public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sergey Lapin <slapin@ossfans.org>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [AT91] Problems configuring bit-banged I2C
Date: Sat, 31 May 2008 01:58:03 +0400	[thread overview]
Message-ID: <20080530215803.GA1801@fan.ossfans.org> (raw)
In-Reply-To: <20080524133309.GA6493@game.jcrosoft.org>

> Why don't you use the gpio function?
Well, I tried to use them but that lead to same result.

> > +
> void at91sam9260_i2c_init(void)
> {
> 	at91_set_GPIO_periph(AT91_PIN_PA23, 0);
> 	at91_set_multi_drive(AT91_PIN_PA23, 1);
> 
> 	at91_set_A_periph(AT91_PIN_PA24, 0);
Why?

> 	at91_set_multi_drive(AT91_PIN_PA24, 1);
> }
> 
> void at91sam9260_i2c_scl(unsigned long bit)
> {
> 	at91_set_gpio_value(AT91_PIN_PA24, bit);
> }
> 
> void at91sam9260_i2c_sda(unsigned long bit)
> {
> 	at91_set_gpio_value(AT91_PIN_PA23, bit)
> }
> int at91sam9260_i2c_read(void)
> {
> 	retrun at91_get_gpio_value(AT91_PIN_PA23);
> }
> void at91sam9260_i2c_active()
> {
> 	gpio_direction_output(AT91_PIN_PA23, 0);
> }
> 
> void at91sam9260_i2c_tristate()
> {
> 	gpio_direction_input(AT91_PIN_PA23);
> }
Thanks a lot for your help, but this did not work either.
iprobe returns full 0x0 - 0x7f range as devices.
Linux i2c-gpio works properly and returns proper set of devices (0x68,
0x50). Is it me or there's bug somewhere?
I can see output values with oscilloscope. I wonder what happens.

> 
> I sync it will be better to use the hardware stack which is not too
> complicate to implement

As commented in Linux kernel about i2c_at91, it is very buggy,
and I was afraid that it could not work for me at all. i2c-gpio works
in Linux. What prevents soft i2c from working ont the same CPU?
This stuff is a mystery for me :(

  reply	other threads:[~2008-05-30 21:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23 23:36 [U-Boot-Users] [AT91] Problems configuring bit-banged I2C Sergey Lapin
2008-05-24 13:33 ` Jean-Christophe PLAGNIOL-VILLARD
2008-05-30 21:58   ` Sergey Lapin [this message]
2008-05-24 15:24 ` Haavard Skinnemoen
2008-05-29 21:56   ` Sergey Lapin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080530215803.GA1801@fan.ossfans.org \
    --to=slapin@ossfans.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox