-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
AMD mailbox driver support #7270
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the checkpatch issues.
This code is unused, do you plan to upstream code that uses the mailbox driver any time soon?
Add support for the AMD Mailbox Service for use on AMD platforms. The Mailbox Service requires the Local IPI ID as a mandatory input, provided via CFG_MAILBOX_LOCAL_ID. Mailbox initialization for CFG_MAILBOX_LOCAL_ID occurs as a late init service and will be utilized by various drivers to communicate with other firmware. The remote ID will be supplied by different drivers using the mailbox service. Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
bd5d9e9
to
9ab658e
Compare
core/drivers/amd/mailbox_driver.c
Outdated
{ | ||
TEE_Result res = TEE_ERROR_GENERIC; | ||
|
||
cache_operation(TEE_CACHEINVALIDATE, ipi_info.rsp, payload_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, cache_operation()
may return an error code. If never awaited, maybe asserting the return value is enough. That said, I see that almost all callers of that function do not check the return value :(
There are all in core/drivers/...
. Note that if ipi_info.rsp
is NULL, the function would have returned an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me revisit and modify accordingly.
um, isnt this driver just the same than could you comment please? |
Also, if this is an |
Also notice that given the nature of the firmware receiving the requests, mbox requests/responses usually consist of several buffers and the payload and each buffer had alignment requirements. as @jenswi-linaro mentioned, if would be nice to have an example of usage. |
@ldts This driver is meant for a newer AMD Versal Gen 2 family and later versions. This change is having the base infra, more will be added to it later. The use case is different from the the versal platform. |
What do you mean by "more will be added to it later"? Are you referring to additional changes to this mailbox driver under review? This driver is a simplified version of versal_mbox.c, and my concern is that you may eventually need to make it more complex, resulting in something similar to what already exists. |
Add AMD mailbox driver support for AMD Versal Gen 2 platform. Keeping the config CFG_MAILBOX_DRIVER disabled by default. Once a driver using the mailbox service is added and enabled for this platform the configuration to be updated. Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
Address upstream review comments Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
As I mentioned, AMD Versal Gen 2 is new family and the underlying workings are not exactly same as Versal and Versal NET.
Appreciate, will have a look in to those changes as well. |
thanks. but please, do take the time to ask my questions to avoid going in circles. This driver is a simplified version of what we currently have. |
Address error condition cases as per review comments. Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
9ab658e
to
c85d468
Compare
@etienne-lms @jenswi-linaro |
um you made me curious about the IPI Gen2 now, where can I find the PLM code? should it still be in the embeddedsw repo or is it now hosted somwhere else? |
Add support for the AMD Mailbox Service for use on AMD platforms.
The Mailbox Service requires the Local IPI ID as a mandatory input,
provided via CFG_MAILBOX_LOCAL_ID.
Mailbox initialization for CFG_MAILBOX_LOCAL_ID occurs as a late init
service and will be utilized by various drivers to communicate with other
firmware.
The remote ID will be supplied by different drivers using the mailbox
service.