[U-Boot] [PATCH] da830 evm: Fix checkpatch error on 'pinmux' macro

2010-07-06 Thread Prakash PM
Existing code returns checkpatch error on pinmux macro definition for
not enclosing the definition in parenthesis. The error can be observed in
the patch generated from commit id bdc9c6c7f77a9a63349ecb9f54b20ad34033a2ae.
So macro implementation is modified to fix the error.

Signed-off-by: Prakash PM prakash...@ti.com
---
 board/davinci/da8xxevm/da830evm.c |   68 ++--
 1 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/board/davinci/da8xxevm/da830evm.c 
b/board/davinci/da8xxevm/da830evm.c
index 57506d6..6baa860 100644
--- a/board/davinci/da8xxevm/da830evm.c
+++ b/board/davinci/da8xxevm/da830evm.c
@@ -45,63 +45,63 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define pinmux davinci_syscfg_regs-pinmux
+#define pinmux(x)  (davinci_syscfg_regs-pinmux[x])
 
 /* SPI0 pin muxer settings */
 static const struct pinmux_config spi0_pins[] = {
-   { pinmux[7], 1, 3 },
-   { pinmux[7], 1, 4 },
-   { pinmux[7], 1, 5 },
-   { pinmux[7], 1, 6 },
-   { pinmux[7], 1, 7 }
+   { pinmux(7), 1, 3 },
+   { pinmux(7), 1, 4 },
+   { pinmux(7), 1, 5 },
+   { pinmux(7), 1, 6 },
+   { pinmux(7), 1, 7 }
 };
 
 /* EMIF-A bus pins for 8-bit NAND support on CS3 */
 static const struct pinmux_config emifa_nand_pins[] = {
-   { pinmux[13], 1, 6 },
-   { pinmux[13], 1, 7 },
-   { pinmux[14], 1, 0 },
-   { pinmux[14], 1, 1 },
-   { pinmux[14], 1, 2 },
-   { pinmux[14], 1, 3 },
-   { pinmux[14], 1, 4 },
-   { pinmux[14], 1, 5 },
-   { pinmux[15], 1, 7 },
-   { pinmux[16], 1, 0 },
-   { pinmux[18], 1, 1 },
-   { pinmux[18], 1, 4 },
-   { pinmux[18], 1, 5 },
+   { pinmux(13), 1, 6 },
+   { pinmux(13), 1, 7 },
+   { pinmux(14), 1, 0 },
+   { pinmux(14), 1, 1 },
+   { pinmux(14), 1, 2 },
+   { pinmux(14), 1, 3 },
+   { pinmux(14), 1, 4 },
+   { pinmux(14), 1, 5 },
+   { pinmux(15), 1, 7 },
+   { pinmux(16), 1, 0 },
+   { pinmux(18), 1, 1 },
+   { pinmux(18), 1, 4 },
+   { pinmux(18), 1, 5 },
 };
 
 /* EMAC PHY interface pins */
 static const struct pinmux_config emac_pins[] = {
-   { pinmux[9], 0, 5 },
-   { pinmux[10], 2, 1 },
-   { pinmux[10], 2, 2 },
-   { pinmux[10], 2, 3 },
-   { pinmux[10], 2, 4 },
-   { pinmux[10], 2, 5 },
-   { pinmux[10], 2, 6 },
-   { pinmux[10], 2, 7 },
-   { pinmux[11], 2, 0 },
-   { pinmux[11], 2, 1 },
+   { pinmux(9), 0, 5 },
+   { pinmux(10), 2, 1 },
+   { pinmux(10), 2, 2 },
+   { pinmux(10), 2, 3 },
+   { pinmux(10), 2, 4 },
+   { pinmux(10), 2, 5 },
+   { pinmux(10), 2, 6 },
+   { pinmux(10), 2, 7 },
+   { pinmux(11), 2, 0 },
+   { pinmux(11), 2, 1 },
 };
 
 /* UART pin muxer settings */
 static const struct pinmux_config uart_pins[] = {
-   { pinmux[8], 2, 7 },
-   { pinmux[9], 2, 0 }
+   { pinmux(8), 2, 7 },
+   { pinmux(9), 2, 0 }
 };
 
 /* I2C pin muxer settings */
 static const struct pinmux_config i2c_pins[] = {
-   { pinmux[8], 2, 3 },
-   { pinmux[8], 2, 4 }
+   { pinmux(8), 2, 3 },
+   { pinmux(8), 2, 4 }
 };
 
 /* USB0_DRVVBUS pin muxer settings */
 static const struct pinmux_config usb_pins[] = {
-   { pinmux[9], 1, 1 }
+   { pinmux(9), 1, 1 }
 };
 
 static const struct pinmux_resource pinmuxes[] = {
-- 
1.5.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] da850 evm: Fix definition of 'pinmux' macro

2010-07-06 Thread Prakash PM
Usage of parenthesis in pinmux macro definition changes the
definition of the macro and raises the precedence of ''
operator inadvertently over '[]'.

Signed-off-by: Prakash PM prakash...@ti.com
---
 board/davinci/da8xxevm/da850evm.c |   22 +++---
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 959b2c6..eeb456c 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -30,28 +30,28 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define pinmux (davinci_syscfg_regs-pinmux)
+#define pinmux(x)  (davinci_syscfg_regs-pinmux[x])
 
 /* SPI0 pin muxer settings */
 static const struct pinmux_config spi1_pins[] = {
-   { pinmux[5], 1, 1 },
-   { pinmux[5], 1, 2 },
-   { pinmux[5], 1, 4 },
-   { pinmux[5], 1, 5 }
+   { pinmux(5), 1, 1 },
+   { pinmux(5), 1, 2 },
+   { pinmux(5), 1, 4 },
+   { pinmux(5), 1, 5 }
 };
 
 /* UART pin muxer settings */
 static const struct pinmux_config uart_pins[] = {
-   { pinmux[0], 4, 6 },
-   { pinmux[0], 4, 7 },
-   { pinmux[4], 2, 4 },
-   { pinmux[4], 2, 5 }
+   { pinmux(0), 4, 6 },
+   { pinmux(0), 4, 7 },
+   { pinmux(4), 2, 4 },
+   { pinmux(4), 2, 5 }
 };
 
 /* I2C pin muxer settings */
 static const struct pinmux_config i2c_pins[] = {
-   { pinmux[4], 2, 2 },
-   { pinmux[4], 2, 3 }
+   { pinmux(4), 2, 2 },
+   { pinmux(4), 2, 3 }
 };
 
 static const struct pinmux_resource pinmuxes[] = {
-- 
1.5.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] DaVinci: EMAC: Get EMAC_MDIO_PHY_NUM from config files

2010-06-22 Thread Prakash PM
Currently EMAC_MDIO_PHY_NUM is defined as 1 in emac_defs.h.
Because of this, EMAC does not work on EVMs which do not have phy
connected at 1. Moving the macro to board config file makes this
configurable depending on where the phy is connected on the MDIO bus.

This patch fixes the board reset issue observed during network access
on DM365EVM. EMAC driver was assuming EMAC_MDIO_PHY_NUM as 1
but it is 0 on DM365EVM.

This patch is verified on da830/omap-l137, dm365 and dm644x evms.

Signed-off-by: Prakash PM prakash...@ti.com
---
Since v1:
Added CONFIG_EMAC_MDIO_PHY_NUM for Davinci SONATA board config file,
without which MAKEALL fails for Davinci SONATA evm.

 arch/arm/include/asm/arch-davinci/emac_defs.h |2 +-
 include/configs/da830evm.h|1 +
 include/configs/davinci_dm365evm.h|1 +
 include/configs/davinci_dvevm.h   |1 +
 include/configs/davinci_schmoogie.h   |1 +
 include/configs/davinci_sffsdr.h  |1 +
 include/configs/davinci_sonata.h  |1 +
 7 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/arch-davinci/emac_defs.h 
b/arch/arm/include/asm/arch-davinci/emac_defs.h
index b0ec8f5..35a1585 100644
--- a/arch/arm/include/asm/arch-davinci/emac_defs.h
+++ b/arch/arm/include/asm/arch-davinci/emac_defs.h
@@ -85,7 +85,7 @@
 #endif
 
 /* PHY mask - set only those phy number bits where phy is/can be connected */
-#define EMAC_MDIO_PHY_NUM   1
+#define EMAC_MDIO_PHY_NUM   CONFIG_EMAC_MDIO_PHY_NUM
 #define EMAC_MDIO_PHY_MASK  (1  EMAC_MDIO_PHY_NUM)
 
 /* Ethernet Min/Max packet size */
diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 0f58e11..160ece2 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -87,6 +87,7 @@
  * Network  Ethernet Configuration
  */
 #ifdef CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   1
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/include/configs/davinci_dm365evm.h 
b/include/configs/davinci_dm365evm.h
index 6f99ae0..2c3d88d 100644
--- a/include/configs/davinci_dm365evm.h
+++ b/include/configs/davinci_dm365evm.h
@@ -58,6 +58,7 @@
 
 /* Network Configuration */
 #define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   0
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/include/configs/davinci_dvevm.h b/include/configs/davinci_dvevm.h
index 5774df5..aab2afa 100644
--- a/include/configs/davinci_dvevm.h
+++ b/include/configs/davinci_dvevm.h
@@ -102,6 +102,7 @@
 /* Network  Ethernet Configuration */
 /*==*/
 #define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   1
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/include/configs/davinci_schmoogie.h 
b/include/configs/davinci_schmoogie.h
index 3972ebc..875dda4 100644
--- a/include/configs/davinci_schmoogie.h
+++ b/include/configs/davinci_schmoogie.h
@@ -69,6 +69,7 @@
 /* Network  Ethernet Configuration */
 /*==*/
 #define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   1
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/include/configs/davinci_sffsdr.h b/include/configs/davinci_sffsdr.h
index 94be9dc..f4e17f8 100644
--- a/include/configs/davinci_sffsdr.h
+++ b/include/configs/davinci_sffsdr.h
@@ -66,6 +66,7 @@
 #define CONFIG_SYS_I2C_SLAVE   10  /* Bogus, master-only in U-Boot 
*/
 /* Network  Ethernet Configuration */
 #define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   1
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/include/configs/davinci_sonata.h b/include/configs/davinci_sonata.h
index 490821a..4c01844 100644
--- a/include/configs/davinci_sonata.h
+++ b/include/configs/davinci_sonata.h
@@ -102,6 +102,7 @@
 /* Network  Ethernet Configuration */
 /*==*/
 #define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   1
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
-- 
1.5.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] DaVinci: EMAC: Get EMAC_MDIO_PHY_NUM from config files

2010-06-21 Thread Prakash PM
Currently EMAC_MDIO_PHY_NUM is defined as 1 in emac_defs.h.
Because of this, EMAC does not work on EVMs which do not have phy
connected at 1. Moving the macro to board config file makes this
configurable depending on where the phy is connected on the MDIO bus.

This patch fixes the board reset issue observed during network access
on DM365EVM. EMAC driver was assuming EMAC_MDIO_PHY_NUM as 1
but it is 0 on DM365EVM.

This patch is verified on da830/omap-l137, dm365 and dm644x evms.

Signed-off-by: Prakash PM prakash...@ti.com
---
 arch/arm/include/asm/arch-davinci/emac_defs.h |2 +-
 include/configs/da830evm.h|1 +
 include/configs/davinci_dm365evm.h|1 +
 include/configs/davinci_dvevm.h   |1 +
 include/configs/davinci_schmoogie.h   |1 +
 include/configs/davinci_sffsdr.h  |1 +
 6 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/arch-davinci/emac_defs.h 
b/arch/arm/include/asm/arch-davinci/emac_defs.h
index b0ec8f5..35a1585 100644
--- a/arch/arm/include/asm/arch-davinci/emac_defs.h
+++ b/arch/arm/include/asm/arch-davinci/emac_defs.h
@@ -85,7 +85,7 @@
 #endif
 
 /* PHY mask - set only those phy number bits where phy is/can be connected */
-#define EMAC_MDIO_PHY_NUM   1
+#define EMAC_MDIO_PHY_NUM   CONFIG_EMAC_MDIO_PHY_NUM
 #define EMAC_MDIO_PHY_MASK  (1  EMAC_MDIO_PHY_NUM)
 
 /* Ethernet Min/Max packet size */
diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 0f58e11..621bae4 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -87,6 +87,7 @@
  * Network  Ethernet Configuration
  */
 #ifdef CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   1
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/include/configs/davinci_dm365evm.h 
b/include/configs/davinci_dm365evm.h
index 6f99ae0..76a3b0c 100644
--- a/include/configs/davinci_dm365evm.h
+++ b/include/configs/davinci_dm365evm.h
@@ -58,6 +58,7 @@
 
 /* Network Configuration */
 #define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   0
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/include/configs/davinci_dvevm.h b/include/configs/davinci_dvevm.h
index 5774df5..21f7a80 100644
--- a/include/configs/davinci_dvevm.h
+++ b/include/configs/davinci_dvevm.h
@@ -102,6 +102,7 @@
 /* Network  Ethernet Configuration */
 /*==*/
 #define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   1
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/include/configs/davinci_schmoogie.h 
b/include/configs/davinci_schmoogie.h
index 3972ebc..f28d073 100644
--- a/include/configs/davinci_schmoogie.h
+++ b/include/configs/davinci_schmoogie.h
@@ -69,6 +69,7 @@
 /* Network  Ethernet Configuration */
 /*==*/
 #define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   1
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/include/configs/davinci_sffsdr.h b/include/configs/davinci_sffsdr.h
index 94be9dc..d1ed918 100644
--- a/include/configs/davinci_sffsdr.h
+++ b/include/configs/davinci_sffsdr.h
@@ -66,6 +66,7 @@
 #define CONFIG_SYS_I2C_SLAVE   10  /* Bogus, master-only in U-Boot 
*/
 /* Network  Ethernet Configuration */
 #define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM   1
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
-- 
1.5.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot