[U-Boot] [PATCH 1/4] blackfin: i2c: Missing the patch to define GPIO I2C pins.

From: Sonic Zhang sonic.zhang@analog.com
Signed-off-by: Sonic Zhang sonic.zhang@analog.com --- include/configs/bf533-stamp.h | 48 +++++-------------------------------------- 1 file changed, 5 insertions(+), 43 deletions(-)
diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h index a22c868..26a140e 100644 --- a/include/configs/bf533-stamp.h +++ b/include/configs/bf533-stamp.h @@ -14,6 +14,7 @@ #define CONFIG_BFIN_CPU bf533-0.3 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
+ /* * Clock Settings * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV @@ -37,6 +38,7 @@ /* Values can range from 1-15 */ #define CONFIG_SCLK_DIV 6 /* note: 1.2 boards can go faster */
+ /* * Memory Settings */ @@ -72,42 +74,6 @@ /* #define CONFIG_ETHADDR 02:80:ad:20:31:b8 */
-/* I2C */ -#define CONFIG_SYS_I2C -#define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */ -#define CONFIG_SYS_I2C_SOFT_SPEED 50000 -#define CONFIG_SYS_I2C_SOFT_SLAVE 0 -/* - * Software (bit-bang) I2C driver configuration - */ -#define PF_SCL PF3 -#define PF_SDA PF2 -#define I2C_INIT (*pFIO_DIR |= PF_SCL); asm("ssync;") -#define I2C_ACTIVE (*pFIO_DIR |= PF_SDA); \ - *pFIO_INEN &= ~PF_SDA; asm("ssync;") -#define I2C_TRISTATE (*pFIO_DIR &= ~PF_SDA); \ - *pFIO_INEN |= PF_SDA; asm("ssync;") -#define I2C_READ ((volatile)(*pFIO_FLAG_D & PF_SDA) != 0); \ - asm("ssync;") -#define I2C_SDA(bit) if (bit) { \ - *pFIO_FLAG_S = PF_SDA; \ - asm("ssync;"); \ - } \ - else { \ - *pFIO_FLAG_C = PF_SDA; \ - asm("ssync;"); \ - } -#define I2C_SCL(bit) if (bit) { \ - *pFIO_FLAG_S = PF_SCL; \ - asm("ssync;"); \ - } \ - else { \ - *pFIO_FLAG_C = PF_SCL; \ - asm("ssync;"); \ - } -#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */ - - /* * Flash Settings */ @@ -118,6 +84,7 @@ #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 67
+ /* * SPI Settings */ @@ -165,15 +132,10 @@ /* * I2C Settings */ -#define CONFIG_SYS_I2C_SOFT -#ifdef CONFIG_SYS_I2C_SOFT -#define CONFIG_SYS_I2C +#define CONFIG_SOFT_I2C #define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF3 #define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF2 -#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */ -#define CONFIG_SYS_I2C_SOFT_SPEED 50000 -#define CONFIG_SYS_I2C_SOFT_SLAVE 0 -#endif +
/* * Compact Flash / IDE / ATA Settings

From: Sonic Zhang sonic.zhang@analog.com
Signed-off-by: Sonic Zhang sonic.zhang@analog.com --- include/configs/cm-bf548.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/configs/cm-bf548.h b/include/configs/cm-bf548.h index 3c9eeb5..7f27eda 100644 --- a/include/configs/cm-bf548.h +++ b/include/configs/cm-bf548.h @@ -118,6 +118,8 @@ #define CONFIG_BOOTCOMMAND "run flashboot" #define FLASHBOOT_ENV_SETTINGS "flashboot=bootm 0x20040000\0"
+#define CONFIG_ADI_GPIO2 + #ifndef __ADSPBF542__ /* Don't waste time transferring a logo over the UART */ # if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_UART)

From: Sonic Zhang sonic.zhang@analog.com
Signed-off-by: Sonic Zhang sonic.zhang@analog.com --- arch/blackfin/cpu/gpio.c | 2 +- arch/blackfin/include/asm/gpio.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/blackfin/cpu/gpio.c b/arch/blackfin/cpu/gpio.c index 5e9c68a..86da706 100644 --- a/arch/blackfin/cpu/gpio.c +++ b/arch/blackfin/cpu/gpio.c @@ -12,7 +12,7 @@ #include <asm/gpio.h> #include <asm/portmux.h>
-#ifdef CONFIG_ADI_GPIO1 +#ifndef CONFIG_ADI_GPIO2 #if ANOMALY_05000311 || ANOMALY_05000323 enum { AWA_data = SYSCR, diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index 376ec02..6ebcf01 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h @@ -72,7 +72,7 @@
#ifndef __ASSEMBLY__
-#ifdef CONFIG_ADI_GPIO1 +#ifndef CONFIG_ADI_GPIO2 void set_gpio_dir(unsigned, unsigned short); void set_gpio_inen(unsigned, unsigned short); void set_gpio_polar(unsigned, unsigned short);

From: Sonic Zhang sonic.zhang@analog.com
Signed-off-by: Sonic Zhang sonic.zhang@analog.com --- include/configs/bf506f-ezkit.h | 1 + include/configs/bf525-ucr2.h | 1 + include/configs/bf537-minotaur.h | 1 + include/configs/bf537-srv1.h | 1 + include/configs/blackstamp.h | 1 + include/configs/dnp5370.h | 1 + 6 files changed, 6 insertions(+)
diff --git a/include/configs/bf506f-ezkit.h b/include/configs/bf506f-ezkit.h index 77b6735..5ad3ee7 100644 --- a/include/configs/bf506f-ezkit.h +++ b/include/configs/bf506f-ezkit.h @@ -94,6 +94,7 @@ #define CONFIG_DCACHE_OFF #define CONFIG_UART_CONSOLE 0 #define CONFIG_BAUDRATE 115200 +#define CONFIG_BFIN_SERIAL
#define CONFIG_CMD_MEMORY #undef CONFIG_GZIP diff --git a/include/configs/bf525-ucr2.h b/include/configs/bf525-ucr2.h index 1f65130..008f4b5 100644 --- a/include/configs/bf525-ucr2.h +++ b/include/configs/bf525-ucr2.h @@ -85,6 +85,7 @@ #define CONFIG_UART_CONSOLE 0
#define CONFIG_BAUDRATE 115200 +#define CONFIG_BFIN_SERIAL #define CONFIG_BOOTARGS "root=/dev/mtdblock0 rw" #define CONFIG_BOOTCOMMAND "run sfboot" #define CONFIG_BOOTDELAY 5 diff --git a/include/configs/bf537-minotaur.h b/include/configs/bf537-minotaur.h index feb9d73..156eeab 100644 --- a/include/configs/bf537-minotaur.h +++ b/include/configs/bf537-minotaur.h @@ -136,6 +136,7 @@
#define CONFIG_BAUDRATE 57600 #define CONFIG_UART_CONSOLE 0 +#define CONFIG_BFIN_SERIAL
#define CONFIG_PANIC_HANG 1 #define CONFIG_RTC_BFIN 1 diff --git a/include/configs/bf537-srv1.h b/include/configs/bf537-srv1.h index 1de8ffe..e12d761 100644 --- a/include/configs/bf537-srv1.h +++ b/include/configs/bf537-srv1.h @@ -136,6 +136,7 @@
#define CONFIG_BAUDRATE 115200 #define CONFIG_UART_CONSOLE 0 +#define CONFIG_BFIN_SERIAL
#define CONFIG_PANIC_HANG 1 #define CONFIG_RTC_BFIN 1 diff --git a/include/configs/blackstamp.h b/include/configs/blackstamp.h index 5b3aac7..7de4253 100644 --- a/include/configs/blackstamp.h +++ b/include/configs/blackstamp.h @@ -195,6 +195,7 @@ #define CONFIG_BAUDRATE 57600 #define CONFIG_LOADS_ECHO 1 #define CONFIG_UART_CONSOLE 0 +#define CONFIG_BFIN_SERIAL
/* * I2C settings diff --git a/include/configs/dnp5370.h b/include/configs/dnp5370.h index d0e72e3..4f2c742 100644 --- a/include/configs/dnp5370.h +++ b/include/configs/dnp5370.h @@ -103,6 +103,7 @@ #define CONFIG_DNP5370_EXT_WD_DISABLE 1
#define CONFIG_UART_CONSOLE 0 +#define CONFIG_BFIN_SERIAL #define CONFIG_BAUDRATE 115200 #define CONFIG_BOOTCOMMAND "bootm 0x20030000" #define CONFIG_BOOTARGS "console=ttyBF0,115200 root=/dev/mtdblock3 rootfstype=ext2"

Hello Sonic Zhang,
Am 18.11.2013 08:12, schrieb Sonic Zhang:
From: Sonic Zhangsonic.zhang@analog.com
Signed-off-by: Sonic Zhangsonic.zhang@analog.com
include/configs/bf533-stamp.h | 48 +++++-------------------------------------- 1 file changed, 5 insertions(+), 43 deletions(-)
diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h index a22c868..26a140e 100644 --- a/include/configs/bf533-stamp.h +++ b/include/configs/bf533-stamp.h @@ -14,6 +14,7 @@ #define CONFIG_BFIN_CPU bf533-0.3 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
Not needed, please remove.
/*
- Clock Settings
- CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
@@ -37,6 +38,7 @@ /* Values can range from 1-15 */ #define CONFIG_SCLK_DIV 6 /* note: 1.2 boards can go faster */
Here too...
/*
- Memory Settings
*/ @@ -72,42 +74,6 @@ /* #define CONFIG_ETHADDR 02:80:ad:20:31:b8 */
-/* I2C */ -#define CONFIG_SYS_I2C -#define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */ -#define CONFIG_SYS_I2C_SOFT_SPEED 50000 -#define CONFIG_SYS_I2C_SOFT_SLAVE 0
Why do you remove the soft i2c driver?
-/*
- Software (bit-bang) I2C driver configuration
- */
-#define PF_SCL PF3 -#define PF_SDA PF2 -#define I2C_INIT (*pFIO_DIR |= PF_SCL); asm("ssync;") -#define I2C_ACTIVE (*pFIO_DIR |= PF_SDA); \
*pFIO_INEN&= ~PF_SDA; asm("ssync;")
-#define I2C_TRISTATE (*pFIO_DIR&= ~PF_SDA); \
*pFIO_INEN |= PF_SDA; asm("ssync;")
-#define I2C_READ ((volatile)(*pFIO_FLAG_D& PF_SDA) != 0); \
asm("ssync;")
-#define I2C_SDA(bit) if (bit) { \
*pFIO_FLAG_S = PF_SDA; \
asm("ssync;"); \
} \
else { \
*pFIO_FLAG_C = PF_SDA; \
asm("ssync;"); \
}
-#define I2C_SCL(bit) if (bit) { \
*pFIO_FLAG_S = PF_SCL; \
asm("ssync;"); \
} \
else { \
*pFIO_FLAG_C = PF_SCL; \
asm("ssync;"); \
}
-#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
- /*
*/
- Flash Settings
@@ -118,6 +84,7 @@ #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 67
- /*
*/
- SPI Settings
@@ -165,15 +132,10 @@ /*
- I2C Settings
*/ -#define CONFIG_SYS_I2C_SOFT -#ifdef CONFIG_SYS_I2C_SOFT -#define CONFIG_SYS_I2C +#define CONFIG_SOFT_I2C
NAK. This define is not existent in current mainline code ...
#define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF3 #define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF2 -#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */ -#define CONFIG_SYS_I2C_SOFT_SPEED 50000 -#define CONFIG_SYS_I2C_SOFT_SLAVE 0 -#endif
/*
- Compact Flash / IDE / ATA Settings
bye, Heiko

bHi Heiko,
On Mon, Nov 18, 2013 at 3:49 PM, Heiko Schocher hs@denx.de wrote:
Hello Sonic Zhang,
Am 18.11.2013 08:12, schrieb Sonic Zhang:
From: Sonic Zhangsonic.zhang@analog.com
Signed-off-by: Sonic Zhangsonic.zhang@analog.com
include/configs/bf533-stamp.h | 48 +++++-------------------------------------- 1 file changed, 5 insertions(+), 43 deletions(-)
diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h index a22c868..26a140e 100644 --- a/include/configs/bf533-stamp.h +++ b/include/configs/bf533-stamp.h @@ -14,6 +14,7 @@ #define CONFIG_BFIN_CPU bf533-0.3 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
Not needed, please remove.
/*
- Clock Settings
- CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
@@ -37,6 +38,7 @@ /* Values can range from 1-15 */ #define CONFIG_SCLK_DIV 6 /* note: 1.2 boards can go faster */
Here too...
/*
- Memory Settings
*/ @@ -72,42 +74,6 @@ /* #define CONFIG_ETHADDR 02:80:ad:20:31:b8 */
-/* I2C */ -#define CONFIG_SYS_I2C -#define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */ -#define CONFIG_SYS_I2C_SOFT_SPEED 50000 -#define CONFIG_SYS_I2C_SOFT_SLAVE 0
Why do you remove the soft i2c driver?
You should access GPIO register such via macro bfin_read_XXX other than macro pFIO_XXX directly. So do the macro PFX. They don't exist in head files and cause building failure.
I missed these code are from your patch "soft-i2c: switch to new multibus/multiadapter support". I will try to send a new fix.
Regards,
Sonic Zhang
participants (2)
-
Heiko Schocher
-
Sonic Zhang