Re: [PATCH v6 1/7] Add documentation for Sahara protocol
Kishore Batta <[email protected]> Mon, 13 Jul 2026 12:50:00 +0530
| Newsgroups | dev.linux.lists.mhi,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 7/8/2026 10:16 AM, Randy Dunlap wrote: > On 7/1/26 3:37 AM, Kishore Batta wrote: >> +The packet flow sequence is as follows : >> + >> +1. The target sends the hello packet to the host to initiate the protocol >> + with the mode set to image transfer pending. >> + >> +2. The host sends a hello response packet with a success status and sets the >> + mode to image transfer pending after it receives the hello packet and >> + validates the protocol version running on the target. >> + >> +3. After the target receives the hello response, it initiates the data >> + transfer by requesting the size of DDR training/calibration data. >> + >> +4. The host sends back the DDR training/calibration data to the target. >> + >> +5. The target decodes the training data and does not find valid DDR >> + calibration data, target sends END_IMAGE_TX to interrupt the transfer. >> + >> +6. The host sends DONE after receives END_IMAGE_TX. >> + >> +7. The target sends DONE_RESP with mode = IMAGE_TX_PENDING because it has >> + not received all images. >> + >> +8. The target executes DDR training process to generate valid DDR calibration >> + data and prepares to push back to host. >> + >> +9. The target initiates protocol by sending a hello packet with COMMAND_MODE >> + to the host. >> + >> +10. The host sends a hello response packet with a success status and sets the >> + mode to COMMAND_MODE. >> + >> +11. The target sends CMD_READY to the host. >> + >> +12. The host receives CMD_READY and starts to get command IDs to be executed. >> + >> +13. The target sends CMD_ID = 9 to push DDR calibration data to host. >> + >> +14. The host executes CMD_ID = 9 to get DDR calibration data from the target. >> + >> +15. The target sends RAW_DATA with the payload which contains DDR calibration >> + data to host. >> + >> +16. The host saves training data in the kernel buffer and exposes to userspace >> + via the sysfs entry. The host sends CMD_SWITCH_MODE with the mode set to >> + IMAGE_TX_PENDING to continue booting. >> + >> +17. After the target receives the CMD_SWITCH_MODE command, it sends HELLO to >> + the host with the mode set to IMAGE_TX_PENDING. The target and the host >> + repeat the packet flow for image transfer to get all booting-required >> + images. >> + >> +18. Upon successful transfer of all images, the target sends an END_IMAGE_TX >> + packet with a success status to the host. >> + >> +19. The host sends DONE after it receives END_IMAGE_TX. >> + >> +20. The target sends DONE_RESP with the mode set to IMAGE_TX_COMPLETE because >> + it has received all images. The process has been completed after the host >> + receives DONE_RESP with the mode set to IMAGE_TX_COMPLETE. >> + >> +Subsequent boot scenario with valid DDR calibration data >> +-------------------------------------------------------- >> + >> +The below firgure shows the subsequent boot scenario with valid DDR calibration >> +data process being loaded from host to target. >> + >> +.. code-block:: text >> + >> + Host Target >> + | HELLO | >> + | (mode = image transfer) | >> + |<--------------------------| >> + | | >> + | HELLO RESP | >> + | (mode = image transfer) | >> + |-------------------------->| >> + | | >> + | READ_DATA | >> + | (img ID:34, 0, offset, | >> + | size of DDR training data)| >> + |<--------------------------| >> + | | >> + | RAW_DATA | >> + |(size of DDR training data)| >> + |-------------------------->| >> + | | >> + | | >> + | END_IMAGE_TX | >> + |<--------------------------| >> + | | >> + | | >> + | DONE | >> + |-------------------------->| >> + | | >> + | | >> + | DONE_RESP | >> + | (mode = IMAGE_TX_PENDING) | >> + |<--------------------------| >> + | | >> + | Subsequent boot scenario | >> + | (valid calibration data) | >> + | DDR driver configures DDR | >> + | using valid calibration | >> + | data | >> + | | >> + | | >> + | HELLO | >> + | (mode = IMAGE_TX_PENDING) | >> + |<--------------------------| >> + | | >> + | HELLO RESP | >> + | (mode = IMAGE_TX_PENDING) | >> + |-------------------------->| >> + | | >> + | Boot/Load rest of the | >> + | images.... | >> + | | >> + | END_IMAGE_TX | >> + |<--------------------------| >> + | | >> + | | >> + | DONE | >> + |-------------------------->| >> + | | >> + | | >> + | DONE_RESP | >> + |(mode = IMAGE_TX_COMPLETE) | >> + |<--------------------------| >> + | | >> + >> +The packet flow is as follows : >> + > s/as follows :/as follows:/ > in 2 places. ACK. I'll remove the extra space before the colon in both places in the next version. > >> +1. The target sends the hello packet to the host to initiate the protocol >> + with the mode set to image transfer pending.