
Greetings,
I'm working on U-Boot board support for a family of IMX8MM boards and need to support multiple DTB's. My boards have an i2c EEPROM that I need to read to find the model and other specifics before board_fit_config_name_match can do the right thing.
I find that when I enable CONFIG_SPL_MULTI_DTB_FIT I can not access i2c within my board_fit_config_name_match. It would appear that perhaps the heap isn't setup yet as I get a spew of 'alloc space exhausted'.
Any ideas how I can hook a board specific function that can access i2c before the call to board_fit_config_name_match in the SPL?
Best Regards,
Tim

On Fri, Oct 23, 2020 at 11:32 AM Tim Harvey tharvey@gateworks.com wrote:
Greetings,
I'm working on U-Boot board support for a family of IMX8MM boards and need to support multiple DTB's. My boards have an i2c EEPROM that I need to read to find the model and other specifics before board_fit_config_name_match can do the right thing.
I find that when I enable CONFIG_SPL_MULTI_DTB_FIT I can not access i2c within my board_fit_config_name_match. It would appear that perhaps the heap isn't setup yet as I get a spew of 'alloc space exhausted'.
Any ideas how I can hook a board specific function that can access i2c before the call to board_fit_config_name_match in the SPL?
I seem to be stuck with a chicken and egg problem here.
I'm using DM_I2C but that requires that I've processed a device-tree first but my problem is that I need to read an I2C EEPROM before I know what device-tree to use. So how can I do this without disabling DM_I2C for U-Boot? I feel like storing model information in an EEPROM is not that uncommon of a thing.
The 'alloc space exhausted' issue was that malloc space wasn't setup yet as that is done in spl_early_init().
My board family consists of a SOM and a Baseboard. There is 2 variants of the SOM currently both based on IMX8MM but differing in memory and emmc size. There are 4 baseboards the SOM can be married two. EEPROM data tells me which SOM I have (and its memory size) and which baseboard I have.
At some point we wish to add an IMX8MP SOM compatible with the same baseboards but I believe that may mean two different bootloaders as I don't think IMX8MM is runtime compatible with IMX8MP as far as U-Boot is concerned.
Perhaps the best approach is to create a small default dtb for the SOM then handle the baseboard as overlays but I'm not exactly sure how to handle the overlays. Looking at CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY it would appear that overlays are added fairly late in the SPL and not early enough for the SPL to use DM to configure things like SDHC and PMIC.
Any suggestions are greatly appreciated.
Best Regards,
Tim
participants (1)
-
Tim Harvey