From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] arm nomadik: add i2c
Date: Tue, 28 Jul 2009 09:51:02 +0200 [thread overview]
Message-ID: <4A6EADE6.4040903@denx.de> (raw)
In-Reply-To: <20090727200408.GC5259@game.jcrosoft.org>
Hello Jean-Christophe,
Jean-Christophe PLAGNIOL-VILLARD wrote:
>> }
>>
>> diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
>> index 3e2e09f..8a83d92 100644
>> --- a/include/configs/nhk8815.h
>> +++ b/include/configs/nhk8815.h
>> @@ -93,7 +93,7 @@
>> #define CONFIG_SYS_GBL_DATA_SIZE 128 /* for initial data */
>> #define CONFIG_SYS_64BIT_VSPRINTF /* mtd desires this */
>>
>> -#define CONFIG_MISC_INIT_R /* call misc_init_r during start up */
>> +#define BOARD_LATE_INIT /* call board_late_init during start up */
>>
>> /* timing informazion */
>> #define CONFIG_SYS_HZ 1000 /* Mandatory... */
>> @@ -110,6 +110,22 @@
>> #define CONFIG_PL01x_PORTS { (void *)CFG_SERIAL0, (void *)CFG_SERIAL1 }
>> #define CONFIG_PL011_CLOCK 48000000
>>
>> +/* i2c, for the port extenders (uses gpio.c in board directory) */
>> +#ifndef __ASSEMBLY__
>> +#include <asm/arch/gpio.h>
> I really do not like to include file from the config
> and it will be difficult to clean up when moving to Kconfig
>> +#define CONFIG_CMD_I2C
>> +#define CONFIG_SOFT_I2C
>> +#define CONFIG_SYS_I2C_SPEED 400000
>> +#define __SDA 63
>> +#define __SCL 62
>> +#define I2C_SDA(x) nmk_gpio_set(__SDA, x)
>> +#define I2C_SCL(x) nmk_gpio_set(__SCL, x)
>> +#define I2C_READ (nmk_gpio_get(__SDA)!=0)
>> +#define I2C_ACTIVE nmk_gpio_dir(__SDA, 1)
>> +#define I2C_TRISTATE nmk_gpio_dir(__SDA, 0)
>> +#define I2C_DELAY (udelay(2))
> it will better to define a couple of generic function where we implement it
> as this
> i2c_sda()
> i2c_scl()
> i2c_read()
> i2c_activate()
> i2c_tristate()
> i2c_delay()
> i2c_get_bus_num()
> i2c_set_bus_num()
> i2c_get_bus_speed()
> i2c_set_bus_speed()
> i2c_init()
I posted such a suggestion in this thread, see:
http://lists.denx.de/pipermail/u-boot/2009-July/056934.html
I got no responses for this suggestion, so I talked with Wolfgang,
and he convinced me, that this is not necessary.
bye
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2009-07-28 7:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0e975ff141a9923b58859fad00cf3df664f2fe04.1248427487.git.rubini@unipv.it>
2009-07-28 9:41 ` [U-Boot] [PATCH v2 1/2] arm nomadik: add gpio support Jean-Christophe PLAGNIOL-VILLARD
2009-07-28 10:37 ` Heiko Schocher
[not found] ` <0b10781c46b757737db8ff5e49c2b8b745c9f269.1248427487.git.rubini@unipv.it>
2009-07-27 9:45 ` [U-Boot] [PATCH v2 2/2] arm nomadik: add i2c Heiko Schocher
2009-07-27 20:04 ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-27 20:22 ` Wolfgang Denk
2009-07-28 7:51 ` Heiko Schocher [this message]
2009-07-28 9:24 ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-28 9:41 ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-28 10:26 ` Heiko Schocher
2009-07-28 10:37 ` Heiko Schocher
2009-07-24 9:27 [U-Boot] [PATCH v2 1/2] arm nomadik: add gpio support Alessandro Rubini
[not found] ` <0e975ff141a9923b58859fad00cf3df664f2fe04.1248427487.git.rubini @unipv.it>
2009-07-24 9:27 ` [U-Boot] [PATCH v2 2/2] arm nomadik: add i2c Alessandro Rubini
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=4A6EADE6.4040903@denx.de \
--to=hs@denx.de \
--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