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

Link to post
Share on other sites
Donate and support the project!

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

 

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 ...

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

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...