1 1
andy_n

u-boot with I2C

Recommended Posts

 

I had it and lost it: u-boot with I2C. I did not write down how I did it (was heavy) :(
Tried to build yourself again: does not work.
u-boot-mizi.bin does not want to boot.

 

For 2 days I try to find the solution. Google has already blocked me ;)

 

Can somebody help? I need i2c directly, after power on, to read FRAM and set relays. 

Programming in Linux is enjoyable but system administration is horrible.

 

Thanks

Share this post


Link to post
Share on other sites
4 hours ago, andy_n said:

 

I had it and lost it: u-boot with I2C. I did not write down how I did it (was heavy) :(
Tried to build yourself again: does not work.
u-boot-mizi.bin does not want to boot.

 

For 2 days I try to find the solution. Google has already blocked me ;)

 

Can somebody help? I need i2c directly, after power on, to read FRAM and set relays. 

Programming in Linux is enjoyable but system administration is horrible.

What am I doing:

 

git clone https://github.com/hsdenx/u-boot-i2c.git

u-boot/make orangepi_zero_defconfig

u-boot/make

 

u-boot/export card=/dev/mmcblk0
u-boot/export p=p
u-boot/dd if=u-boot-sunxi-with-spl.bin of=${card} bs=1024 seek=8

reboot = not booting

 

I'm tried this  with git://git.denx.de/u-boot.git: not working.

 

What am I doing wrong?

 

4 hours ago, andy_n said:

 

Thanks

 

Share this post


Link to post
Share on other sites
18 minutes ago, andy_n said:

What am I doing wrong?

There is no I2C node in DT :  https://github.com/hsdenx/u-boot-i2c/blob/master/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts

 

Also, you probably need to add CONFIG_DM_I2C in this file : https://github.com/hsdenx/u-boot-i2c/blob/master/configs/orangepi_zero_defconfig

 

... and maybe more, such as porting i2c-sun6i-p2wi.c from Kernel into U-Boot ...

Maybe you can try to use software bitbanging using CONFIG_DM_I2C_GPIO ...

Share this post


Link to post
Share on other sites

Thanks martinayotte,

 

I2C was working (in u-boot-mizi.bin not in u-boot-i2c!!!) but SD Card can not boot with Armbian after replacing U-Boot.

Share this post


Link to post
Share on other sites
18 minutes ago, andy_n said:

I2C was working ( in any .bin - I tied so many) but SD Card can not boot with Armbian after replacing U-Boot.

I'm not sure to understand you : do you mean that this "hsdenx" u-boot-i2c is incompatible with Armbian ?

Maybe you should try the Armbian build process and tweak it to met your I2C requirement ...

 

Share this post


Link to post
Share on other sites

Sorry martinayotte,

 

u-boot-i2c  is working but w/o i2c!?

u-boot-mizi.bin has i2c working but not compatible with Armbian (OpenWrt)...

 

Soft i2c in u-boot, is it possible?

 

I've build u-boot with .dts and board.c changes and didn't note how - so stupid.

 

 

 

 

Share this post


Link to post
Share on other sites
33 minutes ago, andy_n said:

Soft i2c in u-boot, is it possible?

Of course, with CONFIG_DM_I2C_GPIO, although I've never tried myself ...

https://github.com/hsdenx/u-boot-i2c/blob/master/drivers/i2c/Kconfig#L66

 

But, then, the i2C DT node would be a bit different since you need to define the GPIO pins been used :

https://github.com/hsdenx/u-boot-i2c/blob/master/doc/device-tree-bindings/i2c/i2c-gpio.txt

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1