[U-Boot] [PATCH] Change the configuration for the STx GP3-SSA board in order to support FDT parsing and passing.

Change the configuration for the STx GP3-SSA board in order to support FDT parsing and passing. Also changed default u-boot environment for convenience.
Signed-off-by: Bradley Hughes bhughes@silicontkx.com
--- board/stx/stxssa/stxssa.c | 10 ++++ include/configs/stxssa.h | 114 +++++++++++++++++++++++++++++---------------- 2 files changed, 84 insertions(+), 40 deletions(-)
diff --git a/board/stx/stxssa/stxssa.c b/board/stx/stxssa/stxssa.c index 0b2584c..9cd2c62 100644 --- a/board/stx/stxssa/stxssa.c +++ b/board/stx/stxssa/stxssa.c @@ -40,6 +40,8 @@ #include <spd_sdram.h> #include <miiphy.h> #include <netdev.h> +#include <libfdt.h> +#include <fdt_support.h>
long int fixed_sdram (void);
@@ -407,3 +409,11 @@ int board_eth_init(bd_t *bis) cpu_eth_init(bis); /* Initialize TSECs first */ return pci_eth_init(bis); } + +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +void ft_board_setup(void *blob, bd_t *bd) +{ + ft_cpu_setup(blob, bd); +} +#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ + diff --git a/include/configs/stxssa.h b/include/configs/stxssa.h index 363f7b4..d7adee9 100644 --- a/include/configs/stxssa.h +++ b/include/configs/stxssa.h @@ -26,11 +26,7 @@ * MA 02111-1307 USA */
-/* mpc8560ads board configuration file */ -/* please refer to doc/README.mpc85xx for more info */ -/* make sure you change the MAC address and other network params first, - * search for CONFIG_ETHADDR,CONFIG_SERVERIP,etc in this file - */ +/* STX GP3 SSA board configuration file */
#ifndef __CONFIG_H #define __CONFIG_H @@ -41,7 +37,7 @@ #define CONFIG_MPC85xx 1 /* MPC8540/MPC8560 */ #define CONFIG_CPM2 1 /* has CPM2 */ #define CONFIG_STXSSA 1 /* Silicon Tx GPPP SSA board specific*/ -#define CONFIG_MPC8560 1 +#define CONFIG_MPC8555 1
#define CONFIG_PCI /* PCI ethernet support */ #define CONFIG_TSEC_ENET /* tsec ethernet support*/ @@ -194,6 +190,14 @@ #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " #endif
+/* + * Support FDT-file passing + */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 +#define CONFIG_OF_STDOUT_VIA_ALIAS 1 + + /* * I2C */ @@ -346,15 +350,19 @@ */ #include <config_cmd_default.h>
+#define CONFIG_CMD_ASKENV #define CONFIG_CMD_DATE #define CONFIG_CMD_DHCP #define CONFIG_CMD_EEPROM #define CONFIG_CMD_I2C +#define CONFIG_CMD_MII #define CONFIG_CMD_NFS #define CONFIG_CMD_PING #define CONFIG_CMD_SNTP #define CONFIG_CMD_REGINFO
+#undef CONFIG_CMD_FUSE + #if defined(CONFIG_PCI) #define CONFIG_CMD_PCI #endif @@ -370,14 +378,13 @@ #define CONFIG_CMD_ELF #endif
- #undef CONFIG_WATCHDOG /* watchdog disabled */
/* * Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ -#define CONFIG_SYS_PROMPT "SSA=> " /* Monitor Command Prompt */ +#define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */ #if defined(CONFIG_CMD_KGDB) #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ #else @@ -419,6 +426,20 @@ #define CONFIG_ETH2ADDR 00:e0:0c:07:9b:8c #endif
+ + +/* + * Configuration options for EEPROM or FLASH Setup + */ +#define CONFIG_SERVERIP 10.10.0.150 +#define CONFIG_IPADDR 10.10.0.95 +#define CONFIG_GATEWAYIP 10.10.0.1 +#define CONFIG_NETMASK 255.255.255.0 +#define CONFIG_HOSTNAME STX_SSA +#define CONFIG_ROOTPATH /opt/ppc/ppc_85xx +#define CONFIG_BOOTFILE stxssa/uImage +#define CONFIG_FDTFILE stxssa/stxssa.fdt + /* * Environment in EEPROM is compatible with different flash sector sizes, * but only little space is available, so we use a very simple setup. @@ -431,13 +452,6 @@ #define CONFIG_BOOTDELAY 3 /* -1 disable autoboot */ #define CONFIG_BOOTCOMMAND "bootm 0xffc00000 0xffd00000" #define CONFIG_BOOTARGS "root=/dev/nfs rw ip=any console=ttyS1,$baudrate" -#define CONFIG_SERVERIP 192.168.85.1 -#define CONFIG_IPADDR 192.168.85.60 -#define CONFIG_GATEWAYIP 192.168.85.1 -#define CONFIG_NETMASK 255.255.255.0 -#define CONFIG_HOSTNAME STX_SSA -#define CONFIG_ROOTPATH /gppproot -#define CONFIG_BOOTFILE uImage #define CONFIG_LOADADDR 0x1000000
#else /* ENV IS IN FLASH -- use a full-blown envionment */ @@ -452,31 +466,51 @@
#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
-#define CONFIG_EXTRA_ENV_SETTINGS \ - "hostname=gp3ssa\0" \ - "bootfile=/tftpboot/gp3ssa/uImage\0" \ - "loadaddr=400000\0" \ - "netdev=eth0\0" \ - "consdev=ttyS1\0" \ - "nfsargs=setenv bootargs root=/dev/nfs rw " \ - "nfsroot=$serverip:$rootpath\0" \ - "ramargs=setenv bootargs root=/dev/ram rw\0" \ - "addip=setenv bootargs $bootargs " \ - "ip=$ipaddr:$serverip:$gatewayip:$netmask" \ - ":$hostname:$netdev:off panic=1\0" \ - "addcons=setenv bootargs $bootargs " \ - "console=$consdev,$baudrate\0" \ - "flash_nfs=run nfsargs addip addcons;" \ - "bootm $kernel_addr\0" \ - "flash_self=run ramargs addip addcons;" \ - "bootm $kernel_addr $ramdisk_addr\0" \ - "net_nfs=tftp $loadaddr $bootfile;" \ - "run nfsargs addip addcons;bootm\0" \ - "rootpath=/opt/eldk/ppc_85xx\0" \ - "kernel_addr=FC000000\0" \ - "ramdisk_addr=FC200000\0" \ - "" -#define CONFIG_BOOTCOMMAND "run flash_self" +#define CONFIG_EXTRA_ENV_SETTINGS \ + "u-boot_addr_r=FFF00000\0" \ + "kernel_addr_r=FC000000\0" \ + "fdt_addr_r=FC400000\0" \ + "ramdisk_addr_r=FC200000\0" \ + "u-boot_addr=FFF00000\0" \ + "kernel_addr=FC000000\0" \ + "fdt_addr=FC400000\0" \ + "ramdisk_addr=FC200000\0" \ + "ramdiskfile=stxssa/uRamdisk\0" \ + "u-boot=stxssa/u-boot.bin\0" \ + "bootfile=stxssa/uImage\0" \ + "fdtfile=stxssa/stxssa.dtb\0" \ + "rootpath=/opt/ppc/ppc_85xx\n" \ + "netdev=eth0\0" \ + "consdev=ttyPSC0\0" \ + "nfsargs=setenv bootargs root=/dev/nfs rw " \ + "nfsroot=${serverip}:${rootpath}\0" \ + "ramargs=setenv bootargs root=/dev/ram rw\0" \ + "addip=setenv bootargs ${bootargs} " \ + "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ + ":${hostname}:${netdev}:off panic=1\0" \ + "addtty=setenv bootargs ${bootargs} " \ + "console=${consdev},${baudrate}\0" \ + "flash_nfs=run nfsargs addip addtty;" \ + "bootm ${kernel_addr} - ${fdt_addr}\0" \ + "flash_self=run ramargs addip addtty;" \ + "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \ + "net_nfs=tftp ${kernel_addr_r} ${bootfile};" \ + "tftp ${fdt_addr_r} ${fdtfile};" \ + "run nfsargs addip addtty;" \ + "bootm ${kernel_addr_r} - ${fdt_addr_r}\0" \ + "net_self=tftp ${kernel_addr_r} ${bootfile};" \ + "tftp ${ramdisk_addr_r} ${ramdiskfile};" \ + "tftp ${fdt_addr_r} ${fdtfile};" \ + "run ramargs addip addtty;" \ + "bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}\0"\ + "load=tftp ${u-boot_addr_r} ${u-boot}\0" \ + "update=protect off ${u-boot_addr} +${filesize};" \ + "era ${u-boot_addr} +${filesize};" \ + "cp.b ${u-boot_addr_r} ${u-boot_addr} ${filesize}\0" \ + "upd=run load update\0" \ + "" + +#define CONFIG_BOOTCOMMAND "run net_nfs"
#endif /* CONFIG_ENV_IS_IN_EEPROM */

Dear Bradley Hughes,
your Subject: is WAY too long - please restict to some 60 characters or so.
In message AANLkTimM0NENrBZo9seY6OlLNmU_fz3tv9LWZeG8ykRN@mail.gmail.com you wrote:
Change the configuration for the STx GP3-SSA board in order to support FDT parsing and passing.
...and please don't repeat the same in the commit message.
...
diff --git a/board/stx/stxssa/stxssa.c b/board/stx/stxssa/stxssa.c index 0b2584c..9cd2c62 100644 --- a/board/stx/stxssa/stxssa.c +++ b/board/stx/stxssa/stxssa.c @@ -40,6 +40,8 @@ #include <spd_sdram.h> #include <miiphy.h> #include <netdev.h> +#include <libfdt.h> +#include <fdt_support.h>
long int fixed_sdram (void);
@@ -407,3 +409,11 @@ int board_eth_init(bd_t *bis) cpu_eth_init(bis); /* Initialize TSECs first */ return pci_eth_init(bis); }
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +void ft_board_setup(void *blob, bd_t *bd) +{
ft_cpu_setup(blob, bd);
+} +#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
Please don't add trailing empty lines.
diff --git a/include/configs/stxssa.h b/include/configs/stxssa.h index 363f7b4..d7adee9 100644 --- a/include/configs/stxssa.h +++ b/include/configs/stxssa.h
...
-#define CONFIG_MPC8560 1 +#define CONFIG_MPC8555 1
Hm... is this correct? The board I have here actually seems to use a 8541E ?
@@ -419,6 +426,20 @@ #define CONFIG_ETH2ADDR 00:e0:0c:07:9b:8c #endif
+/*
Please max. 2 blank lines.
- Configuration options for EEPROM or FLASH Setup
- */
+#define CONFIG_SERVERIP 10.10.0.150 +#define CONFIG_IPADDR 10.10.0.95 +#define CONFIG_GATEWAYIP 10.10.0.1 +#define CONFIG_NETMASK 255.255.255.0 +#define CONFIG_HOSTNAME STX_SSA +#define CONFIG_ROOTPATH /opt/ppc/ppc_85xx +#define CONFIG_BOOTFILE stxssa/uImage +#define CONFIG_FDTFILE stxssa/stxssa.fdt
NAK. We do not allow network configuration in the board config file; it may be correct for you, but it is wrong for all other users.
Best regards,
Wolfgang Denk

Hi, Wolfgang,
On Wed, Jul 21, 2010 at 4:50 PM, Wolfgang Denk wd@denx.de wrote:
Dear Bradley Hughes,
your Subject: is WAY too long - please restict to some 60 characters or so.
In message AANLkTimM0NENrBZo9seY6OlLNmU_fz3tv9LWZeG8ykRN@mail.gmail.com you wrote:
Change the configuration for the STx GP3-SSA board in order to support FDT parsing and passing.
...and please don't repeat the same in the commit message.
ACK... Sorry for this... it is my first time submitting a patch to the community. I appreciate the feedback in how things are done; thanks!
...
diff --git a/board/stx/stxssa/stxssa.c b/board/stx/stxssa/stxssa.c index 0b2584c..9cd2c62 100644 --- a/board/stx/stxssa/stxssa.c +++ b/board/stx/stxssa/stxssa.c @@ -40,6 +40,8 @@ #include <spd_sdram.h> #include <miiphy.h> #include <netdev.h> +#include <libfdt.h> +#include <fdt_support.h>
long int fixed_sdram (void);
@@ -407,3 +409,11 @@ int board_eth_init(bd_t *bis) cpu_eth_init(bis); /* Initialize TSECs first */ return pci_eth_init(bis); }
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +void ft_board_setup(void *blob, bd_t *bd) +{
- ft_cpu_setup(blob, bd);
+} +#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
Please don't add trailing empty lines.
diff --git a/include/configs/stxssa.h b/include/configs/stxssa.h index 363f7b4..d7adee9 100644 --- a/include/configs/stxssa.h +++ b/include/configs/stxssa.h
...
-#define CONFIG_MPC8560 1 +#define CONFIG_MPC8555 1
Hm... is this correct? The board I have here actually seems to use a 8541E ?
The board has two population options; the 8541E and 8555E are pin compatible. The one I am working on right now has the 8555.
What would be the best way to achieve compatibility? Should the stxssa be split into two boards? Or is there a better facility to accommodate this? (#if 0 ... #else ... #endif block?) Perhaps another board does this that I could use as an example?
@@ -419,6 +426,20 @@ #define CONFIG_ETH2ADDR 00:e0:0c:07:9b:8c #endif
+/*
Please max. 2 blank lines.
- Configuration options for EEPROM or FLASH Setup
- */
+#define CONFIG_SERVERIP 10.10.0.150 +#define CONFIG_IPADDR 10.10.0.95 +#define CONFIG_GATEWAYIP 10.10.0.1 +#define CONFIG_NETMASK 255.255.255.0 +#define CONFIG_HOSTNAME STX_SSA +#define CONFIG_ROOTPATH /opt/ppc/ppc_85xx +#define CONFIG_BOOTFILE stxssa/uImage +#define CONFIG_FDTFILE stxssa/stxssa.fdt
NAK. We do not allow network configuration in the board config file; it may be correct for you, but it is wrong for all other users.
Certainly, I'll remove all of the network configuration lines, fix whitespace problems, and resubmit. In the mean time I'd appreciate pointers on the multiple processor per board issue.
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@denx.de "The X11 source code style is ATROCIOUS and should not be used as a model." - Doug Gwyn
Best Regards, Bradley

Dear Bradley Hughes,
In message AANLkTimS_i7NRtDPCUzT3lxoxS15EoTAdC6tUoGQbn-u@mail.gmail.com you wrote:
-#define CONFIG_MPC8560 1 +#define CONFIG_MPC8555 1
Hm... is this correct? The board I have here actually seems to use a 8541E ?
The board has two population options; the 8541E and 8555E are pin compatible. The one I am working on right now has the 8555.
What would be the best way to achieve compatibility? Should the stxssa be split into two boards? Or is there a better facility to accommodate this? (#if 0 ... #else ... #endif block?) Perhaps another board does this that I could use as an example?
If needed we could add this a separate Makefile targets; but if the same U-Boot image really runs on both systems (displaying the correct CPU id?), then we don't need this. It's OK to set this to 8555, then.
Best regards,
Wolfgang Denk

Dear Bradley Hughes,
In message AANLkTimM0NENrBZo9seY6OlLNmU_fz3tv9LWZeG8ykRN@mail.gmail.com you wrote:
Change the configuration for the STx GP3-SSA board in order to support FDT parsing and passing. Also changed default u-boot environment for convenience.
One more thing:
...
"consdev=ttyPSC0\0" \
...
This is almost certainly wrong. There is no PSC on a 85xx; on my board, "consdev=ttyS1" is needed.
Best regards,
Wolfgang Denk
participants (2)
-
Bradley Hughes
-
Wolfgang Denk