Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 65 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ members = [
"platform/ihv1-sp",
"platform/qemu-sp",
"aarch64-haf",
"sp-mctp-framer",
]

[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.92"

[workspace.dependencies]
aarch64-cpu = "10.0.0"
Expand All @@ -33,12 +35,14 @@ espi-device-stub = { path = "espi-device-stub" }
odp-ffa = { path = "odp-ffa" }
hafnium = { path = "hafnium" }
log = { version = "0.4", default-features = false }
mctp-rs = { git = "https://github.com/dymk/mctp-rs", rev = "3d941ba5205ca7781bf37e3dc7c5dfdc99a082d6", default-features = false }
mockall = "0.13.1"
num_enum = { version = "0.7.3", default-features = false }
num_enum = { version = "0.7.4", default-features = false }
num-traits = { version = "0.2.19", default-features = false }
subenum = { version = "1.1.2", default-features = false }
uuid = { version = "1.0", default-features = false, features = ["v1"] }
rstest = "0.26.1"
pretty_assertions = "1.4.1"

[workspace.lints.clippy]
suspicious = "deny"
Expand Down
1 change: 1 addition & 0 deletions aarch64-haf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "aarch64-haf"
version = "0.1.0"
edition = "2024"
rust-version.workspace = true
license = "MIT"
authors = ["Dylan Knutson <dylanknutson@microsoft.com>"]
description = "AArch64 HAL for Hafnium"
Expand Down
1 change: 1 addition & 0 deletions dev-hooks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "dev-hooks"
version = "0.1.0"
edition = "2021"
rust-version.workspace = true
publish = false
description = "Git hooks setup (husky-rs); not published"
license = "MIT"
Expand Down
1 change: 1 addition & 0 deletions ec-service-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "ec-service-lib"
categories = ["embedded", "no-std"]
version = "0.1.0"
edition = "2021"
rust-version.workspace = true
license = "MIT"
description = "Provides standard EC services to OS"
readme = "README.md"
Expand Down
1 change: 1 addition & 0 deletions espi-device-stub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "espi-device-stub"
version = "0.1.0"
edition = "2021"
rust-version.workspace = true
authors = ["Dylan Knutson <dylanknutson@microsoft.com>"]
license = "MIT"
description = "Stub implementation of the eSPI driver"
Expand Down
1 change: 1 addition & 0 deletions espi-device/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "espi-device"
version = "0.1.0"
edition = "2021"
rust-version.workspace = true
description = "eSPI device driver interface"
license = "MIT"
authors = ["Dylan Knutson <dylanknutson@microsoft.com"]
Expand Down
1 change: 1 addition & 0 deletions platform/ihv1-sp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "ihv1-ec-sp"
version = "0.1.0"
edition = "2021"
rust-version.workspace = true
license = "MIT OR Apache-2.0"
description = "Sample Embedded Controller Secure Partition Service"
authors = ["Phil Weber <philweber@microsoft.com>"]
Expand Down
1 change: 1 addition & 0 deletions platform/qemu-sp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "qemu-ec-sp"
version = "0.1.0"
edition = "2021"
rust-version.workspace = true
license = "MIT OR Apache-2.0"
description = "QEMU Embedded Controller Secure Partition Service"
authors = ["Phil Weber <philweber@microsoft.com>"]
Expand Down
1 change: 1 addition & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[toolchain]
channel = "1.92.0"
components = ["rust-src", "llvm-tools-preview", "rustfmt", "rust-analyzer"]
targets = ["aarch64-unknown-none-softfloat"]
29 changes: 29 additions & 0 deletions sp-mctp-framer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "sp-mctp-framer"
version = "0.1.0"
edition = "2021"
rust-version.workspace = true
license = "MIT"
description = "SP-side MCTP framer over SmbusEspiMedium for SP↔EC interop"
repository = "https://github.com/OpenDevicePartnership/odp-secure-services"
readme = "README.md"
keywords = ["mctp", "smbus", "no-std", "embedded", "sp"]
categories = ["embedded", "no-std"]

[features]
# Re-export Phase 12 golden capture fixtures for downstream test suites
# (e.g. `mod/secure-services/platform/src/mctp_ping.rs` host tests). Keeps
# the wire-format goldens in a single place — see lib.rs::test_fixtures.
test-fixtures = []

[dependencies]
mctp-rs.workspace = true

[dev-dependencies]
pretty_assertions.workspace = true

[lints]
workspace = true

[package.metadata.docs.rs]
all-features = true
30 changes: 30 additions & 0 deletions sp-mctp-framer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# sp-mctp-framer

SP-side MCTP framer over `SmbusEspiMedium`. Encodes ODP-relay requests and
decodes ODP-relay responses byte-for-byte against EC's
`embedded-services::uart-service` framing. Service-agnostic — caller
supplies `service_id`, `message_id`, and the per-service payload bytes.

## Usage

```rust
use sp_mctp_framer::{encode_request, decode_response};

const BATTERY_SVC_ID: u8 = 0x08;
const BATTERY_GETSTA_MSG_ID: u16 = 15;

let mut tx = [0u8; 32];
let n = encode_request(&mut tx, BATTERY_SVC_ID, BATTERY_GETSTA_MSG_ID, &[/* battery_id */ 0])?;
// transmit tx[..n] over the wire ...
let resp = decode_response(&rx[..])?;
```

Runtime path uses only stack/static buffers (no heap). Maximum per-service
payload is `MAX_PAYLOAD_LEN` bytes — larger payloads return `BufTooSmall`.

## Features

- `test-fixtures` — re-export captured ping-pong wire bytes
(`PHASE_12_TX_18B`, `PHASE_12_RX_13B`) for downstream test crates.
These are the captured Battery::GetSta ping-pong from QEMU SBSA spike-up
and serve as the reference for both encode and decode validation.
Loading
Loading