Supporting different custom carrier boards with single image

Hey,

we would like to build (slightly) different variants of carrier boards and ideally use a single set of firmware files. From what we can tell, Nvidia seems to have implemented some mechanism for this, e.g. in the MB2 around the cvb_eeprom_read_size.

From what I can find today, the nvidia implementation lives in the GitHub - NVIDIA/edk2-nvidia: NVIDIA EDK2 platform support repo and I’ve found the code reading the Nvidia EEPROMs.

Edit here: I think I’ve NOT found that code. From what I can see most places in the edk2 code do work with the EEPROM, but I’ve not yet identified the code which reads the EEPROM. Files like edk2-nvidia/Silicon/NVIDIA/Drivers/EepromDxe/Eeprom.c, but the EEPROM content comes from a struct found by TEGRA_CPUBL_PARAMS, which is prepopulated? More info on this would be appreciated as well.

Our goal would be to extend this mechanism to dynamically check some hardware presence (e.g. via I2C) and e.g. apply dtb overlays based on the results or do simple boot time tasks like I2C calls to I2C GPIO expanders to enable serial access. Is there some documentation, guidance or pre-existing code to implement this in a way that aligns well with the Nvidia implementations?`

Best regards

Hi,

The UEFI is actually using eeprom-manager in the device tree to read.

You could check the device tree first.

Hey,

I’ve found that section before, though it expects an AT24-compatible EEPROM to work. Using such a EEPROM requires it to be pre-programmed, which we try to avoid, instead we’re often using I2C GPIO expanders + resistor settings to easily read hardware variants and revisions.

But I could not find an example interacting with e.g. an I2C device from “simple” source code. Are there such examples?

Best regards