[U-Boot] Build error found when using CONFIG_CMD_UBIFS

2009-11-09 Thread Lv Terry-R65388
Hi All,
 
I have encountered a build error when trying to build ubifs on
u-boot v2009.08.
 
Have anyone met this error before and how to fix it?
 
In file included from ubifs.c:26:
ubifs.h:469: error: conflicting types for '__set_bit'
/home/r65388/uboot-v2009.08/uboot-imx/include/asm/bitops.h:29: error:
previous definition of '__set_bit' was here
ubifs.h:477: error: conflicting types for '__clear_bit'
/home/r65388/uboot-v2009.08/uboot-imx/include/asm/bitops.h:36: error:
previous definition of '__clear_bit' was here
ubifs.c:30:2: warning: #warning Please define CONFIG_SYS_64BIT_VSPRINTF
for correct output!
make[1]: *** [ubifs.o] Error 1
make[1]: Leaving directory
`/home/r65388/uboot-v2009.08/uboot-imx/fs/ubifs'
make: *** [fs/ubifs/libubifs.a] Error 2
 
Thanks~~
 
Yours
Terry
 
 
 General Business Information
 Freescale Internal Use Only
 Freescale Confidential Proprietary
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Build error found when using CONFIG_CMD_UBIFS

2009-11-09 Thread Wolfgang Denk
Dear Lv Terry-R65388,

In message 
1ae74f652ecb1440b73dd7c2c20842d1a0c...@zch01exm27.fsl.freescale.net you wrote:
 
 I have encountered a build error when trying to build ubifs on
 u-boot v2009.08.

And is the error still present when using current code (top of tree in
git, or at least v2009.11-rc1) ?

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: w...@denx.de
The bad reputation UNIX has gotten is totally undeserved, laid on by
people who don't understand, who have not gotten in there  and  tried
anything.  -- Jim Joyce, owner of Jim Joyce's UNIX Bookstore
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/6] ppc4xx: Linker script consolidation

2009-11-09 Thread Stefan Roese
On Tuesday 27 October 2009 16:41:35 Stefan Roese wrote:
 This patchset will consolidate the linker scripts for PPC4xx.
 My plan is to push this in the next merge window. I've pushed
 this patchset in the 4xx-linker-script branch of the ppc4xx
 repository:
 
 http://git.denx.de/?p=u-boot/u-boot-ppc4xx.git;a=shortlog;h=refs/heads/4xx-
 linker-script

Patchset (1...6) applied to u-boot-ppc4xx/next. Thanks.

Cheers,
Stefan

--
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: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc4xx: Consolidate 4xx PCIe board specific configuration

2009-11-09 Thread Stefan Roese
On Thursday 29 October 2009 18:46:25 Stefan Roese wrote:
 This patch consolidates the PPC4xx board specific PCIe configuration
 code. This way the duplicated code is removed. Boards can implement a
 special, non standard behaviour (e.g. number of PCIe slots, etc) by
 overriding the weak default functions.

Applied to u-boot-ppc4xx/next. Thanks.

Cheers,
Stefan

--
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: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc4xx: Remove duplicated is_pci_host() functions

2009-11-09 Thread Stefan Roese
On Thursday 29 October 2009 18:47:05 Stefan Roese wrote:
 This patch introduces a weak default function for is_pci_host(),
 returning 1. This is the default behaviour, since most boards only
 implement PCI host functionality. This weak default can be overridden
 by a board specific version if needed.

Applied to u-boot-ppc4xx/next. Thanks.

Cheers,
Stefan

--
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: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ppc4xx: Fix NAND booting targets after 4xx linker script consolidation

2009-11-09 Thread Stefan Roese
Somehow I missed the NAND booting targets in the 4xx linker script
consolidation patchset. This patch fixes this issue.

Signed-off-by: Stefan Roese s...@denx.de
---
 board/amcc/acadia/config.mk  |4 
 board/amcc/bamboo/config.mk  |4 
 board/amcc/canyonlands/config.mk |4 
 board/amcc/kilauea/config.mk |4 
 board/amcc/sequoia/config.mk |4 
 5 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/board/amcc/acadia/config.mk b/board/amcc/acadia/config.mk
index 290415c..01db41c 100644
--- a/board/amcc/acadia/config.mk
+++ b/board/amcc/acadia/config.mk
@@ -34,3 +34,7 @@ endif
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
 endif
+
+ifdef CONFIG_NAND_U_BOOT
+LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
+endif
diff --git a/board/amcc/bamboo/config.mk b/board/amcc/bamboo/config.mk
index a37636a..72b6bc0 100644
--- a/board/amcc/bamboo/config.mk
+++ b/board/amcc/bamboo/config.mk
@@ -36,3 +36,7 @@ endif
 ifeq ($(dbcr),1)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff
 endif
+
+ifdef CONFIG_NAND_U_BOOT
+LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
+endif
diff --git a/board/amcc/canyonlands/config.mk b/board/amcc/canyonlands/config.mk
index 551a817..7a58665 100644
--- a/board/amcc/canyonlands/config.mk
+++ b/board/amcc/canyonlands/config.mk
@@ -39,3 +39,7 @@ endif
 ifeq ($(dbcr),1)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff
 endif
+
+ifdef CONFIG_NAND_U_BOOT
+LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
+endif
diff --git a/board/amcc/kilauea/config.mk b/board/amcc/kilauea/config.mk
index f5800eb..b3d3f22 100644
--- a/board/amcc/kilauea/config.mk
+++ b/board/amcc/kilauea/config.mk
@@ -30,3 +30,7 @@ endif
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
 endif
+
+ifdef CONFIG_NAND_U_BOOT
+LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
+endif
diff --git a/board/amcc/sequoia/config.mk b/board/amcc/sequoia/config.mk
index 6c748c9..b57e473 100644
--- a/board/amcc/sequoia/config.mk
+++ b/board/amcc/sequoia/config.mk
@@ -43,3 +43,7 @@ endif
 ifeq ($(dbcr),1)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff
 endif
+
+ifdef CONFIG_NAND_U_BOOT
+LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
+endif
-- 
1.6.5.2

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


[U-Boot] use boot select jumper on NGW100 to select USART

2009-11-09 Thread Thomas Sprinkmeier
From: Thomas Sprinkmeier thomas.sprinkme...@gmail.com
Date: Mon, 9 Nov 2009 09:28:51 +1030
Subject: [PATCH] use boot select jumper on NGW100 to select USART

Without the boot select jumper U-Boot will use the USART selected
using the CONFIG_USART1, CONFIG_USART2, directive.

If  CONFIG_ALT_USART1 (or ..2, ..3, ..0) is defined then,
with the jumper in place, that USART is used instead.

Signed-off-by: Thomas Sprinkmeier thomas.sprinkme...@gmail.com
---
 board/atmel/atngw100/atngw100.c |6 ++-
 drivers/serial/atmel_usart.c|   15 +---
 include/atmel_alt_usart.h   |   81 +++
 include/configs/atngw100.h  |1 +
 4 files changed, 88 insertions(+), 15 deletions(-)
 create mode 100644 include/atmel_alt_usart.h

diff --git a/board/atmel/atngw100/atngw100.c b/board/atmel/atngw100/atngw100.c
index 004d8da..841d9ec 100644
--- a/board/atmel/atngw100/atngw100.c
+++ b/board/atmel/atngw100/atngw100.c
@@ -29,6 +29,8 @@
 #include asm/arch/portmux.h
 #include netdev.h
 
+#include atmel_alt_usart.h
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static const struct sdram_config sdram_config = {
@@ -53,7 +55,9 @@ int board_early_init_f(void)
hmatrix_slave_write(EBI, SFR, HMATRIX_BIT(EBI_SDRAM_ENABLE));
 
portmux_enable_ebi(16, 23, 0, PORTMUX_DRIVE_HIGH);
-   portmux_enable_usart1(PORTMUX_DRIVE_MIN);
+
+   USART_JUMPER_CONFIG;
+   USART_ENABLE;
 
 #if defined(CONFIG_MACB)
portmux_enable_macb0(PORTMUX_MACB_MII, PORTMUX_DRIVE_HIGH);
diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
index f50552a..c78755c 100644
--- a/drivers/serial/atmel_usart.c
+++ b/drivers/serial/atmel_usart.c
@@ -21,20 +21,7 @@
 #include asm/io.h
 #include asm/arch/clk.h
 #include asm/arch/memory-map.h
-
-#if defined(CONFIG_USART0)
-# define USART_ID  0
-# define USART_BASEUSART0_BASE
-#elif defined(CONFIG_USART1)
-# define USART_ID  1
-# define USART_BASEUSART1_BASE
-#elif defined(CONFIG_USART2)
-# define USART_ID  2
-# define USART_BASEUSART2_BASE
-#elif defined(CONFIG_USART3)
-# define USART_ID  3
-# define USART_BASEUSART3_BASE
-#endif
+#include atmel_alt_usart.h
 
 #include atmel_usart.h
 
diff --git a/include/atmel_alt_usart.h b/include/atmel_alt_usart.h
new file mode 100644
index 000..1ed2fb8
--- /dev/null
+++ b/include/atmel_alt_usart.h
@@ -0,0 +1,81 @@
+/*
+ *  Copyright (C) 2009 Thomas Sprinkmeier
+ *
+ * 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
+ */
+#ifndef __ATMEL_ALT_USART_H__
+#define __ATMEL_ALT_USART_H__
+
+/* Define alternate USART ID and BASE */
+#if   defined(CONFIG_ALT_USART0)
+# define USART_ALT_ID  0
+# define USART_ALT_BASEUSART0_BASE
+#elif defined(CONFIG_ALT_USART1)
+# define USART_ALT_ID  1
+# define USART_ALT_BASEUSART1_BASE
+#elif defined(CONFIG_ALT_USART2)
+# define USART_ALT_ID  2
+# define USART_ALT_BASEUSART2_BASE
+#elif defined(CONFIG_ALT_USART3)
+# define USART_ALT_ID  3
+# define USART_ALT_BASEUSART3_BASE
+#elif
+/* No alternate USART selected */
+#define USART_USE_ALT (0)
+#define USART_PIN_CONFIG
+#endif
+
+/* How to read/initialise the boot-select jumper */
+#ifndef USART_USE_ALT
+#define USART_USE_ALT (!gpio_get_value(GPIO_PIN_PB(30)))
+#define USART_JUMPER_CONFIG portmux_select_gpio(PORTMUX_PORT_B,
\
+   (1  30),  \
+   PORTMUX_DIR_INPUT)
+#endif
+
+/*Configure default USART ID and BASE*/
+#if   defined(CONFIG_USART0)
+# define USART_DEF_ID  0
+# define USART_DEF_BASEUSART0_BASE
+#elif defined(CONFIG_USART1)
+# define USART_DEF_ID  1
+# define USART_DEF_BASEUSART1_BASE
+#elif defined(CONFIG_USART2)
+# define USART_DEF_ID  2
+# define USART_DEF_BASEUSART2_BASE
+#elif defined(CONFIG_USART3)
+# define USART_DEF_ID  3
+# define USART_DEF_BASEUSART3_BASE
+#elif
+#error You must define CONFIG_USART[0..1] to select a console port
+#endif
+
+
+/* Which USART ID/BASE to use. */
+#define USART_ID   (USART_USE_ALT ? USART_ALT_ID   : USART_DEF_ID)
+#define USART_BASE (USART_USE_ALT ? USART_ALT_BASE : USART_DEF_BASE)
+
+/* Enable the appropriate USART */
+#define USART_ENABLE { \
+  switch (USART_ID)

Re: [U-Boot] [PATCH] ppc4xx: Canyonlands: Change EBC bus config to drive always (no high-z)

2009-11-09 Thread Stefan Roese
On Thursday 29 October 2009 18:44:31 Stefan Roese wrote:
 This patch fixes a problem only seen very occasionally on Canyonlands.
 The NOR flash interface (CFI driver) doesn't work reliably in all cases.
 Erasing and/or programming sometimes doesn't work. Sometimes with
 an error message, like flash not erased when trying to program an
 area that should have just been erased. And sometimes without any error
 messages. As mentioned above, this problem was only seen rarely and with
 some PLL configuration (CPU speed, EBC speed).
 
 Now I spotted this problem a few times, when running my Canyonlands with
 the following setup (chip_config):
 
 1000-nor - NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
 
 Changing the EBC configuration to not release the bus into high
 impedance state inbetween the transfers (ATC, DTC and CTC bits set to 1
 in EBC0_CFG) seems to fix this problem. I haven't seen any failure
 anymore with this patch applied.

Applied to u-boot-ppc4xx/master. Thanks.
 
Cheers,
Stefan

--
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: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc4xx: 44x_spd_ddr2.c: Fix register macro ECCCR - ECCES (SDRAM_ECCES)

2009-11-09 Thread Stefan Roese
On Tuesday 03 November 2009 14:35:08 Stefan Roese wrote:
 This error only appears when DEBUG is enabled in this driver. That's why
 it went unnoticed till now.

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

Cheers,
Stefan

--
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: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2009-11-09 Thread Stefan Roese
Hi Wolfgang,

please pull some fixes for this release.

Thanks.

The following changes since commit b91b8f74fe9ded18344c3d03080a4abc07254502:
  Wolfgang Denk (1):
Merge branch 'master' of /home/wd/git/u-boot/custodians

are available in the git repository at:

  git://www.denx.de/git/u-boot-ppc4xx.git master

Stefan Roese (2):
  ppc4xx: Canyonlands: Change EBC bus config to drive always (no high-z)
  ppc4xx: 44x_spd_ddr2.c: Fix register macro ECCCR - ECCES (SDRAM_ECCES)

 cpu/ppc4xx/44x_spd_ddr2.c |2 +-
 include/configs/canyonlands.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)




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


Re: [U-Boot] [PATCH] Fix build failure in examples/standalone

2009-11-09 Thread Premi, Sanjeev
 -Original Message-
 From: Wolfgang Denk [mailto:w...@denx.de] 
 Sent: Monday, November 09, 2009 4:16 AM
 To: Premi, Sanjeev
 Cc: u-boot@lists.denx.de
 Subject: Re: [U-Boot] [PATCH] Fix build failure in examples/standalone
 
 Dear Premi, Sanjeev,
 
 In message 
 b85a65d85d7eb246be421b3fb0fbb59301de31f...@dbde02.ent.ti.com
  you wrote:
 
  I was surprised too. It is the first time ever I have seen 
 this problem
  with any Makefile over years.
 
  To debug I tried this:
 ...
  Makefile:47: *** *** COBJS evaluates to [hello_world.o 
 smc911x_eeprom.o   .o].  Stop.
  make[1]: Leaving directory 
 `/home/sanjeev/u-boot/examples/standalone'
  make: *** [examples/standalone] Error 2
 
  Notice the empty .o in the output. This prompted me to 
 use $(strip ...)
 
 Indeed. I do not doubt that your modification fixes the issue.

[sp] I was only illustrating the problem.

 
  premi # make --version
  GNU Make 3.80
  Copyright (C) 2002  Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.
  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
  PARTICULAR PURPOSE.
 
 It seems very much to me as if this was a bug in GNU Make 3.80, then.
 
 May I please ask you to modify your poatch such that both the code and
 the commit message contain a comment that the added strip call is a
 workaround for a white-space handling problem in some versions of GNU
 make, especially version 3.80? 

[sp] Sure I will do so today.

Best regards,
Sanjeev

 
 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: w...@denx.de
 A conservative is a man who believes that nothing should be done for
 the first time.   - Alfred E. Wiggam
 
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] OMAP3:SDRC: introduce DDR types

2009-11-09 Thread Tom
Steve Sakoman wrote:
 On Sat, Nov 7, 2009 at 10:15 AM, Paulraj, Sandeep s-paul...@ti.com wrote:
 Introduce Micron DDR timings and provide
 CONFIG_OMAP3_INFINEON_DDR and CONFIG_OMAP3_MICRON_DDR config
 options to allow for platform files to setup their timings as
 per the type of DDR selected

 Reported-by: Steve Sakoman in

 http://www.nabble.com/forum/Permalink.jtp?root=25779518post=25959734page
 =y

 Signed-off-by: Nishanth Menon n...@ti.com
 ---
  include/asm-arm/arch-omap3/mem.h |   88
 ++---
 -
  include/configs/devkit8000.h |3 +
  include/configs/omap3_beagle.h   |3 +
  include/configs/omap3_evm.h  |3 +
  include/configs/omap3_overo.h|3 +
  include/configs/omap3_pandora.h  |3 +
  include/configs/omap3_sdp3430.h  |3 +
  include/configs/omap3_zoom1.h|3 +
  include/configs/omap3_zoom2.h|3 +
  9 files changed, 94 insertions(+), 18 deletions(-)

 Pushed to u-boot-ti/next

 I think this series from Nishanth needs some runtime tests.
 I believe Steve had some issues with his EVM not booting everytime due
 to issues with DDR init.
 Thanks,
 Sandeep
 Maybe it should go on the testing branch?

 I will give zoom2 a try..

 Tom

 Nishanth has already tried on SDP 3430.
 I think the board that needs to be tried is overo.
 
 Correct, it was Overo, though I suspect Beagle might have the same
 issue since they use the same Micron POP memory.  I'll try to test
 this weekend.
 
 Steve

I can try that too.

Did you see the problem on warm or cold booting?

Tom


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


[U-Boot] [PATCH 1/2] ppc4xx: Switch to I2C bus numer 0 for chip_config command

2009-11-09 Thread Stefan Roese
All currently available 4xx derivats have the I2C bootstrap EEPROM
located on I2C bus number 0. This patch now first sets this bus number,
so that the chip_config command also works for board with multiple
I2C busses, like Katmai.

Signed-off-by: Stefan Roese s...@denx.de
---
 cpu/ppc4xx/cmd_chip_config.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/cpu/ppc4xx/cmd_chip_config.c b/cpu/ppc4xx/cmd_chip_config.c
index d360d5b..ba57211 100644
--- a/cpu/ppc4xx/cmd_chip_config.c
+++ b/cpu/ppc4xx/cmd_chip_config.c
@@ -52,6 +52,12 @@ static int do_chip_config(cmd_tbl_t *cmdtp, int flag, int 
argc, char *argv[])
int cur_config_nr = -1;
u8 cur_config[CONFIG_4xx_CONFIG_BLOCKSIZE];
 
+   /*
+* First switch to correct I2C bus. This is I2C bus 0
+* for all currently available 4xx derivats.
+*/
+   I2C_SET_BUS(0);
+
 #ifdef CONFIG_CMD_EEPROM
ret = eeprom_read(CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR,
  CONFIG_4xx_CONFIG_I2C_EEPROM_OFFSET,
-- 
1.6.5.2

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


[U-Boot] [PATCH 2/2] ppc4xx: Katmai: Add chip_config command

2009-11-09 Thread Stefan Roese
This patch removes the Katmai bootstrap command and replaces it
with the now common command chip_config.

Signed-off-by: Stefan Roese s...@denx.de
---
 board/amcc/katmai/Makefile  |4 +-
 board/amcc/katmai/chip_config.c |   55 ++
 board/amcc/katmai/cmd_katmai.c  |  218 ---
 include/configs/katmai.h|9 ++-
 4 files changed, 66 insertions(+), 220 deletions(-)
 create mode 100644 board/amcc/katmai/chip_config.c
 delete mode 100644 board/amcc/katmai/cmd_katmai.c

diff --git a/board/amcc/katmai/Makefile b/board/amcc/katmai/Makefile
index 318016d..168bab5 100644
--- a/board/amcc/katmai/Makefile
+++ b/board/amcc/katmai/Makefile
@@ -25,9 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  = $(BOARD).o cmd_katmai.o
+COBJS-y:= $(BOARD).o
+COBJS-$(CONFIG_CMD_CHIP_CONFIG) += chip_config.o
 SOBJS  = init.o
 
+COBJS   := $(COBJS-y)
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
diff --git a/board/amcc/katmai/chip_config.c b/board/amcc/katmai/chip_config.c
new file mode 100644
index 000..efaf378
--- /dev/null
+++ b/board/amcc/katmai/chip_config.c
@@ -0,0 +1,55 @@
+/*
+ * (C) Copyright 2009
+ * Stefan Roese, DENX Software Engineering, s...@denx.de.
+ *
+ * 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 asm/ppc4xx_config.h
+
+struct ppc4xx_config ppc4xx_config_val[] = {
+   {
+   400-133,CPU: 400 PLB: 133 OPB:  66 EBC:  66,
+   { 0x86, 0x78, 0xc2, 0xc6, 0x05, 0xa5, 0x04, 0xe1 }
+   },
+   {
+   500-166,CPU: 500 PLB: 166 OPB:  83 EBC:  83,
+   { 0x87, 0x78, 0xf2, 0xc6, 0x05, 0xa5, 0x04, 0xe1 }
+   },
+   {
+   533-133,CPU: 533 PLB: 133 OPB:  66 EBC:  66,
+   { 0x87, 0x79, 0x02, 0x52, 0x05, 0xa5, 0x04, 0xe1 }
+   },
+   {
+   667-133,CPU: 667 PLB: 133 OPB:  66 EBC:  66,
+   { 0x87, 0x79, 0x42, 0x56, 0x05, 0xa5, 0x04, 0xe1 }
+   },
+   {
+   667-166,CPU: 667 PLB: 166 OPB:  83 EBC:  83,
+   { 0x87, 0x79, 0x42, 0x06, 0x05, 0xa5, 0x04, 0xe1 }
+   },
+   {
+   800-160,CPU: 800 PLB: 160 OPB:  53 EBC:  17,
+   { 0x86, 0x79, 0x81, 0xa7, 0x07, 0xa5, 0x04, 0xe1 }
+   },
+};
+
+int ppc4xx_config_count = ARRAY_SIZE(ppc4xx_config_val);
diff --git a/board/amcc/katmai/cmd_katmai.c b/board/amcc/katmai/cmd_katmai.c
deleted file mode 100644
index 335d30c..000
--- a/board/amcc/katmai/cmd_katmai.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * (C) Copyright 2007
- * Stefan Roese, DENX Software Engineering, s...@denx.de.
- *
- * 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 command.h
-#include i2c.h
-#include asm/byteorder.h
-
-#defineCONFIG_STRESS   /* enable 667 MHz CPU freq selection */
-#define DEBUG
-
-static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-   uchar   chip;
-   ulong   data;
-   int nbytes;
-   extern char console_buffer[];
-
-   char sysClock[4];
-   char cpuClock[4];
-   char plbClock[4];
-   char pcixClock[4];
-
-   if (argc  3) {
-   cmd_usage(cmdtp);
-   return 1;
-   }
-
-   if (strcmp(argv[2], prom0) == 0)
-   chip = IIC0_BOOTPROM_ADDR;
-   else
-   chip 

Re: [U-Boot] use boot select jumper on NGW100 to select USART

2009-11-09 Thread Wolfgang Denk
Dear Thomas Sprinkmeier,

In message e1n7tgc-ms...@lego.my-domain you wrote:
 From: Thomas Sprinkmeier thomas.sprinkme...@gmail.com
 Date: Mon, 9 Nov 2009 09:28:51 +1030
 Subject: [PATCH] use boot select jumper on NGW100 to select USART
 
 Without the boot select jumper U-Boot will use the USART selected
 using the CONFIG_USART1, CONFIG_USART2, directive.
 
 If  CONFIG_ALT_USART1 (or ..2, ..3, ..0) is defined then,
 with the jumper in place, that USART is used instead.
 
 Signed-off-by: Thomas Sprinkmeier thomas.sprinkme...@gmail.com
 ---
  board/atmel/atngw100/atngw100.c |6 ++-
  drivers/serial/atmel_usart.c|   15 +---
  include/atmel_alt_usart.h   |   81 
 +++
  include/configs/atngw100.h  |1 +
  4 files changed, 88 insertions(+), 15 deletions(-)
  create mode 100644 include/atmel_alt_usart.h
 
 diff --git a/board/atmel/atngw100/atngw100.c b/board/atmel/atngw100/atngw100.c
 index 004d8da..841d9ec 100644
 --- a/board/atmel/atngw100/atngw100.c
 +++ b/board/atmel/atngw100/atngw100.c
 @@ -29,6 +29,8 @@
  #include asm/arch/portmux.h
  #include netdev.h
  
 +#include atmel_alt_usart.h
 +
  DECLARE_GLOBAL_DATA_PTR;
  
  static const struct sdram_config sdram_config = {
 @@ -53,7 +55,9 @@ int board_early_init_f(void)
   hmatrix_slave_write(EBI, SFR, HMATRIX_BIT(EBI_SDRAM_ENABLE));
  
   portmux_enable_ebi(16, 23, 0, PORTMUX_DRIVE_HIGH);
 - portmux_enable_usart1(PORTMUX_DRIVE_MIN);
 +
 + USART_JUMPER_CONFIG;
 + USART_ENABLE;

Function / Macro when used as funxctions should always look as such,
i. e. have parens with them.


 diff --git a/include/atmel_alt_usart.h b/include/atmel_alt_usart.h
 new file mode 100644
 index 000..1ed2fb8
...
 +/* Enable the appropriate USART */
 +#define USART_ENABLE {   
 \
 +  switch (USART_ID)  \
 +{
 \
 +case 0:  portmux_enable_usart0(PORTMUX_DRIVE_MIN); break;
 \
 +case 1:  portmux_enable_usart1(PORTMUX_DRIVE_MIN); break;
 \
 +case 2:  portmux_enable_usart2(PORTMUX_DRIVE_MIN); break;
 \
 +default: portmux_enable_usart3(PORTMUX_DRIVE_MIN); break;
 \
 +}
 \
 +  } while(0)

NAK.  When you use a function-style macro it should look like one. But
why is this a macro at all? Please make it a (static) inline function
instead.

Also please note that the Coding Style requires indentation by TABs.

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: w...@denx.de
F u cn rd ths u cnt spl wrth a dm!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] OMAP3:SDRC: introduce DDR types

2009-11-09 Thread Steve Sakoman
On Mon, Nov 9, 2009 at 5:13 AM, Tom tom@windriver.com wrote:
 Steve Sakoman wrote:

 On Sat, Nov 7, 2009 at 10:15 AM, Paulraj, Sandeep s-paul...@ti.com
 wrote:

 Introduce Micron DDR timings and provide
 CONFIG_OMAP3_INFINEON_DDR and CONFIG_OMAP3_MICRON_DDR config
 options to allow for platform files to setup their timings as
 per the type of DDR selected

 Reported-by: Steve Sakoman in


 http://www.nabble.com/forum/Permalink.jtp?root=25779518post=25959734page

 =y

 Signed-off-by: Nishanth Menon n...@ti.com
 ---
  include/asm-arm/arch-omap3/mem.h |   88

 ++---

 -
  include/configs/devkit8000.h     |    3 +
  include/configs/omap3_beagle.h   |    3 +
  include/configs/omap3_evm.h      |    3 +
  include/configs/omap3_overo.h    |    3 +
  include/configs/omap3_pandora.h  |    3 +
  include/configs/omap3_sdp3430.h  |    3 +
  include/configs/omap3_zoom1.h    |    3 +
  include/configs/omap3_zoom2.h    |    3 +
  9 files changed, 94 insertions(+), 18 deletions(-)

 Pushed to u-boot-ti/next

 I think this series from Nishanth needs some runtime tests.
 I believe Steve had some issues with his EVM not booting everytime due

 to issues with DDR init.

 Thanks,
 Sandeep

 Maybe it should go on the testing branch?

 I will give zoom2 a try..

 Tom

 Nishanth has already tried on SDP 3430.
 I think the board that needs to be tried is overo.

 Correct, it was Overo, though I suspect Beagle might have the same
 issue since they use the same Micron POP memory.  I'll try to test
 this weekend.

 Steve

 I can try that too.

 Did you see the problem on warm or cold booting?

IIRC, it was an issue with both warm and cold boots.

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


Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?

2009-11-09 Thread Prafulla Wadaskar
Dear Albert 

 -Original Message-
 From: Albert ARIBAUD [mailto:albert.arib...@free.fr] 
 Sent: Monday, November 02, 2009 5:46 PM
 To: Prafulla Wadaskar
 Subject: Re: [U-Boot] Best way of making some drivers common 
 across kirkwood and orion5x SoCs?
 
 Prafulla Wadaskar a écrit :
  
  Still, the drivers would be full of 'KWxxx and kwxxx symbols of
  which many are not kirkwood-specific actually.
  
  Any way, those are not even orion specific nor Marvell specific. 
  Those are related to the functionality supported by SOCs that may be
  customized by each SOC
  
  In order for these drivers to compile with an orion5x SoC, I would
  have to adopt kirkwood names in the
  
  What harm in this?
 
 I would say it harms maintenability and reuseability of the code. If
 those drivers are neither kirkwood- nor even 
 marvell-specific, then they
 should not lead readers to believe they are, otherwise people 
 might not
 realize they can ruse these drivers in their own SoCs.
 
  orion5x code, which I don't like as much as I would like fixing the
  
  If you see kernel code even there you can see kirkwood call from
  Orion drivers and vice versa.
  
  symbols to make them marvell-, not kirkwood-, specific.
  
  This will not solve the root problem, what about some non 
 marvell SoC
  have same h/w and want to reuse the code? Do we again change the
  suffixes? (kirkwood re-used external serial driver adopting external
  definitions).
 
 Point valid and taken--see my suggestion below.
 
  I suggest here to adopt kw symbols in Orion. This would 
 make it clear
  for anybody that kirkwood code is reused by orion. With 
 this kirkwood
  drives will be untouched.
 
 This does not solve the root problem any better than switching to 
 Marvell prefixes, as you rightly point out. I thus suggest 
 removing any 
 Marvell, Kirkwood or Orion prefixes from symbols in these drivers 
 altogether. For instance, egiga symbols would take EGIGA_ as 
 a prefix. 
 Then each SoC (kirkwood, orion5x, any other) header file 
 would provide 
 adequate definitions (#define EGIGA_ ).

I understands your concerns-
1. For SOC support Orion should be implemented similar to Kirkwood (you agreed 
on this)
2. For common drivers for (ex: kirkwood_egiga.c) the common code must be 
abstracted to egiga_core.c and architecture specific code must be supported 
through kirkwood_egiga.c/h and orion_egiga.c/h, this way it would make it more 
clean and structured.

 
  While doing this reuse activity, if we find something blocking,
  certainly we should address that, but let's avoid changing identity
  of drivers.
 
 I personally believe that having the Orion5x SoC dependent of the 
 kirkwood one is blocking enough from a design standpoint.

What is your opinion with #2 suggestion?

Regards..
Prafulla . .

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


[U-Boot] [PATCH v2] Fix build failure in examples/standalone

2009-11-09 Thread Sanjeev Premi
Some versions of 'make' do not handle trailing white-spaces
properly. Trailing spaces in ELF causes a 'fake' source to
be added to the variable COBJS; leading to build failure
(listed below). The problem was found with GNU Make 3.80.

Using text-function 'strip' as a workaround for the problem.

make[1]: Entering directory `/home/sanjeev/u-boot/examples/standalone'
arm-none-linux-gnueabi-gcc -g  -Os   -fno-common -ffixed-r8 -msoft-float
-D__KERNEL__ -DTEXT_BASE=0x80e8 -I/home/sanjeev/u-boot/include
-fno-builtin -ffreestanding -nostdinc -isystem /opt/codesourcery/2009q1-
203/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -pipe  -DCONFIG_
ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-interwork -march=armv5
-Wall -Wstrict-prototypes -fno-stack-protector -g  -Os   -fno-common -ff
ixed-r8 -msoft-float   -D__KERNEL__ -DTEXT_BASE=0x80e8 -I/home/sanje
ev/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/co
desourcery/2009q1-203/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/includ
e -pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-inte
rwork -march=armv5 -I.. -Bstatic -T u-boot.lds  -Ttext 0x80e8 -o .c
arm-none-linux-gnueabi-gcc: no input files
make[1]: *** [.c] Error 1
make[1]: Leaving directory `/home/sanjeev/u-boot/examples/standalone'
make: *** [examples/standalone] Error 2
premi #

Signed-off-by: Sanjeev Premi pr...@ti.com
---
 examples/standalone/Makefile |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 5e2f2bc..c02ce43 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -38,7 +38,13 @@ ELF-mpc8260  += mem_to_mem_idma2intr
 ELF-ppc  += sched
 ELF-oxc  += eepro100_eeprom
 
-ELF := $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(BOARD)) $(ELF-$(CPU))
+#
+# Some versions of make do not handle trailing white spaces properly;
+# leading to build failures. The problem was found with GNU Make 3.80.
+# Using 'strip' as a workaround for the problem.
+#
+ElF := $(strip $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(BOARD)) $(ELF-$(CPU)))
+
 SREC = $(addsuffix .srec,$(ELF))
 BIN  = $(addsuffix .bin,$(ELF))
 
-- 
1.6.2.2

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


Re: [U-Boot] [PATCH 0/3] enable CONFIG_NET_MULTI for LAN91C96

2009-11-09 Thread Menon, Nishanth
 From: Ben Warren [mailto:biggerbadder...@gmail.com]
 Sent: Friday, October 16, 2009 11:30 AM
 
 Nishanth Menon wrote:
  Based on the discussion[1] here is the patchset
 
  Patchset is based on [2], and tested on SDP3430.
  Other platforms would be prefered to be
  build/tested/fixed as required
 
  Nishanth Menon (3):
NET: LAN91C96 CONFIG_NET_MULTIify
TI OMAP3: SDP3430 FIX NET_MULTI Warning
LAN91C96: Enable NET_MULTI LAN driver
 
 
 On first pass review, this looks great!  There are a few things I'd like
 to do to improve the driver, but it has nothing to do with converting to
 NET_MULTI.
 
 I'm going to fire up a net-next branch this weekend and will try to
 apply it there.
Did this get into the net-next branch? [1] did not seem to have it.

Regards,
Nishanth Menon
Ref:
[1] http://git.denx.de/?p=u-boot/u-boot-net.git;a=shortlog;h=refs/heads/next

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


Re: [U-Boot] [PATCH v2] Fix build failure in examples/standalone

2009-11-09 Thread Peter Tyser
Hi Sanjeev,

snip

  
 -ELF := $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(BOARD)) $(ELF-$(CPU))
 +#
 +# Some versions of make do not handle trailing white spaces properly;
 +# leading to build failures. The problem was found with GNU Make 3.80.
 +# Using 'strip' as a workaround for the problem.
 +#
 +ElF := $(strip $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(BOARD)) $(ELF-$(CPU)))
 +

I haven't been following the thread, but am assuming the the
capitalization of ElF above is a typo?

Best,
Peter

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


[U-Boot] MPC8360ERDK and DP83848

2009-11-09 Thread Jon . Gadsden
The MPC8360ERDK from Freescale has both Broadcom 5481 and National DP83848 
ethernet interfaces.  However the U-Boot supplied with the RDK only 
supports the Broadcom 5481.  Has anybody got the National DP83848 
interface working for U-Boot on this RDK?  In the U-Boot archives I can 
only find references to the DP83848 driver for the A91RM9200 board.

Thanks, Jon

--
Jon Gadsden
Embedded Software Engineer, 
Vital Platforms Centre of Excellence
Invensys Rail (UK), Chippenham
Telephone: +44 (0) 1249 441407
email: jon.gads...@invensysrail.com


Any files attached to this e-mail will have been checked with virus 
detection software prior to transmission but you should carry out your own 
virus check before opening any attachment. Invensys Rail does not accept 
liability for any damage or loss which may be caused by software viruses. 
This e-mail and any associated files are intended solely for the 
individual or entity to whom they are addressed. Please do not copy it or 
use it for any purposes, or disclose its contents to any other person. 
Further, this e-mail and any associated files may be confidential and 
further may be legally privileged.

This email is from the Invensys Rail Limited business unit of Invensys plc 
which is a company registered in England and Wales with its registered 
office at Portland House, Bressenden Place, London, SW1E 5BF (Registered 
number 166023). For a list of European legal entities within Invensys Rail 
business group, please click here

If you have received this e-mail in error, you are on notice of its 
status. Please notify us immediately by reply e-mail and then delete this 
message from your system. Thank you for your co-operation. You may contact 
our Helpdesk on +44 (0)20 7821 3859 / 2105 or email 
inet.hqhelpd...@invensys.com

This e-mail and any attachments thereto may be subject to the terms of any 
agreements between Invensys (and/or its subsidiaries and affiliates) and 
the recipient (and/or its subsidiaries and affiliates).___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/3] enable CONFIG_NET_MULTI for LAN91C96

2009-11-09 Thread Ben Warren
Menon, Nishanth wrote:
 From: Ben Warren [mailto:biggerbadder...@gmail.com]
 Sent: Friday, October 16, 2009 11:30 AM

 Nishanth Menon wrote:
 
 Based on the discussion[1] here is the patchset

 Patchset is based on [2], and tested on SDP3430.
 Other platforms would be prefered to be
 build/tested/fixed as required

 Nishanth Menon (3):
   NET: LAN91C96 CONFIG_NET_MULTIify
   TI OMAP3: SDP3430 FIX NET_MULTI Warning
   LAN91C96: Enable NET_MULTI LAN driver


   
 On first pass review, this looks great!  There are a few things I'd like
 to do to improve the driver, but it has nothing to do with converting to
 NET_MULTI.

 I'm going to fire up a net-next branch this weekend and will try to
 apply it there.
 
 Did this get into the net-next branch? [1] did not seem to have it.

   
Unfortunately, for me 'this weekend' quite often leaves 'this' open to 
interpretation.  Bill Clinton would be proud.

Soon...

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


Re: [U-Boot] MPC8360ERDK and DP83848

2009-11-09 Thread Ben Warren
Hello Jon,

jon.gads...@invensysrail.com wrote:
 The MPC8360ERDK from Freescale has both Broadcom 5481 and National DP83848 
 ethernet interfaces.  However the U-Boot supplied with the RDK only 
 supports the Broadcom 5481.  Has anybody got the National DP83848 
 interface working for U-Boot on this RDK?  In the U-Boot archives I can 
 only find references to the DP83848 driver for the A91RM9200 board.

   
The UEC driver has support for a generic PHY.  It might 'just work'.
 Thanks, Jon

 --
 Jon Gadsden
 Embedded Software Engineer, 
 Vital Platforms Centre of Excellence
 Invensys Rail (UK), Chippenham
 Telephone: +44 (0) 1249 441407
 email: jon.gads...@invensysrail.com


 Any files attached to this e-mail will have been checked with virus 
 detection software prior to transmission but you should carry out your own 
 virus check before opening any attachment. Invensys Rail does not accept 
 liability for any damage or loss which may be caused by software viruses. 
 This e-mail and any associated files are intended solely for the 
 individual or entity to whom they are addressed. Please do not copy it or 
 use it for any purposes, or disclose its contents to any other person. 
 Further, this e-mail and any associated files may be confidential and 
 further may be legally privileged.

 This email is from the Invensys Rail Limited business unit of Invensys plc 
 which is a company registered in England and Wales with its registered 
 office at Portland House, Bressenden Place, London, SW1E 5BF (Registered 
 number 166023). For a list of European legal entities within Invensys Rail 
 business group, please click here

 If you have received this e-mail in error, you are on notice of its 
 status. Please notify us immediately by reply e-mail and then delete this 
 message from your system. Thank you for your co-operation. You may contact 
 our Helpdesk on +44 (0)20 7821 3859 / 2105 or email 
 inet.hqhelpd...@invensys.com

 This e-mail and any attachments thereto may be subject to the terms of any 
 agreements between Invensys (and/or its subsidiaries and affiliates) and 
 the recipient (and/or its subsidiaries and affiliates).
   
   
If you can strip this crap from your messages you'll make more friends

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


Re: [U-Boot] [PATCH] Fix cs8900 dev-priv not init issue

2009-11-09 Thread Ben Warren
Hui.Tang wrote:
 Fix cs8900 dev-priv not init issue, do it as Ben Warren's suggestion.

 Signed-off-by: Hui.Tang zetal...@gmail.com
 ---
  drivers/net/cs8900.c |7 ---
  1 files changed, 4 insertions(+), 3 deletions(-)

 diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
 index 587f7f6..a9d1f22 100644
 --- a/drivers/net/cs8900.c
 +++ b/drivers/net/cs8900.c
 @@ -321,15 +321,16 @@ int cs8900_initialize(u8 dev_num, int base_addr)
   memset(priv, 0, sizeof(*priv));
   priv-regs = (struct cs8900_regs *)base_addr;
  
 - /* Load MAC address from EEPROM */
 - cs8900_get_enetaddr(dev);
 -
   dev-iobase = base_addr;
   dev-priv = priv;
   dev-init = cs8900_init;
   dev-halt = cs8900_halt;
   dev-send = cs8900_send;
   dev-recv = cs8900_recv;
 +
 + /* Load MAC address from EEPROM */
 + cs8900_get_enetaddr(dev);
 +
   sprintf(dev-name, %s-%hu, CS8900_DRIVERNAME, dev_num);
  
   eth_register(dev);
   
Applied to net repo with minor commit message editing.

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


Re: [U-Boot] [PATCH 1/6] NAND: Correct the chip_shift calculation

2009-11-09 Thread Scott Wood
On Sat, Nov 07, 2009 at 02:24:06PM -0500, s-paul...@ti.com wrote:
 From: Sandeep Paulraj s-paul...@ti.com
 
 This patch updates the chip_shift calculation in the
 NAND driver. This is being done to sync up the NAND driver with
 the kernel NAND driver.
 
 Signed-off-by: Sandeep Paulraj s-paul...@ti.com

Applied all 7 patches to next, thanks!

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


Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?

2009-11-09 Thread Albert ARIBAUD
Hi PRafulla,

Prafulla Wadaskar a écrit :

  1. For SOC support Orion should be implemented similar to Kirkwood
  (you agreed on this)

I still do. :)

  2. For common drivers for (ex: kirkwood_egiga.c) the common code must
  be abstracted to egiga_core.c and architecture specific code must be
  supported through kirkwood_egiga.c/h and orion_egiga.c/h, this way it
  would make it more clean and structured.

Agreed.

  What is your opinion with #2 suggestion?

Sounds fine! I'll start submitting patches for both common drivers and 
orion support based on this proposal.

Regarding the arch-specific parts of current driver code, should they 
end up in cpu/arm926ejs/{kirkwood,orion5x} or stay in drivers/*? I tend 
like cpu/arm926ejs/* better as it puts everything arch-specific in a 
single place.

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


[U-Boot] [PATCH 1/5] tsec: Clean up Broadcom PHY status parsing

2009-11-09 Thread Peter Tyser
- Remove unnecessary printing Enet starting in speed/duplex
This same information is already printed during normal ethernet
operation in the form Speed: 1000, full duplex.

- Add a check for link before determining link speed and duplex
If there is no link, speed/duplex don't matter.  This also removes
the annoying and unneeded Auto-neg error, defaulting to 10BT/HD
message that occurs when no link is detected.

- Whitespace and line  80 characters cleanup

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 drivers/net/tsec.c |   77 +++-
 1 files changed, 34 insertions(+), 43 deletions(-)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index d8b6619..1038285 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -487,50 +487,41 @@ uint mii_BCM54xx_wirespeed(uint mii_reg, struct 
tsec_private *priv)
  */
 uint mii_parse_BCM54xx_sr(uint mii_reg, struct tsec_private *priv)
 {
+   /* If there is no link, speed and duplex don't matter */
+   if (!priv-link)
+   return 0;
 
-   switch((mii_reg  MIIM_BCM54xx_AUXSTATUS_LINKMODE_MASK)  
MIIM_BCM54xx_AUXSTATUS_LINKMODE_SHIFT){
-
-   case 1:
-   printf(Enet starting in 10BT/HD\n);
-   priv-duplexity = 0;
-   priv-speed = 10;
-   break;
-
-   case 2:
-   printf(Enet starting in 10BT/FD\n);
-   priv-duplexity = 1;
-   priv-speed = 10;
-   break;
-
-   case 3:
-   printf(Enet starting in 100BT/HD\n);
-   priv-duplexity = 0;
-   priv-speed = 100;
-   break;
-
-   case 5:
-   printf(Enet starting in 100BT/FD\n);
-   priv-duplexity = 1;
-   priv-speed = 100;
-   break;
-
-   case 6:
-   printf(Enet starting in 1000BT/HD\n);
-   priv-duplexity = 0;
-   priv-speed = 1000;
-   break;
-
-   case 7:
-   printf(Enet starting in 1000BT/FD\n);
-   priv-duplexity = 1;
-   priv-speed = 1000;
-   break;
-
-   default:
-   printf(Auto-neg error, defaulting to 10BT/HD\n);
-   priv-duplexity = 0;
-   priv-speed = 10;
-   break;
+   switch ((mii_reg  MIIM_BCM54xx_AUXSTATUS_LINKMODE_MASK) 
+   MIIM_BCM54xx_AUXSTATUS_LINKMODE_SHIFT) {
+   case 1:
+   priv-duplexity = 0;
+   priv-speed = 10;
+   break;
+   case 2:
+   priv-duplexity = 1;
+   priv-speed = 10;
+   break;
+   case 3:
+   priv-duplexity = 0;
+   priv-speed = 100;
+   break;
+   case 5:
+   priv-duplexity = 1;
+   priv-speed = 100;
+   break;
+   case 6:
+   priv-duplexity = 0;
+   priv-speed = 1000;
+   break;
+   case 7:
+   priv-duplexity = 1;
+   priv-speed = 1000;
+   break;
+   default:
+   printf(Auto-neg error, defaulting to 10BT/HD\n);
+   priv-duplexity = 0;
+   priv-speed = 10;
+   break;
}
 
return 0;
-- 
1.6.2.1

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


[U-Boot] [PATCH 5/5] tsec: Add TSEC_FIBER flag

2009-11-09 Thread Peter Tyser
The TSEC_FIBER flag should be set when a PHY is operating with an
external fiber interface.  Currently it is only used to notify a user
that the PHY is operating in fiber mode.

A short description was also added to the other TSEC flag defines so
that it is clear how they differ from one another.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 drivers/net/tsec.c |6 --
 include/tsec.h |6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 2f41024..618dadd 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -616,6 +616,7 @@ static uint mii_parse_BCM5482_sr(uint mii_reg, struct 
tsec_private *priv)
 {
if (BCM8482_is_serdes(priv)) {
mii_parse_BCM5482_serdes_sr(priv);
+   priv-flags |= TSEC_FIBER;
} else {
/* Wait for auto-negotiation to complete or fail */
mii_parse_sr(mii_reg, priv);
@@ -939,8 +940,9 @@ static void adjust_link(struct eth_device *dev)
break;
}
 
-   printf(Speed: %d, %s duplex\n, priv-speed,
-  (priv-duplexity) ? full : half);
+   printf(Speed: %d, %s duplex%s\n, priv-speed,
+  (priv-duplexity) ? full : half,
+  (priv-flags  TSEC_FIBER) ? , fiber mode : );
 
} else {
printf(%s: No link.\n, dev-name);
diff --git a/include/tsec.h b/include/tsec.h
index b2e37d4..1e90365 100644
--- a/include/tsec.h
+++ b/include/tsec.h
@@ -584,9 +584,9 @@ typedef struct tsec
 
 /* This flag currently only has
  * meaning if we're using the eTSEC */
-#define TSEC_REDUCED   (1  1)
-
-#define TSEC_SGMII (1  2)
+#define TSEC_REDUCED   (1  1)/* MAC-PHY interface uses RGMII */
+#define TSEC_SGMII (1  2)/* MAC-PHY interface uses SGMII */
+#define TSEC_FIBER (1  3)/* PHY uses fiber, eg 1000 Base-X */
 
 struct tsec_private {
volatile tsec_t *regs;
-- 
1.6.2.1

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


[U-Boot] [PATCH 2/5] tsec: Make functions/data static when possible

2009-11-09 Thread Peter Tyser
This is generally good practice and saves ~150 bytes.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 drivers/net/tsec.c |   90 +++-
 include/tsec.h |1 -
 2 files changed, 47 insertions(+), 44 deletions(-)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 1038285..fd8896c 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -48,14 +48,15 @@ static int tsec_send(struct eth_device *dev,
 volatile void *packet, int length);
 static int tsec_recv(struct eth_device *dev);
 static int tsec_init(struct eth_device *dev, bd_t * bd);
+static int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info);
 static void tsec_halt(struct eth_device *dev);
 static void init_registers(volatile tsec_t * regs);
 static void startup_tsec(struct eth_device *dev);
 static int init_phy(struct eth_device *dev);
 void write_phy_reg(struct tsec_private *priv, uint regnum, uint value);
 uint read_phy_reg(struct tsec_private *priv, uint regnum);
-struct phy_info *get_phy_info(struct eth_device *dev);
-void phy_run_commands(struct tsec_private *priv, struct phy_cmd *cmd);
+static struct phy_info *get_phy_info(struct eth_device *dev);
+static void phy_run_commands(struct tsec_private *priv, struct phy_cmd *cmd);
 static void adjust_link(struct eth_device *dev);
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
 !defined(BITBANGMII)
@@ -112,7 +113,7 @@ int tsec_standard_init(bd_t *bis)
 /* Initialize device structure. Returns success if PHY
  * initialization succeeded (i.e. if it recognizes the PHY)
  */
-int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info)
+static int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info)
 {
struct eth_device *dev;
int i;
@@ -174,7 +175,7 @@ int tsec_initialize(bd_t * bis, struct tsec_info_struct 
*tsec_info)
  * that it returns success if the link is up, failure otherwise.
  * This allows u-boot to find the first active controller.
  */
-int tsec_init(struct eth_device *dev, bd_t * bd)
+static int tsec_init(struct eth_device *dev, bd_t * bd)
 {
uint tempval;
char tmpbuf[MAC_ADDR_LEN];
@@ -243,7 +244,8 @@ static void tsec_local_mdio_write(volatile tsec_mdio_t 
*phyregs, uint addr,
  * notvalid bit cleared), and the bus to cease activity (miimind
  * busy bit cleared), and then returns the value
  */
-uint tsec_local_mdio_read(volatile tsec_mdio_t *phyregs, uint phyid, uint 
regnum)
+static uint tsec_local_mdio_read(volatile tsec_mdio_t *phyregs,
+   uint phyid, uint regnum)
 {
uint value;
 
@@ -342,7 +344,7 @@ static int init_phy(struct eth_device *dev)
  * Returns which value to write to the control register.
  * For 10/100, the value is slightly different
  */
-uint mii_cr_init(uint mii_reg, struct tsec_private * priv)
+static uint mii_cr_init(uint mii_reg, struct tsec_private * priv)
 {
if (priv-flags  TSEC_GIGABIT)
return MIIM_CONTROL_INIT;
@@ -353,7 +355,7 @@ uint mii_cr_init(uint mii_reg, struct tsec_private * priv)
 /*
  * Wait for auto-negotiation to complete, then determine link
  */
-uint mii_parse_sr(uint mii_reg, struct tsec_private * priv)
+static uint mii_parse_sr(uint mii_reg, struct tsec_private * priv)
 {
/*
 * Wait if the link is up, and autonegotiation is in progress
@@ -407,7 +409,7 @@ uint mii_parse_sr(uint mii_reg, struct tsec_private * priv)
  *
  * Stolen from Linux's mii.c and phy_device.c
  */
-uint mii_parse_link(uint mii_reg, struct tsec_private *priv)
+static uint mii_parse_link(uint mii_reg, struct tsec_private *priv)
 {
/* We're using autonegotiation */
if (mii_reg  PHY_BMSR_AUTN_ABLE) {
@@ -476,7 +478,7 @@ uint mii_parse_link(uint mii_reg, struct tsec_private *priv)
  * link.  ether...@wirespeed reduces advertised speed until link
  * can be achieved.
  */
-uint mii_BCM54xx_wirespeed(uint mii_reg, struct tsec_private *priv)
+static uint mii_BCM54xx_wirespeed(uint mii_reg, struct tsec_private *priv)
 {
return (read_phy_reg(priv, mii_reg)  0x8FFF) | 0x8010;
 }
@@ -485,7 +487,7 @@ uint mii_BCM54xx_wirespeed(uint mii_reg, struct 
tsec_private *priv)
  * Parse the BCM54xx status register for speed and duplex information.
  * The linux sungem_phy has this information, but in a table format.
  */
-uint mii_parse_BCM54xx_sr(uint mii_reg, struct tsec_private *priv)
+static uint mii_parse_BCM54xx_sr(uint mii_reg, struct tsec_private *priv)
 {
/* If there is no link, speed and duplex don't matter */
if (!priv-link)
@@ -530,7 +532,7 @@ uint mii_parse_BCM54xx_sr(uint mii_reg, struct tsec_private 
*priv)
 /* Parse the 88E1011's status register for speed and duplex
  * information
  */
-uint mii_parse_88E1011_psr(uint mii_reg, struct tsec_private * priv)
+static uint mii_parse_88E1011_psr(uint mii_reg, struct tsec_private * priv)
 {
uint speed;
 
@@ -588,7 +590,7 @@ uint 

[U-Boot] [PATCH 3/5] tsec: General cleanup

2009-11-09 Thread Peter Tyser
- Cleanup formatting of phy_info structures

- Fix lines  80 chars

- Fix some random indentation inconsistencies

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 drivers/net/tsec.c |  671 +---
 1 files changed, 326 insertions(+), 345 deletions(-)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index fd8896c..a2a1aea 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -236,7 +236,8 @@ static void tsec_local_mdio_write(volatile tsec_mdio_t 
*phyregs, uint addr,
 
 
 /* Provide the default behavior of writing the PHY of this ethernet device */
-#define write_phy_reg(priv, regnum, value) 
tsec_local_mdio_write(priv-phyregs,priv-phyaddr,regnum,value)
+#define write_phy_reg(priv, regnum, value) \
+   tsec_local_mdio_write(priv-phyregs,priv-phyaddr,regnum,value)
 
 /* Reads register regnum on the device's PHY through the
  * specified registers. It lowers and raises the read
@@ -271,7 +272,8 @@ static uint tsec_local_mdio_read(volatile tsec_mdio_t 
*phyregs,
 }
 
 /* #define to provide old read_phy_reg functionality without duplicating code 
*/
-#define read_phy_reg(priv,regnum) 
tsec_local_mdio_read(priv-phyregs,priv-phyaddr,regnum)
+#define read_phy_reg(priv,regnum) \
+   tsec_local_mdio_read(priv-phyregs,priv-phyaddr,regnum)
 
 #define TBIANA_SETTINGS ( \
TBIANA_ASYMMETRIC_PAUSE \
@@ -288,8 +290,8 @@ static uint tsec_local_mdio_read(volatile tsec_mdio_t 
*phyregs,
 /* Configure the TBI for SGMII operation */
 static void tsec_configure_serdes(struct tsec_private *priv)
 {
-   /* Access TBI PHY registers at given TSEC register offset as opposed to 
the
-* register offset used for external PHY accesses */
+   /* Access TBI PHY registers at given TSEC register offset as opposed
+* to the register offset used for external PHY accesses */
tsec_local_mdio_write(priv-phyregs_sgmii, priv-regs-tbipa, TBI_ANA,
TBIANA_SETTINGS);
tsec_local_mdio_write(priv-phyregs_sgmii, priv-regs-tbipa, 
TBI_TBICON,
@@ -993,7 +995,7 @@ static struct phy_info phy_info_M88E1149S = {
0x1410ca,
Marvell 88E1149S,
4,
-   (struct phy_cmd[]){ /* config */
+   (struct phy_cmd[]) { /* config */
/* Reset and configure the PHY */
{MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
{0x1d, 0x1f, NULL},
@@ -1007,17 +1009,16 @@ static struct phy_info phy_info_M88E1149S = {
{MIIM_CONTROL, MIIM_CONTROL_INIT, mii_cr_init},
{miim_end,}
},
-   (struct phy_cmd[]){ /* startup */
+   (struct phy_cmd[]) { /* startup */
/* Status is read once to clear old link state */
{MIIM_STATUS, miim_read, NULL},
/* Auto-negotiate */
{MIIM_STATUS, miim_read, mii_parse_sr},
/* Read the status */
-   {MIIM_88E1011_PHY_STATUS, miim_read,
-mii_parse_88E1011_psr},
+   {MIIM_88E1011_PHY_STATUS, miim_read, mii_parse_88E1011_psr},
{miim_end,}
},
-   (struct phy_cmd[]){ /* shutdown */
+   (struct phy_cmd[]) { /* shutdown */
{miim_end,}
},
 };
@@ -1109,70 +1110,68 @@ static struct phy_info phy_info_M88E1011S = {
0x01410c6,
Marvell 88E1011S,
4,
-   (struct phy_cmd[]){ /* config */
-  /* Reset and configure the PHY */
-  {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-  {0x1d, 0x1f, NULL},
-  {0x1e, 0x200c, NULL},
-  {0x1d, 0x5, NULL},
-  {0x1e, 0x0, NULL},
-  {0x1e, 0x100, NULL},
-  {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
-  {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
-  {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-  {MIIM_CONTROL, MIIM_CONTROL_INIT, mii_cr_init},
-  {miim_end,}
-  },
-   (struct phy_cmd[]){ /* startup */
-  /* Status is read once to clear old link state */
-  {MIIM_STATUS, miim_read, NULL},
-  /* Auto-negotiate */
-  {MIIM_STATUS, miim_read, mii_parse_sr},
-  /* Read the status */
-  {MIIM_88E1011_PHY_STATUS, miim_read,
-   mii_parse_88E1011_psr},
-  {miim_end,}
-  },
-   (struct phy_cmd[]){ /* shutdown */
-  {miim_end,}
-  },
+   (struct phy_cmd[]) {/* config */
+   /* Reset and configure the PHY */
+   {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
+ 

Re: [U-Boot] [PATCH] fsl_elbc_nand: remove the bbt descriptors relocation fixup

2009-11-09 Thread Scott Wood
On Tue, Oct 20, 2009 at 10:30:55AM -0500, Kumar Gala wrote:
 
 On Oct 20, 2009, at 10:28 AM, Scott Wood wrote:
 
 On Tue, Oct 20, 2009 at 10:27:05AM -0500, Kumar Gala wrote:
 
 On Oct 20, 2009, at 3:58 AM, Mingkai Hu wrote:
 
 The commit 66372fe2 manually relocated the bbt pattern pointer,
 which can be removed by using full relocation.
 
 Signed-off-by: Mingkai Hu mingkai...@freescale.com
 ---
 drivers/mtd/nand/fsl_elbc_nand.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)
 
 Scott are you picking this up via the NAND tree?
 
 I can if you want.
 
 Go ahead and pick both up via NAND tree.  I'll ack the second one.

Applied both to next.

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


Re: [U-Boot] [PATCH 1/5] tsec: Clean up Broadcom PHY status parsing

2009-11-09 Thread Peter Tyser
I should have mentioned in the original patches - these are on top of
85xx-next since it looked like there were some recent tsec changes
there.

Peter

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


[U-Boot] [PATCH] Fix CS8900 regression on impa7 board

2009-11-09 Thread Ben Warren
The following error was seen on impa7 board, due to its use of a 32-bit bus
on CS8900.
cs8900.c:137:37: error: macro get_reg_init_bus passed 2 arguments, but takes 
just 1

This patch gives the macro the correct number of arguments

Signed-off-by: Ben Warren biggerbadder...@gmail.com
---
 drivers/net/cs8900.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
index a9d1f22..df36004 100644
--- a/drivers/net/cs8900.c
+++ b/drivers/net/cs8900.c
@@ -56,7 +56,7 @@
 #define REG_READ(a) readl((a))
 
 /* we don't need 16 bit initialisation on 32 bit bus */
-#define get_reg_init_bus(x) get_reg((x))
+#define get_reg_init_bus(r,d) get_reg((r),(d))
 
 #else
 
-- 
1.6.0.4

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


Re: [U-Boot] [PATCH 3/3] [OneNAND] Flex-OneNAND boundary settings

2009-11-09 Thread Scott Wood
On Fri, Nov 06, 2009 at 05:17:44PM +0530, Amul Kumar Saha wrote:
 - printk(Bad blocks %d at 0x%x\n,
 -(u32)(ofs  this-erase_shift), (u32)ofs);
 + printk(Bad blocks %lu at 0x%x\n,
 +(u32)onenand_block(this, ofs), (u32)ofs);

cmd_onenand.c: In function ‘onenand_block_read’:
cmd_onenand.c:103: warning: format ‘%lu’ expects type ‘long unsigned int’,
but argument 2 has type ‘unsigned int’

If you must pass a u32 to printf, use %u or %x -- but it makes little
sense to explicitly cast from int to something that doesn't have a standard
printf format string.

How about this?

+   printk(Bad block %d at 0x%llx\n,
+  onenand_block(this, ofs), ofs);

Likewise throughout the rest of the file.

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


Re: [U-Boot] [RFC 4/4] MXC: Reorganize 16 bit nand detection.

2009-11-09 Thread Scott Wood
On Sun, Nov 08, 2009 at 11:55:39AM +0100, Magnus Lilja wrote:
 Alternative solution for supporting 16 bit NAND detection for the
 i.MX27 and i.MX31 SoCs. This moves the SoC specific code to the SoC header
 file leaving mxc_nand.c free from #ifdef's (in this respect).

OTOH, it moves more NAND stuff out of the NAND driver.

I guess it depends on how many more such alternatives you think will be
added in the future.

 diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
 index 3e4254a..45d0024 100644
 --- a/drivers/mtd/nand/mxc_nand.c
 +++ b/drivers/mtd/nand/mxc_nand.c
 @@ -808,8 +808,6 @@ static void mxc_nand_command(struct mtd_info *mtd, 
 unsigned command,
  
  int board_nand_init(struct nand_chip *this)
  {
 - struct system_control_regs *sc_regs =
 - (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
   struct mtd_info *mtd;
   uint16_t tmp;
   int err = 0;
 @@ -871,15 +869,9 @@ int board_nand_init(struct nand_chip *this)
   writew(0x4, host-regs-nfc_wrprot);
  
   /* NAND bus width determines access funtions used by upper layer */
 -#ifdef CONFIG_MX27
 - if (readl(sc_regs-fmcr)  NF_16BIT_SEL)
 - this-options |= NAND_BUSWIDTH_16;
 -#elif defined(CONFIG_MX31)
 - if (readl(sc_regs-rcsr)  CCM_RCSR_NF16B)
 + if (mxc_nand_is_16bit())
   this-options |= NAND_BUSWIDTH_16;
 -#else
 -#warning No autodetection of 8/16 bit NAND
 -#endif
 +
   host-pagesize_2k = 0;
  
   return err;
 diff --git a/include/asm-arm/arch-mx27/imx-regs.h 
 b/include/asm-arm/arch-mx27/imx-regs.h
 index d36a6da..b88fe51 100644
 --- a/include/asm-arm/arch-mx27/imx-regs.h
 +++ b/include/asm-arm/arch-mx27/imx-regs.h
 @@ -516,4 +516,17 @@ struct iim_regs {
  #define IIM0_SCC_KEY 11
  #define IIM1_SUID1
  
 +#ifndef __ASSEMBLY__
 +static inline int mxc_nand_is_16bit(void)
 +{
 + struct system_control_regs *sc_regs =
 + (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
 +
 + if (readl(sc_regs-rcsr)  CCM_RCSR_NF16B)
 + return 1;
 + else
 + return 0;
 +}
 +#endif
 +
  #endif   /* _IMX_REGS_H */
 diff --git a/include/asm-arm/arch-mx31/mx31-regs.h 
 b/include/asm-arm/arch-mx31/mx31-regs.h
 index 86c9975..613c632 100644
 --- a/include/asm-arm/arch-mx31/mx31-regs.h
 +++ b/include/asm-arm/arch-mx31/mx31-regs.h
 @@ -63,6 +63,19 @@ struct system_control_regs {
  #define CCM_RCSR_NF16B   (1  31)
  #define CCM_RCSR_NFMS(1  30)
  
 +#include asm/io.h
 +
 +static inline int mxc_nand_is_16bit(void)
 +{
 + struct system_control_regs *sc_regs =
 + (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
 +
 + if (readl(sc_regs-rcsr)  CCM_RCSR_NF16B)
 + return 1;
 + else
 + return 0;
 +}
 +
  #endif

It looks like you put the MX31 version in the MX27 file as well...

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


[U-Boot] [PATCH] circbuf: Move to lib_generic and conditionally compile

2009-11-09 Thread Peter Tyser
circbuf could be used as a generic library and is only currently
needed when CONFIG_USB_TTY is defined.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 common/Makefile   |1 -
 lib_generic/Makefile  |1 +
 {common = lib_generic}/circbuf.c |0
 3 files changed, 1 insertions(+), 1 deletions(-)
 rename {common = lib_generic}/circbuf.c (100%)

diff --git a/common/Makefile b/common/Makefile
index 3781738..47f6a71 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -29,7 +29,6 @@ AOBJS =
 
 # core
 COBJS-y += main.o
-COBJS-y += circbuf.o
 COBJS-y += console.o
 COBJS-y += command.o
 COBJS-y += dlmalloc.o
diff --git a/lib_generic/Makefile b/lib_generic/Makefile
index 686601c..2ec261a 100644
--- a/lib_generic/Makefile
+++ b/lib_generic/Makefile
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_BZIP2) += bzlib_crctable.o
 COBJS-$(CONFIG_BZIP2) += bzlib_decompress.o
 COBJS-$(CONFIG_BZIP2) += bzlib_randtable.o
 COBJS-$(CONFIG_BZIP2) += bzlib_huffman.o
+COBJS-$(CONFIG_USB_TTY) += circbuf.o
 COBJS-y += crc16.o
 COBJS-y += crc32.o
 COBJS-y += ctype.o
diff --git a/common/circbuf.c b/lib_generic/circbuf.c
similarity index 100%
rename from common/circbuf.c
rename to lib_generic/circbuf.c
-- 
1.6.2.1

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


[U-Boot] [PATCH] m41t11: Remove unused functions

2009-11-09 Thread Peter Tyser
Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 drivers/rtc/m41t11.c |   14 --
 1 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/drivers/rtc/m41t11.c b/drivers/rtc/m41t11.c
index e0c27e1..bb13487 100644
--- a/drivers/rtc/m41t11.c
+++ b/drivers/rtc/m41t11.c
@@ -181,18 +181,4 @@ void rtc_reset (void)
val = val  0x3F;/*turn off freq test keep calibration*/
i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_CONTROL_ADDR, 1, val, 1);
 }
-
-int rtc_store(int addr, unsigned char* data, int size)
-{
-   /*don't let things wrap onto the time on a write*/
-   if( (addr+size) = M41T11_STORAGE_SZ )
-   return 1;
-   return i2c_write( CONFIG_SYS_I2C_RTC_ADDR, REG_CNT+addr, 1, data, size 
);
-}
-
-int rtc_recall(int addr, unsigned char* data, int size)
-{
-   return i2c_read( CONFIG_SYS_I2C_RTC_ADDR, REG_CNT+addr, 1, data, size );
-}
-
 #endif
-- 
1.6.2.1

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


[U-Boot] [PATCH] smc91111_eeprom: fix compile warning

2009-11-09 Thread Ben Warren
smc9_eeprom.c:278: warning: suggest parentheses around + or - in operand
smc9_eeprom.c:281: warning: suggest parentheses around + or - in operand

Signed-off-by: Ben Warren biggerbadder...@gmail.com
---
 examples/standalone/smc9_eeprom.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/standalone/smc9_eeprom.c 
b/examples/standalone/smc9_eeprom.c
index 89afc87..345b1ab 100644
--- a/examples/standalone/smc9_eeprom.c
+++ b/examples/standalone/smc9_eeprom.c
@@ -275,10 +275,10 @@ void print_macaddr (struct eth_device *dev)
printf (Current MAC Address in SMSC9 );
SMC_SELECT_BANK (dev, 1);
for (i = 0; i  5; i++) {
-   printf (%02x:, SMC_inb (dev, ADDR0_REG + i));
+   printf (%02x:, SMC_inb (dev, (ADDR0_REG + i)));
}
 
-   printf (%02x\n, SMC_inb (dev, ADDR0_REG + 5));
+   printf (%02x\n, SMC_inb (dev, (ADDR0_REG + 5)));
 
i = 0;
for (j = 0x20; j  0x23; j++) {
-- 
1.6.0.4

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


[U-Boot] [PATCH] Fix SMC91111 regression: lpd7a40x build failures

2009-11-09 Thread Ben Warren
Both lpd7a400 and lpd7a404 failed to compile because they had
CONFIG_SMC_USE_IOFUNCS defined:

examples/standalone/smc9_eeprom.c:388: undefined reference to `SMC_outw'

Also removed an orphaned paren in lpd7a404.h

Signed-off-by: Ben Warren biggerbadder...@gmail.com
---

NOTE: I have only compile tested this.  I'm not sure how this ever worked,
since the SMC9 rework didn't make any functional changes to the accessors.

 include/configs/lpd7a400-10.h |1 -
 include/configs/lpd7a404-10.h |1 -
 include/configs/lpd7a404.h|2 +-
 3 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/include/configs/lpd7a400-10.h b/include/configs/lpd7a400-10.h
index 5f57c3a..91bf1fa 100644
--- a/include/configs/lpd7a400-10.h
+++ b/include/configs/lpd7a400-10.h
@@ -76,6 +76,5 @@
 #define CONFIG_SMC9
 #define CONFIG_SMC9_BASE   (0x7000)
 #undef CONFIG_SMC_USE_32_BIT
-#define CONFIG_SMC_USE_IOFUNCS
 
 #endif  /* __LPD7A400_10_H */
diff --git a/include/configs/lpd7a404-10.h b/include/configs/lpd7a404-10.h
index 9074e28..b10e69d 100644
--- a/include/configs/lpd7a404-10.h
+++ b/include/configs/lpd7a404-10.h
@@ -76,6 +76,5 @@
 #define CONFIG_SMC9
 #define CONFIG_SMC9_BASE   (0x7000)
 #undef CONFIG_SMC_USE_32_BIT
-#define CONFIG_SMC_USE_IOFUNCS
 
 #endif  /* __LPD7A404_10_H */
diff --git a/include/configs/lpd7a404.h b/include/configs/lpd7a404.h
index 102c0af..557f389 100644
--- a/include/configs/lpd7a404.h
+++ b/include/configs/lpd7a404.h
@@ -72,7 +72,7 @@
 #include config_cmd_default.h
 
 #ifndef USE_920T_MMU
-#define CONFIG_CMD_PING)
+#define CONFIG_CMD_PING
 #undef CONFIG_CMD_CACHE
 #else
 #define CONFIG_CMD_DATE
-- 
1.6.0.4

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


Re: [U-Boot] [PATCH] smc91111_eeprom: fix compile warning

2009-11-09 Thread Mike Frysinger
On Monday 09 November 2009 16:19:58 Ben Warren wrote:
 smc9_eeprom.c:278: warning: suggest parentheses around + or - in
  operand
  smc9_eeprom.c:281: warning: suggest parentheses around + or -
  in operand
 
   for (i = 0; i  5; i++) {
 - printf (%02x:, SMC_inb (dev, ADDR0_REG + i));
 + printf (%02x:, SMC_inb (dev, (ADDR0_REG + i)));
   }

erm, this says to me that the SMC inb macro is broken.  it should be using 
paren when expanding the second argument.  so lets fix that instead.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] smc91111_eeprom: fix compile warning

2009-11-09 Thread Ben Warren
Mike Frysinger wrote:
 On Monday 09 November 2009 16:19:58 Ben Warren wrote:
   
 smc9_eeprom.c:278: warning: suggest parentheses around + or - in
  operand
  smc9_eeprom.c:281: warning: suggest parentheses around + or -
  in operand

  for (i = 0; i  5; i++) {
 -printf (%02x:, SMC_inb (dev, ADDR0_REG + i));
 +printf (%02x:, SMC_inb (dev, (ADDR0_REG + i)));
  }
 

 erm, this says to me that the SMC inb macro is broken.  it should be using 
 paren when expanding the second argument.  so lets fix that instead.
 -mike
   

Yeah, I see where it is:

#define SMC_inb(a,p)  ({ \
unsigned int __p = (unsigned int)((a)-iobase + (p1)); \
unsigned int __v = *(volatile unsigned short *)((__p)  ~2); \
if (__p  2) __v = 8; \
else __v = 0xff; \
__v; })


(p1) -- ((p)1)

Thanks for pointing this out.  Patch coming up.

regards,
Ben

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


Re: [U-Boot] AT91 Rework

2009-11-09 Thread Wolfgang Denk
Dear Jens Scharsig,

In message 4af5cc8f.7040...@scharsoft.de you wrote:

 But I have a problem with lowlevel_init.s files
 Both AT91 and AT91RM9200 use the register defines here.
 The C header files have a
 
 #ifndef __assembly
 ...
 #endif
 
 to prevent assembler error.
 
 My Question:
 
 Should we move the handfull defines used by assembly code
 to a separate header file (lowlevel.h), or
 to the front of the lowlevel_init.s files, or
 define it a #ifndef __assembly ... #endif block

I'm not too familiar with that code, so I tend to trust you who knows
it better than me - just apply common sense. If in doubt, go for the
minimal invasive changes - this is something we can clean up later
easily, too.

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: w...@denx.de
There's another way to survive.  Mutual trust -- and help.
-- Kirk, Day of the Dove, stardate unknown
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] ARM pull request

2009-11-09 Thread Wolfgang Denk
Dear Tom,

In message 4af600f5.8090...@windriver.com you wrote:

 I have cherry picked this commit into arm/master-sync.
 This is the pull request.

Thanks.

 The following changes since commit b91b8f74fe9ded18344c3d03080a4abc07254502:
Wolfgang Denk (1):
  Merge branch 'master' of /home/wd/git/u-boot/custodians
 
 are available in the git repository at:
 
git://git.denx.de/u-boot-arm master-sync
 
 Remy Bohmer (1):
ARM: Use Linux version for unaligned access code
 
   include/asm-arm/unaligned.h|3 +-
   include/linux/unaligned/be_byteshift.h |   70 
 
   include/linux/unaligned/le_byteshift.h |   70 
 
   3 files changed, 142 insertions(+), 1 deletions(-)
   create mode 100644 include/linux/unaligned/be_byteshift.h
   create mode 100644 include/linux/unaligned/le_byteshift.h

Appliewd, 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: w...@denx.de
Of all the things I've lost, I miss my mind the most.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] SMC91111: Clean up SMC_inx macros on xsengine and xaeniax

2009-11-09 Thread Ben Warren
This patch fixes the following warnings:

Configuring for xaeniax board...
smc9_eeprom.c: In function 'print_macaddr':
smc9_eeprom.c:278: warning: suggest parentheses around + or - in operand of 

smc9_eeprom.c:281: warning: suggest parentheses around + or - in operand of 

...
Configuring for xsengine board...
smc9_eeprom.c: In function 'print_macaddr':
smc9_eeprom.c:278: warning: suggest parentheses around + or - inside shift
smc9_eeprom.c:281: warning: suggest parentheses around + or - inside shift

Signed-off-by: Ben Warren biggerbadder...@gmail.com
---

This replaces the previous 'bad' patch named
'smc9_eeprom: fix compile warning

 drivers/net/smc9.h |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/smc9.h b/drivers/net/smc9.h
index bb45241..895c749 100644
--- a/drivers/net/smc9.h
+++ b/drivers/net/smc9.h
@@ -81,10 +81,10 @@ struct smc9_priv{
 #ifdef CONFIG_PXA250
 
 #ifdef CONFIG_XSENGINE
-#defineSMC_inl(a,r)(*((volatile dword *)((a)-iobase+(r1
-#defineSMC_inw(a,r)(*((volatile word *)((a)-iobase+(r1
+#defineSMC_inl(a,r)(*((volatile dword *)((a)-iobase+((r)1
+#defineSMC_inw(a,r)(*((volatile word *)((a)-iobase+((r)1
 #define SMC_inb(a,p)  ({ \
-   unsigned int __p = (unsigned int)((a)-iobase + (p1)); \
+   unsigned int __p = (unsigned int)((a)-iobase + ((p)1)); \
unsigned int __v = *(volatile unsigned short *)((__p)  ~2); \
if (__p  2) __v = 8; \
else __v = 0xff; \
@@ -99,7 +99,7 @@ struct smc9_priv{
__v; })
 #define SMC_inb(a,p)   ({ \
unsigned int ___v = SMC_inw((a),(p)  ~1); \
-   if (p  1) ___v = 8; \
+   if ((p)  1) ___v = 8; \
else ___v = 0xff; \
___v; })
 #else
-- 
1.6.0.4

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


[U-Boot] [PATCH 2/7] 85xx/86xx: Add ECC error injection defines

2009-11-09 Thread Peter Tyser
These defines are needed for the upcoming ECC driver.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 include/asm-ppc/immap_85xx.h |4 
 include/asm-ppc/immap_86xx.h |3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-ppc/immap_85xx.h b/include/asm-ppc/immap_85xx.h
index 4194295..b283986 100644
--- a/include/asm-ppc/immap_85xx.h
+++ b/include/asm-ppc/immap_85xx.h
@@ -167,6 +167,10 @@ typedef struct ccsr_ddr {
u32 data_err_inject_hi; /* Data Path Err Injection Mask High */
u32 data_err_inject_lo; /* Data Path Err Injection Mask Low */
u32 ecc_err_inject; /* Data Path Err Injection Mask ECC */
+#define ECC_ERR_INJECT_APIEN   0x0001  /* Address Parity Injection */
+#define ECC_ERR_INJECT_EMB 0x0200  /* ECC Mirror Byte */
+#define ECC_ERR_INJECT_EIEN0x0100  /* Error Injection Enable */
+#define ECC_ERR_INJECT_EEIM0x00ff  /* ECC Erroe Injection Enable */
u8  res9[20];
u32 capture_data_hi;/* Data Path Read Capture High */
u32 capture_data_lo;/* Data Path Read Capture Low */
diff --git a/include/asm-ppc/immap_86xx.h b/include/asm-ppc/immap_86xx.h
index fdfc654..384912f 100644
--- a/include/asm-ppc/immap_86xx.h
+++ b/include/asm-ppc/immap_86xx.h
@@ -135,6 +135,9 @@ typedef struct ccsr_ddr {
uintdata_err_inject_hi; /* 0x2e00 - DDR Memory Data Path Error 
Injection Mask High */
uintdata_err_inject_lo; /* 0x2e04 - DDR Memory Data Path Error 
Injection Mask Low */
uintecc_err_inject; /* 0x2e08 - DDR Memory Data Path Error 
Injection Mask ECC */
+#define ECC_ERR_INJECT_EMB 0x0200  /* ECC Mirror Byte */
+#define ECC_ERR_INJECT_EIEN0x0100  /* Error Injection Enable */
+#define ECC_ERR_INJECT_EEIM0x00ff  /* ECC Erroe Injection Enable */
charres12[20];
uintcapture_data_hi;/* 0x2e20 - DDR Memory Data Path Read 
Capture High */
uintcapture_data_lo;/* 0x2e24 - DDR Memory Data Path Read 
Capture Low */
-- 
1.6.2.1

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


[U-Boot] [PATCH 1/7] 83xx: Add CCSR DDR register offsets

2009-11-09 Thread Peter Tyser
Using the same naming convention for CCSR register addresses between the
83xx, 85xx, and 86xx platforms makes it a bit easier to share code
between them.

A small amount of asthetic cleanup was also done in this change.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 include/asm-ppc/immap_83xx.h |   22 +++---
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/include/asm-ppc/immap_83xx.h b/include/asm-ppc/immap_83xx.h
index c60a7d2..a9d0698 100644
--- a/include/asm-ppc/immap_83xx.h
+++ b/include/asm-ppc/immap_83xx.h
@@ -858,14 +858,22 @@ typedef struct immap {
 } immap_t;
 #endif
 
-#define CONFIG_SYS_MPC83xx_DMA_OFFSET  (0x8000)
-#define CONFIG_SYS_MPC83xx_DMA_ADDR(CONFIG_SYS_IMMR + 
CONFIG_SYS_MPC83xx_DMA_OFFSET)
-#define CONFIG_SYS_MPC83xx_ESDHC_OFFSET(0x2e000)
-#define CONFIG_SYS_MPC83xx_ESDHC_ADDR  (CONFIG_SYS_IMMR + 
CONFIG_SYS_MPC83xx_ESDHC_OFFSET)
-
+#define CONFIG_SYS_MPC83xx_DDR_OFFSET  0x2000
+#define CONFIG_SYS_MPC83xx_DMA_OFFSET  0x8000
+#define CONFIG_SYS_MPC83xx_DDR2_OFFSET 0xd000
 #ifndef CONFIG_SYS_MPC83xx_USB_OFFSET
-#define CONFIG_SYS_MPC83xx_USB_OFFSET  0x23000
+#define CONFIG_SYS_MPC83xx_USB_OFFSET  0x23000
 #endif
+#define CONFIG_SYS_MPC83xx_ESDHC_OFFSET0x2e000
+
+#define CONFIG_SYS_MPC83xx_DDR_ADDR \
+   (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_DDR_OFFSET)
+#define CONFIG_SYS_MPC83xx_DDR2_ADDR \
+   (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_DDR2_OFFSET)
+#define CONFIG_SYS_MPC83xx_DMA_ADDR \
+   (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_DMA_OFFSET)
+#define CONFIG_SYS_MPC83xx_ESDHC_ADDR \
+   (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_ESDHC_OFFSET)
 #define CONFIG_SYS_MPC83xx_USB_ADDR \
-   (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_USB_OFFSET)
+   (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_USB_OFFSET)
 #endif /* __IMMAP_83xx__ */
-- 
1.6.2.1

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


[U-Boot] [PATCH v2 0/7] 83xx/85xx/86xx ECC update

2009-11-09 Thread Peter Tyser
This patch series is similar to the 8xxx: Add 'ecc' command recently
submitted but has the following changes:
- Supports 83xx/85xx/86xx, previously 83xx wasn't supported
- Removes the old 83xx ecc command and replaces it with this new
  implementation
- Places the ecc code in a new drivers/edac directory instead of
  in cpu/8xxx
- The ecc command is enabled via CONFIG_EDAC_FSL_ECC instead of
  CONFIG_CMD_ECC

I compile tested on 83xx, but don't have any 83xx boards to test
on, so it'd be much appreciated if someone else could give it a shot.
If people don't want to actually ground signals on their boards,
they can inject an error then modify memory or perform a mtest to
simulate ecc errors.

Peter Tyser (7):
  83xx: Add CCSR DDR register offsets
  85xx/86xx: Add ECC error injection defines
  83xx/85xx/86xx: Add ECC support
  83xx: Migrate CONFIG_DDR_ECC_CMD to CONFIG_FSL_EDAC_ECC
  Add check for ECC errors during SDRAM POST and mtest
  xes: Add 8xxx post support
  xes: Enable memory POST and ECC error reporting

 Makefile |2 +
 board/xes/common/Makefile|1 +
 board/xes/common/fsl_8xxx_post.c |   36 
 common/cmd_mem.c |   10 +
 cpu/mpc83xx/Makefile |1 -
 cpu/mpc83xx/ecc.c|  390 --
 drivers/edac/Makefile|   46 +
 drivers/edac/fsl_8xxx_ecc.c  |  381 +
 include/asm-ppc/immap_83xx.h |   22 ++-
 include/asm-ppc/immap_85xx.h |4 +
 include/asm-ppc/immap_86xx.h |3 +
 include/common.h |6 +
 include/configs/MPC8349EMDS.h|2 +-
 include/configs/MPC8360EMDS.h|2 +-
 include/configs/MPC8360ERDK.h|2 +-
 include/configs/MPC837XEMDS.h|2 +-
 include/configs/MPC837XERDB.h|2 +-
 include/configs/XPEDITE5170.h|3 +
 include/configs/XPEDITE5200.h|3 +
 include/configs/XPEDITE5370.h|3 +
 include/configs/sbc8349.h|2 +-
 include/configs/vme8349.h|2 +-
 post/drivers/memory.c|5 +
 23 files changed, 525 insertions(+), 405 deletions(-)
 create mode 100644 board/xes/common/fsl_8xxx_post.c
 delete mode 100644 cpu/mpc83xx/ecc.c
 create mode 100644 drivers/edac/Makefile
 create mode 100644 drivers/edac/fsl_8xxx_ecc.c

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


[U-Boot] [PATCH 5/7] Add check for ECC errors during SDRAM POST and mtest

2009-11-09 Thread Peter Tyser
Add a CONFIG_CHECK_ECC_ERRORS define which causes the SDRAM POST and
mtest command to check for ECC errors during execution.

The 83xx, 85xx, and 86xx architectures currently support enabling
CONFIG_CHECK_ECC_ERRORS.  Other architectures/boards can use it if they
implement an ecc_count() and ecc_info() function.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 common/cmd_mem.c  |   10 ++
 include/common.h  |6 ++
 post/drivers/memory.c |5 +
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index a34b342..efedf79 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -691,6 +691,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
__FUNCTION__, __LINE__, start, end);
 
for (;;) {
+#ifdef CONFIG_CHECK_ECC_ERRORS
+   if (ecc_count())
+   ecc_info();
+#endif
+
if (ctrlc()) {
putc ('\n');
return 1;
@@ -917,6 +922,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
 #else /* The original, quickie test */
incr = 1;
for (;;) {
+#ifdef CONFIG_CHECK_ECC_ERRORS
+   if (ecc_count())
+   ecc_info();
+#endif
+
if (ctrlc()) {
putc ('\n');
return 1;
diff --git a/include/common.h b/include/common.h
index 7df9afa..e606a74 100644
--- a/include/common.h
+++ b/include/common.h
@@ -310,6 +310,12 @@ void   api_init (void);
 /* common/memsize.c */
 long   get_ram_size  (volatile long *, long);
 
+/* driver/edac/ */
+#ifdef CONFIG_CHECK_ECC_ERRORS
+void ecc_info(void);
+int ecc_count(void);
+#endif
+
 /* $(BOARD)/$(BOARD).c */
 void   reset_phy (void);
 void   fdc_hw_init   (void);
diff --git a/post/drivers/memory.c b/post/drivers/memory.c
index 0062360..b8bbac5 100644
--- a/post/drivers/memory.c
+++ b/post/drivers/memory.c
@@ -477,6 +477,11 @@ int memory_post_test (int flags)
}
}
 
+#ifdef CONFIG_CHECK_ECC_ERRORS
+   if (ecc_count())
+   printf(WARNING: %d ECC errors detected!!\n, ecc_count());
+#endif
+
return ret;
 }
 
-- 
1.6.2.1

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


[U-Boot] [PATCH 4/7] 83xx: Migrate CONFIG_DDR_ECC_CMD to CONFIG_EDAC_FSL_ECC

2009-11-09 Thread Peter Tyser
Update 83xx boards to use the same ECC driver that the 85xx and 86xx
boards currently use.  The common 83xx/85xx/86xx ECC driver has
fewer options, but better error reporting.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 cpu/mpc83xx/Makefile  |1 -
 cpu/mpc83xx/ecc.c |  390 -
 include/configs/MPC8349EMDS.h |2 +-
 include/configs/MPC8360EMDS.h |2 +-
 include/configs/MPC8360ERDK.h |2 +-
 include/configs/MPC837XEMDS.h |2 +-
 include/configs/MPC837XERDB.h |2 +-
 include/configs/sbc8349.h |2 +-
 include/configs/vme8349.h |2 +-
 9 files changed, 7 insertions(+), 398 deletions(-)
 delete mode 100644 cpu/mpc83xx/ecc.c

diff --git a/cpu/mpc83xx/Makefile b/cpu/mpc83xx/Makefile
index 15e2c18..8fda557 100644
--- a/cpu/mpc83xx/Makefile
+++ b/cpu/mpc83xx/Makefile
@@ -35,7 +35,6 @@ COBJS-y += cpu_init.o
 COBJS-y += speed.o
 COBJS-y += interrupts.o
 COBJS-y += spd_sdram.o
-COBJS-y += ecc.o
 COBJS-$(CONFIG_QE) += qe_io.o
 COBJS-$(CONFIG_FSL_SERDES) += serdes.o
 COBJS-$(CONFIG_PCI) += pci.o
diff --git a/cpu/mpc83xx/ecc.c b/cpu/mpc83xx/ecc.c
deleted file mode 100644
index f3942b4..000
--- a/cpu/mpc83xx/ecc.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * Copyright (C) 2007 Freescale Semiconductor, Inc.
- *
- * Dave Liu dave...@freescale.com
- * based on the contribution of Marian Balakowicz m...@semihalf.com
- *
- * 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.
- */
-
-#include common.h
-#include mpc83xx.h
-#include command.h
-
-#if defined(CONFIG_DDR_ECC)  defined(CONFIG_DDR_ECC_CMD)
-void ecc_print_status(void)
-{
-   volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
-   volatile ddr83xx_t *ddr = immap-ddr;
-
-   printf(\nECC mode: %s\n\n,
-  (ddr-sdram_cfg  SDRAM_CFG_ECC_EN) ? ON : OFF);
-
-   /* Interrupts */
-   printf(Memory Error Interrupt Enable:\n);
-   printf(  Multiple-Bit Error Interrupt Enable: %d\n,
-  (ddr-err_int_en  ECC_ERR_INT_EN_MBEE) ? 1 : 0);
-   printf(  Single-Bit Error Interrupt Enable: %d\n,
-  (ddr-err_int_en  ECC_ERR_INT_EN_SBEE) ? 1 : 0);
-   printf(  Memory Select Error Interrupt Enable: %d\n\n,
-  (ddr-err_int_en  ECC_ERR_INT_EN_MSEE) ? 1 : 0);
-
-   /* Error disable */
-   printf(Memory Error Disable:\n);
-   printf(  Multiple-Bit Error Disable: %d\n,
-  (ddr-err_disable  ECC_ERROR_DISABLE_MBED) ? 1 : 0);
-   printf(  Sinle-Bit Error Disable: %d\n,
-  (ddr-err_disable  ECC_ERROR_DISABLE_SBED) ? 1 : 0);
-   printf(  Memory Select Error Disable: %d\n\n,
-  (ddr-err_disable  ECC_ERROR_DISABLE_MSED) ? 1 : 0);
-
-   /* Error injection */
-   printf(Memory Data Path Error Injection Mask High/Low: %08x %08x\n,
-  ddr-data_err_inject_hi, ddr-data_err_inject_lo);
-
-   printf(Memory Data Path Error Injection Mask ECC:\n);
-   printf(  ECC Mirror Byte: %d\n,
-  (ddr-ecc_err_inject  ECC_ERR_INJECT_EMB) ? 1 : 0);
-   printf(  ECC Injection Enable: %d\n,
-  (ddr-ecc_err_inject  ECC_ERR_INJECT_EIEN) ? 1 : 0);
-   printf(  ECC Error Injection Mask: 0x%02x\n\n,
-  ddr-ecc_err_inject  ECC_ERR_INJECT_EEIM);
-
-   /* SBE counter/threshold */
-   printf(Memory Single-Bit Error Management (0..255):\n);
-   printf(  Single-Bit Error Threshold: %d\n,
-  (ddr-err_sbe  ECC_ERROR_MAN_SBET)  ECC_ERROR_MAN_SBET_SHIFT);
-   printf(  Single-Bit Error Counter: %d\n\n,
-  (ddr-err_sbe  ECC_ERROR_MAN_SBEC)  ECC_ERROR_MAN_SBEC_SHIFT);
-
-   /* Error detect */
-   printf(Memory Error Detect:\n);
-   printf(  Multiple Memory Errors: %d\n,
-  (ddr-err_detect  ECC_ERROR_DETECT_MME) ? 1 : 0);
-   printf(  Multiple-Bit Error: %d\n,
-  (ddr-err_detect  ECC_ERROR_DETECT_MBE) ? 1 : 0);
-   printf(  Single-Bit Error: %d\n,
-  (ddr-err_detect  ECC_ERROR_DETECT_SBE) ? 1 : 0);
-   printf(  Memory Select Error: %d\n\n,
-  (ddr-err_detect  ECC_ERROR_DETECT_MSE) ? 1 : 0);
-
-   /* Capture data */
-   printf(Memory Error Address Capture: 0x%08x\n, ddr-capture_address);
-   printf(Memory Data Path Read Capture High/Low: %08x %08x\n,
-  ddr-capture_data_hi, ddr-capture_data_lo);
-   printf(Memory Data Path Read Capture ECC: 0x%02x\n\n,
-  ddr-capture_ecc  CAPTURE_ECC_ECE);
-
-   printf(Memory Error Attributes Capture:\n);
-   printf( Data Beat Number: %d\n,
-  (ddr-capture_attributes  ECC_CAPT_ATTR_BNUM) 
-  ECC_CAPT_ATTR_BNUM_SHIFT);
-   printf(  Transaction Size: 

[U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support

2009-11-09 Thread Peter Tyser
Add a new 'ecc' command to interact with the 83xx, 85xx, and 86xx DDR
ECC registers.  The 'ecc' command can inject data/ECC errors to simulate
errors and provides an 'info' subcommand which displays ECC error
information such as failure address, read vs expected data/ECC,
physical signal which failed, single-bit error count, and multiple bit
error occurrence.  An example of the 'ecc info' command follows:

WARNING: ECC error in DDR Controller 0
Addr:   0x0_01001000
Data:   0x0001_ ECC:0x00
Expect: 0x_ ECC:0x00
Net:DATA32
Syndrome: 0xce
Single-Bit errors: 0x40
Attrib: 0x30112001
Detect: 0x8004 (MME, SBE)

This new 'ecc' command support was placed in a new drives/edac
directory which can be used to support general Error Detection and
Correction (EDAC) code similar to Linux.

Signed-off-by: Peter Tyser pty...@xes-inc.com
Signed-off-by: John Schmoller jschmol...@xes-inc.com
---
 Makefile|2 +
 drivers/edac/Makefile   |   46 +
 drivers/edac/fsl_8xxx_ecc.c |  381 +++
 3 files changed, 429 insertions(+), 0 deletions(-)
 create mode 100644 drivers/edac/Makefile
 create mode 100644 drivers/edac/fsl_8xxx_ecc.c

diff --git a/Makefile b/Makefile
index bed9469..3663780 100644
--- a/Makefile
+++ b/Makefile
@@ -204,6 +204,7 @@ LIBS += disk/libdisk.a
 LIBS += drivers/bios_emulator/libatibiosemu.a
 LIBS += drivers/block/libblock.a
 LIBS += drivers/dma/libdma.a
+LIBS += drivers/edac/libedac.a
 LIBS += drivers/fpga/libfpga.a
 LIBS += drivers/gpio/libgpio.a
 LIBS += drivers/hwmon/libhwmon.a
@@ -416,6 +417,7 @@ TAG_SUBDIRS += disk
 TAG_SUBDIRS += common
 TAG_SUBDIRS += drivers/bios_emulator
 TAG_SUBDIRS += drivers/block
+TAG_SUBDIRS += drivers/edac
 TAG_SUBDIRS += drivers/gpio
 TAG_SUBDIRS += drivers/hwmon
 TAG_SUBDIRS += drivers/i2c
diff --git a/drivers/edac/Makefile b/drivers/edac/Makefile
new file mode 100644
index 000..92ab497
--- /dev/null
+++ b/drivers/edac/Makefile
@@ -0,0 +1,46 @@
+#
+# (C) Copyright 2000-2007
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB:= $(obj)libedac.a
+
+COBJS-$(CONFIG_EDAC_FSL_ECC) += fsl_8xxx_ecc.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/drivers/edac/fsl_8xxx_ecc.c b/drivers/edac/fsl_8xxx_ecc.c
new file mode 100644
index 000..8f3bc7e
--- /dev/null
+++ b/drivers/edac/fsl_8xxx_ecc.c
@@ -0,0 +1,381 @@
+/*
+ * Copyright 2009 Extreme Engineering Solutions, Inc.
+ *
+ * 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 asm/io.h
+#if defined(CONFIG_MPC85xx)
+#include mpc85xx.h
+#elif defined(CONFIG_MPC86xx)
+#include mpc86xx.h
+#elif defined(CONFIG_MPC83xx)
+#include mpc83xx.h
+#endif
+
+/* Provide a common name for DDR addresses on 83xx/85xx/86xx */
+#if defined(CONFIG_MPC85xx)
+#define MPC8xxx_DDR_ADDR   CONFIG_SYS_MPC85xx_DDR_ADDR
+#define MPC8xxx_DDR2_ADDR  CONFIG_SYS_MPC85xx_DDR2_ADDR

[U-Boot] [PATCH 7/7] xes: Enable memory POST and ECC error reporting

2009-11-09 Thread Peter Tyser
Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 include/configs/XPEDITE5170.h |3 +++
 include/configs/XPEDITE5200.h |3 +++
 include/configs/XPEDITE5370.h |3 +++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/configs/XPEDITE5170.h b/include/configs/XPEDITE5170.h
index 1a810e4..07a61bb 100644
--- a/include/configs/XPEDITE5170.h
+++ b/include/configs/XPEDITE5170.h
@@ -106,6 +106,9 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_ALT_MEMTEST
 #define CONFIG_SYS_MEMTEST_START   0x1000
 #define CONFIG_SYS_MEMTEST_END 0x2000
+#define CONFIG_POST(CONFIG_SYS_POST_MEMORY)
+#define CONFIG_CHECK_ECC_ERRORS/* Check ECC count during 
POST/mtest */
+#define CONFIG_EDAC_FSL_ECC/* Enable ECC checking/command */
 
 /*
  * Memory map
diff --git a/include/configs/XPEDITE5200.h b/include/configs/XPEDITE5200.h
index 3f73780..ff780ab 100644
--- a/include/configs/XPEDITE5200.h
+++ b/include/configs/XPEDITE5200.h
@@ -89,6 +89,9 @@
 #define CONFIG_SYS_ALT_MEMTEST
 #define CONFIG_SYS_MEMTEST_START   0x1000
 #define CONFIG_SYS_MEMTEST_END 0x2000
+#define CONFIG_POST(CONFIG_SYS_POST_MEMORY)
+#define CONFIG_CHECK_ECC_ERRORS/* Check ECC count during 
POST/mtest */
+#define CONFIG_EDAC_FSL_ECC/* Enable ECC checking/command */
 
 /*
  * Memory map
diff --git a/include/configs/XPEDITE5370.h b/include/configs/XPEDITE5370.h
index 26b798b..0f80ed3 100644
--- a/include/configs/XPEDITE5370.h
+++ b/include/configs/XPEDITE5370.h
@@ -100,6 +100,9 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 #define CONFIG_SYS_ALT_MEMTEST
 #define CONFIG_SYS_MEMTEST_START   0x1000
 #define CONFIG_SYS_MEMTEST_END 0x2000
+#define CONFIG_POST(CONFIG_SYS_POST_MEMORY)
+#define CONFIG_CHECK_ECC_ERRORS/* Check ECC count during 
POST/mtest */
+#define CONFIG_EDAC_FSL_ECC/* Enable ECC checking/command */
 
 /*
  * Memory map
-- 
1.6.2.1

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


[U-Boot] [PATCH 6/7] xes: Add 8xxx post support

2009-11-09 Thread Peter Tyser
Note that SPRG4 is used to store U-Boot's post 'word'.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 board/xes/common/Makefile|1 +
 board/xes/common/fsl_8xxx_post.c |   36 
 2 files changed, 37 insertions(+), 0 deletions(-)
 create mode 100644 board/xes/common/fsl_8xxx_post.c

diff --git a/board/xes/common/Makefile b/board/xes/common/Makefile
index d022831..b6297ed 100644
--- a/board/xes/common/Makefile
+++ b/board/xes/common/Makefile
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_FSL_PCI_INIT)  += fsl_8xxx_pci.o
 COBJS-$(CONFIG_MPC8572)+= fsl_8xxx_clk.o
 COBJS-$(CONFIG_MPC86xx)+= fsl_8xxx_clk.o
 COBJS-$(CONFIG_FSL_DDR2)   += fsl_8xxx_ddr.o
+COBJS-$(CONFIG_HAS_POST)   += fsl_8xxx_post.o
 COBJS-$(CONFIG_NAND_ACTL)  += actl_nand.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
diff --git a/board/xes/common/fsl_8xxx_post.c b/board/xes/common/fsl_8xxx_post.c
new file mode 100644
index 000..179f970
--- /dev/null
+++ b/board/xes/common/fsl_8xxx_post.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2008 Extreme Engineering Solutions, Inc.
+ *
+ * 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 asm/processor.h
+
+int post_hotkeys_pressed(void) {
+   return 0;
+}
+
+void post_word_store(ulong a) {
+   mtspr(SPRG4, a);
+}
+
+ulong post_word_load(void) {
+   return mfspr(SPRG4);
+}
-- 
1.6.2.1

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


Re: [U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support

2009-11-09 Thread Liu Dave-R63238
How to use these command to test the ECC?
Specially, how to inject multi error in 64bit data bus?

Thanks, Dave

 -Original Message-
 From: u-boot-boun...@lists.denx.de 
 [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Peter Tyser
 Sent: Tuesday, November 10, 2009 7:37 AM
 To: u-boot@lists.denx.de
 Cc: Peter Tyser; Phillips Kim-R1AAHA; ga...@kernel.crashing.org
 Subject: [U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support
 
 Add a new 'ecc' command to interact with the 83xx, 85xx, and 86xx DDR
 ECC registers.  The 'ecc' command can inject data/ECC errors 
 to simulate
 errors and provides an 'info' subcommand which displays ECC error
 information such as failure address, read vs expected data/ECC,
 physical signal which failed, single-bit error count, and multiple bit
 error occurrence.  An example of the 'ecc info' command follows:
 
 WARNING: ECC error in DDR Controller 0
 Addr:   0x0_01001000
 Data:   0x0001_ ECC:0x00
 Expect: 0x_ ECC:0x00
 Net:DATA32
 Syndrome: 0xce
 Single-Bit errors: 0x40
 Attrib: 0x30112001
 Detect: 0x8004 (MME, SBE)
 
 This new 'ecc' command support was placed in a new drives/edac
 directory which can be used to support general Error Detection and
 Correction (EDAC) code similar to Linux.
 
 Signed-off-by: Peter Tyser pty...@xes-inc.com
 Signed-off-by: John Schmoller jschmol...@xes-inc.com
 ---
  Makefile|2 +
  drivers/edac/Makefile   |   46 +
  drivers/edac/fsl_8xxx_ecc.c |  381 
 +++
  3 files changed, 429 insertions(+), 0 deletions(-)
  create mode 100644 drivers/edac/Makefile
  create mode 100644 drivers/edac/fsl_8xxx_ecc.c
 
 diff --git a/Makefile b/Makefile
 index bed9469..3663780 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -204,6 +204,7 @@ LIBS += disk/libdisk.a
  LIBS += drivers/bios_emulator/libatibiosemu.a
  LIBS += drivers/block/libblock.a
  LIBS += drivers/dma/libdma.a
 +LIBS += drivers/edac/libedac.a
  LIBS += drivers/fpga/libfpga.a
  LIBS += drivers/gpio/libgpio.a
  LIBS += drivers/hwmon/libhwmon.a
 @@ -416,6 +417,7 @@ TAG_SUBDIRS += disk
  TAG_SUBDIRS += common
  TAG_SUBDIRS += drivers/bios_emulator
  TAG_SUBDIRS += drivers/block
 +TAG_SUBDIRS += drivers/edac
  TAG_SUBDIRS += drivers/gpio
  TAG_SUBDIRS += drivers/hwmon
  TAG_SUBDIRS += drivers/i2c
 diff --git a/drivers/edac/Makefile b/drivers/edac/Makefile
 new file mode 100644
 index 000..92ab497
 --- /dev/null
 +++ b/drivers/edac/Makefile
 @@ -0,0 +1,46 @@
 +#
 +# (C) Copyright 2000-2007
 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 +#
 +# 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 $(TOPDIR)/config.mk
 +
 +LIB  := $(obj)libedac.a
 +
 +COBJS-$(CONFIG_EDAC_FSL_ECC) += fsl_8xxx_ecc.o
 +
 +COBJS:= $(COBJS-y)
 +SRCS := $(COBJS:.o=.c)
 +OBJS := $(addprefix $(obj),$(COBJS))
 +
 +all: $(LIB)
 +
 +$(LIB):  $(obj).depend $(OBJS)
 + $(AR) $(ARFLAGS) $@ $(OBJS)
 +
 +#
 
 +
 +# defines $(obj).depend target
 +include $(SRCTREE)/rules.mk
 +
 +sinclude $(obj).depend
 +
 +#
 
 diff --git a/drivers/edac/fsl_8xxx_ecc.c b/drivers/edac/fsl_8xxx_ecc.c
 new file mode 100644
 index 000..8f3bc7e
 --- /dev/null
 +++ b/drivers/edac/fsl_8xxx_ecc.c
 @@ -0,0 +1,381 @@
 +/*
 + * Copyright 2009 Extreme Engineering Solutions, Inc.
 + *
 + * 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 

Re: [U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support

2009-11-09 Thread Peter Tyser
On Tue, 2009-11-10 at 08:25 +0800, Liu Dave-R63238 wrote:
 How to use these command to test the ECC?
 Specially, how to inject multi error in 64bit data bus?

snip

  +U_BOOT_CMD(ecc, 5, 0, do_ecc,
  +   support for DDR ECC features,
  +   info - print ECC information\n
  +#if (CONFIG_NUM_DDR_CONTROLLERS  1)
  +   ecc ctrl [num]\n
  +   \t-Set active controller to 'num', or display active 
  controller\n
  +#endif
  +   ecc inject high mask\n
  +   ecc inject low mask\n
  +   ecc inject ecc mask\n
  +   \t- XOR 'mask' with high/low data or ECC\n
  +   ecc inject off\n
  +   \t- disable error injection\n
  +);

Hi Dave,
You can inject data in the upper/lower 32 bit data path, or in the ecc
path using the ecc inject command shown above.  The inject command
takes a mask that is XORed with the proper data, eg ecc inject low 0x5
would result in data bits 0 and 2 always being swapped resulting in
multibit errors.

Or you could ground 2 data pins on the PCB:)

Peter


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


Re: [U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support

2009-11-09 Thread Liu Dave-R63238
 You can inject data in the upper/lower 32 bit data path, or in the ecc
 path using the ecc inject command shown above.  The inject command
 takes a mask that is XORed with the proper data, eg ecc 
 inject low 0x5
 would result in data bits 0 and 2 always being swapped resulting in
 multibit errors.

IIRC, 85xx cache is enabled, so when we do the ecc error inject test,
What will happen before disable ecc error inject?
I-fetch may get wrong instruction?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support

2009-11-09 Thread Liu Dave-R63238
 IIRC, 85xx cache is enabled, so when we do the ecc error inject test,
 What will happen before disable ecc error inject?
 I-fetch may get wrong instruction?

and 
Because cache is enabled, data bus assume 64 bits (it is normal case).
The DDR bus will have 4-beat burst. So the error information will be
the last beat triggered, or multi-bit error at first beat., or..
It is really complex.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support

2009-11-09 Thread Liu Dave-R63238
  IIRC, 85xx cache is enabled, so when we do the ecc error 
 inject test,
  What will happen before disable ecc error inject?
  I-fetch may get wrong instruction?
 
 and 
 Because cache is enabled, data bus assume 64 bits (it is normal case).
 The DDR bus will have 4-beat burst. So the error information will be
 the last beat triggered, or multi-bit error at first beat., or..
 It is really complex.

BTW, 83xx are using the d-cache inhibited...
The ecc test code really has some tricks, eg: must interrupt disable
context,
var should be put in the registers
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/7] 83xx: Migrate CONFIG_DDR_ECC_CMD toCONFIG_EDAC_FSL_ECC

2009-11-09 Thread Liu Dave-R63238
83xx ECC test code is really perfect, but it is regretful that it can
not reused to 85xx/86xx right now.
I'm not sure which approach is better between Peter's and this.
Because I still have not read carefully Peter's code.

 
 Update 83xx boards to use the same ECC driver that the 85xx and 86xx
 boards currently use.  The common 83xx/85xx/86xx ECC driver has
 fewer options, but better error reporting.
 
 Signed-off-by: Peter Tyser pty...@xes-inc.com
 ---
  cpu/mpc83xx/Makefile  |1 -
  cpu/mpc83xx/ecc.c |  390 
 -
  include/configs/MPC8349EMDS.h |2 +-
  include/configs/MPC8360EMDS.h |2 +-
  include/configs/MPC8360ERDK.h |2 +-
  include/configs/MPC837XEMDS.h |2 +-
  include/configs/MPC837XERDB.h |2 +-
  include/configs/sbc8349.h |2 +-
  include/configs/vme8349.h |2 +-
  9 files changed, 7 insertions(+), 398 deletions(-)
  delete mode 100644 cpu/mpc83xx/ecc.c
 
 diff --git a/cpu/mpc83xx/Makefile b/cpu/mpc83xx/Makefile
 index 15e2c18..8fda557 100644
 --- a/cpu/mpc83xx/Makefile
 +++ b/cpu/mpc83xx/Makefile
 @@ -35,7 +35,6 @@ COBJS-y += cpu_init.o
  COBJS-y += speed.o
  COBJS-y += interrupts.o
  COBJS-y += spd_sdram.o
 -COBJS-y += ecc.o
  COBJS-$(CONFIG_QE) += qe_io.o
  COBJS-$(CONFIG_FSL_SERDES) += serdes.o
  COBJS-$(CONFIG_PCI) += pci.o
 diff --git a/cpu/mpc83xx/ecc.c b/cpu/mpc83xx/ecc.c
 deleted file mode 100644
 index f3942b4..000
 --- a/cpu/mpc83xx/ecc.c
 +++ /dev/null
 @@ -1,390 +0,0 @@
 -/*
 - * Copyright (C) 2007 Freescale Semiconductor, Inc.
 - *
 - * Dave Liu dave...@freescale.com
 - * based on the contribution of Marian Balakowicz m...@semihalf.com
 - *
 - * 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.
 - */
 -
 -#include common.h
 -#include mpc83xx.h
 -#include command.h
 -
 -#if defined(CONFIG_DDR_ECC)  defined(CONFIG_DDR_ECC_CMD)
 -void ecc_print_status(void)
 -{
 - volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 - volatile ddr83xx_t *ddr = immap-ddr;
 -
 - printf(\nECC mode: %s\n\n,
 -(ddr-sdram_cfg  SDRAM_CFG_ECC_EN) ? ON : OFF);
 -
 - /* Interrupts */
 - printf(Memory Error Interrupt Enable:\n);
 - printf(  Multiple-Bit Error Interrupt Enable: %d\n,
 -(ddr-err_int_en  ECC_ERR_INT_EN_MBEE) ? 1 : 0);
 - printf(  Single-Bit Error Interrupt Enable: %d\n,
 -(ddr-err_int_en  ECC_ERR_INT_EN_SBEE) ? 1 : 0);
 - printf(  Memory Select Error Interrupt Enable: %d\n\n,
 -(ddr-err_int_en  ECC_ERR_INT_EN_MSEE) ? 1 : 0);
 -
 - /* Error disable */
 - printf(Memory Error Disable:\n);
 - printf(  Multiple-Bit Error Disable: %d\n,
 -(ddr-err_disable  ECC_ERROR_DISABLE_MBED) ? 1 : 0);
 - printf(  Sinle-Bit Error Disable: %d\n,
 -(ddr-err_disable  ECC_ERROR_DISABLE_SBED) ? 1 : 0);
 - printf(  Memory Select Error Disable: %d\n\n,
 -(ddr-err_disable  ECC_ERROR_DISABLE_MSED) ? 1 : 0);
 -
 - /* Error injection */
 - printf(Memory Data Path Error Injection Mask High/Low: 
 %08x %08x\n,
 -ddr-data_err_inject_hi, ddr-data_err_inject_lo);
 -
 - printf(Memory Data Path Error Injection Mask ECC:\n);
 - printf(  ECC Mirror Byte: %d\n,
 -(ddr-ecc_err_inject  ECC_ERR_INJECT_EMB) ? 1 : 0);
 - printf(  ECC Injection Enable: %d\n,
 -(ddr-ecc_err_inject  ECC_ERR_INJECT_EIEN) ? 1 : 0);
 - printf(  ECC Error Injection Mask: 0x%02x\n\n,
 -ddr-ecc_err_inject  ECC_ERR_INJECT_EEIM);
 -
 - /* SBE counter/threshold */
 - printf(Memory Single-Bit Error Management (0..255):\n);
 - printf(  Single-Bit Error Threshold: %d\n,
 -(ddr-err_sbe  ECC_ERROR_MAN_SBET)  
 ECC_ERROR_MAN_SBET_SHIFT);
 - printf(  Single-Bit Error Counter: %d\n\n,
 -(ddr-err_sbe  ECC_ERROR_MAN_SBEC)  
 ECC_ERROR_MAN_SBEC_SHIFT);
 -
 - /* Error detect */
 - printf(Memory Error Detect:\n);
 - printf(  Multiple Memory Errors: %d\n,
 -(ddr-err_detect  ECC_ERROR_DETECT_MME) ? 1 : 0);
 - printf(  Multiple-Bit Error: %d\n,
 -(ddr-err_detect  ECC_ERROR_DETECT_MBE) ? 1 : 0);
 - printf(  Single-Bit Error: %d\n,
 -(ddr-err_detect  ECC_ERROR_DETECT_SBE) ? 1 : 0);
 - printf(  Memory Select Error: %d\n\n,
 -(ddr-err_detect  ECC_ERROR_DETECT_MSE) ? 1 : 0);
 -
 - /* Capture data */
 - printf(Memory Error Address Capture: 0x%08x\n, 
 ddr-capture_address);
 - printf(Memory Data Path Read Capture High/Low: %08x %08x\n,
 -ddr-capture_data_hi, ddr-capture_data_lo);
 - printf(Memory Data Path Read Capture ECC: 0x%02x\n\n,
 -ddr-capture_ecc  

Re: [U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support

2009-11-09 Thread Liu Dave-R63238
 On Tue, 2009-11-10 at 08:42 +0800, Liu Dave-R63238 wrote:
   IIRC, 85xx cache is enabled, so when we do the ecc error inject 
   test, What will happen before disable ecc error inject?
   I-fetch may get wrong instruction?
 
 If you're injecting multibit errors, yes, things could break 
 down, much like a real multibit error.

IIRC, 83xx ECC code will NOT break down when we inject multibit error.
The code will go on, u-boot also go on...
 
  and 
  Because cache is enabled, data bus assume 64 bits (it is 
 normal case).
  The DDR bus will have 4-beat burst. So the error 
 information will be 
  the last beat triggered, or multi-bit error at first beat., or..
  It is really complex.
 
 I believe all 4 beats would have the ecc error injected.
 
 In my opinion, the error reporting functionality of the ECC 
 code is much more important than error injection.  Other than 
 testing code during development, when do you inject errors?  
 ECC detection and reporting is useful day-to-day, in the 
 field, during manufacturing tests, etc so that's where the 
 emphasis of this patch is focussed.

83xx ECC code also has good ECC error reporting functionality,
IIRC, type ecc status...
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/7] 83xx: Migrate CONFIG_DDR_ECC_CMD toCONFIG_EDAC_FSL_ECC

2009-11-09 Thread Peter Tyser
Please stop top-posting.

On Tue, 2009-11-10 at 08:51 +0800, Liu Dave-R63238 wrote:
 83xx ECC test code is really perfect, but it is regretful that it can
 not reused to 85xx/86xx right now.
 I'm not sure which approach is better between Peter's and this.
 Because I still have not read carefully Peter's code.

snip

The 83xx ECC test code may have been perfect for your needs, but it was
not perfect for mine:)  Or most people I would think.  As I mentioned
before, I put an emphasis on the error reporting.  Wolfgang and I
discussed exactly this in v1 of the patch: 
http://www.mail-archive.com/u-boot@lists.denx.de/msg24216.html

quote
 83xx, 85xx, and 86xx could all share an implementation I believe. I 
 didn't integrate the 83xx in this patch because it seemed to have a 
 different goal than the patch I submitted.  The 83xx implementation 
 supported a high degree of tweaking registers which I personally find 
 unnecessary for general use.  I think that if someone wants that level 
 of control, they could just modify the registers directly since they 
 have to have the 83xx user's manual handy anyway.

Agreed.

 The implementation I submitted has limited, common features and much 
 better error reporting.  The error reporting is the feature that would 
 be used 98% of the time, not the tweaking of registers.  I'd be happy to 
 include the 83xx implementation in this patch, but I'd vote to strip out 
 most of the current 83xx features - ie basically remove the 83xx ecc 
 code and replace it with the  85/86xx implementation I submitted.  Would 
 83xx people be OK with this?  Or have any suggestions on what the 
 combined implementation should look like?

I have yet to see a user who actually uses the existing code on 83xx,
so as far as I am concerned I'll be fine with the common, simpler
code.
/quote

Best,
Peter

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


Re: [U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support

2009-11-09 Thread Peter Tyser
On Tue, 2009-11-10 at 09:08 +0800, Liu Dave-R63238 wrote:
  On Tue, 2009-11-10 at 08:42 +0800, Liu Dave-R63238 wrote:
IIRC, 85xx cache is enabled, so when we do the ecc error inject 
test, What will happen before disable ecc error inject?
I-fetch may get wrong instruction?
  
  If you're injecting multibit errors, yes, things could break 
  down, much like a real multibit error.
 
 IIRC, 83xx ECC code will NOT break down when we inject multibit error.
 The code will go on, u-boot also go on...

What is the benefit of having such a high level of control over error
injection?  When do people use this feature?  How often do they use it?

   and 
   Because cache is enabled, data bus assume 64 bits (it is 
  normal case).
   The DDR bus will have 4-beat burst. So the error 
  information will be 
   the last beat triggered, or multi-bit error at first beat., or..
   It is really complex.
  
  I believe all 4 beats would have the ecc error injected.
  
  In my opinion, the error reporting functionality of the ECC 
  code is much more important than error injection.  Other than 
  testing code during development, when do you inject errors?  
  ECC detection and reporting is useful day-to-day, in the 
  field, during manufacturing tests, etc so that's where the 
  emphasis of this patch is focussed.
 
 83xx ECC code also has good ECC error reporting functionality,
 IIRC, type ecc status...

I believe the ecc status command basically just did a register dump of
the ECC registers.  In my opinion, the output was overly verbose and not
that useful.  The patch I submitted attempts to *decode* the register
dump so Joe User can figure out what's really wrong with their board.

Best,
Peter

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


Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?

2009-11-09 Thread Prafulla Wadaskar
 

 -Original Message-
 From: Albert ARIBAUD [mailto:albert.arib...@free.fr] 
 Sent: Tuesday, November 10, 2009 12:27 AM
 To: Prafulla Wadaskar
 Cc: u-boot@lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik
 Subject: Re: [U-Boot] Best way of making some drivers common 
 across kirkwood and orion5x SoCs?
 
 Hi PRafulla,
 
 Prafulla Wadaskar a écrit :
 
   1. For SOC support Orion should be implemented similar to Kirkwood
   (you agreed on this)
 
 I still do. :)
 
   2. For common drivers for (ex: kirkwood_egiga.c) the 
 common code must
   be abstracted to egiga_core.c and architecture specific 
 code must be
   supported through kirkwood_egiga.c/h and orion_egiga.c/h, 
 this way it
   would make it more clean and structured.
 
 Agreed.
 
   What is your opinion with #2 suggestion?
 
 Sounds fine! I'll start submitting patches for both common 
 drivers and 
 orion support based on this proposal.
 
 Regarding the arch-specific parts of current driver code, should they 
 end up in cpu/arm926ejs/{kirkwood,orion5x} or stay in 
 drivers/*? I tend 
 like cpu/arm926ejs/* better as it puts everything arch-specific in a 
 single place.

I agree for this. Good luck :-)

Regards...
Prafulla . . .

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


[U-Boot] [PATCH] nfs: NfsTimeout() updates

2009-11-09 Thread Peter Tyser
From: Evan Samanas esama...@xes-inc.com

- NfsTimeout() does not correctly update the NFS timeout value which
  results in NfsTimeout() only being called once in certain situations.
  This can result in the 'nfs' command hanging indefinetly.  For
  example, the command:

nfs 192.168.0.1:/home/user/file

  will not exit until ctrl-c is pressed if 192.168.0.1 does not have an
  NFS server running.

  This issue is resolved by reinitializting the NFS timeout value inside
  NfsTimeout() when a timeout occurs.

- Make the 'nfs' command print the 'T' character when a timeout occurs.
  Previously there was no indication that timeouts were occuring.

- Mimic the 'tftpboot' command and when a download fails print Retry
  count exceeded; starting again, and restart the download taking the
  'netretry' environment variable into account.

Signed-off-by: Evan Samanas esama...@xes-inc.com
Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 net/nfs.c |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/nfs.c b/net/nfs.c
index 27395fb..51b17c7 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -571,13 +571,14 @@ Interfaces of U-BOOT
 static void
 NfsTimeout (void)
 {
-   if ( NfsTimeoutCount++  NFS_RETRY_COUNT ) {
+   if ( ++NfsTimeoutCount  NFS_RETRY_COUNT ) {
+   puts (\nRetry count exceeded; starting again\n);
+   NetStartAgain ();
+   } else {
+   puts(T );
+   NetSetTimeout (NFS_TIMEOUT, NfsTimeout);
NfsSend ();
-   return;
}
-   puts (Timeout\n);
-   NetState = NETLOOP_FAIL;
-   return;
 }
 
 static void
-- 
1.6.2.1

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


Re: [U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support

2009-11-09 Thread Ira W. Snyder
On Mon, Nov 09, 2009 at 07:20:26PM -0600, Peter Tyser wrote:
 On Tue, 2009-11-10 at 09:08 +0800, Liu Dave-R63238 wrote:
   On Tue, 2009-11-10 at 08:42 +0800, Liu Dave-R63238 wrote:
 IIRC, 85xx cache is enabled, so when we do the ecc error inject 
 test, What will happen before disable ecc error inject?
 I-fetch may get wrong instruction?
   
   If you're injecting multibit errors, yes, things could break 
   down, much like a real multibit error.
  
  IIRC, 83xx ECC code will NOT break down when we inject multibit error.
  The code will go on, u-boot also go on...
 
 What is the benefit of having such a high level of control over error
 injection?  When do people use this feature?  How often do they use it?
 

I used the ECC error injection code when adding ECC support on our
board, to verify that ECC was actually enabled and reporting errors. I
found it extremely useful at the time, though I haven't used it since.

and 
Because cache is enabled, data bus assume 64 bits (it is 
   normal case).
The DDR bus will have 4-beat burst. So the error 
   information will be 
the last beat triggered, or multi-bit error at first beat., or..
It is really complex.
   
   I believe all 4 beats would have the ecc error injected.
   
   In my opinion, the error reporting functionality of the ECC 
   code is much more important than error injection.  Other than 
   testing code during development, when do you inject errors?  
   ECC detection and reporting is useful day-to-day, in the 
   field, during manufacturing tests, etc so that's where the 
   emphasis of this patch is focussed.
  
  83xx ECC code also has good ECC error reporting functionality,
  IIRC, type ecc status...
 
 I believe the ecc status command basically just did a register dump of
 the ECC registers.  In my opinion, the output was overly verbose and not
 that useful.  The patch I submitted attempts to *decode* the register
 dump so Joe User can figure out what's really wrong with their board.
 

I haven't looked at your code. When I was running the old ecc command, I
had the 83xx reference manual open to decode the command's output, IIRC.

PS - I'm happy to test stuff on 83xx, I'll try and find time to test
this patch series tomorrow.

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


Re: [U-Boot] [PATCH ARM v2] Clean-up of s3c24x0 header files

2009-11-09 Thread Minkyu Kang
Dear kevin.morfitt,

2009/11/4 kevin.morf...@fearnside-systems.co.uk
kevin.morf...@fearnside-systems.co.uk:
 Cleans up the s3c24x0 header files:

 s4c24x0.h: removes the use of 'volatile' from the S3C24X0_REG8,
 S3C24X0_REG16 and S3C24X0_REG32 register typedef's. Registers are always
 accessed using the IO accessor functions which cast the register address
 as 'volatile' anyway so it isn't required here.

 s3c2400.h and s3c2410.h: insert a blank line between the static inline
 functions

 Signed-off-by: Kevin Morfitt kevin.morf...@fearnside-systems.co.uk
 ---
  v2 changes: remove the S3C24X0_REG8, S3C24X0_REG16 and S3C24X0_REG32
  register typedef's from s3c24x0.h, s3c2400.h, s3c2410.h and vcma9.h

  board/mpl/vcma9/vcma9.h                |   14 +-
  include/asm-arm/arch-s3c24x0/s3c2400.h |   16 +
  include/asm-arm/arch-s3c24x0/s3c2410.h |   17 +
  include/asm-arm/arch-s3c24x0/s3c24x0.h |  904 
 
  4 files changed, 490 insertions(+), 461 deletions(-)


applied to u-boot-samsung

Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] 83xx/85xx/86xx: Add ECC support

2009-11-09 Thread Peter Tyser
Hi Ira,

On Mon, 2009-11-09 at 18:15 -0800, Ira W. Snyder wrote:
 On Mon, Nov 09, 2009 at 07:20:26PM -0600, Peter Tyser wrote:
  On Tue, 2009-11-10 at 09:08 +0800, Liu Dave-R63238 wrote:
On Tue, 2009-11-10 at 08:42 +0800, Liu Dave-R63238 wrote:
  IIRC, 85xx cache is enabled, so when we do the ecc error inject 
  test, What will happen before disable ecc error inject?
  I-fetch may get wrong instruction?

If you're injecting multibit errors, yes, things could break 
down, much like a real multibit error.
   
   IIRC, 83xx ECC code will NOT break down when we inject multibit error.
   The code will go on, u-boot also go on...
  
  What is the benefit of having such a high level of control over error
  injection?  When do people use this feature?  How often do they use it?
  
 
 I used the ECC error injection code when adding ECC support on our
 board, to verify that ECC was actually enabled and reporting errors. I
 found it extremely useful at the time, though I haven't used it since.

I had the same usage pattern as you.  I used the ecc inject command
for some testing, but I don't plan using it again unless I update the
ECC code again.  The injecting feature of this patch isn't great, but I
personally think its sufficient, at least on 85xx and 86xx.  I was
pretty easily able to simulate single and double bit errors on both
platforms.  I'll be curious to hear how it works on 83xx...

 and 
 Because cache is enabled, data bus assume 64 bits (it is 
normal case).
 The DDR bus will have 4-beat burst. So the error 
information will be 
 the last beat triggered, or multi-bit error at first beat., or..
 It is really complex.

I believe all 4 beats would have the ecc error injected.

In my opinion, the error reporting functionality of the ECC 
code is much more important than error injection.  Other than 
testing code during development, when do you inject errors?  
ECC detection and reporting is useful day-to-day, in the 
field, during manufacturing tests, etc so that's where the 
emphasis of this patch is focussed.
   
   83xx ECC code also has good ECC error reporting functionality,
   IIRC, type ecc status...
  
  I believe the ecc status command basically just did a register dump of
  the ECC registers.  In my opinion, the output was overly verbose and not
  that useful.  The patch I submitted attempts to *decode* the register
  dump so Joe User can figure out what's really wrong with their board.
  
 
 I haven't looked at your code. When I was running the old ecc command, I
 had the 83xx reference manual open to decode the command's output, IIRC.
 
 PS - I'm happy to test stuff on 83xx, I'll try and find time to test
 this patch series tomorrow.

Thanks, its much appreciated.

Peter

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


[U-Boot] [PATCH] fsl-ddr: Fix the chip-select interleaving issue

2009-11-09 Thread Dave Liu
commit 1542fbdeec0d1e2a6df13189df8dcb1ce8802be3
introduced one new bug to chip-select interleaving.

Single DDR controller also can do the chip-select
interleaving if there is dual-rank or qual-rank DIMMs.

Signed-off-by: Dave Liu dave...@freescale.com
---
 cpu/mpc8xxx/ddr/options.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/cpu/mpc8xxx/ddr/options.c b/cpu/mpc8xxx/ddr/options.c
index db44291..bfddd6d 100644
--- a/cpu/mpc8xxx/ddr/options.c
+++ b/cpu/mpc8xxx/ddr/options.c
@@ -22,9 +22,7 @@ unsigned int populate_memctl_options(int all_DIMMs_registered,
unsigned int ctrl_num)
 {
unsigned int i;
-#if (CONFIG_NUM_DDR_CONTROLLERS  1)
const char *p;
-#endif
 
/* Chip select options. */
 
@@ -242,6 +240,7 @@ unsigned int populate_memctl_options(int 
all_DIMMs_registered,
simple_strtoul(p, NULL, 0);
}
}
+#endif
 
if( (p = getenv(ba_intlv_ctl)) != NULL) {
if (strcmp(p, cs0_cs1) == 0)
@@ -283,7 +282,6 @@ unsigned int populate_memctl_options(int 
all_DIMMs_registered,
break;
}
}
-#endif
 
fsl_ddr_board_options(popts, pdimm, ctrl_num);
 
-- 
1.5.6

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


Re: [U-Boot] [PATCH 1/3] NET: LAN91C96 CONFIG_NET_MULTIify

2009-11-09 Thread Ben Warren
Nishanth,

Nishanth Menon wrote:
 Make the lan91c96 driver capable of CONFIG_NET_MULTI
 to be clean for the new arch, add a a lil detect function
 Most of the formatting change was done to keep checkpatch
 silent, but a few functions and #if 0ed code which
 does not make sense for NET_MULTI have been removed

 Now, use the lan91c96_initialize() function to init the driver

 Signed-off-by: Nishanth Menon n...@ti.com
 Cc: Andrea Scian andrea.sc...@dave-tech.it
 Cc: Ben Warren biggerbadder...@gmail.com
 Cc: Dave Peverley dpever...@mpc-data.co.uk
 Cc: George G. Davis gda...@mvista.com
 Cc: Kyungmin Park kyungmin.p...@samsung.com
 Cc: Nishant Kamat nska...@ti.com
 Cc: Richard Woodruff r-woodru...@ti.com
 Cc: Rishi Bhattacharya ri...@ti.com
 Cc: Sandeep Paulraj s-paul...@ti.com
 ---
  drivers/net/Makefile   |2 +-
  drivers/net/lan91c96.c |  452 +++
  drivers/net/lan91c96.h |  110 ++---
  include/netdev.h   |1 +
  4 files changed, 236 insertions(+), 329 deletions(-)
   
applied to net/next

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


Re: [U-Boot] [PATCH 2/3] TI OMAP3: SDP3430 FIX NET_MULTI Warning

2009-11-09 Thread Ben Warren
Nishanth,

Nishanth Menon wrote:
 Enable the NET MULTI option and remove build warning

 Tested: SDP3430

 Signed-off-by: Nishanth Menon n...@ti.com
 Cc: Ben Warren biggerbadder...@gmail.com
 Cc: Sandeep Paulraj s-paul...@ti.com
 ---
  board/ti/sdp3430/sdp.c  |   12 +++-
  include/configs/omap3_sdp3430.h |3 ++-
  2 files changed, 9 insertions(+), 6 deletions(-)
   
Applied to net/next

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


Re: [U-Boot] [PATCH 3/3] LAN91C96: Enable NET_MULTI LAN driver

2009-11-09 Thread Ben Warren
Nishanth,

Nishanth Menon wrote:
 This modification is NOT tested on any of the
 platforms modified as I dont have them. please
 help by testing+building+fixing

 Signed-off-by: Nishanth Menon n...@ti.com
 Cc: Andrea Scian andrea.sc...@dave-tech.it
 Cc: Ben Warren biggerbadder...@gmail.com
 Cc: Dave Peverley dpever...@mpc-data.co.uk
 Cc: George G. Davis gda...@mvista.com
 Cc: Kyungmin Park kyungmin.p...@samsung.com
 Cc: Nishant Kamat nska...@ti.com
 Cc: Richard Woodruff r-woodru...@ti.com
 Cc: Rishi Bhattacharya ri...@ti.com
 Cc: Sandeep Paulraj s-paul...@ti.com
 ---
  board/apollon/apollon.c   |   12 +++-
  include/configs/B2.h  |2 +-
  include/configs/apollon.h |3 ++-
  include/configs/assabet.h |3 ++-
  include/configs/gcplus.h  |3 ++-
  include/configs/lubbock.h |3 ++-
  include/configs/omap1510inn.h |3 ++-
  include/configs/omap1610h2.h  |3 ++-
  include/configs/omap1610inn.h |3 ++-
  include/configs/omap2420h4.h  |3 ++-
  include/configs/omap5912osk.h |3 ++-
  include/configs/omap730p2.h   |3 ++-
  include/configs/pleb2.h   |6 --
  13 files changed, 32 insertions(+), 18 deletions(-)
   
I expect that all of these boards are now broken, since you haven't 
provided board_eth_init() functions for them.

Applying to net/next anyway to make it easy to get everything working.

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


Re: [U-Boot] [PATCH] Repair the 'netry=once' option.

2009-11-09 Thread Ben Warren
Hi Remy,

Remy Bohmer wrote:
 'netretry = once' does the same as 'netretry = yes', because it is not stored
 when it was tried once.

 Signed-off-by: Remy Bohmer li...@bohmer.net
 ---
  net/net.c |   34 +-
  1 files changed, 25 insertions(+), 9 deletions(-)
   
Applied to net/next.

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


Re: [U-Boot] [PATCH] Add error codes/handling for TFTP-server

2009-11-09 Thread Ben Warren
Remy Bohmer wrote:
 Signed-off-by: Remy Bohmer li...@bohmer.net
 ---
  net/tftp.c |   32 +---
  1 files changed, 29 insertions(+), 3 deletions(-)

 diff --git a/net/tftp.c b/net/tftp.c
 index cc60a3b..d254f49 100644
 --- a/net/tftp.c
 +++ b/net/tftp.c
 @@ -47,6 +47,16 @@ static int TftpTimeoutCountMax = TIMEOUT_COUNT;
  ulong TftpRRQTimeoutMSecs = TIMEOUT;
  int TftpRRQTimeoutCountMax = TIMEOUT_COUNT;
  
 +enum {
 + TFTP_ERR_UNDEFINED   = 0,
 + TFTP_ERR_FILE_NOT_FOUND  = 1,
 + TFTP_ERR_ACCESS_DENIED   = 2,
 + TFTP_ERR_DISK_FULL   = 3,
 + TFTP_ERR_UNEXPECTED_OPCODE   = 4,
 + TFT_ERR_UNKNOWN_TRANSFER_ID  = 5,
   
Applied to net/next after fixing typo in last enum

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


Re: [U-Boot] use boot select jumper on NGW100 to select USART

2009-11-09 Thread Thomas Sprinkmeier
Dear Wolfgang Denk,

 +     USART_JUMPER_CONFIG;
 +     USART_ENABLE;

 Function / Macro when used as funxctions should always look as such,
 i. e. have parens with them.

So the patch for atmel_usart.c would look like this:

hmatrix_slave_write(EBI, SFR, HMATRIX_BIT(EBI_SDRAM_ENABLE));

portmux_enable_ebi(16, 23, 0, PORTMUX_DRIVE_HIGH);
-   portmux_enable_usart1(PORTMUX_DRIVE_MIN);
+
+   USART_JUMPER_CONFIG();
+   atmel_usart_enable();

and atmel_alt_usart.h would change to:

+#elif
+/* No alternate USART selected */
+#define USART_USE_ALT() (0)
+#define USART_PIN_CONFIG()
+#endif
+
+/* How to read/initialise the boot-select jumper */
+#ifndef USART_USE_ALT
+#define USART_USE_ALT() (!gpio_get_value(GPIO_PIN_PB(30)))
+#define USART_JUMPER_CONFIG() portmux_select_gpio(PORTMUX_PORT_B,  \
+   (1  30),  
\
+   PORTMUX_DIR_INPUT)
+#endif

or should USART_USE_ALT and USART_JUMPER_CONFIG become static inline
functions (as below)?

I was trying to make as little impact as possible, somehow a macro
seemed 'better' than a function.

 diff --git a/include/atmel_alt_usart.h b/include/atmel_alt_usart.h
 new file mode 100644
 index 000..1ed2fb8
 ...
 +/* Enable the appropriate USART */
 +#define USART_ENABLE {                                                      
  \
 +  switch (USART_ID)                                                  \
 +    {                                                                       
  \
 +    case 0:  portmux_enable_usart0(PORTMUX_DRIVE_MIN); break;               
  \
 +    case 1:  portmux_enable_usart1(PORTMUX_DRIVE_MIN); break;               
  \
 +    case 2:  portmux_enable_usart2(PORTMUX_DRIVE_MIN); break;               
  \
 +    default: portmux_enable_usart3(PORTMUX_DRIVE_MIN); break;               
  \
 +    }                                                                       
  \
 +  } while(0)

 NAK.  When you use a function-style macro it should look like one. But
 why is this a macro at all? Please make it a (static) inline function
 instead.



+/* Enable the appropriate USART */
+static inline void atmel_usart_enable()
+{
+   switch (USART_ID) {
+   case 0:
+   portmux_enable_usart0(PORTMUX_DRIVE_MIN);
+   break;
+   case 1:
+   portmux_enable_usart1(PORTMUX_DRIVE_MIN);
+   break;
+   case 2:
+   portmux_enable_usart2(PORTMUX_DRIVE_MIN);
+   break;
+   default:
+   portmux_enable_usart3(PORTMUX_DRIVE_MIN);
+   }
+}
+
+#endif /* __ATMEL_ALT_USART_H__ */

 Also please note that the Coding Style requires indentation by TABs.

fixed.

Thank you for your patience,

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


Re: [U-Boot] [u-boot] [PATCH] [1/2] [v1.2] mxc_fec: fix some erroneous PHY accesses.

2009-11-09 Thread Ben Warren
Javier,

javier Martin wrote:
 This patch fixes erroneous access to the ethernet PHY which broke the driver.
 1. Selector field in the auto-negotiation register must be 0x1 for
 using 802.3, not 0x0 which is reseved.
 2. Access to the PHY address specified by CONFIG_FEC_MXC_PHYADDR, not
 0x0 fixed address.

 This has been tested in i.MX27 Litekit board and eldk-4.2 toolchains.

 Now using proper defines for auto-negotiation register.

 Signed-off-by: Javier Martin javier.mar...@vista-silicon.com
 --
Applied to net repo.

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


Re: [U-Boot] [u-boot] [PATCH] [2/2] [v1.4] mxc_fec: avoid free() calls to already freed pointers.

2009-11-09 Thread Ben Warren
javier Martin wrote:
 Sometimes, inside NetLoop, eth_halt() is called before eth_init() has
 been called. This is harmless except for free() calls to pointers
 which have not been allocated yet.

 This patch initializes those pointers to NULL and allocates them only
 the first time. This way we can get rid of free calls in halt callback.

 This has been tested in i.MX27 Litekit board and eldk-4.2 toolchains.

 Signed-off-by: Javier Martin javier.mar...@vista-silicon.com
 --
  drivers/net/fec_mxc.c |   12 +++-
  1 files changed, 7 insertions(+), 5 deletions(-)
   
Applied to net repo.

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


Re: [U-Boot] [PATCH 1/1] net: pull CONFIG checks out of source and into makefile

2009-11-09 Thread Ben Warren
Mike,

Mike Frysinger wrote:
 Signed-off-by: Mike Frysinger vap...@gentoo.org
 ---
  net/Makefile |   12 ++--
  net/bootp.c  |4 
  net/eth.c|7 +++
  net/net.c|4 
  net/nfs.c|4 
  net/rarp.c   |4 
  net/tftp.c   |4 
  7 files changed, 9 insertions(+), 30 deletions(-)
   
Applied to net/next.

Thanks for doing this thankless work.

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