fel: add FEL protocol and soc_info_t struct documentation#241
Conversation
Add a markdown document describing the basics of the FEL protocol, to give some idea about the expectations and limitations of the protocol. Also add a description for each member of the soc_info_t struct, and explain how their values should be determined for a new SoC. Signed-off-by: Andre Przywara <osp@andrep.de>
dlan17
left a comment
There was a problem hiding this comment.
This doc is really excellent for people to get overview of soc_info structure, so I realize it's not really necessary to get into too many details which takes extra more efforts, or even we can just leave to improve them later.
| - `name`: A string with the short name of the SoC, like `"A133"` or `"T527"`. | ||
| - `spl_addr`: This is the address where the BootROM(BROM) will load an eGON | ||
| wrapped payload to. Often this is the start of the first SRAM block (SRAM A1), | ||
| though newer SoCs tend to deviate here. This must be the same value where the |
There was a problem hiding this comment.
for "must be the same value", it would be great to emphasis this choice is taken by sunxi-tools's policy for easing maintenance, not restricted by lowlevel BROM protocol, which I mean it's totally ok to download code to any valid address and execute..
There was a problem hiding this comment.
It's not OK to load the U-Boot's SPL to a wrong address because it's not position independent.
| SPL binary to work with any load method. | ||
| The SRAM address(es) should be mentioned in the memory map of the manual, but | ||
| it's best to confirm this by loading a small code snippet from SD card and | ||
| printing the load address. |
There was a problem hiding this comment.
is there any public repo available for that small code which able to print the address? or docs recorded for this
(I remember you shared that when I add fel support for A733..)
| out (set to `false`) for every other SoC. | ||
| - `mmu_tt_addr`: Address of some memory area to hold the page tables during | ||
| the FEL operation. Only needed on older SoCs that enable and require the | ||
| MMU during FEL operation. Can be left out (set to 0) for newer SoCs. |
There was a problem hiding this comment.
It's not needed on old SoCs either. But it provided significantly faster data transfer speed. See the detailed explanations in the following commit messages:
e4b3da2, a275b24, c32eeb8. And also the table at https://linux-sunxi.org/FEL/USBBoot#SoC_support_status
The difference between ~180KB/s and ~900KB/s, observed on H3 was gigantic from the practical point of view, considering the typical sizes of the linux kernel images.
There was a problem hiding this comment.
If you have a H3 you should maybe see if DMA works on it. I get nearly a 100x speed increase with that on H616 and ported the optimizations based on BROM dump analysis.
Add a markdown document describing the basics of the FEL protocol, to give some idea about the expectations and limitations of the protocol.
Also add a description for each member of the soc_info_t struct, and explain how their values should be determined for a new SoC.