RPI CM4 - I2C BUS and Device Tree

Peter Robinson pbrobinson at gmail.com
Sat Aug 17 17:55:28 CEST 2024


Hi,

> I am currently facing an issue with U-Boot and a raspberry pi CM4. Here is
> the setup:
>
>
>
> 1. Yocto Scarthgap
>
> 2. U-Boot 2024.01
>
> 3. rpi_arm64_defconfig
>
>
>
> I am trying to access the i2c bus from U-Boot. I have been trying to modify
> the device tree which is referenced as
> “CONFIG_DEFAULT_DEVICE_TREE="bcm2711-rpi-4-b”” in the defconfig without
> success. I can remove everything, set all nodes to disabled and I see no
> change in U-Boot (I am using dm commands to check the status of the
> peripherals).

What i2c driver are you using in U-Boot?

> It seems that with the rpi, U-Boot will only configure itself against the
> device tree passed by the bootloader of RPI. Could someone confirm this ?

By default, yes that is the case.

> Is there a way to configure / modify U-Boot to use its own devicetree and
> simply pass the device tree generated by the rpi bootloader to the kernel ?

You can do the former, but I believe that DT is then passed to the
kernel, you can't specify differing DTs.

> Because the second issue is that the i2c driver defined in the device tree
> passed to u-boot is not available in u-boot.

Well I think that is the main issue, there's not a driver the RPi i2c
IP in U-Boot, if there was a driver the DT provided by the prior
fimware should then work for what you're trying to do. There's no
driver to date likely because no one has needed to access i2c on the
rpi in U-Boot so it's not been contributed.

Peter


More information about the U-Boot mailing list