ppc4xx: Enable device tree support (fdt) on Kilauea per default
authorStefan Roese <sr@denx.de>
Thu, 11 Oct 2007 09:15:59 +0000 (11:15 +0200)
committerStefan Roese <sr@denx.de>
Wed, 31 Oct 2007 20:20:50 +0000 (21:20 +0100)
This patch enables the fdt support on the AMCC Kilauea eval board.
Additionally now EBC ranges fdt fixup is included to support NOR
FLASH mapping via the Linux physmap_of driver.

This Kilauea port now support booting arch/ppc and arch/powerpc
Linux kernels. The default environment "net_nfs" is for arch/ppc
and "net_nfs_fdt" is for arch/powerpc. In the long run, arch/ppc
support will be removed.

Signed-off-by: Stefan Roese <sr@denx.de>
board/amcc/kilauea/kilauea.c
include/configs/kilauea.h

index d91ee17a909e1a92be2873443e38cd68689c9d75..8767f758810165396573374888307e2e1a0ec6e7 100644 (file)
@@ -381,6 +381,20 @@ int post_hotkeys_pressed(void)
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 void ft_board_setup(void *blob, bd_t *bd)
 {
+       u32 val[4];
+       int rc;
+
        ft_cpu_setup(blob, bd);
+
+       /* Fixup NOR mapping */
+       val[0] = 0;                             /* chip select number */
+       val[1] = 0;                             /* always 0 */
+       val[2] = gd->bd->bi_flashstart;
+       val[3] = gd->bd->bi_flashsize;
+       rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges",
+                                 val, sizeof(val), 1);
+       if (rc)
+               printf("Unable to update property NOR mapping, err=%s\n",
+                      fdt_strerror(rc));
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 7858f8319810d0cd3870d20ea7420d5bacd3e1d3..461f8f0591d4fc71f506e147ae74eb4d1e71e355 100644 (file)
 
 #undef CONFIG_BOOTARGS
 
-#undef USE_LIBFDT
-#ifdef USE_LIBFDT
-/*
- * LIBFDT support is disabled for now since first Linux port is still
- * arch/ppc.
- */
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
        "logversion=2\0"                                                \
        "netdev=eth0\0"                                                 \
                ":${hostname}:${netdev}:off panic=1\0"                  \
        "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
        "net_nfs=tftp 200000 ${bootfile};"                              \
+               "run nfsargs addip addtty;"                             \
+               "bootm 200000\0"                                        \
+       "net_nfs_fdt=tftp 200000 ${bootfile};"                          \
                "tftp ${fdt_addr} ${fdt_file};"                         \
                "run nfsargs addip addtty;"                             \
                "bootm 200000 - ${fdt_addr}\0"                          \
        "nupdate=nand erase 0 60000;nand write 200000 0 60000;"         \
                "setenv filesize;saveenv\0"                             \
        "nupd=run nload nupdate\0"                                      \
-       ""
-#else
-#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
-       "logversion=2\0"                                                \
-       "netdev=eth0\0"                                                 \
-       "hostname=kilauea\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=ttyS0,${baudrate}\0"\
-       "net_nfs=tftp 200000 ${bootfile};"                              \
-               "run nfsargs addip addtty;"                             \
-               "bootm 200000\0"                                        \
-       "flash_nfs=run nfsargs addip addtty;"                           \
-               "bootm ${kernel_addr}\0"                                \
-       "flash_self=run ramargs addip addtty;"                          \
-               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
-       "rootpath=/opt/eldk/ppc_4xx\0"                                  \
-       "bootfile=kilauea/uImage\0"                                     \
-       "kernel_addr=fc000000\0"                                        \
-       "ramdisk_addr=fc200000\0"                                       \
-       "initrd_high=30000000\0"                                        \
-       "load=tftp 200000 kilauea/u-boot.bin\0"                         \
-       "update=protect off fffa0000 ffffffff;era fffa0000 ffffffff;"   \
-               "cp.b ${fileaddr} fffa0000 ${filesize};"                \
-               "setenv filesize;saveenv\0"                             \
-       "upd=run load update\0"                                         \
-       "nload=tftp 200000 kilauea/u-boot-nand.bin\0"                   \
-       "nupdate=nand erase 0 60000;nand write 200000 0 60000;"         \
-               "setenv filesize;saveenv\0"                             \
-       "nupd=run nload nupdate\0"                                      \
        "pciconfighost=1\0"                                             \
        ""
-#endif
 #define CONFIG_BOOTCOMMAND     "run flash_self"
 
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 
 #endif /* __CONFIG_H */
 
-#ifdef USE_LIBFDT
 /* pass open firmware flat tree */
 #define CONFIG_OF_LIBFDT       1
 #define CONFIG_OF_BOARD_SETUP  1
 
 #define OF_CPU                 "PowerPC,405EX@0"
-#endif