diff mbox

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

Message ID 1384758770-7462-1-git-send-email-sonic.adi@gmail.com
State Superseded
Delegated to: Sonic Zhang
Headers show

Commit Message

Sonic Zhang Nov. 18, 2013, 7:12 a.m. UTC
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(-)

Comments

Heiko Schocher Nov. 18, 2013, 7:49 a.m. UTC | #1
Hello Sonic Zhang,

Am 18.11.2013 08:12, schrieb Sonic Zhang:
> 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
>
> +

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
Sonic Zhang Nov. 18, 2013, 10:20 a.m. UTC | #2
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 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
>>
>> +
>
>
> 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
diff mbox

Patch

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