Skip to contentSkip to conversation

ppc4xx: Add AMCC Arches board support (dual 460GT)

PATCH Superseded Adam Graham 3 participants 6 messages Oct 1, 2008 – Oct 7, 2008 Kbuild

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 ppc4xx: Add AMCC Arches board support (dual 460GT)

The Arches Evaluation board is based on the AMCC 460GT SoC chip. This board is a dual processor board with each processor providing independent resources for Rapid IO, Gigabit Ethernet, and serial communications. Each 460GT has it's own 512MB DDR2 memory, 32MB NOR FLASH, UART, EEPROM and temperature sensor, along with a shared debug port. The two 460GT's will communicate with each other via shared memory, Gigabit Ethernet and x1 PCI-Express.

---
v2:
- Added Arches (460GT) support to the existing Canyonlands (460) board files since the Canyonlands board files support all current AMCC PPC460EX/GT boards.

 MAKEALL                              |    1 +
 Makefile                             |    3 +-
 board/amcc/canyonlands/canyonlands.c |  143 ++++++++++++++++++++
 board/amcc/canyonlands/init.S        |   17 +++
 include/configs/amcc-common.h        |   19 +++-
 include/configs/canyonlands.h        |  242 +++++++++++++++++++++++++++++++---
 include/ppc440.h                     |    3 +
 7 files changed, 410 insertions(+), 18 deletions(-)
MAKEALL +1 -0
index 9ccb9ac..847c1fa 100755
@@ -161,6 +161,7 @@ LIST_4xx="		\
 	alpr		\
 	AP1000		\
 	AR405		\
+	arches		\
 	ASH405		\
 	bamboo		\
 	bamboo_nand	\
Makefile +2 -1
index 7c13ce8..2af11c4 100644
@@ -1206,7 +1206,8 @@ bubinga_config:	unconfig
 CANBT_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc ppc4xx canbt esd
 
-# Canyonlands & Glacier use different U-Boot images
+# Arches, Canyonlands & Glacier use different U-Boot images
+arches_config \
 canyonlands_config \
 glacier_config:	unconfig
 	@mkdir -p $(obj)include
board/amcc/canyonlands/canyonlands.c +143 -0

207 lines not on this page · raw message

board/amcc/canyonlands/init.S +17 -0
index 258fb5d..12dead3 100644
@@ -77,11 +77,16 @@ tlbtab:
 	/* PCIe UTL register */
 	tlbentry(CFG_PCIE_BASE, SZ_16K, 0x08010000, 0xC, AC_R|AC_W|SA_G|SA_I)
 
+#if !defined(CONFIG_ARCHES)
 	/* TLB-entry for NAND */
 	tlbentry(CFG_NAND_ADDR, SZ_16M, CFG_NAND_ADDR, 4, AC_R|AC_W|AC_X|SA_G|SA_I)
 
 	/* TLB-entry for CPLD */
 	tlbentry(CFG_BCSR_BASE, SZ_1K, CFG_BCSR_BASE, 4, AC_R|AC_W|SA_G|SA_I)
+#else
+	/* TLB-entry for FPGA */
+	tlbentry(CFG_FPGA_BASE, SZ_16M, CFG_FPGA_BASE, 4, AC_R|AC_W|SA_G|SA_I)
+#endif
 
 	/* TLB-entry for OCM */
 	tlbentry(CFG_OCM_BASE, SZ_16K, 0x00040000, 4, AC_R|AC_W|AC_X|SA_I)
@@ -92,6 +97,18 @@ tlbtab:
 	/* AHB: Internal USB Peripherals (USB, SATA) */
 	tlbentry(CFG_AHB_BASE, SZ_1M, 0xbff00000, 4, AC_R|AC_W|AC_X|SA_G|SA_I)
 
+#if defined(CONFIG_RAPIDIO)
+        /* TLB-entries for RapidIO (SRIO) */
+	tlbentry(CFG_SRGPL0_REG_BAR, SZ_16M, CFG_SRGPL0_REG_BAR,
+					0xD, AC_R|AC_W|SA_G|SA_I)
+	tlbentry(CFG_SRGPL0_CFG_BAR, SZ_16M, CFG_SRGPL0_CFG_BAR,
+					0xD, AC_R|AC_W|SA_G|SA_I)
+	tlbentry(CFG_SRGPL0_MNT_BAR, SZ_16M, CFG_SRGPL0_MNT_BAR,
+					0xD, AC_R|AC_W|SA_G|SA_I)
+	tlbentry(CFG_I2ODMA_BASE, SZ_1K,  0x00100000,
+					0x4, AC_R|AC_W|SA_G|SA_I)
+#endif
+
 	tlbtab_end
 
 #if defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
include/configs/amcc-common.h +18 -1
index 1f27d78..ee053fb 100644
@@ -55,6 +55,13 @@
 #endif
 
 /*
+ * Only very few boards have default netdev not set to eth0 (like Arches)
+ */
+#if !defined(CONFIG_NETDEV)
+#define CONFIG_NETDEV		eth0
+#endif
+
+/*
  * Commands
  */
 #include <config_cmd_default.h>
@@ -147,9 +154,11 @@
 /*
  * Booting and default environment
  */
+#if !defined(CONFIG_PREBOOT)
 #define CONFIG_PREBOOT	"echo;"	\
 	"echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
 	"echo"
+#endif
 #define CONFIG_BOOTCOMMAND	"run flash_self"
 
 /*
@@ -184,7 +193,7 @@
  * General common environment variables shared on all AMCC eval boards
  */
 #define CONFIG_AMCC_DEF_ENV						\
-	"netdev=eth0\0"							\
+	"netdev=" xstr(CONFIG_NETDEV) "\0"				\
 	"nfsargs=setenv bootargs root=/dev/nfs rw "			\
 		"nfsroot=${serverip}:${rootpath}\0"			\
 	"ramargs=setenv bootargs root=/dev/ram rw\0"			\
@@ -197,8 +206,10 @@
 	"initrd_high=30000000\0"					\
 	"kernel_addr_r=400000\0"					\
 	"fdt_addr_r=800000\0"						\
+	"ramdisk_addr_r=C00000\0"					\
 	"hostname=" xstr(CONFIG_HOSTNAME) "\0"				\
 	"bootfile=" xstr(CONFIG_HOSTNAME) "/uImage\0"			\
+	"ramdisk_file=" xstr(CONFIG_HOSTNAME) "/uRamdisk\0"		\
 	CONFIG_AMCC_DEF_ENV_ROOTPATH
 
 /*
@@ -214,6 +225,12 @@
 		"tftp ${fdt_addr_r} ${fdt_file}; "			\
 		"run nfsargs addip addtty addmisc;"			\
 		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"		\
+	"net_self_load=tftp ${kernel_addr_r} ${bootfile};"		\
+		"tftp ${fdt_addr_r} ${fdt_file};"			\
+		"tftp ${ramdisk_addr_r} ${ramdisk_file};\0"		\
+	"net_self=run net_self_load;"					\
+		"run ramargs addip addtty addmisc;"			\
+		"bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}\0" \
 	"fdt_file=" xstr(CONFIG_HOSTNAME) "/" xstr(CONFIG_HOSTNAME) ".dtb\0"
 
 /*
include/configs/canyonlands.h +226 -16

350 lines not on this page · raw message

include/ppc440.h +3 -0
index be8d3ff..7ffc640 100644
@@ -1349,6 +1349,9 @@
 #define SDR0_ETH_CFG_ZMII_RMII_MODE_10M		0x10
 #define SDR0_ETH_CFG_ZMII_RMII_MODE_100M	0x11
 
+/* Ethernet Status Register */
+#define SDR0_ETH_STS		0x4104
+
 /* Miscealleneaous Function Reg. (SDR0_MFR) */
 #define SDR0_MFR		0x4300
 #define SDR0_MFR_T0TxFL		0x00800000	/* force parity error TAHOE0 Tx FIFO bits 0:63 */
Signature · 1 line
1.5.5
#1 lore raw

PATCH v2 1/3 ppc4xx: Add AMCC Arches board support (dual 460GT)

Dear Adam Graham,

Quoted 1 line · In message <[email protected]> you wrote:

The Arches Evaluation board is based on the AMCC 460GT SoC chip. This board is a dual processor board with each processor providing independent resources for Rapid IO, Gigabit Ethernet, and serial communications. Each 460GT has it's own 512MB DDR2 memory, 32MB NOR FLASH, UART, EEPROM and temperature sensor, along with a shared debug port. The two 460GT's will communicate with each other via shared memory, Gigabit Ethernet and x1 PCI-Express.

Wow. Line length 448, that's more than 6 times the allowed max.

Please restrict your line length to < 70 characters.

...

Quoted 2 lines
board/amcc/canyonlands/canyonlands.c +2 -0
+int misc_init_r(void)
+{

...

board/amcc/canyonlands/canyonlands.c int misc_init_r(void) · line 571

Quoted 13 lines
board/amcc/canyonlands/canyonlands.c +13 -0
+	/* reset all SGMII interfaces */
+	mfsdr(SDR0_SRST1,   reg);
+	reg |= (SDR0_SRST1_SGMII0 | SDR0_SRST1_SGMII1 | SDR0_SRST1_SGMII2);
+	mtsdr(SDR0_SRST1, reg);
+	mtsdr(SDR0_ETH_STS, 0xFFFFFFFF);
+	mtsdr(SDR0_SRST1,   0x00000000);
+
+	for (timeout = 60; timeout > 0; timeout--) {
+		udelay(1000);
+		mfsdr(SDR0_ETH_PLL, eth_pll);
+		if ((eth_pll & SDR0_ETH_PLL_PLLLOCK) != 0)
+			break;
+	}

Where is the 60 ms timeout coming from?

include/configs/amcc-common.h line 62

Quoted 11 lines
include/configs/amcc-common.h +5 -0
@@ -55,6 +55,13 @@
 #endif
 
 /*
+ * Only very few boards have default netdev not set to eth0 (like Arches)
+ */
+#if !defined(CONFIG_NETDEV)
+#define CONFIG_NETDEV		eth0
+#endif

Please don't add this to common code; please handle it locally in the arches configuration.

include/configs/amcc-common.h line 161

Quoted 9 lines
include/configs/amcc-common.h +2 -0
@@ -147,9 +154,11 @@
 /*
  * Booting and default environment
  */
+#if !defined(CONFIG_PREBOOT)
 #define CONFIG_PREBOOT	"echo;"	\
 	"echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
 	"echo"
+#endif

Ditto. [Also: what's the reason for this change? ]

include/configs/amcc-common.h line 230

Quoted 3 lines
include/configs/amcc-common.h +3 -0
+	"net_self_load=tftp ${kernel_addr_r} ${bootfile};"		\
+		"tftp ${fdt_addr_r} ${fdt_file};"			\
+		"tftp ${ramdisk_addr_r} ${ramdisk_file};\0"		\

What is this needed for?

Quoted 4 lines
include/configs/canyonlands.h +0 -0
index 2f162e1..acad9b3 100644

...

include/configs/canyonlands.h line 71

Quoted 2 lines
include/configs/canyonlands.h +2 -0
+#define CONFIG_PREBOOT \
+	"setenv ethact ppc_4xx_eth1;" \

This should not be done in the preboot command, but as part of the default config instead.

include/configs/canyonlands.h line 137

Quoted 2 lines
include/configs/canyonlands.h +1 -1
-#define CFG_AHB_BASE		0xE2000000	/* internal AHB peripherals	*/
+#define CFG_AHB_BASE		0xE2000000	/* internal AHB peripherals */

Is this change an improvement?

include/configs/canyonlands.h line 274

Quoted 8 lines
include/configs/canyonlands.h +1 -0
@@ -223,6 +268,7 @@
  * DDR SDRAM
  *----------------------------------------------------------------------------*/
 #if !defined(CONFIG_NAND_U_BOOT)
+#if !defined(CONFIG_ARCHES)
 /*
  * NAND booting U-Boot version uses a fixed initialization, since the whole
  * I2C SPD DIMM autodetection/calibration doesn't fit into the 4k of boot

Are you sure this is correct?

Quoted 3 lines

+#if !defined(CONFIG_ARCHES)
/* Only Canyonlands (460EX) has USB */
#ifdef CONFIG_460EX

I think it would make more sense to move the "!defined(CONFIG_ARCHES)" _after_ the "#ifdef CONFIG_460EX".

include/configs/canyonlands.h line 462

Quoted 8 lines
include/configs/canyonlands.h +8 -0
+#else	/* defined(CONFIG_ARCHES) */
+
+/* Arches board does not have USB connectivity */
+
+/*
+ * Default environment variables
+ */
+#define	CONFIG_EXTRA_ENV_SETTINGS					\

Ah... but these definitely do not belong into the "USB connectivity" block...

Quoted 4 lines

*/

include/configs/canyonlands.h +1 -1
+#if !defined(CONFIG_ARCHES)
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_DTT

include/configs/canyonlands.h line 487

Quoted 10 lines
include/configs/canyonlands.h +3 -1
 #define CONFIG_CMD_NAND
+#define CONFIG_CMD_SNTP
+#endif
+#define CONFIG_CMD_DTT
 #define CONFIG_CMD_PCI
 #define CONFIG_CMD_SDRAM
-#define CONFIG_CMD_SNTP
 #ifdef CONFIG_460EX
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT

I think we should separate these tlistrs of commands, so we can keep the lists sorted.

Quoted 5 lines

+/*
+ * Arches has 32MBytes of NOR FLASH (Spansion 29GL256) so remap FLASH to
+ * EBC address which accepts bigger regions:
+ * 0xfe00.0000 -> 4.ce00.0000
+ */

Cannot we do this automatically, dependent on the actual size of flash as determined by the code?

Best regards,

Wolfgang Denk

Signature · 5 lines
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 at denx.de
Q: What do you get when you cross an ethernet with an income statement?
A: A local area networth.
#2 lore raw

PATCH v2 1/3 ppc4xx: Add AMCC Arches board support(dual 460GT)

Dear Wolfgang,

Thanks for the feedback.

Quoted 4 lines

...

Quoted 2 lines
board/amcc/canyonlands/canyonlands.c +2 -0
+int misc_init_r(void)
+{

...

Quoted 16 lines

board/amcc/canyonlands/canyonlands.c int misc_init_r(void) · line 571

Quoted 13 lines
board/amcc/canyonlands/canyonlands.c +13 -0
+	/* reset all SGMII interfaces */
+	mfsdr(SDR0_SRST1,   reg);
+	reg |= (SDR0_SRST1_SGMII0 | SDR0_SRST1_SGMII1 | SDR0_SRST1_SGMII2);
+	mtsdr(SDR0_SRST1, reg);
+	mtsdr(SDR0_ETH_STS, 0xFFFFFFFF);
+	mtsdr(SDR0_SRST1,   0x00000000);
+
+	for (timeout = 60; timeout > 0; timeout--) {
+		udelay(1000);
+		mfsdr(SDR0_ETH_PLL, eth_pll);
+		if ((eth_pll & SDR0_ETH_PLL_PLLLOCK) != 0)
+			break;
+	}

Where is the 60 ms timeout coming from?

This is a very high mark number we came up with when running some test while waiting for SDR0_ETH_PLL_PLLLLOCK. Actually a timeout is really not needed PLL LOCK is always achieved. No initialization of the SDR0_ETH_PLL required. The SDR0_ETH_PLL is configured by default after reset. The code should look more like this.

do {
	mfsdr(SDR0_ETH_PLL, eth_pll);
} while (!(eth_pll & SDR0_ETH_PLL_PLLLOCK));
Quoted 5 lines
Quoted 5 lines
include/configs/amcc-common.h +0 -0
@@ -55,6 +55,13 @@
 #endif
 
Quoted 9 lines

include/configs/amcc-common.h line 62

Quoted 6 lines
include/configs/amcc-common.h +5 -0
 /*
+ * Only very few boards have default netdev not set to eth0 (like Arches)
+ */
+#if !defined(CONFIG_NETDEV)
+#define CONFIG_NETDEV		eth0
+#endif

Please don't add this to common code; please handle it locally in the arches configuration.

We do handle this locally in arches config section (canyonlands.h). The above is the default. We need this because eth0 in Arches is used for CPU-to-CPU Communcation via ethernet. Eth1 is used for normal RJ45 connection.

Quoted 12 lines

include/configs/amcc-common.h line 161

Quoted 9 lines
include/configs/amcc-common.h +2 -0
@@ -147,9 +154,11 @@
 /*
  * Booting and default environment
  */
+#if !defined(CONFIG_PREBOOT)
 #define CONFIG_PREBOOT	"echo;"	\
 	"echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
 	"echo"
+#endif

Ditto. [Also: what's the reason for this change? ]

Once again. This is the default, we overwrite this in our arches Config section (canyonlands.h). We modify CONFIG_PREBOOT to Set the default ethact to ppc_4xx_eth1. See below

Quoted 5 lines

include/configs/amcc-common.h line 230

Quoted 3 lines
include/configs/amcc-common.h +3 -0
+	"net_self_load=tftp ${kernel_addr_r} ${bootfile};"		\
+		"tftp ${fdt_addr_r} ${fdt_file};"			\
+		"tftp ${ramdisk_addr_r} ${ramdisk_file};\0"		\

What is this needed for?

net_self_load is used by net_self to load linux, fdt blob, ramdisk via tftp. this is very similar to net_nfs, flash_nfs and flash_self

Quoted 10 lines
Quoted 4 lines
include/configs/canyonlands.h +0 -0
index 2f162e1..acad9b3 100644

...

include/configs/canyonlands.h line 71

Quoted 2 lines
include/configs/canyonlands.h +2 -0
+#define CONFIG_PREBOOT \
+	"setenv ethact ppc_4xx_eth1;" \

This should not be done in the preboot command, but as part of the default config instead.

Yes, you are correct. I will fix this.

Quoted 4 lines

include/configs/canyonlands.h line 137

Quoted 2 lines
include/configs/canyonlands.h +1 -1
-#define CFG_AHB_BASE		0xE2000000	/* internal AHB peripherals	*/
+#define CFG_AHB_BASE		0xE2000000	/* internal AHB peripherals */

Is this change an improvement?

No

Quoted 10 lines

include/configs/canyonlands.h line 274

Quoted 8 lines
include/configs/canyonlands.h +1 -0
@@ -223,6 +268,7 @@
  * DDR SDRAM
  *----------------------------------------------------------------------------*/
 #if !defined(CONFIG_NAND_U_BOOT)
+#if !defined(CONFIG_ARCHES)
 /*
  * NAND booting U-Boot version uses a fixed initialization, since the whole
  * I2C SPD DIMM autodetection/calibration doesn't fit into the 4k of boot

Are you sure this is correct?

I will investigate.

Quoted 6 lines
Quoted 3 lines

+#if !defined(CONFIG_ARCHES)
/* Only Canyonlands (460EX) has USB */
#ifdef CONFIG_460EX

I think it would make more sense to move the "!defined(CONFIG_ARCHES)" _after_ the "#ifdef CONFIG_460EX".

Will double check

Quoted 11 lines

include/configs/canyonlands.h line 462

Quoted 8 lines
include/configs/canyonlands.h +8 -0
+#else	/* defined(CONFIG_ARCHES) */
+
+/* Arches board does not have USB connectivity */
+
+/*
+ * Default environment variables
+ */
+#define	CONFIG_EXTRA_ENV_SETTINGS					\

Ah... but these definitely do not belong into the "USB connectivity" block...

OK. Will fix.

Quoted 9 lines
Quoted 9 lines

*/

include/configs/canyonlands.h +4 -1
+#if !defined(CONFIG_ARCHES)
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_DTT
 #define CONFIG_CMD_NAND
+#define CONFIG_CMD_SNTP
+#endif
+#define CONFIG_CMD_DTT
 #define CONFIG_CMD_PCI
Quoted 8 lines
Quoted 5 lines

#define CONFIG_CMD_SDRAM
-#define CONFIG_CMD_SNTP
#ifdef CONFIG_460EX
#define CONFIG_CMD_EXT2
#define CONFIG_CMD_FAT

I think we should separate these tlistrs of commands, so we can keep the lists sorted.

OK.

Quoted 9 lines
Quoted 5 lines

+/*
+ * Arches has 32MBytes of NOR FLASH (Spansion 29GL256) so remap FLASH to
+ * EBC address which accepts bigger regions:
+ * 0xfe00.0000 -> 4.ce00.0000
+ */

Cannot we do this automatically, dependent on the actual size of flash as determined by the code?

Will investigate.

Best Regards,

Victor Gallardo

#3 lore raw

PATCH v2 1/3 ppc4xx: Add AMCC Arches boardsupport(dual 460GT)

Dear Wolfgang,

Quoted 10 lines
Quoted 4 lines
(quoted diff) +0 -0

b/include/configs/canyonlands.h index 2f162e1..acad9b3 100644

include/configs/canyonlands.h +0 -0

...

include/configs/canyonlands.h line 71

Quoted 2 lines
include/configs/canyonlands.h +2 -0
+#define CONFIG_PREBOOT \
+	"setenv ethact ppc_4xx_eth1;" \

This should not be done in the preboot command, but as part of the default config instead.

I reviewed this again. It cannot be part of default config. We need to do it at PREBOOT because eth_register() updates this variable each time at boot. It assigns ethact to the first ethernet port it discovers. In Arches, we need the second Ethernet port set as ethact. Updating it at preboot allows us to update after eth_register has set it.

Best Regards,

Victor Gallardo

#4 lore raw

PATCH v2 1/3 ppc4xx: Add AMCC Arches boardsupport(dual 460GT)

Dear "Victor Gallardo",

Quoted 7 lines · In message <0CA0A16855646F4FA96D25A158E299D6052C64FA@SDCEXCHANGE01.ad.amcc.com>…

I reviewed this again. It cannot be part of default config. We need to do it at PREBOOT because eth_register() updates this variable each time at boot. It assigns ethact to the first ethernet port it discovers. In Arches, we need the second Ethernet port set as ethact. Updating it at preboot allows us to update after eth_register has set it.

Are you sure? I think there must be something wrong with your configuration, then. Did you set "ethprime" ?

Best regards,

Wolfgang Denk

Signature · 5 lines
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 at denx.de
The more we disagree, the more chance there is that at least  one  of
us is right.
#5 lore raw

PATCH v2 1/3 ppc4xx: Add AMCC Arches boardsupport(dual 460GT)

Quoted 10 lines
Quoted 7 lines

I reviewed this again. It cannot be part of default config. We need to do it at PREBOOT because eth_register() updates this variable each time at boot. It assigns ethact to the first ethernet port it discovers. In Arches, we need the second Ethernet port set as ethact. Updating it at preboot allows us to update after eth_register has set it.

Are you sure? I think there must be something wrong with your configuration, then. Did you set "ethprime" ?

How did I miss that. Yes, this is what we should be using.

Thanks for the help Wolfgang,

Victor Gallardo