Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User space interface for DMA and Mailbox #75

Merged
merged 6 commits into from
Jan 10, 2025
Merged

Conversation

mlvisaya
Copy link
Collaborator

@mlvisaya mlvisaya commented Jan 2, 2025

No description provided.

@mlvisaya mlvisaya force-pushed the mlvisaya/image-loading branch 2 times, most recently from 60b23bd to edc2136 Compare January 3, 2025 18:45
@mlvisaya mlvisaya marked this pull request as ready for review January 3, 2025 19:02
runtime/apps/apis/dma/src/lib.rs Outdated Show resolved Hide resolved
runtime/apps/apis/mailbox/src/lib.rs Outdated Show resolved Hide resolved
@mlvisaya mlvisaya force-pushed the mlvisaya/image-loading branch from a3bc7ce to 60ddd87 Compare January 7, 2025 22:37
Copy link
Collaborator

@helloxiling helloxiling left a comment

Choose a reason for hiding this comment

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

@mlvisaya, please take a look at latest mainline change: ae37e04 add mctp userspace lib support (#76). We prefer a single package libtock_caliptra for userland APIs. Please adjust for consistency.

Added user APIs for DMA and mailbox

The DMA API allows for AXI-to-AXI transfers or from local buffer to an
AXI component.

The Mailbox API allows for executing a mailbox command in an atomic
fashion, i.e. execute command, wait for response, return response.
@mlvisaya mlvisaya force-pushed the mlvisaya/image-loading branch from 521d58b to 808c333 Compare January 8, 2025 19:34
Use TockSubscribe while passing buffers with the required permission
Add tock API to pass ro and rw buffers for the mailbox use case
@mlvisaya
Copy link
Collaborator Author

mlvisaya commented Jan 8, 2025

@helloxiling , thanks I updated this PR now to be consistent with Flash and MCTP implementations

#[derive(Debug, Clone)]
pub enum DMASource<'a> {
/// A memory address as the source.
Address(u64),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this an AXI address or a local memory address (which would be a u32)?

It might be good to have a separate type for AXI addresses so that we don't mix them up. Something like pub type AxiAddr(u64); or pub type AxiAddr = u64.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it is Axi address. good point, I can create a new type for AxiAddr

Copy link
Collaborator

@swenson swenson left a comment

Choose a reason for hiding this comment

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

LGTM

@mlvisaya
Copy link
Collaborator Author

Thank you!

@mlvisaya mlvisaya merged commit 9077cb2 into main Jan 10, 2025
1 check passed
@mlvisaya mlvisaya deleted the mlvisaya/image-loading branch January 10, 2025 18:28
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.

3 participants