Re: [U-Boot] [PATCH 1/2] Fix OneNAND ipl to read CONFIG_SYS_MONITOR_LEN

2009-04-12 Thread apgmoorthy

Hi Scott, 

On Tuesday, March 31, 2009 4:04 AM Scott Wood Wrote :

Note that there are a couple of board files (apollon and nmdk8815) that use 
the OneNAND loader 
that do not define CONFIG_SYS_MONITOR_LEN.  I've added the maintainers to the 
Cc: list.

CONFIG_SYS_MONITOR_LEN is not defined in include/configs/apollon.h as of now.

This is done by the Post : [U-Boot] [PATCH 2/2] Fix OneNAND ipl to read 
CONFIG_SYS_MONITOR_LEN

What do you feel about getting this one inside u-boot-nand-flash ?

With Regards
  Moorthy

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


[U-Boot] [PATCH v5] [RESEND] Add imls utility command

2009-04-12 Thread Marco
Signed-off-by: Marco Stornelli marco.storne...@gmail.com
---
diff --git a/tools/imls/Makefile b/tools/imls/Makefile
new file mode 100644
index 000..d654658
--- /dev/null
+++ b/tools/imls/Makefile
@@ -0,0 +1,106 @@
+#
+# (C) Copyright 2009 Marco Stornelli marco.storne...@gmail.com
+#
+# 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 $(TOPDIR)/config.mk
+
+HOST_CFLAGS = -Wall -pedantic
+
+# Generated executable files
+BIN_FILES-y += imls
+
+# Source files which exist outside the tools directory
+EXT_OBJ_FILES-y += lib_generic/crc32.o
+EXT_OBJ_FILES-y += lib_generic/md5.o
+EXT_OBJ_FILES-y += lib_generic/sha1.o
+EXT_OBJ_FILES-y += common/image.o
+
+# Source files located in the tools directory
+OBJ_FILES-y += imls.o
+
+# Flattened device tree objects
+LIBFDT_OBJ_FILES-y += fdt.o
+LIBFDT_OBJ_FILES-y += fdt_ro.o
+LIBFDT_OBJ_FILES-y += fdt_rw.o
+LIBFDT_OBJ_FILES-y += fdt_strerror.o
+LIBFDT_OBJ_FILES-y += fdt_wip.o
+
+# now $(obj) is defined
+SRCS   += $(addprefix $(SRCTREE)/,$(EXT_OBJ_FILES-y:.o=.c))
+SRCS   += $(addprefix $(SRCTREE)/tools/,$(OBJ_FILES-y:.o=.c))
+SRCS   += $(addprefix $(SRCTREE)/libfdt/,$(LIBFDT_OBJ_FILES-y:.o=.c))
+BINS   := $(addprefix $(obj),$(sort $(BIN_FILES-y)))
+LIBFDT_OBJS:= $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y))
+
+#
+# Use native tools and options
+# Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
+#
+CPPFLAGS   = -idirafter $(SRCTREE)/include \
+   -idirafter $(OBJTREE)/include2 \
+   -idirafter $(OBJTREE)/include \
+   -I $(SRCTREE)/libfdt \
+   -I $(SRCTREE)/tools \
+   -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES
+CFLAGS = $(HOST_CFLAGS) $(CPPFLAGS) -O
+
+# No -pedantic switch to avoid libfdt compilation warnings
+FIT_CFLAGS = -Wall $(CPPFLAGS) -O
+
+CC= $(CROSS_COMPILER)gcc
+STRIP = $(CROSS_COMPILER)strip
+
+ifeq ($(MTD_VERSION),old)
+CPPFLAGS += -DMTD_OLD
+endif
+
+all:   $(BINS)
+
+$(obj)imls:$(obj)imls.o $(obj)crc32.o $(obj)image.o $(obj)md5.o \
+   $(obj)sha1.o $(LIBFDT_OBJS)
+   $(CC) $(CFLAGS) -o $@ $^
+   $(STRIP) $@
+
+# Some files complain if compiled with -pedantic, use FIT_CFLAGS
+$(obj)image.o: $(SRCTREE)/common/image.c
+   $(CC) -g $(FIT_CFLAGS) -c -o $@ $
+
+$(obj)imls.o: imls.c
+   $(CC) -g $(FIT_CFLAGS) -c -o $@ $
+
+# Some of the tool objects need to be accessed from outside the tools
directory
+$(obj)%.o: $(SRCTREE)/common/%.c
+   $(CC) -g $(FIT_CFLAGS) -c -o $@ $
+
+$(obj)%.o: $(SRCTREE)/lib_generic/%.c
+   $(CC) -g $(CFLAGS) -c -o $@ $
+
+$(obj)%.o: $(SRCTREE)/libfdt/%.c
+   $(CC) -g $(FIT_CFLAGS) -c -o $@ $
+
+clean:
+   rm -rf *.o imls
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/tools/imls/README b/tools/imls/README
new file mode 100644
index 000..63d639d
--- /dev/null
+++ b/tools/imls/README
@@ -0,0 +1,57 @@
+#
+# (C) Copyright 2009 Marco Stornelli marco.storne...@gmail.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# The files in this directory are free software; you can redistribute
+# them and/or modify them 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.
+#
+# These files are distributed in the hope that they 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
+#
+
+IMLS
+-
+
+imls is an implementation of a Linux command line tool to access
+to raw flash partitions and list images made with mkimage command.
+
+For building against older versions of the MTD headers (meaning before
+v2.6.8-rc1) it is required to pass the argument MTD_VERSION=old to
+make.
+
+Usage examples
+--
+
+1) Flash with sectors of 128KiB 

[U-Boot] [PATCH u-boot git] dm9000 EEPROM reading bugfix

2009-04-12 Thread David Brownell
From: David Brownell dbrown...@users.sourceforge.net

Make the U-Boot dm9000 driver read addresses from EEPROM just
like Linux does ... read six bytes, instead of reading twelve
bytes then discarding every one.

Using the right Ethernet address is a big win.

Signed-off-by: David Brownell dbrown...@users.sourceforge.net
---
 drivers/net/dm9000x.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -113,7 +113,7 @@ void eth_halt(void);
 static int dm9000_probe(void);
 static u16 phy_read(int);
 static void phy_write(int, u16);
-u16 read_srom_word(int);
+static void read_srom_word(int, u8 *);
 static u8 DM9000_ior(int);
 static void DM9000_iow(int reg, u8 value);
 
@@ -348,8 +348,8 @@ eth_init(bd_t * bd)
/* Set Node address */
if (!eth_getenv_enetaddr(ethaddr, enetaddr)) {
 #if !defined(CONFIG_AT91SAM9261EK)
-   for (i = 0; i  6; i++)
-   enetaddr[i] = read_srom_word(i);
+   for (i = 0; i  3; i++)
+   read_srom_word(i, enetaddr + 2 * i);
eth_setenv_enetaddr(ethaddr, enetaddr);
 #endif
}
@@ -541,14 +541,14 @@ eth_rx(void)
 /*
   Read a word data from SROM
 */
-u16
-read_srom_word(int offset)
+static void read_srom_word(int offset, u8 *to)
 {
DM9000_iow(DM9000_EPAR, offset);
DM9000_iow(DM9000_EPCR, 0x4);
udelay(8000);
DM9000_iow(DM9000_EPCR, 0x0);
-   return (DM9000_ior(DM9000_EPDRL) + (DM9000_ior(DM9000_EPDRH)  8));
+   to[0] = DM9000_ior(DM9000_EPDRL);
+   to[1] = DM9000_ior(DM9000_EPDRH);
 }
 
 void
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH u-boot git] fix DaVinci NS16550_REG_SIZE regression

2009-04-12 Thread David Brownell
From: David Brownell dbrown...@users.sourceforge.net

Update the DaVinci DM6446 boards to use the new convention
for CONFIG_SYS_NS16550_REG_SIZE ... the size hasn't changed
from the original 4 bytes, but these chips are little-endian.

(Resolves a regression added recently by the include/ns16550.h
patch to Unify structure declaration for registers.  The code
previously worked just fine because the registers were accessed
as host-endian words, not as bytes.)

Signed-off-by: David Brownell dbrown...@users.sourceforge.net
---
 include/configs/davinci_dvevm.h |2 +-
 include/configs/davinci_schmoogie.h |2 +-
 include/configs/davinci_sffsdr.h|2 +-
 include/configs/davinci_sonata.h|2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

--- a/include/configs/davinci_dvevm.h
+++ b/include/configs/davinci_dvevm.h
@@ -85,7 +85,7 @@
 /**/
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE4   /* NS16550 register 
size */
+#define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size, 
byteorder */
 #define CONFIG_SYS_NS16550_COM10x01c2  /* Base address of 
UART0 */
 #define CONFIG_SYS_NS16550_CLK 2700/* Input clock to 
NS16550 */
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
--- a/include/configs/davinci_schmoogie.h
+++ b/include/configs/davinci_schmoogie.h
@@ -52,7 +52,7 @@
 /**/
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE4   /* NS16550 register 
size */
+#define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size, 
byteorder */
 #define CONFIG_SYS_NS16550_COM10x01c2  /* Base address of 
UART0 */
 #define CONFIG_SYS_NS16550_CLK 2700/* Input clock to 
NS16550 */
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
--- a/include/configs/davinci_sffsdr.h
+++ b/include/configs/davinci_sffsdr.h
@@ -54,7 +54,7 @@
 /* Serial Driver info */
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE4   /* NS16550 register 
size */
+#define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size, 
byteorder */
 #define CONFIG_SYS_NS16550_COM10x01c2  /* Base address of 
UART0 */
 #define CONFIG_SYS_NS16550_CLK 2700/* Input clock to 
NS16550 */
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
--- a/include/configs/davinci_sonata.h
+++ b/include/configs/davinci_sonata.h
@@ -85,7 +85,7 @@
 /**/
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE4   /* NS16550 register 
size */
+#define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size, 
byteorder */
 #define CONFIG_SYS_NS16550_COM10x01c2  /* Base address of 
UART0 */
 #define CONFIG_SYS_NS16550_CLK 2700/* Input clock to 
NS16550 */
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH u-boot git] minor DaVinci clock cleanup

2009-04-12 Thread David Brownell
From: David Brownell dbrown...@users.sourceforge.net

Minor cleanup to clock-related defines for DaVinci DM6446 boards:

 - CONFIG_SYS_CLK_FREQ is unused; remove it.

 - CONFIG_SYS_NS16550_CLK must be the same as CONFIG_SYS_HZ_CLOCK

On DM6446 both of those peripheral clocks actually come from the
same source, the primary oscillator.  Having them use the same
symbol avoids bugs in the clone'n'modify development cycle.

Signed-off-by: David Brownell dbrown...@users.sourceforge.net
---
 include/configs/davinci_dvevm.h |3 +--
 include/configs/davinci_schmoogie.h |3 +--
 include/configs/davinci_sffsdr.h|3 +--
 include/configs/davinci_sonata.h|3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)

--- a/include/configs/davinci_dvevm.h
+++ b/include/configs/davinci_dvevm.h
@@ -56,7 +56,6 @@
 /* SoC Configuration */
 /*===*/
 #define CONFIG_ARM926EJS   /* arm926ejs CPU core */
-#define CONFIG_SYS_CLK_FREQ29700   /* Arm Clock frequency */
 #define CONFIG_SYS_TIMERBASE   0x01c21400  /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK2700/* Timer Input clock 
freq */
 #define CONFIG_SYS_HZ  1000
@@ -87,7 +86,7 @@
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size, 
byteorder */
 #define CONFIG_SYS_NS16550_COM10x01c2  /* Base address of 
UART0 */
-#define CONFIG_SYS_NS16550_CLK 2700/* Input clock to 
NS16550 */
+#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_HZ_CLOCK /* Input clock to 
NS16550 */
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
 #define CONFIG_BAUDRATE115200  /* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
--- a/include/configs/davinci_schmoogie.h
+++ b/include/configs/davinci_schmoogie.h
@@ -31,7 +31,6 @@
 /* SoC Configuration */
 /*===*/
 #define CONFIG_ARM926EJS   /* arm926ejs CPU core */
-#define CONFIG_SYS_CLK_FREQ29700   /* Arm Clock frequency */
 #define CONFIG_SYS_TIMERBASE   0x01c21400  /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK2700/* Timer Input clock 
freq */
 #define CONFIG_SYS_HZ  1000
@@ -54,7 +53,7 @@
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size, 
byteorder */
 #define CONFIG_SYS_NS16550_COM10x01c2  /* Base address of 
UART0 */
-#define CONFIG_SYS_NS16550_CLK 2700/* Input clock to 
NS16550 */
+#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_HZ_CLOCK /* Input clock to 
NS16550 */
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
 #define CONFIG_BAUDRATE115200  /* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
--- a/include/configs/davinci_sffsdr.h
+++ b/include/configs/davinci_sffsdr.h
@@ -32,7 +32,6 @@
 * powering ON the DSP. */
 /* SoC Configuration */
 #define CONFIG_ARM926EJS   /* arm926ejs CPU core */
-#define CONFIG_SYS_CLK_FREQ29700   /* Arm Clock frequency */
 #define CONFIG_SYS_TIMERBASE   0x01c21400  /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK2700/* Timer Input clock 
freq */
 #define CONFIG_SYS_HZ  1000
@@ -56,7 +55,7 @@
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size, 
byteorder */
 #define CONFIG_SYS_NS16550_COM10x01c2  /* Base address of 
UART0 */
-#define CONFIG_SYS_NS16550_CLK 2700/* Input clock to 
NS16550 */
+#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_HZ_CLOCK /* Input clock to 
NS16550 */
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
 #define CONFIG_BAUDRATE115200  /* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
--- a/include/configs/davinci_sonata.h
+++ b/include/configs/davinci_sonata.h
@@ -56,7 +56,6 @@
 /* SoC Configuration */
 /*===*/
 #define CONFIG_ARM926EJS   /* arm926ejs CPU core */
-#define CONFIG_SYS_CLK_FREQ29700   /* Arm Clock frequency */
 #define CONFIG_SYS_TIMERBASE   0x01c21400  /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK2700/* Timer Input clock 
freq */
 #define CONFIG_SYS_HZ  1000
@@ -87,7 +86,7 @@
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size, 
byteorder */
 #define CONFIG_SYS_NS16550_COM10x01c2  /* Base address of 
UART0 */
-#define CONFIG_SYS_NS16550_CLK 2700/* Input clock to 
NS16550 */
+#define 

[U-Boot] [PATCH u-boot git] DaVinci Ethernet cleanup

2009-04-12 Thread David Brownell
From: David Brownell dbrown...@users.sourceforge.net

Chips without the EMAC controller won't need the utilities
it uses to read an Ethernet address from EEPROM; so don't 
include them needlessly.

Use is_valid_ether() to validate the address from EEPROM.
All-zero addresses aren't the only invalid addresses.
A fully erased EEPROM returns all-ones, also invalid...

Switch those Ethernet utilities to use %pM for printing
MAC addresses; and not say ROM when they mean EEPROM.

Signed-off-by: David Brownell dbrown...@users.sourceforge.net

--- a/board/davinci/common/misc.c
+++ b/board/davinci/common/misc.c
@@ -25,6 +25,7 @@
 
 #include common.h
 #include i2c.h
+#include net.h
 #include asm/arch/hardware.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -49,6 +50,8 @@ void dv_display_clk_infos(void)
   ((REG(PLL2_DIV2)  0x1f) + 1) / 2);
 }
 
+#ifdef CONFIG_DRIVER_TI_EMAC
+
 /* Read ethernet MAC address from EEPROM for DVEVM compatible boards.
  * Returns 1 if found, 0 otherwise.
  */
@@ -60,8 +63,8 @@ int dvevm_read_mac_address(uint8_t *buf)
 (uint8_t *) buf[0], 6))
goto i2cerr;
 
-   /* Check that MAC address is not null. */
-   if (memcmp(buf, \0\0\0\0\0\0, 6) == 0)
+   /* Check that MAC address is valid. */
+   if (!is_valid_ether_addr(buf))
goto err;
 
return 1; /* Found */
@@ -75,11 +78,11 @@ err:
 }
 
 /* If there is a MAC address in the environment, and if it is not identical to
- * the MAC address in the ROM, then a warning is printed and the MAC address
+ * the MAC address in the EEPROM, then a warning is printed and the MAC address
  * from the environment is used.
  *
  * If there is no MAC address in the environment, then it will be initialized
- * (silently) from the value in the ROM.
+ * (silently) from the value in the EEPROM.
  */
 void dv_configure_mac_address(uint8_t *rom_enetaddr)
 {
@@ -96,31 +99,24 @@ void dv_configure_mac_address(uint8_t *r
tmp = (*end) ? end+1 : end;
}
 
-   /* Check if ROM and U-Boot environment MAC addresses match. */
+   /* Check if EEPROM and U-Boot environment MAC addresses match. */
if (memcmp(env_enetaddr, \0\0\0\0\0\0, 6) != 0 
memcmp(env_enetaddr, rom_enetaddr, 6) != 0) {
printf(Warning: MAC addresses don't match:\n);
-   printf(  ROM MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n,
-  rom_enetaddr[0], rom_enetaddr[1],
-  rom_enetaddr[2], rom_enetaddr[3],
-  rom_enetaddr[4], rom_enetaddr[5]);
-   printf(  \ethaddr\ value: %02X:%02X:%02X:%02X:%02X:%02X\n,
-  env_enetaddr[0], env_enetaddr[1],
-  env_enetaddr[2], env_enetaddr[3],
-  env_enetaddr[4], env_enetaddr[5]) ;
+   printf(  EEPROM MAC address: %pM\n, rom_enetaddr);
+   printf( \ethaddr\ value: %pM\n, env_enetaddr) ;
debug(### Using MAC address from environment\n);
}
if (!tmp) {
char ethaddr[20];
 
/* There is no MAC address in the environment, so we initialize
-* it from the value in the ROM. */
-   sprintf(ethaddr, %02X:%02X:%02X:%02X:%02X:%02X,
-   rom_enetaddr[0], rom_enetaddr[1],
-   rom_enetaddr[2], rom_enetaddr[3],
-   rom_enetaddr[4], rom_enetaddr[5]) ;
-   debug(### Setting environment from ROM MAC address = \%s\\n,
+* it from the value in the EEPROM. */
+   sprintf(ethaddr, %pM, rom_enetaddr) ;
+   debug(### Setting environment from EEPROM MAC address = 
\%s\\n,
  ethaddr);
setenv(ethaddr, ethaddr);
}
 }
+
+#endif /* DAVINCI_EMAC */
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH u-boot git] there are non-DM6446 DaVinci chips

2009-04-12 Thread David Brownell
From: David Brownell dbrown...@users.sourceforge.net

Start updating DaVinci board support to reduce dependencies on
dm644x chips and EVM-like boards ... beginning with psc.c,
which hosts a bunch of those dependencies:

 - Pinmux registers and their contents are SoC-specific, and
   are also unrelated to the Power and Sleep Controller.
   
 * Declare more of the pinmux registers;
 * Move their bitfield decls to a public header;
 * Renaming thse bitfields to be clearly SoC-specific.

 - Rename the errata workarounds to be clearly SoC-specific.

 - Add a CONFIG_SOC_DM6446; use it to prevent some mux goofs.

 - Don't include the I2C support if the I2C driver is not enabled.

Plus two minor bugfixes:

 - Correct the PSC_MDSTAT mask ...  it's six bits, not five.
   (Original DM6446 doces said five, FWIW.)

 - Correct the PWREMU_MGT mask ... don't set must-be-zero bits.

The simplest always-correct way to handle pinmux is in board_init()
calls; or possibly in SoC-specific device setup code.  Currently
these chips don't have such SoC-specific support.

Signed-off-by: David Brownell dbrown...@users.sourceforge.net
---
 board/davinci/common/psc.c  |   29 -
 board/davinci/common/psc.h  |2 +-
 board/davinci/dvevm/dvevm.c |2 +-
 board/davinci/schmoogie/schmoogie.c |2 +-
 board/davinci/sffsdr/sffsdr.c   |2 +-
 board/davinci/sonata/sonata.c   |2 +-
 include/asm-arm/arch-davinci/hardware.h |   23 +--
 include/configs/davinci_dvevm.h |1 +
 include/configs/davinci_schmoogie.h |1 +
 include/configs/davinci_sffsdr.h|1 +
 include/configs/davinci_sonata.h|1 +
 11 files changed, 46 insertions(+), 20 deletions(-)

--- a/board/davinci/common/psc.c
+++ b/board/davinci/common/psc.c
@@ -26,13 +26,6 @@
 #include common.h
 #include asm/arch/hardware.h
 
-#define PINMUX0_EMACEN (1  31)
-#define PINMUX0_AECS5  (1  11)
-#define PINMUX0_AECS4  (1  10)
-
-#define PINMUX1_I2C(1   7)
-#define PINMUX1_UART1  (1   1)
-#define PINMUX1_UART0  (1   0)
 
 /*
  * The DM6446 includes two separate power domains: Always On and DSP. The
@@ -57,7 +50,7 @@ void lpsc_on(unsigned int id)
 
while (REG(PSC_PTSTAT)  0x01);
 
-   if ((*mdstat  0x1f) == 0x03)
+   if ((*mdstat  0x3f) == 0x03)
return; /* Already on and enabled */
 
*mdctl |= 0x03;
@@ -129,10 +122,12 @@ void davinci_enable_uart0(void)
lpsc_on(DAVINCI_LPSC_UART0);
 
/* Bringup UART0 out of reset */
-   REG(UART0_PWREMU_MGMT) = 0xe003;
+   REG(UART0_PWREMU_MGMT) = 0x6001;
 
+#ifdef CONFIG_SOC_DM6446
/* Enable UART0 MUX lines */
-   REG(PINMUX1) |= PINMUX1_UART0;
+   REG(PINMUX1) |= DM644X_PINMUX1_UART0;
+#endif
 }
 
 #ifdef CONFIG_DRIVER_TI_EMAC
@@ -145,20 +140,27 @@ void davinci_enable_emac(void)
/* Enable GIO3.3V cells used for EMAC */
REG(VDD3P3V_PWDN) = 0;
 
+#ifdef CONFIG_SOC_DM6446
/* Enable EMAC. */
-   REG(PINMUX0) |= PINMUX0_EMACEN;
+   REG(PINMUX0) |= DM644X_PINMUX0_EMACEN;
+#endif
 }
 #endif
 
+#ifdef CONFIG_DRIVER_DAVINCI_I2C
 void davinci_enable_i2c(void)
 {
lpsc_on(DAVINCI_LPSC_I2C);
 
+#ifdef CONFIG_SOC_DM6446
/* Enable I2C pin Mux */
-   REG(PINMUX1) |= PINMUX1_I2C;
+   REG(PINMUX1) |= DM644X_PINMUX1_I2C;
+#endif
 }
+#endif
 
-void davinci_errata_workarounds(void)
+#ifdef CONFIG_SOC_DM6446
+void dm6446_errata_workarounds(void)
 {
/*
 * Workaround for TMS320DM6446 errata 1.3.22:
@@ -180,3 +182,4 @@ void davinci_errata_workarounds(void)
 */
REG(VBPR) = 0x20;
 }
+#endif
--- a/board/davinci/common/psc.h
+++ b/board/davinci/common/psc.h
@@ -27,6 +27,6 @@ void dsp_on(void);
 void davinci_enable_uart0(void);
 void davinci_enable_emac(void);
 void davinci_enable_i2c(void);
-void davinci_errata_workarounds(void);
+void dm6446_errata_workarounds(void);
 
 #endif /* __PSC_H */
--- a/board/davinci/dvevm/dvevm.c
+++ b/board/davinci/dvevm/dvevm.c
@@ -44,7 +44,7 @@ int board_init(void)
 * with pull-up/pull-down resistors) */
REG(PINMUX0) = 0x0c1f;
 
-   davinci_errata_workarounds();
+   dm6446_errata_workarounds();
 
/* Power on required peripherals */
lpsc_on(DAVINCI_LPSC_GPIO);
--- a/board/davinci/schmoogie/schmoogie.c
+++ b/board/davinci/schmoogie/schmoogie.c
@@ -44,7 +44,7 @@ int board_init(void)
 * with pull-up/pull-down resistors) */
REG(PINMUX0) = 0x0c1f;
 
-   davinci_errata_workarounds();
+   dm6446_errata_workarounds();
 
/* Power on required peripherals */
lpsc_on(DAVINCI_LPSC_GPIO);
--- a/board/davinci/sffsdr/sffsdr.c
+++ b/board/davinci/sffsdr/sffsdr.c
@@ -50,7 +50,7 @@ int board_init(void)
/* address of boot parameters */
gd-bd-bi_boot_params = LINUX_BOOT_PARAM_ADDR;
 
-   davinci_errata_workarounds();
+  

[U-Boot] [PATCH u-boot git] DaVinci now respects SKIP_LOWLEVEL_INIT

2009-04-12 Thread David Brownell
From: David Brownell dbrown...@users.sourceforge.net

Don't needlessly include lowlevel init code; that's only really
needed with boot-from NOR (not boot-from-NAND).  The 2nd stage
loader (UBL) handles that before it loads U-Boot.

Signed-off-by: David Brownell dbrown...@users.sourceforge.net

--- a/cpu/arm926ejs/davinci/lowlevel_init.S
+++ b/cpu/arm926ejs/davinci/lowlevel_init.S
@@ -45,6 +45,8 @@
 
 #include config.h
 
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+
 .globl lowlevel_init
 lowlevel_init:
 
@@ -705,3 +707,5 @@ DDR2_START_ADDR:
.word   0x8000
 DUMMY_VAL:
.word   0xa55aa55a
+
+#endif /* !CONFIG_SKIP_LOWLEVEL_INIT */
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH u-boot git] dm9000 EEPROM reading bugfix

2009-04-12 Thread David Brownell
On Sunday 12 April 2009, David Brownell wrote:
... read six bytes, instead of reading twelve
 bytes then discarding every one.

Urgh, editing goof.  Should read discarding every other one.



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


[U-Boot] [PATCH] cmd_nand: drop duplicate NULL ptr check

2009-04-12 Thread Mike Frysinger
The first if statement checks for NULL ptrs, so there is no need to check
it again in later else cases (such as .oob).

Signed-off-by: Mike Frysinger vap...@gentoo.org
CC: Scott Wood scottw...@freescale.com
---
 common/cmd_nand.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index e142d76..ff5bc6e 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -390,7 +390,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char 
*argv[])
else
ret = nand_write_skip_bad(nand, off, size,
  (u_char *)addr);
-   } else if (s != NULL  !strcmp(s, .oob)) {
+   } else if (!strcmp(s, .oob)) {
/* out-of-band data */
mtd_oob_ops_t ops = {
.oobbuf = (u8 *)addr,
-- 
1.6.2.2

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