Srinirajini
Posts: 8
Joined: Fri Oct 05, 2018 4:17 am

Does uboot has I2c drivers for Raspberry Pi CM3

Mon Oct 22, 2018 11:22 am

Dear All,
I wonder do we need to write/port I2C driver for Raspberry Pi CM3 for u-boot because under the u-boot menuconfig option I could not see any I2C driver relating to Raspberry, I had blindly enabled the I2C command and tried to access the bus but nothing has turned out. My u-boot version is "u-boot-2018.09"

U-Boot>
No I2C bus selected
Current bus is -1
U-Boot>


I had verified the pinctrl driver module which has been enabled for bcm283x device, but I am not clear whether we need to enable the bcm2835 pin control device please help me clarify. finally, my goal is to use the I2C Bus from U-boot to control my I2c Chip device.

By the way the configuration that I am using for building the u-boot is "rpi_3_32b_defconfig" and with this configuration I could do everything else except accessing the I2C Bus, even after the kernel boot, I could access the I2C device using the command "i2cdetect - y 1" , so I doubt whether the device tree "bcm2837-rpi-3-b.dts" loaded by the default configuration is correct or not?, At kernel I tried inserting the i2c_bcm2835 and i2c_dev modules manually, but still the bus is not created under the /dev/
I have enabled the I2C device tree param to "ON" (dtparam=i2c_arm=on ) in /boot/config file , Please provide some pointer

Thanks In Advance.
Srini.

W. H. Heydt
Posts: 9050
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Does uboot has I2c drivers for Raspberry Pi CM3

Mon Oct 22, 2018 3:06 pm

I would suggest asking this question on whatever support forums exist for u-boot.

drgeoff
Posts: 8611
Joined: Wed Jan 25, 2012 6:39 pm

Re: Does uboot has I2c drivers for Raspberry Pi CM3

Mon Oct 22, 2018 3:23 pm

Have I been labouring for years under these two misapprehensions?

1. uboot is not an Operating System. It is a bootloader - some code that loads and starts an OS.

2. Drivers run as part of or on top of the OS.

Srinirajini
Posts: 8
Joined: Fri Oct 05, 2018 4:17 am

Re: Does uboot has I2c drivers for Raspberry Pi CM3

Tue Oct 23, 2018 10:33 am

drgeoff wrote:
Mon Oct 22, 2018 3:23 pm
Have I been labouring for years under these two misapprehensions?

1. uboot is not an Operating System. It is a bootloader - some code that loads and starts an OS.

2. Drivers run as part of or on top of the OS.
Firstly, thanks for the response, and I completely agree with your point that the u-boot is the minimal initial code that load and execute the kernel, but then I believe even the bootlader can support accessing peripherals of the system. and I could see from the u-boot terminal that it list all other devices either through Pincontrol subsystem or through individual driver model. but I wonder why only the I2C is missing. also, my concern is if I load the same kernel which is properly probing the I2C bus, if loaded and executed straight away by the "start.elf" which is not probing the I2C bus if loaded through u-boot.
Any Idea pointer is greatly appreciated.

Regards,
Srini.

epoch1970
Posts: 2075
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Does uboot has I2c drivers for Raspberry Pi CM3

Tue Oct 23, 2018 12:58 pm

IIRC the DT passed by the pi bootloader is used as is, unless you actively replace it with your own (with the "dt" commands available in u-boot)
I tend to believe the issue might be in u-boot's code instead.

I would try with one of the repos owned by Alexander Graf, https://github.com/agraf/u-boot/
He is the current u-boot maintainer for the RPI platform, his tree gets merged upstream but I've had denx releases fail where agraf's would work.

Personally I am using agraf's "rpi-stable" branch and have no experience with i2c.
There is an "rpi-next" branch that is more recent, but the current effort seems to be around 64-bit u-boot with EFI support.

Good luck.
PS: I you have any practical experience to share about LED control on Pi 3 within u-boot, I'd be keen on a few hints ;)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Srinirajini
Posts: 8
Joined: Fri Oct 05, 2018 4:17 am

Re: Does uboot has I2c drivers for Raspberry Pi CM3

Wed Oct 24, 2018 1:30 am

epoch1970 wrote:
Tue Oct 23, 2018 12:58 pm
IIRC the DT passed by the pi bootloader is used as is, unless you actively replace it with your own (with the "dt" commands available in u-boot)
I tend to believe the issue might be in u-boot's code instead.

I would try with one of the repos owned by Alexander Graf, https://github.com/agraf/u-boot/
He is the current u-boot maintainer for the RPI platform, his tree gets merged upstream but I've had denx releases fail where agraf's would work.

Personally I am using agraf's "rpi-stable" branch and have no experience with i2c.
There is an "rpi-next" branch that is more recent, but the current effort seems to be around 64-bit u-boot with EFI support.

Good luck.
PS: I you have any practical experience to share about LED control on Pi 3 within u-boot, I'd be keen on a few hints ;)
Thank you so much for pointer let me try with Alexander Graf's repo probably "RPI_Stable", and try to explore I2C, even I need to start with LED from u-Boot using Pinctrl, that's propriety next to the I2C access. sure I will give you an update on led as soon as work on it.

Srinirajini
Posts: 8
Joined: Fri Oct 05, 2018 4:17 am

Re: Does uboot has I2c drivers for Raspberry Pi CM3

Wed Oct 24, 2018 2:44 am

No Luck I tried most of the different branches but I2C is not working in none of the branches for Raspberry "rpi_3_32b_defconfig" configuration, I notice gpio staus of the Pin 2 and 3 is not assigned with Function Alterative_0 rather it is kept open as General I/O pin. I am checking with pinctrl drivers, let me update if I get through. meantime if anybody could help, please provide suggestions.

Thanks,

Return to “Advanced users”