U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
May 2008
- 200 participants
- 467 discussions

22 May '08
Hi Haavard Skinnemoen,
while you are working on atmel mci mmc driver, i would like to know
whether you can tell me anything about the bug mentioned here
Possible Bug in at32ap mmc driver atmel_mci.c related to incorrect usage
of variables.
http://www.nabble.com/Possible-Bug-in-at32ap-mmc-driver-atmel_mci.c-td16
111511.html#a16111511
Thanks in advance
Regards
Gururaja
2
1

22 May '08
In the file of include\configs\octeon_ebh3100.h, there is a macro definition:
#define BOARD_DIMM_0_SPD_TWSI_ADDR 0x52
I know it is a address of eeprom in I2C bus, but I don't know why you define it 0x50. What does 0x50 base on?
1
0
is anyone worked on Atlas-III navigation board plz help me out in loading
u-boot onto the Atlas-III board
--
View this message in context: http://www.nabble.com/regarding-u-boot-u-tp17397000p17397000.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
2
1
--
View this message in context: http://www.nabble.com/regarding-u-boot-tp17396977p17396977.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
1
0

[U-Boot-Users] [PATCH] PPC4xx: Enable Primordial Stack for 40x and Unify ECC Handling
by Grant Erickson 21 May '08
by Grant Erickson 21 May '08
21 May '08
This patch:
* Rolls up a suite of changes to enable correct primordial stack and
global data handling when the data cache is used for such a purpose
for PPC40x-variants.
* Related to the first, unifies DDR2 SDRAM and ECC initialization by
eliminating redundant ECC initialization implementations and moving
redundant SDRAM initialization out of board code into shared 4xx
code.
* Enables MCSR visibility on the 405EX(r).
* Finally, it enables the use of the data cache for initial RAM on
both AMCC's Kilauea and Makalu.
With respect to the 4xx DDR initialization and ECC unification, there
is certainly more work that can and should be done (file renaming,
etc.). However, that can be handled at a later date on a second or
third pass. As it stands, this patch moves things forward in an
incremental yet positive way for those platforms that utilize this
code and the features associated with it.
Signed-off-by: Grant Erickson <gerickson(a)nuovations.com>
---
board/amcc/kilauea/init.S | 231 +++++++++++++++++----------------
board/amcc/kilauea/memory.c | 12 +-
board/amcc/makalu/init.S | 127 +-----------------
board/amcc/makalu/memory.c | 122 +-----------------
cpu/ppc4xx/44x_spd_ddr.c | 49 +-------
cpu/ppc4xx/44x_spd_ddr2.c | 124 +++++++++++++++++-
cpu/ppc4xx/Makefile | 1 +
cpu/ppc4xx/cpu_init.c | 85 ------------
cpu/ppc4xx/ecc.c | 121 +++++++++++++++++
cpu/ppc4xx/ecc.h | 42 ++++++
cpu/ppc4xx/sdram.c | 44 +------
cpu/ppc4xx/start.S | 303 +++++++++++++++++++++++++++++++++----------
cpu/ppc4xx/traps.c | 9 +-
include/asm-ppc/processor.h | 6 +-
include/configs/kilauea.h | 116 ++++++++++++++---
include/configs/makalu.h | 116 ++++++++++++++--
include/ppc405.h | 193 +++++++++++++++++++++++++--
include/ppc4xx.h | 15 ++
18 files changed, 1061 insertions(+), 655 deletions(-)
diff --git a/board/amcc/kilauea/init.S b/board/amcc/kilauea/init.S
index 053fe19..6ff39bb 100644
--- a/board/amcc/kilauea/init.S
+++ b/board/amcc/kilauea/init.S
@@ -1,6 +1,9 @@
/*
- * (C) Copyright 2007-2008
- * Stefan Roese, DENX Software Engineering, sr(a)denx.de.
+ * Copyright (c) 2008 Nuovation System Designs, LLC
+ * Grant Erickson <gerickson(a)nuovations.com>
+ *
+ * Copyright (c) 2007-2008 DENX Software Engineering, GmbH
+ * Stefan Roese <sr(a)denx.de>
*
* Based on code provided from UDTech and AMCC
*
@@ -29,126 +32,136 @@
#include <ppc_asm.tmpl>
#include <ppc_defs.h>
-#define mtsdram_as(reg, value) \
- addi r4,0,reg ; \
- mtdcr memcfga,r4 ; \
- addis r4,0,value@h ; \
- ori r4,r4,value@l ; \
- mtdcr memcfgd,r4 ;
+#define mtsdram_as(reg, value) \
+ addi r4,0,reg ; \
+ mtdcr memcfga,r4 ; \
+ addis r4,0,value@h ; \
+ ori r4,r4,value@l ; \
+ mtdcr memcfgd,r4 ;
+
+#if defined(CONFIG_DDR_ECC)
+ .extern ecc_init
+#endif /* defined(CONFIG_DDR_ECC) */
.globl ext_bus_cntlr_init
ext_bus_cntlr_init:
+#if !defined(CFG_INIT_DCACHE_CS)
#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
/*
- * DDR2 setup
+ * DDR2 SDRAM Controller Setup
*/
- /* Following the DDR Core Manual, here is the initialization */
-
- /* Step 1 */
-
- /* Step 2 */
-
- /* Step 3 */
-
- /* base=00000000, size=256MByte (6), mode=7 (n*10*8) */
- mtsdram_as(SDRAM_MB0CF, 0x00006701);
-
- /* SET SDRAM_MB1CF - Not enabled */
- mtsdram_as(SDRAM_MB1CF, 0x00000000);
-
- /* SET SDRAM_MB2CF - Not enabled */
- mtsdram_as(SDRAM_MB2CF, 0x00000000);
-
- /* SET SDRAM_MB3CF - Not enabled */
- mtsdram_as(SDRAM_MB3CF, 0x00000000);
-
- /* SDRAM_CLKTR: Adv Addr clock by 180 deg */
- mtsdram_as(SDRAM_CLKTR, 0x80000000);
-
- /* Refresh Time register (0x30) Refresh every 7.8125uS */
- mtsdram_as(SDRAM_RTR, 0x06180000);
+ /* Set Memory Bank Configuration Registers */
+ mtsdram_as(SDRAM_MB0CF, CFG_SDRAM0_MB0CF);
+ mtsdram_as(SDRAM_MB1CF, CFG_SDRAM0_MB1CF);
+ mtsdram_as(SDRAM_MB2CF, CFG_SDRAM0_MB2CF);
+ mtsdram_as(SDRAM_MB3CF, CFG_SDRAM0_MB3CF);
+
+ /* Set Memory Clock Timing Register */
+ mtsdram_as(SDRAM_CLKTR, CFG_SDRAM0_CLKTR);
+
+ /* Set Refresh Time Register */
+ mtsdram_as(SDRAM_RTR, CFG_SDRAM0_RTR);
+
+ /* Set SDRAM Timing Registers */
+ mtsdram_as(SDRAM_SDTR1, CFG_SDRAM0_SDTR1);
+ mtsdram_as(SDRAM_SDTR2, CFG_SDRAM0_SDTR2);
+ mtsdram_as(SDRAM_SDTR3, CFG_SDRAM0_SDTR3);
+
+ /* Set Mode and Extended Mode Registers */
+ mtsdram_as(SDRAM_MMODE, CFG_SDRAM0_MMODE);
+ mtsdram_as(SDRAM_MEMODE, CFG_SDRAM0_MEMODE);
+
+ /* Set Memory Controller Options 1 Register */
+ mtsdram_as(SDRAM_MCOPT1, CFG_SDRAM0_MCOPT1);
+
+ /* Set Manual Initialization Control Registers */
+ mtsdram_as(SDRAM_INITPLR0, CFG_SDRAM0_INITPLR0);
+ mtsdram_as(SDRAM_INITPLR1, CFG_SDRAM0_INITPLR1);
+ mtsdram_as(SDRAM_INITPLR2, CFG_SDRAM0_INITPLR2);
+ mtsdram_as(SDRAM_INITPLR3, CFG_SDRAM0_INITPLR3);
+ mtsdram_as(SDRAM_INITPLR4, CFG_SDRAM0_INITPLR4);
+ mtsdram_as(SDRAM_INITPLR5, CFG_SDRAM0_INITPLR5);
+ mtsdram_as(SDRAM_INITPLR6, CFG_SDRAM0_INITPLR6);
+ mtsdram_as(SDRAM_INITPLR7, CFG_SDRAM0_INITPLR7);
+ mtsdram_as(SDRAM_INITPLR8, CFG_SDRAM0_INITPLR8);
+ mtsdram_as(SDRAM_INITPLR9, CFG_SDRAM0_INITPLR9);
+ mtsdram_as(SDRAM_INITPLR10, CFG_SDRAM0_INITPLR10);
+ mtsdram_as(SDRAM_INITPLR11, CFG_SDRAM0_INITPLR11);
+ mtsdram_as(SDRAM_INITPLR12, CFG_SDRAM0_INITPLR12);
+ mtsdram_as(SDRAM_INITPLR13, CFG_SDRAM0_INITPLR13);
+ mtsdram_as(SDRAM_INITPLR14, CFG_SDRAM0_INITPLR14);
+ mtsdram_as(SDRAM_INITPLR15, CFG_SDRAM0_INITPLR15);
+
+ /* Set On-Die Termination Registers */
+ mtsdram_as(SDRAM_CODT, CFG_SDRAM0_CODT);
+ mtsdram_as(SDRAM_MODT0, CFG_SDRAM0_MODT0);
+ mtsdram_as(SDRAM_MODT1, CFG_SDRAM0_MODT1);
+
+ /* Set Write Timing Register */
+ mtsdram_as(SDRAM_WRDTR, CFG_SDRAM0_WRDTR);
- /* SDRAM_SDTR1 */
- mtsdram_as(SDRAM_SDTR1, 0x80201000);
-
- /* SDRAM_SDTR2 */
- mtsdram_as(SDRAM_SDTR2, 0x32204232);
+ /*
+ * Start Initialization by SDRAM0_MCOPT2[SREN] = 0 and
+ * SDRAM0_MCOPT2[IPTR] = 1
+ */
+ mtsdram_as(SDRAM_MCOPT2, SDRAM_MCOPT2_SREN_EXIT | \
+ SDRAM_MCOPT2_IPTR_EXECUTE);
- /* SDRAM_SDTR3 */
- mtsdram_as(SDRAM_SDTR3, 0x080b0d1a);
+ /*
+ * Poll SDRAM0_MCSTAT[MIC] for assertion to indicate the
+ * completion of initialization.
+ *
+ * do {
+ * mfsdram(SDRAM_MCSTAT, val);
+ * } while ((val & SDRAM_MCSTAT_MIC_MASK) != SDRAM_MCSTAT_MIC_COMP);
+ */
+ li r4,SDRAM_MCSTAT
+ lis r2,SDRAM_MCSTAT_MIC_COMP@h
+ ori r2,r2,SDRAM_MCSTAT_MIC_COMP@l
+0: mtdcr memcfga,r4
+ mfdcr r3,memcfgd
+ clrrwi r3,r3,31
+ cmpw cr7,r3,r2
+ bne+ cr7,0b
+
+ /* Set Delay Control Registers */
+ mtsdram_as(SDRAM_DLCR, CFG_SDRAM0_DLCR);
+ mtsdram_as(SDRAM_RDCC, CFG_SDRAM0_RDCC);
+ mtsdram_as(SDRAM_RQDC, CFG_SDRAM0_RQDC);
+ mtsdram_as(SDRAM_RFDC, CFG_SDRAM0_RFDC);
- mtsdram_as(SDRAM_MMODE, 0x00000442);
- mtsdram_as(SDRAM_MEMODE, 0x00000404);
+ /*
+ * Enable Controller by SDRAM0_MCOPT2[DCEN] = 1:
+ *
+ * mcopt2 = mfsdram(SDRAM_MCOPT2);
+ */
+ li r4,SDRAM_MCOPT2
+ mtdcr memcfga,r4
+ mfdcr r3,memcfgd
- /* SDRAM0_MCOPT1 (0X20) No ECC Gen */
- mtsdram_as(SDRAM_MCOPT1, 0x04322000);
+ /*
+ * mtsdram(SDRAM_MCOPT2, mcopt2 | SDRAM_MCOPT2_DCEN_ENABLE);
+ */
+ mtdcr memcfga,r4
+ oris r3,r3,SDRAM_MCOPT2_DCEN_ENABLE@h
+ ori r3,r3,SDRAM_MCOPT2_DCEN_ENABLE@l
+ mtdcr memcfgd,r3
- /* NOP */
- mtsdram_as(SDRAM_INITPLR0, 0xa8380000);
- /* precharge 3 DDR clock cycle */
- mtsdram_as(SDRAM_INITPLR1, 0x81900400);
- /* EMR2 twr = 2tck */
- mtsdram_as(SDRAM_INITPLR2, 0x81020000);
- /* EMR3 twr = 2tck */
- mtsdram_as(SDRAM_INITPLR3, 0x81030000);
- /* EMR DLL ENABLE twr = 2tck */
- mtsdram_as(SDRAM_INITPLR4, 0x81010404);
- /* MR w/ DLL reset
- * Note: 5 is CL. May need to be changed
+#if defined(CONFIG_DDR_ECC)
+ /*
+ * ecc_init(CFG_SDRAM_BASE, CFG_MBYTES_SDRAM << 20);
*/
- mtsdram_as(SDRAM_INITPLR5, 0x81000542);
- /* precharge 3 DDR clock cycle */
- mtsdram_as(SDRAM_INITPLR6, 0x81900400);
- /* Auto-refresh trfc = 26tck */
- mtsdram_as(SDRAM_INITPLR7, 0x8D080000);
- /* Auto-refresh trfc = 26tck */
- mtsdram_as(SDRAM_INITPLR8, 0x8D080000);
- /* Auto-refresh */
- mtsdram_as(SDRAM_INITPLR9, 0x8D080000);
- /* Auto-refresh */
- mtsdram_as(SDRAM_INITPLR10, 0x8D080000);
- /* MRS - normal operation; wait 2 cycle (set wait to tMRD) */
- mtsdram_as(SDRAM_INITPLR11, 0x81000442);
- mtsdram_as(SDRAM_INITPLR12, 0x81010780);
- mtsdram_as(SDRAM_INITPLR13, 0x81010400);
- mtsdram_as(SDRAM_INITPLR14, 0x00000000);
- mtsdram_as(SDRAM_INITPLR15, 0x00000000);
-
- /* SET MCIF0_CODT Die Termination On */
- mtsdram_as(SDRAM_CODT, 0x0080f837);
- mtsdram_as(SDRAM_MODT0, 0x01800000);
- mtsdram_as(SDRAM_MODT1, 0x00000000);
-
- mtsdram_as(SDRAM_WRDTR, 0x00000000);
-
- /* SDRAM0_MCOPT2 (0X21) Start initialization */
- mtsdram_as(SDRAM_MCOPT2, 0x20000000);
-
- /* Step 5 */
- lis r3,0x1 /* 400000 = wait 100ms */
- mtctr r3
-
-pll_wait:
- bdnz pll_wait
-
- /* Step 6 */
-
- /* SDRAM_DLCR */
- mtsdram_as(SDRAM_DLCR, 0x030000a5);
-
- /* SDRAM_RDCC */
- mtsdram_as(SDRAM_RDCC, 0x40000000);
-
- /* SDRAM_RQDC */
- mtsdram_as(SDRAM_RQDC, 0x80000038);
-
- /* SDRAM_RFDC */
- mtsdram_as(SDRAM_RFDC, 0x00000209);
-
- /* Enable memory controller */
- mtsdram_as(SDRAM_MCOPT2, 0x28000000);
-#endif /* #ifndef CONFIG_NAND_U_BOOT */
+ mflr r13
+ lis r3,CFG_SDRAM_BASE@h
+ ori r3,r3,CFG_SDRAM_BASE@l
+ lis r4,(CFG_MBYTES_SDRAM << 20)@h
+ ori r4,r4,(CFG_MBYTES_SDRAM << 20)@l
+ bl ecc_init
+ mtlr r13
+#endif /* defined(CONFIG_DDR_ECC) */
+#endif /* !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL) */
+#endif /* !defined(CFG_INIT_DCACHE_CS) */
blr
diff --git a/board/amcc/kilauea/memory.c b/board/amcc/kilauea/memory.c
index 1d7a3fa..8a2bbbc 100644
--- a/board/amcc/kilauea/memory.c
+++ b/board/amcc/kilauea/memory.c
@@ -1,6 +1,9 @@
/*
- * (C) Copyright 2007
- * Stefan Roese, DENX Software Engineering, sr(a)denx.de.
+ * Copyright (c) 2008 Nuovation System Designs, LLC
+ * Grant Erickson <gerickson(a)nuovations.com>
+ *
+ * Copyright (c) 2007 DENX Software Engineering, GmbH
+ * Stefan Roese <sr(a)denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -30,11 +33,6 @@ void sdram_init(void)
return;
}
-long int initdram(int board_type)
-{
- return (CFG_MBYTES_SDRAM << 20);
-}
-
#if defined(CFG_DRAM_TEST)
int testdram (void)
{
diff --git a/board/amcc/makalu/init.S b/board/amcc/makalu/init.S
index 5e9a5e0..d74d93b 100644
--- a/board/amcc/makalu/init.S
+++ b/board/amcc/makalu/init.S
@@ -1,8 +1,9 @@
/*
- * (C) Copyright 2007-2008
- * Stefan Roese, DENX Software Engineering, sr(a)denx.de.
+ * Copyright (c) 2008 Nuovation System Designs, LLC
+ * Grant Erickson <gerickson(a)nuovations.com>
*
- * Based on code provided from Senao and AMCC
+ * Copyright (c) 2007-2008 DENX Software Engineering, GmbH
+ * Stefan Roese <sr(a)denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -23,126 +24,6 @@
* MA 02111-1307 USA
*/
-#include <config.h>
-#include <ppc4xx.h>
-
-#include <ppc_asm.tmpl>
-#include <ppc_defs.h>
-
-#define mtsdram_as(reg, value) \
- addi r4,0,reg ; \
- mtdcr memcfga,r4 ; \
- addis r4,0,value@h ; \
- ori r4,r4,value@l ; \
- mtdcr memcfgd,r4 ;
-
.globl ext_bus_cntlr_init
ext_bus_cntlr_init:
-
- /*
- * DDR2 setup
- */
-
- /* Following the DDR Core Manual, here is the initialization */
-
- /* Step 1 */
-
- /* Step 2 */
-
- /* Step 3 */
-
- /* base=00000000, size=128MByte (5), mode=2 (n*10*4) */
- mtsdram_as(SDRAM_MB0CF, 0x00005201);
-
- /* base=08000000, size=128MByte (5), mode=2 (n*10*4) */
- mtsdram_as(SDRAM_MB1CF, (0x08000000 >> 3) | 0x5201);
-
- /* SDRAM_CLKTR: Adv Addr clock by 180 deg */
- mtsdram_as(SDRAM_CLKTR,0x80000000);
-
- /* Refresh Time register (0x30) Refresh every 7.8125uS */
- mtsdram_as(SDRAM_RTR, 0x06180000);
-
- /* SDRAM_SDTR1 */
- mtsdram_as(SDRAM_SDTR1, 0x80201000);
-
- /* SDRAM_SDTR2 */
- mtsdram_as(SDRAM_SDTR2, 0x32204232);
-
- /* SDRAM_SDTR3 */
- mtsdram_as(SDRAM_SDTR3, 0x080b0d1a);
-
- mtsdram_as(SDRAM_MMODE, 0x00000442);
- mtsdram_as(SDRAM_MEMODE, 0x00000404);
-
- /* SDRAM0_MCOPT1 (0X20) No ECC Gen */
- mtsdram_as(SDRAM_MCOPT1, 0x04322000);
-
- /* NOP */
- mtsdram_as(SDRAM_INITPLR0, 0xa8380000);
- /* precharge 3 DDR clock cycle */
- mtsdram_as(SDRAM_INITPLR1, 0x81900400);
- /* EMR2 twr = 2tck */
- mtsdram_as(SDRAM_INITPLR2, 0x81020000);
- /* EMR3 twr = 2tck */
- mtsdram_as(SDRAM_INITPLR3, 0x81030000);
- /* EMR DLL ENABLE twr = 2tck */
- mtsdram_as(SDRAM_INITPLR4, 0x81010404);
- /* MR w/ DLL reset
- * Note: 5 is CL. May need to be changed
- */
- mtsdram_as(SDRAM_INITPLR5, 0x81000542);
- /* precharge 3 DDR clock cycle */
- mtsdram_as(SDRAM_INITPLR6, 0x81900400);
- /* Auto-refresh trfc = 26tck */
- mtsdram_as(SDRAM_INITPLR7, 0x8D080000);
- /* Auto-refresh trfc = 26tck */
- mtsdram_as(SDRAM_INITPLR8, 0x8D080000);
- /* Auto-refresh */
- mtsdram_as(SDRAM_INITPLR9, 0x8D080000);
- /* Auto-refresh */
- mtsdram_as(SDRAM_INITPLR10, 0x8D080000);
- /* MRS - normal operation; wait 2 cycle (set wait to tMRD) */
- mtsdram_as(SDRAM_INITPLR11, 0x81000442);
- mtsdram_as(SDRAM_INITPLR12, 0x81010780);
- mtsdram_as(SDRAM_INITPLR13, 0x81010400);
- mtsdram_as(SDRAM_INITPLR14, 0x00000000);
- mtsdram_as(SDRAM_INITPLR15, 0x00000000);
-
- /* SET MCIF0_CODT Die Termination On */
- mtsdram_as(SDRAM_CODT, 0x0080f837);
- mtsdram_as(SDRAM_MODT0, 0x01800000);
-#if 0 /* test-only: not sure if 0 is ok when 2nd bank is used */
- mtsdram_as(SDRAM_MODT1, 0x00000000);
-#endif
-
- mtsdram_as(SDRAM_WRDTR, 0x00000000);
-
- /* SDRAM0_MCOPT2 (0X21) Start initialization */
- mtsdram_as(SDRAM_MCOPT2, 0x20000000);
-
- /* Step 5 */
- lis r3,0x1 /* 400000 = wait 100ms */
- mtctr r3
-
-pll_wait:
- bdnz pll_wait
-
- /* Step 6 */
-
- /* SDRAM_DLCR */
- mtsdram_as(SDRAM_DLCR, 0x030000a5);
-
- /* SDRAM_RDCC */
- mtsdram_as(SDRAM_RDCC, 0x40000000);
-
- /* SDRAM_RQDC */
- mtsdram_as(SDRAM_RQDC, 0x80000038);
-
- /* SDRAM_RFDC */
- mtsdram_as(SDRAM_RFDC, 0x00000209);
-
- /* Enable memory controller */
- mtsdram_as(SDRAM_MCOPT2, 0x28000000);
-
blr
diff --git a/board/amcc/makalu/memory.c b/board/amcc/makalu/memory.c
index b03b60b..03c64fa 100644
--- a/board/amcc/makalu/memory.c
+++ b/board/amcc/makalu/memory.c
@@ -1,6 +1,9 @@
/*
- * (C) Copyright 2007
- * Stefan Roese, DENX Software Engineering, sr(a)denx.de.
+ * Copyright (c) 2008 Nuovation System Designs, LLC
+ * Grant Erickson <gerickson(a)nuovations.com>
+ *
+ * Copyright (c) 2007 DENX Software Engineering, GmbH
+ * Stefan Roese <sr(a)denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -29,121 +32,6 @@ void sdram_init(void)
return;
}
-long int initdram(int board_type)
-{
- /*
- * Same as on Kilauea, Makalu generates exception 0x200
- * (machine check) after trap_init() in board_init_f,
- * when SDRAM is initialized here (late) and d-cache is
- * used earlier as INIT_RAM.
- * So for now, initialize DDR2 in init.S very early and
- * also use it for INIT_RAM. Then this exception doesn't
- * occur.
- */
-#if 0
- u32 val;
-
- /* base=00000000, size=128MByte (5), mode=2 (n*10*4) */
- mtsdram(SDRAM_MB0CF, 0x00005201);
-
- /* SET SDRAM_MB1CF - Not enabled */
- mtsdram(SDRAM_MB1CF, 0x00000000);
-
- /* SET SDRAM_MB2CF - Not enabled */
- mtsdram(SDRAM_MB2CF, 0x00000000);
-
- /* SET SDRAM_MB3CF - Not enabled */
- mtsdram(SDRAM_MB3CF, 0x00000000);
-
- /* SDRAM_CLKTR: Adv Addr clock by 90 deg */
- mtsdram(SDRAM_CLKTR, 0x80000000);
-
- /* Refresh Time register (0x30) Refresh every 7.8125uS */
- mtsdram(SDRAM_RTR, 0x06180000);
-
- /* SDRAM_SDTR1 */
- mtsdram(SDRAM_SDTR1, 0x80201000);
-
- /* SDRAM_SDTR2 */
- mtsdram(SDRAM_SDTR2, 0x32204232);
-
- /* SDRAM_SDTR3 */
- mtsdram(SDRAM_SDTR3, 0x080b0d1a);
-
- mtsdram(SDRAM_MMODE, 0x00000442);
- mtsdram(SDRAM_MEMODE, 0x00000404);
-
- /* SDRAM0_MCOPT1 (0X20) No ECC Gen */
- mtsdram(SDRAM_MCOPT1, 0x04322000);
-
- /* NOP */
- mtsdram(SDRAM_INITPLR0, 0xa8380000);
- /* precharge 3 DDR clock cycle */
- mtsdram(SDRAM_INITPLR1, 0x81900400);
- /* EMR2 twr = 2tck */
- mtsdram(SDRAM_INITPLR2, 0x81020000);
- /* EMR3 twr = 2tck */
- mtsdram(SDRAM_INITPLR3, 0x81030000);
- /* EMR DLL ENABLE twr = 2tck */
- mtsdram(SDRAM_INITPLR4, 0x81010404);
- /* MR w/ DLL reset
- * Note: 5 is CL. May need to be changed
- */
- mtsdram(SDRAM_INITPLR5, 0x81000542);
- /* precharge 3 DDR clock cycle */
- mtsdram(SDRAM_INITPLR6, 0x81900400);
- /* Auto-refresh trfc = 26tck */
- mtsdram(SDRAM_INITPLR7, 0x8D080000);
- /* Auto-refresh trfc = 26tck */
- mtsdram(SDRAM_INITPLR8, 0x8D080000);
- /* Auto-refresh */
- mtsdram(SDRAM_INITPLR9, 0x8D080000);
- /* Auto-refresh */
- mtsdram(SDRAM_INITPLR10, 0x8D080000);
- /* MRS - normal operation; wait 2 cycle (set wait to tMRD) */
- mtsdram(SDRAM_INITPLR11, 0x81000442);
- mtsdram(SDRAM_INITPLR12, 0x81010780);
- mtsdram(SDRAM_INITPLR13, 0x81010400);
- mtsdram(SDRAM_INITPLR14, 0x00000000);
- mtsdram(SDRAM_INITPLR15, 0x00000000);
-
- /* SET MCIF0_CODT Die Termination On */
- mtsdram(SDRAM_CODT, 0x0080f837);
- mtsdram(SDRAM_MODT0, 0x01800000);
- mtsdram(SDRAM_MODT1, 0x00000000);
-
- mtsdram(SDRAM_WRDTR, 0x00000000);
-
- /* SDRAM0_MCOPT2 (0X21) Start initialization */
- mtsdram(SDRAM_MCOPT2, 0x20000000);
-
- /* Step 5 */
- do {
- mfsdram(SDRAM_MCSTAT, val);
- } while ((val & SDRAM_MCSTAT_MIC_COMP) != SDRAM_MCSTAT_MIC_COMP);
-
- /* Step 6 */
-
- /* SDRAM_DLCR */
- mtsdram(SDRAM_DLCR, 0x030000a5);
-
- /* SDRAM_RDCC */
- mtsdram(SDRAM_RDCC, 0x40000000);
-
- /* SDRAM_RQDC */
- mtsdram(SDRAM_RQDC, 0x80000038);
-
- /* SDRAM_RFDC */
- mtsdram(SDRAM_RFDC, 0x00000209);
-
- /* Enable memory controller */
- mfsdram(SDRAM_MCOPT2, val);
- val |= SDRAM_MCOPT2_DCEN_ENABLE;
- mtsdram(SDRAM_MCOPT2, val);
-#endif
- return (CFG_MBYTES_SDRAM << 20);
-}
-
#if defined(CFG_DRAM_TEST)
int testdram (void)
{
diff --git a/cpu/ppc4xx/44x_spd_ddr.c b/cpu/ppc4xx/44x_spd_ddr.c
index b9cf5cb..b7eeaf2 100644
--- a/cpu/ppc4xx/44x_spd_ddr.c
+++ b/cpu/ppc4xx/44x_spd_ddr.c
@@ -53,6 +53,8 @@
#include <ppc4xx.h>
#include <asm/mmu.h>
+#include "ecc.h"
+
#if defined(CONFIG_SPD_EEPROM) && \
(defined(CONFIG_440GP) || defined(CONFIG_440GX) || \
defined(CONFIG_440EP) || defined(CONFIG_440GR))
@@ -296,10 +298,6 @@ static void program_tr0(unsigned long *dimm_populated,
unsigned long num_dimm_banks);
static void program_tr1(void);
-#ifdef CONFIG_DDR_ECC
-static void program_ecc(unsigned long num_bytes);
-#endif
-
static unsigned long program_bxcr(unsigned long *dimm_populated,
unsigned char *iic0_dimm_addr,
unsigned long num_dimm_banks);
@@ -418,7 +416,7 @@ long int spd_sdram(void) {
/*
* If ecc is enabled, initialize the parity bits.
*/
- program_ecc(total_size);
+ ecc_init(CFG_SDRAM_BASE, total_size);
#endif
return total_size;
@@ -1402,45 +1400,4 @@ static unsigned long program_bxcr(unsigned long *dimm_populated,
return(bank_base_addr);
}
-
-#ifdef CONFIG_DDR_ECC
-static void program_ecc(unsigned long num_bytes)
-{
- unsigned long bank_base_addr;
- unsigned long current_address;
- unsigned long end_address;
- unsigned long address_increment;
- unsigned long cfg0;
-
- /*
- * get Memory Controller Options 0 data
- */
- mfsdram(mem_cfg0, cfg0);
-
- /*
- * reset the bank_base address
- */
- bank_base_addr = CFG_SDRAM_BASE;
-
- if ((cfg0 & SDRAM_CFG0_MCHK_MASK) != SDRAM_CFG0_MCHK_NON) {
- mtsdram(mem_cfg0, (cfg0 & ~SDRAM_CFG0_MCHK_MASK) | SDRAM_CFG0_MCHK_GEN);
-
- if ((cfg0 & SDRAM_CFG0_DMWD_MASK) == SDRAM_CFG0_DMWD_32)
- address_increment = 4;
- else
- address_increment = 8;
-
- current_address = (unsigned long)(bank_base_addr);
- end_address = (unsigned long)(bank_base_addr) + num_bytes;
-
- while (current_address < end_address) {
- *((unsigned long*)current_address) = 0x00000000;
- current_address += address_increment;
- }
-
- mtsdram(mem_cfg0, (cfg0 & ~SDRAM_CFG0_MCHK_MASK) |
- SDRAM_CFG0_MCHK_CHK);
- }
-}
-#endif /* CONFIG_DDR_ECC */
#endif /* CONFIG_SPD_EEPROM */
diff --git a/cpu/ppc4xx/44x_spd_ddr2.c b/cpu/ppc4xx/44x_spd_ddr2.c
index ec76b71..ae6024f 100644
--- a/cpu/ppc4xx/44x_spd_ddr2.c
+++ b/cpu/ppc4xx/44x_spd_ddr2.c
@@ -3,11 +3,14 @@
* This SPD SDRAM detection code supports AMCC PPC44x cpu's with a
* DDR2 controller (non Denali Core). Those currently are:
*
- * 405: 405EX
+ * 405: 405EX(r)
* 440/460: 440SP/440SPe/460EX/460GT
*
- * (C) Copyright 2007-2008
- * Stefan Roese, DENX Software Engineering, sr(a)denx.de.
+ * Copyright (c) 2008 Nuovation System Designs, LLC
+ * Grant Erickson <gerickson(a)nuovations.com>
+ *
+ * Copyright (c) 2007-2008 DENX Software Engineering, GmbH
+ * Stefan Roese <sr(a)denx.de>
*
* COPYRIGHT AMCC CORPORATION 2004
*
@@ -45,6 +48,8 @@
#include <asm/mmu.h>
#include <asm/cache.h>
+#include "ecc.h"
+
#if defined(CONFIG_SPD_EEPROM) && \
(defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
defined(CONFIG_460EX) || defined(CONFIG_460GT))
@@ -3064,9 +3069,116 @@ static void ppc440sp_sdram_register_dump(void)
dcr_data = mfdcr(SDRAM_R3BAS);
printf(" MQ3_B0BAS = 0x%08X\n", dcr_data);
}
-#else
+#else /* !defined(DEBUG) */
static void ppc440sp_sdram_register_dump(void)
{
}
-#endif
-#endif /* CONFIG_SPD_EEPROM */
+#endif /* defined(DEBUG) */
+#elif defined(CONFIG_405EX)
+/*-----------------------------------------------------------------------------
+ * Function: initdram
+ * Description: Configures the PPC405EX(r) DDR1/DDR2 SDRAM memory
+ * banks. The configuration is performed using static, compile-
+ * time parameters.
+ *---------------------------------------------------------------------------*/
+long initdram(int board_type)
+{
+ unsigned long val;
+
+ /* Set Memory Bank Configuration Registers */
+
+ mtsdram(SDRAM_MB0CF, CFG_SDRAM0_MB0CF);
+ mtsdram(SDRAM_MB1CF, CFG_SDRAM0_MB1CF);
+ mtsdram(SDRAM_MB2CF, CFG_SDRAM0_MB2CF);
+ mtsdram(SDRAM_MB3CF, CFG_SDRAM0_MB3CF);
+
+ /* Set Memory Clock Timing Register */
+
+ mtsdram(SDRAM_CLKTR, CFG_SDRAM0_CLKTR);
+
+ /* Set Refresh Time Register */
+
+ mtsdram(SDRAM_RTR, CFG_SDRAM0_RTR);
+
+ /* Set SDRAM Timing Registers */
+
+ mtsdram(SDRAM_SDTR1, CFG_SDRAM0_SDTR1);
+ mtsdram(SDRAM_SDTR2, CFG_SDRAM0_SDTR2);
+ mtsdram(SDRAM_SDTR3, CFG_SDRAM0_SDTR3);
+
+ /* Set Mode and Extended Mode Registers */
+
+ mtsdram(SDRAM_MMODE, CFG_SDRAM0_MMODE);
+ mtsdram(SDRAM_MEMODE, CFG_SDRAM0_MEMODE);
+
+ /* Set Memory Controller Options 1 Register */
+
+ mtsdram(SDRAM_MCOPT1, CFG_SDRAM0_MCOPT1);
+
+ /* Set Manual Initialization Control Registers */
+
+ mtsdram(SDRAM_INITPLR0, CFG_SDRAM0_INITPLR0);
+ mtsdram(SDRAM_INITPLR1, CFG_SDRAM0_INITPLR1);
+ mtsdram(SDRAM_INITPLR2, CFG_SDRAM0_INITPLR2);
+ mtsdram(SDRAM_INITPLR3, CFG_SDRAM0_INITPLR3);
+ mtsdram(SDRAM_INITPLR4, CFG_SDRAM0_INITPLR4);
+ mtsdram(SDRAM_INITPLR5, CFG_SDRAM0_INITPLR5);
+ mtsdram(SDRAM_INITPLR6, CFG_SDRAM0_INITPLR6);
+ mtsdram(SDRAM_INITPLR7, CFG_SDRAM0_INITPLR7);
+ mtsdram(SDRAM_INITPLR8, CFG_SDRAM0_INITPLR8);
+ mtsdram(SDRAM_INITPLR9, CFG_SDRAM0_INITPLR9);
+ mtsdram(SDRAM_INITPLR10, CFG_SDRAM0_INITPLR10);
+ mtsdram(SDRAM_INITPLR11, CFG_SDRAM0_INITPLR11);
+ mtsdram(SDRAM_INITPLR12, CFG_SDRAM0_INITPLR12);
+ mtsdram(SDRAM_INITPLR13, CFG_SDRAM0_INITPLR13);
+ mtsdram(SDRAM_INITPLR14, CFG_SDRAM0_INITPLR14);
+ mtsdram(SDRAM_INITPLR15, CFG_SDRAM0_INITPLR15);
+
+ /* Set On-Die Termination Registers */
+
+ mtsdram(SDRAM_CODT, CFG_SDRAM0_CODT);
+ mtsdram(SDRAM_MODT0, CFG_SDRAM0_MODT0);
+ mtsdram(SDRAM_MODT1, CFG_SDRAM0_MODT1);
+
+ /* Set Write Timing Register */
+
+ mtsdram(SDRAM_WRDTR, CFG_SDRAM0_WRDTR);
+
+ /*
+ * Start Initialization by SDRAM0_MCOPT2[SREN] = 0 and
+ * SDRAM0_MCOPT2[IPTR] = 1
+ */
+
+ mtsdram(SDRAM_MCOPT2, (SDRAM_MCOPT2_SREN_EXIT |
+ SDRAM_MCOPT2_IPTR_EXECUTE));
+
+ /*
+ * Poll SDRAM0_MCSTAT[MIC] for assertion to indicate the
+ * completion of initialization.
+ */
+
+ do {
+ mfsdram(SDRAM_MCSTAT, val);
+ } while ((val & SDRAM_MCSTAT_MIC_MASK) != SDRAM_MCSTAT_MIC_COMP);
+
+ /* Set Delay Control Registers */
+
+ mtsdram(SDRAM_DLCR, CFG_SDRAM0_DLCR);
+ mtsdram(SDRAM_RDCC, CFG_SDRAM0_RDCC);
+ mtsdram(SDRAM_RQDC, CFG_SDRAM0_RQDC);
+ mtsdram(SDRAM_RFDC, CFG_SDRAM0_RFDC);
+
+ /*
+ * Enable Controller by SDRAM0_MCOPT2[DCEN] = 1:
+ */
+
+ mfsdram(SDRAM_MCOPT2, val);
+ mtsdram(SDRAM_MCOPT2, val | SDRAM_MCOPT2_DCEN_ENABLE);
+
+#if defined(CONFIG_DDR_ECC)
+ ecc_init(CFG_SDRAM_BASE, CFG_MBYTES_SDRAM << 20);
+#endif /* defined(CONFIG_DDR_ECC) */
+
+ return (CFG_MBYTES_SDRAM << 20);
+}
+#endif /* defined(CONFIG_SPD_EEPROM) && defined(CONFIG_440SP) || ... */
diff --git a/cpu/ppc4xx/Makefile b/cpu/ppc4xx/Makefile
index 178c5c6..800bb41 100644
--- a/cpu/ppc4xx/Makefile
+++ b/cpu/ppc4xx/Makefile
@@ -45,6 +45,7 @@ COBJS += cpu.o
COBJS += cpu_init.o
COBJS += denali_data_eye.o
COBJS += denali_spd_ddr2.o
+COBJS += ecc.o
COBJS += fdt.o
COBJS += gpio.o
COBJS += i2c.o
diff --git a/cpu/ppc4xx/cpu_init.c b/cpu/ppc4xx/cpu_init.c
index 42eabfe..1e9423a 100644
--- a/cpu/ppc4xx/cpu_init.c
+++ b/cpu/ppc4xx/cpu_init.c
@@ -32,73 +32,6 @@
DECLARE_GLOBAL_DATA_PTR;
#endif
-#ifdef CFG_INIT_DCACHE_CS
-# if (CFG_INIT_DCACHE_CS == 0)
-# define PBxAP pb0ap
-# define PBxCR pb0cr
-# if (defined(CFG_EBC_PB0AP) && defined(CFG_EBC_PB0CR))
-# define PBxAP_VAL CFG_EBC_PB0AP
-# define PBxCR_VAL CFG_EBC_PB0CR
-# endif
-# endif
-# if (CFG_INIT_DCACHE_CS == 1)
-# define PBxAP pb1ap
-# define PBxCR pb1cr
-# if (defined(CFG_EBC_PB1AP) && defined(CFG_EBC_PB1CR))
-# define PBxAP_VAL CFG_EBC_PB1AP
-# define PBxCR_VAL CFG_EBC_PB1CR
-# endif
-# endif
-# if (CFG_INIT_DCACHE_CS == 2)
-# define PBxAP pb2ap
-# define PBxCR pb2cr
-# if (defined(CFG_EBC_PB2AP) && defined(CFG_EBC_PB2CR))
-# define PBxAP_VAL CFG_EBC_PB2AP
-# define PBxCR_VAL CFG_EBC_PB2CR
-# endif
-# endif
-# if (CFG_INIT_DCACHE_CS == 3)
-# define PBxAP pb3ap
-# define PBxCR pb3cr
-# if (defined(CFG_EBC_PB3AP) && defined(CFG_EBC_PB3CR))
-# define PBxAP_VAL CFG_EBC_PB3AP
-# define PBxCR_VAL CFG_EBC_PB3CR
-# endif
-# endif
-# if (CFG_INIT_DCACHE_CS == 4)
-# define PBxAP pb4ap
-# define PBxCR pb4cr
-# if (defined(CFG_EBC_PB4AP) && defined(CFG_EBC_PB4CR))
-# define PBxAP_VAL CFG_EBC_PB4AP
-# define PBxCR_VAL CFG_EBC_PB4CR
-# endif
-# endif
-# if (CFG_INIT_DCACHE_CS == 5)
-# define PBxAP pb5ap
-# define PBxCR pb5cr
-# if (defined(CFG_EBC_PB5AP) && defined(CFG_EBC_PB5CR))
-# define PBxAP_VAL CFG_EBC_PB5AP
-# define PBxCR_VAL CFG_EBC_PB5CR
-# endif
-# endif
-# if (CFG_INIT_DCACHE_CS == 6)
-# define PBxAP pb6ap
-# define PBxCR pb6cr
-# if (defined(CFG_EBC_PB6AP) && defined(CFG_EBC_PB6CR))
-# define PBxAP_VAL CFG_EBC_PB6AP
-# define PBxCR_VAL CFG_EBC_PB6CR
-# endif
-# endif
-# if (CFG_INIT_DCACHE_CS == 7)
-# define PBxAP pb7ap
-# define PBxCR pb7cr
-# if (defined(CFG_EBC_PB7AP) && defined(CFG_EBC_PB7CR))
-# define PBxAP_VAL CFG_EBC_PB7AP
-# define PBxCR_VAL CFG_EBC_PB7CR
-# endif
-# endif
-#endif /* CFG_INIT_DCACHE_CS */
-
#ifndef CFG_PLL_RECONFIG
#define CFG_PLL_RECONFIG 0
#endif
@@ -353,24 +286,6 @@ int cpu_init_r (void)
uint pvr = get_pvr();
#endif
-#ifdef CFG_INIT_DCACHE_CS
- /*
- * Flush and invalidate dcache, then disable CS for temporary stack.
- * Afterwards, this CS can be used for other purposes
- */
- dcache_disable(); /* flush and invalidate dcache */
- mtebc(PBxAP, 0);
- mtebc(PBxCR, 0); /* disable CS for temporary stack */
-
-#if (defined(PBxAP_VAL) && defined(PBxCR_VAL))
- /*
- * Write new value into CS register
- */
- mtebc(PBxAP, PBxAP_VAL);
- mtebc(PBxCR, PBxCR_VAL);
-#endif
-#endif /* CFG_INIT_DCACHE_CS */
-
/*
* Write Ethernetaddress into on-chip register
*/
diff --git a/cpu/ppc4xx/ecc.c b/cpu/ppc4xx/ecc.c
new file mode 100644
index 0000000..f9bff9a
--- /dev/null
+++ b/cpu/ppc4xx/ecc.c
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2008 Nuovation System Designs, LLC
+ * Grant Erickson <gerickson(a)nuovations.com>
+ *
+ * Copyright (c) 2005-2007 DENX Software Engineering, GmbH
+ * Stefan Roese <sr(a)denx.de>
+ *
+ * Copyright (c) 2002 Artesyn Technology
+ * Jun Gu <jung(a)artesyncp.com>
+ *
+ * Copyright (c) 2001 Wave 7 Optics
+ * Bill Hunter <williamhunter(a)attbi.com>x
+ *
+ * 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 abe 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
+ *
+ * Description:
+ * This file implements generic DRAM ECC initialization for
+ * PowerPC processors using a SDRAM DDR/DDR2 controller,
+ * including the 405EX(r), 440GP/GX/EP/GR, 440SP(E), and
+ * 460EX/GT.
+ */
+
+#include <common.h>
+#include <ppc4xx.h>
+#include <ppc_asm.tmpl>
+#include <ppc_defs.h>
+#include <asm/processor.h>
+#include <asm/io.h>
+
+#include "ecc.h"
+
+#if !defined(CONFIG_440EPX) && !defined(CONFIG_440GRX)
+#if defined(CONFIG_DDR_ECC) || defined(CONFIG_SDRAM_ECC)
+/*
+ * void ecc_init()
+ *
+ * Description:
+ * This routine initializes a range of DRAM ECC memory with known
+ * data and enables ECC checking.
+ *
+ * TO DO:
+ * - Improve performance by utilizing cache.
+ * - Further generalize to make usable by other 4xx variants (e.g.
+ * 440EPx, et al).
+ *
+ * Input(s):
+ * start - A pointer to the start of memory covered by ECC requiring
+ * initialization.
+ * size - The size, in bytes, of the memory covered by ECC requiring
+ * initialization.
+ *
+ * Output(s):
+ * start - A pointer to the start of memory covered by ECC with
+ * CFG_ECC_PATTERN written to all locations and ECC data
+ * primed.
+ *
+ * Returns:
+ * N/A
+ */
+void ecc_init(unsigned long * const start, unsigned long size)
+{
+ const unsigned long pattern = CFG_ECC_PATTERN;
+ unsigned * const end = (unsigned long * const)((long)start + size);
+ unsigned long * current = start;
+ unsigned long mcopt1;
+ long increment;
+
+ if (start >= end)
+ return;
+
+ mfsdram(SDRAM_MCOPT1, mcopt1);
+
+ /* Enable ECC generation without checking or reporting */
+
+ mtsdram(SDRAM_MCOPT1, ((mcopt1 & ~SDRAM_MCOPT1_MCHK_MASK) |
+ SDRAM_MCOPT1_MCHK_GEN));
+
+ increment = sizeof(u32);
+
+#if defined(CONFIG_440)
+ /*
+ * Look at the geometry of SDRAM (data width) to determine whether we
+ * can skip words when writing.
+ */
+
+ if ((mcopt1 & SDRAM_MCOPT1_DMWD_MASK) != SDRAM_MCOPT1_DMWD_32)
+ increment = sizeof(u64);
+#endif /* defined(CONFIG_440) */
+
+ while (current < end) {
+ *current = pattern;
+ current = (unsigned long *)((long)current + increment);
+ }
+
+ /* Wait until the writes are finished. */
+
+ sync();
+
+ /* Enable ECC generation with checking and no reporting */
+
+ mtsdram(SDRAM_MCOPT1, ((mcopt1 & ~SDRAM_MCOPT1_MCHK_MASK) |
+ SDRAM_MCOPT1_MCHK_CHK));
+}
+#endif /* defined(CONFIG_DDR_ECC) || defined(CONFIG_SDRAM_ECC) */
+#endif /* !defined(CONFIG_440EPX) && !defined(CONFIG_440GRX) */
diff --git a/cpu/ppc4xx/ecc.h b/cpu/ppc4xx/ecc.h
new file mode 100644
index 0000000..da1c4fd
--- /dev/null
+++ b/cpu/ppc4xx/ecc.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2008 Nuovation System Designs, LLC
+ * Grant Erickson <gerickson(a)nuovations.com>
+ *
+ * Copyright (c) 2007 DENX Software Engineering, GmbH
+ * Stefan Roese <sr(a)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 abe 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
+ *
+ * Description:
+ * This file implements ECC initialization for PowerPC processors
+ * using the SDRAM DDR2 controller, including the 405EX(r),
+ * 440SP(E), 460EX and 460GT.
+ *
+ */
+
+#ifndef _ECC_H_
+#define _ECC_H_
+
+#if !defined(CFG_ECC_PATTERN)
+#define CFG_ECC_PATTERN 0x00000000
+#endif /* !defined(CFG_ECC_PATTERN) */
+
+extern void ecc_init(unsigned long * const start, unsigned long size);
+
+#endif /* _ECC_H_ */
diff --git a/cpu/ppc4xx/sdram.c b/cpu/ppc4xx/sdram.c
index 2724d91..901d650 100644
--- a/cpu/ppc4xx/sdram.c
+++ b/cpu/ppc4xx/sdram.c
@@ -31,6 +31,7 @@
#include <ppc4xx.h>
#include <asm/processor.h>
#include "sdram.h"
+#include "ecc.h"
#ifdef CONFIG_SDRAM_BANK0
@@ -332,49 +333,6 @@ static void sdram_tr1_set(int ram_address, int* tr1_value)
*tr1_value = (first_good + last_bad) / 2;
}
-#ifdef CONFIG_SDRAM_ECC
-static void ecc_init(ulong start, ulong size)
-{
- ulong current_addr; /* current byte address */
- ulong end_addr; /* end of memory region */
- ulong addr_inc; /* address skip between writes */
- ulong cfg0_reg; /* for restoring ECC state */
-
- /*
- * TODO: Enable dcache before running this test (speedup)
- */
-
- mfsdram(mem_cfg0, cfg0_reg);
- mtsdram(mem_cfg0, (cfg0_reg & ~SDRAM_CFG0_MEMCHK) | SDRAM_CFG0_MEMCHK_GEN);
-
- /*
- * look at geometry of SDRAM (data width) to determine whether we
- * can skip words when writing
- */
- if ((cfg0_reg & SDRAM_CFG0_DRAMWDTH) == SDRAM_CFG0_DRAMWDTH_32)
- addr_inc = 4;
- else
- addr_inc = 8;
-
- current_addr = start;
- end_addr = start + size;
-
- while (current_addr < end_addr) {
- *((ulong *)current_addr) = 0x00000000;
- current_addr += addr_inc;
- }
-
- /*
- * TODO: Flush dcache and disable it again
- */
-
- /*
- * Enable ecc checking and parity errors
- */
- mtsdram(mem_cfg0, (cfg0_reg & ~SDRAM_CFG0_MEMCHK) | SDRAM_CFG0_MEMCHK_CHK);
-}
-#endif
-
/*
* Autodetect onboard DDR SDRAM on 440 platforms
*
diff --git a/cpu/ppc4xx/start.S b/cpu/ppc4xx/start.S
index a513b45..e43da7b 100644
--- a/cpu/ppc4xx/start.S
+++ b/cpu/ppc4xx/start.S
@@ -3,6 +3,8 @@
* Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
* Copyright (C) 2000,2001,2002 Wolfgang Denk <wd(a)denx.de>
* Copyright (C) 2007 Stefan Roese <sr(a)denx.de>, DENX Software Engineering
+ * Copyright (c) 2008 Nuovation System Designs, LLC
+ * Grant Erickson <gerickson(a)nuovations.com>
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -79,34 +81,100 @@
# if (CFG_INIT_DCACHE_CS == 0)
# define PBxAP pb0ap
# define PBxCR pb0cr
+# if (defined(CFG_EBC_PB0AP) && defined(CFG_EBC_PB0CR))
+# define PBxAP_VAL CFG_EBC_PB0AP
+# define PBxCR_VAL CFG_EBC_PB0CR
+# endif
# endif
# if (CFG_INIT_DCACHE_CS == 1)
# define PBxAP pb1ap
# define PBxCR pb1cr
+# if (defined(CFG_EBC_PB1AP) && defined(CFG_EBC_PB1CR))
+# define PBxAP_VAL CFG_EBC_PB1AP
+# define PBxCR_VAL CFG_EBC_PB1CR
+# endif
# endif
# if (CFG_INIT_DCACHE_CS == 2)
# define PBxAP pb2ap
# define PBxCR pb2cr
+# if (defined(CFG_EBC_PB2AP) && defined(CFG_EBC_PB2CR))
+# define PBxAP_VAL CFG_EBC_PB2AP
+# define PBxCR_VAL CFG_EBC_PB2CR
+# endif
# endif
# if (CFG_INIT_DCACHE_CS == 3)
# define PBxAP pb3ap
# define PBxCR pb3cr
+# if (defined(CFG_EBC_PB3AP) && defined(CFG_EBC_PB3CR))
+# define PBxAP_VAL CFG_EBC_PB3AP
+# define PBxCR_VAL CFG_EBC_PB3CR
+# endif
# endif
# if (CFG_INIT_DCACHE_CS == 4)
# define PBxAP pb4ap
# define PBxCR pb4cr
+# if (defined(CFG_EBC_PB4AP) && defined(CFG_EBC_PB4CR))
+# define PBxAP_VAL CFG_EBC_PB4AP
+# define PBxCR_VAL CFG_EBC_PB4CR
+# endif
# endif
# if (CFG_INIT_DCACHE_CS == 5)
# define PBxAP pb5ap
# define PBxCR pb5cr
+# if (defined(CFG_EBC_PB5AP) && defined(CFG_EBC_PB5CR))
+# define PBxAP_VAL CFG_EBC_PB5AP
+# define PBxCR_VAL CFG_EBC_PB5CR
+# endif
# endif
# if (CFG_INIT_DCACHE_CS == 6)
# define PBxAP pb6ap
# define PBxCR pb6cr
+# if (defined(CFG_EBC_PB6AP) && defined(CFG_EBC_PB6CR))
+# define PBxAP_VAL CFG_EBC_PB6AP
+# define PBxCR_VAL CFG_EBC_PB6CR
+# endif
# endif
# if (CFG_INIT_DCACHE_CS == 7)
# define PBxAP pb7ap
# define PBxCR pb7cr
+# if (defined(CFG_EBC_PB7AP) && defined(CFG_EBC_PB7CR))
+# define PBxAP_VAL CFG_EBC_PB7AP
+# define PBxCR_VAL CFG_EBC_PB7CR
+# endif
+# endif
+# ifndef PBxAP_VAL
+# define PBxAP_VAL 0
+# endif
+# ifndef PBxCR_VAL
+# define PBxCR_VAL 0
+# endif
+/*
+ * Memory Bank x (nothingness) initialization CFG_INIT_RAM_ADDR + 64 MiB
+ * used as temporary stack pointer for the primordial stack
+ */
+# ifndef CFG_INIT_DCACHE_PBxAR
+# define CFG_INIT_DCACHE_PBxAR (EBC_BXAP_BME_DISABLED | \
+ EBC_BXAP_TWT_ENCODE(7) | \
+ EBC_BXAP_BCE_DISABLE | \
+ EBC_BXAP_BCT_2TRANS | \
+ EBC_BXAP_CSN_ENCODE(0) | \
+ EBC_BXAP_OEN_ENCODE(0) | \
+ EBC_BXAP_WBN_ENCODE(0) | \
+ EBC_BXAP_WBF_ENCODE(0) | \
+ EBC_BXAP_TH_ENCODE(2) | \
+ EBC_BXAP_RE_DISABLED | \
+ EBC_BXAP_SOR_NONDELAYED | \
+ EBC_BXAP_BEM_WRITEONLY | \
+ EBC_BXAP_PEN_DISABLED)
+# endif /* CFG_INIT_DCACHE_PBxAR */
+# ifndef CFG_INIT_DCACHE_PBxCR
+# define CFG_INIT_DCACHE_PBxCR (EBC_BXCR_BAS_ENCODE(CFG_INIT_RAM_ADDR) | \
+ EBC_BXCR_BS_64MB | \
+ EBC_BXCR_BU_RW | \
+ EBC_BXCR_BW_16BIT)
+# endif /* CFG_INIT_DCACHE_PBxCR */
+# ifndef CFG_INIT_RAM_PATTERN
+# define CFG_INIT_RAM_PATTERN 0xDEADDEAD
# endif
#endif /* CFG_INIT_DCACHE_CS */
@@ -840,15 +908,25 @@ _start:
/* make sure above stores all comlete before going on */
sync
- /*----------------------------------------------------------------------- */
- /* Enable two 128MB cachable regions. */
- /*----------------------------------------------------------------------- */
- addis r1,r0,0xc000
- addi r1,r1,0x0001
+ /*---------------------------------------------------------------------
+ * Enable two 128MB cachable instruction regions at CFG_SDRAM_BASE
+ * and another 128MB cacheable instruction region covering NOR flash
+ * at CFG_FLASH_BASE. Disbale all cacheable data regions.
+ *------------------------------------------------------------------ */
+
+#define ICSACRVAL (PPC_128MB_SACR_VALUE(CFG_SDRAM_BASE + ( 0 << 20)) | \
+ PPC_128MB_SACR_VALUE(CFG_SDRAM_BASE + (128 << 20)) | \
+ PPC_128MB_SACR_VALUE(CFG_FLASH_BASE))
+
+ lis r1, ICSACRVAL@h
+ ori r1, r1, ICSACRVAL@l
mticcr r1 /* instruction cache */
+ isync
- addis r1,r0,0x0000
- addi r1,r1,0x0000
+#define DCSACRVAL 0x00000000
+
+ lis r1, DCSACRVAL@h
+ ori r1, r1, DCSACRVAL@l
mtdccr r1 /* data cache */
addis r1,r0,CFG_INIT_RAM_ADDR@h
@@ -902,16 +980,25 @@ _start:
bl invalidate_icache
bl invalidate_dcache
- /*----------------------------------------------------------------------- */
- /* Enable two 128MB cachable regions. */
- /*----------------------------------------------------------------------- */
- lis r4,0xc000
- ori r4,r4,0x0001
+ /*---------------------------------------------------------------------
+ * Enable two 128MB cachable instruction regions at CFG_SDRAM_BASE
+ * and another 128MB cacheable instruction region covering NOR flash
+ * at CFG_FLASH_BASE. Disbale all cacheable data regions.
+ *------------------------------------------------------------------ */
+
+#define ICSACRVAL (PPC_128MB_SACR_VALUE(CFG_SDRAM_BASE + ( 0 << 20)) | \
+ PPC_128MB_SACR_VALUE(CFG_SDRAM_BASE + (128 << 20)) | \
+ PPC_128MB_SACR_VALUE(CFG_FLASH_BASE))
+
+ lis r4, ICSACRVAL@h
+ ori r4, r4, ICSACRVAL@l
mticcr r4 /* instruction cache */
isync
- lis r4,0x0000
- ori r4,r4,0x0000
+#define DCSACRVAL 0x00000000
+
+ lis r4, DCSACRVAL@h
+ ori r4, r4, DCSACRVAL@l
mtdccr r4 /* data cache */
#if !(defined(CFG_EBC_PB0AP) && defined(CFG_EBC_PB0CR)) || defined(CONFIG_405EX)
@@ -922,9 +1009,9 @@ _start:
#endif
#if !(defined(CFG_INIT_DCACHE_CS) || defined(CFG_TEMP_STACK_OCM))
/*
- * Boards like the Kilauea (405EX) don't have OCM and can't use
- * DCache for init-ram. So setup stack here directly after the
- * SDRAM is initialized.
+ * For boards that don't have OCM and can't use the data cache
+ * for their primordial stack, setup stack here directly after the
+ * SDRAM is initialized in ext_bus_cntlr_init.
*/
lis r1, CFG_INIT_RAM_ADDR@h
ori r1,r1,CFG_INIT_SP_OFFSET /* set up the stack in SDRAM */
@@ -1043,47 +1130,86 @@ start_ram:
/* Setup temporary stack in DCACHE or OCM if needed for SDRAM SPD. */
/*----------------------------------------------------------------------- */
#ifdef CFG_INIT_DCACHE_CS
- /*----------------------------------------------------------------------- */
- /* Memory Bank x (nothingness) initialization 1GB+64MEG */
- /* used as temporary stack pointer for stage0 */
- /*----------------------------------------------------------------------- */
- li r4,PBxAP
- mtdcr ebccfga,r4
- lis r4,0x0380
- ori r4,r4,0x0480
- mtdcr ebccfgd,r4
-
- addi r4,0,PBxCR
- mtdcr ebccfga,r4
- lis r4,0x400D
- ori r4,r4,0xa000
- mtdcr ebccfgd,r4
-
- /* turn on data cache for this region */
- lis r4,0x0080
+ li r4, PBxAP
+ mtdcr ebccfga, r4
+ lis r4, CFG_INIT_DCACHE_PBxAR@h
+ ori r4, r4, CFG_INIT_DCACHE_PBxAR@l
+ mtdcr ebccfgd, r4
+
+ addi r4, 0, PBxCR
+ mtdcr ebccfga, r4
+ lis r4, CFG_INIT_DCACHE_PBxCR@h
+ ori r4, r4, CFG_INIT_DCACHE_PBxCR@l
+ mtdcr ebccfgd, r4
+
+ /*
+ * Enable the data cache for the 128MB storage access control region
+ * at CFG_INIT_RAM_ADDR.
+ */
+ mfdccr r4
+ oris r4, r4, PPC_128MB_SACR_VALUE(CFG_INIT_RAM_ADDR)@h
+ ori r4, r4, PPC_128MB_SACR_VALUE(CFG_INIT_RAM_ADDR)@l
mtdccr r4
- /* set stack pointer and clear stack to known value */
+ /*
+ * Preallocate data cache lines to be used to avoid a subsequent
+ * cache miss and an ensuing machine check exception when exceptions
+ * are enabled.
+ */
+ li r0, 0
- lis r1,CFG_INIT_RAM_ADDR@h
- ori r1,r1,CFG_INIT_SP_OFFSET@l
+ lis r3, CFG_INIT_RAM_ADDR@h
+ ori r3, r3, CFG_INIT_RAM_ADDR@l
- li r4,2048 /* we store 2048 words to stack */
+ lis r4, CFG_INIT_RAM_END@h
+ ori r4, r4, CFG_INIT_RAM_END@l
+
+ /*
+ * Convert the size, in bytes, to the number of cache lines/blocks
+ * to preallocate.
+ */
+ clrlwi. r5, r4, (32 - L1_CACHE_SHIFT)
+ srwi r5, r4, L1_CACHE_SHIFT
+ beq ..load_counter
+ addi r5, r5, 0x0001
+..load_counter:
+ mtctr r5
+
+ /* Preallocate the computed number of cache blocks. */
+..alloc_dcache_block:
+ dcba r0, r3
+ addi r3, r3, L1_CACHE_BYTES
+ bdnz ..alloc_dcache_block
+ sync
+
+ /*
+ * Load the initial stack pointer and data area and convert the size,
+ * in bytes, to the number of words to initialize to a known value.
+ */
+ lis r1, CFG_INIT_RAM_ADDR@h
+ ori r1, r1, CFG_INIT_SP_OFFSET@l
+
+ lis r4, (CFG_INIT_RAM_END >> 2)@h
+ ori r4, r4, (CFG_INIT_RAM_END >> 2)@l
mtctr r4
- lis r2,CFG_INIT_RAM_ADDR@h /* we also clear data area */
- ori r2,r2,CFG_INIT_RAM_END@l /* so cant copy value from r1 */
+ lis r2, CFG_INIT_RAM_ADDR@h
+ ori r2, r2, CFG_INIT_RAM_END@l
- lis r4,0xdead /* we store 0xdeaddead in the stack */
- ori r4,r4,0xdead
+ lis r4, CFG_INIT_RAM_PATTERN@h
+ ori r4, r4, CFG_INIT_RAM_PATTERN@l
..stackloop:
- stwu r4,-4(r2)
+ stwu r4, -4(r2)
bdnz ..stackloop
- li r0, 0 /* Make room for stack frame header and */
- stwu r0, -4(r1) /* clear final stack frame so that */
- stwu r0, -4(r1) /* stack backtraces terminate cleanly */
+ /*
+ * Make room for stack frame header and clear final stack frame so
+ * that stack backtraces terminate cleanly.
+ */
+ stwu r0, -4(r1)
+ stwu r0, -4(r1)
+
/*
* Set up a dummy frame to store reset vector as return address.
* this causes stack underflow to reset board.
@@ -1328,33 +1454,72 @@ in32r:
* This "function" does not return, instead it continues in RAM
* after relocating the monitor code.
*
- * r3 = dest
- * r4 = src
- * r5 = length in bytes
- * r6 = cachelinesize
+ * r3 = Relocated stack pointer
+ * r4 = Relocated global data pointer
+ * r5 = Relocated text pointer
*/
.globl relocate_code
relocate_code:
-#ifdef CONFIG_4xx_DCACHE
+#if defined(CONFIG_4xx_DCACHE) || defined(CFG_INIT_DCACHE_CS)
/*
- * We need to flush the Init Data before the dcache will be
- * invalidated
+ * We need to flush the initial global data (gd_t) before the dcache
+ * will be invalidated.
*/
- /* save regs */
- mr r9,r3
- mr r10,r4
- mr r11,r5
+ /* Save registers */
+ mr r9, r3
+ mr r10, r4
+ mr r11, r5
- mr r3,r4
- addi r4,r4,0x200 /* should be enough for init data */
+ /* Flush initial global data range */
+ mr r3, r4
+ addi r4, r4, CFG_GBL_DATA_SIZE@l
bl flush_dcache_range
- /* restore regs */
- mr r3,r9
- mr r4,r10
- mr r5,r11
-#endif
+#if defined(CFG_INIT_DCACHE_CS)
+ /*
+ * Undo the earlier data cache set-up for the primordial stack and
+ * data area. First, invalidate the data cache and then disable data
+ * cacheability for that area. Finally, restore the EBC values, if
+ * any.
+ */
+
+ /* Invalidate the primordial stack and data area in cache */
+ lis r3, CFG_INIT_RAM_ADDR@h
+ ori r3, r3, CFG_INIT_RAM_ADDR@l
+
+ lis r4, CFG_INIT_RAM_END@h
+ ori r4, r4, CFG_INIT_RAM_END@l
+ add r4, r4, r3
+
+ bl invalidate_dcache_range
+
+ /* Disable cacheability for the region */
+ mfdccr r3
+ lis r4, ~PPC_128MB_SACR_VALUE(CFG_INIT_RAM_ADDR)@h
+ ori r4, r4, ~PPC_128MB_SACR_VALUE(CFG_INIT_RAM_ADDR)@l
+ and r3, r3, r4
+ mtdccr r3
+
+ /* Restore the EBC parameters */
+ li r3, PBxAP
+ mtdcr ebccfga, r3
+ lis r3, PBxAP_VAL@h
+ ori r3, r3, PBxAP_VAL@l
+ mtdcr ebccfgd, r3
+
+ li r3, PBxCR
+ mtdcr ebccfga, r3
+ lis r3, PBxCR_VAL@h
+ ori r3, r3, PBxCR_VAL@l
+ mtdcr ebccfgd, r3
+#endif /* defined(CFG_INIT_DCACHE_CS) */
+
+ /* Restore registers */
+ mr r3, r9
+ mr r4, r10
+ mr r5, r11
+#endif /* defined(CONFIG_4xx_DCACHE) || defined(CFG_INIT_DCACHE_CS) */
#ifdef CFG_INIT_RAM_DCACHE
/*
@@ -1396,13 +1561,13 @@ relocate_code:
addi r1,r0,CFG_TLB_FOR_BOOT_FLASH /* Use defined TLB */
#else
addi r1,r0,0x0000 /* Default TLB entry is #0 */
-#endif
+#endif /* CFG_TLB_FOR_BOOT_FLASH */
tlbre r0,r1,0x0002 /* Read contents */
ori r0,r0,0x0c00 /* Or in the inhibit, write through bit */
tlbwe r0,r1,0x0002 /* Save it out */
sync
isync
-#endif
+#endif /* defined(CONFIG_440EP) || ... || defined(CONFIG_460GT) */
mr r1, r3 /* Set new stack pointer */
mr r9, r4 /* Save copy of Init Data pointer */
mr r10, r5 /* Save copy of Destination Address */
@@ -1425,7 +1590,7 @@ relocate_code:
/* First our own GOT */
add r14, r14, r15
- /* the the one used by the C code */
+ /* then the one used by the C code */
add r30, r30, r15
/*
@@ -1867,7 +2032,7 @@ ppc405ep_init:
#if defined(CONFIG_ZEUS)
mfdcr r4, CPC0_BOOT
andi. r5, r4, CPC0_BOOT_SEP@l
- bne strap_1 /* serial eeprom present */
+ bne strap_1 /* serial eeprom present */
lis r3,0x0000
addi r3,r3,0x3030
lis r4,0x8042
diff --git a/cpu/ppc4xx/traps.c b/cpu/ppc4xx/traps.c
index 38b6f89..8b7e32a 100644
--- a/cpu/ppc4xx/traps.c
+++ b/cpu/ppc4xx/traps.c
@@ -170,7 +170,7 @@ MachineCheckException(struct pt_regs *regs)
val = get_esr();
-#if !defined(CONFIG_440)
+#if !defined(CONFIG_440) && !defined(CONFIG_405EX)
if (val& ESR_IMCP) {
printf("Instruction");
mtspr(ESR, val & ~ESR_IMCP);
@@ -179,7 +179,7 @@ MachineCheckException(struct pt_regs *regs)
}
printf(" machine check.\n");
-#elif defined(CONFIG_440)
+#elif defined(CONFIG_440) || defined(CONFIG_405EX)
if (val& ESR_IMCP){
printf("Instruction Synchronous Machine Check exception\n");
mtspr(SPRN_ESR, val & ~ESR_IMCP);
@@ -187,10 +187,15 @@ MachineCheckException(struct pt_regs *regs)
val = mfspr(MCSR);
if (val & MCSR_IB)
printf("Instruction Read PLB Error\n");
+#if defined(CONFIG_440)
if (val & MCSR_DRB)
printf("Data Read PLB Error\n");
if (val & MCSR_DWB)
printf("Data Write PLB Error\n");
+#else
+ if (val & MCSR_DB)
+ printf("Data PLB Error\n");
+#endif
if (val & MCSR_TLBP)
printf("TLB Parity Error\n");
if (val & MCSR_ICP){
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index 8bdfb9d..cfd8440 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -460,17 +460,19 @@
#define SPRN_PID2 0x27a /* Process ID Register 2 */
#define SPRN_MCSR 0x23c /* Machine Check Syndrome register */
#define SPRN_MCAR 0x23d /* Machine Check Address register */
-#ifdef CONFIG_440
#define MCSR_MCS 0x80000000 /* Machine Check Summary */
#define MCSR_IB 0x40000000 /* Instruction PLB Error */
+#if defined(CONFIG_440)
#define MCSR_DRB 0x20000000 /* Data Read PLB Error */
#define MCSR_DWB 0x10000000 /* Data Write PLB Error */
+#else
+#define MCSR_DB 0x20000000 /* Data PLB Error */
+#endif /* defined(CONFIG_440) */
#define MCSR_TLBP 0x08000000 /* TLB Parity Error */
#define MCSR_ICP 0x04000000 /* I-Cache Parity Error */
#define MCSR_DCSP 0x02000000 /* D-Cache Search Parity Error */
#define MCSR_DCFP 0x01000000 /* D-Cache Flush Parity Error */
#define MCSR_IMPE 0x00800000 /* Imprecise Machine Check Exception */
-#endif
#define ESR_ST 0x00800000 /* Store Operation */
#if defined(CONFIG_MPC86xx)
diff --git a/include/configs/kilauea.h b/include/configs/kilauea.h
index c7c42a4..953c87a 100644
--- a/include/configs/kilauea.h
+++ b/include/configs/kilauea.h
@@ -1,6 +1,9 @@
/*
- * (C) Copyright 2007
- * Stefan Roese, DENX Software Engineering, sr(a)denx.de.
+ * Copyright (c) 2008 Nuovation System Designs, LLC
+ * Grant Erickson <gerickson(a)nuovations.com>
+ *
+ * Copyright (c) 2007-2008 DENX Software Engineering, GmbH
+ * Stefan Roese <sr(a)denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -54,20 +57,56 @@
#define CFG_MONITOR_BASE (TEXT_BASE)
/*-----------------------------------------------------------------------
- * Initial RAM & stack pointer
- *----------------------------------------------------------------------*/
-#define CFG_INIT_RAM_ADDR 0x02000000 /* inside of SDRAM */
-#define CFG_INIT_RAM_END (4 << 10)
+ * Initial RAM & Stack Pointer Configuration Options
+ *
+ * There are traditionally three options for the primordial
+ * (i.e. initial) stack usage on the 405-series:
+ *
+ * 1) On-chip Memory (OCM) (i.e. SRAM)
+ * 2) Data cache
+ * 3) SDRAM
+ *
+ * For the 405EX(r), there is no OCM, so we are left with (2) or (3)
+ * the latter of which is less than desireable since it requires
+ * setting up the SDRAM and ECC in assembly code.
+ *
+ * To use (2), define 'CFG_INIT_DCACHE_CS' to be an unused chip
+ * select on the External Bus Controller (EBC) and then select a
+ * value for 'CFG_INIT_RAM_ADDR' outside of the range of valid,
+ * physical SDRAM. Otherwise, undefine 'CFG_INIT_DCACHE_CS' and
+ * select a value for 'CFG_INIT_RAM_ADDR' within the range of valid,
+ * physical SDRAM to use (3).
+ *-----------------------------------------------------------------------*/
+
+// #define CFG_INIT_DCACHE_CS 4
+
+#if defined(CFG_INIT_DCACHE_CS)
+#define CFG_INIT_RAM_ADDR (CFG_SDRAM_BASE + ( 1 << 30)) /* 1 GiB */
+#else
+#define CFG_INIT_RAM_ADDR (CFG_SDRAM_BASE + (32 << 20)) /* 32 MiB */
+#endif /* defined(CFG_INIT_DCACHE_CS) */
+
+#define CFG_INIT_RAM_END (4 << 10) /* 4 KiB */
#define CFG_GBL_DATA_SIZE 256 /* num bytes initial data */
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
-/* reserve some memory for POST and BOOT limit info */
-#define CFG_INIT_SP_OFFSET (CFG_GBL_DATA_OFFSET - 16)
-/* extra data in init-ram */
-#define CFG_POST_WORD_ADDR (CFG_GBL_DATA_OFFSET - 4)
-#define CFG_POST_MAGIC (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET - 8)
-#define CFG_POST_VAL (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET - 12)
-#define CFG_OCM_DATA_ADDR CFG_INIT_RAM_ADDR /* for commproc.c */
+/*
+ * If the data cache is being used for the primordial stack and global
+ * data area, the POST word must be placed somewhere else. The General
+ * Purpose Timer (GPT) is unused by u-boot and the kernel and preserves
+ * its compare and mask register contents across reset, so it is used
+ * for the POST word.
+ */
+
+#if defined(CFG_INIT_DCACHE_CS)
+# define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
+# define CFG_POST_ALT_WORD_ADDR (CFG_PERIPHERAL_BASE + GPT0_COMP6)
+#else
+# define CFG_INIT_EXTRA_SIZE 16
+# define CFG_INIT_SP_OFFSET (CFG_GBL_DATA_OFFSET - CFG_INIT_EXTRA_SIZE)
+# define CFG_POST_WORD_ADDR (CFG_GBL_DATA_OFFSET - 4)
+# define CFG_OCM_DATA_ADDR CFG_INIT_RAM_ADDR
+#endif /* defined(CFG_INIT_DCACHE_CS) */
/*-----------------------------------------------------------------------
* Serial Port
@@ -108,7 +147,7 @@
#define CFG_FLASH_EMPTY_INFO /* print 'E' for empty sector on flinfo */
#ifdef CFG_ENV_IS_IN_FLASH
-#define CFG_ENV_SECT_SIZE 0x20000 /* size of one complete sector */
+#define CFG_ENV_SECT_SIZE 0x20000 /* size of one complete sector */
#define CFG_ENV_ADDR (CFG_MONITOR_BASE-CFG_ENV_SECT_SIZE)
#define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
@@ -185,7 +224,51 @@
/*-----------------------------------------------------------------------
* DDR SDRAM
*----------------------------------------------------------------------*/
-#define CFG_MBYTES_SDRAM (256) /* 256MB */
+#define CFG_MBYTES_SDRAM 256
+
+#define CFG_SDRAM0_MB0CF_BASE (( 0 << 20) + CFG_SDRAM_BASE)
+
+/* DDR1/2 SDRAM Device Control Register Data Values */
+#define CFG_SDRAM0_MB0CF ((CFG_SDRAM0_MB0CF_BASE >> 3) | \
+ SDRAM_RXBAS_SDSZ_256MB | \
+ SDRAM_RXBAS_SDAM_MODE7 | \
+ SDRAM_RXBAS_SDBE_ENABLE)
+#define CFG_SDRAM0_MB1CF SDRAM_RXBAS_SDBE_DISABLE
+#define CFG_SDRAM0_MB2CF SDRAM_RXBAS_SDBE_DISABLE
+#define CFG_SDRAM0_MB3CF SDRAM_RXBAS_SDBE_DISABLE
+#define CFG_SDRAM0_MCOPT1 0x04322000
+#define CFG_SDRAM0_MCOPT2 0x00000000
+#define CFG_SDRAM0_MODT0 0x01800000
+#define CFG_SDRAM0_MODT1 0x00000000
+#define CFG_SDRAM0_CODT 0x0080f837
+#define CFG_SDRAM0_RTR 0x06180000
+#define CFG_SDRAM0_INITPLR0 0xa8380000
+#define CFG_SDRAM0_INITPLR1 0x81900400
+#define CFG_SDRAM0_INITPLR2 0x81020000
+#define CFG_SDRAM0_INITPLR3 0x81030000
+#define CFG_SDRAM0_INITPLR4 0x81010404
+#define CFG_SDRAM0_INITPLR5 0x81000542
+#define CFG_SDRAM0_INITPLR6 0x81900400
+#define CFG_SDRAM0_INITPLR7 0x8D080000
+#define CFG_SDRAM0_INITPLR8 0x8D080000
+#define CFG_SDRAM0_INITPLR9 0x8D080000
+#define CFG_SDRAM0_INITPLR10 0x8D080000
+#define CFG_SDRAM0_INITPLR11 0x81000442
+#define CFG_SDRAM0_INITPLR12 0x81010780
+#define CFG_SDRAM0_INITPLR13 0x81010400
+#define CFG_SDRAM0_INITPLR14 0x00000000
+#define CFG_SDRAM0_INITPLR15 0x00000000
+#define CFG_SDRAM0_RQDC 0x80000038
+#define CFG_SDRAM0_RFDC 0x00000209
+#define CFG_SDRAM0_RDCC 0x40000000
+#define CFG_SDRAM0_DLCR 0x030000a5
+#define CFG_SDRAM0_CLKTR 0x80000000
+#define CFG_SDRAM0_WRDTR 0x00000000
+#define CFG_SDRAM0_SDTR1 0x80201000
+#define CFG_SDRAM0_SDTR2 0x32204232
+#define CFG_SDRAM0_SDTR3 0x080b0d1a
+#define CFG_SDRAM0_MMODE 0x00000442
+#define CFG_SDRAM0_MEMODE 0x00000404
/*-----------------------------------------------------------------------
* I2C
@@ -319,8 +402,7 @@
#define CONFIG_CMD_SNTP
/* POST support */
-#define CONFIG_POST (CFG_POST_MEMORY | \
- CFG_POST_CACHE | \
+#define CONFIG_POST (CFG_POST_CACHE | \
CFG_POST_CPU | \
CFG_POST_ETHER | \
CFG_POST_I2C | \
diff --git a/include/configs/makalu.h b/include/configs/makalu.h
index 67243d4..3e61925 100644
--- a/include/configs/makalu.h
+++ b/include/configs/makalu.h
@@ -1,6 +1,9 @@
/*
- * (C) Copyright 2007-2008
- * Stefan Roese, DENX Software Engineering, sr(a)denx.de.
+ * Copyright (c) 2008 Nuovation System Designs, LLC
+ * Grant Erickson <gerickson(a)nuovations.com>
+ *
+ * Copyright (c) 2007-2008 DENX Software Engineering, GmbH
+ * Stefan Roese <sr(a)denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -52,20 +55,56 @@
#define CFG_MONITOR_BASE (TEXT_BASE)
/*-----------------------------------------------------------------------
- * Initial RAM & stack pointer
- *----------------------------------------------------------------------*/
-#define CFG_INIT_RAM_ADDR 0x02000000 /* inside of SDRAM */
-#define CFG_INIT_RAM_END (4 << 10)
+ * Initial RAM & Stack Pointer Configuration Options
+ *
+ * There are traditionally three options for the primordial
+ * (i.e. initial) stack usage on the 405-series:
+ *
+ * 1) On-chip Memory (OCM) (i.e. SRAM)
+ * 2) Data cache
+ * 3) SDRAM
+ *
+ * For the 405EX(r), there is no OCM, so we are left with (2) or (3)
+ * the latter of which is less than desireable since it requires
+ * setting up the SDRAM and ECC in assembly code.
+ *
+ * To use (2), define 'CFG_INIT_DCACHE_CS' to be an unused chip
+ * select on the External Bus Controller (EBC) and then select a
+ * value for 'CFG_INIT_RAM_ADDR' outside of the range of valid,
+ * physical SDRAM. Otherwise, undefine 'CFG_INIT_DCACHE_CS' and
+ * select a value for 'CFG_INIT_RAM_ADDR' within the range of valid,
+ * physical SDRAM to use (3).
+ *-----------------------------------------------------------------------*/
+
+#define CFG_INIT_DCACHE_CS 4
+
+#if defined(CFG_INIT_DCACHE_CS)
+#define CFG_INIT_RAM_ADDR (CFG_SDRAM_BASE + ( 1 << 30)) /* 1 GiB */
+#else
+#define CFG_INIT_RAM_ADDR (CFG_SDRAM_BASE + (32 << 20)) /* 32 MiB */
+#endif /* defined(CFG_INIT_DCACHE_CS) */
+
+#define CFG_INIT_RAM_END (4 << 10) /* 4 KiB */
#define CFG_GBL_DATA_SIZE 256 /* num bytes initial data */
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
-/* reserve some memory for POST and BOOT limit info */
-#define CFG_INIT_SP_OFFSET (CFG_GBL_DATA_OFFSET - 16)
-/* extra data in init-ram */
-#define CFG_POST_WORD_ADDR (CFG_GBL_DATA_OFFSET - 4)
-#define CFG_POST_MAGIC (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET - 8)
-#define CFG_POST_VAL (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET - 12)
-#define CFG_OCM_DATA_ADDR CFG_INIT_RAM_ADDR /* for commproc.c */
+/*
+ * If the data cache is being used for the primordial stack and global
+ * data area, the POST word must be placed somewhere else. The General
+ * Purpose Timer (GPT) is unused by u-boot and the kernel and preserves
+ * its compare and mask register contents across reset, so it is used
+ * for the POST word.
+ */
+
+#if defined(CFG_INIT_DCACHE_CS)
+# define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
+# define CFG_POST_ALT_WORD_ADDR (CFG_PERIPHERAL_BASE + GPT0_COMP6)
+#else
+# define CFG_INIT_EXTRA_SIZE 16
+# define CFG_INIT_SP_OFFSET (CFG_GBL_DATA_OFFSET - CFG_INIT_EXTRA_SIZE)
+# define CFG_POST_WORD_ADDR (CFG_GBL_DATA_OFFSET - 4)
+# define CFG_OCM_DATA_ADDR CFG_INIT_RAM_ADDR
+#endif /* defined(CFG_INIT_DCACHE_CS) */
/*-----------------------------------------------------------------------
* Serial Port
@@ -115,6 +154,54 @@
*----------------------------------------------------------------------*/
#define CFG_MBYTES_SDRAM 256
+#define CFG_SDRAM0_MB0CF_BASE (( 0 << 20) + CFG_SDRAM_BASE)
+#define CFG_SDRAM0_MB1CF_BASE ((128 << 20) + CFG_SDRAM_BASE)
+
+/* DDR1/2 SDRAM Device Control Register Data Values */
+#define CFG_SDRAM0_MB0CF ((CFG_SDRAM0_MB0CF_BASE >> 3) | \
+ SDRAM_RXBAS_SDSZ_128MB | \
+ SDRAM_RXBAS_SDAM_MODE2 | \
+ SDRAM_RXBAS_SDBE_ENABLE)
+#define CFG_SDRAM0_MB1CF ((CFG_SDRAM0_MB1CF_BASE >> 3) | \
+ SDRAM_RXBAS_SDSZ_128MB | \
+ SDRAM_RXBAS_SDAM_MODE2 | \
+ SDRAM_RXBAS_SDBE_ENABLE)
+#define CFG_SDRAM0_MB2CF SDRAM_RXBAS_SDBE_DISABLE
+#define CFG_SDRAM0_MB3CF SDRAM_RXBAS_SDBE_DISABLE
+#define CFG_SDRAM0_MCOPT1 0x04322000
+#define CFG_SDRAM0_MCOPT2 0x00000000
+#define CFG_SDRAM0_MODT0 0x01800000
+#define CFG_SDRAM0_MODT1 0x00000000
+#define CFG_SDRAM0_CODT 0x0080f837
+#define CFG_SDRAM0_RTR 0x06180000
+#define CFG_SDRAM0_INITPLR0 0xa8380000
+#define CFG_SDRAM0_INITPLR1 0x81900400
+#define CFG_SDRAM0_INITPLR2 0x81020000
+#define CFG_SDRAM0_INITPLR3 0x81030000
+#define CFG_SDRAM0_INITPLR4 0x81010404
+#define CFG_SDRAM0_INITPLR5 0x81000542
+#define CFG_SDRAM0_INITPLR6 0x81900400
+#define CFG_SDRAM0_INITPLR7 0x8D080000
+#define CFG_SDRAM0_INITPLR8 0x8D080000
+#define CFG_SDRAM0_INITPLR9 0x8D080000
+#define CFG_SDRAM0_INITPLR10 0x8D080000
+#define CFG_SDRAM0_INITPLR11 0x81000442
+#define CFG_SDRAM0_INITPLR12 0x81010780
+#define CFG_SDRAM0_INITPLR13 0x81010400
+#define CFG_SDRAM0_INITPLR14 0x00000000
+#define CFG_SDRAM0_INITPLR15 0x00000000
+#define CFG_SDRAM0_RQDC 0x80000038
+#define CFG_SDRAM0_RFDC 0x00000209
+#define CFG_SDRAM0_RDCC 0x40000000
+#define CFG_SDRAM0_DLCR 0x030000a5
+#define CFG_SDRAM0_CLKTR 0x80000000
+#define CFG_SDRAM0_WRDTR 0x00000000
+#define CFG_SDRAM0_SDTR1 0x80201000
+#define CFG_SDRAM0_SDTR2 0x32204232
+#define CFG_SDRAM0_SDTR3 0x080b0d1a
+#define CFG_SDRAM0_MMODE 0x00000442
+#define CFG_SDRAM0_MEMODE 0x00000404
+
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
@@ -244,8 +331,7 @@
#define CONFIG_CMD_SNTP
/* POST support */
-#define CONFIG_POST (CFG_POST_MEMORY | \
- CFG_POST_CACHE | \
+#define CONFIG_POST (CFG_POST_CACHE | \
CFG_POST_CPU | \
CFG_POST_ETHER | \
CFG_POST_I2C | \
diff --git a/include/ppc405.h b/include/ppc405.h
index 37b121c..45eeddf 100644
--- a/include/ppc405.h
+++ b/include/ppc405.h
@@ -22,6 +22,10 @@
#ifndef __PPC405_H__
#define __PPC405_H__
+/* Define bits and masks for real-mode storage attribute control registers */
+#define PPC_128MB_SACR_BIT(addr) ((addr) >> 27)
+#define PPC_128MB_SACR_VALUE(addr) PPC_REG_VAL(PPC_128MB_SACR_BIT(addr),1)
+
#ifndef CONFIG_IOP480
#define CFG_DCACHE_SIZE (16 << 10) /* For AMCC 405 CPUs */
#else
@@ -363,6 +367,120 @@
#endif /* defined(CONFIG_405EZ) */
/******************************************************************************
+ * External Bus Controller (EBC)
+ *****************************************************************************/
+
+/* Bank Configuration Register */
+#define EBC_BXCR_BAS_MASK PPC_REG_VAL(11, 0xFFF)
+#define EBC_BXCR_BAS_ENCODE(n) (((static_cast(unsigned long, n)) & \
+ EBC_BXCR_BAS_MASK) << 0)
+#define EBC_BXCR_BS_MASK PPC_REG_VAL(14, 0x7)
+#define EBC_BXCR_BS_1MB PPC_REG_VAL(14, 0x0)
+#define EBC_BXCR_BS_2MB PPC_REG_VAL(14, 0x1)
+#define EBC_BXCR_BS_4MB PPC_REG_VAL(14, 0x2)
+#define EBC_BXCR_BS_8MB PPC_REG_VAL(14, 0x3)
+#define EBC_BXCR_BS_16MB PPC_REG_VAL(14, 0x4)
+#define EBC_BXCR_BS_32MB PPC_REG_VAL(14, 0x5)
+#define EBC_BXCR_BS_64MB PPC_REG_VAL(14, 0x6)
+#define EBC_BXCR_BS_128MB PPC_REG_VAL(14, 0x7)
+#define EBC_BXCR_BU_MASK PPC_REG_VAL(16, 0x3)
+#define EBC_BXCR_BU_NONE PPC_REG_VAL(16, 0x0)
+#define EBC_BXCR_BU_R PPC_REG_VAL(16, 0x1)
+#define EBC_BXCR_BU_W PPC_REG_VAL(16, 0x2)
+#define EBC_BXCR_BU_RW PPC_REG_VAL(16, 0x3)
+#define EBC_BXCR_BW_MASK PPC_REG_VAL(18, 0x3)
+#define EBC_BXCR_BW_8BIT PPC_REG_VAL(18, 0x0)
+#define EBC_BXCR_BW_16BIT PPC_REG_VAL(18, 0x1)
+#define EBC_BXCR_BW_32BIT PPC_REG_VAL(18, 0x3)
+
+/* Bank Access Parameter Register */
+#define EBC_BXAP_BME_ENABLED PPC_REG_VAL(0, 0x1)
+#define EBC_BXAP_BME_DISABLED PPC_REG_VAL(0, 0x0)
+#define EBC_BXAP_TWT_ENCODE(n) PPC_REG_VAL(8, \
+ (static_cast(unsigned long, n)) \
+ & 0xFF)
+#define EBC_BXAP_FWT_ENCODE(n) PPC_REG_VAL(5, \
+ (static_cast(unsigned long, n)) \
+ & 0x1F)
+#define EBC_BXAP_BWT_ENCODE(n) PPC_REG_VAL(8, \
+ (static_cast(unsigned long, n)) \
+ & 0x7)
+#define EBC_BXAP_BCE_DISABLE PPC_REG_VAL(9, 0x0)
+#define EBC_BXAP_BCE_ENABLE PPC_REG_VAL(9, 0x1)
+#define EBC_BXAP_BCT_MASK PPC_REG_VAL(11, 0x3)
+#define EBC_BXAP_BCT_2TRANS PPC_REG_VAL(11, 0x0)
+#define EBC_BXAP_BCT_4TRANS PPC_REG_VAL(11, 0x1)
+#define EBC_BXAP_BCT_8TRANS PPC_REG_VAL(11, 0x2)
+#define EBC_BXAP_BCT_16TRANS PPC_REG_VAL(11, 0x3)
+#define EBC_BXAP_CSN_ENCODE(n) PPC_REG_VAL(13, \
+ (static_cast(unsigned long, n)) \
+ & 0x3)
+#define EBC_BXAP_OEN_ENCODE(n) PPC_REG_VAL(15, \
+ (static_cast(unsigned long, n)) \
+ & 0x3)
+#define EBC_BXAP_WBN_ENCODE(n) PPC_REG_VAL(17, \
+ (static_cast(unsigned long, n)) \
+ & 0x3)
+#define EBC_BXAP_WBF_ENCODE(n) PPC_REG_VAL(19, \
+ (static_cast(unsigned long, n)) \
+ & 0x3)
+#define EBC_BXAP_TH_ENCODE(n) PPC_REG_VAL(22, \
+ (static_cast(unsigned long, n)) \
+ & 0x7)
+#define EBC_BXAP_RE_ENABLED PPC_REG_VAL(23, 0x1)
+#define EBC_BXAP_RE_DISABLED PPC_REG_VAL(23, 0x0)
+#define EBC_BXAP_SOR_DELAYED PPC_REG_VAL(24, 0x0)
+#define EBC_BXAP_SOR_NONDELAYED PPC_REG_VAL(24, 0x1)
+#define EBC_BXAP_BEM_WRITEONLY PPC_REG_VAL(25, 0x0)
+#define EBC_BXAP_BEM_RW PPC_REG_VAL(25, 0x1)
+#define EBC_BXAP_PEN_DISABLED PPC_REG_VAL(26, 0x0)
+#define EBC_BXAP_PEN_ENABLED PPC_REG_VAL(26, 0x1)
+
+/* Configuration Register */
+#define EBC_CFG_LE_MASK PPC_REG_VAL(0, 0x1)
+#define EBC_CFG_LE_UNLOCK PPC_REG_VAL(0, 0x0)
+#define EBC_CFG_LE_LOCK PPC_REG_VAL(0, 0x1)
+#define EBC_CFG_PTD_MASK PPC_REG_VAL(1, 0x1)
+#define EBC_CFG_PTD_ENABLE PPC_REG_VAL(1, 0x0)
+#define EBC_CFG_PTD_DISABLE PPC_REG_VAL(1, 0x1)
+#define EBC_CFG_RTC_MASK PPC_REG_VAL(4, 0x7)
+#define EBC_CFG_RTC_16PERCLK PPC_REG_VAL(4, 0x0)
+#define EBC_CFG_RTC_32PERCLK PPC_REG_VAL(4, 0x1)
+#define EBC_CFG_RTC_64PERCLK PPC_REG_VAL(4, 0x2)
+#define EBC_CFG_RTC_128PERCLK PPC_REG_VAL(4, 0x3)
+#define EBC_CFG_RTC_256PERCLK PPC_REG_VAL(4, 0x4)
+#define EBC_CFG_RTC_512PERCLK PPC_REG_VAL(4, 0x5)
+#define EBC_CFG_RTC_1024PERCLK PPC_REG_VAL(4, 0x6)
+#define EBC_CFG_RTC_2048PERCLK PPC_REG_VAL(4, 0x7)
+#define EBC_CFG_ATC_MASK PPC_REG_VAL(5, 0x1)
+#define EBC_CFG_ATC_HI PPC_REG_VAL(5, 0x0)
+#define EBC_CFG_ATC_PREVIOUS PPC_REG_VAL(5, 0x1)
+#define EBC_CFG_DTC_MASK PPC_REG_VAL(6, 0x1)
+#define EBC_CFG_DTC_HI PPC_REG_VAL(6, 0x0)
+#define EBC_CFG_DTC_PREVIOUS PPC_REG_VAL(6, 0x1)
+#define EBC_CFG_CTC_MASK PPC_REG_VAL(7, 0x1)
+#define EBC_CFG_CTC_HI PPC_REG_VAL(7, 0x0)
+#define EBC_CFG_CTC_PREVIOUS PPC_REG_VAL(7, 0x1)
+#define EBC_CFG_OEO_MASK PPC_REG_VAL(8, 0x1)
+#define EBC_CFG_OEO_DISABLE PPC_REG_VAL(8, 0x0)
+#define EBC_CFG_OEO_ENABLE PPC_REG_VAL(8, 0x1)
+#define EBC_CFG_EMC_MASK PPC_REG_VAL(9, 0x1)
+#define EBC_CFG_EMC_NONDEFAULT PPC_REG_VAL(9, 0x0)
+#define EBC_CFG_EMC_DEFAULT PPC_REG_VAL(9, 0x1)
+#define EBC_CFG_PME_MASK PPC_REG_VAL(14, 0x1)
+#define EBC_CFG_PME_DISABLE PPC_REG_VAL(14, 0x0)
+#define EBC_CFG_PME_ENABLE PPC_REG_VAL(14, 0x1)
+#define EBC_CFG_PMT_MASK PPC_REG_VAL(19, 0x1F)
+#define EBC_CFG_PMT_ENCODE(n) PPC_REG_VAL(19, \
+ (static_cast(unsigned long, n)) \
+ & 0x1F)
+#define EBC_CFG_PR_MASK PPC_REG_VAL(21, 0x3)
+#define EBC_CFG_PR_16 PPC_REG_VAL(21, 0x0)
+#define EBC_CFG_PR_32 PPC_REG_VAL(21, 0x1)
+#define EBC_CFG_PR_64 PPC_REG_VAL(21, 0x2)
+#define EBC_CFG_PR_128 PPC_REG_VAL(21, 0x3)
+
+/******************************************************************************
* SDRAM Controller
******************************************************************************/
/* values for memcfga register - indirect addressing of these regs */
@@ -1216,21 +1334,45 @@
#define SDRAM_ECCCR 0x98 /* ECC error status */
#define SDRAM_RID 0xF8 /* revision ID */
-/*-----------------------------------------------------------------------------+
+/*----------------------------------------------------------------------------+
| Memory Bank 0-7 configuration
-+-----------------------------------------------------------------------------*/
-#define SDRAM_RXBAS_SDSZ_4 0x00000000 /* 4M */
-#define SDRAM_RXBAS_SDSZ_8 0x00001000 /* 8M */
-#define SDRAM_RXBAS_SDSZ_16 0x00002000 /* 16M */
-#define SDRAM_RXBAS_SDSZ_32 0x00003000 /* 32M */
-#define SDRAM_RXBAS_SDSZ_64 0x00004000 /* 64M */
-#define SDRAM_RXBAS_SDSZ_128 0x00005000 /* 128M */
-#define SDRAM_RXBAS_SDSZ_256 0x00006000 /* 256M */
-#define SDRAM_RXBAS_SDSZ_512 0x00007000 /* 512M */
-#define SDRAM_RXBAS_SDSZ_1024 0x00008000 /* 1024M */
-#define SDRAM_RXBAS_SDSZ_2048 0x00009000 /* 2048M */
-#define SDRAM_RXBAS_SDSZ_4096 0x0000a000 /* 4096M */
-#define SDRAM_RXBAS_SDSZ_8192 0x0000b000 /* 8192M */
++----------------------------------------------------------------------------*/
+#define SDRAM_RXBAS_SDSZ_MASK PPC_REG_VAL(19, 0xF)
+#define SDRAM_RXBAS_SDSZ_4MB PPC_REG_VAL(19, 0x0)
+#define SDRAM_RXBAS_SDSZ_8MB PPC_REG_VAL(19, 0x1)
+#define SDRAM_RXBAS_SDSZ_16MB PPC_REG_VAL(19, 0x2)
+#define SDRAM_RXBAS_SDSZ_32MB PPC_REG_VAL(19, 0x3)
+#define SDRAM_RXBAS_SDSZ_64MB PPC_REG_VAL(19, 0x4)
+#define SDRAM_RXBAS_SDSZ_128MB PPC_REG_VAL(19, 0x5)
+#define SDRAM_RXBAS_SDSZ_256MB PPC_REG_VAL(19, 0x6)
+#define SDRAM_RXBAS_SDSZ_512MB PPC_REG_VAL(19, 0x7)
+#define SDRAM_RXBAS_SDSZ_1024MB PPC_REG_VAL(19, 0x8)
+#define SDRAM_RXBAS_SDSZ_2048MB PPC_REG_VAL(19, 0x9)
+#define SDRAM_RXBAS_SDSZ_4096MB PPC_REG_VAL(19, 0xA)
+#define SDRAM_RXBAS_SDSZ_8192MB PPC_REG_VAL(19, 0xB)
+#define SDRAM_RXBAS_SDSZ_8 SDRAM_RXBAS_SDSZ_8MB
+#define SDRAM_RXBAS_SDSZ_16 SDRAM_RXBAS_SDSZ_16MB
+#define SDRAM_RXBAS_SDSZ_32 SDRAM_RXBAS_SDSZ_32MB
+#define SDRAM_RXBAS_SDSZ_64 SDRAM_RXBAS_SDSZ_64MB
+#define SDRAM_RXBAS_SDSZ_128 SDRAM_RXBAS_SDSZ_128MB
+#define SDRAM_RXBAS_SDSZ_256 SDRAM_RXBAS_SDSZ_256MB
+#define SDRAM_RXBAS_SDSZ_512 SDRAM_RXBAS_SDSZ_512MB
+#define SDRAM_RXBAS_SDSZ_1024 SDRAM_RXBAS_SDSZ_1024MB
+#define SDRAM_RXBAS_SDSZ_2048 SDRAM_RXBAS_SDSZ_2048MB
+#define SDRAM_RXBAS_SDSZ_4096 SDRAM_RXBAS_SDSZ_4096MB
+#define SDRAM_RXBAS_SDSZ_8192 SDRAM_RXBAS_SDSZ_8192MB
+#define SDRAM_RXBAS_SDAM_MODE0 PPC_REG_VAL(23, 0x0)
+#define SDRAM_RXBAS_SDAM_MODE1 PPC_REG_VAL(23, 0x1)
+#define SDRAM_RXBAS_SDAM_MODE2 PPC_REG_VAL(23, 0x2)
+#define SDRAM_RXBAS_SDAM_MODE3 PPC_REG_VAL(23, 0x3)
+#define SDRAM_RXBAS_SDAM_MODE4 PPC_REG_VAL(23, 0x4)
+#define SDRAM_RXBAS_SDAM_MODE5 PPC_REG_VAL(23, 0x5)
+#define SDRAM_RXBAS_SDAM_MODE6 PPC_REG_VAL(23, 0x6)
+#define SDRAM_RXBAS_SDAM_MODE7 PPC_REG_VAL(23, 0x7)
+#define SDRAM_RXBAS_SDAM_MODE8 PPC_REG_VAL(23, 0x8)
+#define SDRAM_RXBAS_SDAM_MODE9 PPC_REG_VAL(23, 0x9)
+#define SDRAM_RXBAS_SDBE_DISABLE PPC_REG_VAL(31, 0x0)
+#define SDRAM_RXBAS_SDBE_ENABLE PPC_REG_VAL(31, 0x1)
/*-----------------------------------------------------------------------------+
| Memory Controller Status
@@ -1612,4 +1754,27 @@
#define SDR0_PFC1_GPT_FREQ 0x0000000f
#endif
+/* General Purpose Timer (GPT) Register Offsets */
+#define GPT0_TBC 0x00000000
+#define GPT0_IM 0x00000018
+#define GPT0_ISS 0x0000001C
+#define GPT0_ISC 0x00000020
+#define GPT0_IE 0x00000024
+#define GPT0_COMP0 0x00000080
+#define GPT0_COMP1 0x00000084
+#define GPT0_COMP2 0x00000088
+#define GPT0_COMP3 0x0000008C
+#define GPT0_COMP4 0x00000090
+#define GPT0_COMP5 0x00000094
+#define GPT0_COMP6 0x00000098
+#define GPT0_MASK0 0x000000C0
+#define GPT0_MASK1 0x000000C4
+#define GPT0_MASK2 0x000000C8
+#define GPT0_MASK3 0x000000CC
+#define GPT0_MASK4 0x000000D0
+#define GPT0_MASK5 0x000000D4
+#define GPT0_MASK6 0x000000D8
+#define GPT0_DCT0 0x00000110
+#define GPT0_DCIS 0x0000011C
+
#endif /* __PPC405_H__ */
diff --git a/include/ppc4xx.h b/include/ppc4xx.h
index 76fe872..4a6eb86 100644
--- a/include/ppc4xx.h
+++ b/include/ppc4xx.h
@@ -29,6 +29,21 @@
#endif
/*
+ * Macro for generating register field mnemonics
+ */
+#define PPC_REG_BITS 32
+#define PPC_REG_VAL(bit, value) ((value) << ((PPC_REG_BITS - 1) - (bit)))
+
+/*
+ * Elide casts when assembling register mnemonics
+ */
+#ifndef __ASSEMBLY__
+#define static_cast(type, val) (type)(val)
+#else
+#define static_cast(type, val) (val)
+#endif
+
+/*
* Common stuff for 4xx (405 and 440)
*/
2
3

21 May '08
Sorry, I forgot this line:
Signed-off-by: Christian Eggers <ceggers(a)gmx.de>
Dear Markus,
I've made I new patch with git as requested.
regards
Christian
> Dear Christian,
>
> "Christian Eggers" <ceggers(a)gmx.de> writes:
>
> > I've recognized that a lot of USB code in U-Boot uses the macros
> > swap_16() and swap_32() which are defined in usb.h. The behaviour
> > of the macros is controlled by the define LITTLEENDIAN.
> >
> > Is there a good reason NOT to use the macros provided in
> > asm/byteorder.h (as in the appropriate code in Linux-2.4 )?
>
> Largely not. But be carefull. Besides big and little endian CPUs we also
> have controllers that operate in big or little endian (see
> CFG_OHCI_BE_CONTROLLER), and then there are PCI controllers whose
> registers need to be accessed as little endian
> (CFG_OHCI_SWAP_REG_ACCESS).
>
> But your right, there is no real for LITTLEENDIAN.
>
> > I think that switching to these functions might be useful in order
> > to eliminate the need to use the LITTLEENDIAN define for
> > specifying the byteorder. It seems that LITTLEENDIAN is not
> > used outside the USB code.
>
> Right. Patches cleaning this up are more than welcome! Please note that
> cleaning up USB drivers under the cpu/ directory is a waste of time
> though. Boards using these drivers should be converted to use the
> generic infrastructure in drivers/usb/ instead.
>
> Best regards
>
> Markus Klotzbuecher
---
common/usb.c | 44 ++++++++++++++++++++++----------------------
common/usb_kbd.c | 11 ++++++-----
common/usb_storage.c | 28 ++++++++++------------------
3 files changed, 38 insertions(+), 45 deletions(-)
diff --git a/common/usb.c b/common/usb.c
index 2fa5254..7033c2a 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -48,6 +48,7 @@
#include <command.h>
#include <asm/processor.h>
#include <linux/ctype.h>
+#include <asm/byteorder.h>
#if defined(CONFIG_CMD_USB)
@@ -177,10 +178,10 @@ int usb_control_msg(struct usb_device *d
/* set setup command */
setup_packet.requesttype = requesttype;
setup_packet.request = request;
- setup_packet.value = swap_16(value);
- setup_packet.index = swap_16(index);
- setup_packet.length = swap_16(size);
- USB_PRINTF("usb_control_msg: request: 0x%X, requesttype: 0x%X\nvalue
0x%X index 0x%X length 0x%X\n",
+ setup_packet.value = cpu_to_le16(value);
+ setup_packet.index = cpu_to_le16(index);
+ setup_packet.length = cpu_to_le16(size);
+ USB_PRINTF("usb_control_msg: request: 0x%X, requesttype: 0x%X, value
0x%X index 0x%X length 0x%X\n",
request,requesttype,value,index,size);
dev->status=USB_ST_NOT_PROC; /*not yet processed */
@@ -300,7 +301,7 @@ int usb_parse_config(struct usb_device *
return -1;
}
memcpy(&dev->config, buffer, buffer[0]);
- dev->config.wTotalLength = swap_16(dev->config.wTotalLength);
+ le16_to_cpus(&(dev->config.wTotalLength));
dev->config.no_of_if = 0;
index = dev->config.bLength;
@@ -329,8 +330,7 @@ int usb_parse_config(struct usb_device *
dev->config.if_desc[ifno].no_of_ep++; /* found an
endpoint */
memcpy(&dev->config.if_desc[ifno].ep_desc[epno],
&buffer[index], buffer[index]);
- dev-
>config.if_desc[ifno].ep_desc[epno].wMaxPacketSize =
- swap_16(dev-
>config.if_desc[ifno].ep_desc[epno].wMaxPacketSize);
+ le16_to_cpus(&(dev-
>config.if_desc[ifno].ep_desc[epno].wMaxPacketSize));
USB_PRINTF("if %d, ep %d\n", ifno, epno);
break;
default:
@@ -413,7 +413,7 @@ int usb_get_configuration_no(struct usb_
printf("config descriptor too short (expected %i, got
%i)\n",8,result);
return -1;
}
- tmp=swap_16(config->wTotalLength);
+ tmp = le16_to_cpu(config->wTotalLength);
if (tmp > USB_BUFSIZ) {
USB_PRINTF("usb_get_configuration_no: failed to get descriptor - too
long: %d\n",
@@ -816,10 +816,10 @@ int usb_new_device(struct usb_device *de
return 1;
}
/* correct le values */
- dev->descriptor.bcdUSB=swap_16(dev->descriptor.bcdUSB);
- dev->descriptor.idVendor=swap_16(dev->descriptor.idVendor);
- dev->descriptor.idProduct=swap_16(dev->descriptor.idProduct);
- dev->descriptor.bcdDevice=swap_16(dev->descriptor.bcdDevice);
+ le16_to_cpus(&dev->descriptor.bcdUSB);
+ le16_to_cpus(&dev->descriptor.idVendor);
+ le16_to_cpus(&dev->descriptor.idProduct);
+ le16_to_cpus(&dev->descriptor.bcdDevice);
/* only support for one config for now */
usb_get_configuration_no(dev,&tmpbuf[0],0);
usb_parse_config(dev,&tmpbuf[0],0);
@@ -979,8 +979,8 @@ static int hub_port_reset(struct usb_dev
USB_HUB_PRINTF("get_port_status failed status %lX\n",dev-
>status);
return -1;
}
- portstatus = swap_16(portsts.wPortStatus);
- portchange = swap_16(portsts.wPortChange);
+ portstatus = le16_to_cpu(portsts.wPortStatus);
+ portchange = le16_to_cpu(portsts.wPortChange);
USB_HUB_PRINTF("portstatus %x, change %x, %s\n", portstatus
,portchange,
portstatus&(1<<USB_PORT_FEAT_LOWSPEED) ? "Low
Speed" : "High Speed");
USB_HUB_PRINTF("STAT_C_CONNECTION = %d
STAT_CONNECTION = %d USB_PORT_STAT_ENABLE %d\n",
@@ -1024,8 +1024,8 @@ void usb_hub_port_connect_change(struct
return;
}
- portstatus = swap_16(portsts.wPortStatus);
- portchange = swap_16(portsts.wPortChange);
+ portstatus = le16_to_cpu(portsts.wPortStatus);
+ portchange = le16_to_cpu(portsts.wPortChange);
USB_HUB_PRINTF("portstatus %x, change %x, %s\n", portstatus, portchange,
portstatus&(1<<USB_PORT_FEAT_LOWSPEED) ? "Low Speed" : "High
Speed");
@@ -1099,7 +1099,7 @@ int usb_hub_configure(struct usb_device
}
memcpy((unsigned char *)&hub->desc,buffer,descriptor->bLength);
/* adjust 16bit values */
- hub->desc.wHubCharacteristics=swap_16(descriptor->wHubCharacteristics);
+ hub->desc.wHubCharacteristics = le16_to_cpu(descriptor->wHubCharacteristics);
/* set the bitmap */
bitmap=(unsigned char *)&hub->desc.DeviceRemovable[0];
memset(bitmap,0xff,(USB_MAXCHILDREN+1+7)/8); /* devices not removable by
default */
@@ -1161,11 +1161,11 @@ int usb_hub_configure(struct usb_device
}
hubsts = (struct usb_hub_status *)buffer;
USB_HUB_PRINTF("get_hub_status returned status %X, change %X\n",
- swap_16(hubsts->wHubStatus),swap_16(hubsts->wHubChange));
+ le16_to_cpu(hubsts->wHubStatus),le16_to_cpu(hubsts->wHubChange));
USB_HUB_PRINTF("local power source is %s\n",
- (swap_16(hubsts->wHubStatus) & HUB_STATUS_LOCAL_POWER) ?
"lost (inactive)" : "good");
+ (le16_to_cpu(hubsts->wHubStatus) & HUB_STATUS_LOCAL_POWER)
? "lost (inactive)" : "good");
USB_HUB_PRINTF("%sover-current condition exists\n",
- (swap_16(hubsts->wHubStatus) & HUB_STATUS_OVERCURRENT) ? ""
: "no ");
+ (le16_to_cpu(hubsts->wHubStatus) & HUB_STATUS_OVERCURRENT)
? "" : "no ");
usb_hub_power_on(hub);
for (i = 0; i < dev->maxchild; i++) {
struct usb_port_status portsts;
@@ -1175,8 +1175,8 @@ int usb_hub_configure(struct usb_device
USB_HUB_PRINTF("get_port_status failed\n");
continue;
}
- portstatus = swap_16(portsts.wPortStatus);
- portchange = swap_16(portsts.wPortChange);
+ portstatus = le16_to_cpu(portsts.wPortStatus);
+ portchange = le16_to_cpu(portsts.wPortChange);
USB_HUB_PRINTF("Port %d Status %X Change
%X\n",i+1,portstatus,portchange);
if (portchange & USB_PORT_STAT_C_CONNECTION) {
USB_HUB_PRINTF("port %d connection change\n", i + 1);
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 1703b23..f54c527 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -26,6 +26,7 @@
*/
#include <common.h>
#include <devices.h>
+#include <asm/byteorder.h>
#ifdef CONFIG_USB_KEYBOARD
@@ -475,14 +476,14 @@ static int fetch_item(unsigned char *sta
break;
case 2:
if ((end - start) >= 2) {
- item->data.u16 = swap_16((unsigned
short *)start);
+ item->data.u16 = le16_to_cpu((unsigned
short *)start);
start+=2;
return item->size;
}
case 3:
item->size++;
if ((end - start) >= 4) {
- item->data.u32 = swap_32((unsigned
long *)start);
+ item->data.u32 = le32_to_cpu((unsigned
long *)start);
start+=4;
return item->size;
}
@@ -705,15 +706,15 @@ static int usb_kbd_get_hid_desc(struct u
}
index=head->bLength;
config=(struct usb_config_descriptor *)&buffer[0];
- len=swap_16(config->wTotalLength);
+ len=le16_to_cpu(config->wTotalLength);
/* Ok the first entry must be a configuration entry, now process the others */
head=(struct usb_descriptor_header *)&buffer[index];
while(index+1 < len) {
if(head->bDescriptorType==USB_DT_HID) {
printf("HID desc found\n");
memcpy(&usb_kbd_hid_desc,&buffer[index],buffer[index]);
-
usb_kbd_hid_desc.bcdHID=swap_16(usb_kbd_hid_desc.bcdHID);
-
usb_kbd_hid_desc.wDescriptorLength=swap_16(usb_kbd_hid_desc.wDescriptorLength);
+ le16_to_cpus(&usb_kbd_hid_desc.bcdHID);
+ le16_to_cpus(&usb_kbd_hid_desc.wDescriptorLength);
usb_kbd_display_hid(&usb_kbd_hid_desc);
len=0;
break;
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 7c08f95..2ca4721 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -52,6 +52,7 @@
#include <common.h>
#include <command.h>
+#include <asm/byteorder.h>
#include <asm/processor.h>
@@ -474,9 +475,9 @@ int usb_stor_BBB_comdat(ccb *srb, struct
/* always OUT to the ep */
pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
- cbw.dCBWSignature = swap_32(CBWSIGNATURE);
- cbw.dCBWTag = swap_32(CBWTag++);
- cbw.dCBWDataTransferLength = swap_32(srb->datalen);
+ cbw.dCBWSignature = cpu_to_le32(CBWSIGNATURE);
+ cbw.dCBWTag = cpu_to_le32(CBWTag++);
+ cbw.dCBWDataTransferLength = cpu_to_le32(srb->datalen);
cbw.bCBWFlags = (dir_in? CBWFLAGS_IN : CBWFLAGS_OUT);
cbw.bCBWLUN = srb->lun;
cbw.bCDBLength = srb->cmdlen;
@@ -692,14 +693,14 @@ int usb_stor_BBB_transport(ccb *srb, str
printf("\n");
#endif
/* misuse pipe to get the residue */
- pipe = swap_32(csw.dCSWDataResidue);
+ pipe = le32_to_cpu(csw.dCSWDataResidue);
if (pipe == 0 && srb->datalen != 0 && srb->datalen - data_actlen != 0)
pipe = srb->datalen - data_actlen;
- if (CSWSIGNATURE != swap_32(csw.dCSWSignature)) {
+ if (CSWSIGNATURE != le32_to_cpu(csw.dCSWSignature)) {
USB_STOR_PRINTF("!CSWSIGNATURE\n");
usb_stor_BBB_reset(us);
return USB_STOR_TRANSPORT_FAILED;
- } else if ((CBWTag - 1) != swap_32(csw.dCSWTag)) {
+ } else if ((CBWTag - 1) != le32_to_cpu(csw.dCSWTag)) {
USB_STOR_PRINTF("!Tag\n");
usb_stor_BBB_reset(us);
return USB_STOR_TRANSPORT_FAILED;
@@ -1222,18 +1223,9 @@ int usb_stor_get_info(struct usb_device
if(cap[0]>(0x200000 * 10)) /* greater than 10 GByte */
cap[0]>>=16;
#endif
-#ifdef LITTLEENDIAN
- cap[0] = ((unsigned long)(
- (((unsigned long)(cap[0]) & (unsigned long)0x000000ffUL) << 24) |
- (((unsigned long)(cap[0]) & (unsigned long)0x0000ff00UL) << 8) |
- (((unsigned long)(cap[0]) & (unsigned long)0x00ff0000UL) >> 8) |
- (((unsigned long)(cap[0]) & (unsigned long)0xff000000UL) >> 24) ));
- cap[1] = ((unsigned long)(
- (((unsigned long)(cap[1]) & (unsigned long)0x000000ffUL) << 24) |
- (((unsigned long)(cap[1]) & (unsigned long)0x0000ff00UL) << 8) |
- (((unsigned long)(cap[1]) & (unsigned long)0x00ff0000UL) >> 8) |
- (((unsigned long)(cap[1]) & (unsigned long)0xff000000UL) >> 24) ));
-#endif
+ cap[0] = cpu_to_be32(cap[0]);
+ cap[1] = cpu_to_be32(cap[1]);
+
/* this assumes bigendian! */
cap[0] += 1;
capacity = &cap[0];
--
1.4.3.4
2
1

[U-Boot-Users] [Patch] Configure SMC for a second flash device if required
by Christian Eggers 21 May '08
by Christian Eggers 21 May '08
21 May '08
If SMC_CSR2_VAL is defined in the board configuration file,
the static memory controller will be configured for it.
---
cpu/arm920t/at91rm9200/lowlevel_init.S | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/cpu/arm920t/at91rm9200/lowlevel_init.S
b/cpu/arm920t/at91rm9200/lowlevel_init.S
index 98363eb..bb4b95f 100644
--- a/cpu/arm920t/at91rm9200/lowlevel_init.S
+++ b/cpu/arm920t/at91rm9200/lowlevel_init.S
@@ -47,6 +47,7 @@
#define MC_AASR 0xFFFFFF08
#define EBI_CFGR 0xFFFFFF64
#define SMC_CSR0 0xFFFFFF70
+#define SMC_CSR2 0xFFFFFF78
/* clocks */
#define PLLAR 0xFFFFFC28
@@ -96,7 +97,7 @@ LoopOsc:
ldr r0, =SMRDATA
ldr r1, _MTEXT_BASE
sub r0, r0, r1
- add r2, r0, #80
+ add r2, r0, #(SMRDATA1-SMRDATA)
0:
/* the address */
ldr r1, [r0], #4
@@ -113,7 +114,7 @@ LoopOsc:
ldr r0, =SMRDATA1
ldr r1, _MTEXT_BASE
sub r0, r0, r1
- add r2, r0, #176
+ add r2, r0, #(SMRDATA2-SMRDATA1)
2:
/* the address */
ldr r1, [r0], #4
@@ -148,6 +149,10 @@ SMRDATA:
.word EBI_CFGR_VAL
.word SMC_CSR0
.word SMC_CSR0_VAL
+#ifdef SMC_CSR2_VAL
+ .word SMC_CSR2
+ .word SMC_CSR2_VAL
+#endif
.word PLLAR
.word PLLAR_VAL
.word PLLBR
@@ -202,4 +207,5 @@ SMRDATA1:
.word SDRAM
.word SDRAM_VAL
/* SMRDATA1 is 176 bytes long */
+SMRDATA2:
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
--
1.4.3.4
Signed-off-by: Christian Eggers <ceggers(a)gmx.de>
1
0

21 May '08
Hello,
I've recognized that a lot of USB code in U-Boot uses the macros
swap_16() and swap_32() which are defined in usb.h. The behaviour
of the macros is controlled by the define LITTLEENDIAN.
Is there a good reason NOT to use the macros provided in
asm/byteorder.h (as in the appropriate code in Linux-2.4 )?
I think that switching to these functions might be useful in order
to eliminate the need to use the LITTLEENDIAN define for
specifying the byteorder. It seems that LITTLEENDIAN is not
used outside the USB code.
regards
Christian Eggers
3
3
This commit gets rid of a huge amount of silly white-space issues.
Especially, all sequences of SPACEs followed by TAB characters get
removed (unless they appear in print statements).
Also remove all embedded "vim:" and "vi:" statements which hide
indentation problems.
Signed-off-by: Wolfgang Denk <wd(a)denx.de>
---
Note: this patch is *huge* (about 15M) and therefore too big
for posting here. Please download it from
ftp://ftp.denx.de/pub/tmp/big-white-space-cleanup.patch.gz
Note2: As this patch affects *many* boards, I intend to merge it as
one of the first patcehs in this merge window. Please respond
ASAP if you have any comments / concerns.
board/MAI/AmigaOneG3SE/AmigaOneG3SE.c | 86 +-
board/MAI/AmigaOneG3SE/enet.c | 601 +-
board/MAI/AmigaOneG3SE/interrupts.c | 128 +-
board/MAI/AmigaOneG3SE/ps2kbd.c | 455 +-
board/MAI/AmigaOneG3SE/start.txt | 224 +-
board/MAI/AmigaOneG3SE/u-boot.lds | 42 +-
board/MAI/AmigaOneG3SE/usb_uhci.c | 1674 +++---
board/MAI/AmigaOneG3SE/via686.c | 164 +-
board/MAI/menu/menu.h | 92 +-
board/Marvell/common/bootseq.txt | 124 +-
board/Marvell/common/flash.c | 1800 +++---
board/Marvell/db64360/mpsc.c | 1146 ++--
board/Marvell/db64360/mpsc.h | 6 +-
board/Marvell/db64360/mv_eth.c | 4034 ++++++------
board/Marvell/db64360/u-boot.lds | 42 +-
board/Marvell/db64460/mpsc.c | 1146 ++--
board/Marvell/db64460/mpsc.h | 6 +-
board/Marvell/db64460/mv_eth.c | 4032 ++++++------
board/Marvell/db64460/u-boot.lds | 42 +-
board/MigoR/lowlevel_init.S | 416 +-
board/RPXClassic/u-boot.lds | 56 +-
board/RPXClassic/u-boot.lds.debug | 52 +-
board/RPXlite/flash.c | 792 ++--
board/RPXlite/u-boot.lds | 56 +-
board/RPXlite/u-boot.lds.debug | 52 +-
board/RPXlite_dw/RPXlite_dw.c | 180 +-
board/RPXlite_dw/flash.c | 6 +-
board/RPXlite_dw/u-boot.lds | 56 +-
board/RPXlite_dw/u-boot.lds.debug | 52 +-
board/RRvision/u-boot.lds | 64 +-
board/a3000/Makefile | 14 +-
board/a3000/a3000.c | 2 +-
board/adder/u-boot.lds | 46 +-
board/ads5121/u-boot.lds | 42 +-
board/amcc/acadia/u-boot-nand.lds | 46 +-
board/amcc/acadia/u-boot.lds | 46 +-
board/amcc/bamboo/bamboo.c | 3308 +++++-----
board/amcc/bamboo/u-boot-nand.lds | 46 +-
board/amcc/bamboo/u-boot.lds | 52 +-
board/amcc/bubinga/u-boot.lds | 46 +-
board/amcc/canyonlands/u-boot-nand.lds | 46 +-
board/amcc/canyonlands/u-boot.lds | 50 +-
board/amcc/ebony/u-boot.lds | 50 +-
board/amcc/katmai/katmai.c | 866 ++--
board/amcc/kilauea/Makefile | 20 +-
board/amcc/kilauea/init.S | 180 +-
board/amcc/kilauea/kilauea.c | 564 +-
board/amcc/kilauea/u-boot-nand.lds | 46 +-
board/amcc/kilauea/u-boot.lds | 42 +-
board/amcc/luan/u-boot.lds | 50 +-
board/amcc/makalu/Makefile | 20 +-
board/amcc/makalu/init.S | 202 +-
board/amcc/makalu/makalu.c | 502 +-
board/amcc/makalu/u-boot.lds | 42 +-
board/amcc/ocotea/u-boot.lds | 50 +-
board/amcc/sequoia/u-boot-nand.lds | 46 +-
board/amcc/sequoia/u-boot.lds | 48 +-
board/amcc/taihu/u-boot.lds | 46 +-
board/amcc/taishan/u-boot.lds | 50 +-
board/amcc/walnut/u-boot.lds | 46 +-
board/amcc/yosemite/u-boot.lds | 50 +-
board/amcc/yucca/yucca.c | 1650 +++---
board/amirix/ap1000/u-boot.lds | 68 +-
board/apollon/apollon.c | 510 +-
board/armadillo/lowlevel_init.S | 4 +-
board/assabet/assabet.c | 2 +-
board/atmel/at91sam9260ek/at91sam9260ek.c | 262 +-
board/atum8548/u-boot.lds | 44 +-
board/barco/speed.h | 22 +-
board/bc3450/cmd_bc3450.c | 1172 ++--
board/bf533-ezkit/flash-defines.h | 138 +-
board/bf533-stamp/bf533-stamp.h | 10 +-
board/bmw/README | 50 +-
board/bmw/early_init.S | 6 +-
board/c2mon/pcmcia.c | 476 +-
board/c2mon/u-boot.lds | 56 +-
board/c2mon/u-boot.lds.debug | 52 +-
board/cerf250/lowlevel_init.S | 260 +-
board/cm5200/u-boot.lds | 42 +-
board/cmc_pu2/cmc_pu2.c | 2 +-
board/cmi/flash.c | 768 ++--
board/cobra5272/u-boot.lds | 58 +-
board/cogent/lcd.h | 2 +-
board/cogent/u-boot.lds | 40 +-
board/cogent/u-boot.lds.debug | 52 +-
board/cpc45/plx9030.c | 160 +-
board/cray/L1/L1.h | 12 +-
board/cray/L1/u-boot.lds | 68 +-
board/cray/L1/u-boot.lds.debug | 54 +-
board/csb226/lowlevel_init.S | 554 +-
board/csb272/u-boot.lds | 72 +-
board/csb472/u-boot.lds | 72 +-
board/dave/B2/B2.c | 114 +-
board/dave/PPChameleonEVB/u-boot.lds | 66 +-
board/davinci/dv-evm/dv_board.c | 262 +-
board/davinci/schmoogie/dv_board.c | 362 +-
board/davinci/sonata/dv_board.c | 272 +-
board/eltec/bab7xx/u-boot.lds | 42 +-
board/eltec/elppc/u-boot.lds | 42 +-
board/eltec/mhpc/u-boot.lds | 42 +-
board/eltec/mhpc/u-boot.lds.debug | 52 +-
board/emk/top860/u-boot.lds | 42 +-
board/emk/top860/u-boot.lds.debug | 54 +-
board/ep8260/flash.c | 610 +-
board/ep82xxm/ep82xxm.c | 266 +-
board/ep88x/u-boot.lds | 46 +-
board/eric/flash.c | 195 +-
board/eric/u-boot.lds | 70 +-
board/esd/adciop/u-boot.lds | 48 +-
board/esd/apc405/u-boot.lds | 64 +-
board/esd/ar405/u-boot.lds | 88 +-
board/esd/ash405/u-boot.lds | 64 +-
board/esd/canbt/u-boot.lds | 86 +-
board/esd/cms700/cms700.c | 270 +-
board/esd/cms700/u-boot.lds | 64 +-
board/esd/cpci2dp/u-boot.lds | 64 +-
board/esd/cpci405/u-boot.lds | 64 +-
board/esd/cpci5200/Makefile | 26 +-
board/esd/cpci750/mpsc.c | 1146 ++--
board/esd/cpci750/mpsc.h | 6 +-
board/esd/cpci750/mv_eth.c | 4036 ++++++------
board/esd/cpci750/sdram_init.c | 259 +-
board/esd/cpci750/u-boot.lds | 42 +-
board/esd/cpciiser4/u-boot.lds | 64 +-
board/esd/dasa_sim/u-boot.lds | 90 +-
board/esd/dp405/u-boot.lds | 66 +-
board/esd/du405/u-boot.lds | 64 +-
board/esd/du440/u-boot.lds | 48 +-
board/esd/hh405/hh405.c | 1182 ++--
board/esd/hh405/u-boot.lds | 64 +-
board/esd/hub405/u-boot.lds | 66 +-
board/esd/ocrtc/u-boot.lds | 64 +-
board/esd/pci405/cmd_pci405.c | 1416 +++---
board/esd/pci405/u-boot.lds | 64 +-
board/esd/pf5200/Makefile | 26 +-
board/esd/plu405/u-boot.lds | 66 +-
board/esd/pmc405/u-boot.lds | 64 +-
board/esd/pmc440/u-boot-nand.lds | 46 +-
board/esd/pmc440/u-boot.lds | 48 +-
board/esd/tasreg/u-boot.lds | 56 +-
board/esd/voh405/u-boot.lds | 66 +-
board/esd/vom405/u-boot.lds | 64 +-
board/esd/wuh405/u-boot.lds | 64 +-
board/esteem192e/flash.c | 1030 ++--
board/esteem192e/u-boot.lds | 56 +-
board/etin/debris/debris.c | 204 +-
board/etin/debris/speed.h | 22 +-
board/etx094/u-boot.lds | 62 +-
board/etx094/u-boot.lds.debug | 68 +-
board/evb64260/bootseq.txt | 124 +-
board/evb64260/eth.c | 988 ++--
board/evb64260/mpsc.c | 4 +-
board/evb64260/mpsc.h | 6 +-
board/evb64260/u-boot.lds | 42 +-
board/evb64260/zuma_pbb_mbox.c | 26 +-
board/exbitgen/exbitgen.h | 18 +-
board/exbitgen/init.S | 1570 +++---
board/exbitgen/u-boot.lds | 68 +-
board/fads/fads.h | 6 +-
board/fads/pcmcia.c | 70 +-
board/fads/u-boot.lds | 44 +-
board/fads/u-boot.lds.debug | 54 +-
board/flagadm/u-boot.lds | 42 +-
board/flagadm/u-boot.lds.debug | 52 +-
board/freescale/common/fsl_diu_fb.c | 926 ++--
board/freescale/common/pixis.c | 686 +-
board/freescale/common/sys_eeprom.c | 428 +-
board/freescale/m52277evb/u-boot.lds | 58 +-
board/freescale/m5235evb/u-boot.16 | 58 +-
board/freescale/m5235evb/u-boot.32 | 74 +-
board/freescale/m5235evb/u-boot.lds | 58 +-
board/freescale/m5249evb/u-boot.lds | 56 +-
board/freescale/m5253evbe/u-boot.lds | 56 +-
board/freescale/m5275evb/u-boot.lds | 54 +-
board/freescale/m5329evb/u-boot.lds | 56 +-
board/freescale/m5373evb/u-boot.lds | 56 +-
board/freescale/m54455evb/u-boot.atm | 56 +-
board/freescale/m54455evb/u-boot.int | 54 +-
board/freescale/m54455evb/u-boot.lds | 56 +-
board/freescale/m547xevb/u-boot.lds | 54 +-
board/freescale/m548xevb/u-boot.lds | 54 +-
board/freescale/mpc7448hpc2/asm_init.S | 1226 ++--
board/freescale/mpc7448hpc2/tsi108_init.c | 1004 ++--
board/freescale/mpc7448hpc2/u-boot.lds | 42 +-
board/freescale/mpc8260ads/mpc8260ads.c | 760 ++--
board/freescale/mpc8349emds/pci.c | 636 +-
board/freescale/mpc8349itx/mpc8349itx.c | 500 +-
board/freescale/mpc8540ads/u-boot.lds | 44 +-
board/freescale/mpc8541cds/u-boot.lds | 44 +-
board/freescale/mpc8544ds/u-boot.lds | 44 +-
board/freescale/mpc8548cds/u-boot.lds | 44 +-
board/freescale/mpc8555cds/u-boot.lds | 44 +-
board/freescale/mpc8560ads/u-boot.lds | 44 +-
board/freescale/mpc8568mds/bcsr.h | 136 +-
board/freescale/mpc8568mds/tlb.c | 124 +-
board/freescale/mpc8568mds/u-boot.lds | 44 +-
board/freescale/mpc8641hpcn/u-boot.lds | 42 +-
board/g2000/u-boot.lds | 66 +-
board/gen860t/README | 2 -
board/gen860t/beeper.c | 104 +-
board/gen860t/beeper.h | 2 -
board/gen860t/flash.c | 908 ++--
board/gen860t/fpga.c | 2 -
board/gen860t/fpga.h | 2 -
board/gen860t/ioport.c | 510 +-
board/gen860t/ioport.h | 2 -
board/gen860t/u-boot-flashenv.lds | 46 +-
board/gen860t/u-boot.lds | 46 +-
board/genietv/flash.c | 698 ++--
board/genietv/u-boot.lds | 58 +-
board/genietv/u-boot.lds.debug | 58 +-
board/gth/flash.c | 930 ++--
board/gth/u-boot.lds | 40 +-
board/hermes/u-boot.lds | 58 +-
board/hermes/u-boot.lds.debug | 52 +-
board/hidden_dragon/speed.h | 22 +-
board/hymod/hymod.c | 706 ++--
board/hymod/u-boot.lds | 58 +-
board/hymod/u-boot.lds.debug | 52 +-
board/icu862/pcmcia.c | 442 +-
board/icu862/u-boot.lds | 58 +-
board/icu862/u-boot.lds.debug | 54 +-
board/idmr/u-boot.lds | 56 +-
board/imx31_litekit/lowlevel_init.S | 118 +-
board/imx31_phycore/lowlevel_init.S | 118 +-
board/innokom/flash.c | 530 +-
board/innokom/lowlevel_init.S | 554 +-
board/integratorap/memsetup.S | 4 +-
board/integratorap/split_by_variant.sh | 28 +-
board/integratorcp/flash.c | 770 ++--
board/integratorcp/memsetup.S | 4 +-
board/integratorcp/split_by_variant.sh | 42 +-
board/ip860/u-boot.lds | 54 +-
board/ip860/u-boot.lds.debug | 52 +-
board/ivm/u-boot.lds | 42 +-
board/ivm/u-boot.lds.debug | 54 +-
board/ixdp425/flash.c | 18 +-
board/jse/u-boot.lds | 46 +-
board/korat/u-boot-F7FC.lds | 48 +-
board/korat/u-boot.lds | 48 +-
board/kup/common/pcmcia.c | 364 +-
board/kup/kup4k/u-boot.lds | 58 +-
board/kup/kup4k/u-boot.lds.debug | 52 +-
board/kup/kup4x/u-boot.lds | 58 +-
board/kup/kup4x/u-boot.lds.debug | 52 +-
board/lantec/u-boot.lds | 56 +-
board/lantec/u-boot.lds.debug | 52 +-
board/linkstation/avr.c | 4 +-
board/logodl/flash.c | 1144 ++--
board/logodl/lowlevel_init.S | 554 +-
board/lpc2292sodimm/lowlevel_init.S | 12 +-
board/lpd7a40x/lowlevel_init.S | 282 +-
board/lubbock/lowlevel_init.S | 540 +-
board/lwmon/pcmcia.c | 400 +-
board/lwmon/u-boot.lds | 42 +-
board/lwmon/u-boot.lds.debug | 54 +-
board/lwmon5/u-boot.lds | 48 +-
board/m5271evb/u-boot.lds | 56 +-
board/m5272c3/u-boot.lds | 56 +-
board/m5282evb/u-boot.lds | 56 +-
board/mbx8xx/u-boot.lds | 42 +-
board/mbx8xx/u-boot.lds.debug | 54 +-
board/mgsuvd/u-boot.lds | 64 +-
board/ml2/u-boot.lds | 70 +-
board/ml2/u-boot.lds.debug | 54 +-
board/mousse/u-boot.lds | 52 +-
board/mousse/u-boot.lds.ram | 10 +-
board/mousse/u-boot.lds.rom | 56 +-
board/mpc8540eval/u-boot.lds | 44 +-
board/mpl/common/common_util.c | 996 ++--
board/mpl/common/common_util.h | 10 +-
board/mpl/common/flash.c | 1362 ++--
board/mpl/common/kbd.c | 256 +-
board/mpl/common/memtst.c | 764 ++--
board/mpl/common/pci.c | 92 +-
board/mpl/common/pci_parts.h | 36 +-
board/mpl/common/usb_uhci.c | 1636 +++---
board/mpl/mip405/cmd_mip405.c | 40 +-
board/mpl/mip405/mip405.c | 1034 ++--
board/mpl/mip405/mip405.h | 198 +-
board/mpl/mip405/u-boot.lds | 72 +-
board/mpl/pati/cmd_pati.c | 622 +-
board/mpl/pati/pati.c | 706 ++--
board/mpl/pati/pati.h | 50 +-
board/mpl/pati/pci_eeprom.h | 102 +-
board/mpl/pip405/cmd_pip405.c | 44 +-
board/mpl/pip405/pip405.h | 156 +-
board/mpl/pip405/u-boot.lds | 68 +-
board/mpl/pip405/u-boot.lds.debug | 54 +-
board/mpl/vcma9/cmd_vcma9.c | 230 +-
board/mpl/vcma9/lowlevel_init.S | 220 +-
board/ms7722se/lowlevel_init.S | 478 +-
board/munices/u-boot.lds | 42 +-
board/musenki/musenki.c | 80 +-
board/mvblue/flash.c | 10 +-
board/mvs1/flash.c | 1000 ++--
board/mvs1/u-boot.lds | 64 +-
board/mvs1/u-boot.lds.debug | 52 +-
board/mx1ads/lowlevel_init.S | 72 +-
board/mx1ads/mx1ads.c | 142 +-
board/mx1ads/syncflash.c | 62 +-
board/mx1fs2/flash.c | 1296 ++--
board/mx1fs2/lowlevel_init.S | 200 +-
board/nc650/u-boot.lds | 42 +-
board/nc650/u-boot.lds.debug | 42 +-
board/netphone/netphone.c | 1030 ++--
board/netphone/u-boot.lds | 10 +-
board/netphone/u-boot.lds.debug | 52 +-
board/netstal/hcu4/u-boot.lds | 42 +-
board/netstal/hcu5/hcu5.c | 664 +-
board/netstal/hcu5/init.S | 140 +-
board/netstal/hcu5/u-boot.lds | 48 +-
board/netstal/mcu25/u-boot.lds | 42 +-
board/netstar/crcek.S | 370 +-
board/netstar/eeprom_start.S | 260 +-
board/netstar/setup.S | 442 +-
board/netta/dsp.c | 1764 +++---
board/netta/pcmcia.c | 10 +-
board/netta/u-boot.lds | 12 +-
board/netta/u-boot.lds.debug | 52 +-
board/netta2/u-boot.lds | 12 +-
board/netta2/u-boot.lds.debug | 52 +-
board/netvia/u-boot.lds | 12 +-
board/netvia/u-boot.lds.debug | 52 +-
board/ns9750dev/ns9750dev.c | 44 +-
board/nx823/u-boot.lds | 42 +-
board/nx823/u-boot.lds.debug | 52 +-
board/omap1610inn/lowlevel_init.S | 582 +-
board/omap1610inn/omap1610innovator.c | 352 +-
board/omap2420h4/mem.c | 502 +-
board/omap2420h4/omap2420h4.c | 1058 ++--
board/omap5912osk/lowlevel_init.S | 618 +-
board/omap730p2/lowlevel_init.S | 518 +-
board/oxc/flash.c | 202 +-
board/pcippc2/cpc710_init_ram.c | 362 +-
board/pcippc2/fpga_serial.h | 14 +-
board/pcippc2/pcippc2.h | 24 +-
board/pcippc2/sconsole.h | 25 +-
board/pcippc2/u-boot.lds | 42 +-
board/pcs440ep/pcs440ep.c | 1302 ++--
board/pcs440ep/u-boot.lds | 48 +-
board/pm520/flash.c | 42 +-
board/pm854/pm854.c | 290 +-
board/pm854/u-boot.lds | 44 +-
board/pm856/pm856.c | 546 +-
board/pm856/u-boot.lds | 44 +-
board/pn62/pn62.h | 28 +-
board/ppmc7xx/u-boot.lds | 42 +-
board/prodrive/alpr/u-boot.lds | 50 +-
board/prodrive/p3mx/mpsc.c | 1156 ++--
board/prodrive/p3mx/mpsc.h | 6 +-
board/prodrive/p3mx/u-boot.lds | 42 +-
board/prodrive/p3p440/u-boot.lds | 50 +-
board/purple/purple.c | 31 +-
board/purple/sconsole.h | 21 +-
board/pxa255_idp/lowlevel_init.S | 670 +-
board/quantum/fpga.h | 1 -
board/quantum/u-boot.lds | 56 +-
board/quantum/u-boot.lds.debug | 52 +-
board/r360mpi/pcmcia.c | 382 +-
board/r360mpi/u-boot.lds | 56 +-
board/r7780mp/lowlevel_init.S | 728 ++--
board/rbc823/flash.c | 698 ++--
board/rbc823/u-boot.lds | 56 +-
board/rmu/u-boot.lds | 56 +-
board/rmu/u-boot.lds.debug | 52 +-
board/rsdproto/flash.c | 390 +-
board/rsdproto/u-boot.lds | 42 +-
board/sandburst/karef/u-boot.lds | 72 +-
board/sandburst/karef/u-boot.lds.debug | 68 +-
board/sandburst/metrobox/u-boot.lds | 72 +-
board/sandburst/metrobox/u-boot.lds.debug | 68 +-
board/sandpoint/sandpoint.c | 72 +-
board/sandpoint/speed.h | 22 +-
board/sbc405/u-boot.lds | 66 +-
board/sbc8548/law.c | 30 +-
board/sbc8548/sbc8548.c | 772 ++--
board/sbc8548/u-boot.lds | 44 +-
board/sbc8560/u-boot.lds | 44 +-
board/sbc8641d/u-boot.lds | 42 +-
board/sc3/sc3.c | 976 ++--
board/sc3/sc3.h | 86 +-
board/sc3/u-boot.lds | 68 +-
board/sc520_cdp/sc520_cdp.c | 706 ++--
board/sc520_cdp/sc520_cdp_asm.S | 60 +-
board/sc520_cdp/u-boot.lds | 78 +-
board/sc520_spunk/sc520_spunk.c | 880 ++--
board/sc520_spunk/sc520_spunk_asm.S | 52 +-
board/sc520_spunk/u-boot.lds | 78 +-
board/siemens/CCM/u-boot.lds | 56 +-
board/siemens/CCM/u-boot.lds.debug | 52 +-
board/siemens/IAD210/u-boot.lds | 52 +-
board/siemens/SMN42/lowlevel_init.S | 10 +-
board/siemens/pcu_e/u-boot.lds | 42 +-
board/siemens/pcu_e/u-boot.lds.debug | 54 +-
board/sixnet/u-boot.lds | 42 +-
board/sl8245/Makefile | 14 +-
board/smdk2410/lowlevel_init.S | 180 +-
board/snmc/qs850/u-boot.lds | 64 +-
board/snmc/qs860t/flash.c | 221 +-
board/snmc/qs860t/u-boot.lds | 64 +-
board/spc1920/u-boot.lds | 64 +-
board/spd8xx/u-boot.lds | 42 +-
board/spd8xx/u-boot.lds.debug | 54 +-
board/stxgp3/u-boot.lds | 44 +-
board/stxssa/u-boot.lds | 44 +-
board/stxxtc/u-boot.lds | 12 +-
board/stxxtc/u-boot.lds.debug | 52 +-
board/svm_sc8xx/u-boot.lds | 64 +-
board/svm_sc8xx/u-boot.lds.debug | 52 +-
board/total5200/total5200.c | 94 +-
board/tqm5200/cmd_stk52xx.c | 2106 ++++----
board/tqm8260/tqm8260.c | 536 +-
board/tqm834x/pci.c | 310 +-
board/tqm8xx/u-boot.lds | 64 +-
board/tqm8xx/u-boot.lds.debug | 52 +-
board/trab/lowlevel_init.S | 196 +-
board/trab/memory.c | 452 +-
board/trab/trab.c | 452 +-
board/trab/tsc2000.h | 93 +-
board/trab/vfd.c | 824 ++--
board/uc100/u-boot.lds | 64 +-
board/uc100/u-boot.lds.debug | 52 +-
board/uc100/uc100.c | 366 +-
board/utx8245/flash.c | 828 ++--
board/v37/flash.c | 800 ++--
board/v37/u-boot.lds | 64 +-
board/v37/v37.c | 94 +-
board/versatile/flash.c | 720 ++--
board/versatile/versatile.c | 48 +-
board/voiceblue/setup.S | 404 +-
board/w7o/post1.S | 64 +-
board/w7o/u-boot.lds | 44 +-
board/w7o/u-boot.lds.debug | 54 +-
board/wepep250/lowlevel_init.S | 8 +-
board/westel/amx860/u-boot.lds | 56 +-
board/westel/amx860/u-boot.lds.debug | 54 +-
board/xilinx/common/xdma_channel.c | 370 +-
board/xilinx/common/xdma_channel.h | 88 +-
board/xilinx/ml300/u-boot.lds | 70 +-
board/xilinx/ml300/u-boot.lds.debug | 54 +-
board/xpedite1k/u-boot.lds | 70 +-
board/xpedite1k/u-boot.lds.debug | 66 +-
board/xsengine/lowlevel_init.S | 20 +-
board/zeus/u-boot.lds | 42 +-
common/cmd_autoscript.c | 318 +-
common/cmd_dcr.c | 318 +-
common/cmd_fdc.c | 136 +-
common/cmd_fdt.c | 1352 ++--
common/cmd_i2c.c | 2096 ++++----
common/cmd_ide.c | 2872 +++++-----
common/cmd_mem.c | 60 +-
common/cmd_pci.c | 838 ++--
common/cmd_reginfo.c | 112 +-
common/cmd_scsi.c | 906 ++--
common/cmd_usb.c | 1046 ++--
common/cmd_vfd.c | 86 +-
common/command.c | 34 +-
common/console.c | 688 +-
common/env_dataflash.c | 74 +-
common/env_nand.c | 304 +-
common/hush.c | 1 -
common/lists.c | 752 ++--
common/usb.c | 1664 +++---
common/usb_kbd.c | 1038 ++--
common/virtex2.c | 700 ++--
config.mk | 104 +-
cpu/arm1136/mx31/serial.c | 188 +-
cpu/arm1136/start.S | 532 +-
cpu/arm720t/interrupts.c | 272 +-
cpu/arm720t/serial_netarm.c | 186 +-
cpu/arm920t/at91rm9200/ether.c | 248 +-
cpu/arm920t/imx/serial.c | 204 +-
cpu/arm920t/s3c24x0/usb_ohci.c | 2484 ++++----
cpu/arm920t/s3c24x0/usb_ohci.h | 293 +-
cpu/arm920t/start.S | 514 +-
cpu/arm925t/start.S | 22 +-
cpu/arm926ejs/davinci/dp83848.c | 168 +-
cpu/arm926ejs/davinci/ether.c | 99 +-
cpu/arm926ejs/davinci/lowlevel_init.S | 1060 ++--
cpu/arm926ejs/davinci/nand.c | 486 +-
cpu/arm926ejs/interrupts.c | 10 +-
cpu/arm926ejs/start.S | 432 +-
cpu/arm946es/start.S | 446 +-
cpu/arm_intcm/start.S | 386 +-
cpu/blackfin/flush.S | 372 +-
cpu/blackfin/i2c.c | 592 +-
cpu/blackfin/serial.c | 100 +-
cpu/i386/sc520.c | 626 +-
cpu/i386/sc520_asm.S | 574 +-
cpu/i386/start.S | 12 +-
cpu/i386/start16.S | 82 +-
cpu/ixp/npe/IxEthAcc.c | 24 +-
cpu/ixp/npe/IxEthAccCommon.c | 624 +-
cpu/ixp/npe/IxEthAccDataPlane.c | 2192 ++++----
cpu/ixp/npe/IxEthAccMac.c | 1490 +++---
cpu/ixp/npe/IxEthAccMii.c | 140 +-
cpu/ixp/npe/IxNpeDlImageMgr.c | 338 +-
cpu/ixp/npe/IxNpeDlNpeMgrUtils.c | 330 +-
cpu/ixp/npe/IxOsalIoMem.c | 8 +-
cpu/ixp/npe/IxQMgrAqmIf.c | 472 +-
cpu/ixp/npe/IxQMgrQAccess.c | 176 +-
cpu/ixp/npe/include/IxDmaAcc.h | 18 +-
cpu/ixp/npe/include/IxEthAcc.h | 80 +-
cpu/ixp/npe/include/IxEthAccMii_p.h | 24 +-
cpu/ixp/npe/include/IxEthAcc_p.h | 2 +-
cpu/ixp/npe/include/IxEthMii.h | 28 +-
cpu/ixp/npe/include/IxI2cDrv.h | 514 +-
cpu/ixp/npe/include/IxOsalAssert.h | 2 +-
cpu/ixp/npe/include/IxOsalBackwardBufferMgt.h | 60 +-
cpu/ixp/npe/include/IxOsalBackwardMemMap.h | 82 +-
cpu/ixp/npe/include/IxOsalIoMem.h | 20 +-
cpu/ixp/npe/include/IxOsalMemAccess.h | 48 +-
cpu/ixp/npe/include/IxOsalTypes.h | 38 +-
cpu/ixp/npe/include/IxQMgr.h | 634 +-
cpu/ixp/npe/include/IxQMgrAqmIf_p.h | 350 +-
cpu/ixp/npe/include/IxQueueAssignments.h | 2 +-
cpu/ixp/pci.c | 778 ++--
cpu/ixp/start.S | 701 ++--
cpu/leon2/start.S | 22 +-
cpu/leon3/start.S | 24 +-
cpu/lh7a40x/start.S | 518 +-
cpu/mcf523x/start.S | 446 +-
cpu/mcf52x2/start.S | 592 +-
cpu/mcf532x/start.S | 430 +-
cpu/mcf5445x/start.S | 520 +-
cpu/mcf547x_8x/start.S | 472 +-
cpu/mips/asc_serial.c | 128 +-
cpu/mips/au1x00_usb_ohci.h | 264 +-
cpu/mips/incaip_wdt.S | 48 +-
cpu/mips/start.S | 630 +-
cpu/mpc512x/start.S | 1034 ++--
cpu/mpc5xx/config.mk | 8 +-
cpu/mpc5xx/cpu_init.c | 104 +-
cpu/mpc5xx/serial.c | 120 +-
cpu/mpc5xx/speed.c | 44 +-
cpu/mpc5xx/spi.c | 562 +-
cpu/mpc5xx/traps.c | 196 +-
cpu/mpc5xx/u-boot.lds | 58 +-
cpu/mpc5xxx/fec.c | 1546 +++---
cpu/mpc5xxx/u-boot-customlayout.lds | 40 +-
cpu/mpc5xxx/u-boot.lds | 42 +-
cpu/mpc8220/u-boot.lds | 42 +-
cpu/mpc824x/drivers/epic/epic2.S | 208 +-
cpu/mpc824x/drivers/errors.h | 30 +-
cpu/mpc824x/u-boot.lds | 42 +-
cpu/mpc8260/i2c.c | 1050 ++--
cpu/mpc8260/speed.h | 22 +-
cpu/mpc8260/u-boot.lds | 42 +-
cpu/mpc83xx/cpu_init.c | 334 +-
cpu/mpc83xx/spd_sdram.c | 1560 +++---
cpu/mpc83xx/u-boot.lds | 42 +-
cpu/mpc85xx/qe_io.c | 90 +-
cpu/mpc85xx/start.S | 1512 +++---
cpu/mpc86xx/spd_sdram.c | 2242 ++++----
cpu/mpc86xx/start.S | 1690 +++---
cpu/mpc8xx/i2c.c | 1016 ++--
cpu/mpc8xx/scc.c | 736 ++--
cpu/mpc8xx/video.c | 1538 +++---
cpu/nios/asmi.c | 1012 ++--
cpu/nios/start.S | 342 +-
cpu/nios2/start.S | 274 +-
cpu/ppc4xx/4xx_pci.c | 682 +-
cpu/ppc4xx/4xx_pcie.c | 1766 +++---
cpu/ppc4xx/i2c.c | 604 +-
cpu/ppc4xx/kgdb.S | 68 +-
cpu/ppc4xx/speed.c | 1906 +++---
cpu/ppc4xx/start.S | 58 +-
cpu/ppc4xx/usb_ohci.c | 2390 ++++----
cpu/pxa/i2c.c | 506 +-
cpu/s3c44b0/start.S | 228 +-
cpu/sa1100/start.S | 486 +-
cpu/sh4/cache.c | 100 +-
disk/part_iso.c | 360 +-
disk/part_iso.h | 210 +-
doc/README-i386 | 28 +-
doc/README-integrator | 60 +-
doc/README.RPXlite | 754 ++--
doc/README.adnpesc1 | 110 +-
doc/README.adnpesc1_base32 | 770 ++--
doc/README.console | 42 +-
doc/README.m54455evb | 4 +-
doc/README.m68k | 10 +-
doc/README.marubun-pcmcia | 56 +-
doc/README.mpc8313erdb | 116 +-
doc/README.mpc8349itx | 246 +-
doc/README.mpc8360emds | 214 +-
doc/README.mpc837xemds | 150 +-
doc/README.mpc8641hpcn | 180 +-
doc/README.video | 4 +-
drivers/bios_emulator/bios.c | 320 +-
drivers/block/Makefile | 16 +-
drivers/block/sym53c8xx.c | 202 +-
drivers/dma/Makefile | 16 +-
drivers/i2c/Makefile | 16 +-
drivers/input/Makefile | 16 +-
drivers/input/keyboard.c | 398 +-
drivers/misc/Makefile | 16 +-
drivers/misc/ali512x.c | 346 +-
drivers/mtd/at45.c | 26 +-
drivers/mtd/nand/Makefile | 16 +-
drivers/mtd/nand/diskonchip.c | 2812 +++++-----
drivers/mtd/nand/nand_base.c | 4026 ++++++------
drivers/mtd/nand/nand_bbt.c | 8 +-
drivers/mtd/nand/nand_ids.c | 192 +-
drivers/mtd/nand_legacy/Makefile | 16 +-
drivers/mtd/nand_legacy/nand_legacy.c | 2520 ++++----
drivers/net/3c589.c | 536 +-
drivers/net/3c589.h | 380 +-
drivers/net/Makefile | 16 +-
drivers/net/bcm570x.c | 2248 ++++----
drivers/net/bfin_mac.c | 754 ++--
drivers/net/dc2114x.c | 47 +-
drivers/net/dm9000x.c | 18 +-
drivers/net/e1000.h | 946 ++--
drivers/net/lan91c96.h | 20 +-
drivers/net/mcffec.c | 896 ++--
drivers/net/natsemi.c | 158 +-
drivers/net/nicext.h | 2 +-
drivers/net/ns8382x.c | 1046 ++--
drivers/net/plb2800_eth.c | 424 +-
drivers/net/rtl8019.h | 153 +-
drivers/net/sk98lin/h/skdebug.h | 128 +-
drivers/net/sk98lin/h/skdrv2nd.h | 4 +-
drivers/net/sk98lin/h/skgedrv.h | 18 +-
drivers/net/sk98lin/h/skgehw.h | 144 +-
drivers/net/sk98lin/h/skgei2c.h | 10 +-
drivers/net/sk98lin/h/skgeinit.h | 1650 +++---
drivers/net/sk98lin/h/skgepnm2.h | 620 +-
drivers/net/sk98lin/h/skgepnmi.h | 417 +-
drivers/net/sk98lin/h/skvpd.h | 488 +-
drivers/net/sk98lin/h/xmac_ii.h | 2874 +++++-----
drivers/net/sk98lin/skge.c | 7246 +++++++++++-----------
drivers/net/sk98lin/skgeinit.c | 11 +-
drivers/net/sk98lin/skgepnmi.c | 128 +-
drivers/net/sk98lin/skgesirq.c | 3882 ++++++------
drivers/net/sk98lin/ski2c.c | 2166 ++++----
drivers/net/sk98lin/sklm80.c | 440 +-
drivers/net/sk98lin/skproc.c | 71 +-
drivers/net/sk98lin/skrlmt.c | 5692 +++++++++---------
drivers/net/sk98lin/skvpd.c | 2092 ++++----
drivers/net/sk98lin/skxmac2.c | 6608 ++++++++++----------
drivers/net/smc91111.h | 88 +-
drivers/net/smc911x.c | 1026 ++--
drivers/net/tigon3.h | 2622 ++++----
drivers/net/tsec.h | 182 +-
drivers/net/uli526x.c | 1464 +++---
drivers/pci/Makefile | 16 +-
drivers/pci/pci.c | 648 +-
drivers/pci/pci_indirect.c | 162 +-
drivers/pci/pci_sh7780.c | 122 +-
drivers/pci/w83c553f.c | 330 +-
drivers/pcmcia/Makefile | 16 +-
drivers/pcmcia/marubun_pcmcia.c | 110 +-
drivers/pcmcia/mpc8xx_pcmcia.c | 380 +-
drivers/pcmcia/tqm8xx_pcmcia.c | 410 +-
drivers/qe/Makefile | 16 +-
drivers/qe/qe.h | 96 +-
drivers/qe/uccf.c | 682 +-
drivers/qe/uec.c | 2312 ++++----
drivers/qe/uec.h | 964 ++--
drivers/rtc/date.c | 4 +-
drivers/rtc/ds12887.c | 10 +-
drivers/rtc/ds1302.c | 386 +-
drivers/rtc/mc146818.c | 36 +-
drivers/serial/Makefile | 16 +-
drivers/serial/serial_max3100.c | 342 +-
drivers/serial/serial_sh.c | 32 +-
drivers/serial/usbtty.c | 1402 +++---
drivers/serial/usbtty.h | 42 +-
drivers/spi/mxc_spi.c | 174 +-
drivers/usb/Makefile | 16 +-
drivers/usb/isp116x-hcd.c | 2208 ++++----
drivers/usb/sl811_usb.c | 1116 ++--
drivers/video/Makefile | 16 +-
drivers/video/ati_radeon_fb.h | 416 +-
examples/sched.c | 466 +-
examples/smc91111_eeprom.c | 2 +-
examples/timer.c | 460 +-
fs/jffs2/jffs2_1pass.c | 18 +-
fs/jffs2/jffs2_nand_1pass.c | 1568 +++---
fs/reiserfs/dev.c | 148 +-
fs/reiserfs/mode_string.c | 1 -
fs/reiserfs/reiserfs_private.h | 140 +-
include/ACEX1K.h | 40 +-
include/SA-1100.h | 3394 +++++-----
include/ahci.h | 270 +-
include/armcoremodule.h | 10 +-
include/asm-arm/arch-arm720t/netarm_mem_module.h | 166 +-
include/asm-arm/arch-arm720t/netarm_ser_module.h | 438 +-
include/asm-arm/arch-arm720t/s3c4510b.h | 10 +-
include/asm-arm/arch-at91rm9200/AT91RM9200.h | 382 +-
include/asm-arm/arch-at91sam9/gpio.h | 492 +-
include/asm-arm/arch-ixp/ixp425.h | 76 +-
include/asm-arm/arch-omap24xx/clocks.h | 20 +-
include/asm-arm/arch-pxa/bitfield.h | 44 +-
include/asm-arm/arch-pxa/mmc.h | 107 +-
include/asm-arm/arch-s3c24x0/memory.h | 34 +-
include/asm-arm/arch-sa1100/bitfield.h | 44 +-
include/asm-arm/u-boot.h | 24 +-
include/asm-avr32/arch-at32ap700x/mmc.h | 120 +-
include/asm-blackfin/cplb.h | 4 +-
include/asm-blackfin/shared_resources.h | 2 +-
include/asm-i386/ic/sc520.h | 390 +-
include/asm-m68k/m5249.h | 228 +-
include/asm-m68k/m5282.h | 18 +-
include/asm-microblaze/asm.h | 74 +-
include/asm-mips/au1x00.h | 2 +-
include/asm-mips/cacheops.h | 80 +-
include/asm-mips/mipsregs.h | 30 +-
include/asm-nios/io.h | 90 +-
include/asm-ppc/4xx_pci.h | 2 +-
include/asm-ppc/5xx_immap.h | 36 +-
include/asm-ppc/e300.h | 122 +-
include/asm-ppc/immap_85xx.h | 60 +-
include/asm-ppc/immap_86xx.h | 6 +-
include/asm-ppc/mmu.h | 650 +-
include/asm-ppc/ppc4xx-intvec.h | 418 +-
include/asm-ppc/ptrace.h | 2 +-
include/asm-ppc/sigcontext.h | 10 +-
include/asm-ppc/u-boot.h | 108 +-
include/asm-sh/cpu_sh7750.h | 254 +-
include/asm-sh/ptrace.h | 2 +-
include/asm-sh/system.h | 32 +-
include/bcm5221.h | 118 +-
include/bedbug/ppc.h | 144 +-
include/bedbug/tables.h | 604 +-
include/clps7111.h | 2 +-
include/command.h | 40 +-
include/commproc.h | 2202 ++++----
include/config_cmd_all.h | 138 +-
include/config_cmd_default.h | 42 +-
include/configs/A3000.h | 22 +-
include/configs/ADNPESC1.h | 648 +-
include/configs/ADNPESC1_base_32.h | 714 ++--
include/configs/AMX860.h | 196 +-
include/configs/APC405.h | 2 +-
include/configs/AR405.h | 208 +-
include/configs/ATUM8548.h | 390 +-
include/configs/Adder.h | 10 +-
include/configs/B2.h | 140 +-
include/configs/CCM.h | 362 +-
include/configs/CPU86.h | 484 +-
include/configs/CRAYL1.h | 12 +-
include/configs/CU824.h | 2 +-
include/configs/DK1C20.h | 400 +-
include/configs/DK1S10.h | 400 +-
include/configs/DK1S10_mtx_ldk_20.h | 256 +-
include/configs/DU440.h | 6 +-
include/configs/EB+MCF-EV123.h | 10 +-
include/configs/EP88x.h | 8 +-
include/configs/ERIC.h | 246 +-
include/configs/ETX094.h | 288 +-
include/configs/EVB64260.h | 10 +-
include/configs/EXBITGEN.h | 152 +-
include/configs/FADS823.h | 270 +-
include/configs/GEN860T.h | 86 +-
include/configs/GENIETV.h | 20 +-
include/configs/GTH.h | 4 +-
include/configs/HH405.h | 226 +-
include/configs/IAD210.h | 14 +-
include/configs/ICU862.h | 374 +-
include/configs/IPHASE4539.h | 240 +-
include/configs/ISPAN.h | 2 +-
include/configs/IVML24.h | 348 +-
include/configs/IVMS8.h | 328 +-
include/configs/IceCube.h | 4 +-
include/configs/M5235EVB.h | 2 +-
include/configs/M5271EVB.h | 2 +-
include/configs/M5272C3.h | 2 +-
include/configs/M5282EVB.h | 8 +-
include/configs/M5329EVB.h | 2 +-
include/configs/M5373EVB.h | 2 +-
include/configs/M5475EVB.h | 2 +-
include/configs/M5485EVB.h | 2 +-
include/configs/MIP405.h | 16 +-
include/configs/MOUSSE.h | 16 +-
include/configs/MPC8313ERDB.h | 24 +-
include/configs/MPC832XEMDS.h | 540 +-
include/configs/MPC8349EMDS.h | 752 ++--
include/configs/MPC8349ITX.h | 26 +-
include/configs/MPC8360ERDK.h | 532 +-
include/configs/MPC8540ADS.h | 22 +-
include/configs/MPC8540EVAL.h | 38 +-
include/configs/MPC8541CDS.h | 24 +-
include/configs/MPC8555CDS.h | 24 +-
include/configs/MPC8560ADS.h | 30 +-
include/configs/MPC8568MDS.h | 34 +-
include/configs/MPC8610HPCD.h | 664 +-
include/configs/MPC8641HPCN.h | 252 +-
include/configs/MPC86xADS.h | 26 +-
include/configs/MUSENKI.h | 2 +-
include/configs/MVBLUE.h | 44 +-
include/configs/MVS1.h | 31 +-
include/configs/NC650.h | 310 +-
include/configs/NETPHONE.h | 550 +-
include/configs/NETTA.h | 550 +-
include/configs/NETTA2.h | 524 +-
include/configs/NETVIA.h | 406 +-
include/configs/NSCU.h | 394 +-
include/configs/NX823.h | 2 +-
include/configs/P3G4.h | 6 +-
include/configs/PATI.h | 42 +-
include/configs/PCI5441.h | 114 +-
include/configs/PIP405.h | 216 +-
include/configs/PM520.h | 2 +-
include/configs/PM826.h | 386 +-
include/configs/PM856.h | 22 +-
include/configs/PN62.h | 262 +-
include/configs/QS823.h | 382 +-
include/configs/QS850.h | 382 +-
include/configs/R360MPI.h | 362 +-
include/configs/RBC823.h | 296 +-
include/configs/RPXClassic.h | 326 +-
include/configs/RPXlite.h | 10 +-
include/configs/RRvision.h | 2 +-
include/configs/Rattler.h | 14 +-
include/configs/SBC8540.h | 2 +-
include/configs/SCM.h | 546 +-
include/configs/SL8245.h | 190 +-
include/configs/SM850.h | 304 +-
include/configs/SXNI855T.h | 326 +-
include/configs/TOP5200.h | 2 +-
include/configs/TOP860.h | 10 +-
include/configs/TQM834x.h | 530 +-
include/configs/Total5200.h | 2 +-
include/configs/VCMA9.h | 180 +-
include/configs/VoVPN-GW.h | 306 +-
include/configs/W7OLMC.h | 8 +-
include/configs/W7OLMG.h | 8 +-
include/configs/ZPC1900.h | 14 +-
include/configs/ads5121.h | 474 +-
include/configs/adsvix.h | 2 +-
include/configs/apollon.h | 218 +-
include/configs/armadillo.h | 6 +-
include/configs/atc.h | 336 +-
include/configs/barco.h | 14 +-
include/configs/bf533-stamp.h | 322 +-
include/configs/bf537-stamp.h | 444 +-
include/configs/bf561-ezkit.h | 17 +-
include/configs/bubinga.h | 2 +-
include/configs/c2mon.h | 356 +-
include/configs/canmb.h | 4 +-
include/configs/cerf250.h | 204 +-
include/configs/cmi_mpc5xx.h | 46 +-
include/configs/cobra5272.h | 4 +-
include/configs/csb226.h | 168 +-
include/configs/csb272.h | 182 +-
include/configs/csb472.h | 182 +-
include/configs/davinci_dvevm.h | 130 +-
include/configs/davinci_schmoogie.h | 104 +-
include/configs/davinci_sonata.h | 126 +-
include/configs/dnp1110.h | 2 +-
include/configs/ep7312.h | 6 +-
include/configs/ep8248.h | 14 +-
include/configs/ep8260.h | 262 +-
include/configs/ep82xxm.h | 16 +-
include/configs/evb4510.h | 110 +-
include/configs/gr_cpci_ax2000.h | 184 +-
include/configs/gr_ep2s60.h | 174 +-
include/configs/gr_xc3s_1500.h | 164 +-
include/configs/grsim.h | 196 +-
include/configs/grsim_leon2.h | 196 +-
include/configs/hcu4.h | 4 +-
include/configs/hcu5.h | 20 +-
include/configs/hermes.h | 230 +-
include/configs/idmr.h | 2 +-
include/configs/impa7.h | 4 +-
include/configs/innokom.h | 10 +-
include/configs/integratorcp.h | 6 +-
include/configs/ixdp425.h | 6 +-
include/configs/ixdpg425.h | 6 +-
include/configs/jupiter.h | 2 +-
include/configs/kilauea.h | 2 +-
include/configs/korat.h | 532 +-
include/configs/lart.h | 2 +-
include/configs/linkstation.h | 26 +-
include/configs/logodl.h | 112 +-
include/configs/makalu.h | 2 +-
include/configs/mcu25.h | 10 +-
include/configs/mecp5200.h | 2 +-
include/configs/mgcoge.h | 14 +-
include/configs/modnet50.h | 3 +-
include/configs/ms7720se.h | 126 +-
include/configs/ms7722se.h | 8 +-
include/configs/ms7750se.h | 8 +-
include/configs/netstar.h | 236 +-
include/configs/ns9750dev.h | 120 +-
include/configs/p3mx.h | 4 +-
include/configs/pcu_e.h | 412 +-
include/configs/pdnb3.h | 282 +-
include/configs/ppmc8260.h | 2 +-
include/configs/r7780mp.h | 102 +-
include/configs/rmu.h | 356 +-
include/configs/rsdproto.h | 14 +-
include/configs/sacsng.h | 2 +-
include/configs/sbc2410x.h | 6 +-
include/configs/sbc8260.h | 2 +-
include/configs/sbc8548.h | 480 +-
include/configs/sbc8641d.h | 24 +-
include/configs/sc520_cdp.h | 2 +-
include/configs/sc520_spunk.h | 8 +-
include/configs/sequoia.h | 622 +-
include/configs/shannon.h | 2 +-
include/configs/smdk2400.h | 8 -
include/configs/smdk2410.h | 114 +-
include/configs/sorcery.h | 248 +-
include/configs/stxgp3.h | 60 +-
include/configs/stxssa.h | 16 +-
include/configs/stxxtc.h | 434 +-
include/configs/svm_sc8xx.h | 10 +-
include/configs/taihu.h | 374 +-
include/configs/trab.h | 412 +-
include/configs/trizepsiv.h | 6 +-
include/configs/uc100.h | 2 +-
include/configs/utx8245.h | 308 +-
include/configs/v37.h | 266 +-
include/configs/versatile.h | 2 +-
include/configs/wepep250.h | 28 +-
include/configs/xaeniax.h | 210 +-
include/configs/xupv2p.h | 10 +-
include/div64.h | 26 +-
include/dm9161.h | 56 +-
include/elf.h | 8 +-
include/fat.h | 208 +-
include/flash.h | 4 +-
include/fpga.h | 42 +-
include/galileo/gt64260R.h | 2054 +++---
include/i2c.h | 28 +-
include/libfdt.h | 692 ++--
include/linux/mtd/bbm.h | 116 +-
include/linux/mtd/doc2000.h | 70 +-
include/linux/mtd/mtd-abi.h | 112 +-
include/linux/mtd/mtd.h | 210 +-
include/linux/mtd/nand_legacy.h | 174 +-
include/linux/mtd/nftl.h | 82 +-
include/lists.h | 14 +-
include/lxt971a.h | 128 +-
include/mpc106.h | 12 +-
include/net.h | 432 +-
include/nios2-epcs.h | 14 +-
include/nios2-io.h | 162 +-
include/ns7520_eth.h | 438 +-
include/ns9750_bbus.h | 142 +-
include/ns9750_eth.h | 268 +-
include/ns9750_mem.h | 46 +-
include/ns9750_ser.h | 260 +-
include/ns9750_sys.h | 38 +-
include/pc_keyb.h | 158 +-
include/ppc405.h | 1726 +++---
include/ppc440.h | 4898 ++++++++--------
include/ppc4xx_enet.h | 692 ++--
include/rtc.h | 28 +-
include/s_record.h | 30 +-
include/scsi.h | 254 +-
include/sed13806.h | 44 +-
include/spartan2.h | 16 +-
include/spartan3.h | 22 +-
include/sym53c8xx.h | 8 +-
include/usbdcore_mpc8xx.h | 246 +-
include/video_easylogo.h | 14 +-
include/video_logo.h | 32 +-
include/virtex2.h | 6 +-
include/xilinx.h | 68 +-
lib_arm/Makefile | 40 +-
lib_arm/_udivsi3.S | 122 +-
lib_arm/_umodsi3.S | 146 +-
lib_blackfin/Makefile | 40 +-
lib_generic/Makefile | 12 +-
lib_generic/string.c | 412 +-
lib_generic/zlib.c | 792 ++--
lib_i386/Makefile | 42 +-
lib_i386/bios.S | 12 +-
lib_i386/bios.h | 48 +-
lib_i386/bios_pci.S | 422 +-
lib_i386/pci.c | 170 +-
lib_i386/pci_type1.c | 16 +-
lib_i386/realmode_switch.S | 60 +-
lib_m68k/Makefile | 24 +-
lib_m68k/board.c | 874 ++--
lib_microblaze/Makefile | 20 +-
lib_mips/Makefile | 18 +-
lib_nios/Makefile | 24 +-
lib_nios/math.h | 2 +-
lib_nios2/Makefile | 22 +-
lib_nios2/math.h | 2 +-
lib_ppc/Makefile | 40 +-
lib_sh/Makefile | 18 +-
lib_sparc/Makefile | 14 +-
libfdt/Makefile | 14 +-
libfdt/README | 16 +-
net/net.c | 2566 ++++----
post/drivers/memory.c | 466 +-
post/lib_ppc/andi.c | 86 +-
post/lib_ppc/cmp.c | 90 +-
post/lib_ppc/cmpi.c | 90 +-
post/lib_ppc/cpu_asm.h | 386 +-
post/lib_ppc/rlwimi.c | 168 +-
post/lib_ppc/rlwinm.c | 158 +-
post/lib_ppc/rlwnm.c | 176 +-
post/lib_ppc/srawi.c | 160 +-
post/lib_ppc/three.c | 288 +-
post/lib_ppc/threei.c | 104 +-
post/lib_ppc/threex.c | 262 +-
post/lib_ppc/twox.c | 184 +-
post/rules.mk | 16 +-
tools/Makefile | 272 +-
tools/easylogo/easylogo.c | 716 ++--
tools/easylogo/linux_logo.tga | Bin 19244 -> 19663 bytes
tools/env/fw_env.h | 18 +-
tools/gdb/remote.c | 804 ++--
1011 files changed, 159852 insertions(+), 159846 deletions(-)
mode change 100755 => 100644 include/configs/apollon.h
[Patch removed because of size; please see
ftp://ftp.denx.de/pub/tmp/big-white-space-cleanup.patch.gz ]
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: wd(a)denx.de
Yes, it's a technical challenge, and you have to kind of admire
people who go to the lengths of actually implementing it, but at the
same time you wonder about their IQ...
-- Linus Torvalds in <5phda5$ml6$1(a)palladium.transmeta.com>
7
21

21 May '08
This patch adds OMAP and SDP3430 documentation.
Signed-off-by: Nishanth Menon<x0nishan(a)ti.com>
---
Documentation/boards.dox | 1
arch/arm/mach-arm.dox | 4 +
arch/arm/mach-omap/arch-omap.dox | 92 +++++++++++++++++++++++++++++++++++++++
3 files changed, 97 insertions(+)
Index: u-boot-v2.git/arch/arm/mach-arm.dox
===================================================================
--- u-boot-v2.git.orig/arch/arm/mach-arm.dox 2008-05-20 16:51:42.000000000 -0500
+++ u-boot-v2.git/arch/arm/mach-arm.dox 2008-05-20 16:55:09.000000000 -0500
@@ -30,4 +30,8 @@
the first C instruction in U-Boot. At this point of time:\n
"runtime address == link address".
+@par Architectures using ARM processors
+For details on specific architectures:
+ - @subpage dev_omap_arch
+
*/
Index: u-boot-v2.git/arch/arm/mach-omap/arch-omap.dox
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ u-boot-v2.git/arch/arm/mach-omap/arch-omap.dox 2008-05-20 16:55:09.000000000 -0500
@@ -0,0 +1,92 @@
+/* This document is intended to provide the developer with information
+ * how to integrate a new OMAP Architecture into this part of the U-Boot tree
+ */
+
+/** @page dev_omap_arch Texas Instrument's OMAP Platforms in U-Boot V2
+
+This document highlights some of the factors for supporting Texas Instrument's OMAP platforms in U-Boot V2.
+
+@par Table of Contents
+@li @ref omap_boards
+@li @ref omap_code_arch
+@li @ref mach_omap
+@li @ref asm_arm
+@li @ref board_omap
+@li @ref omap_boot
+@li @ref board_boot
+
+@section omap_boards Boards using OMAP processors
+
+@li @subpage board/omap/board-sdp343x.c
+
+@section omap_arch Documentation for OMAP Architectures files
+
+@li @subpage arch/arm/mach-omap/omap3_generic.c
+
+@section omap_code_arch How is U-Boot V2 OMAP specific architecture code organized?
+
+To understand the architecture of U-Boot V2 source code for OMAP processors, we need to understand a bit on OMAP itself.
+
+A typical Texas Instrument's Open Multimedia Application Processor (OMAP) solution is built around ARM core with multiple on-the-silicon peripherals. It also has a TI Digital Signal Processor(DSP) and few hardware accelerators to cater to computing intensive applications such as encoder/decoders. See http://focus.ti.com/general/docs/wtbu/wtbugencontent.tsp?templateId=6123&na… for further details.
+
+Essentially, OMAP is modular with on-silicon peripherals being reused across multiple OMAP versions. U-Boot V2 code organization is driven by this fact.
+
+Motivation for code organization is driven from:
+@li Clear distinction between architecture and board features.
+@li Code should be re-usable accross OMAP variants AND board variants.
+
+Code is Organized into three main directories:
+@li arch/arm/mach-omap -contains files for ALL peripherals which are present on board with very few exceptions. We will come to these exceptions in later sections.
+@li include/asm-arm/arch-omap - contains files for ALL OMAP on-silicon peripherals. No Board specific files here please!
+@li board/omap - contains files for ALL boards using OMAP processors.
+
+@section mach_omap arch/arm/mach-omap directory guidelines
+It is rather simple: All common peripherals should be isolated as separate driver libraries as far as possible. Exceptions such as clock configuration code may be isolated by the following naming convention: omapX_function_name.[cS], where X belongs to the OMAP variant. The exception is for devices who have existing code locations - potentially drivers/i2c/busses and the like.
+
+All basic devices you'd like to register should be put here with postcore_initcall from architecture files
+
+@section asm_arm include/asm-arm/arch-omap directory guidelines
+All OMAP common headers are located here. Where we have to incorporate a OMAP variant specific header, add a omapX_function_name.h.
+@warning Do not add board specific header files/information here. Put them in mach-omap.
+
+include/asm-arm/arch-omap/silicon.h contains includes for omapX-silicon.h which defines the base addresses for the peripherals on that platform. the usual convention is to use #define OMAP_SOMETHING_BASE to allow re-use.
+
+@section board_omap board/omap directory guidelines
+All Board specific files go here. In U-Boot V1, we always had to use common config file which is shared by other drivers to get serial, ethernet baseaddress etc.. we can easily use the device_d structure to handle it with U-Boot V2. This is more like programming for Linux kernel - it is pretty easy.
+Each specific board file has board-XYZ.c and potentially and equivalent h file.
+
+We'd potentially use device_initcall and console_initcalls as required.
+
+@section omap_boot The OMAP boot path
+The normal flow is to look for arch_init_lowlevel in the required code. This would be the first function to be called after the ARM common code boots up(arch/arm/cpu/start-arm.S), the job of boot code on OMAP platform would be to preventing watchdog timer from kicking in and spoiling all the fun, setup OMAP clocks to the high performance mode, do other architecture specific initializations. There could be some additional stuff we may need to do based on the specific OMAP we support including setting up a usable interrupt vector table etc - some parts of the code may be desired to be in C code (to let normal humans understand without being an asm junkie), in such a case, U-Boot's stack setup is not ready yet, and we may need to setup a temporary SRAM based stack prior to execution. Some things to keep in mind while handling booting code, we might be executing in eXecute In Place (XIP) mode and that only an SRAM stack is setup. Using global variables or using constructs that create function jump tables is doomed to fail as the required area might not be writable or may not be even initialized. So code in this area tends to use lots of if conditions and local variables. Having C code doing the fun part is easy to maintain, so it is advisable to push as much as possible to C functions where possible.
+
+The responsibility of arch_init_lowlevel and related calls is to setup OMAP. No board specific initializations are to be done here.
+
+Once this is past, the code returns back to arm common code (cpu/start-arm.S). Here Instruction and Data caches are disabled. The execution proceeds to normal board initialization.
+
+@section board_boot The board boot path
+If the proper CONFIG_MACH_DO_LOWLEVEL_INIT flag is setup, board_init_lowlevel is called. This again would call a common file board/omap/platform.S which setups a temporary SRAM stack and bumps the control to board_init.
+Every Board in OMAP platform can potentially define a board_init and enable defconfig in arch/arm/configs directory. The responsibility here is to setup OMAP for board configurations - this includes SDRAM configuration and pin muxing configuration.
+
+Once this is complete, U-boot V2 boot process proceeds by calling init functions and finally entering shell prompt
+
+board-XYZ file may potentially register every device it is interested in. You can check out how the code is organized in other board directories also, esentially, the method is as simple as:
+@code
+static struct device_d my_little_device = {
+ .name = "driver_name",
+ .id = "some_unique_id",
+ .platform_data = &any_driver_specific_data,
+ .type = Type_of_device,
+ };
+static int my_board_devices_init(void) {
+ /* Do Blah Blah Blah */
+ return register_device(&my_little_device);
+}
+
+device_initcall(my_board_devices_init);
+@endcode
+
+You may probably be interested in calling console_initcall to get a console.. Modify board/omap/Kconfig to add your OMAP board, create a defconfig, do a make C=2 to enable sparse warnings, you can potentially have a binary done in no time! if you remember to put doxygen comments in your code, you can do a make docs and get the documentation done too..
+
+
+*/
Index: u-boot-v2.git/Documentation/boards.dox
===================================================================
--- u-boot-v2.git.orig/Documentation/boards.dox 2008-05-20 16:51:42.000000000 -0500
+++ u-boot-v2.git/Documentation/boards.dox 2008-05-20 16:55:09.000000000 -0500
@@ -13,6 +13,7 @@
- @subpage imx27ads
- @subpage scb9328
- @subpage netx
+- @subpage dev_omap_arch
Blackfin type:
1
0