Skip to content

Conversation

@embediver
Copy link
Collaborator

Implements the following model for a MCTP Driver:

┌─────────────────┐ ┌─────────────────┐
│   Application   │ │      MCTP       │
│     (PLDM,      │ │     Control     │
│       ...)      │ │     Protocol    │
└─────────────────┘ └─────────────────┘
│     mctp-rs     │ │     mctp-rs     │
│ based interface │ │ based interface │
┌─────────────────┐ ┌─────────────────┐
│    MCTP-API     │ │    MCTP-API     │
└─────────────────┘ └─────────────────┘
              |          |
             IPC        IPC      --- IDOL definition
            	|          |
          ┌─────────────────┐
          │   MCTP-Router   │
          │┌───────────────┐│
          ││  generic MCTP ││
          ││  router impl  ││
          │└───────────────┘│
          └─────────────────┘
          │      trait      │
          │ based interface │
          │  for transport- │
          │     binding     │
          ┌─────────────────┐    -----
          │    driver API   │     Defined by drivers
          │(UART, I2S, ...) │
          └─────────────────┘
                  |
                 IPC
                  |
          ┌─────────────────┐
          │ Hardware Driver │
          │ (UART, I2C, ...)│
          └─────────────────┘

The core MCTP stack is still missing, but the scaffold and IDOL definitions are already implemented.

LeeTroy and others added 15 commits July 31, 2025 02:22
1. Build the firmware image:
```
$ cargo xtask dist app/ast1060-starter/app.toml
$ gen_uart_booting_image.sh target/ast1060-starter/dist/default/final.bin \
                            target/ast1060-starter/dist/default/uart_final.bin
```

2. Using uart_final.bin for boot from UART.

3. Using humility over jtag to verify
```
$ humility -e env.json -t ast1060 tasks
humility: attached via JLink
system time = 114057
ID TASK                       GEN PRI STATE
 0 jefe                         0   0 recv, notif: fault timer(T+43)
 1 idle                         0   5 RUNNING

$ humility -e env.json -t ast1060 stackmargin
humility: attached via JLink
ID TASK                STACKBASE  STACKSIZE   MAXDEPTH     MARGIN
 0 jefe               0x21000          1536        272       1264
 1 idle               0x20c00           256        104        152

```
Note: the humility has some bug in gdb connection.

TODO:
- Adding Secure Boot Header within final.bin
- JTAG halt at main configured by features

Signed-off-by: Troy Lee <[email protected]>
Signed-off-by: Troy Lee <[email protected]>
@embediver embediver requested a review from rusty1968 September 11, 2025 19:12
@rusty1968
Copy link
Collaborator

@embediver , this needs to go into the OpenPRoT/hubris repo.

@@ -0,0 +1,73 @@
// MCTP-Router IPC interface
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must add the license information here. We are not changing the kernel code, perhaps this could be the APL2.0

@@ -0,0 +1,22 @@
[package]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same license comment goes to all the new files. Perhaps this is not top priority right now.

* Implement send and recv(wip)

* Handling of mctp recv calls

* Implement update and timeout functionality

* Update mctp-lib
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 25, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

* add mctp serial transport binding

Signed-off-by: leongross <[email protected]>

* wip

* use ast1060 uart lib for uart

Signed-off-by: leongross <[email protected]>

---------

Signed-off-by: leongross <[email protected]>
Signed-off-by: Marvin Gudel <[email protected]>
Co-authored-by: leongross <[email protected]>
@embediver embediver requested a review from rusty1968 September 25, 2025 17:58
@embediver embediver marked this pull request as ready for review September 25, 2025 17:59
@embediver
Copy link
Collaborator Author

Changed it to ready, since the implementation is complete at this point.

Still some testing to do and some minor cleanups like the license headers.

let mut recv_buf = [0; 255];

loop {
let (_, _, msg, mut resp) = listener.recv(&mut recv_buf).unwrap_lite();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lifetime of the response channel is tied to the recv call. When integrating with spdm-lib we have a deferred processing flow.

@molssongroup
Copy link

/easycla

…quests/listeners

Responses now only have a bound on the MCTP stack,
making them independend from the originating listener.

Missing drop routines for `request` and `response` handles have
been added, freeing the resources in the MCTP driver.

Signed-off-by: Marvin Gudel <[email protected]>
- Fix multiple bugs related to ipc and uart
- Fix sending of responses and cleanup

Signed-off-by: Marvin Gudel <[email protected]>
@embediver embediver requested a review from rusty1968 October 2, 2025 13:04
@embediver
Copy link
Collaborator Author

The listener/response echo example is now working and we are writing up a little guide on how to run this.

@embediver embediver marked this pull request as draft November 3, 2025 15:02
@mynetz
Copy link

mynetz commented Nov 4, 2025

This PR has been obsoleted with #11

@mynetz mynetz closed this Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants