[U-Boot] [PATCH 1/4] arm: rmobile: Add register infomation for i2c of R8A7790

2013-12-11 Thread Nobuhiro Iwamatsu
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 arch/arm/include/asm/arch-rmobile/r8a7790.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/include/asm/arch-rmobile/r8a7790.h 
b/arch/arm/include/asm/arch-rmobile/r8a7790.h
index 42d65d3..e6386b5 100644
--- a/arch/arm/include/asm/arch-rmobile/r8a7790.h
+++ b/arch/arm/include/asm/arch-rmobile/r8a7790.h
@@ -355,6 +355,13 @@
 #define CCI_AXI_IPMMUDSDVMCR   0xFF880414
 #define CCI_AXI_AX2ADDRMASK0xFF88041C
 
+/* I2C */
+#define CONFIG_SYS_RCAR_I2C0_BASE 0xE6508000
+#define CONFIG_SYS_RCAR_I2C1_BASE 0xE6518000
+#define CONFIG_SYS_RCAR_I2C2_BASE 0xE653
+#define CONFIG_SYS_RCAR_I2C3_BASE 0xE654
+#define CONFIF_SYS_RCAR_I2C_NUM_CONTROLLERS 4
+
 #ifndef __ASSEMBLY__
 #include asm/types.h
 
-- 
1.8.5

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


[U-Boot] [PATCH 2/4] arm: lager: Add support Ethernet

2013-12-11 Thread Nobuhiro Iwamatsu
From: Nobuhiro Iwamatsu iwama...@nigauri.org

The lager board has one sh-ether device.
This supports sh-ether.

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 board/renesas/lager/lager.c | 70 +
 include/configs/lager.h | 21 +-
 2 files changed, 90 insertions(+), 1 deletion(-)

diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c
index 5c99fc9..8447fe1 100644
--- a/board/renesas/lager/lager.c
+++ b/board/renesas/lager/lager.c
@@ -11,6 +11,7 @@
 #include common.h
 #include malloc.h
 #include netdev.h
+#include miiphy.h
 #include asm/processor.h
 #include asm/mach-types.h
 #include asm/io.h
@@ -207,6 +208,10 @@ void s_init(void)
 #define SMSTPCR7   0xE615014C
 #define SCIF0_MSTP721  (1  21)
 
+#define MSTPSR80xE61509A0
+#define SMSTPCR8   0xE6150990
+#define ETHER_MSTP813  (1  13)
+
 #define PMMR   0xE606
 #define GPSR4  0xE6060014
 #define IPSR14 0xE6060058
@@ -242,6 +247,9 @@ int board_early_init_f(void)
 
mstp_clrbits_le32(MSTPSR7, SMSTPCR7, SCIF0_MSTP721);
 
+   /* Ether */
+   mstp_clrbits_le32(MSTPSR8, SMSTPCR8, ETHER_MSTP813);
+
return 0;
 }
 
@@ -256,6 +264,68 @@ int board_init(void)
/* Init PFC controller */
r8a7790_pinmux_init();
 
+   /* Ether Enable */
+   gpio_request(GPIO_FN_ETH_CRS_DV, NULL);
+   gpio_request(GPIO_FN_ETH_RX_ER, NULL);
+   gpio_request(GPIO_FN_ETH_RXD0, NULL);
+   gpio_request(GPIO_FN_ETH_RXD1, NULL);
+   gpio_request(GPIO_FN_ETH_LINK, NULL);
+   gpio_request(GPIO_FN_ETH_REF_CLK, NULL);
+   gpio_request(GPIO_FN_ETH_MDIO, NULL);
+   gpio_request(GPIO_FN_ETH_TXD1, NULL);
+   gpio_request(GPIO_FN_ETH_TX_EN, NULL);
+   gpio_request(GPIO_FN_ETH_MAGIC, NULL);
+   gpio_request(GPIO_FN_ETH_TXD0, NULL);
+   gpio_request(GPIO_FN_ETH_MDC, NULL);
+   gpio_request(GPIO_FN_IRQ0, NULL);
+
+   gpio_request(GPIO_GP_5_31, NULL);   /* PHY_RST */
+   gpio_direction_output(GPIO_GP_5_31, 0);
+   mdelay(20);
+   gpio_set_value(GPIO_GP_5_31, 1);
+   udelay(1);
+
+   return 0;
+}
+
+#define CXR24 0xEE7003C0 /* MAC address high register */
+#define CXR25 0xEE7003C8 /* MAC address low register */
+int board_eth_init(bd_t *bis)
+{
+#ifdef CONFIG_SH_ETHER
+   int ret = -ENODEV;
+   u32 val;
+   unsigned char enetaddr[6];
+
+   ret = sh_eth_initialize(bis);
+   if (!eth_getenv_enetaddr(ethaddr, enetaddr))
+   return ret;
+
+   /* Set Mac address */
+   val = enetaddr[0]  24 | enetaddr[1]  16 |
+   enetaddr[2]  8 | enetaddr[3];
+   writel(val, CXR24);
+
+   val = enetaddr[4]  8 | enetaddr[5];
+   writel(val, CXR25);
+
+   return ret;
+#else
+   return 0;
+#endif
+}
+
+/* lager has KSZ8041NL/RNL */
+#define PHY_CONTROL1   0x1E
+#define PHY_LED_MODE   0xC
+#define PHY_LED_MODE_ACK   0x4000
+int board_phy_config(struct phy_device *phydev)
+{
+   int ret = phy_read(phydev, MDIO_DEVAD_NONE, PHY_CONTROL1);
+   ret = ~PHY_LED_MODE;
+   ret |= PHY_LED_MODE_ACK;
+   ret = phy_write(phydev, MDIO_DEVAD_NONE, PHY_CONTROL1, (u16)ret);
+
return 0;
 }
 
diff --git a/include/configs/lager.h b/include/configs/lager.h
index 7819edd..0dc9b6e 100644
--- a/include/configs/lager.h
+++ b/include/configs/lager.h
@@ -28,8 +28,13 @@
 #define CONFIG_CMD_SDRAM
 #define CONFIG_CMD_RUN
 #define CONFIG_CMD_LOADS
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NFS
 #define CONFIG_CMD_BOOTZ
-#defineCONFIG_CMD_FLASH
+#define CONFIG_CMD_FLASH
 
 #defineCONFIG_CMDLINE_TAG
 #defineCONFIG_SETUP_MEMORY_TAGS
@@ -127,6 +132,20 @@
 #define CONFIG_ENV_SIZE(CONFIG_ENV_SECT_SIZE)
 #define CONFIG_ENV_SIZE_REDUND (CONFIG_SYS_MONITOR_LEN)
 
+/* SH Ether */
+#define CONFIG_NET_MULTI
+#define CONFIG_SH_ETHER
+#define CONFIG_SH_ETHER_USE_PORT   0
+#define CONFIG_SH_ETHER_PHY_ADDR   0x1
+#define CONFIG_SH_ETHER_PHY_MODE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SH_ETHER_ALIGNE_SIZE64
+#define CONFIG_SH_ETHER_CACHE_WRITEBACK
+#define CONFIG_SH_ETHER_CACHE_INVALIDATE
+#define CONFIG_PHYLIB
+#define CONFIG_PHY_MICREL
+#define CONFIG_BITBANGMII
+#define CONFIG_BITBANGMII_MULTI
+
 /* Board Clock */
 #define CONFIG_BASE_CLK_FREQ   2000u
 #define CONFIG_SH_TMU_CLK_FREQ (CONFIG_BASE_CLK_FREQ / 2) /* EXT / 2 */
-- 
1.8.5

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


[U-Boot] [PATCH 4/4] arm: lager: Add support reset function

2013-12-11 Thread Nobuhiro Iwamatsu
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 board/renesas/lager/lager.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c
index 8447fe1..7d11c95 100644
--- a/board/renesas/lager/lager.c
+++ b/board/renesas/lager/lager.c
@@ -12,6 +12,7 @@
 #include malloc.h
 #include netdev.h
 #include miiphy.h
+#include i2c.h
 #include asm/processor.h
 #include asm/mach-types.h
 #include asm/io.h
@@ -352,6 +353,15 @@ int board_late_init(void)
return 0;
 }
 
+#define I2C_POWERIC_CHIP   0x58/* da9063 */
+#define I2C_POWERIC_ADDR   0x13
 void reset_cpu(ulong addr)
 {
+   u8 val;
+
+   i2c_set_bus_num(3); /* PowerIC connected to ch3 */
+   i2c_init(40, 0);
+   i2c_read(I2C_POWERIC_CHIP, I2C_POWERIC_ADDR, 1, val, 1);
+   val |= 0x02;
+   i2c_write(I2C_POWERIC_CHIP, I2C_POWERIC_ADDR, 1, val, 1);
 }
-- 
1.8.5

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


[U-Boot] [PATCH 3/4] arm: lager: Add support I2C

2013-12-11 Thread Nobuhiro Iwamatsu
The SoC of lager board has I2C for R-Car.
This supports I2C for R-Car on lager board.

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 include/configs/lager.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/include/configs/lager.h b/include/configs/lager.h
index 0dc9b6e..f525a8a 100644
--- a/include/configs/lager.h
+++ b/include/configs/lager.h
@@ -146,12 +146,21 @@
 #define CONFIG_BITBANGMII
 #define CONFIG_BITBANGMII_MULTI
 
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_RCAR
+#define CONFIG_SYS_RCAR_I2C0_SPEED 40
+#define CONFIG_SYS_RCAR_I2C1_SPEED 40
+#define CONFIG_SYS_RCAR_I2C2_SPEED 40
+#define CONFIG_SYS_RCAR_I2C3_SPEED 40
+
 /* Board Clock */
 #define CONFIG_BASE_CLK_FREQ   2000u
 #define CONFIG_SH_TMU_CLK_FREQ (CONFIG_BASE_CLK_FREQ / 2) /* EXT / 2 */
 #define CONFIG_PLL1_CLK_FREQ   (CONFIG_BASE_CLK_FREQ * 156 / 2)
 #define CONFIG_PLL1_DIV2_CLK_FREQ  (CONFIG_PLL1_CLK_FREQ / 2)
 #define CONFIG_MP_CLK_FREQ (CONFIG_PLL1_DIV2_CLK_FREQ / 15)
+#define CONFIG_HP_CLK_FREQ (CONFIG_PLL1_CLK_FREQ / 12)
 #define CONFIG_SH_SCIF_CLK_FREQCONFIG_MP_CLK_FREQ
 
 #define CONFIG_SYS_TMU_CLK_DIV 4
-- 
1.8.5

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


[U-Boot] [PATCH 3/4] arm: koelsch: Add support I2C

2013-12-11 Thread Nobuhiro Iwamatsu
This supports sh_i2c on koelsch board.

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 include/configs/koelsch.h | 12 
 1 file changed, 12 insertions(+)

diff --git a/include/configs/koelsch.h b/include/configs/koelsch.h
index 4d78388..0c3f7f8 100644
--- a/include/configs/koelsch.h
+++ b/include/configs/koelsch.h
@@ -149,4 +149,16 @@
 #define CONFIG_SYS_TMU_CLK_DIV 4
 #define CONFIG_SYS_HZ  1000
 
+/* I2C */
+#define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SH
+#define CONFIG_SYS_I2C_SLAVE   0x7F
+#define CONFIG_SYS_I2C_SH_SPEED0   40
+#define CONFIG_SYS_I2C_SH_SPEED1   40
+#define CONFIG_SYS_I2C_SH_SPEED2   40
+#define CONFIG_SH_I2C_DATA_HIGH4
+#define CONFIG_SH_I2C_DATA_LOW 5
+#define CONFIG_SH_I2C_CLOCK1000
+
 #endif /* __KOELSCH_H */
-- 
1.8.5

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


[U-Boot] [PATCH 2/4] arm: koelsch: Add support Ethernet

2013-12-11 Thread Nobuhiro Iwamatsu
The koelsch board has one sh-ether device.
This supports sh-ether.

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 board/renesas/koelsch/koelsch.c | 77 +
 include/configs/koelsch.h   | 23 ++--
 2 files changed, 98 insertions(+), 2 deletions(-)

diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c
index 7153f65..1975672 100644
--- a/board/renesas/koelsch/koelsch.c
+++ b/board/renesas/koelsch/koelsch.c
@@ -16,6 +16,8 @@
 #include asm/arch/sys_proto.h
 #include asm/gpio.h
 #include asm/arch/rmobile.h
+#include netdev.h
+#include miiphy.h
 #include i2c.h
 #include qos.h
 
@@ -207,6 +209,10 @@ void s_init(void)
 #define SMSTPCR7   0xE615014C
 #define SCIF0_MSTP721  (1  21)
 
+#define MSTPSR80xE61509A0
+#define SMSTPCR8   0xE6150990
+#define ETHER_MSTP813  (1  13)
+
 #define PMMR   0xE606
 #define GPSR4  0xE6060014
 #define IPSR14 0xE6060058
@@ -241,9 +247,16 @@ int board_early_init_f(void)
 
mstp_clrbits_le32(MSTPSR7, SMSTPCR7, SCIF0_MSTP721);
 
+   /* Ether */
+   mstp_clrbits_le32(MSTPSR8, SMSTPCR8, ETHER_MSTP813);
+
return 0;
 }
 
+/* LSI pin pull-up control */
+#define PUPR5 0xe6060114
+#define PUPR5_ETH 0x3FFC
+#define PUPR5_ETH_MAGIC(1  27)
 int board_init(void)
 {
/* adress of boot parameters */
@@ -252,7 +265,57 @@ int board_init(void)
/* Init PFC controller */
r8a7791_pinmux_init();
 
+   /* Ether Enable */
+   gpio_request(GPIO_FN_ETH_CRS_DV, NULL);
+   gpio_request(GPIO_FN_ETH_RX_ER, NULL);
+   gpio_request(GPIO_FN_ETH_RXD0, NULL);
+   gpio_request(GPIO_FN_ETH_RXD1, NULL);
+   gpio_request(GPIO_FN_ETH_LINK, NULL);
+   gpio_request(GPIO_FN_ETH_REFCLK, NULL);
+   gpio_request(GPIO_FN_ETH_MDIO, NULL);
+   gpio_request(GPIO_FN_ETH_TXD1, NULL);
+   gpio_request(GPIO_FN_ETH_TX_EN, NULL);
+   gpio_request(GPIO_FN_ETH_TXD0, NULL);
+   gpio_request(GPIO_FN_ETH_MDC, NULL);
+   gpio_request(GPIO_FN_IRQ0, NULL);
+
+   mstp_clrbits_le32(PUPR5, PUPR5, PUPR5_ETH  ~PUPR5_ETH_MAGIC);
+   gpio_request(GPIO_GP_5_22, NULL); /* PHY_RST */
+   mstp_clrbits_le32(PUPR5, PUPR5, PUPR5_ETH_MAGIC);
+
+   gpio_direction_output(GPIO_GP_5_22, 0);
+   mdelay(20);
+   gpio_set_value(GPIO_GP_5_22, 1);
+   udelay(1);
+
+   return 0;
+}
+
+#define CXR24 0xEE7003C0 /* MAC address high register */
+#define CXR25 0xEE7003C8 /* MAC address low register */
+int board_eth_init(bd_t *bis)
+{
+#ifdef CONFIG_SH_ETHER
+   int ret = -ENODEV;
+   u32 val;
+   unsigned char enetaddr[6];
+
+   ret = sh_eth_initialize(bis);
+   if (!eth_getenv_enetaddr(ethaddr, enetaddr))
+   return ret;
+
+   /* Set Mac address */
+   val = enetaddr[0]  24 | enetaddr[1]  16 |
+   enetaddr[2]  8 | enetaddr[3];
+   writel(val, CXR24);
+
+   val = enetaddr[4]  8 | enetaddr[5];
+   writel(val, CXR25);
+
+   return ret;
+#else
return 0;
+#endif
 }
 
 int dram_init(void)
@@ -263,6 +326,20 @@ int dram_init(void)
return 0;
 }
 
+/* koelsch has KSZ8041NL/RNL */
+#define PHY_CONTROL1   0x1E
+#define PHY_LED_MODE   0xC
+#define PHY_LED_MODE_ACK   0x4000
+int board_phy_config(struct phy_device *phydev)
+{
+   int ret = phy_read(phydev, MDIO_DEVAD_NONE, PHY_CONTROL1);
+   ret = ~PHY_LED_MODE;
+   ret |= PHY_LED_MODE_ACK;
+   ret = phy_write(phydev, MDIO_DEVAD_NONE, PHY_CONTROL1, (u16)ret);
+
+   return 0;
+}
+
 const struct rmobile_sysinfo sysinfo = {
CONFIG_RMOBILE_BOARD_STRING
 };
diff --git a/include/configs/koelsch.h b/include/configs/koelsch.h
index 59c4948..4d78388 100644
--- a/include/configs/koelsch.h
+++ b/include/configs/koelsch.h
@@ -18,13 +18,18 @@
 
 #include asm/arch/rmobile.h
 
-#defineCONFIG_CMD_EDITENV
-#defineCONFIG_CMD_SAVEENV
+#define CONFIG_CMD_EDITENV
+#define CONFIG_CMD_SAVEENV
 #define CONFIG_CMD_MEMORY
 #define CONFIG_CMD_DFL
 #define CONFIG_CMD_SDRAM
 #define CONFIG_CMD_RUN
 #define CONFIG_CMD_LOADS
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NFS
 #define CONFIG_CMD_BOOTZ
 #defineCONFIG_CMD_FLASH
 
@@ -123,6 +128,20 @@
 #define CONFIG_ENV_SIZE(CONFIG_ENV_SECT_SIZE)
 #define CONFIG_ENV_SIZE_REDUND (CONFIG_SYS_MONITOR_LEN)
 
+/* SH Ether */
+#define CONFIG_NET_MULTI
+#define CONFIG_SH_ETHER
+#define CONFIG_SH_ETHER_USE_PORT   0
+#define CONFIG_SH_ETHER_PHY_ADDR   0x1
+#define CONFIG_SH_ETHER_PHY_MODE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SH_ETHER_CACHE_WRITEBACK
+#define CONFIG_SH_ETHER_CACHE_INVALIDATE
+#define CONFIG_PHYLIB
+#define CONFIG_PHY_MICREL
+#define CONFIG_BITBANGMII
+#define CONFIG_BITBANGMII_MULTI
+#define CONFIG_SH_ETHER_ALIGNE_SIZE 64
+
 /* Board Clock */
 #defineCONFIG_SYS_CLK_FREQ 1000
 #define 

[U-Boot] [PATCH 1/4] arm: rmobile: Add register infomation for i2c of R8A7791

2013-12-11 Thread Nobuhiro Iwamatsu
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 arch/arm/include/asm/arch-rmobile/r8a7791.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/include/asm/arch-rmobile/r8a7791.h 
b/arch/arm/include/asm/arch-rmobile/r8a7791.h
index 2afda0a..3a3277a 100644
--- a/arch/arm/include/asm/arch-rmobile/r8a7791.h
+++ b/arch/arm/include/asm/arch-rmobile/r8a7791.h
@@ -407,6 +407,12 @@
 #define CCI_AXI_IPMMUDSDVMCR   0xFF880414
 #define CCI_AXI_AX2ADDRMASK0xFF88041C
 
+/* I2C */
+#define CONFIG_SYS_I2C_SH_BASE00xE650
+#define CONFIG_SYS_I2C_SH_BASE10xE651
+#define CONFIG_SYS_I2C_SH_BASE20xE60B
+#define CONFIG_SYS_I2C_SH_NUM_CONTROLLERS  3
+
 #ifndef __ASSEMBLY__
 #include asm/types.h
 
-- 
1.8.5

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


[U-Boot] [PATCH 4/4] arm: koelsch: Add support reset function

2013-12-11 Thread Nobuhiro Iwamatsu
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 board/renesas/koelsch/koelsch.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c
index 1975672..b52043b 100644
--- a/board/renesas/koelsch/koelsch.c
+++ b/board/renesas/koelsch/koelsch.c
@@ -355,6 +355,14 @@ int board_late_init(void)
return 0;
 }
 
+#define I2C_POWERIC_CHIP   0x58/* da9063 */
+#define I2C_POWERIC_ADDR   0x13
 void reset_cpu(ulong addr)
 {
+   u8 val;
+
+   i2c_set_bus_num(2); /* PowerIC connected to ch2 */
+   i2c_read(I2C_POWERIC_CHIP, I2C_POWERIC_ADDR, 1, val, 1);
+   val |= 0x02;
+   i2c_write(I2C_POWERIC_CHIP, I2C_POWERIC_ADDR, 1, val, 1);
 }
-- 
1.8.5

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


[U-Boot] [PATCH] arm: rmobile: Update README.rmobile

2013-12-11 Thread Nobuhiro Iwamatsu
Add infomation of Lager and Koelsh board, and R-Car.

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 doc/README.rmobile | 49 ++---
 1 file changed, 34 insertions(+), 15 deletions(-)

diff --git a/doc/README.rmobile b/doc/README.rmobile
index 7ec63f1..4fbbcb3 100644
--- a/doc/README.rmobile
+++ b/doc/README.rmobile
@@ -2,13 +2,15 @@ Summary
 ===
 
 This README is about U-Boot support for Renesas's ARM Cortex-A9 based 
RMOBILE[1]
-family of SoCs. Renesas's RMOBILE SoC family contains an ARM Cortex-A9.
+and R-Car[2]family of SoCs. Renesas's RMOBILE/R-Car SoC family contains an ARM
+Cortex-A9.
 
 Currently the following boards are supported:
 
-* KMC KZM-A9-GT [2]
-
-* Atmark-Techno Armadillo-800-EVA [3]
+* KMC KZM-A9-GT [3]
+* Atmark-Techno Armadillo-800-EVA [4]
+* Renesas Electronics Lager
+* Renesas Electronics Koelsch
 
 Toolchain
 =
@@ -17,7 +19,7 @@ ARM Cortex-A9 support ARM v7 instruction set (-march=armv7a).
 But currently we compile with -march=armv5 to allow more compilers to work.
 (For U-Boot code this has no performance impact.)
 Because there was no compiler which is supporting armv7a not much before.
-Currently, ELDK[4], Linaro[5], CodeSourcey[6] and Emdebian[7] supports 
-march=armv7a
+Currently, ELDK[5], Linaro[6], CodeSourcey[7] and Emdebian[8] supports 
-march=armv7a
 and you can get.
 
 Build
@@ -25,13 +27,26 @@ Build
 
 * KZM-A9-GT
 
-make kzm9g_config
-make
+  make kzm9g_config
+  make
 
 * Armadillo-800-EVA
 
-make armadillo-800eva_config
-make
+  make armadillo-800eva_config
+  make
+
+  Note: Armadillo-800-EVA's U-Boot supports booting from SDcard only.
+Please see B.2 Appendix B Boot Specifications in hardware manual.
+
+* Lager
+
+  make lager_config
+  make
+
+* Koelsch
+
+  make koelsch_config
+  make
 
 Links
 =
@@ -40,26 +55,30 @@ Links
 
 http://am.renesas.com/products/soc/assp/mobile/r_mobile/index.jsp
 
-[2] KZM-A9-GT
+[2] Renesas R-Car:
+
+http://am.renesas.com/products/soc/assp/automotive/index.jsp
+
+[3] KZM-A9-GT
 
 http://www.kmckk.co.jp/kzma9-gt/index.html
 
-[3] Armadillo-800-EVA
+[4] Armadillo-800-EVA
 
 http://armadillo.atmark-techno.com/armadillo-800-EVA
 
-[4] ELDK
+[5] ELDK
 
 http://www.denx.de/wiki/view/ELDK-5/WebHome#Section_1.6.
 
-[5] Linaro
+[6] Linaro
 
 http://www.linaro.org/downloads/
 
-[6] CodeSourcey
+[7] CodeSourcey
 
 http://www.mentor.com/embedded-software/codesourcery
 
-[7] Emdebian
+[8] Emdebian
 
 http://www.emdebian.org/crosstools.html
-- 
1.8.5

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


Re: [U-Boot] [PATCH 08/10] Trats: add LCD download menu support

2013-12-11 Thread Minkyu Kang
On 04/12/13 03:03, Przemyslaw Marczak wrote:
 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 Cc: Lukasz Majewski l.majew...@samsung.com
 ---
  include/configs/trats.h |   10 ++
  1 file changed, 10 insertions(+)
 
 diff --git a/include/configs/trats.h b/include/configs/trats.h
 index 9738a00..d3bed99 100644
 --- a/include/configs/trats.h
 +++ b/include/configs/trats.h
 @@ -19,6 +19,7 @@
  #define CONFIG_EXYNOS4210/* which is in a EXYNOS4210 */
  #define CONFIG_TRATS /* working with TRATS */
  #define CONFIG_TIZEN /* TIZEN lib */
 +#define CONFIG_BOARD_NAMETRATS
  
  #include asm/arch/cpu.h/* get chip and board defs */
  
 @@ -313,6 +314,15 @@
  /* Common misc for Samsung */
  #define CONFIG_MISC_INIT_R   1
  
 +/* Download menu - Samsung common */
 +#define CONFIG_LCD_MENU  1
 +#define CONFIG_LCD_MENU_BOARD1
 +
 +/* LCD console */
 +#define LCD_BPP  LCD_COLOR16
 +#undef  LCD_TEST_PATTERN

Where is this define?

 +#define CONFIG_SYS_WHITE_ON_BLACK1
 +
  /* LCD */
  #define CONFIG_EXYNOS_FB
  #define CONFIG_LCD
 

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


Re: [U-Boot] [PATCH 04/10] samsung: misc: move display logo function to misc.c file.

2013-12-11 Thread Minkyu Kang
On 04/12/13 03:03, Przemyslaw Marczak wrote:
 board/samsung/common/misc.c:
 - move draw_logo() function from exynos_fb.c
 - add get_tizen_logo_info() function call removed from board files
 
 boards:
 - update board files
 - add CONFIG_MISC_INIT_R to Universal, Trats and Trats2
 
 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
  board/samsung/common/misc.c  |   39 
 ++
  board/samsung/trats/trats.c  |3 ---
  board/samsung/trats2/trats2.c|4 ---
  board/samsung/universal_c210/universal.c |4 ---
  drivers/video/exynos_fb.c|   28 -
  include/configs/s5pc210_universal.h  |3 +++
  include/configs/trats.h  |3 +++
  include/configs/trats2.h |3 +++
  8 files changed, 48 insertions(+), 39 deletions(-)
 
 diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
 index 465895b..fa97644 100644
 --- a/board/samsung/common/misc.c
 +++ b/board/samsung/common/misc.c
 @@ -6,11 +6,50 @@
   */
  
  #include common.h
 +#include lcd.h
 +#include libtizen.h
 +
 +#ifdef CONFIG_MISC_INIT_R
 +#ifdef CONFIG_CMD_BMP
 +static void draw_logo(void)
 +{
 + int x, y;
 + ulong addr;
 +
 +#ifdef CONFIG_TIZEN
 + get_tizen_logo_info(panel_info);
 +#else
 + return;
 +#endif
 +
 + if (panel_info.vl_width = panel_info.logo_width) {
 + x = ((panel_info.vl_width - panel_info.logo_width)  1);
 + } else {
 + x = 0;
 + printf(Warning: image width is bigger than display width\n);
 + }
 +
 + if (panel_info.vl_height = panel_info.logo_height) {
 + y = ((panel_info.vl_height - panel_info.logo_height)  1);
 + } else {
 + y = 0;
 + printf(Warning: image height is bigger than display height\n);
 + }
 +
 + addr = panel_info.logo_addr;
 + bmp_display(addr, x, y);
 +}
 +#endif /* CONFIG_CMD_BMP */
 +#endif /* CONFIG_MISC_INIT_R */
  
  #ifdef CONFIG_MISC_INIT_R
  /* Common for Samsung boards */
  int misc_init_r(void)
  {
 +#ifdef CONFIG_CMD_BMP
 + if (panel_info.logo_on)
 + draw_logo();
 +#endif
   return 0;
  }
  #endif /* CONFIG_MISC_INIT_R */
 diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
 index 6bd106e..ce4b41f 100644
 --- a/board/samsung/trats/trats.c
 +++ b/board/samsung/trats/trats.c
 @@ -767,9 +767,6 @@ void init_panel_info(vidinfo_t *vid)
   vid-resolution = HD_RESOLUTION,
   vid-rgb_mode   = MODE_RGB_P,
  
 -#ifdef CONFIG_TIZEN
 - get_tizen_logo_info(vid);
 -#endif
   mipi_lcd_device.reverse_panel = 1;
  
   strcpy(s6e8ax0_platform_data.lcd_panel_name, mipi_lcd_device.name);
 diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
 index 2442d96..73b8cc1 100644
 --- a/board/samsung/trats2/trats2.c
 +++ b/board/samsung/trats2/trats2.c
 @@ -573,10 +573,6 @@ void init_panel_info(vidinfo_t *vid)
  
   mipi_lcd_device.reverse_panel = 1;
  
 -#ifdef CONFIG_TIZEN
 - get_tizen_logo_info(vid);
 -#endif
 -
   strcpy(dsim_platform_data.lcd_panel_name, mipi_lcd_device.name);
   dsim_platform_data.mipi_power = mipi_power;
   dsim_platform_data.phy_enable = set_mipi_phy_ctrl;
 diff --git a/board/samsung/universal_c210/universal.c 
 b/board/samsung/universal_c210/universal.c
 index 54d0e1e..166d5ee 100644
 --- a/board/samsung/universal_c210/universal.c
 +++ b/board/samsung/universal_c210/universal.c
 @@ -484,10 +484,6 @@ void init_panel_info(vidinfo_t *vid)
   vid-resolution = HD_RESOLUTION;
   vid-rgb_mode   = MODE_RGB_P;
  
 -#ifdef CONFIG_TIZEN
 - get_tizen_logo_info(vid);
 -#endif
 -
   /* for LD9040. */
   vid-pclk_name = 1; /* MPLL */
   vid-sclk_div = 1;
 diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
 index 7d4c6e0..00a0a11 100644
 --- a/drivers/video/exynos_fb.c
 +++ b/drivers/video/exynos_fb.c
 @@ -62,31 +62,6 @@ static void exynos_lcd_init(vidinfo_t *vid)
   lcd_set_flush_dcache(1);
  }
  
 -#ifdef CONFIG_CMD_BMP
 -static void draw_logo(void)
 -{
 - int x, y;
 - ulong addr;
 -
 - if (panel_width = panel_info.logo_width) {
 - x = ((panel_width - panel_info.logo_width)  1);
 - } else {
 - x = 0;
 - printf(Warning: image width is bigger than display width\n);
 - }
 -
 - if (panel_height = panel_info.logo_height) {
 - y = ((panel_height - panel_info.logo_height)  1) - 4;
 - } else {
 - y = 0;
 - printf(Warning: image height is bigger than display height\n);
 - }
 -
 - addr = panel_info.logo_addr;
 - bmp_display(addr, x, y);
 -}
 -#endif
 -
  void __exynos_cfg_lcd_gpio(void)
  {
  }
 @@ -323,9 +298,6 @@ void lcd_enable(void)
   if (panel_info.logo_on) {
   memset((void *) gd-fb_base, 0, panel_width * panel_height *
   (NBITS(panel_info.vl_bpix)  

Re: [U-Boot] [PATCH 03/10] samsung: common: Add misc file and common function misc_init_r().

2013-12-11 Thread Minkyu Kang
On 04/12/13 03:03, Przemyslaw Marczak wrote:
 Config options:
 - CONFIG_SAMSUNG - misc.c
 - CONFIG_MISC_INIT_R - function misc_init_r();
 
 New file:
 - board/samsung/common/misc.c
 
 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
  board/samsung/common/Makefile |1 +
  board/samsung/common/misc.c   |   16 
  2 files changed, 17 insertions(+)
  create mode 100644 board/samsung/common/misc.c
 
 diff --git a/board/samsung/common/Makefile b/board/samsung/common/Makefile
 index 501d974..d1eb63f 100644
 --- a/board/samsung/common/Makefile
 +++ b/board/samsung/common/Makefile
 @@ -8,3 +8,4 @@
  obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
  obj-$(CONFIG_THOR_FUNCTION) += thor.o
  obj-$(CONFIG_CMD_USB_MASS_STORAGE) += ums.o
 +obj-$(CONFIG_SAMSUNG) += misc.o

Why CONFIG_SAMSUNG?
We know this Makefile is for samsung boards.

 diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
 new file mode 100644
 index 000..465895b
 --- /dev/null
 +++ b/board/samsung/common/misc.c
 @@ -0,0 +1,16 @@
 +/*
 + * Copyright (C) 2013 Samsung Electronics
 + * Przemyslaw Marczak p.marc...@samsung.com
 + *
 + * SPDX-License-Identifier:  GPL-2.0+
 + */
 +
 +#include common.h
 +
 +#ifdef CONFIG_MISC_INIT_R
 +/* Common for Samsung boards */
 +int misc_init_r(void)
 +{
 + return 0;
 +}
 +#endif /* CONFIG_MISC_INIT_R */
 

Thanks,
Minkyu Kang.

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


Re: [U-Boot] [PATCH 07/10] samsung: misc: Add LCD download menu.

2013-12-11 Thread Minkyu Kang
Dear Przemyslaw Marczak,

On 04/12/13 03:03, Przemyslaw Marczak wrote:
 New configs:
 - CONFIG_LCD_MENU
 - CONFIG_LCD_MENU_BOARD
 which depends on: CONFIG_MISC_INIT_R
 
 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
  board/samsung/common/keys.h |   78 ++
  board/samsung/common/misc.c |  354 
 +++
  2 files changed, 432 insertions(+)
  create mode 100644 board/samsung/common/keys.h
 
 diff --git a/board/samsung/common/keys.h b/board/samsung/common/keys.h
 new file mode 100644
 index 000..48822d1
 --- /dev/null
 +++ b/board/samsung/common/keys.h
 @@ -0,0 +1,78 @@
 +/*
 + * Copyright (C) 2013 Samsung Electronics
 + *
 + * SPDX-License-Identifier:  GPL-2.0+
 + */
 +#ifndef __SAMSUNG_KEYS__
 +#define __SAMSUNG_KEYS__
 +
 +#ifndef __ASSEMBLY__
 +
 +#include config.h
 +#include common.h
 +#include power/pmic.h
 +#include asm/arch/gpio.h
 +
 +/* PMIC PWR ON key */
 +#if defined(CONFIG_MACH_GONI) || defined(CONFIG_UNIVERSAL)
 +
 +#include power/max8998_pmic.h
 +
 +#define KEY_PWR_PMIC_NAMEMAX8998_PMIC
 +
 +#define KEY_PWR_STATUS_REG   MAX8998_REG_STATUS1
 +#define KEY_PWR_STATUS_MASK  (1  7)
 +
 +#define KEY_PWR_INTERRUPT_REGMAX8998_REG_IRQ1
 +#define KEY_PWR_INTERRUPT_MASK   (1  7)
 +
 +#elif defined(CONFIG_TRATS)
 +
 +#include power/max8997_pmic.h
 +
 +#define KEY_PWR_PMIC_NAMEMAX8997_PMIC
 +
 +#define KEY_PWR_STATUS_REG   MAX8997_REG_STATUS1
 +#define KEY_PWR_STATUS_MASK  (1  0)
 +
 +#define KEY_PWR_INTERRUPT_REGMAX8997_REG_INT1
 +#define KEY_PWR_INTERRUPT_MASK   (1  0)
 +
 +#elif defined(CONFIG_TRATS2)
 +
 +#include power/max77686_pmic.h
 +
 +#define KEY_PWR_PMIC_NAMEMAX77686_PMIC
 +
 +#define KEY_PWR_STATUS_REG   MAX77686_REG_PMIC_STATUS1
 +#define KEY_PWR_STATUS_MASK  (1  0)
 +
 +#define KEY_PWR_INTERRUPT_REGMAX77686_REG_PMIC_INT1
 +#define KEY_PWR_INTERRUPT_MASK   (1  1)
 +
 +#endif /* PMIC PWR ON key */

Hm no. it's a board specific feature so it should be go to each boards.
Maybe we need some.. framework?

 +
 +/* GPIO for Vol Up and Vol Down */
 +#if defined(CONFIG_MACH_GONI)
 +
 +#define KEY_VOL_UP_GPIO  s5pc110_gpio_get(h3, 1)
 +#define KEY_VOL_DOWN_GPIOs5pc110_gpio_get(h3, 2)
 +
 +#elif defined(CONFIG_UNIVERSAL) || defined(CONFIG_TRATS)
 +
 +#define KEY_VOL_UP_GPIO  exynos4_gpio_get(2, x2, 0)
 +#define KEY_VOL_DOWN_GPIOexynos4_gpio_get(2, x2, 1)
 +
 +#elif defined(CONFIG_TRATS2)
 +
 +#define KEY_VOL_UP_GPIO  exynos4x12_gpio_get(2, x2, 2)
 +#define KEY_VOL_DOWN_GPIOexynos4x12_gpio_get(2, x3, 3)
 +
 +#else
 +#ifdef CONFIG_MISC_INIT_R
 +#warning Vol UP and Vol DOWN GPIO are undefined!
 +#endif
 +#endif /* GPIO for Vol Up and Vol Down */

ditto.
Will you add ifdef when you add new boards?
It doesn't make sense.

 +
 +#endif /* __ASSEMBLY__ */
 +#endif /* __SAMSUNG_KEYS__ */
 diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
 index fa97644..c792b87 100644
 --- a/board/samsung/common/misc.c
 +++ b/board/samsung/common/misc.c
 @@ -8,8 +8,357 @@
  #include common.h
  #include lcd.h
  #include libtizen.h
 +#include errno.h
 +#include version.h
 +#include asm/sizes.h
 +#include asm/arch/cpu.h
 +#include asm/arch/gpio.h
 +#include asm/gpio.h
 +#include linux/input.h
 +#include lcd.h
 +#include libtizen.h
 +#include mmc.h
 +#include keys.h
  
  #ifdef CONFIG_MISC_INIT_R
 +struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned);
 +int s5p_gpio_get_pin(unsigned);
 +#ifdef CONFIG_REVISION_TAG
 +u32 get_board_rev(void);
 +#endif
 +
 +#ifdef CONFIG_LCD_MENU
 +enum {
 + BOOT_MODE_INFO,
 + BOOT_MODE_THOR,
 + BOOT_MODE_UMS,
 + BOOT_MODE_DFU,
 + BOOT_MODE_EXIT,
 +};
 +
 +static int power_key_pressed(int reg)
 +{
 + struct pmic *pmic = pmic_get(KEY_PWR_PMIC_NAME);
 + u32 status = 0;
 + u32 mask;
 +
 + if (pmic_probe(pmic))
 + return 0;
 +
 + if (!pmic) {
 + printf(%s: Not found\n, KEY_PWR_PMIC_NAME);
 + return -ENODEV;
 + }
 +
 + if (reg == KEY_PWR_STATUS_REG)
 + mask = KEY_PWR_STATUS_MASK;
 + else
 + mask = KEY_PWR_INTERRUPT_MASK;
 +
 + if (pmic_reg_read(pmic, reg, status))
 + return -EIO;
 +
 + return !!(status  mask);
 +}
 +
 +static int key_pressed(int key)
 +{
 + int value = 0;
 +
 + switch (key) {
 + case KEY_POWER:
 + value = power_key_pressed(KEY_PWR_INTERRUPT_REG);
 + break;
 + case KEY_VOLUMEUP:
 + value = !gpio_get_value(KEY_VOL_UP_GPIO);
 + break;
 + case KEY_VOLUMEDOWN:
 + value = !gpio_get_value(KEY_VOL_DOWN_GPIO);
 + break;
 + default:
 + break;
 + }
 +
 + return value;
 +}
 +
 +static int check_keys(void)
 +{
 + int 

Re: [U-Boot] [PATCH] ARM: Samsung: Change GONI and Universal_C210 maintainers.

2013-12-11 Thread Minkyu Kang
On 11/12/13 15:15, Lukasz Majewski wrote:
 Update boards.cfg entries for Samsung's GONI and Universal_C210 maintainers
 entry.
 
 Change-Id: Idac259bdefc8547ec10c7f5b9556be09c2484a3a
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com
 ---
  boards.cfg |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/boards.cfg b/boards.cfg
 index 114cc86..5988c5f 100644
 --- a/boards.cfg
 +++ b/boards.cfg
 @@ -276,7 +276,7 @@ Active  arm armv7  exynos  samsung
  smdk5250
  Active  arm armv7  exynos  samsung smdkv310  
   smdkv310 -  
   
  Chander Kashyap k.chan...@samsung.com
  Active  arm armv7  exynos  samsung trats 
   trats-  
   
  Lukasz Majewski l.majew...@samsung.com
  Active  arm armv7  exynos  samsung trats2
   trats2   -  
   
  Piotr Wilczek p.wilc...@samsung.com
 -Active  arm armv7  exynos  samsung 
 universal_c210  s5pc210_universal-
   
Minkyu Kang mk7.k...@samsung.com
 +Active  arm armv7  exynos  samsung 
 universal_c210  s5pc210_universal-
   
Przemyslaw Marczak p.marc...@samsung.com
  Active  arm armv7  highbank-   highbank  
   highbank -  
   
  Rob Herring rob.herr...@calxeda.com
  Active  arm armv7  mx5 denxm53evk
   m53evk   
 m53evk:IMX_CONFIG=board/denx/m53evk/imximage.cfg  
 Marek Vasut 
 marek.va...@gmail.com
  Active  arm armv7  mx5 esg ima3-mx53 
   ima3-mx53
 ima3-mx53:IMX_CONFIG=board/esg/ima3-mx53/imximage.cfg 
 -
 @@ -341,7 +341,7 @@ Active  arm armv7  omap5   ti 
  dra7xx
  Active  arm armv7  omap5   ti  omap5_uevm
   omap5_uevm   -  
   
  -
  Active  arm armv7  rmobile atmark-techno   
 armadillo-800evaarmadillo-800eva -
   
Nobuhiro Iwamatsu 
 nobuhiro.iwamatsu...@renesas.com
  Active  arm armv7  rmobile kmc kzm9g 
   kzm9g-  
   
  Nobuhiro Iwamatsu 
 nobuhiro.iwamatsu...@renesas.com:Tetsuyuki Kobayashi k...@kmckk.co.jp
 -Active  arm armv7  s5pc1xx samsung goni  
   s5p_goni -  
   
  Minkyu Kang mk7.k...@samsung.com
 +Active  arm armv7  s5pc1xx samsung goni  
   s5p_goni -  
   
  Mateusz Zalega m.zal...@samsung.com
  Active  arm armv7  s5pc1xx samsung smdkc100  
   smdkc100 -  
   
  Minkyu Kang mk7.k...@samsung.com
  Active  arm armv7  socfpga altera  socfpga   
   socfpga_cyclone5 -  

[U-Boot] Some M68K boards are depending the specific order of libraries

2013-12-11 Thread Masahiro Yamada
Hi, M68K maintainers.


I noticed at least some M68K boards are expecting the specific order
of libraries for the link stage.

To confirm this problem, check out the current u-boot/master.
(commit f44483b57c49282299da0e5c10073b909cdad979)

And then build, for example, cobra5272 board.
$ make cobra5272   CROSS_COMPILE=m68k-linux-

The build should succeed.


And then, modify the top Makefile as follows
(omit  $(sort ...)  function)


--- a/Makefile
+++ b/Makefile
@@ -288,7 +288,7 @@ LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/
 LIBS-y += board/$(BOARDDIR)/
 
 LIBS-y := $(patsubst %/, %/built-in.o, $(LIBS-y))
-LIBS := $(addprefix $(obj),$(sort $(LIBS-y)))
+LIBS := $(addprefix $(obj),$(LIBS-y))
 .PHONY : $(LIBS)
 


And then, build again
$ make cobra5272   CROSS_COMPILE=m68k-linux-
snip
arch/m68k/cpu/mcf52x2/start.o: In function `_start':
/home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:201:(.text+0x448):
 relocation truncated to fit: R_68K_PC16 against symbol `cpu_init_f' defined in 
.text.cpu_init_f section in arch/m68k/cpu/mcf52x2/built-in.o
/home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:202:(.text+0x44c):
 relocation truncated to fit: R_68K_PC16 against symbol `board_init_f' defined 
in .text.board_init_f section in arch/m68k/lib/built-in.o
arch/m68k/cpu/mcf52x2/start.o: In function `_exc_handler':
/home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:300:(.text+0x4da):
 relocation truncated to fit: R_68K_PC16 against symbol `exc_handler' defined 
in .text.exc_handler section in arch/m68k/lib/built-in.o
arch/m68k/cpu/mcf52x2/start.o: In function `_int_handler':
/home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:308:(.text+0x4fc):
 relocation truncated to fit: R_68K_PC16 against symbol `int_handler' defined 
in .text.int_handler section in arch/m68k/lib/built-in.o
make[1]: *** [u-boot] Error 1
make[1]: Leaving directory `/home/yamada/workspace/u-boot-org'
make: *** [cobra5272] Error 2



The build will fail with error messages
 relocation truncated to fit: R_68K_PC16 against symbol

What is this error?


And I'd say such boards are working by luck.
This means, if you add a new library, or delete an obsolete library,
or change the order of libraries, some M68K boards might get broken
all of sudden, with totally unrelated cause.

So I'm thinking the root cause of some M68K boards should be fixed.
For now it is only luckily(unluckily?) hidden.

So, I hope M68K experts will check this.


Best Regards
Masahiro Yamada

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


Re: [U-Boot] Creating U-Boot env image

2013-12-11 Thread Bo Shen

Hi Alexey Smishlayev,

On 12/09/2013 10:34 PM, Alexey Smishlayev wrote:

Hello!

I would like to flash the environment variable values to my board,
rather than setting them at the prompt. I've founa a tool mkenvimage is
made specially for that. I used it to create a binary image of the
U-Boot environment. However, when I flash it to my board, I get the message
*** Warning - bad CRC, using default environment


Can you try the sam-ba tool provide by Atmel to generate this kind of 
image? Run the bat file in demo package [1]. It will generate the image 
automatically.

More information, please reference the demo package [1].

[1] 
ftp://ftp.linux4sam.org/pub/demo/linux4sam_2.0/linux4sam-angstrom-at91sam9g20ek.zip



I thought it is due to that redundant memory wasn't written aswell, so I
commented out #define CONFIG_ENV_REDUND_OFFSET in the
include/configs/at91sam9g20ek.h, and tried once again, but I'm still
getting this error.

What should I do to flash environment values directly to the board's NAND?

Best regards,
Alexey Smishlayev


Best Regards,
Bo Shen

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


Re: [U-Boot] [PATCH 03/10] samsung: common: Add misc file and common function misc_init_r().

2013-12-11 Thread Przemyslaw Marczak

Hello Minkyu,

On 12/11/2013 09:16 AM, Minkyu Kang wrote:

On 04/12/13 03:03, Przemyslaw Marczak wrote:

Config options:
- CONFIG_SAMSUNG - misc.c
- CONFIG_MISC_INIT_R - function misc_init_r();

New file:
- board/samsung/common/misc.c

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
  board/samsung/common/Makefile |1 +
  board/samsung/common/misc.c   |   16 
  2 files changed, 17 insertions(+)
  create mode 100644 board/samsung/common/misc.c

diff --git a/board/samsung/common/Makefile b/board/samsung/common/Makefile
index 501d974..d1eb63f 100644
--- a/board/samsung/common/Makefile
+++ b/board/samsung/common/Makefile
@@ -8,3 +8,4 @@
  obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
  obj-$(CONFIG_THOR_FUNCTION) += thor.o
  obj-$(CONFIG_CMD_USB_MASS_STORAGE) += ums.o
+obj-$(CONFIG_SAMSUNG) += misc.o


Why CONFIG_SAMSUNG?
We know this Makefile is for samsung boards.

Right, I will change it to CONFIG_MISC_INIT_R, and this ifdef will be 
removed from misc.c.



diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
new file mode 100644
index 000..465895b
--- /dev/null
+++ b/board/samsung/common/misc.c
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ * Przemyslaw Marczak p.marc...@samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+
+#ifdef CONFIG_MISC_INIT_R
+/* Common for Samsung boards */
+int misc_init_r(void)
+{
+   return 0;
+}
+#endif /* CONFIG_MISC_INIT_R */



Thanks,
Minkyu Kang.




Regards
--
Przemyslaw Marczak
Samsung RD Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Some M68K boards are depending the specific order of libraries

2013-12-11 Thread Andreas Bießmann
Dear Masahiro Yamada,

On 12/11/2013 10:32 AM, Masahiro Yamada wrote:

snip

 And then, build again
 $ make cobra5272   CROSS_COMPILE=m68k-linux-
 snip
 arch/m68k/cpu/mcf52x2/start.o: In function `_start':
 /home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:201:(.text+0x448):
  relocation truncated to fit: R_68K_PC16 against symbol `cpu_init_f' defined 
 in .text.cpu_init_f section in arch/m68k/cpu/mcf52x2/built-in.o
 /home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:202:(.text+0x44c):
  relocation truncated to fit: R_68K_PC16 against symbol `board_init_f' 
 defined in .text.board_init_f section in arch/m68k/lib/built-in.o
 arch/m68k/cpu/mcf52x2/start.o: In function `_exc_handler':
 /home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:300:(.text+0x4da):
  relocation truncated to fit: R_68K_PC16 against symbol `exc_handler' defined 
 in .text.exc_handler section in arch/m68k/lib/built-in.o
 arch/m68k/cpu/mcf52x2/start.o: In function `_int_handler':
 /home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:308:(.text+0x4fc):
  relocation truncated to fit: R_68K_PC16 against symbol `int_handler' defined 
 in .text.int_handler section in arch/m68k/lib/built-in.o
 make[1]: *** [u-boot] Error 1
 make[1]: Leaving directory `/home/yamada/workspace/u-boot-org'
 make: *** [cobra5272] Error 2
 
 
 
 The build will fail with error messages
  relocation truncated to fit: R_68K_PC16 against symbol
 
 What is this error?

It is a linker error stating that the specific call (for example 'bsr
cpu_init_f' @start.S:201) will not work cause (and this is guessing) the
PC relative jump with 16 bit offset can not work cause the symbol
cpu_init_f is to far away.
I had similiar issue in linux kernel for avr32 these days. I found a
work around, please read https://lkml.org/lkml/2013/10/24/156 to
understand it.

Best regards

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


Re: [U-Boot] Some M68K boards are depending the specific order of libraries

2013-12-11 Thread Masahiro Yamada
Hi Andreas,


  The build will fail with error messages
   relocation truncated to fit: R_68K_PC16 against symbol
  
  What is this error?
 
 It is a linker error stating that the specific call (for example 'bsr
 cpu_init_f' @start.S:201) will not work cause (and this is guessing) the
 PC relative jump with 16 bit offset can not work cause the symbol
 cpu_init_f is to far away.
 I had similiar issue in linux kernel for avr32 these days. I found a
 work around, please read https://lkml.org/lkml/2013/10/24/156 to
 understand it.

Thanks!

I could understand well.
But, I am not a M68K expert, nor have a M68K board.
So, I will wait for a while until M68K maintainers catch this.

Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH 16/34] Makefile: move some flags to examples makefiles

2013-12-11 Thread Masahiro Yamada
This commit moves some flags which are used
under examples/ directory only.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 config.mk| 8 
 examples/api/Makefile| 4 
 examples/standalone/Makefile | 4 
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/config.mk b/config.mk
index dfa2ba9..f0d2217 100644
--- a/config.mk
+++ b/config.mk
@@ -102,14 +102,6 @@ CFLAGS = $(KBUILD_CFLAGS) $(CPPFLAGS)
 
 BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
 
-ifeq ($(findstring examples/,$(BCURDIR)),)
-ifeq ($(CONFIG_SPL_BUILD),)
-ifdef FTRACE
-CFLAGS += -finstrument-functions -DFTRACE
-endif
-endif
-endif
-
 AFLAGS = $(KBUILD_AFLAGS) $(CPPFLAGS)
 
 LDFLAGS += $(PLATFORM_LDFLAGS)
diff --git a/examples/api/Makefile b/examples/api/Makefile
index 52f4368..ee3c487 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -4,6 +4,10 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+ifdef FTRACE
+CFLAGS += -finstrument-functions -DFTRACE
+endif
+
 ifeq ($(ARCH),powerpc)
 LOAD_ADDR = 0x4
 endif
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index cad4409..1f8d70c 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -5,6 +5,10 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+ifdef FTRACE
+CFLAGS += -finstrument-functions -DFTRACE
+endif
+
 extra-y:= hello_world
 extra-$(CONFIG_SMC9)   += smc9_eeprom
 extra-$(CONFIG_SMC911X)+= smc911x_eeprom
-- 
1.8.3.2

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


[U-Boot] [PATCH 24/34] Kbuild: convert some make rules to Kbuild style

2013-12-11 Thread Masahiro Yamada
We can get Kbuild-ish log style like this:
  GEN include/autoconf.mk
  GEN include/autoconf.mk.dep

We do not need XECHO any more.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 70 
 1 file changed, 39 insertions(+), 31 deletions(-)

diff --git a/Makefile b/Makefile
index 3895364..2fae092 100644
--- a/Makefile
+++ b/Makefile
@@ -206,12 +206,6 @@ export HOSTARCH HOSTOS
 VENDOR=
 
 #
-# Allow for silent builds
-ifeq (,$(findstring s,$(MAKEFLAGS)))
-XECHO = echo
-else
-XECHO = :
-endif
 
 # The tools are needed early, so put this first
 # Don't include stuff already done in $(LIBS)
@@ -939,52 +933,63 @@ checkdtc:
 # This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
 # the dep file is only include in this top level makefile to determine when
 # to regenerate the autoconf.mk file.
+
+quiet_cmd_autoconf_dep = GEN $@
+  cmd_autoconf_dep = $(CC) -x c -DDO_DEPS_ONLY -M $(c_flags) \
+   -MQ include/autoconf.mk $(srctree)/include/common.h  $@ || rm $@
+
 include/autoconf.mk.dep: include/config.h include/common.h
-   @$(XECHO) Generating $@ ; \
-   : Generate the dependancies ; \
-   $(CC) -x c -DDO_DEPS_ONLY -M $(c_flags) \
-   -MQ include/autoconf.mk $(srctree)/include/common.h  $@ || \
-   rm $@
+   $(call cmd,autoconf_dep)
 
-include/autoconf.mk: include/config.h
-   @$(XECHO) Generating $@ ; \
-   : Extract the config macros ; \
+quiet_cmd_autoconf = GEN $@
+  cmd_autoconf = \
$(CPP) $(c_flags) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h  
$@.tmp  \
-   sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
+   sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
rm $@.tmp
 
+include/autoconf.mk: include/config.h
+   $(call cmd,autoconf)
+
 # Auto-generate the spl-autoconf.mk file (which is included by all makefiles 
for SPL)
-include/tpl-autoconf.mk: include/config.h
-   @$(XECHO) Generating $@ ; \
-   : Extract the config macros ; \
+quiet_cmd_tpl-autoconf = GEN $@
+  cmd_tpl-autoconf = \
$(CPP) $(c_flags) -DCONFIG_TPL_BUILD  -DCONFIG_SPL_BUILD\
-DDO_DEPS_ONLY -dM $(srctree)/include/common.h  $@.tmp 
 \
sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
rm $@.tmp
 
-include/spl-autoconf.mk: include/config.h
-   @$(XECHO) Generating $@ ; \
-   : Extract the config macros ; \
+include/tpl-autoconf.mk: include/config.h
+   $(call cmd,tpl-autoconf)
+
+quiet_cmd_spl-autoconf = GEN $@
+  cmd_spl-autoconf = \
$(CPP) $(c_flags) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM 
$(srctree)/include/common.h  $@.tmp  \
sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
rm $@.tmp
 
+include/spl-autoconf.mk: include/config.h
+   $(call cmd,spl-autoconf)
+
+quiet_cmd_offsets = GEN $@
+  cmd_offsets = $(srctree)/tools/scripts/make-asm-offsets $ $@
+
 include/generated/generic-asm-offsets.h: lib/asm-offsets.s
-   @$(XECHO) Generating $@
-   $(srctree)/tools/scripts/make-asm-offsets lib/asm-offsets.s $@
+   $(call cmd,offsets)
 
-lib/asm-offsets.s: include/config.h $(srctree)/lib/asm-offsets.c
-   @mkdir -p lib
-   $(CC) -DDO_DEPS_ONLY \
+quiet_cmd_asm-offsets.s = CC  $@
+  cmd_asm-offsets.s = mkdir -p lib; \
+   $(CC) -DDO_DEPS_ONLY \
$(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
-   -o $@ $(srctree)/lib/asm-offsets.c -c -S
+   -o $@ $ -c -S
+
+lib/asm-offsets.s: $(srctree)/lib/asm-offsets.c include/config.h
+   $(call cmd,asm-offsets.s)
 
 include/generated/asm-offsets.h: $(CPUDIR)/$(SOC)/asm-offsets.s
-   @$(XECHO) Generating $@
-   $(srctree)/tools/scripts/make-asm-offsets 
$(CPUDIR)/$(SOC)/asm-offsets.s $@
+   $(call cmd,offsets)
 
-$(CPUDIR)/$(SOC)/asm-offsets.s:include/config.h
-   @mkdir -p $(CPUDIR)/$(SOC)
+quiet_cmd_soc_asm-offsets.s = CC  $@
+  cmd_soc_asm-offsets.s = mkdir -p $(CPUDIR)/$(SOC); \
if [ -f $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
$(CC) -DDO_DEPS_ONLY \
$(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
@@ -993,6 +998,9 @@ $(CPUDIR)/$(SOC)/asm-offsets.s: include/config.h
touch $@; \
fi
 
+$(CPUDIR)/$(SOC)/asm-offsets.s:include/config.h
+   $(call cmd,soc_asm-offsets.s)
+
 #
 else   # !config.mk
 all u-boot.hex u-boot.srec u-boot.bin \
-- 
1.8.3.2

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


[U-Boot] [PATCH 02/34] Makefile.host.tmp: add a new script to refactor tools

2013-12-11 Thread Masahiro Yamada
This commit adds scripts/Makefile.host.tmp which will
be used in the next commit to convert makefiles
under tools/ directory to Kbuild style.

Notice this script, scripts/Makefile.host.tmp
is temporary.

When switching over to real Kbuild,
it will be replaced with scripts/Makefile.host of Linux Kernel.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 scripts/Makefile.build| 17 ++---
 scripts/Makefile.host.tmp | 61 +++
 2 files changed, 75 insertions(+), 3 deletions(-)
 create mode 100644 scripts/Makefile.host.tmp

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e3354aa..c451fbf 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -7,15 +7,23 @@ include $(TOPDIR)/config.mk
 LIB := $(obj)built-in.o
 LIBGCC = $(obj)libgcc.o
 SRCS :=
+subdir-y :=
+obj-dirs :=
 
 include Makefile
 
+# Do not include host rules unless needed
+ifneq ($(hostprogs-y)$(hostprogs-m),)
+include $(SRCTREE)/scripts/Makefile.host.tmp
+endif
+
 # Going forward use the following
 obj-y := $(sort $(obj-y))
 extra-y := $(sort $(extra-y))
+always := $(sort $(always))
 lib-y := $(sort $(lib-y))
 
-subdir-y   := $(patsubst %/,%,$(filter %/, $(obj-y)))
+subdir-y   += $(patsubst %/,%,$(filter %/, $(obj-y)))
 obj-y  := $(patsubst %/, %/built-in.o, $(obj-y))
 subdir-obj-y   := $(filter %/built-in.o, $(obj-y))
 subdir-obj-y   := $(addprefix $(obj),$(subdir-obj-y))
@@ -25,7 +33,8 @@ SRCS  += $(wildcard $(obj-y:.o=.c) $(obj-y:.o=.S) 
$(lib-y:.o=.c) \
 OBJS   := $(addprefix $(obj),$(obj-y))
 
 # $(obj-dirs) is a list of directories that contain object files
-obj-dirs := $(dir $(OBJS))
+
+obj-dirs += $(dir $(OBJS))
 
 # Create directories for object files if directory does not exist
 # Needed when obj-y := dir/file.o syntax is used
@@ -33,7 +42,7 @@ _dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || 
mkdir -p $(d)))
 
 LGOBJS := $(addprefix $(obj),$(sort $(lib-y)))
 
-all: $(LIB) $(addprefix $(obj),$(extra-y))
+all: $(LIB) $(addprefix $(obj),$(extra-y) $(always)) $(subdir-y)
 
 $(LIB):$(obj).depend $(OBJS)
$(call cmd_link_o_target, $(OBJS))
@@ -48,7 +57,9 @@ endif
 ifneq ($(subdir-obj-y),)
 # Descending
 $(subdir-obj-y): $(subdir-y)
+endif
 
+ifneq ($(subdir-y),)
 $(subdir-y): FORCE
$(MAKE) -C $@ -f $(TOPDIR)/scripts/Makefile.build
 endif
diff --git a/scripts/Makefile.host.tmp b/scripts/Makefile.host.tmp
new file mode 100644
index 000..4b57846
--- /dev/null
+++ b/scripts/Makefile.host.tmp
@@ -0,0 +1,61 @@
+
+__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
+
+# C code
+# Executables compiled from a single .c file
+host-csingle   := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m)))
+
+# C executables linked based on several .o files
+host-cmulti:= $(foreach m,$(__hostprogs),$(if $($(m)-objs),$(m)))
+
+# Object (.o) files compiled from .c files
+host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs)))
+
+# output directory for programs/.o files
+# hostprogs-y := tools/build may have been specified. Retrieve directory
+host-objdirs := $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f
+# directory of .o files from prog-objs notation
+host-objdirs += $(foreach f,$(host-cmulti),  \
+$(foreach m,$($(f)-objs),\
+$(if $(dir $(m)),$(dir $(m)
+
+host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs
+
+__hostprogs := $(addprefix $(obj),$(__hostprogs))
+host-csingle   := $(addprefix $(obj),$(host-csingle))
+host-cmulti:= $(addprefix $(obj),$(host-cmulti))
+host-cobjs := $(addprefix $(obj),$(host-cobjs))
+host-objdirs:= $(addprefix $(obj),$(host-objdirs))
+
+obj-dirs += $(host-objdirs)
+
+#
+# Handle options to gcc. Support building with separate output directory
+
+_hostc_flags   = $(HOSTCFLAGS)   $(HOST_EXTRACFLAGS)   \
+ $(HOSTCFLAGS_$(basetarget).o)
+
+# Find all -I options and call addtree
+flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
+
+ifeq ($(OBJTREE),$(SRCTREE))
+__hostc_flags  = $(_hostc_flags)
+else
+__hostc_flags  = -I$(obj) $(call flags,_hostc_flags)
+endif
+
+hostc_flags= $(__hostc_flags)
+
+#
+# Compile programs on the host
+
+$(host-csingle): $(obj)%: %.c
+   $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTLDFLAGS) 
$(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR)) -o $@ $
+
+$(host-cmulti): $(obj)%: $(host-cobjs)
+   $(HOSTCC) $(HOSTLDFLAGS) -o $@ $(addprefix $(obj),$($(@F)-objs)) 
$(HOSTLOADLIBES_$(@F))
+
+$(host-cobjs): $(obj)%.o: %.c
+   $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(@F)) 
$(HOSTCFLAGS_$(BCURDIR)) -o $@ $ -c
+
+targets += $(host-csingle)  $(host-cmulti) $(host-cobjs)
-- 
1.8.3.2

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


[U-Boot] [PATCH 18/34] Kbuild: add dummy obj-y to create built-in.o

2013-12-11 Thread Masahiro Yamada
We are going to switch over to Kbuild in upcoming commits.

Each makefile must have non-empty obj- or obj-y
to generate built-in.o on Kbuild.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 arch/arm/cpu/armv7/tegra114/Makefile | 3 ++-
 arch/arm/cpu/armv7/tegra30/Makefile  | 3 ++-
 arch/nds32/cpu/n1213/Makefile| 3 +++
 board/freescale/common/Makefile  | 5 -
 board/samsung/origen/Makefile| 3 +++
 board/samsung/smdkv310/Makefile  | 3 +++
 board/spear/common/Makefile  | 5 -
 board/spear/x600/Makefile| 5 -
 8 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra114/Makefile 
b/arch/arm/cpu/armv7/tegra114/Makefile
index 886b509..77e2319 100644
--- a/arch/arm/cpu/armv7/tegra114/Makefile
+++ b/arch/arm/cpu/armv7/tegra114/Makefile
@@ -17,4 +17,5 @@
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 #
 
-obj- :=
+# necessary to create built-in.o
+obj- := __dummy__.o
diff --git a/arch/arm/cpu/armv7/tegra30/Makefile 
b/arch/arm/cpu/armv7/tegra30/Makefile
index 518d6d1..413eba1 100644
--- a/arch/arm/cpu/armv7/tegra30/Makefile
+++ b/arch/arm/cpu/armv7/tegra30/Makefile
@@ -17,4 +17,5 @@
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 #
 
-obj- :=
+# necessary to create built-in.o
+obj- := __dummy__.o
diff --git a/arch/nds32/cpu/n1213/Makefile b/arch/nds32/cpu/n1213/Makefile
index bb3550e..206d304 100644
--- a/arch/nds32/cpu/n1213/Makefile
+++ b/arch/nds32/cpu/n1213/Makefile
@@ -9,4 +9,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+# necessary to create built-in.o
+obj- := __dummy__.o
+
 extra-y= start.o
diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index 25f063d..f6a0879 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -13,7 +13,10 @@ MINIMAL=y
 endif
 endif
 
-ifndef MINIMAL
+ifdef MINIMAL
+# necessary to create built-in.o
+obj- := __dummy__.o
+else
 obj-$(CONFIG_FSL_CADMUS)   += cadmus.o
 obj-$(CONFIG_FSL_VIA)  += cds_via.o
 obj-$(CONFIG_FMAN_ENET)+= fman.o
diff --git a/board/samsung/origen/Makefile b/board/samsung/origen/Makefile
index 37acba7..1add9fe 100644
--- a/board/samsung/origen/Makefile
+++ b/board/samsung/origen/Makefile
@@ -5,6 +5,9 @@
 #
 
 ifdef CONFIG_SPL_BUILD
+# necessary to create built-in.o
+obj- := __dummy__.o
+
 hostprogs-y := tools/mkorigenspl
 always := $(hostprogs-y)
 
diff --git a/board/samsung/smdkv310/Makefile b/board/samsung/smdkv310/Makefile
index 9e37b4e..de0da16 100644
--- a/board/samsung/smdkv310/Makefile
+++ b/board/samsung/smdkv310/Makefile
@@ -5,6 +5,9 @@
 #
 
 ifdef CONFIG_SPL_BUILD
+# necessary to create built-in.o
+obj- := __dummy__.o
+
 hostprogs-y := tools/mksmdkv310spl
 always := $(hostprogs-y)
 else
diff --git a/board/spear/common/Makefile b/board/spear/common/Makefile
index 08dc09f..b0ba320 100644
--- a/board/spear/common/Makefile
+++ b/board/spear/common/Makefile
@@ -5,7 +5,10 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_BUILD
+# necessary to create built-in.o
+obj- := __dummy__.o
+else
 obj-y  := spr_misc.o
 obj-y  += spr_lowlevel_init.o
 endif
diff --git a/board/spear/x600/Makefile b/board/spear/x600/Makefile
index f9053fe..18d3dd2 100644
--- a/board/spear/x600/Makefile
+++ b/board/spear/x600/Makefile
@@ -5,6 +5,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_BUILD
+# necessary to create built-in.o
+obj- := __dummy__.o
+else
 obj-y  := fpga.o x600.o
 endif
-- 
1.8.3.2

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


[U-Boot] [PATCH 15/34] Makefile: move some flags to spl/Makefile

2013-12-11 Thread Masahiro Yamada
Some flags are used for SPL (and TPL) build only.
This commit moves them from config.mk to spl/Makefile.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 config.mk| 19 ---
 spl/Makefile | 14 ++
 2 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/config.mk b/config.mk
index ef8a99e..dfa2ba9 100644
--- a/config.mk
+++ b/config.mk
@@ -95,20 +95,6 @@ RELFLAGS= $(PLATFORM_RELFLAGS)
 OBJCFLAGS += --gap-fill=0xff
 
 CPPFLAGS = $(KBUILD_CPPFLAGS) $(RELFLAGS)
-
-# Enable garbage collection of un-used sections for SPL
-ifeq ($(CONFIG_SPL_BUILD),y)
-CPPFLAGS += -ffunction-sections -fdata-sections
-LDFLAGS_FINAL += --gc-sections
-endif
-
-ifeq ($(CONFIG_SPL_BUILD),y)
-CPPFLAGS += -DCONFIG_SPL_BUILD
-ifeq ($(CONFIG_TPL_BUILD),y)
-CPPFLAGS += -DCONFIG_TPL_BUILD
-endif
-endif
-
 CPPFLAGS += $(UBOOTINCLUDE)
 CPPFLAGS += $(NOSTDINC_FLAGS) -pipe $(PLATFORM_CPPFLAGS)
 
@@ -129,11 +115,6 @@ AFLAGS = $(KBUILD_AFLAGS) $(CPPFLAGS)
 LDFLAGS += $(PLATFORM_LDFLAGS)
 LDFLAGS_FINAL += -Bstatic
 
-LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
-ifneq ($(CONFIG_SPL_TEXT_BASE),)
-LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
-endif
-
 #
 
 export PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
diff --git a/spl/Makefile b/spl/Makefile
index 13dd616..798c9f3 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -17,6 +17,15 @@
 CONFIG_SPL_BUILD := y
 export CONFIG_SPL_BUILD
 
+KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD
+ifeq ($(CONFIG_TPL_BUILD),y)
+KBUILD_CPPFLAGS += -DCONFIG_TPL_BUILD
+endif
+
+# Enable garbage collection of un-used sections for SPL
+KBUILD_CFLAGS += -ffunction-sections -fdata-sections
+LDFLAGS_FINAL += --gc-sections
+
 ifeq ($(CONFIG_TPL_BUILD),y)
 export CONFIG_TPL_BUILD
 SPL_BIN := u-boot-tpl
@@ -164,6 +173,11 @@ endif
 $(obj)$(SPL_BIN).bin:  $(obj)$(SPL_BIN)
$(OBJCOPY) $(OBJCFLAGS) -O binary $ $@
 
+LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
+endif
+
 GEN_UBOOT = \
cd $(obj)  $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(__START) \
--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
-- 
1.8.3.2

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


[U-Boot] [PATCH 14/34] Makefile: move more stuff to top Makefile

2013-12-11 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile  | 20 +---
 config.mk | 19 +--
 2 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/Makefile b/Makefile
index 4e33cc3..9560f4d 100644
--- a/Makefile
+++ b/Makefile
@@ -281,13 +281,27 @@ endif
 # load other configuration
 include $(TOPDIR)/config.mk
 
+ifneq ($(CONFIG_SYS_TEXT_BASE),)
+KBUILD_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
+endif
+
+export CONFIG_SYS_TEXT_BASE
+
+LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SYS_TEXT_BASE),)
+LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
+endif
+
 # Targets which don't build the source code
-NON_BUILD_TARGETS = backup clean clobber distclean mkproper tidy unconfig
+NON_BUILD_TARGETS = backup clean clobber distclean mkproper tidy unconfig 
%_config
 
 # Only do the generic board check when actually building, not configuring
 ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
-ifeq ($(findstring _config,$(MAKECMDGOALS)),)
-$(CHECK_GENERIC_BOARD)
+ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
+ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
+CHECK_GENERIC_BOARD = $(error Your architecture does not support generic 
board. \
+Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
+endif
 endif
 endif
 
diff --git a/config.mk b/config.mk
index 283772d..ef8a99e 100644
--- a/config.mk
+++ b/config.mk
@@ -102,10 +102,6 @@ CPPFLAGS += -ffunction-sections -fdata-sections
 LDFLAGS_FINAL += --gc-sections
 endif
 
-ifneq ($(CONFIG_SYS_TEXT_BASE),)
-CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
-endif
-
 ifeq ($(CONFIG_SPL_BUILD),y)
 CPPFLAGS += -DCONFIG_SPL_BUILD
 ifeq ($(CONFIG_TPL_BUILD),y)
@@ -113,14 +109,6 @@ CPPFLAGS += -DCONFIG_TPL_BUILD
 endif
 endif
 
-# Does this architecture support generic board init?
-ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
-ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
-CHECK_GENERIC_BOARD = $(error Your architecture does not support generic 
board. \
-Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
-endif
-endif
-
 CPPFLAGS += $(UBOOTINCLUDE)
 CPPFLAGS += $(NOSTDINC_FLAGS) -pipe $(PLATFORM_CPPFLAGS)
 
@@ -141,11 +129,6 @@ AFLAGS = $(KBUILD_AFLAGS) $(CPPFLAGS)
 LDFLAGS += $(PLATFORM_LDFLAGS)
 LDFLAGS_FINAL += -Bstatic
 
-LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL)
-ifneq ($(CONFIG_SYS_TEXT_BASE),)
-LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
-endif
-
 LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
 ifneq ($(CONFIG_SPL_TEXT_BASE),)
 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
@@ -153,4 +136,4 @@ endif
 
 #
 
-export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS 
CFLAGS AFLAGS
+export PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
-- 
1.8.3.2

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


[U-Boot] [PATCH 01/34] .gitignore: ingore files generated by Kbuild

2013-12-11 Thread Masahiro Yamada
Ignore generated files by Kbuild such as .*.cmd, *.order, etc.

Besides above,
 - Ignore *.s files
   We do not need to ignore with file name, asm-offsets.s
 - Do not ignore *.rej (for quilt)
 - Ignore backup files, \#*#

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 .gitignore | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index 3b14c25..a704488 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,13 +5,14 @@
 #
 # Normal rules
 #
-
-*.rej
-*.orig
-*.a
+.*
 *.o
+*.o.*
+*.a
+*.s
 *.su
 *~
+*.order
 *.swp
 *.patch
 *.bin
@@ -24,7 +25,6 @@
 #
 # Top-level generic files
 #
-
 /MLO*
 /SPL
 /System.map
@@ -49,6 +49,12 @@
 /u-boot.sb
 
 #
+# git files that we don't want to ignore even it they are dot-files
+#
+!.gitignore
+!.mailmap
+
+#
 # Generated files
 #
 
@@ -64,7 +70,6 @@
 /include/generated/
 /include/spl-autoconf.mk
 /include/tpl-autoconf.mk
-asm-offsets.s
 
 # stgit generated dirs
 patches-*
@@ -90,3 +95,7 @@ GPATH
 GRTAGS
 GSYMS
 GTAGS
+
+*.orig
+*~
+\#*#
-- 
1.8.3.2

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


[U-Boot] [PATCH 07/34] Makfile: move suffix rules to Makefile.build

2013-12-11 Thread Masahiro Yamada
This commit moves suffix rules from config.mk
to scripts/Makefile.build, which will allow us
to switch smoothly to real Kbuild.

Note1:
post/lib_powerpc/fpu/Makefile has
its own rule to compile C sources.
We need to tweak it to keep the same behavior.

Note2:
There are two file2 with the same name:
arch/arm/lib/crt0.S and eamples/api/crt0.S.
To keep the same build behavior,
examples/api/Makefile also has to be treaked.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 config.mk | 35 ---
 examples/api/Makefile |  4 ++--
 post/lib_powerpc/fpu/Makefile |  2 +-
 scripts/Makefile.build| 31 +++
 4 files changed, 34 insertions(+), 38 deletions(-)

diff --git a/config.mk b/config.mk
index 07afb35..b08be7a 100644
--- a/config.mk
+++ b/config.mk
@@ -318,38 +318,3 @@ endif
 export HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE \
AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP MAKE
 export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS 
CFLAGS AFLAGS
-
-#
-
-# Allow boards to use custom optimize flags on a per dir/file basis
-ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
-ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
-EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR))
-ALL_CFLAGS += $(EXTRA_CPPFLAGS)
-
-# The _DEP version uses the $ file target (for dependency generation)
-# See rules.mk
-EXTRA_CPPFLAGS_DEP = $(CPPFLAGS_$(BCURDIR)/$(addsuffix .o,$(basename $))) \
-   $(CPPFLAGS_$(BCURDIR))
-$(obj)%.s: %.S
-   $(CPP) $(ALL_AFLAGS) -o $@ $
-$(obj)%.o: %.S
-   $(CC)  $(ALL_AFLAGS) -o $@ $ -c
-$(obj)%.o: %.c
-ifneq ($(CHECKSRC),0)
-   $(CHECK) $(CHECKFLAGS) $(ALL_CFLAGS) $
-endif
-   $(CC)  $(ALL_CFLAGS) -o $@ $ -c
-$(obj)%.i: %.c
-   $(CPP) $(ALL_CFLAGS) -o $@ $ -c
-$(obj)%.s: %.c
-   $(CC)  $(ALL_CFLAGS) -o $@ $ -c -S
-
-#
-
-# If the list of objects to link is empty, just create an empty built-in.o
-cmd_link_o_target = $(if $(strip $1),\
- $(LD) $(LDFLAGS) -r -o $@ $1,\
- rm -f $@; $(AR) rcs $@ )
-
-#
diff --git a/examples/api/Makefile b/examples/api/Makefile
index f770859..52f4368 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -50,9 +50,9 @@ $(obj)demo.bin: $(obj)demo
$(OBJCOPY) -O binary $ $@ 2/dev/null
 
 # Rule to build generic library C files
-$(obj)%.o: $(SRCTREE)/lib/%.c
+$(addprefix $(obj),$(notdir $(EXT_COBJ_FILES-y))): $(obj)%.o: 
$(SRCTREE)/lib/%.c
$(CC) -g $(CFLAGS) -c -o $@ $
 
 # Rule to build architecture-specific library assembly files
-$(obj)%.o: $(SRCTREE)/arch/$(ARCH)/lib/%.S
+$(addprefix $(obj),$(notdir $(EXT_SOBJ_FILES-y))): $(obj)%.o: 
$(SRCTREE)/arch/$(ARCH)/lib/%.S
$(CC) -g $(CFLAGS) -c -o $@ $
diff --git a/post/lib_powerpc/fpu/Makefile b/post/lib_powerpc/fpu/Makefile
index ae56a82..a7aa5bc 100644
--- a/post/lib_powerpc/fpu/Makefile
+++ b/post/lib_powerpc/fpu/Makefile
@@ -18,7 +18,7 @@ obj-y += darwin-ldouble.o
 CFLAGS := $(shell echo $(CFLAGS) | sed s/-msoft-float//)
 CFLAGS += -mhard-float -fkeep-inline-functions
 
-$(obj)%.o: %.c
+$(addprefix $(obj),$(obj-y)): $(obj)%.o:   %.c
$(CC)  $(ALL_CFLAGS) -o $@.fp $ -c
$(OBJCOPY) -R .gnu.attributes $@.fp $@
rm -f $@.fp
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 50c0394..1b3d77f 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -67,6 +67,37 @@ endif
 
 #
 
+# Allow boards to use custom optimize flags on a per dir/file basis
+ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
+ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
+EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR))
+ALL_CFLAGS += $(EXTRA_CPPFLAGS)
+
+# The _DEP version uses the $ file target (for dependency generation)
+# See rules.mk
+EXTRA_CPPFLAGS_DEP = $(CPPFLAGS_$(BCURDIR)/$(addsuffix .o,$(basename $))) \
+   $(CPPFLAGS_$(BCURDIR))
+$(obj)%.s: %.S
+   $(CPP) $(ALL_AFLAGS) -o $@ $
+$(obj)%.o: %.S
+   $(CC)  $(ALL_AFLAGS) -o $@ $ -c
+$(obj)%.o: %.c
+ifneq ($(CHECKSRC),0)
+   $(CHECK) $(CHECKFLAGS) $(ALL_CFLAGS) $
+endif
+   $(CC)  $(ALL_CFLAGS) -o $@ $ -c
+$(obj)%.i: %.c
+   $(CPP) $(ALL_CFLAGS) -o $@ $ -c
+$(obj)%.s: %.c
+   $(CC)  $(ALL_CFLAGS) -o $@ $ -c -S
+
+# If the list of objects to link is empty, just create an empty built-in.o
+cmd_link_o_target = $(if $(strip $1),\
+ $(LD) $(LDFLAGS) -r -o $@ $1,\
+ rm -f $@; $(AR) rcs $@ )
+

[U-Boot] [PATCH 09/34] Makefile: move BFD_ROOT_DIR to tools/gdb/Makefile

2013-12-11 Thread Masahiro Yamada
BFD_ROOT_DIR is used only in tools/gdb/Makefile

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 config.mk  | 23 ---
 tools/gdb/Makefile | 21 +
 2 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/config.mk b/config.mk
index 74617d3..dfe81fa 100644
--- a/config.mk
+++ b/config.mk
@@ -220,29 +220,6 @@ ifneq ($(CONFIG_SPL_TEXT_BASE),)
 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
 endif
 
-# Location of a usable BFD library, where we define usable as
-# built for ${HOST}, supports ${TARGET}.  Sensible values are
-# - When cross-compiling: the root of the cross-environment
-# - Linux/ppc (native): /usr
-# - NetBSD/ppc (native): you lose ... (must extract these from the
-#   binutils build directory, plus the native and U-Boot include
-#   files don't like each other)
-#
-# So far, this is used only by tools/gdb/Makefile.
-
-ifeq ($(HOSTOS),darwin)
-BFD_ROOT_DIR = /usr/local/tools
-else
-ifeq ($(HOSTARCH),$(ARCH))
-# native
-BFD_ROOT_DIR = /usr
-else
-#BFD_ROOT_DIR =/LinuxPPC/CDK   # Linux/i386
-#BFD_ROOT_DIR =/usr/pkg/cross  # NetBSD/i386
-BFD_ROOT_DIR = /opt/powerpc
-endif
-endif
-
 #
 
 export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS 
CFLAGS AFLAGS
diff --git a/tools/gdb/Makefile b/tools/gdb/Makefile
index 850bb9b..4513320 100644
--- a/tools/gdb/Makefile
+++ b/tools/gdb/Makefile
@@ -10,6 +10,27 @@
 
 ifneq ($(HOSTOS),cygwin)
 
+# Location of a usable BFD library, where we define usable as
+# built for ${HOST}, supports ${TARGET}.  Sensible values are
+# - When cross-compiling: the root of the cross-environment
+# - Linux/ppc (native): /usr
+# - NetBSD/ppc (native): you lose ... (must extract these from the
+#   binutils build directory, plus the native and U-Boot include
+#   files don't like each other)
+
+ifeq ($(HOSTOS),darwin)
+BFD_ROOT_DIR = /usr/local/tools
+else
+ifeq ($(HOSTARCH),$(ARCH))
+# native
+BFD_ROOT_DIR = /usr
+else
+#BFD_ROOT_DIR =/LinuxPPC/CDK   # Linux/i386
+#BFD_ROOT_DIR =/usr/pkg/cross  # NetBSD/i386
+BFD_ROOT_DIR = /opt/powerpc
+endif
+endif
+
 #
 # Use native tools and options
 #
-- 
1.8.3.2

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


[U-Boot] [PATCH 08/34] Makefile: move some variable definitions to the top Makefile

2013-12-11 Thread Masahiro Yamada
This commit moves some variable definitions from config.mk
to the top Makefile:

  - HOSTCC, HOSTCFLAGS, HOSTLDFLAGS
  - AS, LD, CC, CPP, etc.
  - SHELL (renamed to CONFIG_SHELL)

I'd like to slim down config.mk file
because it is included from all resursive make.
It is redundant to re-define the variables
every time descending into sub directories.
We should rather define them at the top Makefile
and export them.

SHELL has been renamed to CONFIG_SHELL because
Kbuild uses CONFIG_SHELL, not SHELL.
Some build scripts will be imported from Linux Kernel
in the upcoming commits.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile  | 67 ++
 config.mk | 78 +++
 2 files changed, 70 insertions(+), 75 deletions(-)

diff --git a/Makefile b/Makefile
index 44742f4..1dcbae3 100644
--- a/Makefile
+++ b/Makefile
@@ -161,6 +161,73 @@ ifeq ($(HOSTARCH),$(ARCH))
 CROSS_COMPILE ?=
 endif
 
+# SHELL used by kbuild
+CONFIG_SHELL := $(shell if [ -x $$BASH ]; then echo $$BASH; \
+ else if [ -x /bin/bash ]; then echo /bin/bash; \
+ else echo sh; fi ; fi)
+
+HOSTCC   = gcc
+HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+
+ifeq ($(HOSTOS),cygwin)
+HOSTCFLAGS += -ansi
+endif
+
+# Mac OS X / Darwin's C preprocessor is Apple specific.  It
+# generates numerous errors and warnings.  We want to bypass it
+# and use GNU C's cpp. To do this we pass the -traditional-cpp
+# option to the compiler.  Note that the -traditional-cpp flag
+# DOES NOT have the same semantics as GNU C's flag, all it does
+# is invoke the GNU preprocessor in stock ANSI/ISO C fashion.
+#
+# Apple's linker is similar, thanks to the new 2 stage linking
+# multiple symbol definitions are treated as errors, hence the
+# -multiply_defined suppress option to turn off this error.
+#
+ifeq ($(HOSTOS),darwin)
+# get major and minor product version (e.g. '10' and '6' for Snow Leopard)
+DARWIN_MAJOR_VERSION   = $(shell sw_vers -productVersion | cut -f 1 -d '.')
+DARWIN_MINOR_VERSION   = $(shell sw_vers -productVersion | cut -f 2 -d '.')
+
+os_x_before= $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \
+   $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo $(3); else echo 
$(4); fi ;)
+
+# Snow Leopards build environment has no longer restrictions as described above
+HOSTCC   = $(call os_x_before, 10, 5, cc, gcc)
+HOSTCFLAGS  += $(call os_x_before, 10, 4, -traditional-cpp)
+HOSTLDFLAGS += $(call os_x_before, 10, 5, -multiply_defined suppress)
+endif
+
+# Make variables (CC, etc...)
+
+AS = $(CROSS_COMPILE)as
+# Always use GNU ld
+ifneq ($(shell $(CROSS_COMPILE)ld.bfd -v 2 /dev/null),)
+LD = $(CROSS_COMPILE)ld.bfd
+else
+LD = $(CROSS_COMPILE)ld
+endif
+CC = $(CROSS_COMPILE)gcc
+CPP= $(CC) -E
+AR = $(CROSS_COMPILE)ar
+NM = $(CROSS_COMPILE)nm
+LDR= $(CROSS_COMPILE)ldr
+STRIP  = $(CROSS_COMPILE)strip
+OBJCOPY= $(CROSS_COMPILE)objcopy
+OBJDUMP= $(CROSS_COMPILE)objdump
+AWK= awk
+RANLIB = $(CROSS_COMPILE)RANLIB
+DTC= dtc
+CHECK  = sparse
+
+CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
+ -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
+
+export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
+export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
+export MAKE AWK
+export DTC CHECK CHECKFLAGS
+
 # load other configuration
 include $(TOPDIR)/config.mk
 
diff --git a/config.mk b/config.mk
index b08be7a..74617d3 100644
--- a/config.mk
+++ b/config.mk
@@ -6,13 +6,6 @@
 #
 #
 
-# Set shell to bash if possible, otherwise fall back to sh
-SHELL := $(shell if [ -x $$BASH ]; then echo $$BASH; \
-   else if [ -x /bin/bash ]; then echo /bin/bash; \
-   else echo sh; fi; fi)
-
-export SHELL
-
 ifeq ($(CURDIR),$(SRCTREE))
 dir :=
 else
@@ -55,44 +48,6 @@ PLATFORM_CPPFLAGS =
 PLATFORM_LDFLAGS =
 
 #
-
-HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
- $(HOSTCPPFLAGS)
-
-#
-# Mac OS X / Darwin's C preprocessor is Apple specific.  It
-# generates numerous errors and warnings.  We want to bypass it
-# and use GNU C's cpp. To do this we pass the -traditional-cpp
-# option to the compiler.  Note that the -traditional-cpp flag
-# DOES NOT have the same semantics as GNU C's flag, all it does
-# is invoke the GNU preprocessor in stock ANSI/ISO C fashion.
-#
-# Apple's linker is similar, thanks to the new 2 stage linking
-# multiple symbol definitions are treated as errors, hence the
-# -multiply_defined suppress option to turn off this error.
-#
-
-ifeq ($(HOSTOS),darwin)
-# get major and minor product version (e.g. 

[U-Boot] [PATCH 22/34] Kbuild: delete temporary build scripts

2013-12-11 Thread Masahiro Yamada
We had switched to Kbuild.
We do not need old build scripts any more.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 rules.mk   |  30 ---
 scripts/Makefile.build.tmp | 127 -
 scripts/Makefile.host.tmp  |  61 --
 3 files changed, 218 deletions(-)
 delete mode 100644 rules.mk
 delete mode 100644 scripts/Makefile.build.tmp
 delete mode 100644 scripts/Makefile.host.tmp

diff --git a/rules.mk b/rules.mk
deleted file mode 100644
index 8cbd84a..000
--- a/rules.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# (C) Copyright 2006-2013
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-#
-
-_depend:   $(obj)/.depend
-
-# Join all the dependencies into a single file, in three parts
-#  1 .Concatenate all the generated depend files together
-#  2. Add in the deps from OTHER_SRCS which we couldn't process
-#  3. Add in the HOSTSRCS
-$(obj)/.depend:$(TOPDIR)/config.mk $(SRCS) \
-   $(HOSTSRCS)
-   cat /dev/null $(DEPS) $@
-   @for f in $(SRCS); do \
-   g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \
-   $(CC) -M $(CPPFLAGS) -MQ $(obj)/$$g $$f  $@ ; \
-   done
-   @for f in $(HOSTSRCS); do \
-   g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \
-   $(HOSTCC) -M $(HOSTCPPFLAGS) -MQ $(obj)/$$g $$f  $@ ; \
-   done
-
-MAKE_DEPEND = $(CC) -M $(CPPFLAGS) $(EXTRA_CPPFLAGS_DEP) \
-   -MQ $(addsuffix .o,$(obj)$(basename $)) $ $@
-
-#
diff --git a/scripts/Makefile.build.tmp b/scripts/Makefile.build.tmp
deleted file mode 100644
index 52a44ff..000
--- a/scripts/Makefile.build.tmp
+++ /dev/null
@@ -1,127 +0,0 @@
-# our default target
-.PHONY: all
-all:
-
-ifeq ($(CONFIG_TPL_BUILD),y)
-  src := $(patsubst tpl/%,%,$(obj))
-else
-  ifeq ($(CONFIG_SPL_BUILD),y)
-src := $(patsubst spl/%,%,$(obj))
-  else
-src := $(obj)
-  endif
-endif
-
-include $(srctree)/scripts/Kbuild.include
-include $(srctree)/config.mk
-
-# variable LIB is used in examples/standalone/Makefile
-__LIB := $(obj)/built-in.o
-LIBGCC = $(obj)/libgcc.o
-SRCS :=
-subdir-y :=
-obj-dirs :=
-
-kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-include $(kbuild-dir)/Makefile
-
-# Do not include host rules unless needed
-ifneq ($(hostprogs-y)$(hostprogs-m),)
-include $(SRCTREE)/scripts/Makefile.host.tmp
-endif
-
-# Going forward use the following
-obj-y := $(sort $(obj-y))
-extra-y := $(sort $(extra-y))
-always := $(sort $(always))
-lib-y := $(sort $(lib-y))
-
-subdir-y   += $(patsubst %/,%,$(filter %/, $(obj-y)))
-obj-y  := $(patsubst %/, %/built-in.o, $(obj-y))
-subdir-obj-y   := $(filter %/built-in.o, $(obj-y))
-subdir-obj-y   := $(addprefix $(obj)/,$(subdir-obj-y))
-
-SRCS   += $(obj-y:.o=.c) $(obj-y:.o=.S) $(lib-y:.o=.c) \
-   $(lib-y:.o=.S) $(extra-y:.o=.c) $(extra-y:.o=.S)
-
-SRCS := $(addprefix $(if $(KBUILD_SRC),$(srctree)/$(src)/,$(src)/),$(SRCS))
-SRCS := $(wildcard $(SRCS))
-
-OBJS   := $(addprefix $(obj)/,$(obj-y))
-
-# $(obj-dirs) is a list of directories that contain object files
-
-obj-dirs += $(dir $(OBJS))
-
-_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
-
-# Create directories for object files if directory does not exist
-# Needed when obj-y := dir/file.o syntax is used
-_dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
-
-LGOBJS := $(addprefix $(obj)/,$(sort $(lib-y)))
-
-all: $(__LIB) $(addprefix $(obj)/,$(extra-y) $(always)) $(subdir-y)
-
-$(__LIB):  $(obj)/.depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-ifneq ($(strip $(lib-y)),)
-all: $(LIBGCC)
-
-$(LIBGCC): $(obj)/.depend $(LGOBJS)
-   $(call cmd_link_o_target, $(LGOBJS))
-endif
-
-ifneq ($(subdir-obj-y),)
-# Descending
-$(subdir-obj-y): $(subdir-y)
-endif
-
-ifneq ($(subdir-y),)
-$(subdir-y): FORCE
-   $(MAKE) $(build)=$(obj)/$@
-endif
-
-#
-
-# Allow boards to use custom optimize flags on a per dir/file basis
-ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
-ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
-EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR))
-ALL_CFLAGS += $(EXTRA_CPPFLAGS)
-
-# The _DEP version uses the $ file target (for dependency generation)
-# See rules.mk
-EXTRA_CPPFLAGS_DEP = $(CPPFLAGS_$(BCURDIR)/$(addsuffix .o,$(basename $))) \
-   $(CPPFLAGS_$(BCURDIR))
-$(obj)/%.s:$(src)/%.S
-   $(CPP) $(ALL_AFLAGS) -o $@ $
-$(obj)/%.o:$(src)/%.S
-   $(CC)  $(ALL_AFLAGS) -o $@ $ -c
-$(obj)/%.o:$(src)/%.c
-ifneq ($(CHECKSRC),0)
-   $(CHECK) $(CHECKFLAGS) $(ALL_CFLAGS) $
-endif
-   $(CC)  

[U-Boot] [PATCH 29/34] examples: move api/ and standalone/ to examples/Makefile

2013-12-11 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 5 +
 examples/Makefile| 9 +
 examples/api/Makefile| 4 
 examples/standalone/Makefile | 4 
 4 files changed, 10 insertions(+), 12 deletions(-)
 create mode 100644 examples/Makefile

diff --git a/Makefile b/Makefile
index a1be86f..31903e3 100644
--- a/Makefile
+++ b/Makefile
@@ -587,11 +587,8 @@ SUBDIRS = $(SUBDIR_TOOLS)
 
 .PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
 
-SUBDIR_EXAMPLES-y := examples/standalone
-SUBDIR_EXAMPLES-$(CONFIG_API) += examples/api
-ifndef CONFIG_SANDBOX
+SUBDIR_EXAMPLES-y := examples
 SUBDIRS += $(SUBDIR_EXAMPLES-y)
-endif
 
 #
 # U-Boot objectsorder is important (i.e. start must be first)
diff --git a/examples/Makefile b/examples/Makefile
new file mode 100644
index 000..18d008e
--- /dev/null
+++ b/examples/Makefile
@@ -0,0 +1,9 @@
+ifndef CONFIG_SANDBOX
+
+ifdef FTRACE
+subdir-ccflags-y += -finstrument-functions -DFTRACE
+endif
+
+subdir-y += standalone
+subdir-$(CONFIG_API) += api
+endif
diff --git a/examples/api/Makefile b/examples/api/Makefile
index 8b79886..09475f8 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -4,10 +4,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef FTRACE
-ccflags-y += -finstrument-functions -DFTRACE
-endif
-
 ifeq ($(ARCH),powerpc)
 LOAD_ADDR = 0x4
 endif
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index ca62e2a..6a5f1ff 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -5,10 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef FTRACE
-ccflags-y += -finstrument-functions -DFTRACE
-endif
-
 extra-y:= hello_world
 extra-$(CONFIG_SMC9)   += smc9_eeprom
 extra-$(CONFIG_SMC911X)+= smc911x_eeprom
-- 
1.8.3.2

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


[U-Boot] [PATCH 30/34] Kbuild: refactor Makefile and spl/Makefile more

2013-12-11 Thread Masahiro Yamada
This commit refactors rules of directory descending
and defines u-boot-dirs and u-boot-all-dirs.
(We will need u-boot-all-dirs when using
scripts/Makefile.clean)

Additionally, rename LIBS-y to libs-y.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 163 ++-
 spl/Makefile | 106 +++---
 2 files changed, 139 insertions(+), 130 deletions(-)

diff --git a/Makefile b/Makefile
index 31903e3..d89f689 100644
--- a/Makefile
+++ b/Makefile
@@ -578,17 +578,7 @@ CHECKFLAGS += $(NOSTDINC_FLAGS)
 cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS)
 c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 
-# The tools are needed early, so put this first
-# Don't include stuff already done in $(LIBS)
-# The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
-# is yes), so compile examples after U-Boot is compiled.
-SUBDIR_TOOLS = tools
-SUBDIRS = $(SUBDIR_TOOLS)
-
-.PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
-
-SUBDIR_EXAMPLES-y := examples
-SUBDIRS += $(SUBDIR_EXAMPLES-y)
+.PHONY : $(VERSION_FILE) $(TIMESTAMP_FILE)
 
 #
 # U-Boot objectsorder is important (i.e. start must be first)
@@ -597,70 +587,76 @@ head-y := $(CPUDIR)/start.o
 head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o
 head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o
 
-OBJS := $(head-y)
-
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard 
$(srctree)/board/$(VENDOR)/common/Makefile),y,n)
 
-LIBS-y += lib/
-LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
-LIBS-y += $(CPUDIR)/
+libs-y += lib/
+libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
+libs-y += $(CPUDIR)/
 ifdef SOC
-LIBS-y += $(CPUDIR)/$(SOC)/
+libs-y += $(CPUDIR)/$(SOC)/
 endif
-LIBS-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/
-LIBS-$(CONFIG_OF_EMBED) += dts/
-LIBS-y += arch/$(ARCH)/lib/
-LIBS-y += fs/
-LIBS-y += net/
-LIBS-y += disk/
-LIBS-y += drivers/
-LIBS-y += drivers/dma/
-LIBS-y += drivers/gpio/
-LIBS-y += drivers/i2c/
-LIBS-y += drivers/input/
-LIBS-y += drivers/mmc/
-LIBS-y += drivers/mtd/
-LIBS-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
-LIBS-y += drivers/mtd/onenand/
-LIBS-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
-LIBS-y += drivers/mtd/spi/
-LIBS-y += drivers/net/
-LIBS-y += drivers/net/phy/
-LIBS-y += drivers/pci/
-LIBS-y += drivers/power/ \
+libs-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/
+libs-$(CONFIG_OF_EMBED) += dts/
+libs-y += arch/$(ARCH)/lib/
+libs-y += fs/
+libs-y += net/
+libs-y += disk/
+libs-y += drivers/
+libs-y += drivers/dma/
+libs-y += drivers/gpio/
+libs-y += drivers/i2c/
+libs-y += drivers/input/
+libs-y += drivers/mmc/
+libs-y += drivers/mtd/
+libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
+libs-y += drivers/mtd/onenand/
+libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
+libs-y += drivers/mtd/spi/
+libs-y += drivers/net/
+libs-y += drivers/net/phy/
+libs-y += drivers/pci/
+libs-y += drivers/power/ \
drivers/power/fuel_gauge/ \
drivers/power/mfd/ \
drivers/power/pmic/ \
drivers/power/battery/
-LIBS-y += drivers/spi/
-LIBS-$(CONFIG_FMAN_ENET) += drivers/net/fm/
-LIBS-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
-LIBS-y += drivers/serial/
-LIBS-y += drivers/usb/eth/
-LIBS-y += drivers/usb/gadget/
-LIBS-y += drivers/usb/host/
-LIBS-y += drivers/usb/musb/
-LIBS-y += drivers/usb/musb-new/
-LIBS-y += drivers/usb/phy/
-LIBS-y += drivers/usb/ulpi/
-LIBS-y += common/
-LIBS-y += lib/libfdt/
-LIBS-$(CONFIG_API) += api/
-LIBS-$(CONFIG_HAS_POST) += post/
-LIBS-y += test/
+libs-y += drivers/spi/
+libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
+libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
+libs-y += drivers/serial/
+libs-y += drivers/usb/eth/
+libs-y += drivers/usb/gadget/
+libs-y += drivers/usb/host/
+libs-y += drivers/usb/musb/
+libs-y += drivers/usb/musb-new/
+libs-y += drivers/usb/phy/
+libs-y += drivers/usb/ulpi/
+libs-y += common/
+libs-y += lib/libfdt/
+libs-$(CONFIG_API) += api/
+libs-$(CONFIG_HAS_POST) += post/
+libs-y += test/
 
 ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610))
-LIBS-y += arch/$(ARCH)/imx-common/
+libs-y += arch/$(ARCH)/imx-common/
 endif
 
-LIBS-$(CONFIG_ARM) += arch/arm/cpu/
-LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/
+libs-$(CONFIG_ARM) += arch/arm/cpu/
+libs-$(CONFIG_PPC) += arch/powerpc/cpu/
+
+libs-y += board/$(BOARDDIR)/
+
+libs-y := $(sort $(libs-y))
 
-LIBS-y += board/$(BOARDDIR)/
+u-boot-dirs:= $(patsubst %/,%,$(filter %/, $(libs-y))) tools examples
+
+u-boot-alldirs := $(sort $(u-boot-dirs) $(patsubst %/,%,$(filter %/, 
$(libs-
+
+libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
+
+u-boot-init := $(head-y)
+u-boot-main := $(libs-y)
 
-LIBS-y := $(patsubst %/, %/built-in.o, $(LIBS-y))
-LIBS := $(sort $(LIBS-y))
-.PHONY : $(LIBS)
 
 # Add GCC lib
 ifdef USE_PRIVATE_LIBGCC
@@ -730,7 +726,7 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += 

[U-Boot] [PATCH 03/34] tools: convert makefiles to kbuild style

2013-12-11 Thread Masahiro Yamada
Before this commit, makefiles under tools/ directory
were implemented with their own way.

This commit refactors them by using hostprogs-y variable.

Several C sources have been added to wrap other C sources
to simplify Makefile.
For example, tools/crc32.c includes lib/crc32.c

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile  |  18 +--
 config.mk |  28 +
 rules.mk  |   5 -
 spl/Makefile  |   4 +-
 tools/.gitignore  |   2 +-
 tools/Makefile| 295 +++---
 tools/crc32.c |   1 +
 tools/easylogo/Makefile   |  12 +-
 tools/env/Makefile|  32 ++---
 tools/env/crc32.c |   1 +
 tools/env/ctype.c |   1 +
 tools/env/env_attr.c  |   1 +
 tools/env/env_flags.c |   1 +
 tools/env/linux_string.c  |   1 +
 tools/env_embedded.c  |   1 +
 tools/fdt.c   |   1 +
 tools/fdt_ro.c|   1 +
 tools/fdt_rw.c|   1 +
 tools/fdt_strerror.c  |   1 +
 tools/fdt_wip.c   |   1 +
 tools/gdb/Makefile|  43 +--
 tools/image-fit.c |   1 +
 tools/image-sig.c |   1 +
 tools/image.c |   1 +
 tools/kernel-doc/Makefile |  21 +---
 tools/md5.c   |   1 +
 tools/rsa-sign.c  |   1 +
 tools/sha1.c  |   1 +
 28 files changed, 148 insertions(+), 330 deletions(-)
 create mode 100644 tools/crc32.c
 create mode 100644 tools/env/crc32.c
 create mode 100644 tools/env/ctype.c
 create mode 100644 tools/env/env_attr.c
 create mode 100644 tools/env/env_flags.c
 create mode 100644 tools/env/linux_string.c
 create mode 100644 tools/env_embedded.c
 create mode 100644 tools/fdt.c
 create mode 100644 tools/fdt_ro.c
 create mode 100644 tools/fdt_rw.c
 create mode 100644 tools/fdt_strerror.c
 create mode 100644 tools/fdt_wip.c
 create mode 100644 tools/image-fit.c
 create mode 100644 tools/image-sig.c
 create mode 100644 tools/image.c
 create mode 100644 tools/md5.c
 create mode 100644 tools/rsa-sign.c
 create mode 100644 tools/sha1.c

diff --git a/Makefile b/Makefile
index f678c4b..9479788 100644
--- a/Makefile
+++ b/Makefile
@@ -126,6 +126,8 @@ unexport CDPATH
 
 #
 
+build := -f $(TOPDIR)/scripts/Makefile.build -C
+
 # The tools are needed early, so put this first
 # Don't include stuff already done in $(LIBS)
 # The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
@@ -348,8 +350,6 @@ ALL-y += $(obj)u-boot-nodtb-tegra.bin
 endif
 endif
 
-build := -f $(TOPDIR)/scripts/Makefile.build -C
-
 all:   $(ALL-y) $(SUBDIR_EXAMPLES-y)
 
 $(obj)u-boot.dtb:  checkdtc $(obj)u-boot
@@ -535,7 +535,10 @@ $(OBJS):
 $(LIBS):   depend $(SUBDIR_TOOLS)
$(MAKE) $(build) $(dir $(subst $(obj),,$@))
 
-$(SUBDIRS):depend
+tools: depend
+   $(MAKE) $(build) $@ all
+
+$(filter-out tools,$(SUBDIRS)):depend
$(MAKE) -C $@ all
 
 $(SUBDIR_EXAMPLES-y): $(obj)u-boot
@@ -688,7 +691,7 @@ depend dep tags ctags etags cscope $(obj)System.map:
@ exit 1
 
 tools: $(VERSION_FILE) $(TIMESTAMP_FILE)
-   $(MAKE) -C $@ all
+   $(MAKE) $(build) $@ all
 endif  # config.mk
 
 # ARM relocations should all be R_ARM_RELATIVE.
@@ -719,14 +722,15 @@ $(TIMESTAMP_FILE):
@cmp -s $@ $@.tmp  rm -f $@.tmp || mv -f $@.tmp $@
 
 easylogo env gdb:
-   $(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}
+   $(MAKE) $(build) tools/$@ MTD_VERSION=${MTD_VERSION}
+
 gdbtools: gdb
 
 xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc
$(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@
 
 tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE)
-   $(MAKE) -C tools HOST_TOOLS_ALL=y
+   $(MAKE) $(build) tools HOST_TOOLS_ALL=y
 
 .PHONY : CHANGELOG
 CHANGELOG:
@@ -770,7 +774,7 @@ clean:
   $(obj)tools/gdb/{gdbcont,gdbsend}  \
   $(obj)tools/gen_eth_addr$(obj)tools/img2srec   \
   $(obj)tools/mk{env,}image   $(obj)tools/mpc86x_clk \
-  $(obj)tools/mk{$(BOARD),}spl   \
+  $(obj)tools/mk{$(BOARD),exynos}spl \
   $(obj)tools/mxsboot\
   $(obj)tools/ncb $(obj)tools/ubsha1 \
   $(obj)tools/kernel-doc/docproc \
diff --git a/config.mk b/config.mk
index 60e297a..07afb35 100644
--- a/config.mk
+++ b/config.mk
@@ -58,7 +58,6 @@ PLATFORM_LDFLAGS =
 
 HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
  $(HOSTCPPFLAGS)
-HOSTSTRIP  = strip
 
 #
 # Mac OS X / Darwin's C preprocessor is Apple specific.  It
@@ -93,13 +92,6 @@ ifeq ($(HOSTOS),cygwin)
 HOSTCFLAGS += -ansi
 endif
 
-# We 

[U-Boot] [PATCH 11/34] Kbuild: Use Kbuild.include

2013-12-11 Thread Masahiro Yamada
This commit adjusts some files to use Kbuild.include.

 - Use cc-option defined in Kbuild.include
(Delete cc-option in config.mk)
 - Use cc-version defined in
(Delete cc-version in config.mk)
 - Move binutils-version and dtc-version to Kbuild.include
 by analogy to cc-version

This commit also adds srctree (same as SRCTREE)
to use Kbuild scripts.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile   |  9 ++---
 config.mk  | 29 -
 scripts/Kbuild.include |  8 +++-
 scripts/Makefile.build |  1 +
 spl/Makefile   |  4 ++--
 5 files changed, 16 insertions(+), 35 deletions(-)

diff --git a/Makefile b/Makefile
index 1dcbae3..02fb5fa 100644
--- a/Makefile
+++ b/Makefile
@@ -102,9 +102,10 @@ OBJTREE:= $(if 
$(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
 SPLTREE:= $(OBJTREE)/spl
 TPLTREE:= $(OBJTREE)/tpl
 SRCTREE:= $(CURDIR)
+srctree:= $(SRCTREE)
 TOPDIR := $(SRCTREE)
 LNDIR  := $(OBJTREE)
-export TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE
+export TOPDIR SRCTREE srctree OBJTREE SPLTREE TPLTREE
 
 MKCONFIG   := $(SRCTREE)/mkconfig
 export MKCONFIG
@@ -126,8 +127,6 @@ unexport CDPATH
 
 #
 
-build := -f $(TOPDIR)/scripts/Makefile.build -C
-
 # The tools are needed early, so put this first
 # Don't include stuff already done in $(LIBS)
 # The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
@@ -198,6 +197,10 @@ HOSTCFLAGS  += $(call os_x_before, 10, 4, 
-traditional-cpp)
 HOSTLDFLAGS += $(call os_x_before, 10, 5, -multiply_defined suppress)
 endif
 
+# We need some generic definitions (do not try to remake the file).
+$(srctree)/scripts/Kbuild.include: ;
+include $(srctree)/scripts/Kbuild.include
+
 # Make variables (CC, etc...)
 
 AS = $(CROSS_COMPILE)as
diff --git a/config.mk b/config.mk
index dfe81fa..ba42641 100644
--- a/config.mk
+++ b/config.mk
@@ -48,35 +48,6 @@ PLATFORM_CPPFLAGS =
 PLATFORM_LDFLAGS =
 
 #
-#
-# Option checker, gcc version (courtesy linux kernel) to ensure
-# only supported compiler options are used
-#
-CC_OPTIONS_CACHE_FILE := $(OBJTREE)/include/generated/cc_options.mk
-CC_TEST_OFILE := $(OBJTREE)/include/generated/cc_test_file.o
-
--include $(CC_OPTIONS_CACHE_FILE)
-
-cc-option-sys = $(shell mkdir -p $(dir $(CC_TEST_OFILE)); \
-   if $(CC) $(CFLAGS) $(1) -S -xc /dev/null -o $(CC_TEST_OFILE) \
-/dev/null 21; then \
-   echo 'CC_OPTIONS += $(strip $1)'  $(CC_OPTIONS_CACHE_FILE); \
-   echo $(1); fi)
-
-ifeq ($(CONFIG_CC_OPT_CACHE_DISABLE),y)
-cc-option = $(strip $(if $(call cc-option-sys,$1),$1,$2))
-else
-cc-option = $(strip $(if $(findstring $1,$(CC_OPTIONS)),$1,\
-   $(if $(call cc-option-sys,$1),$1,$2)))
-endif
-
-# cc-version
-# Usage gcc-ver := $(call cc-version)
-cc-version = $(shell $(CONFIG_SHELL) $(SRCTREE)/scripts/gcc-version.sh $(CC))
-binutils-version = $(shell $(CONFIG_SHELL) 
$(SRCTREE)/scripts/binutils-version.sh $(AS))
-dtc-version = $(shell $(CONFIG_SHELL) $(SRCTREE)/scripts/dtc-version.sh $(DTC))
-
-#
 
 # Load generated board configuration
 ifeq ($(CONFIG_TPL_BUILD),y)
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 547e15d..ca5fd56 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -140,6 +140,10 @@ cc-fullversion = $(shell $(CONFIG_SHELL) \
 # Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
 cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ]  echo $(3))
 
+# added for U-Boot
+binutils-version = $(shell $(CONFIG_SHELL) 
$(srctree)/scripts/binutils-version.sh $(AS))
+dtc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/dtc-version.sh $(DTC))
+
 # cc-ldoption
 # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both)
 cc-ldoption = $(call try-run,\
@@ -161,7 +165,9 @@ ar-option = $(call try-run, $(AR) rc$(1) $$TMP,$(1),$(2))
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
 # Usage:
 # $(Q)$(MAKE) $(build)=dir
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
+#build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
+# temporary
+build := -f $(srctree)/scripts/Makefile.build -C
 
 ###
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 1b3d77f..7789efa 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -2,6 +2,7 @@
 .PHONY: all
 all:
 
+include $(srctree)/scripts/Kbuild.include
 include $(TOPDIR)/config.mk
 
 # variable LIB is used in examples/standalone/Makefile
diff --git a/spl/Makefile b/spl/Makefile
index a3253ba..13dd616 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ 

[U-Boot] [PATCH 27/34] Makefile: remove a cleaning target tidy

2013-12-11 Thread Masahiro Yamada
Before this commit, make tidy did
make clean + delete *.depend* files.

But, we do not have *.depend* files any more,
which means make tidy is the same as make clean.

This commit removes the redandant target tidy.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 MAKEALL  | 2 +-
 Makefile | 8 ++--
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/MAKEALL b/MAKEALL
index 6ccff3f..e3b732b 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -684,7 +684,7 @@ build_target() {
if [ $BUILD_MANY == 1 ] ; then
trap - TERM
 
-   ${MAKE} -s tidy
+   ${MAKE} -s clean
 
if [ -s ${LOG_DIR}/${target}.ERR ] ; then
cp ${LOG_DIR}/${target}.ERR 
${OUTPUT_PREFIX}/ERR/${target}
diff --git a/Makefile b/Makefile
index c805de1..9d47c4c 100644
--- a/Makefile
+++ b/Makefile
@@ -472,7 +472,7 @@ LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
 
 # Targets which don't build the source code
-NON_BUILD_TARGETS = backup clean clobber distclean mkproper tidy unconfig 
%_config
+NON_BUILD_TARGETS = backup clean clobber distclean mkproper unconfig %_config
 
 # Only do the generic board check when actually building, not configuring
 ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
@@ -1089,11 +1089,7 @@ clean:
-o -name '*.cfgtmp' \) -print \
| xargs rm -f
 
-# Removes everything not needed for testing u-boot
-tidy:  clean
-   @find $(OBJTREE) -type f \( -name '*.depend*' \) -print | xargs rm -f
-
-clobber:   tidy
+clobber: clean
@find $(OBJTREE) -type f \( -name '*.srec' \
-o -name '*.bin' -o -name u-boot.img \) \
-print0 | xargs -0 rm -f
-- 
1.8.3.2

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


[U-Boot] [PATCH 31/34] Makefile: Do not pass MTD_VERSION from the top Makefile

2013-12-11 Thread Masahiro Yamada
$(MTD_VERSION) is used in tools/env/Makefile

If you specify a variable at a command line like:
  $ make MTD_VERSION=old env
or specify it thru an envrionment variable like:
  $ export MTD_VERSION=old
  $ make env
it is inherited to the sub-make too.
We do not need to pass it from the top Makefile explicitely.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index d89f689..40f351e 100644
--- a/Makefile
+++ b/Makefile
@@ -1060,7 +1060,7 @@ $(TIMESTAMP_FILE):
@cmp -s $@ $@.tmp  rm -f $@.tmp || mv -f $@.tmp $@
 
 easylogo env gdb:
-   $(Q)$(MAKE) $(build)=tools/$@ MTD_VERSION=${MTD_VERSION}
+   $(Q)$(MAKE) $(build)=tools/$@
 
 gdbtools: gdb
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 19/34] Makefile: rename scripts/Makefile.build to scripts/Makefile.build.tmp

2013-12-11 Thread Masahiro Yamada
Some build scripts including scripts/Makefile.build
will be imported from Linux Kernel in the next commit.
We need to adjust them for U-Boot in the following commits.

To make it easier for reviewers to track the modification,
this commit renames scripts/Makefile.build to
scripts/Makefile.build.tmp beforehand.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 scripts/Kbuild.include | 2 +-
 scripts/{Makefile.build = Makefile.build.tmp} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename scripts/{Makefile.build = Makefile.build.tmp} (100%)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 6113c13..30a5551 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -165,7 +165,7 @@ ar-option = $(call try-run, $(AR) rc$(1) $$TMP,$(1),$(2))
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
 # Usage:
 # $(Q)$(MAKE) $(build)=dir
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
 
 ###
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
diff --git a/scripts/Makefile.build b/scripts/Makefile.build.tmp
similarity index 100%
rename from scripts/Makefile.build
rename to scripts/Makefile.build.tmp
-- 
1.8.3.2

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


[U-Boot] [PATCH 0/34] Switch over to real Kbuild

2013-12-11 Thread Masahiro Yamada

We switched to Kbuild style makefiles at v2014.01-rc1 release.
With that modification, we can write makefiles simpler.
But it is NOT real Kbuild.

As the next step, this series imports (+ adjusts) build scripts
from Linux Kernel under scripts/ directory.
By applying this series, we can get more advantages:
  - short log
  - perfect dependency tracking
  - preparation to the next step: Kconfig
  - other things...

 Kbuild without Kconfig
 --

At first, to make things clearer, let me explain
the difference between Kbuild and Kconfig.
They are, I think, sometimes confusing.

 Kbuild - build system used for Linux Kernel.
Some features of Kbuild are:

   (a) We can describe makefiles simple.
  Just addi objects to obj-y like this:
  obj-$(CONFIG_FOO) += foo.o

   (b) We can describe directory descending nicely
  Add a directory name to obj-y like this:
  obj-$(CONFIG_BAR) += bar/

   (c) Short log like follows:
  CC  common/foo.o
  CC  common/bar.o
  LD  common/built-in.o

   (d) Perfect dependency tracking
  I think this is the biggest advantage.
  To be honest, the dependency tracing of U-Boot build system
  was not reliable.

 Kconfig - A tool to manage CONFIG macros.
  We can handle the dependency among CONFIG macros.
  Kconfig allows us to modify CONFIG settings easily
  by make config.
  GUI interface are also available by make menuconfig
  All defined CONFIG macros are stored into .config file

I think most of you are already familiar with above.
I definitely want to port both of these, but I want to do one by one: Kbuild 
first.
(If we do Kbuild and Kconfig at the same time, it might be messed up.)

So, I want to do Kbuild without Kconfig in this series.
The conventional tool (mkconfig + boards.cfg file)
is used for board configuration.

 How to apply this series ?
 --

Before importing new features, I wanted to clean up some parts of makefiles.
I posted many trivial patches to refactor makefiles.

This series uses the followings as prerequisites:

[1] blackfin: Do not generate unused header bootrom-asm-offsets.h
http://patchwork.ozlabs.org/patch/295141/

[2] sandbox: Use system headers first for sandbox's os.c in a different way
http://patchwork.ozlabs.org/patch/294233/

[3] .gitignore: ignore spl/ and tpl/ directories except spl/Makefile
http://patchwork.ozlabs.org/patch/294271/

[4] Makefile: delete a make rule of $(LDSCRIPT)
http://patchwork.ozlabs.org/patch/294717/

[5] post: descend only when CONFIG_HAS_POST is defined
http://patchwork.ozlabs.org/patch/294741/

[6] Makefile: Select objects by CONFIG_ rather than $(ARCH) or $(CPU)
http://patchwork.ozlabs.org/patch/294742/

[7] drivers/usb/gadget: select objects by obj-$(CONFIG-...)
http://patchwork.ozlabs.org/patch/294745/

[8] drivers/mtd: descend into sub directories only when it is necessary
http://patchwork.ozlabs.org/patch/294746/

[9] Makefile: Move some scripts imported from Linux
http://patchwork.ozlabs.org/patch/294780/

[10] Makefile: delete unnecessary CPPFLAGS settings
http://patchwork.ozlabs.org/patch/294829/

[11] Makefile: delete unnecessary lines
http://patchwork.ozlabs.org/patch/295052/

[12] Makefile: Do not create empty autoconf.mk on error
http://patchwork.ozlabs.org/patch/295779/

[13] Makefile: use two double-quotations as a pair
http://patchwork.ozlabs.org/patch/296718/

[14] Makefile: correct dependencies of asm-offsets.[hs]
http://patchwork.ozlabs.org/patch/296722/

[15] examples: x86: delete 82559_eeprom
http://patchwork.ozlabs.org/patch/297608/

[16] Makefile, .gitignore: Cleanup non-existing binaries
http://patchwork.ozlabs.org/patch/297609/

[17] spl/Makefile: merge LIBS-y += arch/$(ARCH)/imx-common
http://patchwork.ozlabs.org/patch/299660/

You need to apply above patches beforehand to use this series.
They are simple patches, so I hope they will be reviewed and applied first.

 How to Build ?
 --

We can build the same as before.
Do board configuraton and then run make.

  $ make  omap4_panda_config
  Configuring for omap4_panda board...
  $ make  CROSS_COMPILE=arm-linux-gnueabi-
  GEN include/autoconf.mk.dep
  GEN include/autoconf.mk
  CC  lib/asm-offsets.s
  GEN include/generated/generic-asm-offsets.h
  CC  arch/arm/cpu/armv7/omap4/asm-offsets.s
  GEN include/generated/asm-offsets.h
  HOSTCC  scripts/basic/fixdep
   ...

You will find a difference at a glance, short log
If you need detail log message, please add V=1.
(You can also use V=2)

Please note we can not use any more
  $ make omap4_panda CROSS_COMPILE=arm-linux-gnueabi-
to do board configuration and make at the same time.

Instead, we can use Kbuild-ish way for that purpose:
  $ make omap4_panda_config all CROSS_COMPILE=arm-linux-gnuabi-

This series keeps the other features:

  - Support out-of-tree build
 You can use 

[U-Boot] [PATCH 25/34] Kbuild: move include directives of board configuration files

2013-12-11 Thread Masahiro Yamada
This commit changes the location of include directives
of board configuration files.

The purpose of this change is:
 - Slim down $(TOPDIR)/config.mk
 - Prevent $(TOPDIR)/Makefile from including the same
configuration file twice
 - Do not include include/config.mk multiple times
because ARCH, CPU, BOARD, VENDOR, SOC are exported

Before this commit:

 - include/autoconf.mk was included from $(TOPDIR)/Makefile
   and $(TOPDIR)/config.mk
   (This means $(TOPDIR)/Makefile included include/autoconf.mk twice)

 - include/{spl,tpl}-autoconf.mk was included from $(TOPDIR)/config.mk

 - include/config.mk was included from $(TOPDIR)/Makefile
   and $(TOPDIR)/config.mk
   (This means $(TOPDIR)/Makefile included include/config.mk twice)

After this commit:

 - include/autoconf.mk is included from $(TOPDIR)/Makefile
   and $(TOPDIR)/scripts/Makefile.build

 - include/{spl,tpl}-autoconf.mk is included from $(TOPDIR)/spl/Makefile
   and $(TOPDIR)/scripts/Makefile.build

 - include/config.mk is included from $(TOPDIR)/config.mk and
   $(TOPDIR)/spl/Makefile

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 config.mk  | 15 ---
 scripts/Makefile.build | 11 +++
 spl/Makefile   |  8 
 3 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/config.mk b/config.mk
index 1336ef8..5b886aa 100644
--- a/config.mk
+++ b/config.mk
@@ -13,21 +13,6 @@ PLATFORM_LDFLAGS =
 
 #
 
-# Load generated board configuration
-ifeq ($(CONFIG_TPL_BUILD),y)
-# Include TPL autoconf
-sinclude include/tpl-autoconf.mk
-else
-ifeq ($(CONFIG_SPL_BUILD),y)
-# Include SPL autoconf
-sinclude include/spl-autoconf.mk
-else
-# Include normal autoconf
-sinclude include/autoconf.mk
-endif
-endif
-sinclude $(OBJTREE)/include/config.mk
-
 # Some architecture config.mk files need to know what CPUDIR is set to,
 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
 # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 921fbbf..f37957f 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -42,6 +42,17 @@ subdir-ccflags-y :=
 # Read auto.conf if it exists, otherwise ignore
 -include include/config/auto.conf
 
+# Added for U-Boot: Load U-Boot configuration
+ifeq ($(CONFIG_TPL_BUILD),y)
+  -include include/tpl-autoconf.mk
+else
+  ifeq ($(CONFIG_SPL_BUILD),y)
+-include include/spl-autoconf.mk
+  else
+-include include/autoconf.mk
+  endif
+endif
+
 include scripts/Kbuild.include
 # Modified for U-Boot
 #  We must include config.mk after Kbuild.include:
diff --git a/spl/Makefile b/spl/Makefile
index fd5294b..bf886f7 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -38,6 +38,14 @@ else
 SPL_BIN := u-boot-spl
 endif
 
+include include/config.mk
+
+ifeq ($(CONFIG_TPL_BUILD),y)
+  -include include/tpl-autoconf.mk
+else
+  -include include/spl-autoconf.mk
+endif
+
 include $(srctree)/scripts/Kbuild.include
 
 include $(TOPDIR)/config.mk
-- 
1.8.3.2

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


[U-Boot] [PATCH 32/34] Makefile: refactor tools-all targets

2013-12-11 Thread Masahiro Yamada
 - Move easylogo, env, gdb tagets to tools/Makefile
 - Delete gdbtools target (same as gdb)

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile   | 7 +--
 tools/Makefile | 6 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 40f351e..ad05007 100644
--- a/Makefile
+++ b/Makefile
@@ -1059,15 +1059,10 @@ $(TIMESTAMP_FILE):
@LC_ALL=C date +'#define U_BOOT_TIME %T'  $@.tmp
@cmp -s $@ $@.tmp  rm -f $@.tmp || mv -f $@.tmp $@
 
-easylogo env gdb:
-   $(Q)$(MAKE) $(build)=tools/$@
-
-gdbtools: gdb
-
 xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc
$(Q)$(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) $(build)=doc/DocBook $@
 
-tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE)
+tools-all: $(VERSION_FILE) $(TIMESTAMP_FILE)
$(Q)$(MAKE) $(build)=tools HOST_TOOLS_ALL=y
 
 .PHONY : CHANGELOG
diff --git a/tools/Makefile b/tools/Makefile
index e03815e..ec1b78c 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -24,6 +24,10 @@ CONFIG_NETCONSOLE = y
 CONFIG_SHA1_CHECK_UB_IMG = y
 endif
 
+subdir-$(HOST_TOOLS_ALL) += easylogo
+subdir-$(HOST_TOOLS_ALL) += env
+subdir-$(HOST_TOOLS_ALL) += gdb
+
 # Merge all the different vars for envcrc into one
 ENVCRC-$(CONFIG_ENV_IS_EMBEDDED) = y
 ENVCRC-$(CONFIG_ENV_IS_IN_DATAFLASH) = y
@@ -172,7 +176,7 @@ HOST_EXTRACFLAGS += -include 
$(SRCTREE)/include/libfdt_env.h \
 
 __build:   $(LOGO-y)
 
-subdir-y := kernel-doc
+subdir-y += kernel-doc
 
 $(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP)
$(obj)/bmp_logo --gen-info $(LOGO_BMP)  $@
-- 
1.8.3.2

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


[U-Boot] [PATCH 04/34] board: samsung: refactor host programs

2013-12-11 Thread Masahiro Yamada
Some Samsung boards have their own tools under board/samsung/board/tools/.
This commit refactor more makefiles with hostprogs-y.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

Note1:
Samsung boards have tools under board/samsung/board/tools/
and have tools/mkexynosspl.c too.
It is inconsistent, so we should choose the appropriate
directory in which Samsung-specific tools are stored.

Note2:

I marded TODO item in board/samsung/origen/Makefile.

Samsung engineers, I hope you will fix the root cause of the warning.

 # omit -O2 option to suppress
 #   warning: dereferencing type-punned pointer will break strict-aliasing rules
 #
 # TODO:
 # Fix the root cause in tools/mkorigenspl.c and delete the following 
work-around
 $(obj)/tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS))


 Makefile |  1 +
 board/samsung/origen/Makefile| 20 ++--
 .../origen/tools/{mkv310_image.c = mkorigenspl.c}   |  0
 board/samsung/smdkv310/Makefile  | 15 ---
 .../tools/{mkv310_image.c = mksmdkv310spl.c}|  0
 spl/Makefile |  4 ++--
 6 files changed, 17 insertions(+), 23 deletions(-)
 rename board/samsung/origen/tools/{mkv310_image.c = mkorigenspl.c} (100%)
 rename board/samsung/smdkv310/tools/{mkv310_image.c = mksmdkv310spl.c} (100%)

diff --git a/Makefile b/Makefile
index 9479788..cedec69 100644
--- a/Makefile
+++ b/Makefile
@@ -781,6 +781,7 @@ clean:
   $(obj)tools/proftool
@rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}\
   $(obj)board/matrix_vision/*/bootscript.img \
+  $(obj)spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl   \
   $(obj)u-boot.lds   \
   $(obj)arch/blackfin/cpu/init.{lds,elf}
@rm -f $(obj)include/bmp_logo.h
diff --git a/board/samsung/origen/Makefile b/board/samsung/origen/Makefile
index e8818bf..31e88f4 100644
--- a/board/samsung/origen/Makefile
+++ b/board/samsung/origen/Makefile
@@ -4,16 +4,16 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
-obj-y  += origen.o
-endif
-
 ifdef CONFIG_SPL_BUILD
-all: $(OBJTREE)/tools/mk$(BOARD)spl
-endif
+hostprogs-y := tools/mkorigenspl
+always := $(hostprogs-y)
 
-# Fix ME after we implement hostprogs-y.
-ifdef CONFIG_SPL_BUILD
-$(OBJTREE)/tools/mk$(BOARD)spl:tools/mkv310_image.c
-   $(HOSTCC) tools/mkv310_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl
+# omit -O2 option to suppress
+#   warning: dereferencing type-punned pointer will break strict-aliasing rules
+#
+# TODO:
+# Fix the root cause in tools/mkorigenspl.c and delete the following 
work-around
+$(obj)tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS))
+else
+obj-y  += origen.o
 endif
diff --git a/board/samsung/origen/tools/mkv310_image.c 
b/board/samsung/origen/tools/mkorigenspl.c
similarity index 100%
rename from board/samsung/origen/tools/mkv310_image.c
rename to board/samsung/origen/tools/mkorigenspl.c
diff --git a/board/samsung/smdkv310/Makefile b/board/samsung/smdkv310/Makefile
index dbc621b..9e37b4e 100644
--- a/board/samsung/smdkv310/Makefile
+++ b/board/samsung/smdkv310/Makefile
@@ -4,16 +4,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
-obj-y  += smdkv310.o
-endif
-
 ifdef CONFIG_SPL_BUILD
-all: $(OBJTREE)/tools/mk$(BOARD)spl
-endif
-
-# Fix ME after we implement hostprogs-y.
-ifdef CONFIG_SPL_BUILD
-$(OBJTREE)/tools/mk$(BOARD)spl:tools/mkv310_image.c
-   $(HOSTCC) tools/mkv310_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl
+hostprogs-y := tools/mksmdkv310spl
+always := $(hostprogs-y)
+else
+obj-y  += smdkv310.o
 endif
diff --git a/board/samsung/smdkv310/tools/mkv310_image.c 
b/board/samsung/smdkv310/tools/mksmdkv310spl.c
similarity index 100%
rename from board/samsung/smdkv310/tools/mkv310_image.c
rename to board/samsung/smdkv310/tools/mksmdkv310spl.c
diff --git a/spl/Makefile b/spl/Makefile
index b23ade8..a3253ba 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -156,8 +156,8 @@ all:$(ALL-y)
 
 ifdef CONFIG_SAMSUNG
 $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin
-   $(if $(wildcard $(OBJTREE)/tools/mk$(BOARD)spl),\
-   $(OBJTREE)/tools/mk$(BOARD)spl,\
+   $(if $(wildcard 
$(OBJTREE)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl),\
+   $(OBJTREE)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl,\
$(OBJTREE)/tools/mkexynosspl) $ $@
 endif
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 10/34] Kbuild: import Kbuild.include from linux v3.12 tag

2013-12-11 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 scripts/Kbuild.include | 278 +
 1 file changed, 278 insertions(+)
 create mode 100644 scripts/Kbuild.include

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
new file mode 100644
index 000..547e15d
--- /dev/null
+++ b/scripts/Kbuild.include
@@ -0,0 +1,278 @@
+
+# kbuild: Generic definitions
+
+# Convenient variables
+comma   := ,
+squote  := '
+empty   :=
+space   := $(empty) $(empty)
+
+###
+# Name of target with a '.' as filename prefix. foo/bar.o = foo/.bar.o
+dot-target = $(dir $@).$(notdir $@)
+
+###
+# The temporary file to save gcc -MD generated dependencies must not
+# contain a comma
+depfile = $(subst $(comma),_,$(dot-target).d)
+
+###
+# filename of target with directory and extension stripped
+basetarget = $(basename $(notdir $@))
+
+###
+# filename of first prerequisite with directory and extension stripped
+baseprereq = $(basename $(notdir $))
+
+###
+# Escape single quote for use in echo statements
+escsq = $(subst $(squote),'\$(squote)',$1)
+
+###
+# Easy method for doing a status message
+   kecho := :
+ quiet_kecho := echo
+silent_kecho := :
+kecho := $($(quiet)kecho)
+
+###
+# filechk is used to check if the content of a generated file is updated.
+# Sample usage:
+# define filechk_sample
+#  echo $KERNELRELEASE
+# endef
+# version.h : Makefile
+#  $(call filechk,sample)
+# The rule defined shall write to stdout the content of the new file.
+# The existing file will be compared with the new one.
+# - If no file exist it is created
+# - If the content differ the new file is used
+# - If they are equal no change, and no timestamp update
+# - stdin is piped in from the first prerequisite ($) so one has
+#   to specify a valid file as first prerequisite (often the kbuild file)
+define filechk
+   $(Q)set -e; \
+   $(kecho) '  CHK $@';\
+   mkdir -p $(dir $@); \
+   $(filechk_$(1))  $  $@.tmp;  \
+   if [ -r $@ ]  cmp -s $@ $@.tmp; then  \
+   rm -f $@.tmp;   \
+   else\
+   $(kecho) '  UPD $@';\
+   mv -f $@.tmp $@;\
+   fi
+endef
+
+##
+# gcc support functions
+# See documentation in Documentation/kbuild/makefiles.txt
+
+# cc-cross-prefix
+# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
+# Return first prefix where a prefix$(CC) is found in PATH.
+# If no $(CC) found in PATH with listed prefixes return nothing
+cc-cross-prefix =  \
+   $(word 1, $(foreach c,$(1),   \
+   $(shell set -e;   \
+   if (which $(strip $(c))$(CC))  /dev/null 21 ; then \
+   echo $(c);\
+   fi)))
+
+# output directory for tests below
+TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
+
+# try-run
+# Usage: option = $(call try-run, $(CC)...-o $$TMP,option-ok,otherwise)
+# Exit code chooses option. $$TMP is can be used as temporary file and
+# is automatically cleaned up.
+try-run = $(shell set -e;  \
+   TMP=$(TMPOUT)..tmp;   \
+   TMPO=$(TMPOUT)..o;\
+   if ($(1)) /dev/null 21;  \
+   then echo $(2);   \
+   else echo $(3);   \
+   fi; \
+   rm -f $$TMP $$TMPO)
+
+# as-option
+# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
+
+as-option = $(call try-run,\
+   $(CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o 
$$TMP,$(1),$(2))
+
+# as-instr
+# Usage: cflags-y += $(call as-instr,instr,option1,option2)
+
+as-instr = $(call try-run,\
+   printf %b\n $(1) | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o 
$$TMP -,$(2),$(3))
+
+# cc-option
+# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
+
+cc-option = $(call try-run,\
+   $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o 
$$TMP,$(1),$(2))
+
+# cc-option-yn
+# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
+cc-option-yn = $(call try-run,\
+   $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o 
$$TMP,y,n)
+
+# cc-option-align
+# Prefix align with either -falign or -malign
+cc-option-align = $(subst -functions=0,,\
+   $(call cc-option,-falign-functions=0,-malign-functions=0))
+
+# cc-disable-warning
+# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
+cc-disable-warning = $(call try-run,\
+   $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c 
/dev/null -o $$TMP,-Wno-$(strip $(1)))
+
+# cc-version
+# Usage gcc-ver := $(call cc-version)
+cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
+
+# cc-fullversion
+# Usage gcc-ver := 

[U-Boot] [PATCH 05/34] examples: Use scripts/Makefile.build

2013-12-11 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile |  5 +
 examples/api/Makefile| 21 +---
 examples/standalone/Makefile | 46 ++--
 scripts/Makefile.build   |  7 ---
 4 files changed, 24 insertions(+), 55 deletions(-)

diff --git a/Makefile b/Makefile
index cedec69..c28a587 100644
--- a/Makefile
+++ b/Makefile
@@ -535,12 +535,9 @@ $(OBJS):
 $(LIBS):   depend $(SUBDIR_TOOLS)
$(MAKE) $(build) $(dir $(subst $(obj),,$@))
 
-tools: depend
+$(SUBDIRS):depend
$(MAKE) $(build) $@ all
 
-$(filter-out tools,$(SUBDIRS)):depend
-   $(MAKE) -C $@ all
-
 $(SUBDIR_EXAMPLES-y): $(obj)u-boot
 
 $(obj)u-boot.lds: $(LDSCRIPT) depend
diff --git a/examples/api/Makefile b/examples/api/Makefile
index cad10a3..f770859 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -11,10 +11,8 @@ ifeq ($(ARCH),arm)
 LOAD_ADDR = 0x100
 endif
 
-include $(TOPDIR)/config.mk
-
 # Resulting ELF and binary exectuables will be named demo and demo.bin
-OUTPUT = $(obj)demo
+extra-y = demo
 
 # Source files located in the examples/api directory
 SOBJ_FILES-y += crt0.o
@@ -43,13 +41,13 @@ OBJS+= $(addprefix $(obj),$(COBJ_FILES-y))
 OBJS   += $(addprefix $(obj),$(notdir $(EXT_COBJ_FILES-y)))
 OBJS   += $(addprefix $(obj),$(notdir $(EXT_SOBJ_FILES-y)))
 
-all:   $(obj).depend $(OUTPUT)
-
 #
 
-$(OUTPUT): $(OBJS)
+$(obj)demo:$(OBJS)
$(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $^ 
$(PLATFORM_LIBS)
-   $(OBJCOPY) -O binary $@ $(OUTPUT).bin 2/dev/null
+
+$(obj)demo.bin: $(obj)demo
+   $(OBJCOPY) -O binary $ $@ 2/dev/null
 
 # Rule to build generic library C files
 $(obj)%.o: $(SRCTREE)/lib/%.c
@@ -58,12 +56,3 @@ $(obj)%.o: $(SRCTREE)/lib/%.c
 # Rule to build architecture-specific library assembly files
 $(obj)%.o: $(SRCTREE)/arch/$(ARCH)/lib/%.S
$(CC) -g $(CFLAGS) -c -o $@ $
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 0841c75..cad4409 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -5,27 +5,25 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-ELF-y:= hello_world
-
-ELF-$(CONFIG_SMC9)   += smc9_eeprom
-ELF-$(CONFIG_SMC911X)+= smc911x_eeprom
-ELF-$(CONFIG_SPI_FLASH_ATMEL)+= atmel_df_pow2
-ELF-$(CONFIG_MPC5xxx)+= interrupt
-ELF-$(CONFIG_8xx)+= test_burst timer
-ELF-$(CONFIG_8260)   += mem_to_mem_idma2intr
-ELF-$(CONFIG_PPC)+= sched
+extra-y:= hello_world
+extra-$(CONFIG_SMC9)   += smc9_eeprom
+extra-$(CONFIG_SMC911X)+= smc911x_eeprom
+extra-$(CONFIG_SPI_FLASH_ATMEL)+= atmel_df_pow2
+extra-$(CONFIG_MPC5xxx)+= interrupt
+extra-$(CONFIG_8xx)+= test_burst timer
+extra-$(CONFIG_8260)   += mem_to_mem_idma2intr
+extra-$(CONFIG_PPC)+= sched
 
 #
 # Some versions of make do not handle trailing white spaces properly;
 # leading to build failures. The problem was found with GNU Make 3.80.
 # Using 'strip' as a workaround for the problem.
 #
-ELF := $(strip $(ELF-y))
+ELF := $(strip $(extra-y))
+
+extra-y += $(addsuffix .srec,$(extra-y)) $(addsuffix .bin,$(extra-y))
+clean-files  := $(extra-) $(addsuffix .srec,$(extra-)) $(addsuffix 
.bin,$(extra-))
 
-SREC := $(addsuffix .srec,$(ELF))
-BIN  := $(addsuffix .bin,$(ELF))
 
 COBJS  := $(ELF:=.o)
 
@@ -42,8 +40,6 @@ LIBOBJS   = $(addprefix $(obj),$(LIBAOBJS) $(LIBCOBJS))
 SRCS   := $(COBJS:.o=.c) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S)
 OBJS   := $(addprefix $(obj),$(COBJS))
 ELF:= $(addprefix $(obj),$(ELF))
-BIN:= $(addprefix $(obj),$(BIN))
-SREC   := $(addprefix $(obj),$(SREC))
 
 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
 
@@ -60,13 +56,10 @@ endif
 # We don't want gcc reordering functions if possible.  This ensures that an
 # application's entry point will be the first function in the application's
 # source file.
-CFLAGS_NTR := $(call cc-option,-fno-toplevel-reorder)
-CFLAGS += $(CFLAGS_NTR)
-
-all:   $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF)
+CFLAGS += $(call cc-option,-fno-toplevel-reorder)
 
 #
-$(LIB):$(obj).depend $(LIBOBJS)
+$(LIB):$(LIBOBJS)
$(call cmd_link_o_target, $(LIBOBJS))
 
 $(ELF):
@@ -75,19 +68,8 @@ $(obj)%: $(obj)%.o $(LIB)
-o $@ -e $(SYM_PREFIX)$(notdir $(:.o=)) $ $(LIB) \

[U-Boot] [PATCH 12/34] Makefile: move more flags to the top Makefile

2013-12-11 Thread Masahiro Yamada
Before this commit, most of compiler flags were defined in config.mk.
But it is redundant because config.mk is included from all recursive make.

This commit moves many complier flags to the top Makefile
and export them.
And we use new vaiarables to store them:
KBUILD_CPPFLAGS, KBUILD_CFLAGS, KBUILD_AFLAGS.
This will allow us to switch more smoothly to Kbuild.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile  | 35 +++
 config.mk | 41 -
 2 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/Makefile b/Makefile
index 02fb5fa..0fb9d99 100644
--- a/Makefile
+++ b/Makefile
@@ -226,11 +226,46 @@ CHECK = sparse
 CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
  -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
 
+KBUILD_CPPFLAGS := -D__KERNEL__
+
+KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
+  -Wno-format-security \
+  -fno-builtin -ffreestanding
+KBUILD_AFLAGS   := -D__ASSEMBLY__
+
 export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
 export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
 export MAKE AWK
 export DTC CHECK CHECKFLAGS
 
+export KBUILD_CPPFLAGS
+export KBUILD_CFLAGS KBUILD_AFLAGS
+
+KBUILD_CFLAGS += -Os #-fomit-frame-pointer
+
+ifdef BUILD_TAG
+KBUILD_CFLAGS += -DBUILD_TAG='$(BUILD_TAG)'
+endif
+
+KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
+
+KBUILD_CFLAGS  += -g
+# $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -gformat
+# option to the assembler.
+KBUILD_AFLAGS  += -g
+
+# Report stack usage if supported
+KBUILD_CFLAGS += $(call cc-option,-fstack-usage)
+
+KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
+
+# turn jbsr into jsr for m68k
+ifeq ($(ARCH),m68k)
+ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4)
+KBUILD_AFLAGS += -Wa,-gstabs,-S
+endif
+endif
+
 # load other configuration
 include $(TOPDIR)/config.mk
 
diff --git a/config.mk b/config.mk
index ba42641..0494805 100644
--- a/config.mk
+++ b/config.mk
@@ -90,19 +90,13 @@ endif
 
 #
 
-# We don't actually use $(ARFLAGS) anywhere anymore, so catch people
-# who are porting old code to latest mainline but not updating $(AR).
-ARFLAGS = $(error update your Makefile to use cmd_link_o_target and not AR)
 RELFLAGS= $(PLATFORM_RELFLAGS)
-DBGFLAGS= -g # -DDEBUG
-OPTFLAGS= -Os #-fomit-frame-pointer
 
 OBJCFLAGS += --gap-fill=0xff
 
 gccincdir := $(shell $(CC) -print-file-name=include)
 
-CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS)\
-   -D__KERNEL__
+CPPFLAGS = $(KBUILD_CPPFLAGS) $(RELFLAGS)
 
 # Enable garbage collection of un-used sections for SPL
 ifeq ($(CONFIG_SPL_BUILD),y)
@@ -134,26 +128,10 @@ CPPFLAGS += -I$(OBJTREE)/include
 endif
 
 CPPFLAGS += -I$(TOPDIR)/include -I$(SRCTREE)/arch/$(ARCH)/include
-CPPFLAGS += -fno-builtin -ffreestanding -nostdinc  \
+CPPFLAGS += -nostdinc  \
-isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
 
-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes
-
-ifdef BUILD_TAG
-CFLAGS += -DBUILD_TAG='$(BUILD_TAG)'
-endif
-
-CFLAGS_SSP := $(call cc-option,-fno-stack-protector)
-CFLAGS += $(CFLAGS_SSP)
-# Some toolchains enable security related warning flags by default,
-# but they don't make much sense in the u-boot world, so disable them.
-CFLAGS_WARN := $(call cc-option,-Wno-format-nonliteral) \
-  $(call cc-option,-Wno-format-security)
-CFLAGS += $(CFLAGS_WARN)
-
-# Report stack usage if supported
-CFLAGS_STACK := $(call cc-option,-fstack-usage)
-CFLAGS += $(CFLAGS_STACK)
+CFLAGS = $(KBUILD_CFLAGS) $(CPPFLAGS)
 
 BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
 
@@ -165,18 +143,7 @@ endif
 endif
 endif
 
-# $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -gformat
-# option to the assembler.
-AFLAGS_DEBUG :=
-
-# turn jbsr into jsr for m68k
-ifeq ($(ARCH),m68k)
-ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4)
-AFLAGS_DEBUG := -Wa,-gstabs,-S
-endif
-endif
-
-AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)
+AFLAGS = $(KBUILD_AFLAGS) $(CPPFLAGS)
 
 LDFLAGS += $(PLATFORM_LDFLAGS)
 LDFLAGS_FINAL += -Bstatic
-- 
1.8.3.2

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


[U-Boot] [PATCH 33/34] Kbuild: use scripts/Makefile.clean

2013-12-11 Thread Masahiro Yamada
This commit refactors cleaning targets such as
clean, clobber, mrpropper, distclean
with scripts/Makefile.clean.

By using scripts/Makefile.clean, we can recursively descend
into subdirectories and delete generated files there.

We do not need add a big list of generated files
to the clean target.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

We can delete ugly stuff like follows:

  clean:
@rm -f $(obj)examples/standalone/82559_eeprom \
   $(obj)examples/standalone/atmel_df_pow2\
   $(obj)examples/standalone/eepro100_eeprom  \
   $(obj)examples/standalone/hello_world  \
   $(obj)examples/standalone/interrupt\
   $(obj)examples/standalone/mem_to_mem_idma2intr \
   $(obj)examples/standalone/sched\
   $(obj)examples/standalone/smc911{11,x}_eeprom  \
   $(obj)examples/standalone/test_burst   \
   $(obj)examples/standalone/timer
@rm -f $(obj)examples/api/demo{,.bin}
@rm -f $(obj)tools/bmp_logo$(obj)tools/easylogo/easylogo  \
   $(obj)tools/env/{fw_printenv,fw_setenv}\
   $(obj)tools/envcrc \
   $(obj)tools/gdb/{astest,gdbcont,gdbsend}   \
   $(obj)tools/gen_eth_addr$(obj)tools/img2srec   \
   $(obj)tools/mk{env,}image   $(obj)tools/mpc86x_clk \
   $(obj)tools/mk{$(BOARD),}spl   \
   $(obj)tools/mxsboot\
   $(obj)tools/ncb $(obj)tools/ubsha1 \
   $(obj)tools/kernel-doc/docproc \
   $(obj)tools/proftool
@rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}\
   $(obj)board/matrix_vision/*/bootscript.img \
   $(obj)board/voiceblue/eeprom   \
   $(obj)u-boot.lds   \
   $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs]  \
   $(obj)arch/blackfin/cpu/init.{lds,elf}

By the way, I am keeping make clobber for now.
Do we need make clobber?
If we like 3-level cleaning targets, clean, mrproper, distclean,
like Linux Kernel, we can squash clobber to clean.


 Makefile   | 186 ++---
 arch/blackfin/cpu/Makefile |   1 +
 board/cray/L1/Makefile |   2 +
 dts/Makefile   |  12 +--
 scripts/Makefile   |   2 +
 scripts/Makefile.clean |   4 +
 6 files changed, 121 insertions(+), 86 deletions(-)
 create mode 100644 scripts/Makefile

diff --git a/Makefile b/Makefile
index ad05007..bd450e7 100644
--- a/Makefile
+++ b/Makefile
@@ -1074,91 +1074,106 @@ include/license.h: tools/bin2header COPYING
cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip  
include/license.h
 #
 
+###
+# Cleaning is done on three levels.
+# make clean Delete most generated files
+#Leave enough to build external modules
+# make mrproper  Delete the current configuration, and all generated files
+# make distclean Remove editor backup files, patch leftover files and the like
+
+# Directories  files removed with 'make clean'
+CLEAN_DIRS  += $(MODVERDIR)
+CLEAN_FILES += u-boot.lds include/bmp_logo.h include/bmp_logo_data.h \
+   board/*/config.tmp board/*/*/config.tmp dts/*.tmp \
+   include/autoconf.mk include/autoconf.mk.dep \
+   include/spl-autoconf.mk include/tpl-autoconf.mk
+
+# Directories  files removed with 'make clobber'
+CLOBBER_DIRS  += tpl \
+$(patsubst %/,spl/%, $(filter-out Makefile, $(filter %/, \
+   $(shell ls -1 --file-type spl 2/dev/null
+CLOBBER_FILES += u-boot u-boot.map u-boot.hex u-boot.img $(ALL-y) \
+u-boot.kwb u-boot.pbl u-boot.imx u-boot-with-spl.imx \
+u-boot-with-nand-spl.imx u-boot.ubl u-boot.ais u-boot.dtb \
+u-boot.sb u-boot.spr MLO MLO.byteswap SPL \
+$(patsubst %,spl/%, $(filter-out Makefile %/, \
+   $(shell ls -1 --file-type spl 2/dev/null))) \
+$(addprefix nand_spl/, u-boot.lds u-boot.lst System.map \
+u-boot-nand_spl.lds u-boot-spl u-boot-spl.map)
+
+# Directories  files removed with 'make mrproper'
+MRPROPER_DIRS  += include/config include/generated
+MRPROPER_FILES += .config .config.old \
+ tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
+ include/config.h include/config.mk
+
+# clean - Delete most, 

[U-Boot] [PATCH 28/34] Kbuild: change the top Makefile to more Kbuild-ish structure

2013-12-11 Thread Masahiro Yamada
This commit changes the top Makefile to handle various targets
nicely.
Make targets are divided into four categories:

 - mixed-targets
 We can call a configuration target and build targets
 at one command line like follows:
 $ make board_name_config u-boot

 They are handled one by one.

 - config targets
 board_name_config

 - no-dot-config-targets
 Targets we can run without board configuration such as
   clean, mrproper, distclean, TAGS, %docs, etc.

 - build targets
 The other target which need board configuration.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 279 ---
 1 file changed, 159 insertions(+), 120 deletions(-)

diff --git a/Makefile b/Makefile
index 9d47c4c..a1be86f 100644
--- a/Makefile
+++ b/Makefile
@@ -207,34 +207,6 @@ VENDOR=
 
 #
 
-# The tools are needed early, so put this first
-# Don't include stuff already done in $(LIBS)
-# The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
-# is yes), so compile examples after U-Boot is compiled.
-SUBDIR_TOOLS = tools
-SUBDIRS = $(SUBDIR_TOOLS)
-
-.PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
-
-ifeq (include/config.mk,$(wildcard include/config.mk))
-
-# Include autoconf.mk before config.mk so that the config options are available
-# to all top level build files.  We need the dummy all: target to prevent the
-# dependency target in autoconf.mk.dep from being the default.
-all:
-sinclude include/autoconf.mk.dep
-sinclude include/autoconf.mk
-
-SUBDIR_EXAMPLES-y := examples/standalone
-SUBDIR_EXAMPLES-$(CONFIG_API) += examples/api
-ifndef CONFIG_SANDBOX
-SUBDIRS += $(SUBDIR_EXAMPLES-y)
-endif
-
-# load ARCH, BOARD, and CPU configuration
-include include/config.mk
-export ARCH CPU BOARD VENDOR SOC
-
 # set default to nothing for native builds
 ifeq ($(HOSTARCH),$(ARCH))
 CROSS_COMPILE ?=
@@ -381,15 +353,6 @@ CHECK  = sparse
 CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
  -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
 
-# Use UBOOTINCLUDE when you must reference the include/ directory.
-# Needed to be compatible with the O= option
-UBOOTINCLUDE:=
-ifneq ($(OBJTREE),$(SRCTREE))
-UBOOTINCLUDE   += -I$(OBJTREE)/include
-endif
-UBOOTINCLUDE   += -I$(srctree)/include \
-   -I$(srctree)/arch/$(ARCH)/include
-
 KBUILD_CPPFLAGS := -D__KERNEL__
 
 KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
@@ -397,6 +360,7 @@ KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
   -fno-builtin -ffreestanding
 KBUILD_AFLAGS   := -D__ASSEMBLY__
 
+export ARCH CPU BOARD VENDOR SOC
 export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
 export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
 export MAKE AWK
@@ -429,64 +393,100 @@ scripts_basic:
 scripts/basic/%: scripts_basic ;
 
 
-KBUILD_CFLAGS += -Os #-fomit-frame-pointer
+no-dot-config-targets := clean clobber mrproper distclean \
+cscope TAGS %tags help %docs check% coccicheck \
+tools backup
 
-ifdef BUILD_TAG
-KBUILD_CFLAGS += -DBUILD_TAG='$(BUILD_TAG)'
+config-targets := 0
+mixed-targets  := 0
+dot-config := 1
+
+ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
+   ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
+   dot-config := 0
+   endif
 endif
 
-KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
+ifeq ($(KBUILD_EXTMOD),)
+ifneq ($(filter config %config,$(MAKECMDGOALS)),)
+config-targets := 1
+ifneq ($(filter-out config %config,$(MAKECMDGOALS)),)
+mixed-targets := 1
+endif
+endif
+endif
 
-KBUILD_CFLAGS  += -g
-# $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -gformat
-# option to the assembler.
-KBUILD_AFLAGS  += -g
+ifeq ($(mixed-targets),1)
+# ===
+# We're called with mixed targets (*config and build targets).
+# Handle them one by one.
 
-NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
-CHECKFLAGS += $(NOSTDINC_FLAGS)
+%:: FORCE
+   $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@
 
-# Report stack usage if supported
-KBUILD_CFLAGS += $(call cc-option,-fstack-usage)
+else
+ifeq ($(config-targets),1)
+# ===
+# *config targets only - make sure prerequisites are updated, and descend
+# in scripts/kconfig to make the *config target
 
-KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
+# Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
+# KBUILD_DEFCONFIG may point out an alternative default configuration
+# used for 'make defconfig'
 
-# turn jbsr into jsr for m68k
-ifeq ($(ARCH),m68k)
-ifeq ($(findstring 

[U-Boot] [PATCH 26/34] Kbuild: generate {spl, tpl}-autoconf.mk only when it is necessary

2013-12-11 Thread Masahiro Yamada
Before this commit, {spl,tpl}-autoconf.mk was always generated
at the top Makefile even if SPL(TPL) build was not selected.

This commit moves the build rule of {spl,tpl}-autoconf.mk
from the top Makefile to spl/Makefile.
It prevents unnecessary {spl,tpl}-autoconf.mk from being
generated.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 23 ---
 spl/Makefile | 16 
 2 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/Makefile b/Makefile
index 2fae092..c805de1 100644
--- a/Makefile
+++ b/Makefile
@@ -867,9 +867,6 @@ tpl/u-boot-tpl.bin: $(SUBDIR_TOOLS) depend scripts_basic
 # Explicitly make _depend in subdirs containing multiple targets to prevent
 # parallel sub-makes creating .depend files simultaneously.
 depend dep:$(TIMESTAMP_FILE) $(VERSION_FILE) \
-   include/spl-autoconf.mk \
-   include/tpl-autoconf.mk \
-   include/autoconf.mk \
include/generated/generic-asm-offsets.h \
include/generated/asm-offsets.h
 
@@ -950,26 +947,6 @@ quiet_cmd_autoconf = GEN $@
 include/autoconf.mk: include/config.h
$(call cmd,autoconf)
 
-# Auto-generate the spl-autoconf.mk file (which is included by all makefiles 
for SPL)
-quiet_cmd_tpl-autoconf = GEN $@
-  cmd_tpl-autoconf = \
-   $(CPP) $(c_flags) -DCONFIG_TPL_BUILD  -DCONFIG_SPL_BUILD\
-   -DDO_DEPS_ONLY -dM $(srctree)/include/common.h  $@.tmp 
 \
-   sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
-   rm $@.tmp
-
-include/tpl-autoconf.mk: include/config.h
-   $(call cmd,tpl-autoconf)
-
-quiet_cmd_spl-autoconf = GEN $@
-  cmd_spl-autoconf = \
-   $(CPP) $(c_flags) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM 
$(srctree)/include/common.h  $@.tmp  \
-   sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
-   rm $@.tmp
-
-include/spl-autoconf.mk: include/config.h
-   $(call cmd,spl-autoconf)
-
 quiet_cmd_offsets = GEN $@
   cmd_offsets = $(srctree)/tools/scripts/make-asm-offsets $ $@
 
diff --git a/spl/Makefile b/spl/Makefile
index bf886f7..55d6824 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -50,6 +50,22 @@ include $(srctree)/scripts/Kbuild.include
 
 include $(TOPDIR)/config.mk
 
+# FIX ME
+c_flags := $(KBUILD_CFLAGS) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) 
$(NOSTDINC_FLAGS)
+
+# Auto-generate the spl-autoconf.mk file (which is included by all makefiles 
for SPL)
+quiet_cmd_autoconf = GEN $@
+  cmd_autoconf = \
+   $(CPP) $(c_flags) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h  
$@.tmp  \
+   sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
+   rm $@.tmp
+
+include/tpl-autoconf.mk: include/config.h
+   $(call cmd,autoconf)
+
+include/spl-autoconf.mk: include/config.h
+   $(call cmd,autoconf)
+
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard 
$(SRCTREE)/board/$(VENDOR)/common/Makefile),y,n)
 
 ifdef  CONFIG_SPL_START_S_PATH
-- 
1.8.3.2

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


[U-Boot] [PATCH 13/34] Makefile: refactor include path settings

2013-12-11 Thread Masahiro Yamada
This commit merges commonly-used header include paths
to UBOOTINCLUDE and NOSTDINC_FLAGS variables, which are placed
at the top Makefile.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile   | 14 +-
 config.mk  | 11 ++-
 tools/Makefile |  8 +++-
 tools/env/Makefile |  4 +---
 4 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index 0fb9d99..4e33cc3 100644
--- a/Makefile
+++ b/Makefile
@@ -226,6 +226,15 @@ CHECK  = sparse
 CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
  -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
 
+# Use UBOOTINCLUDE when you must reference the include/ directory.
+# Needed to be compatible with the O= option
+UBOOTINCLUDE:=
+ifneq ($(OBJTREE),$(SRCTREE))
+UBOOTINCLUDE   += -I$(OBJTREE)/include
+endif
+UBOOTINCLUDE   += -I$(srctree)/include \
+   -I$(srctree)/arch/$(ARCH)/include
+
 KBUILD_CPPFLAGS := -D__KERNEL__
 
 KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
@@ -238,7 +247,7 @@ export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
 export MAKE AWK
 export DTC CHECK CHECKFLAGS
 
-export KBUILD_CPPFLAGS
+export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE
 export KBUILD_CFLAGS KBUILD_AFLAGS
 
 KBUILD_CFLAGS += -Os #-fomit-frame-pointer
@@ -254,6 +263,9 @@ KBUILD_CFLAGS   += -g
 # option to the assembler.
 KBUILD_AFLAGS  += -g
 
+NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
+CHECKFLAGS += $(NOSTDINC_FLAGS)
+
 # Report stack usage if supported
 KBUILD_CFLAGS += $(call cc-option,-fstack-usage)
 
diff --git a/config.mk b/config.mk
index 0494805..283772d 100644
--- a/config.mk
+++ b/config.mk
@@ -94,8 +94,6 @@ RELFLAGS= $(PLATFORM_RELFLAGS)
 
 OBJCFLAGS += --gap-fill=0xff
 
-gccincdir := $(shell $(CC) -print-file-name=include)
-
 CPPFLAGS = $(KBUILD_CPPFLAGS) $(RELFLAGS)
 
 # Enable garbage collection of un-used sections for SPL
@@ -123,13 +121,8 @@ Please undefined CONFIG_SYS_GENERIC_BOARD in your board 
config file)
 endif
 endif
 
-ifneq ($(OBJTREE),$(SRCTREE))
-CPPFLAGS += -I$(OBJTREE)/include
-endif
-
-CPPFLAGS += -I$(TOPDIR)/include -I$(SRCTREE)/arch/$(ARCH)/include
-CPPFLAGS += -nostdinc  \
-   -isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
+CPPFLAGS += $(UBOOTINCLUDE)
+CPPFLAGS += $(NOSTDINC_FLAGS) -pipe $(PLATFORM_CPPFLAGS)
 
 CFLAGS = $(KBUILD_CFLAGS) $(CPPFLAGS)
 
diff --git a/tools/Makefile b/tools/Makefile
index 81c2406..a61e315 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -167,11 +167,9 @@ HOSTSRCS += $(addprefix 
$(SRCTREE)/lib/libfdt/,$(LIBFDT_OBJ_FILES-y:.o=.c))
 # Define _GNU_SOURCE to obtain the getline prototype from stdio.h
 #
 HOST_EXTRACFLAGS += -include $(SRCTREE)/include/libfdt_env.h \
-   -idirafter $(SRCTREE)/include \
-   -idirafter $(SRCTREE)/arch/$(ARCH)/include \
-   -idirafter $(OBJTREE)/include \
-   -I $(SRCTREE)/lib/libfdt \
-   -I $(SRCTREE)/tools \
+   $(patsubst -I%,-idirafter%, $(UBOOTINCLUDE)) \
+   -I$(SRCTREE)/lib/libfdt \
+   -I$(SRCTREE)/tools \
-DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \
-DUSE_HOSTCC \
-D__KERNEL_STRICT_NAMES \
diff --git a/tools/env/Makefile b/tools/env/Makefile
index c303815..d47fe16 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -6,9 +6,7 @@
 #
 
 # Compile for a hosted environment on the target
-HOST_EXTRACFLAGS  = -idirafter $(SRCTREE)/include \
-   -idirafter $(SRCTREE)/arch/$(ARCH)/include \
-   -idirafter $(OBJTREE)/include \
+HOST_EXTRACFLAGS  = $(patsubst -I%,-idirafter%, $(UBOOTINCLUDE)) \
-idirafter $(SRCTREE)/tools/env \
-DUSE_HOSTCC \
-DTEXT_BASE=$(TEXT_BASE)
-- 
1.8.3.2

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


[U-Boot] [PATCH 06/34] nand-spl: Use scripts/Makefile.build

2013-12-11 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile  |  2 +-
 nand_spl/board/amcc/acadia/Makefile   |  8 
 nand_spl/board/amcc/bamboo/Makefile   |  8 
 nand_spl/board/amcc/canyonlands/Makefile  |  8 
 nand_spl/board/amcc/kilauea/Makefile  |  8 
 nand_spl/board/amcc/sequoia/Makefile  |  8 
 nand_spl/board/freescale/mpc8315erdb/Makefile | 10 --
 nand_spl/board/freescale/mpc8536ds/Makefile   | 10 --
 nand_spl/board/freescale/mpc8569mds/Makefile  | 10 --
 nand_spl/board/freescale/mpc8572ds/Makefile   | 10 --
 nand_spl/board/freescale/p1023rds/Makefile| 11 +--
 nand_spl/board/freescale/p1_p2_rdb/Makefile   | 10 --
 nand_spl/board/sheldon/simpc8313/Makefile | 11 ---
 13 files changed, 2 insertions(+), 112 deletions(-)

diff --git a/Makefile b/Makefile
index c28a587..44742f4 100644
--- a/Makefile
+++ b/Makefile
@@ -544,7 +544,7 @@ $(obj)u-boot.lds: $(LDSCRIPT) depend
$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - $ 
$@
 
 nand_spl:  $(TIMESTAMP_FILE) $(VERSION_FILE) depend
-   $(MAKE) -C nand_spl/board/$(BOARDDIR) all
+   $(MAKE) $(build) nand_spl/board/$(BOARDDIR)
 
 $(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin
cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin  
$(obj)u-boot-nand.bin
diff --git a/nand_spl/board/amcc/acadia/Makefile 
b/nand_spl/board/amcc/acadia/Makefile
index 022a205..3b00d49 100644
--- a/nand_spl/board/amcc/acadia/Makefile
+++ b/nand_spl/board/amcc/acadia/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
 nandobj:= $(OBJTREE)/nand_spl/
@@ -94,10 +93,3 @@ $(obj)%.o:   $(obj)%.S
 
 $(obj)%.o: $(obj)%.c
$(CC) $(CFLAGS) -c -o $@ $
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/nand_spl/board/amcc/bamboo/Makefile 
b/nand_spl/board/amcc/bamboo/Makefile
index d413a48..4063274 100644
--- a/nand_spl/board/amcc/bamboo/Makefile
+++ b/nand_spl/board/amcc/bamboo/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
 nandobj:= $(OBJTREE)/nand_spl/
@@ -82,10 +81,3 @@ $(obj)%.o:   $(obj)%.S
 
 $(obj)%.o: $(obj)%.c
$(CC) $(CFLAGS) -c -o $@ $
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/nand_spl/board/amcc/canyonlands/Makefile 
b/nand_spl/board/amcc/canyonlands/Makefile
index b2ef03f..13c8b36 100644
--- a/nand_spl/board/amcc/canyonlands/Makefile
+++ b/nand_spl/board/amcc/canyonlands/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
 nandobj:= $(OBJTREE)/nand_spl/
@@ -87,10 +86,3 @@ $(obj)%.o:   $(obj)%.S
 
 $(obj)%.o: $(obj)%.c
$(CC) $(CFLAGS) -c -o $@ $
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/nand_spl/board/amcc/kilauea/Makefile 
b/nand_spl/board/amcc/kilauea/Makefile
index 5899b9e..9d07147 100644
--- a/nand_spl/board/amcc/kilauea/Makefile
+++ b/nand_spl/board/amcc/kilauea/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
 nandobj:= $(OBJTREE)/nand_spl/
@@ -83,10 +82,3 @@ $(obj)%.o:   $(obj)%.S
 
 $(obj)%.o: $(obj)%.c
$(CC) $(CFLAGS) -c -o $@ $
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/nand_spl/board/amcc/sequoia/Makefile 
b/nand_spl/board/amcc/sequoia/Makefile
index fea6c4e..111bb0d 100644
--- a/nand_spl/board/amcc/sequoia/Makefile
+++ b/nand_spl/board/amcc/sequoia/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
 nandobj:= $(OBJTREE)/nand_spl/
@@ -86,10 +85,3 @@ $(obj)%.o:   $(obj)%.S
 
 $(obj)%.o: $(obj)%.c
$(CC) $(CFLAGS) -c -o $@ $
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/nand_spl/board/freescale/mpc8315erdb/Makefile 
b/nand_spl/board/freescale/mpc8315erdb/Makefile
index c49a6e0..7813823 100644
--- 

[U-Boot] [PATCH 34/34] Kbuild: support simultaneous board configuration and make all

2013-12-11 Thread Masahiro Yamada
This commit fixed two problems:

[1] We could not do board configuration and make all
in one command line.

For example, the following did not work as we expect:
  $ make sandbox_config all
  Configuring for sandbox board...
  make: Nothing to be done for `all'.

[2] mixed-target build did not work with -j option

For example, the following did not work:
  $ make -j8 sandbox_config u-boot
  Makefile:481: *** System not configured - see README.  Stop.
  make: *** [u-boot] Error 2
  make: *** Waiting for unfinished jobs
  Configuring for sandbox board...

Going forward, we can do
  $ make -j8 sandbox_config all

This is the same as
  $ make sandbox_config
  $ make -j8

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index bd450e7..e034677 100644
--- a/Makefile
+++ b/Makefile
@@ -421,8 +421,16 @@ ifeq ($(mixed-targets),1)
 # We're called with mixed targets (*config and build targets).
 # Handle them one by one.
 
-%:: FORCE
-   $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@
+PHONY += $(MAKECMDGOALS) build-one-by-one
+
+$(MAKECMDGOALS): build-one-by-one
+   @:
+
+build-one-by-one:
+   $(Q)set -e; \
+   for i in $(MAKECMDGOALS); do \
+   $(MAKE) -f $(srctree)/Makefile $$i; \
+   done
 
 else
 ifeq ($(config-targets),1)
-- 
1.8.3.2

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


[U-Boot] [PATCH 23/34] Kbuild: move some lines to more suitable place

2013-12-11 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 57 +
 1 file changed, 29 insertions(+), 28 deletions(-)

diff --git a/Makefile b/Makefile
index 6fff457..3895364 100644
--- a/Makefile
+++ b/Makefile
@@ -14,34 +14,6 @@ U_BOOT_VERSION = 
$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 else
 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
 endif
-TIMESTAMP_FILE = include/generated/timestamp_autogenerated.h
-VERSION_FILE = include/generated/version_autogenerated.h
-
-HOSTARCH := $(shell uname -m | \
-   sed -e s/i.86/x86/ \
-   -e s/sun4u/sparc64/ \
-   -e s/arm.*/arm/ \
-   -e s/sa110/arm/ \
-   -e s/ppc64/powerpc/ \
-   -e s/ppc/powerpc/ \
-   -e s/macppc/powerpc/\
-   -e s/sh.*/sh/)
-
-HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
-   sed -e 's/\(cygwin\).*/cygwin/')
-
-export HOSTARCH HOSTOS
-
-# Deal with colliding definitions from tcsh etc.
-VENDOR=
-
-#
-# Allow for silent builds
-ifeq (,$(findstring s,$(MAKEFLAGS)))
-XECHO = echo
-else
-XECHO = :
-endif
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute make help
@@ -212,6 +184,35 @@ unexport CDPATH
 
 #
 
+TIMESTAMP_FILE = include/generated/timestamp_autogenerated.h
+VERSION_FILE = include/generated/version_autogenerated.h
+
+HOSTARCH := $(shell uname -m | \
+   sed -e s/i.86/x86/ \
+   -e s/sun4u/sparc64/ \
+   -e s/arm.*/arm/ \
+   -e s/sa110/arm/ \
+   -e s/ppc64/powerpc/ \
+   -e s/ppc/powerpc/ \
+   -e s/macppc/powerpc/\
+   -e s/sh.*/sh/)
+
+HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
+   sed -e 's/\(cygwin\).*/cygwin/')
+
+export HOSTARCH HOSTOS
+
+# Deal with colliding definitions from tcsh etc.
+VENDOR=
+
+#
+# Allow for silent builds
+ifeq (,$(findstring s,$(MAKEFLAGS)))
+XECHO = echo
+else
+XECHO = :
+endif
+
 # The tools are needed early, so put this first
 # Don't include stuff already done in $(LIBS)
 # The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
-- 
1.8.3.2

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


[U-Boot] [PATCH 20/34] Kbuild: import more build scripts from Linux v3.12 tag

2013-12-11 Thread Masahiro Yamada
This commit imports build scripts from Linux Kernel v3.12
as they are.

I know they include some trailing spaces
but I keep intentionally them untouched.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 scripts/Makefile.build   | 479 +++
 scripts/Makefile.clean   | 104 ++
 scripts/Makefile.host| 170 +
 scripts/Makefile.lib | 373 
 scripts/basic/.gitignore |   1 +
 scripts/basic/Makefile   |  15 ++
 scripts/basic/fixdep.c   | 462 +
 scripts/mkmakefile   |  59 ++
 8 files changed, 1663 insertions(+)
 create mode 100644 scripts/Makefile.build
 create mode 100644 scripts/Makefile.clean
 create mode 100644 scripts/Makefile.host
 create mode 100644 scripts/Makefile.lib
 create mode 100644 scripts/basic/.gitignore
 create mode 100644 scripts/basic/Makefile
 create mode 100644 scripts/basic/fixdep.c
 create mode 100644 scripts/mkmakefile

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
new file mode 100644
index 000..d5d859c
--- /dev/null
+++ b/scripts/Makefile.build
@@ -0,0 +1,479 @@
+# ==
+# Building
+# ==
+
+src := $(obj)
+
+PHONY := __build
+__build:
+
+# Init all relevant variables used in kbuild files so
+# 1) they have correct type
+# 2) they do not inherit any value from the environment
+obj-y :=
+obj-m :=
+lib-y :=
+lib-m :=
+always :=
+targets :=
+subdir-y :=
+subdir-m :=
+EXTRA_AFLAGS   :=
+EXTRA_CFLAGS   :=
+EXTRA_CPPFLAGS :=
+EXTRA_LDFLAGS  :=
+asflags-y  :=
+ccflags-y  :=
+cppflags-y :=
+ldflags-y  :=
+
+subdir-asflags-y :=
+subdir-ccflags-y :=
+
+# Read auto.conf if it exists, otherwise ignore
+-include include/config/auto.conf
+
+include scripts/Kbuild.include
+
+# For backward compatibility check that these variables do not change
+save-cflags := $(CFLAGS)
+
+# The filename Kbuild has precedence over Makefile
+kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
+kbuild-file := $(if $(wildcard 
$(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
+include $(kbuild-file)
+
+# If the save-* variables changed error out
+ifeq ($(KBUILD_NOPEDANTIC),)
+ifneq ($(save-cflags),$(CFLAGS))
+$(error CFLAGS was changed in $(kbuild-file). Fix it to use 
ccflags-y)
+endif
+endif
+
+#
+# make W=... settings
+#
+# W=1 - warnings that may be relevant and does not occur too often
+# W=2 - warnings that occur quite often but may still be relevant
+# W=3 - the more obscure warnings, can most likely be ignored
+#
+# $(call cc-option, -W...) handles gcc -W.. options which
+# are not supported by all versions of the compiler
+ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
+warning-  := $(empty)
+
+warning-1 := -Wextra -Wunused -Wno-unused-parameter
+warning-1 += -Wmissing-declarations
+warning-1 += -Wmissing-format-attribute
+warning-1 += -Wmissing-prototypes
+warning-1 += -Wold-style-definition
+warning-1 += $(call cc-option, -Wmissing-include-dirs)
+warning-1 += $(call cc-option, -Wunused-but-set-variable)
+warning-1 += $(call cc-disable-warning, missing-field-initializers)
+
+warning-2 := -Waggregate-return
+warning-2 += -Wcast-align
+warning-2 += -Wdisabled-optimization
+warning-2 += -Wnested-externs
+warning-2 += -Wshadow
+warning-2 += $(call cc-option, -Wlogical-op)
+warning-2 += $(call cc-option, -Wmissing-field-initializers)
+
+warning-3 := -Wbad-function-cast
+warning-3 += -Wcast-qual
+warning-3 += -Wconversion
+warning-3 += -Wpacked
+warning-3 += -Wpadded
+warning-3 += -Wpointer-arith
+warning-3 += -Wredundant-decls
+warning-3 += -Wswitch-default
+warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
+warning-3 += $(call cc-option, -Wvla)
+
+warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
+warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
+warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
+
+ifeq ($(strip $(warning)),)
+$(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
+endif
+
+KBUILD_CFLAGS += $(warning)
+endif
+
+include scripts/Makefile.lib
+
+ifdef host-progs
+ifneq ($(hostprogs-y),$(host-progs))
+$(warning kbuild: $(obj)/Makefile - Usage of host-progs is deprecated. Please 
replace with hostprogs-y!)
+hostprogs-y += $(host-progs)
+endif
+endif
+
+# Do not include host rules unless needed
+ifneq ($(hostprogs-y)$(hostprogs-m),)
+include scripts/Makefile.host
+endif
+
+ifneq ($(KBUILD_SRC),)
+# Create output directory if not already present
+_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
+
+# Create directories for object files if directory does not exist
+# Needed when obj-y := dir/file.o syntax is used
+_dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
+endif
+
+ifndef obj
+$(warning kbuild: Makefile.build is 

[U-Boot] [PATCH v5] Makefile: add a new script to check -fstack-usage support

2013-12-11 Thread Masahiro Yamada
If -fstack-usage option is given to crosstools
that do not support it, gcc displays a warning message
but still exits with status 0.

This means we can not rely on $(call cc-option,...)
to detect if -fstack-usage option is supported or not.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

Some crosstools currently do not support -fstack-usage option.
For example, bfin-uclinux-gcc, which is available at
https://www.kernel.org/pub/tools/crosstool/

If -fstack-usage option is given to such crosstools,
gcc displays a warning message as follows:

warning: -fstack-usage not supported for this target [enabled by default]

But it still exits with status 0.

So, $(call cc-option,-fstack-usage) does not work as we expect
because cc-option checks exit status
to judge whether the given option is supported or not.


Changes in v5:
  - Rebased on Kbuild series

Changes in v4:
  - Drop executable permission of scripts/gcc-stack-usage.sh
  - Fix commit log
  - Add the rationale below ---

 Makefile   |  4 +++-
 scripts/gcc-stack-usage.sh | 18 ++
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 scripts/gcc-stack-usage.sh

diff --git a/Makefile b/Makefile
index e034677..8f8a131 100644
--- a/Makefile
+++ b/Makefile
@@ -553,7 +553,9 @@ KBUILD_CFLAGS   += -g
 KBUILD_AFLAGS  += -g
 
 # Report stack usage if supported
-KBUILD_CFLAGS += $(call cc-option,-fstack-usage)
+ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-stack-usage.sh $(CC)),y)
+   KBUILD_CFLAGS += -fstack-usage
+endif
 
 KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
 
diff --git a/scripts/gcc-stack-usage.sh b/scripts/gcc-stack-usage.sh
new file mode 100644
index 000..27ac928
--- /dev/null
+++ b/scripts/gcc-stack-usage.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Test for gcc '-fstack-usage' support
+# Copyright (C) 2013, Masahiro Yamada yamad...@jp.panasonic.com
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+TMP=$$
+
+cat END | $@ -Werror -fstack-usage -x c - -c -o $TMP /dev/null 21 \
+echo y
+int main(void)
+{
+   return 0;
+}
+END
+
+rm -f $TMP $TMP.su
-- 
1.8.3.2

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


Re: [U-Boot] [PATCH v4] config.mk: fix -fstack-usage support test

2013-12-11 Thread Masahiro Yamada
Hi.

Please supersed this.

I posted v5 which is rebased on Kbuild series.
(Switch over to real Kbuild, which conststs of 34 patch files)
I want to avoid a conflict with Kbuild series.

Best Regards
Masahiro Yamada

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


Re: [U-Boot] [PATCH 07/10] samsung: misc: Add LCD download menu.

2013-12-11 Thread Przemyslaw Marczak

Dear Minkyu,

On 12/11/2013 09:15 AM, Minkyu Kang wrote:

Dear Przemyslaw Marczak,

On 04/12/13 03:03, Przemyslaw Marczak wrote:

New configs:
- CONFIG_LCD_MENU
- CONFIG_LCD_MENU_BOARD
which depends on: CONFIG_MISC_INIT_R

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
  board/samsung/common/keys.h |   78 ++
  board/samsung/common/misc.c |  354 +++
  2 files changed, 432 insertions(+)
  create mode 100644 board/samsung/common/keys.h

diff --git a/board/samsung/common/keys.h b/board/samsung/common/keys.h
new file mode 100644
index 000..48822d1
--- /dev/null
+++ b/board/samsung/common/keys.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+#ifndef __SAMSUNG_KEYS__
+#define __SAMSUNG_KEYS__
+
+#ifndef __ASSEMBLY__
+
+#include config.h
+#include common.h
+#include power/pmic.h
+#include asm/arch/gpio.h
+
+/* PMIC PWR ON key */
+#if defined(CONFIG_MACH_GONI) || defined(CONFIG_UNIVERSAL)
+
+#include power/max8998_pmic.h
+
+#define KEY_PWR_PMIC_NAME  MAX8998_PMIC
+
+#define KEY_PWR_STATUS_REG MAX8998_REG_STATUS1
+#define KEY_PWR_STATUS_MASK(1  7)
+
+#define KEY_PWR_INTERRUPT_REG  MAX8998_REG_IRQ1
+#define KEY_PWR_INTERRUPT_MASK (1  7)
+
+#elif defined(CONFIG_TRATS)
+
+#include power/max8997_pmic.h
+
+#define KEY_PWR_PMIC_NAME  MAX8997_PMIC
+
+#define KEY_PWR_STATUS_REG MAX8997_REG_STATUS1
+#define KEY_PWR_STATUS_MASK(1  0)
+
+#define KEY_PWR_INTERRUPT_REG  MAX8997_REG_INT1
+#define KEY_PWR_INTERRUPT_MASK (1  0)
+
+#elif defined(CONFIG_TRATS2)
+
+#include power/max77686_pmic.h
+
+#define KEY_PWR_PMIC_NAME  MAX77686_PMIC
+
+#define KEY_PWR_STATUS_REG MAX77686_REG_PMIC_STATUS1
+#define KEY_PWR_STATUS_MASK(1  0)
+
+#define KEY_PWR_INTERRUPT_REG  MAX77686_REG_PMIC_INT1
+#define KEY_PWR_INTERRUPT_MASK (1  1)
+
+#endif /* PMIC PWR ON key */


Hm no. it's a board specific feature so it should be go to each boards.
Maybe we need some.. framework?



Ok, I will move it to boards configs headers.
And one more about some framework. I think this is good idea but I 
prefer to use this simple version first.

We can extend pmic framework with some ops to struct pmic, eg.:
- get_power_key() - status or interrupt
- check_usb_cable()
the same as low_power_mode() which exists.
So at this time we can add two pmic extensions.

Also such pmic framework should provide some generic function to just 
get power key state and usb cable connection with no worry about 
specified pmic name like it is now.

This also adding new problem - what if board has few pmic instances...

This things requires other patch set and adding it here will increase 
this patch set apply time.

So I prefer to just put this code to boards headers.


+
+/* GPIO for Vol Up and Vol Down */
+#if defined(CONFIG_MACH_GONI)
+
+#define KEY_VOL_UP_GPIOs5pc110_gpio_get(h3, 1)
+#define KEY_VOL_DOWN_GPIO  s5pc110_gpio_get(h3, 2)
+
+#elif defined(CONFIG_UNIVERSAL) || defined(CONFIG_TRATS)
+
+#define KEY_VOL_UP_GPIOexynos4_gpio_get(2, x2, 0)
+#define KEY_VOL_DOWN_GPIO  exynos4_gpio_get(2, x2, 1)
+
+#elif defined(CONFIG_TRATS2)
+
+#define KEY_VOL_UP_GPIOexynos4x12_gpio_get(2, x2, 2)
+#define KEY_VOL_DOWN_GPIO  exynos4x12_gpio_get(2, x3, 3)
+
+#else
+#ifdef CONFIG_MISC_INIT_R
+#warning Vol UP and Vol DOWN GPIO are undefined!
+#endif
+#endif /* GPIO for Vol Up and Vol Down */


ditto.
Will you add ifdef when you add new boards?
It doesn't make sense.


+
+#endif /* __ASSEMBLY__ */
+#endif /* __SAMSUNG_KEYS__ */
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index fa97644..c792b87 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -8,8 +8,357 @@
  #include common.h
  #include lcd.h
  #include libtizen.h
+#include errno.h
+#include version.h
+#include asm/sizes.h
+#include asm/arch/cpu.h
+#include asm/arch/gpio.h
+#include asm/gpio.h
+#include linux/input.h
+#include lcd.h
+#include libtizen.h
+#include mmc.h
+#include keys.h

  #ifdef CONFIG_MISC_INIT_R
+struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned);
+int s5p_gpio_get_pin(unsigned);
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void);
+#endif
+
+#ifdef CONFIG_LCD_MENU
+enum {
+   BOOT_MODE_INFO,
+   BOOT_MODE_THOR,
+   BOOT_MODE_UMS,
+   BOOT_MODE_DFU,
+   BOOT_MODE_EXIT,
+};
+
+static int power_key_pressed(int reg)
+{
+   struct pmic *pmic = pmic_get(KEY_PWR_PMIC_NAME);
+   u32 status = 0;
+   u32 mask;
+
+   if (pmic_probe(pmic))
+   return 0;
+
+   if (!pmic) {
+   printf(%s: Not found\n, KEY_PWR_PMIC_NAME);
+   return -ENODEV;
+   }
+
+   if (reg == KEY_PWR_STATUS_REG)
+   mask = 

[U-Boot] [PATCH v14] Introduced btrfs file-system with btrload command

2013-12-11 Thread Koen Kooi
From: Adnan Ali adnan@codethink.co.uk

Introduces btrfs file-system to read file from
volume/sub-volumes with btrload command. This
implementation has read-only support.
This btrfs implementation is based on syslinux btrfs
code.

v14: Merge conflicts, makefile updates and do_load API changes
v13: Added pre-calculated crc for BE  LE
v11: Mirro super block check.
v10: patch problem reworked.
v5:  merged with master.
v4:  btrls command added.

[port of syslinux commit 269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d]

Signed-off-by: Adnan Ali adnan@codethink.co.uk
Signed-off-by: Koen Kooi k...@dominion.thruhere.net
---

Doesn't work for me on armv7a:

U-Boot# ls mmc 1:1
   104092   mlo 
   388916   u-boot.img 
   92   uenv.txt 
  4718096   zimage 
   86   uenv.txt~ 
boot/

5 file(s), 1 dir(s)

U-Boot# ls mmc 1:2
Failed to mount ext2 filesystem...
data abort

MAYBE you should read doc/README.arm-unaligned-accesses

pc : [9f77e6a4]  lr : [9f77d558]
sp : 9f62cda8  ip : 9f633718 fp : 9f62d5f0
r10: 9f7a40bc  r9 : 9f62cf28 r8 : 9ffecd38
r7 : 9f7a2a24  r6 : 9ffbc088 r5 : 9ffbbfbc  r4 : 0061
r3 : 9ffbc425  r2 : 9ffbc411 r1 :   r0 : 9f62cda8
Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32
Resetting CPU ...


U-Boot# btrls mmc 1:2
data abort

MAYBE you should read doc/README.arm-unaligned-accesses

pc : [9f77e6a4]  lr : [9f75bf40]
sp : 9f62cda8  ip : 9f633718 fp : 9f62d5f0
r10: 9f7a40bc  r9 : 9f62cf28 r8 : 9ffecd38
r7 : 9f7a2a24  r6 : 9ffbc088 r5 : 9ffbbfbc  r4 : 0061
r3 : 9ffbc425  r2 : 9ffbc411 r1 :   r0 : 9f62cda8
Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32

It's not unaligned access since I have Mans' patch that removes this bit:

orr r0, r0, #0x0002 @ set bit 1 (--A-) Align

Anyway, I updated this patch so it applies and builds again, someone will have 
to debug the data abort.

 common/Makefile|1 +
 common/cmd_btr.c   |   65 +++
 fs/Makefile|1 +
 fs/btrfs/Makefile  |   12 +
 fs/btrfs/btrfs.c   | 1336 
 fs/fs.c|   10 +
 include/btrfs.h|  417 ++
 include/config_fallbacks.h |4 +
 include/crc.h  |5 +
 include/fs.h   |1 +
 lib/Makefile   |1 +
 lib/crc32_c.c  |  108 
 12 files changed, 1961 insertions(+)
 create mode 100644 common/cmd_btr.c
 create mode 100644 fs/btrfs/Makefile
 create mode 100644 fs/btrfs/btrfs.c
 create mode 100644 include/btrfs.h
 create mode 100644 lib/crc32_c.c

diff --git a/common/Makefile b/common/Makefile
index 74404be..6025a12 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -57,6 +57,7 @@ obj-$(CONFIG_CMD_BMP) += cmd_bmp.o
 obj-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o
 obj-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
 obj-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o
+obj-$(CONFIG_CMD_BTR) += cmd_btr.o
 obj-$(CONFIG_CMD_CACHE) += cmd_cache.o
 obj-$(CONFIG_CMD_CBFS) += cmd_cbfs.o
 obj-$(CONFIG_CMD_CONSOLE) += cmd_console.o
diff --git a/common/cmd_btr.c b/common/cmd_btr.c
new file mode 100644
index 000..02a4bf1
--- /dev/null
+++ b/common/cmd_btr.c
@@ -0,0 +1,65 @@
+/*
+ * (C) Copyright 2013 Codethink Limited
+ * Btrfs port to Uboot by
+ * Adnan Ali adnan@codethink.co.uk
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/*
+ * Boot support
+ */
+#include fs.h
+#include btrfs.h
+
+char subvolname[BTRFS_MAX_SUBVOL_NAME];
+
+int do_btr_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   if (argc  5)
+   strcpy(subvolname, argv[5]);
+   else
+   subvolname[0] = '\0';
+
+   return do_load(cmdtp, flag, argc, argv, FS_TYPE_BTR);
+}
+
+
+U_BOOT_CMD(
+btrload,7,  0,  do_btr_fsload,
+   load binary file from a btr filesystem,
+   interface [dev[:part]]  addr filename [subvol_name]\n
+   - Load binary file 'filename' from 'dev' on 'interface'\n
+ to address 'addr' from better filesystem.\n
+ the load stops on end of file.\n
+ subvol_name is used read that file from this 

Re: [U-Boot] [PATCH 08/10] Trats: add LCD download menu support

2013-12-11 Thread Przemyslaw Marczak

Dear Minkyu,

On 12/11/2013 09:15 AM, Minkyu Kang wrote:

On 04/12/13 03:03, Przemyslaw Marczak wrote:

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Lukasz Majewski l.majew...@samsung.com
---
  include/configs/trats.h |   10 ++
  1 file changed, 10 insertions(+)

diff --git a/include/configs/trats.h b/include/configs/trats.h
index 9738a00..d3bed99 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -19,6 +19,7 @@
  #define CONFIG_EXYNOS4210 /* which is in a EXYNOS4210 */
  #define CONFIG_TRATS  /* working with TRATS */
  #define CONFIG_TIZEN  /* TIZEN lib */
+#define CONFIG_BOARD_NAME  TRATS

  #include asm/arch/cpu.h   /* get chip and board defs */

@@ -313,6 +314,15 @@
  /* Common misc for Samsung */
  #define CONFIG_MISC_INIT_R1

+/* Download menu - Samsung common */
+#define CONFIG_LCD_MENU1
+#define CONFIG_LCD_MENU_BOARD  1
+
+/* LCD console */
+#define LCD_BPPLCD_COLOR16
+#undef  LCD_TEST_PATTERN


Where is this define?



This left after test. Will be removed from every board header.


+#define CONFIG_SYS_WHITE_ON_BLACK  1
+
  /* LCD */
  #define CONFIG_EXYNOS_FB
  #define CONFIG_LCD



Thanks,
Minkyu Kang.



Regards
--
Przemyslaw Marczak
Samsung RD Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 05/10] lib: tizen: add Tizen 16bpp logo support.

2013-12-11 Thread Przemyslaw Marczak

Hello Inha,

On 12/11/2013 02:56 AM, Inha Song wrote:


Hi, Marczak

I think, this patch can make unalgined access.

(maybe.. this code)

if (vid-vl_bpix == 4)
vid-logo_addr = (ulong)tizen_hd_logo_16bpp;
else
vid-logo_addr = (ulong)tizen_hd_logo;


Compiled using arm-linux-gnueabi (4.6.3 version) and
When I tested using TRTAS2 board,

I can face data abort error message like this,

//
data abort

 MAYBE you should read doc/README.arm-unaligned-accesses

pc : [7de5d150]  lr : [0244]
sp : 78e4beb8  ip : 7de9f921 fp : 43e00020
r10: 43e3a048  r9 : 78e4bf20 r8 : 1100
r7 : 1140  r6 :  r5 : 02d0  r4 : 0001
r3 : 0064  r2 : 004d r1 : 0004  r0 : 7de9f921
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32
Resetting CPU ...

resetting ...
///

Thank you.

 Original message 

On Tue, 03 Dec 2013 19:03:21 +0100
Przemyslaw Marczak p.marc...@samsung.com wrote:


Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
This is big size patch. Please follow link:
http://www.denx.de/wiki/pub/U-Boot/TooBigPatches/0005-lib-tizen-add-Tizen-16bpp-logo-support.patch
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot





Actually I used GCC 4.5. Linaro Gcc versions = 4.6 has unaligned acces 
enabled by default. Maybe flag -mno-unaligned-access will avoid this. I 
will check this issue.


Regards.

--
Przemyslaw Marczak
Samsung RD Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] env_eeprom - fix bus recovery for eeprom_bus_read

2013-12-11 Thread Alexey Brodkin
env_eeprom_bus is no longer in use (it was introduced in commit
548738b4d43af841ff58c787bce297ac6a8bf7d1 cmd_eeprom: I2C updates).

As in eeprom_bus_write we just reset I2C bus with the one we saved in
old_bus.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Cc: Wolfgang Denk w...@denx.de
Cc: Tom Rini tr...@ti.com
Cc: Heiko Schocher h...@denx.de
---
 common/env_eeprom.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/common/env_eeprom.c b/common/env_eeprom.c
index 0dcdd1f..0db2bb6 100644
--- a/common/env_eeprom.c
+++ b/common/env_eeprom.c
@@ -24,7 +24,6 @@ DECLARE_GLOBAL_DATA_PTR;
 env_t *env_ptr;
 
 char *env_name_spec = EEPROM;
-int env_eeprom_bus = -1;
 
 static int eeprom_bus_read(unsigned dev_addr, unsigned offset,
   uchar *buffer, unsigned cnt)
@@ -40,8 +39,7 @@ static int eeprom_bus_read(unsigned dev_addr, unsigned offset,
rcode = eeprom_read(dev_addr, offset, buffer, cnt);
 
 #if defined(CONFIG_I2C_ENV_EEPROM_BUS)
-   if (old_bus != env_eeprom_bus)
-   i2c_set_bus_num(old_bus);
+   i2c_set_bus_num(old_bus);
 #endif
 
return rcode;
@@ -63,6 +61,7 @@ static int eeprom_bus_write(unsigned dev_addr, unsigned 
offset,
 #if defined(CONFIG_I2C_ENV_EEPROM_BUS)
i2c_set_bus_num(old_bus);
 #endif
+
return rcode;
 }
 
-- 
1.8.4.2

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


Re: [U-Boot] [PATCH v5] arm: omap3: Add SPL support to cm_t35

2013-12-11 Thread Igor Grinberg
Hi Stefan,

Finally, I've found some time to look at the patch...
Generally, it is fine...
I say generally, because we have found several bugs, but they
are not related to your patch... but to Pekon's work on the
omap nand driver. Nikita is on them ;-)

One minor comment below...

On 12/04/13 14:54, Stefan Roese wrote:
 Add SPL U-Boot support to replace x-loader on the Compulab cm_t35
 board. Currently only the 256MiB SDRAM board versions are supported.
 
 Tested by booting via MMC and NAND.
 
 Signed-off-by: Stefan Roese s...@denx.de
 Cc: Tom Rini tr...@ti.com
 Cc: Igor Grinberg grinb...@compulab.co.il
 Cc: Nikita Kiryanov nik...@compulab.co.il

Apart from the comment below,
Acked-by: Igor Grinberg grinb...@compulab.co.il

 ---
 v5:
 - Added CONFIG_NAND_OMAP_ECCSCHEME to select HW ECC by default
 - Tested with latest mainline U-Boot 2014.01-rc1,
   needs fix for 8bit NAND device from Pekon Gupta
 
 v4:
 - Rebased and retested on current mainline version
 
 v3:
 - Some instability of this SDRAM setup has been detected while running
   Linux. Comparison with the x-loader setup showed that mcfg is configured
   slightly differently here. CM_T35 needs RAS-width of 14 instead of
   13. So use the define MICRON_V_MCFG_200 which implements this 14
   as RAS width.
 
 v2:
 - Change CONFIG_SYS_TEXT_BASE back to 0x80008000 for x-loader
   compatibility
 - Change CONFIG_SPL_BSS_START_ADDR to 0x8010 to not overlap
   with TEXT_BASE now
 
  board/compulab/cm_t35/cm_t35.c | 18 +++-
  include/configs/cm_t35.h   | 65 
 --
  2 files changed, 80 insertions(+), 3 deletions(-)
 
 diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c
 index bc8e0ca..00bcf41 100644
 --- a/board/compulab/cm_t35/cm_t35.c
 +++ b/board/compulab/cm_t35/cm_t35.c
 @@ -105,6 +105,22 @@ static inline int splash_load_from_nand(void)
  }
  #endif /* CONFIG_CMD_NAND */
  
 +#ifdef CONFIG_SPL_BUILD
 +/*
 + * Routine: get_board_mem_timings
 + * Description: If we use SPL then there is no x-loader nor config header
 + * so we have to setup the DDR timings ourself on both banks.
 + */
 +void get_board_mem_timings(struct board_sdrc_timings *timings)
 +{
 + timings-mr = MICRON_V_MR_165;
 + timings-mcfg = MICRON_V_MCFG_200(256  20); /* raswidth 14 needed */
 + timings-ctrla = MICRON_V_ACTIMA_165;
 + timings-ctrlb = MICRON_V_ACTIMB_165;
 + timings-rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
 +}
 +#endif
 +
  int splash_screen_prepare(void)
  {
   char *env_splashimage_value;
 @@ -440,7 +456,7 @@ void set_muxconf_regs(void)
   cm_t3730_set_muxconf();
  }
  
 -#ifdef CONFIG_GENERIC_MMC
 +#if defined(CONFIG_GENERIC_MMC)  !defined(CONFIG_SPL_BUILD)
  int board_mmc_getcd(struct mmc *mmc)
  {
   u8 val;
 diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
 index f4ecd0d..2e865c0 100644
 --- a/include/configs/cm_t35.h
 +++ b/include/configs/cm_t35.h
 @@ -27,8 +27,6 @@
  #define CONFIG_CM_T3X/* working with CM-T35 and CM-T3730 */
  #define CONFIG_OMAP_COMMON
  
 -#define CONFIG_SYS_TEXT_BASE 0x80008000
 -
  #define CONFIG_SDRC  /* The chip has SDRC controller */
  
  #include asm/arch/cpu.h/* get chip and board defs */
 @@ -329,4 +327,67 @@
  
  #define CONFIG_OMAP3_SPI
  
 +/* Defines for SPL */
 +#define CONFIG_SPL
 +#define CONFIG_SPL_FRAMEWORK
 +#define CONFIG_SPL_NAND_SIMPLE
 +
 +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR  0x300 /* address 
 0x6 */
 +#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS   0x200 /* 256 KB */

Our U-Boot binary sizes are beyond 300KiB...
This config is not used anywhere besides config files and README...
That's why it probably works for you...
I think we should either remove it from the README and configs, or
set it to 0x300 or even 0x400 instead (in case we still want to use it,
although I don't know why, as we have the size from the image header).

 +#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
 +#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME u-boot.img
 +
 +#define CONFIG_SPL_BOARD_INIT
 +#define CONFIG_SPL_LIBCOMMON_SUPPORT
 +#define CONFIG_SPL_LIBDISK_SUPPORT
 +#define CONFIG_SPL_I2C_SUPPORT
 +#define CONFIG_SPL_LIBGENERIC_SUPPORT
 +#define CONFIG_SPL_MMC_SUPPORT
 +#define CONFIG_SPL_FAT_SUPPORT
 +#define CONFIG_SPL_SERIAL_SUPPORT
 +#define CONFIG_SPL_NAND_SUPPORT
 +#define CONFIG_SPL_NAND_BASE
 +#define CONFIG_SPL_NAND_DRIVERS
 +#define CONFIG_SPL_NAND_ECC
 +#define CONFIG_SPL_GPIO_SUPPORT
 +#define CONFIG_SPL_POWER_SUPPORT
 +#define CONFIG_SPL_OMAP3_ID_NAND
 +#define CONFIG_SPL_LDSCRIPT  $(CPUDIR)/omap-common/u-boot-spl.lds
 +
 +/* NAND boot config */
 +#define CONFIG_SYS_NAND_5_ADDR_CYCLE
 +#define CONFIG_SYS_NAND_PAGE_COUNT   64
 +#define CONFIG_SYS_NAND_PAGE_SIZE2048
 +#define CONFIG_SYS_NAND_OOBSIZE  64
 +#define CONFIG_SYS_NAND_BLOCK_SIZE   (128 * 1024)
 +#define CONFIG_SYS_NAND_BAD_BLOCK_POSNAND_LARGE_BADBLOCK_POS
 +/*
 + * Use the ECC/OOB 

[U-Boot] am3517_evm: Ethernet activation

2013-12-11 Thread yegorslists
This patch continues Tom's effort in activating Ethernet on am3517_evm board
(http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-arm.git;a=commit;h=18a02e8050b7af165efa72325753e7880bf5567c).

I've removed #if statements, because in include/configs/am3517_evm.h EMAC is 
activated by default. I've also enebled
CONFIG_OMAP_GPIO (needed to turn pin 30 on).

Patch created against u-boot/u-boot-ti.git

Yegor

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


[U-Boot] [PATCH v4] am3517_evm: activate Ethernet PHY

2013-12-11 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Pin 30 is connected to PHY's RESET# signal, so it must be
put to high. Otherwise PHY won't be found via MDIO interface.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
Changes:
v4: as Tom Rini's patch AM3517 EVM: Enable Ethernet activates EMAC by 
default, remove #if statements
v3: use __maybe_unused, instead of #if defined statement (Stefan 
Roese)
v2: put ctr and reset under #if defined statement, to avoid compiler 
warnings, when EMAC is not selected

 board/logicpd/am3517evm/am3517evm.c |   32 
 board/logicpd/am3517evm/am3517evm.h |2 +-
 include/configs/am3517_evm.h|5 +
 3 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/board/logicpd/am3517evm/am3517evm.c 
b/board/logicpd/am3517evm/am3517evm.c
index b6c68da..5196b5d 100644
--- a/board/logicpd/am3517evm/am3517evm.c
+++ b/board/logicpd/am3517evm/am3517evm.c
@@ -22,6 +22,7 @@
 #include asm/arch/musb.h
 #include asm/mach-types.h
 #include asm/errno.h
+#include asm/gpio.h
 #include linux/usb/ch9.h
 #include linux/usb/gadget.h
 #include linux/usb/musb.h
@@ -31,6 +32,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define AM3517_IP_SW_RESET 0x48002598
+#define CPGMACSS_SW_RST(1  1)
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -98,6 +102,9 @@ static void am3517_evm_musb_init(void)
  */
 int misc_init_r(void)
 {
+   volatile unsigned int ctr;
+   u32 reset;
+
 #ifdef CONFIG_DRIVER_OMAP34XX_I2C
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
@@ -106,6 +113,31 @@ int misc_init_r(void)
 
am3517_evm_musb_init();
 
+   /* activate PHY reset */
+   gpio_direction_output(30, 0);
+   gpio_set_value(30, 0);
+
+   ctr  = 0;
+   do {
+   udelay(1000);
+   ctr++;
+   } while (ctr  300);
+
+   /* deactivate PHY reset */
+   gpio_set_value(30, 1);
+
+   /* allow the PHY to stabilize and settle down */
+   ctr = 0;
+   do {
+   udelay(1000);
+   ctr++;
+   } while (ctr  300);
+
+   /* ensure that the module is out of reset */
+   reset = readl(AM3517_IP_SW_RESET);
+   reset = (~CPGMACSS_SW_RST);
+   writel(reset,AM3517_IP_SW_RESET);
+
return 0;
 }
 
diff --git a/board/logicpd/am3517evm/am3517evm.h 
b/board/logicpd/am3517evm/am3517evm.h
index 704af84..d407d66 100644
--- a/board/logicpd/am3517evm/am3517evm.h
+++ b/board/logicpd/am3517evm/am3517evm.h
@@ -315,7 +315,7 @@ const omap3_sysinfo sysinfo = {
MUX_VAL(CP(SYS_CLKREQ), (IEN  | PTD | DIS | M0)) \
MUX_VAL(CP(SYS_NIRQ),   (IEN  | PTU | EN  | M0)) \
/*SYS_nRESWARM */\
-   MUX_VAL(CP(SYS_NRESWARM),   (IDIS | PTU | DIS | M4)) \
+   MUX_VAL(CP(SYS_NRESWARM),   (IDIS | PTU | EN | M4)) \
/* - GPIO30 */\
MUX_VAL(CP(SYS_BOOT0),  (IEN  | PTD | DIS | M4)) /*GPIO_2*/\
 /* - PEN_IRQ */\
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index 5e259f5..e22a46b 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -58,6 +58,11 @@
  */
 
 /*
+ * OMAP GPIO configuration
+ */
+#define CONFIG_OMAP_GPIO
+
+/*
  * NS16550 Configuration
  */
 #define V_NS16550_CLK  4800/* 48MHz (APLL96/2) */
-- 
1.7.7

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


Re: [U-Boot] [PATCH v5] arm: omap3: Add SPL support to cm_t35

2013-12-11 Thread Stefan Roese
Hi Igor!

On 11.12.2013 15:35, Igor Grinberg wrote:
 Finally, I've found some time to look at the patch...
 Generally, it is fine...
 I say generally, because we have found several bugs, but they
 are not related to your patch... but to Pekon's work on the
 omap nand driver. Nikita is on them ;-)

Good. :)

 One minor comment below...

snip

 +/* Defines for SPL */
 +#define CONFIG_SPL
 +#define CONFIG_SPL_FRAMEWORK
 +#define CONFIG_SPL_NAND_SIMPLE
 +
 +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 
 0x6 */
 +#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS  0x200 /* 256 KB */
 
 Our U-Boot binary sizes are beyond 300KiB...
 This config is not used anywhere besides config files and README...
 That's why it probably works for you...
 I think we should either remove it from the README and configs, or
 set it to 0x300 or even 0x400 instead (in case we still want to use it,
 although I don't know why, as we have the size from the image header).

Good catch. If it is not used/referenced at all, then let's remove it
completely. It makes no sense to drag such an unused define along. Could
lead only to confusion.

But we can and should remove this in a separate patch.

Thanks,
Stefan

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


[U-Boot] [PATCH] arm: omap: cm_t35: update config file

2013-12-11 Thread Nikita Kiryanov
This patch makes the following updates to the cm_t35 config file:
- Replace ttyS in default environment kernel bootargs with the new ttyO
  notation.
- Remove omapfb.debug=y from default environment kernel bootargs.
- Define a minimal power-on delay for USB hub ports so that slow-to-power-on USB
  sticks will have enough time to become responsive.
- Add support for bootz command
- ulpi_reset is not necessary and always fails with the following error message:
  ULPI: ulpi_reset: failed writing reset bit
  So, remove it.

Cc: Tom Rini tr...@ti.com
Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Acked-by: Igor Grinberg grinb...@compulab.co.il
---
 include/configs/cm_t35.h | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
index f4ecd0d..f38cac1 100644
--- a/include/configs/cm_t35.h
+++ b/include/configs/cm_t35.h
@@ -104,8 +104,6 @@
 #define CONFIG_USB_OMAP3
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_OMAP
-#define CONFIG_USB_ULPI
-#define CONFIG_USB_ULPI_VIEWPORT_OMAP
 #define CONFIG_USB_STORAGE
 #define CONFIG_MUSB_UDC
 #define CONFIG_TWL4030_USB
@@ -115,6 +113,8 @@
 #define CONFIG_USB_DEVICE
 #define CONFIG_USB_TTY
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+/* This delay is really for slow-to-power-on USB sticks, not the hub */
+#define CONFIG_USB_HUB_MIN_POWER_ON_DELAY 500
 
 /* commands to include */
 #include config_cmd_default.h
@@ -176,7 +176,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
loadaddr=0x8200\0 \
usbtty=cdc_acm\0 \
-   console=ttyS2,115200n8\0 \
+   console=ttyO2,115200n8\0 \
mpurate=500\0 \
vram=12M\0 \
dvimode=1024x768MR-16@60\0 \
@@ -190,7 +190,6 @@
mpurate=${mpurate}  \
vram=${vram}  \
omapfb.mode=dvi:${dvimode}  \
-   omapfb.debug=y  \
omapdss.def_disp=${defaultdisplay}  \
root=${mmcroot}  \
rootfstype=${mmcrootfstype}\0 \
@@ -198,7 +197,6 @@
mpurate=${mpurate}  \
vram=${vram}  \
omapfb.mode=dvi:${dvimode}  \
-   omapfb.debug=y  \
omapdss.def_disp=${defaultdisplay}  \
root=${nandroot}  \
rootfstype=${nandrootfstype}\0 \
@@ -214,6 +212,7 @@
nand read ${loadaddr} 2a 40;  \
bootm ${loadaddr}\0 \
 
+#define CONFIG_CMD_BOOTZ
 #define CONFIG_BOOTCOMMAND \
mmc dev ${mmcdev}; if mmc rescan; then  \
if run loadbootscript; then  \
-- 
1.8.1.2

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


Re: [U-Boot] [PATCH] arm: omap: cm_t35: update config file

2013-12-11 Thread Stefan Roese
On 11.12.2013 17:04, Nikita Kiryanov wrote:
 This patch makes the following updates to the cm_t35 config file:
 - Replace ttyS in default environment kernel bootargs with the new ttyO
   notation.
 - Remove omapfb.debug=y from default environment kernel bootargs.
 - Define a minimal power-on delay for USB hub ports so that slow-to-power-on 
 USB
   sticks will have enough time to become responsive.
 - Add support for bootz command
 - ulpi_reset is not necessary and always fails with the following error 
 message:
   ULPI: ulpi_reset: failed writing reset bit
   So, remove it.

Yes, I had this on my list as well. :)

 Cc: Tom Rini tr...@ti.com
 Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
 Acked-by: Igor Grinberg grinb...@compulab.co.il

Acked-by: Stefan Roese s...@denx.de

Thanks,
Stefan

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


Re: [U-Boot] [PATCH v2 2/2] powerpc/c29xpcie: 8k page size NAND boot support base on TPL/SPL

2013-12-11 Thread Scott Wood
On Wed, 2013-12-11 at 12:10 +0530, Prabhakar Kushwaha wrote:
 On 12/10/2013 11:50 PM, Scott Wood wrote:
  On Tue, 2013-12-10 at 11:37 +0530, Prabhakar Kushwaha wrote:
  On 12/9/2013 11:21 PM, Scott Wood wrote:
  On Mon, 2013-12-09 at 11:10 +0530, Prabhakar Kushwaha wrote:
  On 12/7/2013 6:51 AM, Scott Wood wrote:
  Prabhakar, why did you extend that to other uses?  Why are both entries
  ifdeffed here, but only the 0xe000 entry on existing boards?
  both entry should not be in ifdef. p1010rdb/bsc9131rdb/bsc9132qds does
  not have this.
  i dont think NOR boot tested after this patch. NOR boot will not work
  after applying this patch.
  So what happens if there's a speculative access to the non-ifdeffed
  0xf000 when we're not booting from that (e.g. ramboot, SPL payload,
  SD/SPI...)?
 
 
  If I understand the question correctly,
   Ideally ramboot, SPL payload, SD/SPI should not make access to this
  address.  They assumed to be running from DDR whose TLB has already been
  created by IBR, or First stage boot loader.
  Speculative accesses don't come (directly) from software.  They are
  initiated by the hardware and are not predictable.
 
 
 
 Please help me in understanding this.
What are the scenario where it is possible? means how hardware can 
 initiate any access?
do hardware initiated transaction require TLB?

Any mapping that is in the TLB can be used for speculative reads (except
that the guarded bit or lack of read permission inhibits speculative
data reads, and the lack of execute permission inhibits speculative
instruction fetches).  Any TLB where speculative reads aren't inhibited
as described must be backed by something memory-like.

The CPU will do this when it predicts that it will need data from that
address, though sometimes the predictions are wrong.

-Scott



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


Re: [U-Boot] Please pull u-boot-x86.git

2013-12-11 Thread Tom Rini
On Mon, Dec 09, 2013 at 01:27:38PM -0700, Simon Glass wrote:

 Hi Tom,
 
 Here is the sandbox SPI interface code. Buildman is clean:
 
 $ ./tools/buildman/buildman -b x86-push -s
 Summary of 7 commits for 1187 boards (32 threads, 1 job per thread)
 01: Merge branch 'serial' of git://git.denx.de/u-boot-microblaze
   blackfin: +   bf561-acvilon cm-bf561 blackstamp br4 bct-brettl2
 cm-bf527 dnp5370 bf506f-ezkit ip04 bf527-sdp bf609-ezkit bf537-stamp
 bf527-ezkit-v2 cm-bf537e tcm-bf518 cm-bf537u bf537-pnav cm-bf533 pr1
 bf533-ezkit ibf-dsp561 bf537-srv1 cm-bf548 bf537-minotaur bf538f-ezkit
 bf548-ezkit bf525-ucr2 blackvme bf527-ezkit tcm-bf537 bf533-stamp
 bf518f-ezbrd bf527-ad7160-eval bf526-ezbrd bf561-ezkit
   m68k: +   M54455EVB_a66 M5329AFEE M5249EVB idmr M5208EVBE
 eb_cpu5282 M5475FFE M54451EVB astro_mcf5373l M54418TWR_serial_rmii
 M54455EVB_intel M5282EVB M54455EVB_i66 M5475GFE M5253DEMO
 M54455EVB_stm33 M5485BFE M5485DFE TASREG M5329BFEE M52277EVB M5475EFE
 M5475CFE cobra5272 M5485AFE M53017EVB M5485HFE M5235EVB M5253EVBE
 M54418TWR_nand_mii M54418TWR_nand_rmii_lowfreq M5475BFE M5475DFE
 M5275EVB M52277EVB_stmicro eb_cpu5282_internal M54451EVB_stmicro
 M5271EVB M5485GFE M5485EFE M5485FFE M54418TWR M5235EVB_Flash32
 M5373EVB M54418TWR_nand_rmii M54418TWR_serial_mii M5485CFE M54455EVB
 M5475AFE M5272C3
powerpc: +   T2080QDS_SPIFLASH T2080QDS MVBLM7 T2080QDS_SDCARD
 linkstation_HGLAN T2080QDS_NAND MVSMR lcd4_lwmon5
  sparc: +   grsim grsim_leon2 gr_cpci_ax2000 gr_xc3s_1500 gr_ep2s60
 sh: +   rsk7269 rsk7264 rsk7203
 microblaze: +   microblaze-generic
   openrisc: +   openrisc-generic
arm: +   pm9g45 qong nitrogen6dl2g palmtc zipitz2 omap3_zoom2
 omap3_zoom1 omap3_overo goflexhome mx6slevk nitrogen6s nitrogen6q
 wandboard_solo davinci_sonata VCMA9 mini2440 omap730p2_cs3boot
 iconnect km_kirkwood_pci titanium ib62x0 lubbock ethernut5 zynq_dcc
 vpac270_nor_128 nitrogen6q2g colibri_pxa270 sheevaplug kzm9g
 wandboard_dl wandboard_quad am3517_crane mx6dlsabresd zynq
 tnetv107x_evm xaeniax devkit8000 nitrogen6dl mx6qarm2 magnesium
 mx6qsabrelite mx6qsabresd palmtreo680 kmsuv31 polaris omap3_sdp3430
 imx27lite mgcoge3un mx6qsabreauto vpac270_nor_256 pxa255_idp udoo_quad
 kmnusa omap730p2_cs0boot kmcoge5un am3517_evm nhk8815_onenand
 openrd_client omap730p2 openrd_base nhk8815 km_kirkwood dns325 mcx
 lp8x4x vpac270_ond_256 smdk2410 cam_enc_4xx h2200 nitrogen6s1g scb9328
 jornada cgtqmx6qeval balloon3 omap3_evm omap3_logic dockstar portl2
 palmld openrd_ultimate trizepsiv pogo_e02 pm9263 mx1ads
 02: sandbox: Rename sb_cmdline_option to sandbox_cmdline_option
 03: spi_flash: Add spi_flash_probe_fdt() to locate SPI by FDT node
 04: spi: Add device tree binding for SPI bus
 05: sandbox: spi: Add SPI emulation bus
 06: sandbox: spi: Add new SPI flash driver
 07: sandbox: spi: Enable new spi/sf layers
 
 
 The following changes since commit f44483b57c49282299da0e5c10073b909cdad979:
 
   Merge branch 'serial' of git://git.denx.de/u-boot-microblaze
 (2013-12-02 08:48:02 -0500)
 
 are available in the git repository at:
 
 
   ssh://gu-...@git.denx.de/u-boot-x86.git spi
 
 for you to fetch changes up to ca9a501953ce945da8e76d86a0ddf070a7f729b8:
 
   sandbox: spi: Enable new spi/sf layers (2013-12-09 12:22:42 -0700)
 
 
 Mike Frysinger (3):
   sandbox: spi: Add SPI emulation bus
   sandbox: spi: Add new SPI flash driver
   sandbox: spi: Enable new spi/sf layers
 
 Simon Glass (3):
   sandbox: Rename sb_cmdline_option to sandbox_cmdline_option
   spi_flash: Add spi_flash_probe_fdt() to locate SPI by FDT node
   spi: Add device tree binding for SPI bus
 
  arch/sandbox/cpu/os.c|   2 +-
  arch/sandbox/cpu/start.c |  17 +-
  arch/sandbox/include/asm/config.h|   8 +
  arch/sandbox/include/asm/getopt.h|  23 +-
  arch/sandbox/include/asm/sections.h  |   4 +-
  arch/sandbox/include/asm/spi.h   |  58 
  arch/sandbox/include/asm/state.h |   9 +
  board/sandbox/sandbox/README.sandbox |  54 
  doc/SPI/README.sandbox-spi   |  64 
  doc/device-tree-bindings/spi/spi-bus.txt |  92 ++
  drivers/misc/cros_ec_spi.c   |   3 +-
  drivers/mtd/spi/Makefile |   1 +
  drivers/mtd/spi/sandbox.c| 483 
 +++
  drivers/mtd/spi/sf_internal.h|   1 +
  drivers/mtd/spi/sf_probe.c   |  28 +-
  drivers/spi/Makefile |   1 +
  drivers/spi/exynos_spi.c |  10 +-
  drivers/spi/sandbox_spi.c| 204 +
  drivers/spi/spi.c|  19 ++
  include/configs/exynos5250-dt.h  |   1 +
  include/configs/sandbox.h|  10 +
  include/spi.h|  23 +-
  include/spi_flash.h  |  13 +
  23 files changed, 1088 insertions(+), 

Re: [U-Boot] Pull request mmc tree

2013-12-11 Thread Tom Rini
On Mon, Dec 09, 2013 at 11:09:46AM +0200, Pantelis Antoniou wrote:

 Hi Tom,
 
 The following changes since commit f44483b57c49282299da0e5c10073b909cdad979:
 
   Merge branch 'serial' of git://git.denx.de/u-boot-microblaze (2013-12-02 
 08:48:02 -0500)
 
 are available in the git repository at:
 
 
   git://git.denx.de/u-boot-mmc.git master
 
 for you to fetch changes up to adebb98ba12008021e75a2881deb424db0184770:
 
   mmc: add Faraday FTSDC021 SDHCI controller support (2013-12-08 14:23:05 
 +0200)
 
 
 Alexey Brodkin (1):
   mmc/dwmmc: modify FIFO threshold only if value explicitly set
 
 Jaehoon Chung (1):
   mmc: dw_mmc: remove the exynos specific code in dw-mmc.c
 
 Kuo-Jung Su (1):
   mmc: add Faraday FTSDC021 SDHCI controller support
 
 Priyanka Jain (1):
   powerpc: mmc: Add corenet devices support in esdhc spl
 
  drivers/mmc/Makefile |  1 +
  drivers/mmc/dw_mmc.c | 23 +--
  drivers/mmc/exynos_dw_mmc.c  | 14 ++
  drivers/mmc/fsl_esdhc_spl.c  |  5 +
  drivers/mmc/ftsdc021_sdhci.c | 33 +
  include/dwmmc.h  |  1 +
  include/faraday/ftsdc021.h   | 13 +
  7 files changed, 72 insertions(+), 18 deletions(-)
  create mode 100644 drivers/mmc/ftsdc021_sdhci.c
  create mode 100644 include/faraday/ftsdc021.h

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [i2c] Pull request

2013-12-11 Thread Tom Rini
On Mon, Dec 09, 2013 at 08:00:15AM +0100, Heiko Schocher wrote:

 Hello Tom,
 
 please pull from u-boot-i2c.git.
 
 The following changes since commit f44483b57c49282299da0e5c10073b909cdad979:
 
   Merge branch 'serial' of git://git.denx.de/u-boot-microblaze (2013-12-02 
 08:48:02 -0500)
 
 are available in the git repository at:
 
 
   git://git.denx.de/u-boot-i2c.git master
 
 for you to fetch changes up to e717fc6d1a2b459ae8352f7af5945cc0c216ab1e:
 
   i2c: samsung: register i2c busses for Exynso5420 and Exynos5250 (2013-12-06 
 07:46:23 +0100)
 
 
 Kuo-Jung Su (4):
   i2c: fti2c010: cosmetic: coding style cleanup
   i2c: fti2c010: migrate to new i2c model
   i2c: fti2c010: serial out r/w address in MSB order
   cmd_eeprom: bug fix for i2c read/write
 
 Naveen Krishna Ch (1):
   i2c: samsung: register i2c busses for Exynso5420 and Exynos5250
 
 Nikita Kiryanov (1):
   arm: omap: i2c: don't zero cnt in i2c_write
 
 Piotr Wilczek (2):
   driver:i2c:s3c24x0: adapt driver to new i2c
   driver:i2c:s3c24x0: fix clock init for hsi2c
 
  README  |   6 +++
  board/samsung/smdk5250/exynos5-dt.c |   2 -
  board/samsung/trats/trats.c |  21 ++
  board/samsung/trats2/trats2.c   |  35 +---
  common/cmd_eeprom.c |   4 +-
  drivers/i2c/Makefile|   2 +-
  drivers/i2c/fti2c010.c  | 352 
 +---
  drivers/i2c/omap24xx_i2c.c  |   6 ---
  drivers/i2c/s3c24x0_i2c.c   | 284 
 --
  include/configs/VCMA9.h |   8 ++--
  include/configs/arndale.h   |   9 ++--
  include/configs/exynos5250-dt.h |   8 ++--
  include/configs/trats.h |  25 
  include/configs/trats2.h|  29 ++---
  14 files changed, 474 insertions(+), 317 deletions(-)

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Pull request: u-boot-arm/master

2013-12-11 Thread Tom Rini
On Tue, Dec 10, 2013 at 11:05:27PM +0100, Albert ARIBAUD wrote:

 Hi Tom,
 
 The following changes since commit
 f44483b57c49282299da0e5c10073b909cdad979:
 
   Merge branch 'serial' of git://git.denx.de/u-boot-microblaze
   (2013-12-02 08:48:02 -0500)
 
 are available in the git repository at:
 
 
   git://git.denx.de/u-boot-arm master
 
 for you to fetch changes up to f15ea6e1d67782a1626d4a4922b6c20e380085e5:
 
   Merge branch 'u-boot/master' into 'u-boot-arm/master' (2013-12-10
   22:23:59 +0100)
 
 Note: two in-merge fixes were necessary. They are listed in
 f15ea6e1.
 
 
 
 Albert ARIBAUD (7):
   Merge branch 'u-boot-microblaze/zynq' into 'u-boot-arm/master'
   Merge branch 'u-boot-atmel/master' into 'u-boot-arm/master'
   Merge branch 'u-boot-sh/rmobile' into 'u-boot-arm/master'
   Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
   Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
   arm: keep all sections in ELF file
   Merge branch 'u-boot/master' into 'u-boot-arm/master'
 
 Andreas Bie??mann (10):
   video: remove AT91 legacy API from bus_vcxk
   i2c: switch from AT91 legacy to ATMEL legacy
   at91sam9m10g45ek: remove unused CONFIG_AT91_LEGACY
   snapper9260: remove unused AT91_LEGACY
   net: remove unused CONFIG_AT91_LEGACY
   at91: remove all occourances of CONFIG_AT91_LEGACY
   at91: add new gpio pin definitions
   at91: redefine legacy GPIO PIN_BASE
   at91: nand: switch atmel_nand to generic GPIO API
   at91: switch coloured LED to gpio API
 
 Andrew Bradford (1):
   am335x_evm: Fix CONS_INDEX numbering
 
 Bo Shen (8):
   arm: atmel: sama5d3: correct the ID for DBGU and PIT
   arm: at91: pm9261: remove undefined bit in mckr
   arm: atmel: sama5d3: correct the error define of DIV
   arm: atmel: sama5d3: the offset of MULA is 18
   arm: atmel: sama5d3: early enable PIO peripherals
   arm: atmel: add ddr2 initialization function
   arm: atmel: sama5d3: spl boot from fat fs SD card
   arm: atmel: sam9m10g45ek: let CONFIG_SYS_NO_FLASH at proper
 position
 
 Chin Liang See (1):
   socfpga: Adding Freeze Controller driver
 
 Hardik Patel (1):
   pandaboard: 1/1] ARM:OMAP4+: panda-es: Support Rev B3 Elpida DDR2
 RAM
 
 Heiko Schocher (6):
   bootcount: store bootcount var in environment
   arm, am33x: make RTC32K OSC enable configurable
   usb, g_dnl: make bcdDevice value configurable
   arm926ejs, at91: add common phy_reset function
   arm, at91: add Siemens board taurus and axm
   arm, at91: add siemens corvus board
 
 Ian Campbell (1):
   vexpress: use correct timer address on extended memory map systems
 
 Igor Grinberg (1):
   cm-t35: use gpio_led driver for status led
 
 Ilya Ledvich (3):
   cm_t335: add cm_t335 board support
   cm_t335: add support for status LED
   cm_t335: add support for pca9555 i2c gpio extender
 
 Jaehoon Chung (3):
   arm: exynos: fix set_mmc_clk for exynos4x12
   arm: exynos/goni: fix the return type for s5p_mmc_init
   arm: exynos: remove the unused define.
 
 Jens Scharsig (BuS Elektronik) (1):
   arm: atmel: eb_cpux9k2: config clean up
 
 Lars Poeschel (1):
   pcm051: Support for revision 3
 
 Lokesh Vutla (1):
   ARM: OMAP5+: Remove unnecessary EFUSE settings
 
 Lubomir Popov (1):
   ARM: OMAP4: Fix bug in omap4470_volts struct
 
 Luka Perkov (1):
   config: arm: exynos5250: remove duplicate defines
 
 Masahiro Yamada (1):
   ARM: align MVBAR on 32 byte boundary
 
 Mateusz Kulikowski (1):
   arm: at91: support for the Calao USB-A9263 board (based on
 AT91SAM9263)
 
 Matt Porter (1):
   boards.cfg: update email address for ti814x_evm maintainer
 
 Michael Trimarchi (2):
   arm: omap3: Add uart4 omap3 adddress
   arm: omap3: Enable clocks for peripherals only if they are used
 
 Michal Simek (1):
   arm: zynq: Do not remap OCM to high address
 
 Minkyu Kang (3):
   arm: exynos: fix the align for exynos4_power structure
   arm: exynos: adds ifdef for spi boot
   arm: arndale: disable spi boot
 
 Nobuhiro Iwamatsu (7):
   arm: rmobile: Move lowlevel_init.o to taget of each CPU
   arm: rmobile: Add support R8A7790
   arm: rmobile: Add support lager board
   arm: rmobile: Add support R8A7791
   arm: rmobile: Add support koelsch board
   arm: kzm9g: Fix undefined reference to `__aeabi_uldivmod' error
   arm: rmobile: Remove config.mk
 
 Oleg Kosheliev (2):
   ARMV7: OMAP4: Add struct for twl603x data
   ARMV7: OMAP4: Add twl6032 support
 
 Piotr Wilczek (7):
   driver:usb:s3c_udc: add support for Exynos4x12
   trats2: enable ums support on Trats2
   trats2: enable dfu and thor protocol for Tizen download
   board: trats2: remove unused defines from config file
   board: trats2: fix environmental variables
   

[U-Boot] [PATCH 1/2] arm: omap: nand: introduce CONFIG_NAND_OMAP_SW_ECC_LEGACY

2013-12-11 Thread Nikita Kiryanov
Commit mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform
(d016dc42cedbf6102e100fa9ecb58462edfb14f8) changed the way software ECC is
configured, both during boot, and during ecc switch, in a way that is not
backwards compatible with older systems (for example, X-Loader on CM-T35 relies
on the old behavior).

The culprit is the line which assigns ecc.size for software ECC.
Older version of omap_gpmc.c always assigned ecc.size = 0 when configuring for
software ecc, relying on nand_scan_tail() to select a default for ecc.size
(256), while the new version of omap_gpmc.c assigns ecc.size = pagesize, which
is likely to not be 256.

With this change, nandecc sw no longer sets up software ECC the old way,
which makes it unusable to those who rely on the old behavior, and if the user
wants to default to hardware ECC, the old software ECC configuration becomes
completely unattainable.

To provide backwards compatibility, introduce CONFIG_NAND_OMAP_SW_ECC_LEGACY.
If this CONFIG option is set, omap_select_ecc_scheme() will assign the old
default to ecc.size, instead of the value of pagesize.

Cc: Igor Grinberg grinb...@compulab.co.il
Cc: Tom Rini tr...@ti.com
Cc: Scott Wood scottw...@freescale.com
Cc: Pekon Gupta pe...@ti.com
Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
---
 doc/README.nand  | 7 +++
 drivers/mtd/nand/omap_gpmc.c | 4 
 2 files changed, 11 insertions(+)

diff --git a/doc/README.nand b/doc/README.nand
index b91f198..a115260 100644
--- a/doc/README.nand
+++ b/doc/README.nand
@@ -232,6 +232,13 @@ Platform specific options
- ecc calculation using GPMC hardware engine,
- error detection using ELM hardware engine.
 
+   CONFIG_NAND_OMAP_SW_ECC_LEGACY
+   On OMAP platforms, this CONFIG is used to force pre v2014.01
+   configuration of software ECC. This is necessary for old systems which
+   rely on the old behavior (such as systems that boot with X-Loader).
+   Use this CONFIG if you have an old software stack and are having
+   problems reading U-Boot data that was written using software ECC.
+
 NOTE:
 =
 
diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index 23a961c..0eb65d5 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -774,7 +774,11 @@ static int omap_select_ecc_scheme(struct nand_chip *nand,
bch_priv.type   = 0;
nand-ecc.mode  = NAND_ECC_SOFT;
nand-ecc.layout= NULL;
+#ifdef CONFIG_NAND_OMAP_SW_ECC_LEGACY
+   nand-ecc.size  = 256;
+#else
nand-ecc.size  = pagesize;
+#endif
bch-ecc_scheme = OMAP_ECC_HAM1_CODE_SW;
break;
 
-- 
1.8.1.2

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


[U-Boot] [PATCH 2/2] arm: omap: cm_t35: fix nand sw ecc incompatibility with X-Loader

2013-12-11 Thread Nikita Kiryanov
cm_t35 boards use X-Loader to boot U-Boot. X-Loader expects U-Boot to be written
to NAND with software ECC.
Use CONFIG_NAND_OMAP_SW_ECC_LEGACY to make U-Boot configure software ECC in
X-Loader compatible way.

Cc: Igor Grinberg grinb...@compulab.co.il
Cc: Tom Rini tr...@ti.com
Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
---
 include/configs/cm_t35.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
index 2e865c0..9bcaa75 100644
--- a/include/configs/cm_t35.h
+++ b/include/configs/cm_t35.h
@@ -158,6 +158,7 @@
  */
 #define CONFIG_SYS_NAND_QUIET_TEST
 #define CONFIG_NAND_OMAP_GPMC
+#define CONFIG_NAND_OMAP_SW_ECC_LEGACY
 #define CONFIG_SYS_NAND_ADDR   NAND_BASE   /* physical address */
/* to access nand */
 #define CONFIG_SYS_NAND_BASE   NAND_BASE   /* physical address */
-- 
1.8.1.2

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


[U-Boot] [PATCH 0/2] Introduce CONFIG_NAND_OMAP_SW_ECC_LEGACY, and use it on cm_t35

2013-12-11 Thread Nikita Kiryanov
Commit mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform
(d016dc42cedbf6102e100fa9ecb58462edfb14f8) changed the way software ECC is
configured. The change is not incorrect, but it does cause compatibility issues
for boards that depended on the old behavior. Therefore, instead of reverting
the change, a quirks option is introduced to allow boards to get the old
behavior back. This config option is then used in cm_t35.

Cc: Igor Grinberg grinb...@compulab.co.il
Cc: Tom Rini tr...@ti.com
Cc: Scott Wood scottw...@freescale.com
Cc: Pekon Gupta pe...@ti.com
Nikita Kiryanov (2):
  arm: omap: nand: introduce CONFIG_NAND_OMAP_SW_ECC_LEGACY
  arm: omap: cm_t35: fix nand sw ecc incompatibility with X-Loader

 doc/README.nand  | 7 +++
 drivers/mtd/nand/omap_gpmc.c | 4 
 include/configs/cm_t35.h | 1 +
 3 files changed, 12 insertions(+)

-- 
1.8.1.2

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


Re: [U-Boot] [RFC PATCH] Add support for Micron MT29F8G08 8Gb NAND flash MID: 0x2c, DID: 0x38

2013-12-11 Thread Scott Wood
On Wed, 2013-12-11 at 12:02 +0100, micro1183 wrote:
 Microns MT29F8G08 8GBit flash is not identified correctly.
 Manufacturer ID is 0x2c, device ID is 0x38
 
 Signed-off-by: Lothar Felten lothar.fel...@gmail.com
 CC:  scottw...@freescale.com
 
 ---
  drivers/mtd/nand/nand_ids.c |1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
 index f3f0cb6..a43d0e8 100644
 --- a/drivers/mtd/nand/nand_ids.c
 +++ b/drivers/mtd/nand/nand_ids.c
 @@ -108,6 +108,7 @@ const struct nand_flash_dev nand_flash_ids[] = {
 /* 8 Gigabit */
 {NAND 1GiB 1,8V 8-bit,0xA3, 0, 1024, 0, LP_OPTIONS},
 {NAND 1GiB 3,3V 8-bit,0xD3, 0, 1024, 0, LP_OPTIONS},
 +   {NAND 1GiB 3,3V 8-bit,0x38, 0, 1024, 0, LP_OPTIONS},
 {NAND 1GiB 1,8V 16-bit,   0xB3, 0, 1024, 0, LP_OPTIONS16},
 {NAND 1GiB 3,3V 16-bit,   0xC3, 0, 1024, 0, LP_OPTIONS16},
 

Is this an ONFI flash?  If so, use that instead of the ID table.

-Scott



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


Re: [U-Boot] [PATCH][v2] powerpc/mpc85xx: Add support for single source clocking

2013-12-11 Thread York Sun
On 12/10/2013 09:13 PM, Priyanka Jain wrote:
 Single-source clocking is new feature introduced in T1040.
 In this mode, a differential clock is supplied to the
 DIFF_SYSCLK_P/N inputs to the processor, which in turn is
 used to supply clocks to the sysclock, ddrclock and usbclock.
 
 So, both ddrclock and syclock are driven by same differential
 sysclock in single-sourec clocking whereas in normal clocking
 mode, generally separate DDRCLK and SYSCLK pins provides
 reference clock for sysclock and ddrclock
 
 DDR_REFCLK_SEL rcw bit is used to determine DDR clock source
 -If DDR_REFCLK_SEL rcw bit is 0, then DDR PLLs are driven in
  normal clocking mode by DDR_Reference clock
 
 -If DDR_REFCLK_SEL rcw bit is 1, then DDR PLLs are driven in
  single source clocking mode by DIFF_SYSCLK
 
 Add code to determine ddrclock based on DDR_REFCLK_SEL rcw bit.
 
 Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
 Signed-off-by: Priyanka Jain priyanka.j...@freescale.com
 ---
 Changes for v2:
   Incorporated York's comment to separate out
   DDR_CLK_FREQ and SINGLE_SOURCE_CLK code
 
  arch/powerpc/cpu/mpc85xx/speed.c  |   22 --
  arch/powerpc/include/asm/config_mpc85xx.h |1 +
  arch/powerpc/include/asm/immap_85xx.h |3 +++
  3 files changed, 24 insertions(+), 2 deletions(-)
 
 diff --git a/arch/powerpc/cpu/mpc85xx/speed.c 
 b/arch/powerpc/cpu/mpc85xx/speed.c
 index 46ae80c..ef52669 100644
 --- a/arch/powerpc/cpu/mpc85xx/speed.c
 +++ b/arch/powerpc/cpu/mpc85xx/speed.c
 @@ -76,10 +76,28 @@ void get_sys_info(sys_info_t *sys_info)
   uint mem_pll_rat;
  
   sys_info-freq_systembus = sysclk;
 +#ifdef CONFIG_SINGLE_SOURCE_CLK
 + /*
 +  * DDR_REFCLK_SEL rcw bit is used to determine if DDR PLLS
 +  * are driven by separate DDR Refclock or single source
 +  * differential clock.
 +  */
 + uint single_src;

Sorry I missed this earlier. Please don't declare variables in the
middle of a function.

York

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


Re: [U-Boot] [PATCH] powerpc/t4240: Add a frequency setting case for fman1

2013-12-11 Thread York Sun
On 11/27/2013 09:52 PM, shh@gmail.com wrote:
 From: Shaohui Xie shaohui@freescale.com
 
 A new valid setting case added for fman1, it uses platform frequency.
 
 Signed-off-by: Shaohui Xie shaohui@freescale.com
 ---
 based on patch: http://patchwork.ozlabs.org/patch/294663/
 

Applied to u-boot-mpc85xx/master. Thanks.

York


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


Re: [U-Boot] [PATCH] net/fman: add ft_fixup_xgec to support 3rd and 4th 10GEC

2013-12-11 Thread York Sun
On 12/01/2013 06:23 PM, Shengzhou Liu wrote:
 As mEMAC1 and mEMAC2 are dual-role MACs, which are used as 1G or 10G MAC.
 So we update dynamically 'cell-index' to '2' and '3' for 10GEC3 and 10GEC4.
 Also change 'fsl,fman-port-1g-rx' to 'fsl,fman-port-10g-rx', ditto for Tx.
 
 Signed-off-by: Shengzhou Liu shengzhou@freescale.com
 ---
 v2: rebase to master branch of latest git://git.denx.de/u-boot-mpc85xx.git
 

Applied to u-boot-mpc85xx/master. Thanks.

York


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


Re: [U-Boot] [PATCH] powerpc/p1_p2_rdb_pc: Fix warnings for __iomem pointers

2013-12-11 Thread York Sun
On 12/10/2013 01:22 AM, Claudiu Manoil wrote:
 Add the __iomem address space marker for the tsec pointers
 to struct tsec_mii_mng memory mapped register regions.
 This solves the sparse warnings for mixig normal pointers with
 __iomem pointers for tsec.
 
 p1_p2_rdb_pc.c:373:24: warning: incorrect type in assignment (different
 address spaces)
 p1_p2_rdb_pc.c:373:24:expected struct tsec_mii_mng [noderef]
 asn:2*regs
 p1_p2_rdb_pc.c:373:24:got struct tsec_mii_mng *noident
 
 Use TSEC_GET_MDIO_REGS_BASE() for the remaining mdio 'regs'
 initializations to remove the __iomem warnings and for consistency.
 
 Signed-off-by: Claudiu Manoil claudiu.man...@freescale.com
 ---

Applied to u-boot-mpc85xx/master. Thanks.

York


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


Re: [U-Boot] [PATCH] powerpc/mpc85xx: Update CONFIG_SYS_FSL_TBCLK_DIV for T1040

2013-12-11 Thread York Sun
On 12/10/2013 11:19 PM, Prabhakar Kushwaha wrote:
 The default value of CONFIG_SYS_FSL_TBCLK_DIV is 16.
 
 So, update its value as default.
 
 Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
 ---

Applied to u-boot-mpc85xx/master. Thanks.

York


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


Re: [U-Boot] [PATCH 0/34] Switch over to real Kbuild

2013-12-11 Thread Simon Glass
Hi Massihiro,

On 11 December 2013 04:01, Masahiro Yamada yamad...@jp.panasonic.com wrote:

 We switched to Kbuild style makefiles at v2014.01-rc1 release.
 With that modification, we can write makefiles simpler.
 But it is NOT real Kbuild.

 As the next step, this series imports (+ adjusts) build scripts
 from Linux Kernel under scripts/ directory.
 By applying this series, we can get more advantages:
   - short log
   - perfect dependency tracking
   - preparation to the next step: Kconfig
   - other things...

  Kbuild without Kconfig
  --

 At first, to make things clearer, let me explain
 the difference between Kbuild and Kconfig.
 They are, I think, sometimes confusing.

  Kbuild - build system used for Linux Kernel.
 Some features of Kbuild are:

(a) We can describe makefiles simple.
   Just addi objects to obj-y like this:
   obj-$(CONFIG_FOO) += foo.o

(b) We can describe directory descending nicely
   Add a directory name to obj-y like this:
   obj-$(CONFIG_BAR) += bar/

(c) Short log like follows:
   CC  common/foo.o
   CC  common/bar.o
   LD  common/built-in.o

(d) Perfect dependency tracking
   I think this is the biggest advantage.
   To be honest, the dependency tracing of U-Boot build system
   was not reliable.

  Kconfig - A tool to manage CONFIG macros.
   We can handle the dependency among CONFIG macros.
   Kconfig allows us to modify CONFIG settings easily
   by make config.
   GUI interface are also available by make menuconfig
   All defined CONFIG macros are stored into .config file

 I think most of you are already familiar with above.
 I definitely want to port both of these, but I want to do one by one: Kbuild 
 first.
 (If we do Kbuild and Kconfig at the same time, it might be messed up.)

 So, I want to do Kbuild without Kconfig in this series.
 The conventional tool (mkconfig + boards.cfg file)
 is used for board configuration.

  How to apply this series ?
  --

 Before importing new features, I wanted to clean up some parts of makefiles.
 I posted many trivial patches to refactor makefiles.

 This series uses the followings as prerequisites:

 [1] blackfin: Do not generate unused header bootrom-asm-offsets.h
 http://patchwork.ozlabs.org/patch/295141/

 [2] sandbox: Use system headers first for sandbox's os.c in a different way
 http://patchwork.ozlabs.org/patch/294233/

 [3] .gitignore: ignore spl/ and tpl/ directories except spl/Makefile
 http://patchwork.ozlabs.org/patch/294271/

 [4] Makefile: delete a make rule of $(LDSCRIPT)
 http://patchwork.ozlabs.org/patch/294717/

 [5] post: descend only when CONFIG_HAS_POST is defined
 http://patchwork.ozlabs.org/patch/294741/

 [6] Makefile: Select objects by CONFIG_ rather than $(ARCH) or $(CPU)
 http://patchwork.ozlabs.org/patch/294742/

 [7] drivers/usb/gadget: select objects by obj-$(CONFIG-...)
 http://patchwork.ozlabs.org/patch/294745/

 [8] drivers/mtd: descend into sub directories only when it is necessary
 http://patchwork.ozlabs.org/patch/294746/

 [9] Makefile: Move some scripts imported from Linux
 http://patchwork.ozlabs.org/patch/294780/

 [10] Makefile: delete unnecessary CPPFLAGS settings
 http://patchwork.ozlabs.org/patch/294829/

 [11] Makefile: delete unnecessary lines
 http://patchwork.ozlabs.org/patch/295052/

 [12] Makefile: Do not create empty autoconf.mk on error
 http://patchwork.ozlabs.org/patch/295779/

 [13] Makefile: use two double-quotations as a pair
 http://patchwork.ozlabs.org/patch/296718/

 [14] Makefile: correct dependencies of asm-offsets.[hs]
 http://patchwork.ozlabs.org/patch/296722/

 [15] examples: x86: delete 82559_eeprom
 http://patchwork.ozlabs.org/patch/297608/

 [16] Makefile, .gitignore: Cleanup non-existing binaries
 http://patchwork.ozlabs.org/patch/297609/

 [17] spl/Makefile: merge LIBS-y += arch/$(ARCH)/imx-common
 http://patchwork.ozlabs.org/patch/299660/

 You need to apply above patches beforehand to use this series.
 They are simple patches, so I hope they will be reviewed and applied first.

Can you please push a branch somewhere with all of these and kbuild?

Regards,
Simon


On 11 December 2013 04:01, Masahiro Yamada yamad...@jp.panasonic.com wrote:

 We switched to Kbuild style makefiles at v2014.01-rc1 release.
 With that modification, we can write makefiles simpler.
 But it is NOT real Kbuild.

 As the next step, this series imports (+ adjusts) build scripts
 from Linux Kernel under scripts/ directory.
 By applying this series, we can get more advantages:
   - short log
   - perfect dependency tracking
   - preparation to the next step: Kconfig
   - other things...

  Kbuild without Kconfig
  --

 At first, to make things clearer, let me explain
 the difference between Kbuild and Kconfig.
 They are, I think, sometimes confusing.

  Kbuild - 

[U-Boot] Please pull u-boot-mpc85xx/master

2013-12-11 Thread York Sun
Tom,

The following changes since commit 4b210ad34282bfd9fc982a8e3c9a9126f4094cdb:

  Merge branch 'master' of git://git.denx.de/u-boot-arm (2013-12-10
17:15:18 -0500)

are available in the git repository at:


  git://git.denx.de/u-boot-mpc85xx.git master

for you to fetch changes up to e03c76c30342797a25ef9350e51c8daa0b56f1df:

  powerpc/mpc85xx: Update CONFIG_SYS_FSL_TBCLK_DIV for T1040 (2013-12-11
11:12:54 -0800)


Claudiu Manoil (1):
  powerpc/p1_p2_rdb_pc: Fix warnings for __iomem pointers

Prabhakar Kushwaha (1):
  powerpc/mpc85xx: Update CONFIG_SYS_FSL_TBCLK_DIV for T1040

Shaohui Xie (1):
  powerpc/t4240: Add a frequency setting case for fman1

Shengzhou Liu (1):
  net/fman: add ft_fixup_xgec to support 3rd and 4th 10GEC

 arch/powerpc/cpu/mpc85xx/speed.c|3 ++
 arch/powerpc/include/asm/config_mpc85xx.h   |2 +-
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c |4 +-
 drivers/net/fm/init.c   |   53
++-
 4 files changed, 58 insertions(+), 4 deletions(-)

Thanks,

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


Re: [U-Boot] [PATCH] Revert ARM: move interrupt_init to before relocation

2013-12-11 Thread Albert ARIBAUD
On Fri,  8 Nov 2013 22:37:33 +0100, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:

 Revert commit 0f5141e9 which causes boards starting in
 FLASH to try and write to a FLASH location.
 
 Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
 ---
  arch/arm/lib/board.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
 index 34f50b0..9c72a53 100644
 --- a/arch/arm/lib/board.c
 +++ b/arch/arm/lib/board.c
 @@ -435,7 +435,6 @@ void board_init_f(ulong bootflag)
   addr_sp += 128; /* leave 32 words for abort-stack   */
   gd-irq_sp = addr_sp;
  #endif
 - interrupt_init();
  
   debug(New Stack Pointer is: %08lx\n, addr_sp);
  
 @@ -637,6 +636,8 @@ void board_init_r(gd_t *id, ulong dest_addr)
   misc_init_r();
  #endif
  
 +  /* set up exceptions */
 + interrupt_init();
   /* enable exceptions */
   enable_interrupts();
  

Applied to u-boot-arm/master.

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


Re: [U-Boot] [PATCH v15 00/10] arm64 patch

2013-12-11 Thread Albert ARIBAUD
Hi feng...@phytium.com.cn,

On Fri, 15 Nov 2013 11:45:49 +0800, feng...@phytium.com.cn wrote:

 From: David Feng feng...@phytium.com.cn
 
 Changes for v15:
   - modify boot process, u-boot will run at the highest
 exception level until it prepare jump to OS.
   - Fix a few bugs in cache.S.These bug is reported by
 York Sun york...@freescale.com and Scott Wood
 scottw...@freescale.com.
   - when booting, slaves will wait on WFI, master wakeup
 slaves by SGI interrupt.
   - add generic_timer.c to utilize the newest timer architecture.
   - add gic.S to support gic initialization and interrupt
 operations, currently only support GICv2.

Patch series applies well to current u-boot / u-boot-arm master branch
(bd851c7a) but build (with gcc 4.8 aarch64) fails with:

Configuring for vexpress_aemv8a - Board: vexpress_aemv8a, Options: ARM64
   textdata bss dec
hex filename
 1737288474  220776  402978
62622   ./u-boot
tools/relocate-rela: u-boot.bin: read rela failed at 27ff8

Can you check on your side?

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


Re: [U-Boot] [PATCH 1/2] arm: omap: nand: introduce CONFIG_NAND_OMAP_SW_ECC_LEGACY

2013-12-11 Thread Gupta, Pekon
Hi Nikita,

From: Nikita Kiryanov [mailto:nik...@compulab.co.il]
Commit mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform
(d016dc42cedbf6102e100fa9ecb58462edfb14f8) changed the way software ECC is
configured, both during boot, and during ecc switch, in a way that is not
backwards compatible with older systems (for example, X-Loader on CM-T35 relies
on the old behavior).

The culprit is the line which assigns ecc.size for software ECC.
Older version of omap_gpmc.c always assigned ecc.size = 0 when configuring for
software ecc, relying on nand_scan_tail() to select a default for ecc.size
(256), while the new version of omap_gpmc.c assigns ecc.size = pagesize, which
is likely to not be 256.

Then its just one-line change.. Remove ecc.size = pagesize.
Why do you need to add a newer config for that ?
This ecc-scheme (HAM1_SW) is anyways only kept for backward compatibility
with legacy devices. (As also mentioned in doc/README.nand)
-
  CONFIG_NAND_OMAP_ECCSCHEME
On OMAP platforms, this CONFIG specifies NAND ECC scheme.
It can take following values:
OMAP_ECC_HAM1_CODE_SW
1-bit Hamming code using software lib.
(for legacy devices only)
-

But I don't have any board to boot-test this, because all my boards
have newer ROM code, which auto-detects BCH8 or BCH16 based
on block-size of NAND device connected to it.

Also, I suggest to migrate to 'HAM1_HW' as this should be compatible to
OMAP3 ROM code (for NAND boot), at-least I could check that based
on NAND ecc-layout given in OMAP35xx TRM.
'HAM1_SW' will un-necessary burden your CPU by calculating ECC in
software, inspite the fact that GPMC controller can do that in hardware.


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


[U-Boot] [RFC PATCH] Add support for Micron MT29F8G08 8Gb NAND flash MID: 0x2c, DID: 0x38

2013-12-11 Thread micro1183
Microns MT29F8G08 8GBit flash is not identified correctly.
Manufacturer ID is 0x2c, device ID is 0x38

Signed-off-by: Lothar Felten lothar.fel...@gmail.com
CC:  scottw...@freescale.com

---
 drivers/mtd/nand/nand_ids.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
index f3f0cb6..a43d0e8 100644
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -108,6 +108,7 @@ const struct nand_flash_dev nand_flash_ids[] = {
/* 8 Gigabit */
{NAND 1GiB 1,8V 8-bit,0xA3, 0, 1024, 0, LP_OPTIONS},
{NAND 1GiB 3,3V 8-bit,0xD3, 0, 1024, 0, LP_OPTIONS},
+   {NAND 1GiB 3,3V 8-bit,0x38, 0, 1024, 0, LP_OPTIONS},
{NAND 1GiB 1,8V 16-bit,   0xB3, 0, 1024, 0, LP_OPTIONS16},
{NAND 1GiB 3,3V 16-bit,   0xC3, 0, 1024, 0, LP_OPTIONS16},

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


Re: [U-Boot] [RFC PATCH] Add support for Micron MT29F8G08 8Gb NAND flash MID: 0x2c, DID: 0x38

2013-12-11 Thread micro1183
On 12/11/2013 06:22 PM, Scott Wood wrote:
 On Wed, 2013-12-11 at 12:02 +0100, micro1183 wrote:
 Microns MT29F8G08 8GBit flash is not identified correctly.
 Manufacturer ID is 0x2c, device ID is 0x38

 Signed-off-by: Lothar Felten lothar.fel...@gmail.com
 CC:  scottw...@freescale.com

 ---
  drivers/mtd/nand/nand_ids.c |1 +
  1 file changed, 1 insertion(+)

 diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
 index f3f0cb6..a43d0e8 100644
 --- a/drivers/mtd/nand/nand_ids.c
 +++ b/drivers/mtd/nand/nand_ids.c
 @@ -108,6 +108,7 @@ const struct nand_flash_dev nand_flash_ids[] = {
 /* 8 Gigabit */
 {NAND 1GiB 1,8V 8-bit,0xA3, 0, 1024, 0, LP_OPTIONS},
 {NAND 1GiB 3,3V 8-bit,0xD3, 0, 1024, 0, LP_OPTIONS},
 +   {NAND 1GiB 3,3V 8-bit,0x38, 0, 1024, 0, LP_OPTIONS},
 {NAND 1GiB 1,8V 16-bit,   0xB3, 0, 1024, 0, LP_OPTIONS16},
 {NAND 1GiB 3,3V 16-bit,   0xC3, 0, 1024, 0, LP_OPTIONS16},

 
 Is this an ONFI flash?  If so, use that instead of the ID table.
 
 -Scott
 

Hi Scott,

yes it's an ONFI flash, but the OOB size is 224 bytes, which results in
a data abort (see below).
Apparently the supported ONFI detected OOB sizes are 8,16,64 and 128 bytes.
I lack a nand_oob_224 struct but I don't know what the default positions
would be.

Would the following layout be ok?
.eccbytes = 208,
.eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
112, 113,
114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
128, 129,
130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
144, 145,
146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
160, 161,
162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
176, 177,
178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
192, 193,
194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
208, 209},
.oobfree = {
{.offset = 210,
 .length = 14 } }

(basically skip first two bytes, 208 bytes data, 14 bytes free)

The cause for the data abort is the following access in
nand_scan_tail(struct mtd_info *mtd) as chip-layout has not been set:

/*
 * The number of bytes available for a client to place data into
 * the out of band area.
 */
chip-ecc.layout-oobavail = 0;

If the proposed layout is ok, I'll make a patch.

the data abort:

U-Boot 2014.01-rc1-00027-g78a75bc-dirty (Dec 11 2013 - 21:03:57)

I2C:   ready
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  data abort

MAYBE you should read doc/README.arm-unaligned-accesses

pc : [8f7720f8]  lr : [8f75f654]
sp : 8f630ef0  ip : 0820 fp : 80849989
r10: 0002  r9 : 8f630f28 r8 : 4030cdcc
r7 : 4030cb7c  r6 : 0002 r5 : 8ffbb000  r4 : 8ffbb0b0
r3 :   r2 :  r1 : 8f79f57c  r0 : 8f631040
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32
Resetting CPU ...

-- Lo

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


Re: [U-Boot] [RFC PATCH] Add support for Micron MT29F8G08 8Gb NAND flash MID: 0x2c, DID: 0x38

2013-12-11 Thread Scott Wood
On Wed, 2013-12-11 at 22:16 +0100, micro1183 wrote:
 On 12/11/2013 06:22 PM, Scott Wood wrote:
  On Wed, 2013-12-11 at 12:02 +0100, micro1183 wrote:
  Microns MT29F8G08 8GBit flash is not identified correctly.
  Manufacturer ID is 0x2c, device ID is 0x38
 
  Signed-off-by: Lothar Felten lothar.fel...@gmail.com
  CC:  scottw...@freescale.com
 
  ---
   drivers/mtd/nand/nand_ids.c |1 +
   1 file changed, 1 insertion(+)
 
  diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
  index f3f0cb6..a43d0e8 100644
  --- a/drivers/mtd/nand/nand_ids.c
  +++ b/drivers/mtd/nand/nand_ids.c
  @@ -108,6 +108,7 @@ const struct nand_flash_dev nand_flash_ids[] = {
  /* 8 Gigabit */
  {NAND 1GiB 1,8V 8-bit,0xA3, 0, 1024, 0, LP_OPTIONS},
  {NAND 1GiB 3,3V 8-bit,0xD3, 0, 1024, 0, LP_OPTIONS},
  +   {NAND 1GiB 3,3V 8-bit,0x38, 0, 1024, 0, LP_OPTIONS},
  {NAND 1GiB 1,8V 16-bit,   0xB3, 0, 1024, 0, LP_OPTIONS16},
  {NAND 1GiB 3,3V 16-bit,   0xC3, 0, 1024, 0, LP_OPTIONS16},
 
  
  Is this an ONFI flash?  If so, use that instead of the ID table.
  
  -Scott
  
 
 Hi Scott,
 
 yes it's an ONFI flash, but the OOB size is 224 bytes, which results in
 a data abort (see below).

 Apparently the supported ONFI detected OOB sizes are 8,16,64 and 128 bytes.
 I lack a nand_oob_224 struct but I don't know what the default positions
 would be.

What NAND driver are you using?  Are you using hardware ECC or software
ECC?

-Scott


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


Re: [U-Boot] Please pull u-boot-mpc85xx/master

2013-12-11 Thread Tom Rini
On Wed, Dec 11, 2013 at 11:22:17AM -0800, York Sun wrote:

 Tom,
 
 The following changes since commit 4b210ad34282bfd9fc982a8e3c9a9126f4094cdb:
 
   Merge branch 'master' of git://git.denx.de/u-boot-arm (2013-12-10
 17:15:18 -0500)
 
 are available in the git repository at:
 
 
   git://git.denx.de/u-boot-mpc85xx.git master
 
 for you to fetch changes up to e03c76c30342797a25ef9350e51c8daa0b56f1df:
 
   powerpc/mpc85xx: Update CONFIG_SYS_FSL_TBCLK_DIV for T1040 (2013-12-11
 11:12:54 -0800)
 
 
 Claudiu Manoil (1):
   powerpc/p1_p2_rdb_pc: Fix warnings for __iomem pointers
 
 Prabhakar Kushwaha (1):
   powerpc/mpc85xx: Update CONFIG_SYS_FSL_TBCLK_DIV for T1040
 
 Shaohui Xie (1):
   powerpc/t4240: Add a frequency setting case for fman1
 
 Shengzhou Liu (1):
   net/fman: add ft_fixup_xgec to support 3rd and 4th 10GEC
 
  arch/powerpc/cpu/mpc85xx/speed.c|3 ++
  arch/powerpc/include/asm/config_mpc85xx.h   |2 +-
  board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c |4 +-
  drivers/net/fm/init.c   |   53
 ++-
  4 files changed, 58 insertions(+), 4 deletions(-)

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 0/34] Switch over to real Kbuild

2013-12-11 Thread Masahiro Yamada
Hello Simon

  You need to apply above patches beforehand to use this series.
  They are simple patches, so I hope they will be reviewed and applied first.
 
 Can you please push a branch somewhere with all of these and kbuild?

Sure.

u-boot/master was updated after posting this series.
(Prerequisite [1] was merged into the mainline.)
I rebased my local branch and push it to my GitHub space.


Please try this:
git clone git://github.com/masahir0y/u-boot-kbuild.git
cd u-boot-kbuild
git checktout kbuild




Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH][v3] powerpc/mpc85xx: Add support for single source clocking

2013-12-11 Thread Priyanka Jain
Single-source clocking is new feature introduced in T1040.
In this mode, a differential clock is supplied to the
DIFF_SYSCLK_P/N inputs to the processor, which in turn is
used to supply clocks to the sysclock, ddrclock and usbclock.

So, both ddrclock and syclock are driven by same differential
sysclock in single-sourec clocking whereas in normal clocking
mode, generally separate DDRCLK and SYSCLK pins provides
reference clock for sysclock and ddrclock

DDR_REFCLK_SEL rcw bit is used to determine DDR clock source
-If DDR_REFCLK_SEL rcw bit is 0, then DDR PLLs are driven in
 normal clocking mode by DDR_Reference clock

-If DDR_REFCLK_SEL rcw bit is 1, then DDR PLLs are driven in
 single source clocking mode by DIFF_SYSCLK

Add code to determine ddrclock based on DDR_REFCLK_SEL rcw bit.

Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
Signed-off-by: Priyanka Jain priyanka.j...@freescale.com
---
Changes for v3:
Incorporated York's comment to move declaration to
beginning of function.

Changes for v2:
Incorporated York's comment to separate out
DDR_CLK_FREQ and SINGLE_SOURCE_CLK code

 arch/powerpc/cpu/mpc85xx/speed.c  |   24 ++--
 arch/powerpc/include/asm/config_mpc85xx.h |1 +
 arch/powerpc/include/asm/immap_85xx.h |3 +++
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/speed.c b/arch/powerpc/cpu/mpc85xx/speed.c
index 46ae80c..801564d 100644
--- a/arch/powerpc/cpu/mpc85xx/speed.c
+++ b/arch/powerpc/cpu/mpc85xx/speed.c
@@ -74,12 +74,32 @@ void get_sys_info(sys_info_t *sys_info)
uint ratio[CONFIG_SYS_FSL_NUM_CC_PLLS];
unsigned long sysclk = CONFIG_SYS_CLK_FREQ;
uint mem_pll_rat;
+#ifdef CONFIG_SINGLE_SOURCE_CLK
+   uint single_src;
+#endif
 
sys_info-freq_systembus = sysclk;
+#ifdef CONFIG_SINGLE_SOURCE_CLK
+   /*
+* DDR_REFCLK_SEL rcw bit is used to determine if DDR PLLS
+* are driven by separate DDR Refclock or single source
+* differential clock.
+*/
+   single_src = (in_be32(gur-rcwsr[5]) 
+ FSL_CORENET2_RCWSR5_DDR_REFCLK_SEL_SHIFT) 
+ FSL_CORENET2_RCWSR5_DDR_REFCLK_SEL_MASK;
+   /*
+* For single source clocking, both ddrclock and syclock
+* are driven by differential sysclock.
+*/
+   if (single_src == FSL_CORENET2_RCWSR5_DDR_REFCLK_SINGLE_CLK)
+   sys_info-freq_ddrbus = CONFIG_SYS_CLK_FREQ;
+   else
+#endif
 #ifdef CONFIG_DDR_CLK_FREQ
-   sys_info-freq_ddrbus = CONFIG_DDR_CLK_FREQ;
+   sys_info-freq_ddrbus = CONFIG_DDR_CLK_FREQ;
 #else
-   sys_info-freq_ddrbus = sysclk;
+   sys_info-freq_ddrbus = sysclk;
 #endif
 
sys_info-freq_systembus *= (in_be32(gur-rcwsr[0])  25)  0x1f;
diff --git a/arch/powerpc/include/asm/config_mpc85xx.h 
b/arch/powerpc/include/asm/config_mpc85xx.h
index 99e16bd..370bd21 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -711,6 +711,7 @@ defined(CONFIG_PPC_T1020) || defined(CONFIG_PPC_T1022)
 #define CONFIG_FM_PLAT_CLK_DIV 1
 #define CONFIG_SYS_FM1_CLK CONFIG_FM_PLAT_CLK_DIV
 #define CONFIG_SYS_FM_MURAM_SIZE   0x3
+#define CONFIG_SINGLE_SOURCE_CLK
 #define CONFIG_SYS_FSL_TBCLK_DIV   32
 #define CONFIG_SYS_FSL_PCIE_COMPAT fsl,qoriq-pcie-v2.4
 #define CONFIG_SYS_FSL_USB1_PHY_ENABLE
diff --git a/arch/powerpc/include/asm/immap_85xx.h 
b/arch/powerpc/include/asm/immap_85xx.h
index 672e8c6..68c3c82 100644
--- a/arch/powerpc/include/asm/immap_85xx.h
+++ b/arch/powerpc/include/asm/immap_85xx.h
@@ -1774,6 +1774,9 @@ defined(CONFIG_PPC_T1020) || defined(CONFIG_PPC_T1022)
 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S3_PLL20x0004
 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S4_PLL10x0002
 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S4_PLL20x0001
+#define FSL_CORENET2_RCWSR5_DDR_REFCLK_SEL_SHIFT 4
+#define FSL_CORENET2_RCWSR5_DDR_REFCLK_SEL_MASK0x0011
+#define FSL_CORENET2_RCWSR5_DDR_REFCLK_SINGLE_CLK  1
 
 #else /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */
 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_SHIFT   17
-- 
1.7.4.1



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


[U-Boot] [PATCH] powerpc/t1040qds: Update DDR initialization related settings

2013-12-11 Thread Priyanka Jain
Update following DDR related settings for T1040QDS
-Correct number of chip selects to two as t1040qds supports
 two Chip selects.
-Update board_specific_parameters udimm structure with settings
 derived via calibration.
-Reduced I2C speed to 100KHz as DDR-SPD does not get reliably
 read at 400KHz.

Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
Signed-off-by: Priyanka Jain priyanka.j...@freescale.com
---
 board/freescale/t1040qds/ddr.h |   22 --
 include/configs/T1040QDS.h |6 +++---
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/board/freescale/t1040qds/ddr.h b/board/freescale/t1040qds/ddr.h
index 8ee206e..afa72af 100644
--- a/board/freescale/t1040qds/ddr.h
+++ b/board/freescale/t1040qds/ddr.h
@@ -31,16 +31,18 @@ static const struct board_specific_parameters udimm0[] = {
 *   num|  hi| rank|  clk| wrlvl |   wrlvl   |  wrlvl | cpo  |wrdata|2T
 * ranks| mhz| GB  |adjst| start |   ctl2|  ctl3  |  |delay |
 */
-   {2,  1350, 4, 4, 8, 0x0809090b, 0x0c0c0d0a,   0xff,2,  0},
-   {2,  1350, 0, 5, 7, 0x0709090b, 0x0c0c0d09,   0xff,2,  0},
-   {2,  1666, 4, 4, 8, 0x080a0a0d, 0x0d10100b,   0xff,2,  0},
-   {2,  1666, 0, 5, 7, 0x080a0a0c, 0x0d0d0e0a,   0xff,2,  0},
-   {2,  1900, 0, 4, 8, 0x090a0b0e, 0x0f11120c,   0xff,2,  0},
-   {2,  2140, 0, 4, 8, 0x090a0b0e, 0x0f11120c,   0xff,2,  0},
-   {1,  1350, 0, 5, 8, 0x0809090b, 0x0c0c0d0a,   0xff,2,  0},
-   {1,  1700, 0, 5, 8, 0x080a0a0c, 0x0c0d0e0a,   0xff,2,  0},
-   {1,  1900, 0, 4, 8, 0x080a0a0c, 0x0e0e0f0a,   0xff,2,  0},
-   {1,  2140, 0, 4, 8, 0x090a0b0c, 0x0e0f100b,   0xff,2,  0},
+   {2,  833,  4, 4, 6, 0x06060607, 0x08080807,   0xff,2,  0},
+   {2,  833,  0, 4, 6, 0x06060607, 0x08080807,   0xff,2,  0},
+   {2,  1350, 4, 4, 7, 0x0708080A, 0x0A0B0C09,   0xff,2,  0},
+   {2,  1350, 0, 4, 7, 0x0708080A, 0x0A0B0C09,   0xff,2,  0},
+   {2,  1666, 4, 4, 7, 0x0808090B, 0x0C0D0E0A,   0xff,2,  0},
+   {2,  1666, 0, 4, 7, 0x0808090B, 0x0C0D0E0A,   0xff,2,  0},
+   {1,  833,  4, 4, 6, 0x06060607, 0x08080807,   0xff,2,  0},
+   {1,  833,  0, 4, 6, 0x06060607, 0x08080807,   0xff,2,  0},
+   {1,  1350, 4, 4, 7, 0x0708080A, 0x0A0B0C09,   0xff,2,  0},
+   {1,  1350, 0, 4, 7, 0x0708080A, 0x0A0B0C09,   0xff,2,  0},
+   {1,  1666, 4, 4, 7, 0x0808090B, 0x0C0D0E0A,   0xff,2,  0},
+   {1,  1666, 0, 4, 7, 0x0808090B, 0x0C0D0E0A,   0xff,2,  0},
{}
 };
 
diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
index 43a5778..605270f 100644
--- a/include/configs/T1040QDS.h
+++ b/include/configs/T1040QDS.h
@@ -167,7 +167,7 @@ unsigned long get_board_ddr_clk(void);
 
 /* CONFIG_NUM_DDR_CONTROLLERS is defined in include/asm/config_mpc85xx.h */
 #define CONFIG_DIMM_SLOTS_PER_CTLR 1
-#define CONFIG_CHIP_SELECTS_PER_CTRL   (4 * CONFIG_DIMM_SLOTS_PER_CTLR)
+#define CONFIG_CHIP_SELECTS_PER_CTRL   (2 * CONFIG_DIMM_SLOTS_PER_CTLR)
 
 #define CONFIG_DDR_SPD
 #define CONFIG_SYS_FSL_DDR3
@@ -413,9 +413,9 @@ unsigned long get_board_ddr_clk(void);
 /* I2C */
 #define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_FSL /* Use FSL common I2C driver */
-#define CONFIG_SYS_FSL_I2C_SPEED   40  /* I2C speed in Hz */
+#define CONFIG_SYS_FSL_I2C_SPEED   10  /* I2C speed in Hz */
 #define CONFIG_SYS_FSL_I2C_SLAVE   0x7F
-#define CONFIG_SYS_FSL_I2C2_SPEED  40  /* I2C speed in Hz */
+#define CONFIG_SYS_FSL_I2C2_SPEED  10  /* I2C speed in Hz */
 #define CONFIG_SYS_FSL_I2C2_SLAVE  0x7F
 #define CONFIG_SYS_FSL_I2C_OFFSET  0x118000
 #define CONFIG_SYS_FSL_I2C2_OFFSET 0x119000
-- 
1.7.4.1



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


[U-Boot] [PATCH] board/t1040qds: Relax IFC FPGA timings

2013-12-11 Thread Prabhakar Kushwaha
Current IFC-FPGA TCH(Chip Select hold time with respect to WE deassertion)
is 0 i.e. 0 ns hold time on writes. This may not work on higher clock
freqencies.

So, Increase TCH as 0x8 i.e. 8 ip_clk.

Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
---
 include/configs/T1040QDS.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
index 74f4bde..521a0dc 100644
--- a/include/configs/T1040QDS.h
+++ b/include/configs/T1040QDS.h
@@ -247,7 +247,7 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_CS3_FTIM1   (FTIM1_GPCM_TACO(0xff) | \
FTIM1_GPCM_TRAD(0x3f))
 #define CONFIG_SYS_CS3_FTIM2   (FTIM2_GPCM_TCS(0x0e) | \
-   FTIM2_GPCM_TCH(0x0) | \
+   FTIM2_GPCM_TCH(0x8) | \
FTIM2_GPCM_TWP(0x1f))
 #define CONFIG_SYS_CS3_FTIM3   0x0
 
-- 
1.7.9.5



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