-
Notifications
You must be signed in to change notification settings - Fork 7.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
drivers: firmware: scmi: add optional crc #86347
drivers: firmware: scmi: add optional crc #86347
Conversation
Hello @AndreHeinemans-NXP, and thank you very much for your first pull request to the Zephyr project! |
de53e5e
to
2a78a31
Compare
c4326d1
to
0d87b9d
Compare
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.
Enabling CRC by default in Zephyr effectively breaks all upstream applications counting on the fact that it's disabled (e.g: SOF, CC: @yangbolu1991 this might affect you as well). Apart from that, you're enabling a feature which you arguably don't need for your application.
IMO this can be solved by updating the documentation (i.e: https://docs.zephyrproject.org/latest/boards/nxp/imx95_evk/doc/index.html) to tell people which configuration requires CRC and which doesn't. I can just as fine run "Hello, world" using ALT config without changing anything on Zephyr-side.
For i.mx95, crc was disabled in mx95alt.cfg, which used for m7 tests. But I'm not sure if there are any cases requiring CRC. If so, I think it should be documented. |
0d87b9d
to
4eada1f
Compare
21efab8
to
dea3547
Compare
@AndreHeinemans-NXP @PetervdPerk-NXP Would this work for you? Looks like CRC is disabled with newer configurations. |
dea3547
to
51d08a8
Compare
@dbaluta, @LaurentiuM1234 , |
In principle, I agree with this PR. It is clean enough to not touch the SCMI core and by default the check is disabled and only activated in specific scenarios. Will need to get an Ack from @LaurentiuM1234 and we can merge it. |
Thanks this patch allows me to use Zephyr on the IMX95-EVK, I tried before but couldn't even get hello world to show up till this patch. |
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.
Actually NXP uses two of the SCMI SMT “implementation defined” words, it is res1[2] in the code, the first one holds the status that indicate if CRC is being used and which algorithm is used, and the second one is the CRC. so we need to check first word firstly and then decide use CRC or not, and also decide which CRC algorithm is used. so that the driver will be compatible for all SM firmware with CRC enabled or not.
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.
as @JiafeiPan pointed out, res1[0]
holds the CRC type (algorithm) used and if CRC is enabled. We can use this to dynamically check if CRC is enabled/disabled and which algorithm to use. This way, we can have the CRC NXP vendor extension enabled by default, thus allowing people to use whatever SM configuration they want.
01c58ac
51d08a8
to
01c58ac
Compare
Thanks for pointing this out. It's a perfect solution. I reworked all the comments. |
An option is added to allow vendor specific processing at scmi_shmem_write_message() and scmi_shmem_read_message(). Additionally code has been added specific to NXP which has some extended validation features. Signed-off-by: Andre Heinemans <andre.heinemans@nxp.com>
01c58ac
to
e6883ad
Compare
Hi @AndreHeinemans-NXP! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
An option is added to validate incomming and outgoing SCMI messages on shared memory.
This is needed especially for the imx95_evk/mimx9596/m7 which is used in combination with imx-sm on the M33 core. The imx-sm software uses CRC on SCMI by default. It will be easier to start with this target because it works with the sdcard image that comes with the evk.