Accessing I2C salve IC in UEFI bootloader

Hell Nvidia team,

we are using Orin nano(8GB) with custom carrier board, with L4T 36.3.

we are using as I2C IO-expander which we need to access from UEFI bootlaoder for writing some value to reset particular IC.
so please suggest us any possible ways to achieve this.

Hi bharath.gk,

Which I2C IO-expander module you are using? I suppose that you need the custom driver to work with your IO-expander.
Have you tried to do that in kernel driver?

Do you get UEFI source for R36.3.0 and you can build it successfuly?

Hi @KevinFFF

MAX7313ATG+T is the io expander we use. please suggest us how we achieve this at UEFI level.

From kernel we have not controlling from driver, but direct i2c-read-write apis we are using from user level.

yes source code and able to customize already as @KevinFFF
suggested here Remove boot logo and add boot progress bar - #15 by bharath.gk

I would suggest using kernel driver to init/control your I2C device.

But you can also refer to the following thread to use I2C in UEFI as your requirement.
Need Uefi to send commands to an I2C device - #5 by KevinFFF

1 Like

thank you @KevinFFF ,
we will verify and come back to you.

Hello @KevinFFF ,

could you please provide any steps/link to stop boot at UEFI bash to check available command support.

You can select UEFI shell as boot device in UEFI menu.

hi @KevinFFF ,
w.r.t to i2c slave access in UEFI level, we are following this reference , here we are nit able to identify the bus number. its uses EFI_I2C_IO_PROTOCOL,

our requirement is to access a salve ic 0x20 in i2c-1 device.
any suggestions here?

I think &Register is the I2C address of RTC module in the example you are referring.
edk2-nvidia/Silicon/NVIDIA/Library/MaximRealTimeClockLib/MaximRealTimeClockLib.h at main · NVIDIA/edk2-nvidia · GitHub

hello @KevinFFF , we stuck at GUID for Maxim7313, while following similar implementation for maxim7313 IO expander access from UEFI by referring other imlementaion for maxim IC’s which we shared in previous post,

we may have to add similar kind of support in BpmpI2cDxe.c

GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gNVIDIAI2cMaxim20024 = { 0xa7f8c208, 0xbe90, 0x4363, { 0x84, 0xc5, 0x1c, 0xc9, 0xed, 0x04, 0xe7, 0x19 } };

we need similar kind GUID for Maxim7313 too, we found above GUID for Maxim20024 in some AutoGen.c,

kindly please suggest where do we need to add that GUID’s and where do we get from.

FYI: we already asked for IC vendor for GUID, they suggested to check in linux driver linux/drivers/gpio/gpio-pca953x.c at main · analogdevicesinc/linux · GitHub but we not found suck guid anywhere.