Re: [U-Boot] [PATCH 01/11] i2c: Clean drivers/i2c/ Makefile

2008-08-19 Thread Michal Simek
Hi Wolfgang,

the patches are older and progress in U-BOOT is too big. That's why some patches
contains faults. And you applied some patches from Jean-Christophe before these
which fixed the same issue.

In driver folder only pcmcia and usb need some fix in Makefile.

Regards,
Michal


 Dear [EMAIL PROTECTED],
 
 In message [EMAIL PROTECTED] you wrote:
 From: Michal Simek [EMAIL PROTECTED]


 Signed-off-by: Michal Simek [EMAIL PROTECTED]
 ---
  drivers/i2c/Makefile   |   10 +-
  drivers/i2c/fsl_i2c.c  |2 --
  drivers/i2c/mxc_i2c.c  |2 +-
  drivers/i2c/omap1510_i2c.c |4 
  drivers/i2c/omap24xx_i2c.c |4 
  drivers/i2c/tsi108_i2c.c   |2 --
  6 files changed, 6 insertions(+), 18 deletions(-)
 
 Applied, thanks.
 
 Best regards,
 
 Wolfgang Denk
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot-Users] [PATCH v4] Add MIMC200 board

2008-08-19 Thread Haavard Skinnemoen
Wolfgang Denk [EMAIL PROTECTED] wrote:
 Dear Haavard,
 
 in message [EMAIL PROTECTED] you wrote:
  The MIMC200 board is based on Atmel's NGW100 dev kit, but with an extra 
  8MByte FLASH and 128KByte FRAM.
  ---
   CREDITS   |4 +
   MAINTAINERS   |4 +
   MAKEALL   |1 +
   Makefile  |3 +
   board/mimc/mimc200/Makefile   |   40 
   board/mimc/mimc200/config.mk  |3 +
   board/mimc/mimc200/mimc200.c  |  209 
  +
   board/mimc/mimc200/u-boot.lds |   73 ++
   include/configs/mimc200.h |  177 ++
   10 files changed, 519 insertions(+), 0 deletions(-)
 
 I guess this is sitting on your queue, and I will see a pull request
 soon?

Still waiting for a signed-off-by. But you will see a pull request soon
regardless.

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


Re: [U-Boot] [new uImage] Cleanup cmd_bootm.c

2008-08-19 Thread Wolfgang Denk
Dear Marian,

in commit 1ee1180b you added code to common/cmd_bootm.c which uses the
env_get_char() function. By then, this went through unnoticed.

I'm sorry, but env_get_char() is a function that is internal  to  the
environment  handling  code.  It  is  not  supposed to be exported to
arbitrary  code.  Please  do  not  make  any  assumptions  about  the
internals of how the environment is stored.

Could you please provide a cleanup patch?

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]
There's only one way to have a happy marriage and as soon as I learn
what it is I'll get married again.  - Clint Eastwood
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Mailing List Archive

2008-08-19 Thread Wolfgang Denk
Hi everybody,

the complete combined archive of the old u-boot-users mailing list at
SourceForge and the new u-boot list at DENX is now available at
http://lists.denx.de/pipermail/u-boot/

Enjoy!

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]
Few people do business well who do nothing else.
   -- Philip Earl of Chesterfield
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v8] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t

2008-08-19 Thread Kumar Gala
Move to using the environment variables 'ethaddr', 'eth1addr', etc..
instead of bd-bi_enetaddr, bi_enet1addr, etc.

This makes the code a bit more flexible to the number of ethernet
interfaces.

Signed-off-by: Kumar Gala [EMAIL PROTECTED]
---

Bump the array sizes to cover a vast number of ethernet mac addresses
at Wolfgang's request.

- k

 common/fdt_support.c  |   68 +++-
 cpu/74xx_7xx/cpu.c|2 +-
 cpu/mpc512x/cpu.c |2 +-
 cpu/mpc8260/cpu.c |2 +-
 cpu/mpc83xx/fdt.c |2 +-
 cpu/mpc85xx/fdt.c |2 +-
 cpu/mpc86xx/fdt.c |2 +-
 cpu/mpc8xx/fdt.c  |2 +-
 cpu/ppc4xx/fdt.c  |2 +-
 include/fdt_support.h |2 +-
 10 files changed, 36 insertions(+), 50 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 93b144e..e57ac0a 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -368,55 +368,41 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size)
return 0;
 }
 
-#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
-defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
-
-void fdt_fixup_ethernet(void *fdt, bd_t *bd)
+void fdt_fixup_ethernet(void *fdt)
 {
-   int node;
+   int node, i, j;
+   char enet[16], *tmp, *end;
+   char mac[16] = ethaddr;
const char *path;
+   unsigned char mac_addr[6];
 
node = fdt_path_offset(fdt, /aliases);
-   if (node = 0) {
-#if defined(CONFIG_HAS_ETH0)
-   path = fdt_getprop(fdt, node, ethernet0, NULL);
-   if (path) {
-   do_fixup_by_path(fdt, path, mac-address,
-   bd-bi_enetaddr, 6, 0);
-   do_fixup_by_path(fdt, path, local-mac-address,
-   bd-bi_enetaddr, 6, 1);
-   }
-#endif
-#if defined(CONFIG_HAS_ETH1)
-   path = fdt_getprop(fdt, node, ethernet1, NULL);
-   if (path) {
-   do_fixup_by_path(fdt, path, mac-address,
-   bd-bi_enet1addr, 6, 0);
-   do_fixup_by_path(fdt, path, local-mac-address,
-   bd-bi_enet1addr, 6, 1);
-   }
-#endif
-#if defined(CONFIG_HAS_ETH2)
-   path = fdt_getprop(fdt, node, ethernet2, NULL);
-   if (path) {
-   do_fixup_by_path(fdt, path, mac-address,
-   bd-bi_enet2addr, 6, 0);
-   do_fixup_by_path(fdt, path, local-mac-address,
-   bd-bi_enet2addr, 6, 1);
+   if (node  0)
+   return;
+
+   i = 0;
+   while ((tmp = getenv(mac)) != NULL) {
+   sprintf(enet, ethernet%d, i);
+   path = fdt_getprop(fdt, node, enet, NULL);
+   if (!path) {
+   debug(No alias for %s\n, enet);
+   sprintf(mac, eth%daddr, ++i);
+   continue;
}
-#endif
-#if defined(CONFIG_HAS_ETH3)
-   path = fdt_getprop(fdt, node, ethernet3, NULL);
-   if (path) {
-   do_fixup_by_path(fdt, path, mac-address,
-   bd-bi_enet3addr, 6, 0);
-   do_fixup_by_path(fdt, path, local-mac-address,
-   bd-bi_enet3addr, 6, 1);
+
+   for (j = 0; j  6; j++) {
+   mac_addr[j] = tmp ? simple_strtoul(tmp, end, 16) : 0;
+   if (tmp)
+   tmp = (*end) ? end+1 : end;
}
-#endif
+
+   do_fixup_by_path(fdt, path, mac-address, mac_addr, 6, 0);
+   do_fixup_by_path(fdt, path, local-mac-address,
+   mac_addr, 6, 1);
+
+   sprintf(mac, eth%daddr, ++i);
}
 }
-#endif
 
 #ifdef CONFIG_HAS_FSL_DR_USB
 void fdt_fixup_dr_usb(void *blob, bd_t *bd)
diff --git a/cpu/74xx_7xx/cpu.c b/cpu/74xx_7xx/cpu.c
index ea43c9a..c007abc 100644
--- a/cpu/74xx_7xx/cpu.c
+++ b/cpu/74xx_7xx/cpu.c
@@ -314,7 +314,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 
fdt_fixup_memory(blob, (u64)bd-bi_memstart, (u64)bd-bi_memsize);
 
-   fdt_fixup_ethernet(blob, bd);
+   fdt_fixup_ethernet(blob);
 }
 #endif
 /* - */
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
index 703e188..1f39ac4 100644
--- a/cpu/mpc512x/cpu.c
+++ b/cpu/mpc512x/cpu.c
@@ -191,7 +191,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #endif
ft_clock_setup(blob, bd);
 #ifdef CONFIG_HAS_ETH0
-   fdt_fixup_ethernet(blob, bd);
+   fdt_fixup_ethernet(blob);
 #endif
 }
 #endif
diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c
index 4d5d141..efb8ed6 100644
--- a/cpu/mpc8260/cpu.c
+++ b/cpu/mpc8260/cpu.c
@@ -307,7 +307,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
 
 #if defined(CONFIG_HAS_ETH0) || 

Re: [U-Boot] [PATCH 1/3] [RFC] Add support for early serial debugconsole

2008-08-19 Thread Ken.Fuchs
 It's weekend, and not many people are active now. Let's  wait  for  a
 few  more  days  if  anybody  shows  up with arguments to support your
 patches.

In my opinion, the serial device should be the first device
initialized and utilized before all other devices where that
is possible.  For example, it would be very useful to have
serial output while debugging RAM initialization.  An early
serial port prior to U-Boot relocating itself would be very
useful for porting U-Boot to new boards.

An early debug serial port would be a good candidate for
mainline U-Boot:

CONFIG_DEBUG_EARLY_SERIAL has been implemented in a few forks
of U-Boot.

I also favor an early serial debug console as advocated by this
patch, but perhaps its code should be self contained.  I'm not
sure it is a good idea to modify some commands so they can be
run before RAM relocation.  If such a thing can be done simply,
it should be done for all commands.

Is the patch submitted clean enough?  No, the implementation
could be improved with some effort; a few #if - #else - #endif
clauses could be eliminated for example.

Would an easier to maintain implementation even be feasible?

I agree that a JTAG debugger is extremely useful for board
bring-up, but they are very expensive.

I'm strongly in favor of having some early serial functionality
whether in the form of simply being able to send output to the
serial port or having a semi-functional to fully functional shell
prior to RAM relocation.

Sincerely,

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


Re: [U-Boot] [PATCH 1/3] [RFC] Add support for early serial debugconsole

2008-08-19 Thread Scott Wood
[EMAIL PROTECTED] wrote:
 I'm strongly in favor of having some early serial functionality
 whether in the form of simply being able to send output to the
 serial port or having a semi-functional to fully functional shell
 prior to RAM relocation.

We already have the former.

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


[U-Boot] [PATCH] ColdFire: Add FEC Buffer descriptors in SRAM

2008-08-19 Thread Tsi-Chung Liew
From: TsiChung Liew [EMAIL PROTECTED]

Add FEC Buffer descriptors and data buffer in SRAM for
faster execution and access.

Signed-off-by: TsiChung Liew [EMAIL PROTECTED]
---
 drivers/net/mcffec.c |   42 --
 1 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index 6929716..c1349ac 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -66,6 +66,7 @@ struct fec_info_s fec_info[] = {
 0, /* tx Index */
 0, /* tx buffer */
 0, /* initialized flag */
+(struct fec_info_s *)-1,
 },
 #endif
 #ifdef CFG_FEC1_IOBASE
@@ -78,12 +79,17 @@ struct fec_info_s fec_info[] = {
 0, /* duplex and speed */
 0, /* phy name */
 0, /* phy name init */
+#ifdef CFG_FEC_BUF_USE_SRAM
+(cbd_t *)DBUF_LENGTH,  /* RX BD */
+#else
 0, /* RX BD */
+#endif
 0, /* TX BD */
 0, /* rx Index */
 0, /* tx Index */
 0, /* tx buffer */
 0, /* initialized flag */
+(struct fec_info_s *)-1,
 }
 #endif
 };
@@ -106,10 +112,6 @@ extern int mcffec_miiphy_write(char *devname, unsigned 
char addr,
   unsigned char reg, unsigned short value);
 #endif
 
-#ifdef CFG_UNIFY_CACHE
-extern void icache_invalid(void);
-#endif
-
 void setFecDuplexSpeed(volatile fec_t * fecp, bd_t * bd, int dup_spd)
 {
if ((dup_spd  16) == FULL) {
@@ -172,16 +174,22 @@ int fec_send(struct eth_device *dev, volatile void 
*packet, int length)
/* Activate transmit Buffer Descriptor polling */
fecp-tdar = 0x0100;/* Descriptor polling active*/
 
-   /* FEC fix for MCF5275, FEC unable to initial transmit data packet.
+#ifndef CFG_FEC_BUF_USE_SRAM
+   /*
+* FEC unable to initial transmit data packet.
 * A nop will ensure the descriptor polling active completed.
+* CF Internal RAM has shorter cycle access than DRAM. If use
+* DRAM as Buffer descriptor and data, a nop is a must.
+* Affect only V2 and V3.
 */
-#ifdef CONFIG_M5275
__asm__ (nop);
+
 #endif
 
 #ifdef CFG_UNIFY_CACHE
icache_invalid();
 #endif
+
j = 0;
while ((info-txbd[info-txIdx].cbd_sc  BD_ENET_TX_READY) 
   (j  MCFFEC_TOUT_LOOP)) {
@@ -213,6 +221,8 @@ int fec_recv(struct eth_device *dev)
int length;
 
for (;;) {
+#ifndef CFG_FEC_BUF_USE_SRAM
+#endif
 #ifdef CFG_UNIFY_CACHE
icache_invalid();
 #endif
@@ -557,6 +567,9 @@ int mcffec_initialize(bd_t * bis)
 {
struct eth_device *dev;
int i;
+#ifdef CFG_FEC_BUF_USE_SRAM
+   u32 tmp = CFG_INIT_RAM_ADDR + 0x1000;
+#endif
 
for (i = 0; i  sizeof(fec_info) / sizeof(fec_info[0]); i++) {
 
@@ -577,6 +590,18 @@ int mcffec_initialize(bd_t * bis)
dev-recv = fec_recv;
 
/* setup Receive and Transmit buffer descriptor */
+#ifdef CFG_FEC_BUF_USE_SRAM
+   fec_info[i].rxbd = (cbd_t *)((u32)fec_info[i].rxbd + tmp);
+   tmp = (u32)fec_info[i].rxbd;
+   fec_info[i].txbd =
+   (cbd_t *)((u32)fec_info[i].txbd + tmp +
+   (PKTBUFSRX * sizeof(cbd_t)));
+   tmp = (u32)fec_info[i].txbd;
+   fec_info[i].txbuf =
+   (char *)((u32)fec_info[i].txbuf + tmp +
+   (CFG_TX_ETH_BUFFER * sizeof(cbd_t)));
+   tmp = (u32)fec_info[i].txbuf;
+#else
fec_info[i].rxbd =
(cbd_t *) memalign(CFG_CACHELINE_SIZE,
   (PKTBUFSRX * sizeof(cbd_t)));
@@ -585,6 +610,8 @@ int mcffec_initialize(bd_t * bis)
   (TX_BUF_CNT * sizeof(cbd_t)));
fec_info[i].txbuf =
(char *)memalign(CFG_CACHELINE_SIZE, DBUF_LENGTH);
+#endif
+
 #ifdef ET_DEBUG
printf(rxbd %x txbd %x\n,
   (int)fec_info[i].rxbd, (int)fec_info[i].txbd);
@@ -598,7 +625,10 @@ int mcffec_initialize(bd_t * bis)
miiphy_register(dev-name,
mcffec_miiphy_read, mcffec_miiphy_write);
 #endif
+   if (i  0)
+   fec_info[i - 1].next = fec_info[i];
}
+   fec_info[i - 1].next = fec_info[0];
 
/* default speed */
bis-bi_ethspeed = 10;
-- 
1.5.6.3

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


Re: [U-Boot] [PATCH 1/3] [RFC] Add support for early serial debugconsole

2008-08-19 Thread Wolfgang Denk
Dear [EMAIL PROTECTED],

In message [EMAIL PROTECTED] you wrote:

 In my opinion, the serial device should be the first device
 initialized and utilized before all other devices where that
 is possible.  For example, it would be very useful to have

This is exactly how U-Boot was designed. However, we try to do this in
C, and we try to support all kinds of hardware to do so.

 serial output while debugging RAM initialization.  An early
 serial port prior to U-Boot relocating itself would be very
 useful for porting U-Boot to new boards.

We have that, and always had this as long U-Boot and PPCBoot exist.

 Is the patch submitted clean enough?  No, the implementation

The patch itself may be ok, but the concept is broken, and that's why
I reject it.

 I agree that a JTAG debugger is extremely useful for board
 bring-up, but they are very expensive.

Calculate you own time wasted on fruitless attempts to  get  a  board
working  times your hourly rate and you get ... enough money for more
than one BDI3000.

 I'm strongly in favor of having some early serial functionality
 whether in the form of simply being able to send output to the
 serial port or having a semi-functional to fully functional shell
 prior to RAM relocation.

But hey, we *do* have this. We just don't have an interactve shell
prompt.

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]
That Microsoft, the Trabant of the operating  system  world,  may  be
glancing  over the Berlin Wall at the Audis and BMWs and Mercedes. In
their own universe Trabants and Ladas were mainstream too...
   -- Evan Leibovitch
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 6/7] libfdt: Implement fdt_get_property_namelen() and fdt_getprop_namelen()

2008-08-19 Thread gvb . uboot
From: David Gibson [EMAIL PROTECTED]

As well as fdt_subnode_offset(), libfdt includes an
fdt_subnode_offset_namelen() function that takes the subnode name to
look up not as a NUL-terminated string, but as a string with an
explicit length.  This can be useful when the caller has the name as
part of a longer string, such as a full path.

However, we don't have corresponding 'namelen' versions for
fdt_get_property() and fdt_getprop().  There are less obvious use
cases for these variants on property names, but there are
circumstances where they can be useful e.g. looking up property names
which need to be parsed from a longer string buffer such as user input
or a configuration file, or looking up an alias in a path with
IEEE1275 style aliases.

So, since it's very easy to implement such variants, this patch does
so.  The original NUL-terminated variants are, of course, implemented
in terms of the namelen versions.

Signed-off-by: David Gibson [EMAIL PROTECTED]
---
 include/libfdt.h |   30 ++
 libfdt/fdt_ro.c  |   37 ++---
 2 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/include/libfdt.h b/include/libfdt.h
index 0747981..94c35e3 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -343,6 +343,22 @@ int fdt_path_offset(const void *fdt, const char *path);
 const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
 
 /**
+ * fdt_get_property_namelen - find a property based on substring
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @namelen: number of characters of name to consider
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * Identical to fdt_get_property_namelen(), but only examine the first
+ * namelen characters of name for matching the property name.
+ */
+const struct fdt_property *fdt_get_property_namelen(const void *fdt,
+   int nodeoffset,
+   const char *name,
+   int namelen, int *lenp);
+
+/**
  * fdt_get_property - find a given property in a given node
  * @fdt: pointer to the device tree blob
  * @nodeoffset: offset of the node whose property to find
@@ -380,6 +396,20 @@ static inline struct fdt_property *fdt_get_property_w(void 
*fdt, int nodeoffset,
 }
 
 /**
+ * fdt_getprop_namelen - get property value based on substring
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @namelen: number of characters of name to consider
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * Identical to fdt_getprop(), but only examine the first namelen
+ * characters of name for matching the property name.
+ */
+const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
+   const char *name, int namelen, int *lenp);
+
+/**
  * fdt_getprop - retrieve the value of a given property
  * @fdt: pointer to the device tree blob
  * @nodeoffset: offset of the node whose property to find
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 6292a00..d566eba 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -84,6 +84,14 @@ const char *fdt_string(const void *fdt, int stroffset)
return (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
 }
 
+static int _fdt_string_eq(const void *fdt, int stroffset,
+ const char *s, int len)
+{
+   const char *p = fdt_string(fdt, stroffset);
+
+   return (strlen(p) == len)  (memcmp(p, s, len) == 0);
+}
+
 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
 {
FDT_CHECK_HEADER(fdt);
@@ -179,9 +187,10 @@ const char *fdt_get_name(const void *fdt, int nodeoffset, 
int *len)
return NULL;
 }
 
-const struct fdt_property *fdt_get_property(const void *fdt,
-   int nodeoffset,
-   const char *name, int *lenp)
+const struct fdt_property *fdt_get_property_namelen(const void *fdt,
+   int nodeoffset,
+   const char *name,
+   int namelen, int *lenp)
 {
uint32_t tag;
const struct fdt_property *prop;
@@ -214,7 +223,7 @@ const struct fdt_property *fdt_get_property(const void *fdt,
if (! prop)
goto fail;
namestroff = fdt32_to_cpu(prop-nameoff);
-   if (strcmp(fdt_string(fdt, namestroff), name) == 0) {
+   if (_fdt_string_eq(fdt, namestroff, name, namelen)) {
/* Found it! */
int len = 

[U-Boot] [PATCH 0/7] libfdt: Update to resync with dtc/libfdt

2008-08-19 Thread gvb . uboot
The following changesets resynchronize u-boot with the master libfdt.

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


[U-Boot] [PATCH 3/7] libfdt: Increase namespace-pollution paranoia

2008-08-19 Thread gvb . uboot
From: David Gibson [EMAIL PROTECTED]

libfdt is supposed to easy to embed in projects all and sundry.
Often, it won't be practical to separate the embedded libfdt's
namespace from that of the surrounding project.  Which means there can
be namespace conflicts between even libfdt's internal/static functions
and functions or macros coming from the surrounding project's headers
via libfdt_env.h.

This patch, therefore, renames a bunch of libfdt internal functions
and macros and makes a few other chances to reduce the chances of
namespace collisions with embedding projects.  Specifically:
- Internal functions (even static ones) are now named _fdt_*()

- The type and (static) global for the error table in
  fdt_strerror() gain an fdt_ prefix

- The unused macro PALIGN is removed

- The memeq and streq macros are removed and open-coded in the
  users (they were only used once each)

- Other macros gain an FDT_ prefix

- To save some of the bulk from the previous change, an
  FDT_TAGALIGN() macro is introduced, where FDT_TAGALIGN(x) ==
  FDT_ALIGN(x, FDT_TAGSIZE)

Signed-off-by: David Gibson [EMAIL PROTECTED]
---
 libfdt/fdt.c |8 ++--
 libfdt/fdt_ro.c  |   22 
 libfdt/fdt_rw.c  |  121 +++---
 libfdt/fdt_strerror.c|   34 +++---
 libfdt/fdt_sw.c  |   38 +++---
 libfdt/fdt_wip.c |7 ++-
 libfdt/libfdt_internal.h |   11 ++---
 7 files changed, 119 insertions(+), 122 deletions(-)

diff --git a/libfdt/fdt.c b/libfdt/fdt.c
index 18e8d3c..732103b 100644
--- a/libfdt/fdt.c
+++ b/libfdt/fdt.c
@@ -67,7 +67,7 @@ int fdt_check_header(const void *fdt)
return -FDT_ERR_BADVERSION;
if (fdt_last_comp_version(fdt)  FDT_LAST_SUPPORTED_VERSION)
return -FDT_ERR_BADVERSION;
-   } else if (fdt_magic(fdt) == SW_MAGIC) {
+   } else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
/* Unfinished sequential-write blob */
if (fdt_size_dt_struct(fdt) == 0)
return -FDT_ERR_BADSTATE;
@@ -128,7 +128,7 @@ uint32_t fdt_next_tag(const void *fdt, int offset, int 
*nextoffset)
}
 
if (nextoffset)
-   *nextoffset = ALIGN(offset, FDT_TAGSIZE);
+   *nextoffset = FDT_TAGALIGN(offset);
 
return tag;
 }
@@ -188,14 +188,14 @@ const char *_fdt_find_string(const char *strtab, int 
tabsize, const char *s)
const char *p;
 
for (p = strtab; p = last; p++)
-   if (memeq(p, s, len))
+   if (memcmp(p, s, len) == 0)
return p;
return NULL;
 }
 
 int fdt_move(const void *fdt, void *buf, int bufsize)
 {
-   CHECK_HEADER(fdt);
+   FDT_CHECK_HEADER(fdt);
 
if (fdt_totalsize(fdt)  bufsize)
return -FDT_ERR_NOSPACE;
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 1c897c5..326d19c 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -59,8 +59,8 @@
 
 #include libfdt_internal.h
 
-static int nodename_eq(const void *fdt, int offset,
-  const char *s, int len)
+static int _fdt_nodename_eq(const void *fdt, int offset,
+   const char *s, int len)
 {
const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1);
 
@@ -86,7 +86,7 @@ const char *fdt_string(const void *fdt, int stroffset)
 
 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
 {
-   CHECK_HEADER(fdt);
+   FDT_CHECK_HEADER(fdt);
*address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)-address);
*size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)-size);
return 0;
@@ -106,7 +106,7 @@ int fdt_subnode_offset_namelen(const void *fdt, int offset,
 {
int depth;
 
-   CHECK_HEADER(fdt);
+   FDT_CHECK_HEADER(fdt);
 
for (depth = 0;
 offset = 0;
@@ -114,7 +114,7 @@ int fdt_subnode_offset_namelen(const void *fdt, int offset,
if (depth  0)
return -FDT_ERR_NOTFOUND;
else if ((depth == 1)
- nodename_eq(fdt, offset, name, namelen))
+ _fdt_nodename_eq(fdt, offset, name, namelen))
return offset;
}
 
@@ -133,7 +133,7 @@ int fdt_path_offset(const void *fdt, const char *path)
const char *p = path;
int offset = 0;
 
-   CHECK_HEADER(fdt);
+   FDT_CHECK_HEADER(fdt);
 
if (*path != '/')
return -FDT_ERR_BADPATH;
@@ -214,7 +214,7 @@ const struct fdt_property *fdt_get_property(const void *fdt,
if (! prop)
goto fail;
namestroff = fdt32_to_cpu(prop-nameoff);
-   if (streq(fdt_string(fdt, namestroff), name)) {
+   if (strcmp(fdt_string(fdt, namestroff), name) 

Re: [U-Boot] ARTOS support?

2008-08-19 Thread Kumar Gala

On Aug 19, 2008, at 6:05 PM, Wolfgang Denk wrote:

 Dear Kumar Gala,

 In message D4E20F94-9D70-44EE- 
 [EMAIL PROTECTED] you wrote:

 Wolfgang, any issue with just removing ARTOS support (seems like the
 easiest way to fix the env_get_char() issue).

 Which env_get_char() issue are you referring to?

The one in common/cmd_bootm.c, look at do_bootm_artos().

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


[U-Boot] [PATCH 4/7] libfdt: Improve documentation in libfdt.h

2008-08-19 Thread gvb . uboot
From: Wolfram Sang [EMAIL PROTECTED]

Fix a few typos and mistakes.

Signed-off-by: Wolfram Sang [EMAIL PROTECTED]
Acked-by: David Gibson [EMAIL PROTECTED]
---
 include/libfdt.h |   28 ++--
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/libfdt.h b/include/libfdt.h
index 7e043ef..0747981 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -213,7 +213,7 @@ int fdt_move(const void *fdt, void *buf, int bufsize);
 /**/
 
 /**
- * fdt_string - retreive a string from the strings block of a device tree
+ * fdt_string - retrieve a string from the strings block of a device tree
  * @fdt: pointer to the device tree blob
  * @stroffset: offset of the string within the strings block (native endian)
  *
@@ -227,7 +227,7 @@ int fdt_move(const void *fdt, void *buf, int bufsize);
 const char *fdt_string(const void *fdt, int stroffset);
 
 /**
- * fdt_num_mem_rsv - retreive the number of memory reserve map entries
+ * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
  * @fdt: pointer to the device tree blob
  *
  * Returns the number of entries in the device tree blob's memory
@@ -240,7 +240,7 @@ const char *fdt_string(const void *fdt, int stroffset);
 int fdt_num_mem_rsv(const void *fdt);
 
 /**
- * fdt_get_mem_rsv - retreive one memory reserve map entry
+ * fdt_get_mem_rsv - retrieve one memory reserve map entry
  * @fdt: pointer to the device tree blob
  * @address, @size: pointers to 64-bit variables
  *
@@ -320,7 +320,7 @@ int fdt_subnode_offset(const void *fdt, int parentoffset, 
const char *name);
 int fdt_path_offset(const void *fdt, const char *path);
 
 /**
- * fdt_get_name - retreive the name of a given node
+ * fdt_get_name - retrieve the name of a given node
  * @fdt: pointer to the device tree blob
  * @nodeoffset: structure block offset of the starting node
  * @lenp: pointer to an integer variable (will be overwritten) or NULL
@@ -352,7 +352,7 @@ const char *fdt_get_name(const void *fdt, int nodeoffset, 
int *lenp);
  * fdt_get_property() retrieves a pointer to the fdt_property
  * structure within the device tree blob corresponding to the property
  * named 'name' of the node at offset nodeoffset.  If lenp is
- * non-NULL, the length of the property value also returned, in the
+ * non-NULL, the length of the property value is also returned, in the
  * integer pointed to by lenp.
  *
  * returns:
@@ -389,7 +389,7 @@ static inline struct fdt_property *fdt_get_property_w(void 
*fdt, int nodeoffset,
  * fdt_getprop() retrieves a pointer to the value of the property
  * named 'name' of the node at offset nodeoffset (this will be a
  * pointer to within the device blob itself, not a copy of the value).
- * If lenp is non-NULL, the length of the property value also
+ * If lenp is non-NULL, the length of the property value is also
  * returned, in the integer pointed to by lenp.
  *
  * returns:
@@ -415,7 +415,7 @@ static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
 }
 
 /**
- * fdt_get_phandle - retreive the phandle of a given node
+ * fdt_get_phandle - retrieve the phandle of a given node
  * @fdt: pointer to the device tree blob
  * @nodeoffset: structure block offset of the node
  *
@@ -423,7 +423,7 @@ static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
  * structure block offset nodeoffset.
  *
  * returns:
- * the phandle of the node at nodeoffset, on succes (!= 0, != -1)
+ * the phandle of the node at nodeoffset, on success (!= 0, != -1)
  * 0, if the node has no phandle, or another error occurs
  */
 uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
@@ -522,7 +522,7 @@ int fdt_node_depth(const void *fdt, int nodeoffset);
  * structure from the start to nodeoffset, *twice*.
  *
  * returns:
- * stucture block offset of the parent of the node at nodeoffset
+ * structure block offset of the parent of the node at nodeoffset
  * (=0), on success
  * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
  * -FDT_ERR_BADMAGIC,
@@ -579,7 +579,7 @@ int fdt_node_offset_by_prop_value(const void *fdt, int 
startoffset,
  * @fdt: pointer to the device tree blob
  * @phandle: phandle value
  *
- * fdt_node_offset_by_prop_value() returns the offset of the node
+ * fdt_node_offset_by_phandle() returns the offset of the node
  * which has the given phandle value.  If there is more than one node
  * in the tree with the given phandle (an invalid tree), results are
  * undefined.
@@ -806,13 +806,13 @@ int fdt_pack(void *fdt);
 /**
  * fdt_add_mem_rsv - add one memory reserve map entry
  * @fdt: pointer to the device tree blob
- * @addres, @size: 64-bit values (native endian)
+ * @address, @size: 64-bit values (native endian)
  *
  * Adds a reserve map entry to the given blob reserving a region at
  * address address of length size.
  *
  * This function will insert data into the reserve map and will
- * 

[U-Boot] [PATCH 5/7] libfdt: Forgot one function when cleaning the namespace

2008-08-19 Thread gvb . uboot
From: David Gibson [EMAIL PROTECTED]

In commit b6d80a20fc293f3b995c3ce1a6744a5574192125, we renamed all
libfdt functions to be prefixed with fdt_ or _fdt_ to minimise the
chance of collisions with things from whatever package libfdt is
embedded in, pulled into the libfdt build via that environment's
libfdt_env.h.

Except... I missed one.  This patch applies the same treatment to
_stringlist_contains().  While we're at it, also make it static since
it's only used in the same file.

Signed-off-by: David Gibson [EMAIL PROTECTED]
---
 libfdt/fdt_ro.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 326d19c..6292a00 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -412,7 +412,8 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t 
phandle)
 phandle, sizeof(phandle));
 }
 
-int _stringlist_contains(const char *strlist, int listlen, const char *str)
+static int _fdt_stringlist_contains(const char *strlist, int listlen,
+   const char *str)
 {
int len = strlen(str);
const char *p;
@@ -438,7 +439,7 @@ int fdt_node_check_compatible(const void *fdt, int 
nodeoffset,
prop = fdt_getprop(fdt, nodeoffset, compatible, len);
if (!prop)
return len;
-   if (_stringlist_contains(prop, len, compatible))
+   if (_fdt_stringlist_contains(prop, len, compatible))
return 0;
else
return 1;
-- 
1.5.6.3

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


[U-Boot] [PATCH 2/7] dtc: Enable and fix -Wcast-qual warnings

2008-08-19 Thread gvb . uboot
From: David Gibson [EMAIL PROTECTED]

Enabling -Wcast-qual warnings in dtc shows up a number of places where
we are incorrectly discarding a const qualification.  There are also
some places where we are intentionally discarding the 'const', and we
need an ugly cast through uintptr_t to suppress the warning.  However,
most of these are pretty well isolated with the *_w() functions.  So
in the interests of maximum safety with const qualifications, this
patch enables the warnings and fixes the existing complaints.

Signed-off-by: David Gibson [EMAIL PROTECTED]
Acked-by: Gerald Van Baren [EMAIL PROTECTED]
---
 include/libfdt.h |8 
 libfdt/fdt_ro.c  |2 +-
 libfdt/fdt_rw.c  |4 ++--
 libfdt/libfdt_internal.h |7 ---
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/include/libfdt.h b/include/libfdt.h
index 2a2b23d..7e043ef 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -125,7 +125,7 @@
 const void *fdt_offset_ptr(const void *fdt, int offset, int checklen);
 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
 {
-   return (void *)fdt_offset_ptr(fdt, offset, checklen);
+   return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
 }
 
 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
@@ -375,8 +375,8 @@ static inline struct fdt_property *fdt_get_property_w(void 
*fdt, int nodeoffset,
  const char *name,
  int *lenp)
 {
-   return (struct fdt_property *)fdt_get_property(fdt, nodeoffset,
-  name, lenp);
+   return (struct fdt_property *)(uintptr_t)
+   fdt_get_property(fdt, nodeoffset, name, lenp);
 }
 
 /**
@@ -411,7 +411,7 @@ const void *fdt_getprop(const void *fdt, int nodeoffset,
 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
  const char *name, int *lenp)
 {
-   return (void *)fdt_getprop(fdt, nodeoffset, name, lenp);
+   return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
 }
 
 /**
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 8382afd..1c897c5 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -81,7 +81,7 @@ static int nodename_eq(const void *fdt, int offset,
 
 const char *fdt_string(const void *fdt, int stroffset)
 {
-   return (char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
+   return (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
 }
 
 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c
index 4a16014..6837fb1 100644
--- a/libfdt/fdt_rw.c
+++ b/libfdt/fdt_rw.c
@@ -261,7 +261,7 @@ int fdt_set_name(void *fdt, int nodeoffset, const char 
*name)
 
RW_CHECK_HEADER(fdt);
 
-   namep = (char *)fdt_get_name(fdt, nodeoffset, oldlen);
+   namep = (char *)(uintptr_t)fdt_get_name(fdt, nodeoffset, oldlen);
if (!namep)
return oldlen;
 
@@ -436,7 +436,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
/* But if that overlaps with the old tree... */
if (((tmp + newsize)  fdtstart)  (tmp  fdtend)) {
/* Try right after the old tree instead */
-   tmp = (char *)fdtend;
+   tmp = (char *)(uintptr_t)fdtend;
if ((tmp + newsize)  ((char *)buf + bufsize))
return -FDT_ERR_NOSPACE;
}
diff --git a/libfdt/libfdt_internal.h b/libfdt/libfdt_internal.h
index 2ba30db..549e345 100644
--- a/libfdt/libfdt_internal.h
+++ b/libfdt/libfdt_internal.h
@@ -77,19 +77,20 @@ static inline const void *_fdt_offset_ptr(const void *fdt, 
int offset)
 
 static inline void *_fdt_offset_ptr_w(void *fdt, int offset)
 {
-   return (void *)_fdt_offset_ptr(fdt, offset);
+   return (void *)(uintptr_t)_fdt_offset_ptr(fdt, offset);
 }
 
 static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, 
int n)
 {
-   const struct fdt_reserve_entry *rsv_table = (struct fdt_reserve_entry *)
+   const struct fdt_reserve_entry *rsv_table =
+   (const struct fdt_reserve_entry *)
((const char *)fdt + fdt_off_mem_rsvmap(fdt));
 
return rsv_table + n;
 }
 static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
 {
-   return (void *)_fdt_mem_rsv(fdt, n);
+   return (void *)(uintptr_t)_fdt_mem_rsv(fdt, n);
 }
 
 #define SW_MAGIC   (~FDT_MAGIC)
-- 
1.5.6.3

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


Re: [U-Boot] [T-Engine] UBoot configuration for T-Engine/SH7727 MS7727CP02 DevKit

2008-08-19 Thread thaoth

Hi Nobuhiro Iwamatsu,

1. Clock frequency of board.

#define CONFIG_SYS_CLK_FREQ 
#define TMU_CLK_DIVIDER 4   /* 4 (default), 16, 64, 256 or 1024 */
#define CFG_HZ  (CONFIG_SYS_CLK_FREQ / TMU_CLK_DIVIDER)

I don't understand how to set CONFIG_SYS_CLK_FREQ value. From T-Engine
support, they said clock frequency of board is 144MHz.

CPU:   SH7727 144 MHz
Flash ROM: 8000 - 807F : 8 MB (64 KB blk x 128)
   8000 - 8000 : Monitor Area (64 KB)
   8001 - 8001007F : RomInfo Area (128 B)
SDRAM: 8C00 - 8DFF : 32 MB
   8C00 - 8C001FFF : Monitor  System Area (8 KB)

Could I set CFG_HZ to 144?
#define CFG_HZ 144

2. Cross compiler tool chain : GCC vs T-Engine toolchain
There are two tool chains 
-
http://www.superh-linux.org/archive/bsp/sh7721_se/toolchain_sh3_gcc4.2.tar.gz
support elf32-sh-linux target.
- Tool chain from T-Engine forum support elf32-sh-tkernel
Using both cross compilers, we could turn on LED on debug board by setting
correct value LED_A and LED_B value. 

3. ICE or JTAG debugger and LED debugging.
I don't have these debug tools, and so hard for debugging. T-Engine/SH7727
DevKit has debug board with 8 LEDs. I could turn on/off these LEDs by
setting correct value to 0xA160 memory. But  C function turn on/off LED
cannot work. For example

int cpu_init(void)
{
// Turn off LED 1 to notify cpu_init is called.
outw(0x00  0xFF, 0xa160);
return 0;
}

I don't know why it isn't called?

Would you please give me your ideas? Thank you a lot.
Regards,
-- 
View this message in context: 
http://www.nabble.com/-T-Engine--UBoot-configuration-for-T-Engine-SH7727-MS7727CP02-DevKit-tp18868090p19062634.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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