Re: [U-Boot] [PATCH] Align end of bss by 4 bytes,

2008-10-15 Thread Selvamuthukumar
Wolfgang Denk,

On Wed, Oct 15, 2008 at 2:28 AM, Wolfgang Denk [EMAIL PROTECTED] wrote:
 I think this is a problem that may hit probably all architectures 
 all boards.

 Should we not perform this change globally, i.  e.  to  *all*  linker
 scripts?


Do you expect a patch that touches all linker scripts, that does not do
bss alignment? If so, I'll send it.

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


[U-Boot] [PATCH v2 02/16] [PATCH] I2C: add new command i2c reset.

2008-10-15 Thread Heiko Schocher
If I2C Bus is blocked (see doc/I2C_Edge_Conditions),
it is not possible to get out of this, until the
complete Hardware gets a reset. This new commando
calls again i2c_init (and that calls i2c_init_board
if defined), which will deblock the I2C Bus.

Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 common/cmd_i2c.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index ea80e8a..c0afd11 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1182,6 +1182,12 @@ int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, 
char *argv[])
 #endif

 #if defined(CONFIG_I2C_CMD_TREE)
+int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+   i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
+   return 0;
+}
+
 #if defined(CONFIG_I2C_MULTI_BUS)
 int do_i2c_bus_num(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
@@ -1238,6 +1244,8 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char 
*argv[])
return do_i2c_crc(cmdtp, flag, --argc, ++argv);
if (!strncmp(argv[1], pr, 2))
return do_i2c_probe(cmdtp, flag, --argc, ++argv);
+   if (!strncmp(argv[1], re, 2))
+   return do_i2c_reset(cmdtp, flag, --argc, ++argv);
if (!strncmp(argv[1], lo, 2))
return do_i2c_loop(cmdtp, flag, --argc, ++argv);
 #if defined(CONFIG_CMD_SDRAM)
@@ -1266,6 +1274,7 @@ U_BOOT_CMD(
i2c nm chip address[.0, .1, .2] - write to I2C device (constant 
address)\n
i2c crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n
i2c probe - show devices on the I2C bus\n
+   i2c reset - reinit the I2C Controller\n
i2c loop chip address[.0, .1, .2] [# of objects] - looping read of 
device\n
 #if defined(CONFIG_CMD_SDRAM)
i2c sdram chip - print SDRAM configuration information\n
-- 
1.5.6.1

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 03/16] [POWERPC] mgcoge: fix Codingstyle issues.

2008-10-15 Thread Heiko Schocher
Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 board/keymile/mgcoge/mgcoge.c |   79 +++-
 1 files changed, 38 insertions(+), 41 deletions(-)

diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index 51b6dc6..a6bf9bc 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007
+ * (C) Copyright 2007 - 2008
  * Heiko Schocher, DENX Software Engineering, [EMAIL PROTECTED]
  *
  * See file CREDITS for list of people who contributed to this
@@ -243,13 +243,13 @@ static long int try_init (volatile memctl8260_t * memctl, 
ulong sdmr,
*sdmr_ptr = sdmr | PSDMR_OP_NORM | PSDMR_RFEN;
*base = c;

-   size = get_ram_size((long *)base, maxsize);
+   size = get_ram_size ((long *)base, maxsize);
*orx_ptr = orx | ~(size - 1);

return (size);
 }

-phys_size_t initdram(int board_type)
+phys_size_t initdram (int board_type)
 {
volatile immap_t *immap = (immap_t *) CFG_IMMR;
volatile memctl8260_t *memctl = immap-im_memctl;
@@ -273,7 +273,7 @@ phys_size_t initdram(int board_type)

 int checkboard(void)
 {
-   puts(Board: mgcoge\n);
+   puts (Board: mgcoge\n);

return 0;
 }
@@ -281,7 +281,7 @@ int checkboard(void)
 /*
  * Early board initalization.
  */
-int board_early_init_r(void)
+int board_early_init_r (void)
 {
/* setup the UPIOx */
*(char *)(CFG_PIGGY_BASE + 0x02) = 0xc0;
@@ -293,68 +293,65 @@ int board_early_init_r(void)
 /*
  * update memory property in the blob
  */
-void ft_blob_update(void *blob, bd_t *bd)
+void ft_blob_update (void *blob, bd_t *bd)
 {
int ret, nodeoffset = 0;
ulong memory_data[2] = {0};
ulong flash_data[8] = {0};

-   memory_data[0] = cpu_to_be32(bd-bi_memstart);
-   memory_data[1] = cpu_to_be32(bd-bi_memsize);
+   memory_data[0] = cpu_to_be32 (bd-bi_memstart);
+   memory_data[1] = cpu_to_be32 (bd-bi_memsize);

nodeoffset = fdt_path_offset (blob, /memory);
if (nodeoffset = 0) {
-   ret = fdt_setprop(blob, nodeoffset, reg, memory_data,
-   sizeof(memory_data));
+   ret = fdt_setprop (blob, nodeoffset, reg, memory_data,
+   sizeof (memory_data));
if (ret  0)
-   printf(ft_blob_update(): cannot set /memory/reg 
-   property err:%s\n, fdt_strerror(ret));
-   }
-   else {
+   printf (ft_blob_update(): cannot set /memory/reg 
+   property err:%s\n, fdt_strerror (ret));
+   } else {
/* memory node is required in dts */
-   printf(ft_blob_update(): cannot find /memory node 
-   err:%s\n, fdt_strerror(nodeoffset));
+   printf (ft_blob_update(): cannot find /memory node 
+   err:%s\n, fdt_strerror (nodeoffset));
}
/* update Flash addr, size */
-   flash_data[2] = cpu_to_be32(CFG_FLASH_BASE);
-   flash_data[3] = cpu_to_be32(CFG_FLASH_SIZE);
-   flash_data[4] = cpu_to_be32(1);
-   flash_data[5] = cpu_to_be32(0);
-   flash_data[6] = cpu_to_be32(CFG_FLASH_BASE_1);
-   flash_data[7] = cpu_to_be32(CFG_FLASH_SIZE_1);
+   flash_data[2] = cpu_to_be32 (CFG_FLASH_BASE);
+   flash_data[3] = cpu_to_be32 (CFG_FLASH_SIZE);
+   flash_data[4] = cpu_to_be32 (1);
+   flash_data[5] = cpu_to_be32 (0);
+   flash_data[6] = cpu_to_be32 (CFG_FLASH_BASE_1);
+   flash_data[7] = cpu_to_be32 (CFG_FLASH_SIZE_1);
nodeoffset = fdt_path_offset (blob, /localbus);
if (nodeoffset = 0) {
-   ret = fdt_setprop(blob, nodeoffset, ranges, flash_data,
-   sizeof(flash_data));
+   ret = fdt_setprop (blob, nodeoffset, ranges, flash_data,
+   sizeof (flash_data));
if (ret  0)
-   printf(ft_blob_update(): cannot set /localbus/ranges 
-   property err:%s\n, fdt_strerror(ret));
-   }
-   else {
+   printf (ft_blob_update(): cannot set /localbus/ranges 
+   property err:%s\n, fdt_strerror (ret));
+   } else {
/* memory node is required in dts */
-   printf(ft_blob_update(): cannot find /localbus node 
-   err:%s\n, fdt_strerror(nodeoffset));
+   printf (ft_blob_update(): cannot find /localbus node 
+   err:%s\n, fdt_strerror (nodeoffset));
}
/* MAC Adresse */
nodeoffset = fdt_path_offset (blob, /soc/cpm/ethernet);
if (nodeoffset = 0) {
-   ret = fdt_setprop(blob, nodeoffset, mac-address, 
bd-bi_enetaddr,
-   sizeof(uchar) * 6);
+   ret = fdt_setprop (blob, nodeoffset, mac-address, 
bd-bi_enetaddr,
+   

[U-Boot] [PATCH v2 04/16] i2c: add CONFIG_I2C_MULTI_BUS for soft_i2c and mpc8260 i2c driver.

2008-10-15 Thread Heiko Schocher
Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 cpu/mpc8260/i2c.c  |   36 
 drivers/i2c/soft_i2c.c |   36 
 2 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/cpu/mpc8260/i2c.c b/cpu/mpc8260/i2c.c
index c3af7b6..335177f 100644
--- a/cpu/mpc8260/i2c.c
+++ b/cpu/mpc8260/i2c.c
@@ -36,6 +36,10 @@

 DECLARE_GLOBAL_DATA_PTR;

+#if defined(CONFIG_I2C_MULTI_BUS)
+static unsigned int i2c_bus_num __attribute__ ((section (data))) = 0;
+#endif /* CONFIG_I2C_MULTI_BUS */
+
 /* uSec to wait between polls of the i2c */
 #define DELAY_US   100
 /* uSec to wait for the CPM to start processing the buffer */
@@ -765,4 +769,36 @@ i2c_reg_write(uchar chip, uchar reg, uchar val)
i2c_write(chip, reg, 1, val, 1);
 }

+#if defined(CONFIG_I2C_MULTI_BUS)
+/*
+ * Functions for multiple I2C bus handling
+ */
+unsigned int i2c_get_bus_num(void)
+{
+   return i2c_bus_num;
+}
+
+int i2c_set_bus_num(unsigned int bus)
+{
+   if (bus = CFG_MAX_I2C_BUS)
+   return -1;
+   i2c_bus_num = bus;
+
+   return 0;
+}
+/* TODO: add 100/400k switching */
+unsigned int i2c_get_bus_speed(void)
+{
+   return CFG_I2C_SPEED;
+}
+
+int i2c_set_bus_speed(unsigned int speed)
+{
+   if (speed != CFG_I2C_SPEED)
+   return -1;
+
+   return 0;
+}
+
+#endif /* CONFIG_I2C_MULTI_BUS */
 #endif /* CONFIG_HARD_I2C */
diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index 23db2ee..57736da 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -68,6 +68,10 @@ DECLARE_GLOBAL_DATA_PTR;
 #define PRINTD(fmt,args...)
 #endif

+#if defined(CONFIG_I2C_MULTI_BUS)
+static unsigned int i2c_bus_num __attribute__ ((section (data))) = 0;
+#endif /* CONFIG_I2C_MULTI_BUS */
+
 /*---
  * Local functions
  */
@@ -230,6 +234,38 @@ static int write_byte(uchar data)
return(nack);   /* not a nack is an ack */
 }

+#if defined(CONFIG_I2C_MULTI_BUS)
+/*
+ * Functions for multiple I2C bus handling
+ */
+unsigned int i2c_get_bus_num(void)
+{
+   return i2c_bus_num;
+}
+
+int i2c_set_bus_num(unsigned int bus)
+{
+   if (bus = CFG_MAX_I2C_BUS)
+   return -1;
+   i2c_bus_num = bus;
+
+   return 0;
+}
+
+/* TODO: add 100/400k switching */
+unsigned int i2c_get_bus_speed(void)
+{
+   return CFG_I2C_SPEED;
+}
+
+int i2c_set_bus_speed(unsigned int speed)
+{
+   if (speed != CFG_I2C_SPEED)
+   return -1;
+
+   return 0;
+}
+#endif

 /*---
  * if ack == I2C_ACK, ACK the byte so can continue reading, else
-- 
1.5.6.1

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 05/16] soft_i2c: prevent compilerwarnings if driver not uses CPU Pins.

2008-10-15 Thread Heiko Schocher
This patch fixes the following warnings, when using
the soft_i2c driver using no CPU pins on MPC82xx or MPC8xx
systems:

soft_i2c.c: In function 'send_reset':
soft_i2c.c:93: warning: unused variable 'immr'
soft_i2c.c: In function 'send_start':
soft_i2c.c:124: warning: unused variable 'immr'
soft_i2c.c: In function 'send_stop':
soft_i2c.c:146: warning: unused variable 'immr'
soft_i2c.c: In function 'send_ack':
soft_i2c.c:171: warning: unused variable 'immr'
soft_i2c.c: In function 'write_byte':
soft_i2c.c:196: warning: unused variable 'immr'
soft_i2c.c: In function 'read_byte':
soft_i2c.c:244: warning: unused variable 'immr'

Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 drivers/i2c/soft_i2c.c |   43 ++-
 include/i2c.h  |9 +
 2 files changed, 15 insertions(+), 37 deletions(-)

diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index 57736da..19c364b 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -82,7 +82,6 @@ static void  send_ack (int);
 static int   write_byte(uchar byte);
 static uchar read_byte (int);

-
 /*---
  * Send a reset sequence consisting of 9 clocks with the data signal high
  * to clock any confused device back into an idle state.  Also send a
@@ -90,12 +89,7 @@ static uchar read_byte   (int);
  */
 static void send_reset(void)
 {
-#ifdef CONFIG_MPC8260
-   volatile ioport_t *iop = ioport_addr((immap_t *)CFG_IMMR, I2C_PORT);
-#endif
-#ifdef CONFIG_8xx
-   volatile immap_t *immr = (immap_t *)CFG_IMMR;
-#endif
+   I2C_SOFT_DECLARATIONS   /* intentional without ';' */
int j;

I2C_SCL(1);
@@ -121,12 +115,7 @@ static void send_reset(void)
  */
 static void send_start(void)
 {
-#ifdef CONFIG_MPC8260
-   volatile ioport_t *iop = ioport_addr((immap_t *)CFG_IMMR, I2C_PORT);
-#endif
-#ifdef CONFIG_8xx
-   volatile immap_t *immr = (immap_t *)CFG_IMMR;
-#endif
+   I2C_SOFT_DECLARATIONS   /* intentional without ';' */

I2C_DELAY;
I2C_SDA(1);
@@ -143,12 +132,7 @@ static void send_start(void)
  */
 static void send_stop(void)
 {
-#ifdef CONFIG_MPC8260
-   volatile ioport_t *iop = ioport_addr((immap_t *)CFG_IMMR, I2C_PORT);
-#endif
-#ifdef CONFIG_8xx
-   volatile immap_t *immr = (immap_t *)CFG_IMMR;
-#endif
+   I2C_SOFT_DECLARATIONS   /* intentional without ';' */

I2C_SCL(0);
I2C_DELAY;
@@ -168,12 +152,7 @@ static void send_stop(void)
  */
 static void send_ack(int ack)
 {
-#ifdef CONFIG_MPC8260
-   volatile ioport_t *iop = ioport_addr((immap_t *)CFG_IMMR, I2C_PORT);
-#endif
-#ifdef CONFIG_8xx
-   volatile immap_t *immr = (immap_t *)CFG_IMMR;
-#endif
+   I2C_SOFT_DECLARATIONS   /* intentional without ';' */

I2C_SCL(0);
I2C_DELAY;
@@ -193,12 +172,7 @@ static void send_ack(int ack)
  */
 static int write_byte(uchar data)
 {
-#ifdef CONFIG_MPC8260
-   volatile ioport_t *iop = ioport_addr((immap_t *)CFG_IMMR, I2C_PORT);
-#endif
-#ifdef CONFIG_8xx
-   volatile immap_t *immr = (immap_t *)CFG_IMMR;
-#endif
+   I2C_SOFT_DECLARATIONS   /* intentional without ';' */
int j;
int nack;

@@ -273,12 +247,7 @@ int i2c_set_bus_speed(unsigned int speed)
  */
 static uchar read_byte(int ack)
 {
-#ifdef CONFIG_MPC8260
-   volatile ioport_t *iop = ioport_addr((immap_t *)CFG_IMMR, I2C_PORT);
-#endif
-#ifdef CONFIG_8xx
-   volatile immap_t *immr = (immap_t *)CFG_IMMR;
-#endif
+   I2C_SOFT_DECLARATIONS   /* intentional without ';' */
int  data;
int  j;

diff --git a/include/i2c.h b/include/i2c.h
index a51c164..a6e797a 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -67,6 +67,15 @@
 #define CFG_SPD_BUS_NUM0
 #endif

+#ifndef I2C_SOFT_DECLARATIONS
+# if defined(CONFIG_MPC8260)
+#  define I2C_SOFT_DECLARATIONS volatile ioport_t *iop = ioport_addr((immap_t 
*)CFG_IMMR, I2C_PORT);
+# elif defined(CONFIG_8xx)
+#  define I2C_SOFT_DECLARATIONSvolatile immap_t *immr = (immap_t 
*)CFG_IMMR;
+# else
+#  define I2C_SOFT_DECLARATIONS
+# endif
+#endif
 /*
  * Initialization, must be called once on start up, may be called
  * repeatedly to change the speed and slave addresses.
-- 
1.5.6.1

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 06/16] [POWERPC] mgcoge, mgsuvd: add I2C support.

2008-10-15 Thread Heiko Schocher
Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 board/keymile/mgcoge/mgcoge.c |   14 +++-
 board/keymile/mgsuvd/mgsuvd.c |   11 ++
 include/configs/mgcoge.h  |   25 +++
 include/configs/mgsuvd.h  |   43 +
 4 files changed, 91 insertions(+), 2 deletions(-)

diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index a6bf9bc..d3e46f5 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -24,11 +24,16 @@
 #include common.h
 #include mpc8260.h
 #include ioports.h
+#include malloc.h

 #if defined(CONFIG_OF_BOARD_SETUP)  defined(CONFIG_OF_LIBFDT)
 #include libfdt.h
 #endif

+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#include i2c.h
+#endif
+
 /*
  * I/O Port configuration table
  *
@@ -163,8 +168,13 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD18 */ { 0,  0,   0,   0,   0,   0 }, /* PD18*/
/* PD17 */ { 0,  0,   0,   0,   0,   0 }, /* PD17*/
/* PD16 */ { 0,  0,   0,   0,   0,   0 }, /* PD16*/
-   /* PD15 */ { 0,  0,   0,   0,   0,   0 }, /* PD15*/
-   /* PD14 */ { 0,  0,   0,   0,   0,   0 }, /* PD14*/
+#if defined(CONFIG_HARD_I2C)
+   /* PD15 */ { 1,  1,   1,   0,   1,   0 }, /* I2C SDA */
+   /* PD14 */ { 1,  1,   1,   0,   1,   0 }, /* I2C SCL */
+#else
+   /* PD15 */ { 1,  0,   0,   0,   1,   1 }, /* PD15*/
+   /* PD14 */ { 1,  0,   0,   1,   1,   1 }, /* PD14*/
+#endif
/* PD13 */ { 0,  0,   0,   0,   0,   0 }, /* PD13*/
/* PD12 */ { 0,  0,   0,   0,   0,   0 }, /* PD12*/
/* PD11 */ { 0,  0,   0,   0,   0,   0 }, /* PD11*/
diff --git a/board/keymile/mgsuvd/mgsuvd.c b/board/keymile/mgsuvd/mgsuvd.c
index c51ea7e..62df832 100644
--- a/board/keymile/mgsuvd/mgsuvd.c
+++ b/board/keymile/mgsuvd/mgsuvd.c
@@ -225,3 +225,14 @@ void ft_board_setup(void *blob, bd_t *bd)
ft_blob_update(blob, bd);
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP)  defined(CONFIG_OF_LIBFDT) */
+
+int i2c_soft_read_pin (void)
+{
+   int val;
+
+   *(unsigned short *)(I2C_BASE_DIR) =  ~SDA_CONF;
+   udelay(1);
+   val = *(unsigned char *)(I2C_BASE_PORT);
+   
+   return ((val  SDA_BIT) == SDA_BIT);
+}
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 23af3ec..159eeae 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -82,6 +82,7 @@
 #include config_cmd_default.h

 #define CONFIG_CMD_ECHO
+#define CONFIG_CMD_I2C
 #define CONFIG_CMD_IMMAP
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
@@ -176,6 +177,30 @@
 #define CONFIG_ENV_ADDR(CFG_MONITOR_BASE + CFG_MONITOR_LEN)
 #endif /* CONFIG_ENV_IS_IN_FLASH */

+/* enable I2C and select the hardware/software driver */
+#undef CONFIG_HARD_I2C /* I2C with hardware support*/
+#defineCONFIG_SOFT_I2C 1   /* I2C bit-banged   
*/
+#define CFG_I2C_SPEED  5   /* I2C speed and slave address  */
+#define CFG_I2C_SLAVE  0x7F
+
+/*
+ * Software (bit-bang) I2C driver configuration
+ */
+
+#define I2C_PORT   3   /* Port A=0, B=1, C=2, D=3 */
+#define I2C_ACTIVE (iop-pdir |=  0x0001)
+#define I2C_TRISTATE   (iop-pdir = ~0x0001)
+#define I2C_READ   ((iop-pdat  0x0001) != 0)
+#define I2C_SDA(bit)   if(bit) iop-pdat |=  0x0001; \
+   elseiop-pdat = ~0x0001
+#define I2C_SCL(bit)   if(bit) iop-pdat |=  0x0002; \
+   elseiop-pdat = ~0x0002
+#define I2C_DELAY  udelay(5)   /* 1/4 I2C clock duration */
+
+#define CONFIG_I2C_MULTI_BUS   1
+#define CONFIG_I2C_CMD_TREE1
+#define CFG_MAX_I2C_BUS2
+
 #define CFG_IMMR   0xF000

 #define CFG_INIT_RAM_ADDR  CFG_IMMR
diff --git a/include/configs/mgsuvd.h b/include/configs/mgsuvd.h
index 740767e..f2cfe6e 100644
--- a/include/configs/mgsuvd.h
+++ b/include/configs/mgsuvd.h
@@ -113,6 +113,7 @@

 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
 #define CONFIG_CMD_NFS
 #define CONFIG_CMD_PING

@@ -330,4 +331,46 @@
 #define OF_TBCLK   (bd-bi_busfreq / 4)
 #define OF_STDOUT_PATH /soc/cpm/[EMAIL PROTECTED]

+/* enable I2C and select the hardware/software driver */
+#undef CONFIG_HARD_I2C /* I2C with hardware support*/
+#defineCONFIG_SOFT_I2C 1   /* I2C bit-banged   
*/
+#define CFG_I2C_SPEED  5   /* I2C speed and slave address  */
+#define CFG_I2C_SLAVE  0x7F
+#define I2C_SOFT_DECLARATIONS
+
+/*
+ * Software (bit-bang) I2C driver configuration
+ */
+#define I2C_BASE_DIR   (CFG_PIGGY_BASE + 0x04)
+#define 

[U-Boot] [PATCH v2 07/16] [PATCH] mgcoge, mgsuvd: added EEprom support.

2008-10-15 Thread Heiko Schocher
Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 include/configs/mgcoge.h |8 
 include/configs/mgsuvd.h |7 +++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 159eeae..8cff642 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -82,6 +82,7 @@
 #include config_cmd_default.h

 #define CONFIG_CMD_ECHO
+#define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IMMAP
 #define CONFIG_CMD_MII
@@ -201,6 +202,13 @@
 #define CONFIG_I2C_CMD_TREE1
 #define CFG_MAX_I2C_BUS2

+/* EEprom support */
+#define CFG_I2C_EEPROM_ADDR_LEN1
+#define CFG_I2C_MULTI_EEPROMS  1
+#define CFG_EEPROM_PAGE_WRITE_ENABLE
+#define CFG_EEPROM_PAGE_WRITE_BITS 3
+#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10
+
 #define CFG_IMMR   0xF000

 #define CFG_INIT_RAM_ADDR  CFG_IMMR
diff --git a/include/configs/mgsuvd.h b/include/configs/mgsuvd.h
index f2cfe6e..85c6ac9 100644
--- a/include/configs/mgsuvd.h
+++ b/include/configs/mgsuvd.h
@@ -113,6 +113,7 @@

 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_NFS
 #define CONFIG_CMD_PING
@@ -372,5 +373,11 @@
 #define CONFIG_I2C_CMD_TREE1
 #define CFG_MAX_I2C_BUS2

+/* EEprom support */
+#define CFG_I2C_EEPROM_ADDR_LEN1
+#define CFG_I2C_MULTI_EEPROMS  1
+#define CFG_EEPROM_PAGE_WRITE_ENABLE
+#define CFG_EEPROM_PAGE_WRITE_BITS 3
+#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10

 #endif /* __CONFIG_H */
-- 
1.5.6.1

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 08/16] [PATCH] lm75: fix Codingstyle issues.

2008-10-15 Thread Heiko Schocher
Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 drivers/hwmon/lm75.c |  222 ++
 1 files changed, 99 insertions(+), 123 deletions(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 6770cdd..f544ebb 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -44,159 +44,135 @@

 int dtt_read(int sensor, int reg)
 {
-int dlen;
-uchar data[2];
+   int dlen;
+   uchar data[2];

 #ifdef CONFIG_DTT_AD7414
-/*
- * On AD7414 the first value upon bootup is not read correctly.
- * This is most likely because of the 800ms update time of the
- * temp register in normal update mode. To get current values
- * each time we issue the dtt command including upon powerup
- * we switch into one-short mode.
- *
- * Issue one-shot mode command
- */
-dtt_write(sensor, DTT_CONFIG, 0x64);
+   /*
+* On AD7414 the first value upon bootup is not read correctly.
+* This is most likely because of the 800ms update time of the
+* temp register in normal update mode. To get current values
+* each time we issue the dtt command including upon powerup
+* we switch into one-short mode.
+*
+* Issue one-shot mode command
+*/
+   dtt_write(sensor, DTT_CONFIG, 0x64);
 #endif

-/*
- * Validate 'reg' param
- */
-if((reg  0) || (reg  3))
-   return -1;
-
-/*
- * Calculate sensor address and register.
- */
-sensor = DTT_I2C_DEV_CODE + (sensor  0x07); /* calculate address of lm75 
*/
-
-/*
- * Prepare to handle 2 byte result.
- */
-if ((reg == DTT_READ_TEMP) ||
-   (reg == DTT_TEMP_HYST) ||
-   (reg == DTT_TEMP_SET))
-   dlen = 2;
-else
-   dlen = 1;
-
-/*
- * Now try to read the register.
- */
-if (i2c_read(sensor, reg, 1, data, dlen) != 0)
-   return -1;
-
-/*
- * Handle 2 byte result.
- */
-if (dlen == 2)
-   return ((int)((short)data[1] + (((short)data[0])  8)));
-
-
-return (int)data[0];
+   /* Validate 'reg' param */
+   if((reg  0) || (reg  3))
+   return -1;
+
+   /* Calculate sensor address and register. */
+   sensor = DTT_I2C_DEV_CODE + (sensor  0x07);
+
+   /* Prepare to handle 2 byte result. */
+   if ((reg == DTT_READ_TEMP) ||
+   (reg == DTT_TEMP_HYST) ||
+   (reg == DTT_TEMP_SET))
+   dlen = 2;
+   else
+   dlen = 1;
+
+   /* Now try to read the register. */
+   if (i2c_read(sensor, reg, 1, data, dlen) != 0)
+   return -1;
+
+   /* Handle 2 byte result. */
+   if (dlen == 2)
+   return ((int)((short)data[1] + (((short)data[0])  8)));
+
+   return (int)data[0];
 } /* dtt_read() */


 int dtt_write(int sensor, int reg, int val)
 {
-int dlen;
-uchar data[2];
-
-/*
- * Validate 'reg' param
- */
-if ((reg  0) || (reg  3))
-   return 1;
-
-/*
- * Calculate sensor address and register.
- */
-sensor = DTT_I2C_DEV_CODE + (sensor  0x07); /* calculate address of lm75 
*/
-
-/*
- * Handle 2 byte values.
- */
-if ((reg == DTT_READ_TEMP) ||
-   (reg == DTT_TEMP_HYST) ||
-   (reg == DTT_TEMP_SET)) {
-   dlen = 2;
-   data[0] = (char)((val  8)  0xff);/* MSB first */
-   data[1] = (char)(val  0xff);
-} else {
-   dlen = 1;
-   data[0] = (char)(val  0xff);
-}
-
-/*
- * Write value to register.
- */
-if (i2c_write(sensor, reg, 1, data, dlen) != 0)
-   return 1;
-
-return 0;
+   int dlen;
+   uchar data[2];
+
+   /* Validate 'reg' param */
+   if ((reg  0) || (reg  3))
+   return 1;
+
+   /* Calculate sensor address and register. */
+   sensor = DTT_I2C_DEV_CODE + (sensor  0x07);
+
+   /* Handle 2 byte values. */
+   if ((reg == DTT_READ_TEMP) ||
+   (reg == DTT_TEMP_HYST) ||
+   (reg == DTT_TEMP_SET)) {
+   dlen = 2;
+   data[0] = (char)((val  8)  0xff);/* MSB first */
+   data[1] = (char)(val  0xff);
+   } else {
+   dlen = 1;
+   data[0] = (char)(val  0xff);
+   }
+
+   /* Write value to register. */
+   if (i2c_write(sensor, reg, 1, data, dlen) != 0)
+   return 1;
+
+   return 0;
 } /* dtt_write() */


 static int _dtt_init(int sensor)
 {
-int val;
-
-/*
- * Setup TSET ( trip point ) register
- */
-val = ((CFG_DTT_MAX_TEMP * 2)  7)  0xff80; /* trip */
-if (dtt_write(sensor, DTT_TEMP_SET, val) != 0)
-   return 1;
-
-/*
- * Setup THYST ( untrip point ) register - Hysteresis
- */
-val = (((CFG_DTT_MAX_TEMP - CFG_DTT_HYSTERESIS) * 2)  7)  0xff80;
-if (dtt_write(sensor, DTT_TEMP_HYST, val) != 0)
-   return 1;
-
-/*
- * Setup configuraton register
- */
+   

[U-Boot] [PATCH v2 10/16] [PATCH] mgcoge, mgsuvd: add DTT (LM75) support.

2008-10-15 Thread Heiko Schocher
Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 include/configs/mgcoge.h |9 +
 include/configs/mgsuvd.h |9 +
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 8cff642..bfbbd45 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -81,6 +81,7 @@
  */
 #include config_cmd_default.h

+#define CONFIG_CMD_DTT
 #define CONFIG_CMD_ECHO
 #define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_I2C
@@ -209,6 +210,14 @@
 #define CFG_EEPROM_PAGE_WRITE_BITS 3
 #define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10

+/* I2C SYSMON (LM75, AD7414 is almost compatible)  */
+#define CONFIG_DTT_LM751   /* ON Semi's LM75   
*/
+#define CONFIG_DTT_SENSORS {0} /* Sensor addresses */
+#define CFG_DTT_MAX_TEMP   70
+#define CFG_DTT_LOW_TEMP   -30
+#define CFG_DTT_HYSTERESIS 3
+#define CFG_DTT_BUS_NUM(CFG_MAX_I2C_BUS)
+
 #define CFG_IMMR   0xF000

 #define CFG_INIT_RAM_ADDR  CFG_IMMR
diff --git a/include/configs/mgsuvd.h b/include/configs/mgsuvd.h
index 85c6ac9..c569c81 100644
--- a/include/configs/mgsuvd.h
+++ b/include/configs/mgsuvd.h
@@ -113,6 +113,7 @@

 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DTT
 #define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_NFS
@@ -380,4 +381,12 @@
 #define CFG_EEPROM_PAGE_WRITE_BITS 3
 #define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10

+/* I2C SYSMON (LM75, AD7414 is almost compatible)  */
+#define CONFIG_DTT_LM751   /* ON Semi's LM75   
*/
+#define CONFIG_DTT_SENSORS {0, 2, 4, 6}/* Sensor addresses 
*/
+#define CFG_DTT_MAX_TEMP   70
+#define CFG_DTT_LOW_TEMP   -30
+#define CFG_DTT_HYSTERESIS 3
+#define CFG_DTT_BUS_NUM(CFG_MAX_I2C_BUS)
+
 #endif /* __CONFIG_H */
-- 
1.5.6.1

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 12/16] [PATCH] mgcoge, mgsuvd: add boardspecific I2C deblocking mechanism.

2008-10-15 Thread Heiko Schocher
As Documented in doc/I2C_Edge_Conditions, adding a
boardspecific deblocking mechansim via CFG_I2C_INIT_BOARD
for the mgcoge and mgsuvd board.

This code was originally written by keymile in association
with Anatech and Atmel in 1998. The Code toggels the SCL
until the SCA line goes to High (max. 16 times).
And after this, a start Condition is send.

This is another approach to deblock the I2C Bus. The
soft I2C driver actually sends 9 clocks with SDA High,
and then a stop at the end, to deblock the I2C Bus.

Maybe we should use the approach from keymile as
the new standard?

Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 board/keymile/common/common.c |  209 +
 board/keymile/mgcoge/Makefile |2 +-
 board/keymile/mgsuvd/Makefile |2 +-
 include/configs/mgcoge.h  |1 +
 include/configs/mgsuvd.h  |1 +
 5 files changed, 213 insertions(+), 2 deletions(-)
 create mode 100644 board/keymile/common/common.c

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
new file mode 100644
index 000..13b80fe
--- /dev/null
+++ b/board/keymile/common/common.c
@@ -0,0 +1,209 @@
+/*
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, [EMAIL PROTECTED]
+ *
+ * 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
+ */
+
+#include common.h
+#include mpc8260.h
+#include ioports.h
+#include malloc.h
+
+#if defined(CONFIG_OF_BOARD_SETUP)  defined(CONFIG_OF_LIBFDT)
+#include libfdt.h
+#endif
+
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#include i2c.h
+#endif
+
+extern int i2c_soft_read_pin (void);
+
+#if defined(CFG_I2C_INIT_BOARD)
+#define DELAY_ABORT_SEQ62
+#define DELAY_HALF_PERIOD  (500 / (CFG_I2C_SPEED / 1000))
+
+#if defined(CONFIG_MGCOGE)
+#define SDA_MASK   0x0001
+#define SCL_MASK   0x0002
+static void set_pin (int state, unsigned long mask)
+{
+   volatile ioport_t *iop = ioport_addr ((immap_t *)CFG_IMMR, 3);
+
+   if (state)
+   iop-pdat |= (mask);
+   else
+   iop-pdat = ~(mask);
+
+   iop-pdir |= (mask);
+}
+
+static int get_pin (unsigned long mask)
+{
+   volatile ioport_t *iop = ioport_addr ((immap_t *)CFG_IMMR, 3);
+
+   iop-pdir = ~(mask);
+   return (0 != (iop-pdat  (mask)));
+}
+
+static void set_sda (int state)
+{
+   set_pin (state, SDA_MASK);
+}
+
+static void set_scl (int state)
+{
+   set_pin (state, SCL_MASK);
+}
+
+static int get_sda (void)
+{
+   return get_pin (SDA_MASK);
+}
+
+static int get_scl (void)
+{
+   return get_pin (SCL_MASK);
+}
+
+#if defined(CONFIG_HARD_I2C)
+static void setports (int gpio)
+{
+   volatile ioport_t *iop = ioport_addr ((immap_t *)CFG_IMMR, 3);
+
+   if (gpio) {
+   iop-ppar = ~(SDA_MASK | SCL_MASK);
+   iop-podr = ~(SDA_MASK | SCL_MASK);
+   } else {
+   iop-ppar |= (SDA_MASK | SCL_MASK);
+   iop-pdir = ~(SDA_MASK | SCL_MASK);
+   iop-podr |= (SDA_MASK | SCL_MASK);
+   }
+}
+#endif
+#endif
+
+#if defined(CONFIG_MGSUVD)
+static void set_sda (int state)
+{
+   I2C_SDA(state);
+}
+
+static void set_scl (int state)
+{
+   I2C_SCL(state);
+}
+
+static int get_sda (void)
+{
+   return i2c_soft_read_pin ();
+}
+
+static int get_scl (void)
+{
+   int val;
+
+   *(unsigned short *)(I2C_BASE_DIR) =  ~SCL_CONF;
+   udelay (1);
+   val = *(unsigned char *)(I2C_BASE_PORT);
+   
+   return ((val  SCL_BIT) == SCL_BIT);
+}
+
+#endif
+
+static void writeStartSeq (void)
+{
+   set_sda (1);
+   udelay (DELAY_HALF_PERIOD);
+   set_scl (1);
+   udelay (DELAY_HALF_PERIOD);
+   set_sda (0);
+   udelay (DELAY_HALF_PERIOD);
+   set_scl (0);
+   udelay (DELAY_HALF_PERIOD);
+}
+
+/* I2C is a synchronous protocol and resets of the processor in the middle
+   of an access can block the I2C Bus until a powerdown of the full unit is
+   done. This function toggles the SCL until the SCL and SCA line are
+   released, but max. 16 times, after this a I2C start-sequence is sent.
+   This I2C Deblocking mechanism was developed by Keymile in association
+   with Anatech and Atmel in 1998.
+ */

[U-Boot] [PATCH v2 13/16] I2C: adding new i2c bus Command to the I2C Subsystem.

2008-10-15 Thread Heiko Schocher
With this Command it is possible to add new I2C Busses,
which are behind 1 .. n I2C Muxes. Details see README.

Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 README   |   47 
 common/cmd_i2c.c |  267 ++
 cpu/mpc8260/i2c.c|   15 +++-
 drivers/i2c/soft_i2c.c   |   15 +++-
 include/configs/mgcoge.h |1 +
 include/configs/mgsuvd.h |1 +
 include/i2c.h|   23 
 7 files changed, 367 insertions(+), 2 deletions(-)

diff --git a/README b/README
index b10b539..46353f4 100644
--- a/README
+++ b/README
@@ -1429,6 +1429,53 @@ The following options need to be configured:
Define this option if you want to use Freescale's I2C driver in
drivers/i2c/fsl_i2c.c.

+   CONFIG_I2C_MUX
+
+   Define this option if you have I2C devices reached over 1 .. n
+   I2C Muxes like the pca9544a. This option addes a new I2C
+   Command i2c bus [muxtype:muxaddr:muxchannel] which adds a
+   new I2C Bus to the existing I2C Busses. If you select the
+   new Bus with i2c dev, u-bbot sends first the commandos for
+   the muxes to activate this new bus.
+
+   CONFIG_I2C_MULTI_BUS must be also defined, to use this
+   feature!
+
+   Example:
+   Adding a new I2C Bus reached over 2 pca9544a muxes
+   The First mux with address 70 and channel 6
+   The Second mux with address 71 and channel 4
+
+   = i2c bus pca9544a:70:6:pca9544a:71:4
+
+   Use the i2c bus command without parameter, to get a list
+   of I2C Busses with muxes:
+
+   = i2c bus
+   Busses reached over muxes:
+   Bus ID: 2
+ reached over Mux(es):
+   [EMAIL PROTECTED] ch: 4
+   Bus ID: 3
+ reached over Mux(es):
+   [EMAIL PROTECTED] ch: 6
+   [EMAIL PROTECTED] ch: 4
+   =  
+
+   If you now switch to the new I2C Bus 3 with i2c dev 3
+   u-boot sends First the Commando to the [EMAIL PROTECTED] to 
enable
+   channel 6, and then the Commando to the [EMAIL PROTECTED] to 
enable
+   the channel 4.
+
+   After that, you can use the normal i2c commands as
+   usual, to communicate with your I2C devices behind
+   the 2 muxes.
+
+   This option is actually implemented for the bitbanging
+   algorithm in common/soft_i2c.c and for the Hardware I2C
+   Bus on the MPC8260. But it should be not so difficult
+   to add this option to other architectures.
+

 - SPI Support: CONFIG_SPI

diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index c0afd11..17cdc9f 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -83,7 +83,9 @@

 #include common.h
 #include command.h
+#include environment.h
 #include i2c.h
+#include malloc.h
 #include asm/byteorder.h

 /* Display values from last command.
@@ -125,6 +127,14 @@ static uchar i2c_no_probes[] = CFG_I2C_NOPROBES;
 #define NUM_ELEMENTS_NOPROBE (sizeof(i2c_no_probes)/sizeof(i2c_no_probes[0]))
 #endif

+#if defined(CONFIG_I2C_MUX)
+static I2C_MUX_DEVICE  *i2c_mux_devices = NULL;
+static int i2c_mux_busid = CFG_MAX_I2C_BUS;
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#endif
+
 static int
 mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]);

@@ -1188,6 +1198,37 @@ int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, 
char *argv[])
return 0;
 }

+#if defined(CONFIG_I2C_MUX)
+int do_i2c_add_bus(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+   int ret=0;
+
+   if (argc == 1) {
+   /* show all busses */
+   I2C_MUX *mux;
+   I2C_MUX_DEVICE  *device = i2c_mux_devices;
+
+   printf (Busses reached over muxes:\n);
+   while (device != NULL) {
+   printf (Bus ID: %x\n, device-busid);
+   printf (  reached over Mux(es):\n);
+   mux = device-mux;
+   while (mux != NULL) {
+   printf ([EMAIL PROTECTED] ch: %x\n, 
mux-name, mux-chip, mux-channel);
+   mux = mux-next;
+   }
+   device = device-next;
+   }
+   } else {
+   I2C_MUX_DEVICE *dev;
+
+   dev = i2c_mux_ident_muxstring ((uchar *)argv[1]);
+   ret = 0;
+   }
+   return ret;
+}
+#endif  /* CONFIG_I2C_MUX */
+
 #if defined(CONFIG_I2C_MULTI_BUS)
 int do_i2c_bus_num(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
@@ -1226,6 +1267,10 @@ int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int 
argc, char *argv[])

 int do_i2c(cmd_tbl_t * cmdtp, int 

[U-Boot] [PATCH v2 15/16] [PATCH] mgcoge, mgsuvd: added support for the IVM EEprom.

2008-10-15 Thread Heiko Schocher
The EEprom contains some Manufacturerinformation,
which are read from u-boot at boot time, and saved
in same hush shell variables.

Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 board/keymile/common/common.c |  287 +
 board/keymile/mgcoge/mgcoge.c |7 +
 board/keymile/mgsuvd/mgsuvd.c |8 +
 include/configs/mgcoge.h  |6 +
 include/configs/mgsuvd.h  |6 +
 5 files changed, 314 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 13b80fe..ccf76ca 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -25,6 +25,7 @@
 #include mpc8260.h
 #include ioports.h
 #include malloc.h
+#include hush.h

 #if defined(CONFIG_OF_BOARD_SETUP)  defined(CONFIG_OF_LIBFDT)
 #include libfdt.h
@@ -36,6 +37,292 @@

 extern int i2c_soft_read_pin (void);

+int ivm_calc_crc (unsigned char *buf, int len)
+{
+   const unsigned short crc_tab[16] = {
+   0x, 0xCC01, 0xD801, 0x1400,
+   0xF001, 0x3C00, 0x2800, 0xE401,
+   0xA001, 0x6C00, 0x7800, 0xB401,
+   0x5000, 0x9C01, 0x8801, 0x4400};
+
+   unsigned short crc = 0;   /* final result */
+   unsigned short r1  = 0;   /* temp */
+   unsigned char  byte= 0;   /* input buffer */
+   int i;
+
+   /* calculate CRC from array data */
+   for (i = 0; i  len; i++) {
+   byte = buf[i];
+
+   /* lower 4 bits */
+   r1 = crc_tab[crc  0xF];
+   crc = ((crc)  4)  0x0FFF;
+   crc = crc ^ r1 ^ crc_tab[byte  0xF];
+
+   /* upper 4 bits */
+   r1 = crc_tab[crc  0xF];
+   crc = (crc  4)  0x0FFF;
+   crc = crc ^ r1 ^ crc_tab[(byte  4)  0xF];
+   }
+   return crc;
+}
+
+static int  ivm_set_value (char *name, char *value)
+{
+   char tempbuf[256];
+
+   if (value != NULL) {
+   sprintf (tempbuf, %s=%s, name, value);
+   return set_local_var (tempbuf, 0);
+   } else {
+   unset_local_var (name);
+   }
+   return 0;
+}
+
+static int ivm_get_value (unsigned char *buf, int len, char *name, int off,
+   int check)
+{
+   unsigned short  val;
+   unsigned char   valbuf[30];
+
+   if ((buf[off + 0] != buf[off + 2]) 
+   (buf[off + 2] != buf[off + 4])) {
+   printf (%s Error corrupted %s\n, __FUNCTION__, name);
+   val = -1;
+   } else {
+   val = buf[off + 0] + (buf[off + 1]  8);
+   if ((val == 0)  (check == 1))
+   val = -1;
+   }
+   sprintf ((char *)valbuf, %x, val);
+   ivm_set_value (name, (char *)valbuf);
+   return val;
+}
+
+#define INVENTORYBLOCKSIZE 0x100
+#define INVENTORYDATAADDRESS   0x21
+#define INVENTORYDATASIZE  (INVENTORYBLOCKSIZE - INVENTORYDATAADDRESS - 3)
+
+#define IVM_POS_SHORT_TEXT 0
+#define IVM_POS_MANU_ID1
+#define IVM_POS_MANU_SERIAL2
+#define IVM_POS_PART_NUMBER3
+#define IVM_POS_BUILD_STATE4
+#define IVM_POS_SUPPLIER_PART_NUMBER   5
+#define IVM_POS_DELIVERY_DATE  6
+#define IVM_POS_SUPPLIER_BUILD_STATE   7
+#define IVM_POS_CUSTOMER_ID8
+#define IVM_POS_CUSTOMER_PROD_ID   9
+#define IVM_POS_HISTORY10
+#define IVM_POS_SYMBOL_ONLY11
+
+static char convert_char (char c)
+{
+   return (c  ' ' || c  '~') ? '.' : c;
+}
+
+static int ivm_findinventorystring (int type,
+   unsigned char* const string,
+   unsigned long maxlen,
+   unsigned char *buf)
+{
+   int xcode = 0;
+   unsigned long cr = 0;
+   unsigned long addr = INVENTORYDATAADDRESS;
+   unsigned long size = 0;
+   unsigned long nr = type;
+   int stop = 0;   /* stop on semicolon */
+
+   memset(string, '\0', maxlen);
+   switch (type) {
+   case IVM_POS_SYMBOL_ONLY:
+   nr = 0;
+   stop= 1;
+   break;
+   default:
+   nr = type;
+   stop = 0;
+   }
+
+   /* Look for the requested number of CR. */
+   while ((cr != nr)  (addr  INVENTORYDATASIZE)) {
+   if ((buf[addr] == '\r')) {
+   cr++;
+   }
+   addr++;
+   }
+
+   /* the expected number of CR was found until the end of the IVM
+*  content -- fill string */
+   if (addr  INVENTORYDATASIZE) {
+   /* Copy the IVM string in the corresponding string */
+   for (; (buf[addr] != '\r')  
+   ((buf[addr] != ';') ||  (!stop))
+   (size  (maxlen - 1)
+   

[U-Boot] [PATCH v2 16/16] [PATCH] mgsuvd, mgcoge: added BOOTCOUNT feature.

2008-10-15 Thread Heiko Schocher
Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 include/configs/mgcoge.h |2 ++
 include/configs/mgsuvd.h |2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index cdbfd67..ecf93e9 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -76,6 +76,8 @@

 #define CONFIG_BAUDRATE115200

+#define CONFIG_BOOTCOUNT_LIMIT
+
 /*
  * Command line configuration.
  */
diff --git a/include/configs/mgsuvd.h b/include/configs/mgsuvd.h
index eda71c0..4ecaeac 100644
--- a/include/configs/mgsuvd.h
+++ b/include/configs/mgsuvd.h
@@ -48,6 +48,8 @@
 #define CONFIG_BAUDRATE115200  /* console baudrate = 115kbps   
*/

 #define CONFIG_BOOTCOUNT_LIMIT
+#define CFG_CPM_BOOTCOUNT_ADDR 0x1eb0  /* In case of SMC relocation, the
+* default value is not working */

 #define CONFIG_BOOTDELAY   5   /* autoboot after 5 seconds */

-- 
1.5.6.1

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Handle environment variables like commands

2008-10-15 Thread Wolfgang Denk
Dear Stefano,

In message [EMAIL PROTECTED] you wrote:
 The command interpreter checks always if an environment variable
 for that name exists and in this case the content of the variable
 is executed. It becomes possible to redefine all U-Boot commands.
 A new builtin command is added to be able to run builtin U-boot commands
 even if they are redefined.

Cool. That's just great.

If I had known it's suffcient to put ideas on  a  web  page  to  have
people  put  them  into  code  I  would  have started doing this much
earlier :-)

 + /* Check if exists a variable with that name */
 + if ((p = getenv (child-argv[i])) != NULL )  {
 + int rcode;
 + rcode = (parse_string_outer(p,
 + FLAG_PARSE_SEMICOLON | 
 FLAG_EXIT_FROM_LOOP) != 0);
 + return rcode;
 + }

I think this covers only the hush shell version. We need something
like this instead:


#ifdef CFG_HUSH_PARSER
rcode = parse_string_outer(p, FLAG_PARSE_SEMICOLON |
FLAG_EXIT_FROM_LOOP);
#else 
rcode =run_command (p, 0);
#endif


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
For every complex problem, there is a solution that is simple,  neat,
and wrong.   - Mark Twain
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Align end of bss by 4 bytes,

2008-10-15 Thread Wolfgang Denk
Dear Selvamuthukumar,

In message [EMAIL PROTECTED] you wrote:

  Should we not perform this change globally, i.  e.  to  *all*  linker
  scripts?
 
 Do you expect a patch that touches all linker scripts, that does not do
 bss alignment? If so, I'll send it.

If you could do that, it would be a great help.  Thanks in advance!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Q:  How many DEC repairman does it take to fix a flat ?
A:  Five; four to hold the car up and one to swap tires.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] 74xx/7xx/86xx: Rename flush_data_cache to flush_dcache to match 85xx version

2008-10-15 Thread Wolfgang Denk
Dear Kumar Gala,

In message [EMAIL PROTECTED] you wrote:
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]
 ---
  cpu/74xx_7xx/cache.S |   10 +-
  cpu/mpc86xx/cache.S  |   10 +-
  2 files changed, 10 insertions(+), 10 deletions(-)

Applied to next branch.

Jon, as this was for more than just 86xx I just went ahead. Hope
that's OK with you.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Advice is seldom welcome; and those who want it the most always like
it the least. -- Philip Earl of Chesterfield
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Handle environment variables like commands

2008-10-15 Thread Stefano Babic
The command interpreter checks always if an environment variable
for that name exists and in this case the content of the variable
is executed. It becomes possible to redefine all U-Boot commands.
A new builtin command is added to be able to run builtin U-boot commands
even if they are redefined.
For this reason, builtin is a reserved word an no environment
variable can be set with this name.

Signed-off-by : Stefano Babic [EMAIL PROTECTED]
---
 common/cmd_nvedit.c |8 
 common/hush.c   |9 -
 common/main.c   |   37 +
 tools/env/fw_env.c  |8 
 4 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 637d6c9..c6e4ec7 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -161,6 +161,14 @@ int _do_setenv (int flag, int argc, char *argv[])
}
 
/*
+* Check for reserved words
+*/
+   if (strcmp(name, builtin) == 0) {
+   printf (## Error: builtin is a reserved word. You cannot set a 
variable with this name\n);
+   return 1;
+   }
+
+   /*
 * search if variable with this name already exists
 */
oldval = -1;
diff --git a/common/hush.c b/common/hush.c
index 093c428..bd7b223 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1677,9 +1677,16 @@ static int run_pipe_real(struct pipe *pi)
child-argv[i]);
return -1;
}
-   /* Look up command in command table */
 
+   /* Check if exists a variable with that name, builtin 
is forbidden */
+   if ((strcmp (child-argv[i], builtin) != 0)  (p = 
getenv (child-argv[i])) != NULL )  {
+   int rcode;
+   rcode = (parse_string_outer(p,
+   FLAG_PARSE_SEMICOLON | 
FLAG_EXIT_FROM_LOOP) != 0);
+   return rcode;
+   }
 
+   /* Look up command in command table */
if ((cmdtp = find_cmd(child-argv[i])) == NULL) {
printf (Unknown command '%s' - try 'help'\n, 
child-argv[i]);
return -1;  /* give up after bad command */
diff --git a/common/main.c b/common/main.c
index c06ea07..d2be2ac 100644
--- a/common/main.c
+++ b/common/main.c
@@ -1289,6 +1289,7 @@ int run_command (const char *cmd, int flag)
int argc, inquotes;
int repeatable = 1;
int rc = 0;
+   char *runenv;
 
 #ifdef DEBUG_PARSER
printf ([RUN_COMMAND] cmd[%p]=\, cmd);
@@ -1357,6 +1358,13 @@ int run_command (const char *cmd, int flag)
continue;
}
 
+   if ((strcmp (argv[0], builtin) != 0)  ((runenv = getenv 
(argv[0])) != NULL ))  {
+   if (run_command(runenv,flag) == -1) {
+   rc = -1;
+   }
+   continue;
+   }
+
/* Look up command in command table */
if ((cmdtp = find_cmd(argv[0])) == NULL) {
printf (Unknown command '%s' - try 'help'\n, argv[0]);
@@ -1433,3 +1441,32 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char 
*argv[])
return 0;
 }
 #endif
+
+int do_builtin (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+   int i;
+
+   if (argc  2) {
+   printf (Usage:\n%s\n, cmdtp-usage);
+   return 1;
+   }
+
+   /* Look up command in command table */
+   if ((cmdtp = find_cmd(argv[1])) == NULL) {
+   printf (Unknown builtin command '%s' - try 'help'\n, argv[1]);
+   return 1;
+   }
+
+   /* Remove builtin from arg list */
+   argc--;
+
+   /* OK - call function to do the command */
+   if ((cmdtp-cmd) (cmdtp, flag, argc, argv[1]) != 0) {
+   return 1;
+   }
+}
+
+U_BOOT_CMD(
+   builtin,CFG_MAXARGS,1,  do_builtin,
+   builtin - run builtin commands\n,
+);
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 6e9c34f..cc31b79 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -353,6 +353,14 @@ int fw_setenv (int argc, char *argv[])
name = argv[1];
 
/*
+* Check for reserved words
+*/
+   if (strcmp(name, builtin) == 0) {
+   errno = EINVAL;
+   return -1;
+   }
+
+   /*
 * search if variable with this name already exists
 */
for (nxt = env = environment.data; *env; env = nxt + 1) {
-- 
1.5.4.3

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


Re: [U-Boot] [PATCH] Added arch_lmb_reserve to allow arch specific memory regions protection

2008-10-15 Thread Kumar Gala

On Oct 14, 2008, at 10:16 AM, Kumar Gala wrote:

 Each architecture has different ways of determine what regions of  
 memory
 might not be valid to get overwritten when we boot.  This provides a
 hook to allow them to reserve any regions they care about.  Currently
 only ppc, m68k and sparc need/use this.

 Signed-off-by: Kumar Gala [EMAIL PROTECTED]
 ---
 lib_m68k/bootm.c  |   29 -
 lib_ppc/bootm.c   |   50 +++ 
 +--
 lib_sparc/bootm.c |   16 +---
 3 files changed, 53 insertions(+), 42 deletions(-)

Do not apply this version.. forgot the changes to cmd_bootm.c

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


Re: [U-Boot] [PATCH] Handle environment variables like commands

2008-10-15 Thread Wolfgang Denk
Dear Stefano,

In message [EMAIL PROTECTED] you wrote:
 
  I think this covers only the hush shell version. We need something
  like this instead:
 
 This is not true, I think. The change you are talking about is in hush.c
  (so it must cover *only* the hush shell). The other change is in the
 run_command() function and it is called when CFG_HUSH_PARSER is not
 defined. So both cases are covered.

You are right, of course. I read only part of the patch, it seems.
Sorry ...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Faith: not *wanting* to know what is true.- Friedrich Nietzsche
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] code for DDR

2008-10-15 Thread Fabio Estevam
Kishore,

--- On Wed, 10/15/08, kishore choudhari [EMAIL PROTECTED] wrote:

 From: kishore choudhari [EMAIL PROTECTED]
 Subject: [U-Boot] code for DDR
 To: u-boot@lists.denx.de
 Date: Wednesday, October 15, 2008, 9:26 AM
 Hi all,
  Can i have the bootloader code for DDR ram for
 ARM926EJS
 (ARM9).
 
 thanks in advance.

You should mention which ARM926EJS device and DDR memory you want to use.

Regards,

Fabio Estevam


  
___
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.git

2008-10-15 Thread Wolfgang Denk
Dear Andy Fleming,

In message [EMAIL PROTECTED] you wrote:
 are available in the git repository at:
 
   git://www.denx.de/git/u-boot-mpc85xx.git 85xx-next
 
 Andy Fleming (1):
   Have u-boot pass stashing parameters into device tree
 
 Ed Swarthout (5):
   pixis do not print long help if not configured
   85xx if NUM_CPUS1, print cpu number
   mpc8572 additional end-point mode
   fsl_law clear enable before changing.
   Add cpu/8xxx to TAGS_SUBDIRS
 
 Haiying Wang (6):
   Make DDR interleaving mode work correctly
   Pass dimm parameters to populate populate controller options
   Check DDR interleaving mode
   Add debug information for DDR controller registers
   Add ddr interleaving suppport for MPC8572DS board
   Add DDR options setting on MPC8641HPCN board
 
 Jason Jin (1):
   Enabled the Freescale SGMII riser card on 8536DS
 
 Kumar Gala (3):
   85xx: Export invalidate_{i,d}cache and add flush_dcache
   85xx: Improve flash remapping on MPC8572DS  MPC8536DS
   85xx: Enable interrupt and setexpr commands on Freescale 85xx boards
 
 Liu Yu (2):
   Make pixis_set_sgmii more general to support MPC85xx boards.
   Enabled the Freescale SGMII riser card on 8572DS

Sorry, I get a merge conflict with the SATA code in
board/freescale/mpc8536ds/mpc8536ds.c - can you please rebase your
repo against the current next branch? Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
The project was large enough and management communication poor enough
to prompt many members of the team to see themselves  as  contestants
making  brownie  points,  rather  than as builders making programming
products. Each suboptimized  his  piece  to  meet  his  targets;  few
stopped to think about the total effect on the customer.
  - Fred Brooks, The Mythical Man Month
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/10] Fix IP alignement problem

2008-10-15 Thread Olav Morken
On Wed, Oct 15, 2008 at 07:07, Ben Warren [EMAIL PROTECTED] wrote:
 Hi Olav,

 On Fri, Oct 10, 2008 at 11:53 AM, Olav Morken [EMAIL PROTECTED] wrote:

 On Fri, Oct 10, 2008 at 7:01 PM, Ben Warren [EMAIL PROTECTED]
 wrote:
  What other architectures have you tried this on?

 None, as we don't have any other boards to test on. I do however believe
 that this change should have no side-effects. If any architectures
 relied on this function working as some sort of memory/io barrier, they
 would have problems with other functions such as ArpRequest, which
 doesn't have anything that will work as a memory/io barrier before the
 eth_send function.

 Of course, I could be wrong. I would certainly not suggest including
 this change without some more testing.

 The bug which causes this problem is in avr32-gcc, which makes
 assumptions about the alignement of IP_t when using volatile, and this
 change shouldn't be necessary once that bug is fixed. Until that bug
 is fixed, this change is needed for anyone trying to run U-Boot on
 this microcontroller.

 I don't mean to be a pain, it's just that this code is shared by everything,
 so we need to be really careful.  I agree with Haavard that the volatile
 keyword is probably used much more than it should be in the networking
 library.

 I'll pull this into the net/testing branch in the next couple of days, and
 hopefully we'll get some volunteers to try it out on different
 architectures.

That is great.

FWIW: I have now tested it in qemu_mips, where it appears to work. (Had
to revert qemu-mips.h: Add CFI support before I could test it.)

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


[U-Boot] [PATCH][for v2008.10] 85xx: Fix compile warning

2008-10-15 Thread Kumar Gala
mpc8536ds.c: In function 'is_sata_supported':
mpc8536ds.c:614: warning: unused variable 'devdisr'

Signed-off-by: Kumar Gala [EMAIL PROTECTED]
---
 board/freescale/mpc8536ds/mpc8536ds.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/board/freescale/mpc8536ds/mpc8536ds.c 
b/board/freescale/mpc8536ds/mpc8536ds.c
index 3066b24..2648942 100644
--- a/board/freescale/mpc8536ds/mpc8536ds.c
+++ b/board/freescale/mpc8536ds/mpc8536ds.c
@@ -611,7 +611,6 @@ get_board_ddr_clk(ulong dummy)
 int is_sata_supported(void)
 {
volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
-   uint devdisr = gur-devdisr;
uint sdrs2_io_sel =
(gur-pordevsr  MPC85xx_PORDEVSR_SRDS2_IO_SEL)  27;
if (sdrs2_io_sel  0x04)
-- 
1.5.5.1

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


Re: [U-Boot] [PATCH] Handle environment variables like commands

2008-10-15 Thread Petri Lehtinen
On Wed, Oct 15, 2008 at 12:09:44PM +0200, Stefano Babic wrote:
 The command interpreter checks always if an environment variable
 for that name exists and in this case the content of the variable
 is executed. It becomes possible to redefine all U-Boot commands.
 A new builtin command is added to be able to run builtin U-boot commands
 even if they are redefined.
 
 Signed-off-by : Stefano Babic [EMAIL PROTECTED]
 ---

It seems to me that the builtin command itself can still be
redefined. Is this an issue?

-- 
Petri Lehtinen
Software Specialist
Inoi Oy
Tel. : +358 40 758 0229
Email: [EMAIL PROTECTED]
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 13/16] I2C: adding new i2c bus Command to the I2C Subsystem.

2008-10-15 Thread Ben Warren
Heiko Schocher wrote:
 With this Command it is possible to add new I2C Busses,
 which are behind 1 .. n I2C Muxes. Details see README.
   
While this is pretty cool, I'm curious what circumstances lead to 
needing to add I2C buses at run-time via command line.  Presumably you 
have a real business need for this in a bootloader?

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


Re: [U-Boot] [PATCH] Handle environment variables like commands

2008-10-15 Thread Wolfgang Denk
Dear Petri Lehtinen,

In message [EMAIL PROTECTED] you wrote:

  The command interpreter checks always if an environment variable
  for that name exists and in this case the content of the variable
  is executed. It becomes possible to redefine all U-Boot commands.
  A new builtin command is added to be able to run builtin U-boot commands
  even if they are redefined.
...
 It seems to me that the builtin command itself can still be
 redefined. Is this an issue?

Good catch. Yes, this must be prevented. Any variable named builtin
must be ignored here - i. e. we should issue  an  erro  when  someone
tries  a  setenv, and ignore this variable explicitly (just in case
someone sneaks this into the default environment,  or  uses  un-fixed
Linux tools to create such a variable).

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Objects in mirror are closer than they appear.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] non-needed objects added to resulting U-Boot image

2008-10-15 Thread Wolfgang Denk
Dear Roman Mashak,

In message [EMAIL PROTECTED] you wrote:
 
  These libraries may be used in the link command of your image, but do
  you actually see any unused objects included in your linked image?
 LIBS in Makefile incorporates all drivers, file systems etc., so
 'make' command traverses through out the source tree and builds (in
 many cases the binaries contain only debug information). Isn't it
 reasonable to add a few variables, say in $(uboot)/config_user.mk,
 which will more precisely define what to build. Further,

Um... you didn't follow what's been going on in the Makefiles in the
last months, have you?

 It may slightly speed up a building process.

This is already being worked on, just differently (using kconfig
style).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
...computer hardware progress is so fast. No other  technology  since
civilization  began  has seen six orders of magnitude in performance-
price gain in 30 years. - Fred Brooks, Jr.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Handle environment variables like commands

2008-10-15 Thread stefano babic
Wolfgang Denk wrote:

 If I had known it's suffcient to put ideas on  a  web  page  to  have
 people  put  them  into  code  I  would  have started doing this much
 earlier :-)

That's a good idea ;).

 I think this covers only the hush shell version. We need something
 like this instead:

This is not true, I think. The change you are talking about is in hush.c
 (so it must cover *only* the hush shell). The other change is in the
run_command() function and it is called when CFG_HUSH_PARSER is not
defined. So both cases are covered.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: [EMAIL PROTECTED]
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Automatic software updates in U-Boot -- version 2

2008-10-15 Thread Bartlomiej Sieka
Wolfgang Denk wrote:
 Dear Bartlomiej,
 
 in message [EMAIL PROTECTED] you wrote:
 Seems that the bulk of the feature didn't make it into the 'next'
 branch. Commit 'Automatic software update from TFTP server' on the
 branch (b830abed) shows only the following files modified:

 common/Makefile

 Whereas the patch posted to the list ('[PATCH v2 5/6] Automatic software
 update from TFTP server') has the following diffstat:

   README  |   12 ++
   common/Makefile |1 +
   common/main.c   |7 +
   common/update.c |  315 
 +++
   doc/README.update   |   90 +++
   doc/uImage.FIT/update3.its  |   41 +
   doc/uImage.FIT/update_uboot.its |   21 +++
   7 files changed, 487 insertions(+), 0 deletions(-)
   create mode 100644 common/update.c
   create mode 100644 doc/README.update
   create mode 100644 doc/uImage.FIT/update3.its
   create mode 100644 doc/uImage.FIT/update_uboot.its

 The above changes and newly added files associated with the feature are
 not present in the tree.

 Other commits needed for the auto-update feature are present on the
 'next' branch and look OK.
 
 I think I understand what happened, and fixed it.
 
 Please check again.

Checked -- the 'next' branch has all the commits needed for the
auto-update feature, and the feature itself works as expected.

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


Re: [U-Boot] [PATCH] [POWERPC] remove compilerwarning in lib_ppc_board.c

2008-10-15 Thread Wolfgang Denk
Dear Heiko Schocher,

In message [EMAIL PROTECTED] you wrote:
 
 compiling actual u-boot-next branch for a powerpc board,
 shows following warning:
 
 [EMAIL PROTECTED] u-boot]$ make -s all
 board.c:639: warning: function declaration isn't a prototype
 board.c:646: warning: function declaration isn't a prototype
 [EMAIL PROTECTED] u-boot]$
...
 This patch solves the warning. Jason, can you please try it, and give
 your okay for this fix?

I was just looking for a fix for the same issue, so I just checked it
in :-)

Thanks!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Good manners are the settled  medium  of  social,  as  specie  is  of
commercial, life; returns are equally expected for both.
   - Lord Chesterfield _Letters to his Son_, 25 December 1753
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH/RFC] Some speed improvements to U-Boot JFFS2 code

2008-10-15 Thread Ilya Yanok
Hi Wolfgang,

Wolfgang Denk wrote:
 here is a set of changes we made to improve U-Boot JFFS2 code
 performance. We still can't reach Linux's performance but improvements
 are significant.

 Any comments are welcome.
 

 Are these patches independent of each  other,  or  are  all  of  them
 needed,  and if so, is there any specific order in which they have to
 be applied?
   
Argh... I forgot to create patches with xxx/nnn notation...
Here is the order of patches:
0001-jffs2-add-sector_size-field-to-part_info-structure.patch
0002-jffs2-rewrite-jffs2-scanning-code-based-on-Linux-on.patch
0003-jffs2-summary-support.patch
0004-jffs2-fix-searching-for-latest-version-in-jffs2_1pa.patch
0005-jffs2-add-buffer-to-cache-flash-accesses.patch
0006-jffs2-cache-data_crc-results.patch

It's the order of changes in my tree and thus it's the simplest way to
apply this patches. But actual dependencies are as follows:
0001 and 0004 don't depend on anything
0002 depends on 0001
0003, 0005 and 0006 depend on 0002

Regards, Ilya.

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


Re: [U-Boot] [PATCH] Handle environment variables like commands

2008-10-15 Thread Wolfgang Denk
Dear Stefano,

In message [EMAIL PROTECTED] you wrote:
 Wolfgang Denk wrote:
 
  Good catch. Yes, this must be prevented. Any variable named builtin
  must be ignored here - i. e. we should issue  an  erro  when  someone
  tries  a  setenv, and ignore this variable explicitly (just in case
  someone sneaks this into the default environment,  or  uses  un-fixed
  Linux tools to create such a variable).
 
 I know, I wanted to know which is the preferred method to avoid that.
 One way is to avoid to set the variable, as you suggest.
 The other way is never execute a variable with the name builtin in the
 command interpreter: setenv builtin something remains possible but
 builtin command calls always the U-Boot commands.

We should do both: avoid that the variable gets set, and raise  error
messages  (both  in setenv() and in the fw_setenv Linux tool), but we
should also be defensive and never execute  it  if  we  run  into  it
(which  could  for  example  happen  if we're being poresented an old
environment where some user defined such a variable).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
You said you  didn't  want  to  use  CGI.pm,  but  methinks  you  are
needlessly reinventing the wheel, one spoke at a time. Either you are
masochistic,  or  you  just haven't seen enough of what CGI.pm can do
for you. -- Randal L. Schwartz in [EMAIL PROTECTED]
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/16] updates for mgcoge, mgsuvd.

2008-10-15 Thread Wolfgang Denk
Dear Heiko Schocher,

In message [EMAIL PROTECTED] you wrote:
 The following patchseries updates the mgcoge
 and mgsuvd board with new features:
 
 - fixes some codingstyle issues
 - add I2C support
 - add LM75, EEprom support
 - uses I2C Multibus feature
 - add new I2C Bus command for adding new I2C
   busses behind 1..n I2C mux(es).
 - This Manufacturer uses a I2C deblocking
   mechanism, which was developed with Atmel.
   This patchseries introduce this as a
   boardspecific deblocking algorithm. Maybe
   it is good for a common deblocking mechanism?
 - analyse some information contained in the
   EEProm and saves this information in hush shell
   variables.
 - adds bootcount feature
 
 Also I did a lot of rework of the patches, because
 my First post of this patchseries was not optimal.
 
 Signed-off-by: Heiko Schocher [EMAIL PROTECTED]

All patches applied to next branch.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
I know engineers. They love to change things. - Dr. McCoy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] code for DDR

2008-10-15 Thread kishore choudhari
Hi all,
 Can i have the bootloader code for DDR ram for ARM926EJS
(ARM9).

thanks in advance.


regards,
kishore
___
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.git

2008-10-15 Thread Kumar Gala

On Oct 15, 2008, at 4:31 AM, Wolfgang Denk wrote:

 Dear Andy Fleming,

 In message [EMAIL PROTECTED]  
 you wrote:
 are available in the git repository at:

  git://www.denx.de/git/u-boot-mpc85xx.git 85xx-next

 Andy Fleming (1):
  Have u-boot pass stashing parameters into device tree

 Ed Swarthout (5):
  pixis do not print long help if not configured
  85xx if NUM_CPUS1, print cpu number
  mpc8572 additional end-point mode
  fsl_law clear enable before changing.
  Add cpu/8xxx to TAGS_SUBDIRS

 Haiying Wang (6):
  Make DDR interleaving mode work correctly
  Pass dimm parameters to populate populate controller options
  Check DDR interleaving mode
  Add debug information for DDR controller registers
  Add ddr interleaving suppport for MPC8572DS board
  Add DDR options setting on MPC8641HPCN board

 Jason Jin (1):
  Enabled the Freescale SGMII riser card on 8536DS

 Kumar Gala (3):
  85xx: Export invalidate_{i,d}cache and add flush_dcache
  85xx: Improve flash remapping on MPC8572DS  MPC8536DS
  85xx: Enable interrupt and setexpr commands on Freescale 85xx  
 boards

 Liu Yu (2):
  Make pixis_set_sgmii more general to support MPC85xx boards.
  Enabled the Freescale SGMII riser card on 8572DS

 Sorry, I get a merge conflict with the SATA code in
 board/freescale/mpc8536ds/mpc8536ds.c - can you please rebase your
 repo against the current next branch? Thanks.

Andy, when you do this, fix:

Applying Have u-boot pass stashing parameters into device tree
.dotest/patch:32: space before tab in indent.
fdt_add_enet_stashing(blob);
warning: 1 line adds whitespace errors.

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


Re: [U-Boot] [PATCH] Expose command table search for sub-commands

2008-10-15 Thread Wolfgang Denk
Dear Kumar Gala,

In message [EMAIL PROTECTED] you wrote:
 Sub-command can benefit from using the same table and search functions
 that top level commands have.  Expose this functionality by refactoring
 find_cmd() and introducing find_cmd_tbl() that sub-command processing
 can call.
 
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]
 ---
  common/command.c  |   14 ++
  include/command.h |7 +++
  2 files changed, 17 insertions(+), 4 deletions(-)

Applied to next branch. Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
All easy problems have already been solved.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 3/6] i.MX31: Add basic support for Freescale's i.MX31 PDK board.

2008-10-15 Thread Alan Carvalho de Assis
Hi Jean-Christophe,

On Mon, Oct 13, 2008 at 5:49 AM, Jean-Christophe PLAGNIOL-VILLARD
[EMAIL PROTECTED] wrote:
 Is there any special reason it was not added to the master branch
 yet?


 As we discuss on IRC this board will be merge when it can boot from a storage


Using some patches I sent we can boot it from storage, even without
the MTD NAND driver.

 Best Regards,
 J.

Regards,

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


[U-Boot] [PATCH] Handle environment variables like commands

2008-10-15 Thread Stefano Babic
The command interpreter checks always if an environment variable
for that name exists and in this case the content of the variable
is executed. It becomes possible to redefine all U-Boot commands.
A new builtin command is added to be able to run builtin U-boot commands
even if they are redefined.

Signed-off-by : Stefano Babic [EMAIL PROTECTED]
---
 common/hush.c |9 -
 common/main.c |   37 +
 2 files changed, 45 insertions(+), 1 deletions(-)

diff --git a/common/hush.c b/common/hush.c
index 093c428..68f8a6a 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1677,9 +1677,16 @@ static int run_pipe_real(struct pipe *pi)
child-argv[i]);
return -1;
}
-   /* Look up command in command table */
 
+   /* Check if exists a variable with that name */
+   if ((p = getenv (child-argv[i])) != NULL )  {
+   int rcode;
+   rcode = (parse_string_outer(p,
+   FLAG_PARSE_SEMICOLON | 
FLAG_EXIT_FROM_LOOP) != 0);
+   return rcode;
+   }
 
+   /* Look up command in command table */
if ((cmdtp = find_cmd(child-argv[i])) == NULL) {
printf (Unknown command '%s' - try 'help'\n, 
child-argv[i]);
return -1;  /* give up after bad command */
diff --git a/common/main.c b/common/main.c
index c06ea07..b101b4f 100644
--- a/common/main.c
+++ b/common/main.c
@@ -1289,6 +1289,7 @@ int run_command (const char *cmd, int flag)
int argc, inquotes;
int repeatable = 1;
int rc = 0;
+   char *runenv;
 
 #ifdef DEBUG_PARSER
printf ([RUN_COMMAND] cmd[%p]=\, cmd);
@@ -1357,6 +1358,13 @@ int run_command (const char *cmd, int flag)
continue;
}
 
+   if ((runenv = getenv (argv[0])) != NULL )  {
+   if (run_command(runenv,flag) == -1) {
+   rc = -1;
+   }
+   continue;
+   }
+
/* Look up command in command table */
if ((cmdtp = find_cmd(argv[0])) == NULL) {
printf (Unknown command '%s' - try 'help'\n, argv[0]);
@@ -1433,3 +1441,32 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char 
*argv[])
return 0;
 }
 #endif
+
+int do_builtin (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+   int i;
+
+   if (argc  2) {
+   printf (Usage:\n%s\n, cmdtp-usage);
+   return 1;
+   }
+
+   /* Look up command in command table */
+   if ((cmdtp = find_cmd(argv[1])) == NULL) {
+   printf (Unknown builtin command '%s' - try 'help'\n, argv[1]);
+   return 1;
+   }
+
+   /* Remove builtin from arg list */
+   argc--;
+
+   /* OK - call function to do the command */
+   if ((cmdtp-cmd) (cmdtp, flag, argc, argv[1]) != 0) {
+   return 1;
+   }
+}
+
+U_BOOT_CMD(
+   builtin,CFG_MAXARGS,1,  do_builtin,
+   builtin - run builtin commands\n,
+);
-- 
1.5.4.3

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


Re: [U-Boot] [83xx] [RFC] Widening the scope of u-boot/cpu/mpc83xx/cpu.c : upmconfig

2008-10-15 Thread Kim Phillips
On Wed, 15 Oct 2008 17:35:39 -0400
richardretanubun [EMAIL PROTECTED] wrote:

 Two questions:
 1. Can the CONFIG_MPC834X limitation be relaxed? (I am using an MPC8360E), If 
 so, what should it be? CONFIG_83XX?
 2. Can the #else action be changed from a printf to a #error? Something like 
 this, maybe?
 
 #else
 #error upmconfig function not defined for this configuration.
 #endif
 
 This alerts earlier during compile and not a hang during run time.
 
 Please let me know what you think and I can submit a patch for it.

I think upmconfig code should be common for 83xx, 85xx, and 86xx and
put in a common area such as cpu/mpc8xxx once and for all.

but for now we (mpc83xx) can lose the #ifdef completely.

Patches addressing either of the above are welcome :).

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


Re: [U-Boot] [PATCH] Align end of bss by 4 bytes.

2008-10-15 Thread Trent Piepho
On Thu, 16 Oct 2008, Selvamuthukumar wrote:
 Most of the bss initialization loop increments 4 bytes
 at a time. And the loop end is checked for an 'equal'
 condition. Make the bss end address aligned by 4, so
 that the loop will end as expected.

It's not really the end of bss that matters, but the alignment of the symbol
that is being used in the code that clears bss, e.g. _end or _bss_end or
whatever.

On Thu, 16 Oct 2008, Dan Malek wrote:
 for equal and make these assumptions.  The code should
 be corrected to determine the proper size of the bss
 space and zero accordingly or at least test for
 greater than or equal.

Just changing the test isn't really enough, it's necessary to also support
writing less than 4 bytes at once to get the tail correct.  This appears to be
usually written in asm, so it's not to keep is simple.  For exanple, is
already a patch for ppc4xx that does this:

commit 42ed33ffe135f618680f9d6e9712eb35a85bcb62
Author: Anatolij Gustschin [EMAIL PROTECTED]
Date:   Wed Dec 5 17:43:20 2007 +0100

  Fix ppc4xx clear_bss() code

  ppc4xx clear_bss() fails if BSS segment size is not
  divisible by 4 without remainder. This patch provides
  fix for this problem.

This patch is rather more complex that just adding an ALIGN(4) to the linker
script.

I noticed some errors in this patch:

 +++ b/board/AtmarkTechno/suzaku/u-boot.lds
 @@ -62,6 +62,7 @@ SECTIONS
   __bss_start = .;
   *(.bss)
   __bss_end = .;
 + . = ALIGN(4);

Does this board use __bss_end for it's clear code?  If so, you should move the
alignemnt up a line.

 +++ b/board/MAI/AmigaOneG3SE/u-boot.lds
 @@ -133,6 +133,7 @@ SECTIONS
*(.dynbss)
*(.bss)
*(COMMON)
 +   . = ALIGN(4);
   }
   _end = ALIGN(4) /*.*/ ;

_end is already aligned, you don't need to patch this one.  Or maybe it should
be changed to say _end = .?

   PROVIDE (end = ALIGN(4) /*.*/);

IMHO, that is ugly, this looks nicer:
PROVIDE(end = _end);

 +++ b/board/atmel/atngw100/u-boot.lds
 @@ -67,6 +67,7 @@ SECTIONS
   .bss : {
   *(.bss)
   *(.bss.*)
 + . = ALIGN(4);
   }
   . = ALIGN(8);
   _end = .;

They already have an align 8

 +++ b/board/atmel/atstk1000/u-boot.lds
 @@ -67,6 +67,7 @@ SECTIONS
   .bss (NOLOAD) : {
   *(.bss)
   *(.bss.*)
 + . = ALIGN(4);
   }
   . = ALIGN(8);
   _end = .;

Same here.

 diff --git a/board/dave/PPChameleonEVB/u-boot.lds 
 b/board/dave/PPChameleonEVB/u-boot.lds
 index e42c76f..289cbc2 100644
 --- a/board/dave/PPChameleonEVB/u-boot.lds
 +++ b/board/dave/PPChameleonEVB/u-boot.lds
 @@ -141,6 +141,7 @@ SECTIONS
*(.dynbss)
*(.bss)
*(COMMON)
 +   . = ALIGN(4);
   }

   ppcenv_assert = ASSERT(.  0x8000, .bss section too big, overlaps 
 .ppcenv section. Please update your confguration: CFG_MONITOR_BASE, 
 CFG_MONITOR_LEN and TEXT_BASE may need to be modified.);
. = 0x8000;
.ppcenv :
{
  common/env_embedded.o(.ppcenv);
}

_end = . ;
PROVIDE (end = .);

If this board uses _end to clear bss, you need to move the alignment to after
the ppcenv section.  Or maybe this board should move _end to before ppcenv? 
Or maybe it doesn't clear bss and _end isn't used?  However it works, what you
have changed isn't correct.

 +++ b/board/earthlcd/favr-32-ezkit/u-boot.lds
 @@ -65,6 +65,7 @@ SECTIONS
   .bss (NOLOAD) : {
   *(.bss)
   *(.bss.*)
 + . = ALIGN(4);
   }
   . = ALIGN(8);
   _end = .;

Already has align 8.

 +++ b/board/esd/tasreg/u-boot.lds
 @@ -139,6 +139,7 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
_ebss = .;
 +   . = ALIGN(4);
   }
   _end = . ;
   PROVIDE (end = .);

Already has an align, doesn't need another.

 +++ b/board/genietv/u-boot.lds
 @@ -133,6 +133,7 @@ SECTIONS
*(.dynbss)
*(.bss)
*(COMMON)
 +   . = ALIGN(4);
   }
   . = ALIGN(256 * 1024);
   .ppcenv :

Already has alignment.  There is also no symbol like _end between bss and
ppcenv, so this board probably doesn't clear bss.

 +++ b/board/hymod/u-boot.lds
 @@ -136,6 +136,7 @@ SECTIONS
*(.dynbss)
*(.bss)
*(COMMON)
 +   . = ALIGN(4);
   }
   . = ALIGN(256 * 1024);
   .ppcenv :

Same as genietv

 +++ b/board/sh7763rdp/u-boot.lds
 @@ -98,6 +98,7 @@ SECTIONS
   {
   *(.bss)
   . = ALIGN(4);
 + . = ALIGN(4);
   }
   PROVIDE (bss_end = .);

Already has alignment.

 +++ b/board/ssv/adnpesc1/u-boot.lds
 @@ -64,6 +64,7 @@ SECTIONS
   .bss (NOLOAD) :
   {
   *(.bss)
 + . = ALIGN(4);
   }
   . = ALIGN(4);
   __bss_end = .;

Already has alignment.  Maybe delete the second one?

 +++ b/board/xilinx/ml401/u-boot.lds
 @@ -62,6 +62,7 @@ SECTIONS
   __bss_start = .;
   *(.bss)
   __bss_end = .;
 + . = ALIGN(4);
   }
   __end = . ;
 }


[U-Boot] GPIO configuration on 460EX

2008-10-15 Thread Felix Radensky
Hi,

I'm looking at GPIO setup code for Canyonlands, and
it looks like some initializations mentioned in the 460EX
manual are missing. When pin is configured as alternate
input, the corresponding bits in TSRL/H registers should
be set. U-Boot code sets TSRL/H registers only for output
pins.

Am I missing something ?

Thanks a lot.

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


Re: [U-Boot] [PATCH] Align end of bss by 4 bytes.

2008-10-15 Thread Selvamuthukumar
Trent Piepho,

On Thu, Oct 16, 2008 at 4:09 AM, Trent Piepho [EMAIL PROTECTED] wrote:
 commit 42ed33ffe135f618680f9d6e9712eb35a85bcb62
 Author: Anatolij Gustschin [EMAIL PROTECTED]
 Date:   Wed Dec 5 17:43:20 2007 +0100

  Fix ppc4xx clear_bss() code

  ppc4xx clear_bss() fails if BSS segment size is not
  divisible by 4 without remainder. This patch provides
  fix for this problem.

 This patch is rather more complex that just adding an ALIGN(4) to the linker
 script.

 I noticed some errors in this patch:


Thanks for the review. I'll fix the errors and send v2 of this patch.

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