[U-Boot-Users] [PATCH 1/1] Initial skeleton framework for AMCC 460SX (Redwood) reference board.

fkan at amcc.com fkan at amcc.com
Fri Jun 27 20:01:03 CEST 2008


From: Feng Kan <fkan at amcc.com>

Hi Stefan:
   I have addressed most of the issues except two.
   - I removed get_emac_phy_config, the board will use dip switch
     to determine if the bridge will be GMII or RGMII. I will submit
     it later when it is more mature.
   - I would like to keep redwood.h. It seems one of the guys have
     PCIe.c file that source this file. There will be alot more defines
     in this file. If you think this is still a problem. I will
     merge the redwood.h into redwood.c.

Thanks


Signed-off-by:Feng Kan <fkan at amcc.com>

The AMCC Redwood reference board uses the latest PowerPC 464 CPU
processor combined with a rich mix of peripheral controllers. The
board will support PCIe, mutiple Gig ethernet ports, advanced
hardware RAID assistance and IEEE 1588.

---
 MAINTAINERS                    |    4 +
 MAKEALL                        |    1 +
 Makefile                       |    3 +
 board/amcc/redwood/Makefile    |   50 ++++
 board/amcc/redwood/config.mk   |   42 +++
 board/amcc/redwood/init.S      |   77 +++++
 board/amcc/redwood/redwood.c   |  634 ++++++++++++++++++++++++++++++++++++++++
 board/amcc/redwood/redwood.h   |   50 ++++
 board/amcc/redwood/u-boot.lds  |  147 +++++++++
 cpu/ppc4xx/44x_spd_ddr2.c      |    3 +-
 cpu/ppc4xx/cpu.c               |   33 ++
 cpu/ppc4xx/speed.c             |    3 +-
 cpu/ppc4xx/start.S             |   19 +-
 include/asm-ppc/ppc4xx-sdram.h |    3 +-
 include/asm-ppc/processor.h    |    4 +
 include/configs/redwood.h      |  211 +++++++++++++
 include/ppc440.h               |  124 ++++++++-
 include/ppc4xx.h               |    3 +-
 18 files changed, 1397 insertions(+), 14 deletions(-)
 create mode 100644 board/amcc/redwood/Makefile
 create mode 100644 board/amcc/redwood/config.mk
 create mode 100644 board/amcc/redwood/init.S
 create mode 100644 board/amcc/redwood/redwood.c
 create mode 100644 board/amcc/redwood/redwood.h
 create mode 100644 board/amcc/redwood/u-boot.lds
 create mode 100644 include/configs/redwood.h

diff --git a/MAINTAINERS b/MAINTAINERS
index a3d70b1..cb49a5d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -420,6 +420,10 @@ Guennadi Liakhovetski <g.liakhovetski at gmx.de>
 
 	linkstation		MPC8241
 
+Feng Kan <fkan at amcc.com>
+
+	redwood			PPC460SX
+
 -------------------------------------------------------------------------
 
 Unknown / orphaned boards:
diff --git a/MAKEALL b/MAKEALL
index 32caab7..566e63a 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -221,6 +221,7 @@ LIST_4xx="		\
 	PPChameleonEVB	\
 	quad100hd	\
 	rainier		\
+	redwood		\
 	sbc405		\
 	sc3		\
 	sequoia		\
diff --git a/Makefile b/Makefile
index 8bfc891..ff38e0c 100644
--- a/Makefile
+++ b/Makefile
@@ -1417,6 +1417,9 @@ rainier_nand_config: unconfig
 	@echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/sequoia/config.tmp
 	@echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
 
+redwood_config: unconfig
+	@$(MKCONFIG) $(@:_config=) ppc ppc4xx redwood amcc
+
 sc3_config:unconfig
 	@$(MKCONFIG) $(@:_config=) ppc ppc4xx sc3
 
diff --git a/board/amcc/redwood/Makefile b/board/amcc/redwood/Makefile
new file mode 100644
index 0000000..a8bdb05
--- /dev/null
+++ b/board/amcc/redwood/Makefile
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2008
+# Feng Kan, Applied Micro Circuits Corp., fkan at amcc.com.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).a
+
+COBJS	= $(BOARD).o 
+SOBJS	= init.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak .depend *~
+
+#########################################################################
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/amcc/redwood/config.mk b/board/amcc/redwood/config.mk
new file mode 100644
index 0000000..531d9d3
--- /dev/null
+++ b/board/amcc/redwood/config.mk
@@ -0,0 +1,42 @@
+#
+# (C) Copyright 2008
+# Feng Kan, Applied Micro Circuits Corp., fkan at amcc.com.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+#
+# AMCC 460SX Reference Platform (redwood) board
+#
+
+ifeq ($(ramsym),1)
+TEXT_BASE = 0x07FD0000
+else
+TEXT_BASE = 0xfffb0000
+endif
+
+PLATFORM_CPPFLAGS += -DCONFIG_440=1 
+
+ifeq ($(debug),1)
+PLATFORM_CPPFLAGS += -DDEBUG
+endif
+
+ifeq ($(dbcr),1)
+PLATFORM_CPPFLAGS += -DCFG_INIT_DBCR=0x8cff0000
+endif
diff --git a/board/amcc/redwood/init.S b/board/amcc/redwood/init.S
new file mode 100644
index 0000000..876f96a
--- /dev/null
+++ b/board/amcc/redwood/init.S
@@ -0,0 +1,77 @@
+/*
+ * (C) Copyright 2008
+ * Feng Kan, Applied Micro Circuits Corp., fkan at amcc.com.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <ppc_asm.tmpl>
+#include <config.h>
+#include <asm-ppc/mmu.h>
+
+/**************************************************************************
+ * TLB TABLE
+ *
+ * This table is used by the cpu boot code to setup the initial tlb
+ * entries. Rather than make broad assumptions in the cpu source tree,
+ * this table lets each board set things up however they like.
+ *
+ *  Pointer to the table is returned in r1
+ *
+ *************************************************************************/
+
+	.section .bootpg,"ax"
+	.globl tlbtab
+tlbtab:
+	tlbtab_start
+
+	/*
+	 * BOOT_CS (FLASH) must be first. Before relocation SA_I can be off to use the
+	 * speed up boot process. It is patched after relocation to enable SA_I
+	 */
+	tlbentry(0xff000000, SZ_16M, 0xff000000, 4, AC_R|AC_W|AC_X|SA_G)
+
+	/*
+	 * TLB entries for SDRAM are not needed on this platform.
+	 * They are dynamically generated in the SPD DDR(2) detection
+	 * routine.
+	 */
+
+	/* Although 512 KB, map 256k at a time */
+	tlbentry(CFG_ISRAM_BASE, SZ_256K, 0x00000000, 4, AC_R|AC_W|AC_X|SA_I)
+	tlbentry(CFG_ISRAM_BASE + 0x40000, SZ_256K, 0x00040000, 4, AC_R|AC_W|AC_X|SA_I)
+
+	tlbentry(CFG_OPER_FLASH, SZ_16M, 0xE7000000, 4,AC_R|AC_W|AC_X|SA_G|SA_I)
+	
+	/*
+	 * Peripheral base 
+	 */
+	tlbentry(CFG_PERIPHERAL_BASE, SZ_16K, 0xEF600000, 4, AC_R|AC_W|SA_G|SA_I)
+
+	tlbentry(CFG_PCIE0_XCFGBASE,SZ_16M, 0x00000000, 0xC, AC_R|AC_W|SA_G|SA_I) 
+	tlbentry(CFG_PCIE1_XCFGBASE,SZ_16M, 0x10000000, 0xC, AC_R|AC_W|SA_G|SA_I) 
+	tlbentry(CFG_PCIE2_XCFGBASE,SZ_16M, 0x20000000, 0xC, AC_R|AC_W|SA_G|SA_I) 
+    
+	tlbentry(CFG_PCIE0_MEMBASE, SZ_256M, 0x00000000, 0xD, AC_R|AC_W|SA_G|SA_I)
+	tlbentry(CFG_PCIE1_MEMBASE, SZ_256M, 0x00000000, 0xE, AC_R|AC_W|SA_G|SA_I)
+
+	tlbentry(CFG_PCIE0_REGBASE, SZ_64K, 0x30000000, 0xC, AC_R|AC_W|SA_G|SA_I)
+	tlbentry(CFG_PCIE1_REGBASE, SZ_64K, 0x30010000, 0xC, AC_R|AC_W|SA_G|SA_I)
+	tlbentry(CFG_PCIE2_REGBASE, SZ_64K, 0x30020000, 0xC, AC_R|AC_W|SA_G|SA_I)
+	tlbtab_end
diff --git a/board/amcc/redwood/redwood.c b/board/amcc/redwood/redwood.c
new file mode 100644
index 0000000..d1df392
--- /dev/null
+++ b/board/amcc/redwood/redwood.c
@@ -0,0 +1,634 @@
+/*
+ * This is the main board level file for the Redwood AMCC board.
+ * 
+ * (C) Copyright 2008
+ * Feng Kan, Applied Micro Circuits Corp., fkan at amcc.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#include <common.h>
+#include "redwood.h"
+#include <ppc4xx.h>
+#include <asm/processor.h>
+#include <i2c.h>
+#include <asm-ppc/io.h>
+
+int compare_to_true(char *str);
+char *remove_l_w_space(char *in_str);
+char *remove_t_w_space(char *in_str);
+int get_console_port(void);
+
+static void early_init_EBC(void);
+static int bootdevice_selected(void);
+static void early_reinit_EBC(int);
+static void early_init_UIC(void);
+
+/*----------------------------------------------------------------------------+
+| Define Boot devices
++----------------------------------------------------------------------------*/
+#define BOOT_FROM_8BIT_SRAM			0x00
+#define BOOT_FROM_16BIT_SRAM			0x01
+#define BOOT_FROM_32BIT_SRAM			0x02
+#define BOOT_FROM_8BIT_NAND			0x03
+#define BOOT_FROM_16BIT_NOR			0x04
+#define BOOT_DEVICE_UNKNOWN			0xff
+
+/*----------------------------------------------------------------------------+
+| EBC Devices Characteristics
+|   Peripheral Bank Access Parameters       -   EBC_BxAP
+|   Peripheral Bank Configuration Register  -   EBC_BxCR
++----------------------------------------------------------------------------*/
+
+/*
+ * 8 bit width SRAM
+ * BU Value
+ * BxAP : 0x03800000  - 0 00000111 0 00 00 00 00 00 000 0 0 0 0 00000
+ * B0CR : 0xff098000  - BAS = ff0 - 100 11 00 0000000000000
+ * B2CR : 0xe7098000  - BAS = e70 - 100 11 00 0000000000000
+ */
+#define EBC_BXAP_8BIT_SRAM              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(0)   | \
+                                        EBC_BXAP_RE_DISABLED    | \
+                                        EBC_BXAP_SOR_DELAYED    | \
+                                        EBC_BXAP_BEM_WRITEONLY  | \
+                                        EBC_BXAP_PEN_DISABLED
+
+#define EBC_BXAP_16BIT_SRAM	EBC_BXAP_8BIT_SRAM
+#define EBC_BXAP_32BIT_SRAM	EBC_BXAP_8BIT_SRAM
+
+/*
+ * NAND flash
+ * BU Value
+ * BxAP : 0x048ff240  - 0 00000111 0 00 00 00 00 00 000 0 0 0 0 00000
+ * B0CR : 0xff09a000  - BAS = ff0 - 100 11 01 0000000000000
+ * B2CR : 0xe709a000  - BAS = e70 - 100 11 01 0000000000000
+*/
+#define EBC_BXAP_NAND                   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(0)   | \
+                                        EBC_BXAP_RE_DISABLED    | \
+                                        EBC_BXAP_SOR_DELAYED    | \
+                                        EBC_BXAP_BEM_WRITEONLY  | \
+                                        EBC_BXAP_PEN_DISABLED
+
+/*
+ * NOR flash
+ * BU Value
+ * BxAP : 0x048ff240  - 0 00000111 0 00 00 00 00 00 000 0 0 0 0 00000
+ * B0CR : 0xff09a000  - BAS = ff0 - 100 11 01 0000000000000
+ * B2CR : 0xe709a000  - BAS = e70 - 100 11 01 0000000000000
+*/
+#define EBC_BXAP_NOR                    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(0)   | \
+                                        EBC_BXAP_RE_DISABLED    | \
+                                        EBC_BXAP_SOR_DELAYED    | \
+                                        EBC_BXAP_BEM_WRITEONLY  | \
+                                        EBC_BXAP_PEN_DISABLED
+
+/*
+ * FPGA
+ * BU value :
+ * B1AP = 0x05895240  - 0 00001011 0 00 10 01 01 01 001 0 0 1 0 00000
+ * B1CR = 0xe201a000  - BAS = e20 - 000 11 01 00000000000000
+ */
+#define EBC_BXAP_FPGA                   EBC_BXAP_BME_DISABLED   | \
+                                        EBC_BXAP_TWT_ENCODE(11) | \
+                                        EBC_BXAP_BCE_DISABLE    | \
+                                        EBC_BXAP_BCT_2TRANS     | \
+                                        EBC_BXAP_CSN_ENCODE(10) | \
+                                        EBC_BXAP_OEN_ENCODE(1)  | \
+                                        EBC_BXAP_WBN_ENCODE(1)  | \
+                                        EBC_BXAP_WBF_ENCODE(1)  | \
+                                        EBC_BXAP_TH_ENCODE(1)   | \
+                                        EBC_BXAP_RE_DISABLED    | \
+                                        EBC_BXAP_SOR_DELAYED    | \
+                                        EBC_BXAP_BEM_RW         | \
+                                        EBC_BXAP_PEN_DISABLED
+
+#define EBC_BXCR_8BIT_SRAM_CS0          EBC_BXCR_BAS_ENCODE(0xFFE00000) | \
+                                        EBC_BXCR_BS_1MB                 | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_8BIT
+
+#define EBC_BXCR_32BIT_SRAM_CS0         EBC_BXCR_BAS_ENCODE(0xFFC00000) | \
+                                        EBC_BXCR_BS_1MB                 | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_32BIT
+
+#define EBC_BXCR_NAND_CS0               EBC_BXCR_BAS_ENCODE(0xFF000000) | \
+                                        EBC_BXCR_BS_16MB               | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_8BIT
+
+#define EBC_BXCR_16BIT_SRAM_CS0         EBC_BXCR_BAS_ENCODE(0xFFE00000) | \
+                                        EBC_BXCR_BS_2MB                 | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_16BIT
+
+#define EBC_BXCR_NOR_CS0                EBC_BXCR_BAS_ENCODE(0xFF000000) | \
+                                        EBC_BXCR_BS_16MB                | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_16BIT
+
+#define EBC_BXCR_NOR_CS1                EBC_BXCR_BAS_ENCODE(0xE0000000) | \
+                                        EBC_BXCR_BS_128MB               | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_16BIT
+
+#define EBC_BXCR_NAND_CS1               EBC_BXCR_BAS_ENCODE(0xE0000000) | \
+                                        EBC_BXCR_BS_128MB               | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_8BIT
+
+#define EBC_BXCR_NAND_CS2               EBC_BXCR_BAS_ENCODE(0xC0000000) | \
+                                        EBC_BXCR_BS_128MB                | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_8BIT
+
+#define EBC_BXCR_SRAM_CS2               EBC_BXCR_BAS_ENCODE(0xC0000000) | \
+                                        EBC_BXCR_BS_4MB                | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_32BIT
+
+#define EBC_BXCR_LARGE_FLASH_CS2        EBC_BXCR_BAS_ENCODE(0xE7000000) | \
+                                        EBC_BXCR_BS_16MB                | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_16BIT
+
+#define EBC_BXCR_FPGA_CS3               EBC_BXCR_BAS_ENCODE(0xe2000000) | \
+                                        EBC_BXCR_BS_1MB                 | \
+                                        EBC_BXCR_BU_RW                  | \
+                                        EBC_BXCR_BW_16BIT
+
+/*****************************************************************************
+ * UBOOT initiated board specific function calls
+ ****************************************************************************/
+
+int board_early_init_f(void)
+{
+	int computed_boot_device = BOOT_DEVICE_UNKNOWN;
+
+	/*
+	 * Initialise EBC
+	 */
+	early_init_EBC();
+
+	/*
+	 * Determine which boot device was selected
+	 */
+	computed_boot_device = bootdevice_selected();
+
+	/*
+	 * Reinit EBC based on selected boot device
+	 */
+	early_reinit_EBC(computed_boot_device);
+
+	/*
+	 * Setup for UIC on 460SX redwood board
+	 */
+	early_init_UIC();
+
+	return 0;
+}
+
+int checkboard(void)
+{
+	char *s = getenv("serial#");
+
+	printf("Board: Redwood - AMCC 460SX Reference Board");
+	if (s != NULL) {
+		puts(", serial# ");
+		puts(s);
+	}
+	putc('\n');
+
+	return 0;
+}
+
+static void early_init_EBC(void)
+{
+	/*-------------------------------------------------------------------+
+	| Initialize EBC CONFIG -
+	| Keep the Default value, but the bit PDT which has to be set to 1 ?TBC
+	| default value :
+	|      0x07C00000 - 0 0 000 1 1 1 1 1 0000 0 00000 000000000000
+	|
+	+-------------------------------------------------------------------*/
+	mtebc(xbcfg, EBC_CFG_LE_UNLOCK |
+	      EBC_CFG_PTD_ENABLE |
+	      EBC_CFG_RTC_16PERCLK |
+	      EBC_CFG_ATC_PREVIOUS |
+	      EBC_CFG_DTC_PREVIOUS |
+	      EBC_CFG_CTC_PREVIOUS |
+	      EBC_CFG_OEO_PREVIOUS |
+	      EBC_CFG_EMC_DEFAULT | EBC_CFG_PME_DISABLE | EBC_CFG_PR_16);
+
+	/*-------------------------------------------------------------------+
+         |
+         |  PART 1 : Initialize EBC Bank 3
+         |  ==============================
+         | Bank1 is always associated to the EPLD.
+         | It has to be initialized prior to other banks settings computation
+         | since some board registers values may be needed to determine the
+         | boot type
+         |
+         +-------------------------------------------------------------------*/
+	mtebc(pb1ap, EBC_BXAP_FPGA);
+	mtebc(pb1cr, EBC_BXCR_FPGA_CS3);
+
+}
+
+static int bootdevice_selected(void)
+{
+	unsigned long sdr0_pinstp;
+	unsigned long bootstrap_settings;
+	int computed_boot_device = BOOT_DEVICE_UNKNOWN;
+
+	/*-------------------------------------------------------------------+
+         |
+         |  Determine which boot device was selected
+         |  =================================================
+         |
+         |  Read Pin Strap Register in PPC460SX
+         |  Result can either be :
+         |   - Boot strap = boot from EBC 8bits     => Small Flash
+         |   - Boot strap = boot from PCI
+         |   - Boot strap = IIC
+         |  In case of boot from IIC, read Serial Device Strap Register1
+         |
+         |  Result can either be :
+         |   - Boot from EBC  - EBC Bus Width = 8bits    => Small Flash
+         |   - Boot from EBC  - EBC Bus Width = 16bits   => Large Flash or SRAM
+         |   - Boot from PCI
+         |
+         +-------------------------------------------------------------------*/
+	/* Read Pin Strap Register in PPC460SX */
+	mfsdr(SDR0_PINSTP, sdr0_pinstp);
+	bootstrap_settings = sdr0_pinstp & SDR0_PSTRP0_BOOTSTRAP_MASK;
+
+	switch (bootstrap_settings) {
+	case SDR0_PSTRP0_BOOTSTRAP_SETTINGS0:
+		/*
+		 * Boot from SRAM, 8bit width
+		 */
+		computed_boot_device = BOOT_FROM_8BIT_SRAM;
+		break;
+	case SDR0_PSTRP0_BOOTSTRAP_SETTINGS1:
+		/*
+		 * Boot from SRAM, 32bit width
+		 */
+		computed_boot_device = BOOT_FROM_32BIT_SRAM;
+		break;
+	case SDR0_PSTRP0_BOOTSTRAP_SETTINGS2:
+		/*
+		 * Boot from NAND, 8bit width
+		 */
+		computed_boot_device = BOOT_FROM_8BIT_NAND;
+		break;
+	case SDR0_PSTRP0_BOOTSTRAP_SETTINGS4:
+		/*
+		 * Boot from SRAM, 16bit width
+		 * Boot setting in IIC EEPROM 0x50
+		 */
+		computed_boot_device = BOOT_FROM_16BIT_SRAM;
+		break;
+	case SDR0_PSTRP0_BOOTSTRAP_SETTINGS5:
+		/*
+		 * Boot from NOR, 16bit width
+		 * Boot setting in IIC EEPROM 0x54
+		 */
+		computed_boot_device = BOOT_FROM_16BIT_NOR;
+		break;
+	default:
+		/* should not be */
+		computed_boot_device = BOOT_DEVICE_UNKNOWN;
+		break;
+	}
+
+	return computed_boot_device;
+}
+
+static void early_reinit_EBC(int computed_boot_device)
+{
+	/*-------------------------------------------------------------------+
+         |
+         |  Compute EBC settings depending on selected boot device
+         |  ======   ======================================================
+         |
+         | Resulting EBC init will be among following configurations :
+         |
+         |  - Boot from EBC 8bits => boot from Small Flash selected
+         |            EBC-CS0     = Small Flash
+         |            EBC-CS2     = Large Flash and SRAM
+         |
+         |  - Boot from EBC 16bits => boot from Large Flash or SRAM
+         |            EBC-CS0     = Large Flash or SRAM
+         |            EBC-CS2     = Small Flash
+         |
+         |  - Boot from PCI
+         |            EBC-CS0     = not initialized to avoid address contention
+         |            EBC-CS2     = same as boot from Small Flash selected
+         |
+         +-------------------------------------------------------------------*/
+	unsigned long ebc0_cs0_bxap_value = 0, ebc0_cs0_bxcr_value = 0;
+	unsigned long ebc0_cs1_bxap_value = 0, ebc0_cs1_bxcr_value = 0;
+	unsigned long ebc0_cs2_bxap_value = 0, ebc0_cs2_bxcr_value = 0;
+
+	switch (computed_boot_device) {
+		/*-------------------------------------------------------------------*/
+	case BOOT_FROM_8BIT_SRAM:
+		/*-------------------------------------------------------------------*/
+		ebc0_cs0_bxap_value = EBC_BXAP_8BIT_SRAM;
+		ebc0_cs0_bxcr_value = EBC_BXCR_8BIT_SRAM_CS0;
+		ebc0_cs1_bxap_value = EBC_BXAP_NOR;
+		ebc0_cs1_bxcr_value = EBC_BXCR_NOR_CS1;
+		ebc0_cs2_bxap_value = EBC_BXAP_NAND;
+		ebc0_cs2_bxcr_value = EBC_BXCR_NAND_CS2;
+		break;
+
+		/*-------------------------------------------------------------------*/
+	case BOOT_FROM_16BIT_SRAM:
+		/*-------------------------------------------------------------------*/
+		ebc0_cs0_bxap_value = EBC_BXAP_16BIT_SRAM;
+		ebc0_cs0_bxcr_value = EBC_BXCR_16BIT_SRAM_CS0;
+		ebc0_cs1_bxap_value = EBC_BXAP_NOR;
+		ebc0_cs1_bxcr_value = EBC_BXCR_NOR_CS1;
+		ebc0_cs2_bxap_value = EBC_BXAP_NAND;
+		ebc0_cs2_bxcr_value = EBC_BXCR_NAND_CS2;
+		break;
+
+		/*-------------------------------------------------------------------*/
+	case BOOT_FROM_32BIT_SRAM:
+		/*-------------------------------------------------------------------*/
+		ebc0_cs0_bxap_value = EBC_BXAP_32BIT_SRAM;
+		ebc0_cs0_bxcr_value = EBC_BXCR_32BIT_SRAM_CS0;
+		ebc0_cs1_bxap_value = EBC_BXAP_NOR;
+		ebc0_cs1_bxcr_value = EBC_BXCR_NOR_CS1;
+		ebc0_cs2_bxap_value = EBC_BXAP_NAND;
+		ebc0_cs2_bxcr_value = EBC_BXCR_NAND_CS2;
+		break;
+
+		/*-------------------------------------------------------------------*/
+	case BOOT_FROM_16BIT_NOR:
+		/*-------------------------------------------------------------------*/
+		ebc0_cs0_bxap_value = EBC_BXAP_NOR;
+		ebc0_cs0_bxcr_value = EBC_BXCR_NOR_CS0;
+		ebc0_cs1_bxap_value = EBC_BXAP_NAND;
+		ebc0_cs1_bxcr_value = EBC_BXCR_NAND_CS1;
+		ebc0_cs2_bxap_value = EBC_BXAP_32BIT_SRAM;
+		ebc0_cs2_bxcr_value = EBC_BXCR_SRAM_CS2;
+		break;
+
+		/*-------------------------------------------------------------------*/
+	case BOOT_FROM_8BIT_NAND:
+		/*-------------------------------------------------------------------*/
+		ebc0_cs0_bxap_value = EBC_BXAP_NAND;
+		ebc0_cs0_bxcr_value = EBC_BXCR_NAND_CS0;
+		ebc0_cs1_bxap_value = EBC_BXAP_NOR;
+		ebc0_cs1_bxcr_value = EBC_BXCR_NOR_CS1;
+		ebc0_cs2_bxap_value = EBC_BXAP_32BIT_SRAM;
+		ebc0_cs2_bxcr_value = EBC_BXCR_SRAM_CS2;
+		break;
+
+		/*-------------------------------------------------------------------*/
+	default:
+		/*-------------------------------------------------------------------*/
+		/* BOOT_DEVICE_UNKNOWN */
+		break;
+	}
+
+	mtebc(pb0ap, ebc0_cs0_bxap_value);
+	mtebc(pb0cr, ebc0_cs0_bxcr_value);
+	mtebc(pb1ap, ebc0_cs1_bxap_value);
+	mtebc(pb1cr, ebc0_cs1_bxcr_value);
+	mtebc(pb2ap, ebc0_cs2_bxap_value);
+	mtebc(pb2cr, ebc0_cs2_bxcr_value);
+}
+
+static void early_init_UIC(void)
+{
+	/*--------------------------------------------------------------------+
+         | Interrupt controller setup for the AMCC 460SX Evaluation board.
+         +--------------------------------------------------------------------+
+        +---------------------------------------------------------------------+
+        |Interrupt| Source                            | Pol.  | Sensi.| Crit. |
+        +---------+-----------------------------------+-------+-------+-------+
+        | IRQ 00  | UART0                             | High  | Level | Non   |
+        | IRQ 01  | UART1                             | High  | Level | Non   |
+        | IRQ 02  | IIC0                              | High  | Level | Non   |
+        | IRQ 03  | IIC1                              | High  | Level | Non   |
+        | IRQ 04  | Enhanced DMA Complete Queue A     | High  | Level | Non   |
+        | IRQ 05  | Enhanced DMA Complete Queue B     | High  | Level | Non   |
+        | IRQ 06  | Enhanced DMA Error                | High  | Level | Non   |
+        | IRQ 07  | Peripheral DMA 0/1                | High  | Level | Non   |
+        | IRQ 08  | I2O Completion Queue Not Empty    | High  | Level | Non   |
+        | IRQ 09  | External IRQ 0                    | pgm H | Pgm   | Non   |
+        | IRQ 10  | UIC2 Non-critical Int.            | NA    | NA    | Non   |
+        | IRQ 11  | UIC2 Critical Interrupt           | NA    | NA    | Crit  |
+        | IRQ 12  | PCI Express MSI Level 0           | Rising| Edge  | Non   |
+        | IRQ 13  | PCI Express MSI Level 1           | Rising| Edge  | Non   |
+        | IRQ 14  | PCI Express MSI Level 2           | Rising| Edge  | Non   |
+        | IRQ 15  | PCI Express MSI Level 3           | Rising| Edge  | Non   |
+        | IRQ 16  | UIC3 Non-critical Int.            | NA    | NA    | Non   |
+        | IRQ 17  | UIC3 Critical Interrupt           | NA    | NA    | Crit  |
+        | IRQ 18  | External IRQ 1                    | Pgm   | Pgm   | Non   |
+        | IRQ 19  | EMAC0                             | High  | Level | Non   |
+        | IRQ 20  | EMAC1                             | High  | Level | Non   |
+        | IRQ 21  | EMAC2                             | High  | Level | Non   |
+        | IRQ 22  | EMAC3                             | High  | Level | Non   |
+        | IRQ 23  | I2O Inbound Doorbell              | High  | Level | Non   |
+        | IRQ 24  | Inbound Post List FIFO Not Empt   | High  | Level | Non   |
+        | IRQ 25  | Crypto engine interrupt           | Low   | Both  | Non   |
+        | IRQ 26  | PKA[2] - Sequencer Ready          | High  | Edge  | Non   |
+        | IRQ 27  | PKA[1] - Combine PKCP/Seq Ready   | High  | Edge  | Non   |
+        | IRQ 28  | PKA[0] - LNME ready               | High  | Edge  | Non   |
+        | IRQ 29  | GPT Down Count Timer              | Rising| Edge  | Non   |
+        | IRQ 30  | UIC1 Non-critical Int.            | NA    | NA    | Non   |
+        | IRQ 31  | UIC1 Critical Interrupt           | NA    | NA    | Crit. |
+        |----------------------------------------------------------------------
+        | IRQ 32  | Ext. IRQ 2                        | pgm   | pgm   | Non   |
+        | IRQ 33  | MAL Serr                          | High  | Level | Non   |
+        | IRQ 34  | MAL Txde                          | High  | Level | Non   |
+        | IRQ 35  | MAL Rxde                          | High  | Level | Non   |
+        | IRQ 36  | NAND Flash IRQ                    | High  | Edge  | Non   |
+        | IRQ 37  | EBC                               | High  |Lvl Edg| Non   |
+        | IRQ 38  | MAL TX EOB                        | High  | Level | Non   |
+        | IRQ 39  | MAL RX EOB                        | High  | Level | Non   |
+        | IRQ 40  | Memory Queue CDB Error            | High  | Level | Non   |
+        | IRQ 41  | Uncorectable ECC Memory Error     | High  | Level | Non   |
+        | IRQ 42  | Corectable ECC Memory Error       | High  |Lvl Edg| Non   |
+        | IRQ 43  | L2 Cache                          | Risin | Edge  | Non   |
+        | IRQ 44  | GPT Compare Timer 0               | Risin | Edge  | Non   |
+        | IRQ 45  | GPT Compare Timer 1               | Risin | Edge  | Non   |
+        | IRQ 46  | GPT Compare Timer 2               | Risin | Edge  | Non   |
+        | IRQ 47  | GPT Compare Timer 3               | Risin | Edge  | Non   |
+        | IRQ 48  | GPT Compare Timer 4               | Risin | Edge  | Non   |
+        | IRQ 49  | GPT Compare Timer 5               | Risin | Edge  | Non   |
+        | IRQ 50  | GPT Compare Timer 6               | Risin | Edge  | Non   |
+        | IRQ 51  | I20 Error                         | High  | Level | Non   |
+        | IRQ 52  | Serial ROM Error                  | High  | Level | Non   |
+        | IRQ 53  | EIP-PKP PLB Slave Error           | High  | Level | Non   |
+        | IRQ 54  | I2O Region 0 Low Latency PLB W Hit| High  | Level | Non   |
+        | IRQ 55  | I2O Region 1 Low Latency PLB R Hit| High  | Level | Non   |
+        | IRQ 56  | MAL Interrupt Coalescence TX0     | Risin | Edge  | Non   |
+        | IRQ 57  | MAL Interrupt Coalescence TX1     | Risin | Edge  | Non   |
+        | IRQ 58  | MAL Interrupt Coalescence TX2     | Risin | Edge  | Non   |
+        | IRQ 59  | MAL Interrupt Coalescence TX3     | Risin | Edge  | Non   |
+        | IRQ 60  | MAL Interrupt Coalescence RX0     | Risin | Edge  | Non   |
+        | IRQ 61  | MAL Interrupt Coalescence RX1     | Risin | Edge  | Non   |
+        | IRQ 62  | MAL Interrupt Coalescence RX2     | Risin | Edge  | Non   |
+        | IRQ 63  | MAL Interrupt Coalescence RX3     | Risin | Edge  | Non   |
+        |----------------------------------------------------------------------
+        | IRQ 64  | PE0 AL                            | High  | Level | Non   |
+        | IRQ 65  | PE0 AL Secondary                  | Risin | Edge  | Non   |
+        | IRQ 66  | PE0 Hot Reset Request             | Risin | Edge  | Non   |
+        | IRQ 67  | PE0 Hot Reset Request De-Assert   | Falli | Edge  | Non   |
+        | IRQ 68  | PE0 System error                  | High  | Level | Non   |
+        | IRQ 69  | PE0 Function Level Reset          | Falli | Edge  | Non   |
+        | IRQ 70  | PE0 DCR Error                     | High  | Level | Non   |
+        | IRQ 71  | PE0 VPD IRQ                       | N/A   | N/A   | Non   |
+        | IRQ 72  | PE1 AL                            | High  | Level | Non   |
+        | IRQ 73  | PE1 AL Secondary                  | Risin | Edge  | Non   |
+        | IRQ 74  | PE1 Hot Reset Request             | Risin | Edge  | Non   |
+        | IRQ 75  | PE1 Hot Reset Request De-Assert   | Falli | Edge  | Non   |
+        | IRQ 76  | PE1 System Error                  | High  | Level | Non   |
+        | IRQ 77  | PE1 Function Level Reset          | Falli | Edge  | Non   |
+        | IRQ 78  | PE1 DCR Error                     | High  | Level | Non   |
+        | IRQ 79  | PE1 VPD IRQ                       | N/A   | N/A   | Non   |
+        | IRQ 80  | PE2 AL                            | High  | Level | Non   |
+        | IRQ 81  | PE2 AL Secondary                  | Risin | Edge  | Non   |
+        | IRQ 82  | PE2 Hot Reset Request             | Risin | Edge  | Non   |
+        | IRQ 83  | PE2 Hot Reset Request De-Assert   | Falli | Edge  | Non   |
+        | IRQ 84  | PE2 System Error                  | High  | Level | Non   |
+        | IRQ 85  | PE2 Function Level Reset          | Falli | Edge  | Non   |
+        | IRQ 86  | PE2 DCR Error                     | High  | Level | Non   |
+        | IRQ 87  | PE2 VPD IRQ                       | N/A   | N/A   | Non   |
+        | IRQ 88  | External IRQ(3)                   | Progr | Progr | Non   |
+        | IRQ 89  | External IRQ 4                    | Progr | Progr | Non   |
+        | IRQ 90  | External IRQ 5                    | Progr | Progr | Non   |
+        | IRQ 91  | TRNG Value Avail                  | High  | Level | Non   |
+        | IRQ 92  | TRNG Alarm IRQ                    | High  | Level | Non   |
+        | IRQ 93  | EMAC0/1/2/3 Wake-up (or'd)        | High  | Level | Non   |
+        | IRQ 94  | TAHOE Error 0                     | High  | Level | Non   |
+        | IRQ 95  | TAHOE Error 1                     | High  | Level | Non   |
+        |---------------------------------------------------------------------
+        | IRQ 96  | PE0 INTA                          | High  | Level | Non   |
+        | IRQ 97  | PE0 INTB                          | High  | Level | Non   |
+        | IRQ 98  | PE0 INTC                          | High  | Level | Non   |
+        | IRQ 99  | PE0 INTD                          | High  | Level | Non   |
+        | IRQ 100 | PE1 INTA                          | High  | Level | Non   |
+        | IRQ 101 | PE1 INTB                          | High  | Level | Non   |
+        | IRQ 102 | PE1 INTC                          | High  | Level | Non   |
+        | IRQ 103 | PE1 INTD                          | High  | Level | Non   |
+        | IRQ 104 | PE2 INTA                          | High  | Level | Non   |
+        | IRQ 105 | PE2 INTB                          | High  | Level | Non   |
+        | IRQ 106 | PE2 INTC                          | High  | Level | Non   |
+        | IRQ 107 | PE2 INTD                          | Risin | Edge  | Non   |
+        | IRQ 108 | PCI Express MSI Level 4           | Risin | Edge  | Non   |
+        | IRQ 109 | PCI Express MSI Level 5           | Risin | Edge  | Non   |
+        | IRQ 110 | PCI Express MSI Level 6           | Risin | Edge  | Non   |
+        | IRQ 111 | PCI Express MSI Level 7           | Risin | Edge  | Non   |
+        | IRQ 116 | PCI Express MSI Level 8           | Risin | Edge  | Non   |
+        | IRQ 112 | PCI Express MSI Level 9           | Risin | Edge  | Non   |
+        | IRQ 113 | PCI Express MSI Level 10          | Risin | Edge  | Non   |
+        | IRQ 114 | PCI Express MSI Level 11          | Risin | Edge  | Non   |
+        | IRQ 115 | PCI Express MSI Level 12          | Risin | Edge  | Non   |
+        | IRQ 117 | PCI Express MSI Level 13          | Risin | Edge  | Non   |
+        | IRQ 118 | PCI Express MSI Level 14          | Risin | Edge  | Non   |
+        | IRQ 119 | PCI Express MSI Level 15          | Risin | Edge  | Non   |
+        | IRQ 120 | PCI Express MSI Level 16          | Risin | Edge  | Non   |
+        | IRQ 121 | PCI Express MSI Level 17          | Risin | Edge  | Non   |
+        | IRQ 122 | PCI Express MSI Level 18          | Risin | Edge  | Non   |
+        | IRQ 123 | PCI Express MSI Level 19          | Risin | Edge  | Non   |
+        | IRQ 124 | PCI Express MSI Level 20          | Risin | Edge  | Non   |
+        | IRQ 125 | PCI Express MSI Level 21          | Risin | Edge  | Non   |
+        | IRQ 126 | PCI Express MSI Level 22          | Risin | Edge  | Non   |
+        | IRQ 127 | PCI Express MSI Level 23          | Risin | Edge  | Non   |
+        +---------+-----------------------------------+-------+-------+------*/
+	/*--------------------------------------------------------------------+
+	| Initialise UIC registers.  Clear all interrupts.  Disable all
+	| interrupts.
+	| Set critical interrupt values.  Set interrupt polarities.  Set
+	| interrupt trigger levels.  Make bit 0 High  priority.  Clear all
+	| interrupts again.
+	+-------------------------------------------------------------------*/
+	mtdcr(uic3sr, 0xffffffff);	/* Clear all interrupts */
+	mtdcr(uic3er, 0x00000000);	/* disable all interrupts */
+	mtdcr(uic3cr, 0x00000000);	/* Set Critical / Non Critical
+					 * interrupts */
+	mtdcr(uic3pr, 0xffffffff);	/* Set Interrupt Polarities */
+	mtdcr(uic3tr, 0x001fffff);	/* Set Interrupt Trigger Levels */
+
+	mtdcr(uic3sr, 0x00000000);	/* clear all  interrupts */
+	mtdcr(uic3sr, 0xffffffff);	/* clear all  interrupts */
+
+	mtdcr(uic2sr, 0xffffffff);	/* Clear all interrupts */
+	mtdcr(uic2er, 0x00000000);	/* disable all interrupts */
+	mtdcr(uic2cr, 0x00000000);	/* Set Critical / Non Critical
+					 * interrupts */
+	mtdcr(uic2pr, 0xebebebff);	/* Set Interrupt Polarities */
+	mtdcr(uic2tr, 0x74747400);	/* Set Interrupt Trigger Levels */
+
+	mtdcr(uic2sr, 0x00000000);	/* clear all interrupts */
+	mtdcr(uic2sr, 0xffffffff);	/* clear all interrupts */
+
+	mtdcr(uic1sr, 0xffffffff);	/* Clear all interrupts */
+	mtdcr(uic1er, 0x00000000);	/* disable all interrupts */
+	mtdcr(uic1cr, 0x00000000);	/* Set Critical / Non Critical
+					 * interrupts */
+	mtdcr(uic1pr, 0xffffffff);	/* Set Interrupt Polarities */
+	mtdcr(uic1tr, 0x001fc0ff);	/* Set Interrupt Trigger Levels */
+
+	mtdcr(uic1sr, 0x00000000);	/* clear all interrupts */
+	mtdcr(uic1sr, 0xffffffff);	/* clear all interrupts */
+
+	mtdcr(uic0sr, 0xffffffff);	/* Clear all interrupts */
+	mtdcr(uic0er, 0x00000000);	/* disable all interrupts excepted
+					 * cascade to be checked */
+	mtdcr(uic0cr, 0x00104001);	/* Set Critical / Non Critical
+					 * interrupts */
+	mtdcr(uic0pr, 0xffffffff);	/* Set Interrupt Polarities */
+	mtdcr(uic0tr, 0x000f003c);	/* Set Interrupt Trigger Levels */
+
+	mtdcr(uic0sr, 0x00000000);	/* clear all interrupts */
+	mtdcr(uic0sr, 0xffffffff);	/* clear all interrupts */
+
+}
diff --git a/board/amcc/redwood/redwood.h b/board/amcc/redwood/redwood.h
new file mode 100644
index 0000000..89b87e6
--- /dev/null
+++ b/board/amcc/redwood/redwood.h
@@ -0,0 +1,50 @@
+/*
+ * (C) Copyright 2008
+ * Feng Kan, Applied Micro Circuit Corp., fkan at amcc.com.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __REDWOOD_H_
+#define __REDWOOD_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*----------------------------------------------------------------------------+
+| Defines
++----------------------------------------------------------------------------*/
+/* Pin Straps Reg */
+#define SDR0_PSTRP0			0x0040
+#define SDR0_PSTRP0_BOOTSTRAP_MASK	0xE0000000	/* Strap Bits */
+
+#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS0	0x00000000	/* Default strap settings 0 */
+#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS1	0x20000000	/* Default strap settings 1 */
+#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS2	0x40000000	/* Default strap settings 2 */
+#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS3	0x60000000	/* Default strap settings 3 */
+#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS4	0x80000000	/* Default strap settings 4 */
+#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS5	0xA0000000	/* Default strap settings 5 */
+#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS6	0xC0000000	/* Default strap settings 6 */
+#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS7	0xE0000000	/* Default strap settings 7 */
+
+#ifdef __cplusplus
+}
+#endif
+#endif				/* __REDWOOD_H_ */
diff --git a/board/amcc/redwood/u-boot.lds b/board/amcc/redwood/u-boot.lds
new file mode 100644
index 0000000..2104cc2
--- /dev/null
+++ b/board/amcc/redwood/u-boot.lds
@@ -0,0 +1,147 @@
+/*
+ * (C) Copyright 2004
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  .resetvec 0xFFFFFFFC :
+  {
+    *(.resetvec)
+  } = 0xffff
+
+  .bootpg 0xFFFFF000 :
+  {
+    cpu/ppc4xx/start.o	(.bootpg)
+  } = 0xffff
+
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)		}
+  .dynsym        : { *(.dynsym)		}
+  .dynstr        : { *(.dynstr)		}
+  .rel.text      : { *(.rel.text)	}
+  .rela.text     : { *(.rela.text)	}
+  .rel.data      : { *(.rel.data)	}
+  .rela.data     : { *(.rela.data)	}
+  .rel.rodata    : { *(.rel.rodata)	}
+  .rela.rodata   : { *(.rela.rodata)	}
+  .rel.got       : { *(.rel.got)	}
+  .rela.got      : { *(.rela.got)	}
+  .rel.ctors     : { *(.rel.ctors)	}
+  .rela.ctors    : { *(.rela.ctors)	}
+  .rel.dtors     : { *(.rel.dtors)	}
+  .rela.dtors    : { *(.rela.dtors)	}
+  .rel.bss       : { *(.rel.bss)	}
+  .rela.bss      : { *(.rela.bss)	}
+  .rel.plt       : { *(.rel.plt)	}
+  .rela.plt      : { *(.rela.plt)	}
+  .init          : { *(.init)		}
+  .plt : { *(.plt) }
+  .text      :
+  {
+    /* WARNING - the following is hand-optimized to fit within	*/
+    /* the sector layout of our flash chips!	XXX FIXME XXX	*/
+
+    cpu/ppc4xx/start.o		(.text)
+    board/amcc/redwood/init.o	(.text)
+
+/*    . = env_offset;*/
+/*    common/environment.o(.text)*/
+
+    *(.text)
+    *(.fixup)
+    *(.got1)
+  }
+  _etext = .;
+  PROVIDE (etext = .);
+  .rodata    :
+  {
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x00FF) & 0xFFFFFF00;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(256);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(256);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
diff --git a/cpu/ppc4xx/44x_spd_ddr2.c b/cpu/ppc4xx/44x_spd_ddr2.c
index c28fc46..937d9b5 100644
--- a/cpu/ppc4xx/44x_spd_ddr2.c
+++ b/cpu/ppc4xx/44x_spd_ddr2.c
@@ -52,7 +52,8 @@
 
 #if defined(CONFIG_SPD_EEPROM) &&				\
 	(defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
-	 defined(CONFIG_460EX) || defined(CONFIG_460GT))
+	 defined(CONFIG_460EX) || defined(CONFIG_460GT)  || \
+         defined(CONFIG_460SX))
 
 /*-----------------------------------------------------------------------------+
  * Defines
diff --git a/cpu/ppc4xx/cpu.c b/cpu/ppc4xx/cpu.c
index 39f439d..d3021b6 100644
--- a/cpu/ppc4xx/cpu.c
+++ b/cpu/ppc4xx/cpu.c
@@ -184,6 +184,19 @@ static char *bootstrap_str[] = {
 static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' };
 #endif
 
+#if defined(CONFIG_460SX)
+#define SDR0_PINSTP_SHIFT	29
+static char *bootstrap_str[] = {
+	"EBC (8 bits)",
+	"EBC (16 bits)",
+	"EBC (32 bits)",
+	"NAND (8 bits)",
+	"I2C (Addr 0x54)",	/* A8 */
+	"I2C (Addr 0x52)",	/* A4 */
+};
+static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G' };
+#endif
+
 #if defined(CONFIG_405EZ)
 #define SDR0_PINSTP_SHIFT	28
 static char *bootstrap_str[] = {
@@ -509,6 +522,26 @@ int checkcpu (void)
 		strcpy(addstr, "Security/Kasumi support");
 		break;
 
+	case PVR_460SX_RA:
+		puts("SX Rev. A");
+		strcpy(addstr, "Security support");
+		break;
+
+	case PVR_460SX_RA_V1:
+		puts("SX Rev. A");
+		strcpy(addstr, "No Security support");
+		break;
+
+	case PVR_460GX_RA:
+		puts("GX Rev. A");
+		strcpy(addstr, "Security support");
+		break;
+
+	case PVR_460GX_RA_V1:
+		puts("GX Rev. A");
+		strcpy(addstr, "No Security support");
+		break;
+
 	default:
 		printf (" UNKNOWN (PVR=%08x)", pvr);
 		break;
diff --git a/cpu/ppc4xx/speed.c b/cpu/ppc4xx/speed.c
index ef47ffc..336ca02 100644
--- a/cpu/ppc4xx/speed.c
+++ b/cpu/ppc4xx/speed.c
@@ -205,7 +205,8 @@ ulong get_PCI_freq (void)
 
 #elif defined(CONFIG_440)
 
-#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
+#if defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+    defined(CONFIG_460SX)
 static u8 pll_fwdv_multi_bits[] = {
 	/* values for:  1 - 16 */
 	0x00, 0x01, 0x0f, 0x04, 0x09, 0x0a, 0x0d, 0x0e, 0x03, 0x0c,
diff --git a/cpu/ppc4xx/start.S b/cpu/ppc4xx/start.S
index 426bf3c..714f458 100644
--- a/cpu/ppc4xx/start.S
+++ b/cpu/ppc4xx/start.S
@@ -677,7 +677,8 @@ _start:
 	/* not all PPC's have internal SRAM usable as L2-cache */
 #if defined(CONFIG_440GX) || \
     defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
-    defined(CONFIG_460EX) || defined(CONFIG_460GT)
+    defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+    defined(CONFIG_460SX)
 	mtdcr	l2_cache_cfg,r0		/* Ensure L2 Cache is off */
 #endif
 
@@ -720,6 +721,19 @@ _start:
 	lis	r1,0x4000		/* BAS = 8000_0000 */
 	ori	r1,r1,0x4580		/* 16k */
 	mtdcr	isram0_sb0cr,r1
+#elif defined(CONFIG_460SX)
+	lis	r1,0x0000		/* BAS = 0000_0000 */
+	ori	r1,r1,0x0B84		/* first 128k */
+	mtdcr	isram0_sb0cr,r1
+	lis	r1,0x0001
+	ori	r1,r1,0x0B84		/* second 128k */
+	mtdcr	isram0_sb1cr,r1
+	lis	r1, 0x0002
+	ori	r1,r1, 0x0B84		/* third 128k */
+	mtdcr	isram0_sb2cr,r1
+	lis	r1, 0x0003
+	ori	r1,r1, 0x0B84		/* fourth 128k */
+	mtdcr	isram0_sb3cr,r1
 #elif defined(CONFIG_440GP)
 	ori	r1,r1,0x0380		/* 8k rw */
 	mtdcr	isram0_sb0cr,r1
@@ -1415,7 +1429,8 @@ relocate_code:
 #if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
     defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
     defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
-    defined(CONFIG_460EX) || defined(CONFIG_460GT)
+    defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+    defined(CONFIG_460SX)
 	/*
 	 * On some 440er platforms the cache is enabled in the first TLB (Boot-CS)
 	 * to speed up the boot process. Now this cache needs to be disabled.
diff --git a/include/asm-ppc/ppc4xx-sdram.h b/include/asm-ppc/ppc4xx-sdram.h
index 83931f1..6eb8209 100644
--- a/include/asm-ppc/ppc4xx-sdram.h
+++ b/include/asm-ppc/ppc4xx-sdram.h
@@ -282,7 +282,8 @@
  * Memory Bank 0-7 configuration
  */
 #if defined(CONFIG_440SPE) || \
-    defined(CONFIG_460EX) || defined(CONFIG_460GT)
+    defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+    defined(CONFIG_460SX)
 #define SDRAM_RXBAS_SDBA_MASK		0xFFE00000	/* Base address	*/
 #define SDRAM_RXBAS_SDBA_ENCODE(n)	((((u32)(n))&0xFFE00000)>>2)
 #define SDRAM_RXBAS_SDBA_DECODE(n)	((((u32)(n))&0xFFE00000)<<2)
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index 139e686..9eb672d 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -810,6 +810,10 @@
 #define PVR_460EX_RA	0x130218A3 /* 460EX rev A without Security Engine */
 #define PVR_460GT_SE_RA	0x130218A0 /* 460GT rev A with Security Engine	  */
 #define PVR_460GT_RA	0x130218A1 /* 460GT rev A without Security Engine */
+#define PVR_460SX_RA    0x13541800 /* 460SX rev A                   */
+#define PVR_460SX_RA_V1 0x13541801 /* 460SX rev A Variant 1 Security disabled */
+#define PVR_460GX_RA    0x13541802 /* 460GX rev A                   */
+#define PVR_460GX_RA_V1 0x13541803 /* 460GX rev A Variant 1 Security disabled */
 #define PVR_601		0x00010000
 #define PVR_602		0x00050000
 #define PVR_603		0x00030000
diff --git a/include/configs/redwood.h b/include/configs/redwood.h
new file mode 100644
index 0000000..bf4468b
--- /dev/null
+++ b/include/configs/redwood.h
@@ -0,0 +1,211 @@
+/*
+ * Configuration for AMCC 460SX Ref (redwood)
+ *
+ * (C) Copyright 2008
+ * Feng Kan, Applied Micro Circuits Corp., fkan at amcc.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*-----------------------------------------------------------------------
+ * High Level Configuration Options
+ *----------------------------------------------------------------------*/
+#define CONFIG_4xx			1	/* ... PPC4xx family	*/
+#define CONFIG_440			1	/* ... PPC460 family	*/
+#define CONFIG_460SX			1	/* ... PPC460 family	*/
+#define CONFIG_BOARD_EARLY_INIT_F	1	/* Call board_pre_init	*/
+
+/*-----------------------------------------------------------------------
+ * Include common defines/options for all AMCC boards
+ *----------------------------------------------------------------------*/
+#define CONFIG_HOSTNAME		redwood
+
+#include "amcc-common.h"
+
+#define CONFIG_SYS_CLK_FREQ	33333333	/* external freq to pll	*/
+
+/*-----------------------------------------------------------------------
+ * Base addresses -- Note these are effective addresses where the
+ * actual resources get mapped (not physical addresses)
+ *----------------------------------------------------------------------*/
+#define CFG_FLASH_BASE		0xfff00000	/* start of FLASH	*/
+#define CFG_PERIPHERAL_BASE	0xa0000000	/* internal peripherals	*/
+#define CFG_ISRAM_BASE		0x90000000	/* internal SRAM	*/
+
+#define CFG_PCI_BASE		0xd0000000	/* internal PCI regs	*/
+
+#define CFG_PCIE_MEMBASE        0x90000000      /* mapped PCIe memory   */
+#define CFG_PCIE0_MEMBASE       0x90000000      /* mapped PCIe memory   */
+#define CFG_PCIE1_MEMBASE       0xa0000000      /* mapped PCIe memory   */
+#define CFG_PCIE_MEMSIZE        0x01000000
+
+#define CFG_PCIE0_XCFGBASE      0xb0000000
+#define CFG_PCIE1_XCFGBASE      0xb2000000
+#define CFG_PCIE2_XCFGBASE      0xb4000000
+#define CFG_PCIE0_CFGBASE       0xb6000000
+#define CFG_PCIE1_CFGBASE       0xb8000000
+#define CFG_PCIE2_CFGBASE       0xba000000
+
+/* PCIe mapped UTL registers */
+#define CFG_PCIE0_REGBASE   0xd0000000
+#define CFG_PCIE1_REGBASE   0xd0010000
+#define CFG_PCIE2_REGBASE   0xd0020000
+
+/* System RAM mapped to PCI space */
+#define CONFIG_PCI_SYS_MEM_BUS	CFG_SDRAM_BASE
+#define CONFIG_PCI_SYS_MEM_PHYS	CFG_SDRAM_BASE
+#define CONFIG_PCI_SYS_MEM_SIZE	(1024 * 1024 * 1024)
+
+#define CFG_FPGA_BASE		0xe2000000	/* epld			*/
+#define CFG_OPER_FLASH		0xe7000000	/* SRAM - OPER Flash	*/
+
+/*-----------------------------------------------------------------------
+ * Initial RAM & stack pointer (placed in internal SRAM)
+ *----------------------------------------------------------------------*/
+#define CFG_TEMP_STACK_OCM	1
+#define CFG_OCM_DATA_ADDR	CFG_ISRAM_BASE
+#define CFG_INIT_RAM_ADDR	CFG_ISRAM_BASE	/* Initial RAM address	*/
+#define CFG_INIT_RAM_END	0x2000		/* End of used area in RAM */
+#define CFG_GBL_DATA_SIZE	128		/* num bytes initial data */
+
+#define CFG_GBL_DATA_OFFSET	(CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_POST_WORD_ADDR	(CFG_GBL_DATA_OFFSET - 0x4)
+#define CFG_INIT_SP_OFFSET	CFG_POST_WORD_ADDR
+
+/*-----------------------------------------------------------------------
+ * DDR SDRAM
+ *----------------------------------------------------------------------*/
+#define CONFIG_SPD_EEPROM	1	/* Use SPD EEPROM for setup	*/
+#define CONFIG_DDR_ECC		1	/* with ECC support		*/
+
+#define CFG_SPD_MAX_DIMMS       2
+
+/* SPD i2c spd addresses */
+#if CFG_SPD_MAX_DIMMS == 4
+#define SPD_EEPROM_ADDRESS      {IIC0_DIMM0_ADDR, IIC0_DIMM1_ADDR, IIC0_DIMM2_ADDR, IIC0_DIMM3_ADDR}
+#define IIC0_DIMM0_ADDR         0x53
+#define IIC0_DIMM1_ADDR         0x52
+#define IIC0_DIMM2_ADDR         0x51
+#define IIC0_DIMM3_ADDR         0x50
+
+#elif CFG_SPD_MAX_DIMMS == 3
+#define SPD_EEPROM_ADDRESS      {IIC0_DIMM0_ADDR, IIC0_DIMM1_ADDR, IIC0_DIMM2_ADDR}
+#define IIC0_DIMM0_ADDR         0x53
+#define IIC0_DIMM1_ADDR         0x52
+#define IIC0_DIMM2_ADDR         0x51
+
+#elif CFG_SPD_MAX_DIMMS == 2
+ #define SPD_EEPROM_ADDRESS     {IIC0_DIMM0_ADDR, IIC0_DIMM1_ADDR}
+ #define IIC0_DIMM0_ADDR                0x53
+ #define IIC0_DIMM1_ADDR                0x52
+
+#elif CFG_SPD_MAX_DIMMS == 1
+ #define SPD_EEPROM_ADDRESS     {IIC0_DIMM0_ADDR}
+ #define IIC0_DIMM0_ADDR                0x53
+#endif
+
+/*-----------------------------------------------------------------------
+ * I2C
+ *----------------------------------------------------------------------*/
+#define CFG_I2C_SPEED           400000  /* I2C speed                    */
+
+#define IIC0_BOOTPROM_ADDR	0x50
+#define IIC0_ALT_BOOTPROM_ADDR	0x54
+
+/* Don't probe these addrs */
+#define CFG_I2C_NOPROBES	{0x50, 0x52, 0x53, 0x54}
+
+#define CFG_I2C_EEPROM_ADDR_LEN	2	/* Bytes of address		*/
+
+/*-----------------------------------------------------------------------
+ * Environment
+ *----------------------------------------------------------------------*/
+#undef  CFG_ENV_IS_IN_NVRAM		/* ... not in NVRAM		*/
+#define	CFG_ENV_IS_IN_FLASH	1	/* Environment uses flash	*/
+#undef	CFG_ENV_IS_IN_EEPROM		/* ... not in EEPROM		*/
+
+#define CONFIG_PREBOOT	"echo;"	\
+	"echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+	"echo"
+
+#undef	CONFIG_BOOTARGS
+
+#define	CONFIG_EXTRA_ENV_SETTINGS					\
+	CONFIG_AMCC_DEF_ENV                                             \
+        CONFIG_AMCC_DEF_ENV_POWERPC                                     \
+        CONFIG_AMCC_DEF_ENV_NOR_UPD                                     \
+        CONFIG_AMCC_DEF_ENV_NAND_UPD                                    \
+        "kernel_addr=fc000000\0"                                        \
+        "fdt_addr=fc1e0000\0"                                           \
+        "ramdisk_addr=fc200000\0"                                       \
+	""
+
+/*----------------------------------------------------------------------------+
+| Commands in addition to amcc-common.h
++----------------------------------------------------------------------------*/
+#define CONFIG_CMD_SDRAM
+
+#define CONFIG_BOOTCOMMAND	"run flash_self"
+
+#define CONFIG_BOOTDELAY	5	/* autoboot after 5 seconds	*/
+
+#define	CONFIG_IBM_EMAC4_V4	1
+#define CONFIG_PHY_RESET        1	/* reset phy upon startup	*/
+#define CONFIG_PHY_RESET_DELAY	1000
+#define CONFIG_M88E1141_PHY	1	/* Enable phy */
+#define CONFIG_PHY_GIGE		1	/* Include GbE speed/duplex detection */
+
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
+#define CONFIG_PHY_ADDR		0	/* PHY address, See schematics	*/
+#define CONFIG_PHY1_ADDR	1	/* PHY address, See schematics	*/
+#define CONFIG_PHY2_ADDR	2	/* PHY address, See schematics	*/
+#define CONFIG_PHY3_ADDR	3	/* PHY address, See schematics	*/
+
+#undef CONFIG_WATCHDOG			/* watchdog disabled		*/
+
+/*-----------------------------------------------------------------------
+ * FLASH related
+ *----------------------------------------------------------------------*/
+#define CFG_FLASH_CFI                   /* The flash is CFI compatible  */
+#define CFG_FLASH_CFI_DRIVER            /* Use common CFI driver        */
+#define CFG_FLASH_CFI_AMD_RESET 1       /* Use AMD (Spansion) reset cmd */
+
+#define CFG_MAX_FLASH_BANKS	3	/* number of banks		*/
+#define CFG_MAX_FLASH_SECT	256	/* sectors per device		*/
+
+#undef	CFG_FLASH_CHECKSUM
+#define CFG_FLASH_ERASE_TOUT	120000	/* Timeout for Flash Erase (in ms) */
+#define CFG_FLASH_WRITE_TOUT	500	/* Timeout for Flash Write (in ms) */
+
+#define CFG_FLASH_ADDR0		0x5555
+#define CFG_FLASH_ADDR1		0x2aaa
+#define CFG_FLASH_WORD_SIZE	unsigned char
+
+#ifdef CFG_ENV_IS_IN_FLASH
+#define CFG_ENV_SECT_SIZE	0x10000	/* size of one complete sector	*/
+#define CFG_ENV_ADDR		0xfffa0000
+#define CFG_ENV_SIZE		0x10000	/* Size of Environment vars	*/
+#endif /* CFG_ENV_IS_IN_FLASH */
+
+/*---------------------------------------------------------------------------*/
+
+#endif	/* __CONFIG_H */
diff --git a/include/ppc440.h b/include/ppc440.h
index 62f1680..1be3d72 100644
--- a/include/ppc440.h
+++ b/include/ppc440.h
@@ -749,7 +749,8 @@
  +----------------------------------------------------------------------------*/
 #if defined (CONFIG_440GX) || \
     defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
-    defined(CONFIG_460EX) || defined(CONFIG_460GT)
+    defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+    defined(CONFIG_460SX)
 #define L2_CACHE_BASE	0x030
 #define l2_cache_cfg	(L2_CACHE_BASE+0x00)	/* L2 Cache Config	*/
 #define l2_cache_cmd	(L2_CACHE_BASE+0x01)	/* L2 Cache Command	*/
@@ -837,7 +838,8 @@
 /*-----------------------------------------------------------------------------
  | Clocking, Power Management and Chip Control
  +----------------------------------------------------------------------------*/
-#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
+#if defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+    defined(CONFIG_460SX)
 #define CNTRL_DCR_BASE 0x160
 #else
 #define CNTRL_DCR_BASE 0x0b0
@@ -896,7 +898,8 @@
 
 #if defined(CONFIG_440SPE) || \
     defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
-    defined(CONFIG_460EX) || defined(CONFIG_460GT)
+    defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+    defined(CONFIG_460SX)
 #define UIC2_DCR_BASE 0xe0
 #define uic2sr	(UIC2_DCR_BASE+0x0)   /* UIC2 status-Read Clear		*/
 #define uic2srs	(UIC2_DCR_BASE+0x1)   /* UIC2 status-Read Set */
@@ -1281,6 +1284,40 @@
 #define UIC_UIC1NC	0x00000002	/* UIC1 non-critical interrupt	    */
 #define UIC_UIC1C	0x00000001	/* UIC1 critical interrupt	    */
 
+#elif defined(CONFIG_460SX)
+#define UIC_U0        0x80000000  /* UART 0                             */
+#define UIC_U1        0x40000000  /* UART 1                             */
+#define UIC_IIC0      0x20000000  /* IIC 0                              */
+#define UIC_IIC1      0x10000000  /* IIC 1                              */
+#define UIC_EDMAEQA   0x08000000  /* Enhanced DMA Complete Queue A      */
+#define UIC_EDMAEQB   0x04000000  /* Enhanced DMA Complete Queue B      */
+#define UIC_EDMAERR   0x02000000  /* Enhanced DMA Error                 */
+#define UIC_PDMA      0x01000000  /* Perpheral DMA 0/1                  */
+#define UIC_I2OCQNE   0x00800000  /* I2O Complete Queue Not Empty       */
+#define UIC_EIR0      0x00400000  /* External IRQ 0                     */
+#define UIC_UIC2NC    0x00200000  /* UIC2 non-critical interrupt	*/
+#define UIC_UIC2C     0x00100000  /* UIC2 critical interrupt	        */
+#define UIC_MSI0      0x00080000  /* PCI Express MSI Bit 0              */
+#define UIC_MSI1      0x00040000  /* PCI Express MSI Bit 1              */
+#define UIC_MSI2      0x00020000  /* PCI Express MSI Bit 2              */
+#define UIC_MSI3      0x00010000  /* PCI Express MSI Bit 3              */
+#define UIC_UIC3NC    0x00008000  /* UIC3 non-critical interrupt	*/
+#define UIC_UIC3C     0x00004000  /* UIC3 critical interrupt	        */
+#define UIC_EIR1      0x00002000  /* External IRQ 1                     */
+#define UIC_ETH0     0x00001000  /* EMAC0                              */
+#define UIC_ETH1     0x00000800  /* EMAC1                              */
+#define UIC_ETH2     0x00000400  /* EMAC2                              */
+#define UIC_ETH3     0x00000200  /* EMAC3                              */
+#define UIC_I2ODB     0x00000100  /* I2O Door Bell                      */
+#define UIC_I2OFNE    0x00000080  /* I2O Post List Fifo Not Empty       */
+#define UIC_CEI       0x00000040  /* Crypto Engine Interrupt            */
+#define UIC_PKA2SR    0x00000020  /* PKA 2 Sequencer Ready              */
+#define UIC_PKA1SR    0x00000010  /* PKA 1 Sequencer Ready              */
+#define UIC_PKA0LR    0x00000008  /* PKA0 LNME Ready                    */
+#define UIC_GPTDCT    0x00000004  /* GPT Down Count Timer               */
+#define UIC_UIC1NC    0x00000002  /* UIC1 non-critical interrupt        */
+#define UIC_UIC1C     0x00000001  /* UIC1 critical interrupt            */
+
 #elif !defined(CONFIG_440SPE)
 #define UIC_U0		0x80000000	/* UART 0			    */
 #define UIC_U1		0x40000000	/* UART 1			    */
@@ -1425,6 +1462,40 @@
 #define UIC_EIR7	0x00000002	/* External interrupt 7		    */
 #define UIC_EIR8	0x00000001	/* External interrupt 8		    */
 
+#elif defined(CONFIG_460SX)
+#define UIC_EIR2      0x80000000  /* External IRQ 2                     */
+#define UIC_MS        0x40000000  /* MAL SERR                           */
+#define UIC_MTDE       0x20000000  /* MAL TXDE                           */
+#define UIC_MRDE       0x10000000  /* MAK RXDE                           */
+#define UIC_NDFC      0x08000000  /* Nand Flash IRQ                     */
+#define UIC_EBCO      0x04000000  /* EBCO interrupt status              */
+#define UIC_MTE       0x02000000  /* MAL TX EOB                         */
+#define UIC_MRE       0x01000000  /* MAL RX EOB                         */
+#define UIC_CDBE      0x00800000  /* Memory Queue CDB Error             */
+#define UIC_ECCME     0x00400000  /* Uncorrectable ECC Mem Error        */
+#define UIC_ECCMEC    0x00200000  /* Correctable ECC Mem Error          */
+#define UIC_L2C       0x00100000  /* L2 Cache                           */
+#define UIC_CT0       0x00080000  /* CPT Compare Timer 0                */
+#define UIC_CT1       0x00040000  /* CPT Compare Timer 1                */
+#define UIC_CT2       0x00020000  /* CPT Compare Timer 2                */
+#define UIC_CT3       0x00010000  /* CPT Compare Timer 3                */
+#define UIC_CT4       0x00008000  /* CPT Compare Timer 4                */
+#define UIC_CT5       0x00004000  /* CPT Compare Timer 5                */
+#define UIC_CT6       0x00002000  /* CPT Compare Timer 6                */
+#define UIC_I2OE      0x00001000  /* I2O Error                          */
+#define UIC_SRE       0x00000800  /* Serial Rom Error                   */
+#define UIC_PSE       0x00000400  /* EIP-PKP PLB Slave Error            */
+#define UIC_I2OR0WH   0x00000200  /* I2O Region 0 Write Hit             */
+#define UIC_I2OR1WH   0x00000100  /* I2O Region 1 Write Hit             */
+#define UIC_MALICTX0  0x00000080  /* MAL Interrupt Coalescence TX0      */
+#define UIC_MALICTX1  0x00000040  /* MAL Interrupt Coalescence TX1      */
+#define UIC_MALICTX2  0x00000020  /* MAL Interrupt Coalescence TX2      */
+#define UIC_MALICTX3  0x00000010  /* MAL Interrupt Coalescence TX3      */
+#define UIC_MALICRX0  0x00000008  /* MAL Interrupt Coalescence RX0      */
+#define UIC_MALICRX1  0x00000004  /* MAL Interrupt Coalescence RX1      */
+#define UIC_MALICRX2  0x00000002  /* MAL Interrupt Coalescence RX2      */
+#define UIC_MALICRX3  0x00000001  /* MAL Interrupt Coalescence RX3      */
+
 #elif defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 
 #define UIC_MS        0x80000000  /* MAL SERR                           */
@@ -1579,6 +1650,40 @@
 #define UIC_OHCI	0x00000002	/* USB2.0 Host OHCI		    */
 #define UIC_OHCISMI	0x00000001	/* USB2.0 Host OHCI SMI		    */
 
+#elif defined(CONFIG_460SX)
+#define UIC_PE0PI	0x80000000	/* PE0 AL Primary Interrupt         */
+#define UIC_PE0SI	0x40000000	/* PE0 AL Secondary Interrupt       */
+#define UIC_PE0RRA 	0x20000000	/* PE0 Hot Reset Request Asserted   */
+#define UIC_PE0RRD	0x10000000	/* PE0 Hot Reset Request Deasserted */
+#define UIC_PE0SE	0x08000000	/* PE0 System Error 	            */
+#define UIC_PE0FLR	0x04000000	/* PE0 Function Level Reset 	    */
+#define UIC_PE0DCR	0x02000000	/* PE0 DCR Error		    */
+#define UIC_PE0VPD	0x01000000	/* PE0 VPD IRQ			    */
+#define UIC_PE1PI	0x00800000	/* PE1 AL Primary Interrupt	    */
+#define UIC_PE1SI	0x00400000	/* PE1 AL Secondary Interrupt       */
+#define UIC_PE1RRA	0x00200000	/* PE1 Hot Reset Request Asserted   */
+#define UIC_PE1RRD	0x00100000	/* PE1 Hot Reset Request Deasserted */
+#define UIC_PE1SE	0x00080000	/* PE1 System Error		    */
+#define UIC_PE1FLR	0x00040000	/* PE1 Function Level Reset	    */
+#define UIC_PE1DCR	0x00020000	/* PE1 DCR Error		    */
+#define UIC_PE1VPD	0x00010000	/* PE1 VPD IRQ			    */
+#define UIC_PE2PI	0x00008000	/* PE2 AL Primary Interrupt	    */
+#define UIC_PE2SI	0x00004000	/* PE2 AL Secondary Interrupt	    */
+#define UIC_PE2RRA	0x00002000	/* PE2 Hot Reset Request Asserted   */
+#define UIC_PE2RRD	0x00001000	/* PE2 Hot Reset Request Deasserted */
+#define UIC_PE2SE	0x00000800	/* PE2 System Error	  	    */
+#define UIC_PE2FLR	0x00000400	/* PE2 Function Level Reset	    */
+#define UIC_PE2DCR	0x00000200	/* PE2 DCR Error		    */
+#define UIC_PE2VPD	0x00000100	/* PE2 VPD IRQ			    */
+#define UIC_EIR3	0x00000080	/* External IRQ 3 		    */
+#define UIC_EIR4 	0x00000040	/* External IRQ 4  		    */
+#define UIC_EIR5  	0x00000020	/* External IRQ 4    		    */
+#define UIC_TRNGVA	0x00000010	/* TRNG Value Available		    */
+#define UIC_TRNGA	0x00000008	/* TRNG Alarm			    */
+#define UIC_EMACWUP	0x00000004	/* EMAC 0-3 Wakeup		    */
+#define UIC_TAHOEE0	0x00000002	/* TAHOE Error 0		    */
+#define UIC_TAHOEE1	0x00000001	/* TAHOE Error 1		    */
+
 #elif defined(CONFIG_440EPX) || defined(CONFIG_440GRX) /* UIC2 */
 
 #define UIC_EIR5    0x80000000  /* External interrupt 5                 */
@@ -1608,7 +1713,8 @@
 #define UICB0_ALL	(UICB0_UIC0CI | UICB0_UIC0NCI | UICB0_UIC1CI | \
 			 UICB0_UIC1NCI | UICB0_UIC2CI | UICB0_UIC2NCI)
 
-#elif defined(CONFIG_460EX) || defined(CONFIG_460GT)
+#elif defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+      defined(CONFIG_460SX)
 
 #define UICB0_UIC1NCI	0x00000002	/* UIC1 Noncritical Interrupt	    */
 #define UICB0_UIC1CI	0x00000001	/* UIC1 Critical Interrupt	    */
@@ -1855,7 +1961,7 @@
 #define SDR0_DDR0_TUNE_DECODE(n)	((((unsigned long)(n))>>0)&0x2FF)
 #endif
 
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440SPE) || defined(CONFIG_460SX)
 #define SDR0_CP440			0x0180
 #define SDR0_CP440_ERPN_MASK		0x30000000
 #define SDR0_CP440_ERPN_MASK_HI		0x3000
@@ -2791,7 +2897,8 @@
 /*-----------------------------------------------------------------------------+
 |  Clocking
 +-----------------------------------------------------------------------------*/
-#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
+#if defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+    defined(CONFIG_460SX)
 #define PLLSYS0_FWD_DIV_A_MASK	0x000000f0	/* Fwd Div A */
 #define PLLSYS0_FWD_DIV_B_MASK	0x0000000f	/* Fwd Div B */
 #define PLLSYS0_FB_DIV_MASK	0x0000ff00	/* Feedback divisor */
@@ -3143,14 +3250,15 @@
  * GPIO macro register defines
  ******************************************************************************/
 #if defined(CONFIG_440GP) || defined(CONFIG_440GX) || \
-    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_460SX)
 #define GPIO0_BASE             (CFG_PERIPHERAL_BASE+0x00000700)
 
 #define GPIO0_OR               (GPIO0_BASE+0x0)
 #define GPIO0_TCR              (GPIO0_BASE+0x4)
 #define GPIO0_ODR              (GPIO0_BASE+0x18)
 #define GPIO0_IR               (GPIO0_BASE+0x1C)
-#endif /* CONFIG_440GP */
+#endif 
 
 #if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
     defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
diff --git a/include/ppc4xx.h b/include/ppc4xx.h
index 0a8479f..54897f7 100644
--- a/include/ppc4xx.h
+++ b/include/ppc4xx.h
@@ -41,7 +41,8 @@
 
 #if defined(CONFIG_405EX) || \
     defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
-    defined(CONFIG_460EX) || defined(CONFIG_460GT)
+    defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+    defined(CONFIG_460SX)
 #define CONFIG_SDRAM_PPC4xx_IBM_DDR2	/* IBM DDR(2) controller */
 #endif
 
-- 
1.5.2.2





More information about the U-Boot mailing list