]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge branch 'master' of http://git.denx.de/u-boot-sunxi
authorTom Rini <trini@ti.com>
Tue, 25 Nov 2014 16:09:48 +0000 (11:09 -0500)
committerTom Rini <trini@ti.com>
Wed, 26 Nov 2014 16:21:16 +0000 (11:21 -0500)
114 files changed:
README
arch/nios2/cpu/fdt.c
arch/powerpc/cpu/ppc4xx/fdt.c
board/a3m071/a3m071.c
board/a4m072/a4m072.c
board/amcc/canyonlands/canyonlands.c
board/amcc/sequoia/sequoia.c
board/cm5200/cm5200.c
board/compulab/cm_fx6/cm_fx6.c
board/compulab/cm_t54/cm_t54.c
board/davedenx/aria/aria.c
board/esd/cpci405/cpci405.c
board/esd/mecp5123/mecp5123.c
board/esd/pmc405de/pmc405de.c
board/esd/pmc440/pmc440.c
board/esd/vme8349/vme8349.c
board/freescale/b4860qds/b4860qds.c
board/freescale/bsc9131rdb/bsc9131rdb.c
board/freescale/bsc9132qds/bsc9132qds.c
board/freescale/c29xpcie/c29xpcie.c
board/freescale/common/cds_pci_ft.c
board/freescale/corenet_ds/corenet_ds.c
board/freescale/ls1021aqds/ls1021aqds.c
board/freescale/ls1021atwr/ls1021atwr.c
board/freescale/ls2085a/ls2085a.c
board/freescale/mpc5121ads/mpc5121ads.c
board/freescale/mpc7448hpc2/mpc7448hpc2.c
board/freescale/mpc8308rdb/mpc8308rdb.c
board/freescale/mpc8313erdb/mpc8313erdb.c
board/freescale/mpc8315erdb/mpc8315erdb.c
board/freescale/mpc8323erdb/mpc8323erdb.c
board/freescale/mpc832xemds/mpc832xemds.c
board/freescale/mpc8349emds/mpc8349emds.c
board/freescale/mpc8349itx/mpc8349itx.c
board/freescale/mpc8360emds/mpc8360emds.c
board/freescale/mpc8360erdk/mpc8360erdk.c
board/freescale/mpc837xemds/mpc837xemds.c
board/freescale/mpc837xerdb/mpc837xerdb.c
board/freescale/mpc8536ds/mpc8536ds.c
board/freescale/mpc8540ads/mpc8540ads.c
board/freescale/mpc8544ds/mpc8544ds.c
board/freescale/mpc8560ads/mpc8560ads.c
board/freescale/mpc8568mds/mpc8568mds.c
board/freescale/mpc8569mds/mpc8569mds.c
board/freescale/mpc8572ds/mpc8572ds.c
board/freescale/mpc8610hpcd/mpc8610hpcd.c
board/freescale/mpc8641hpcn/mpc8641hpcn.c
board/freescale/p1010rdb/p1010rdb.c
board/freescale/p1022ds/p1022ds.c
board/freescale/p1023rdb/p1023rdb.c
board/freescale/p1_p2_rdb/p1_p2_rdb.c
board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
board/freescale/p1_twr/p1_twr.c
board/freescale/p2020come/p2020come.c
board/freescale/p2020ds/p2020ds.c
board/freescale/p2041rdb/p2041rdb.c
board/freescale/qemu-ppce500/qemu-ppce500.c
board/freescale/t1040qds/t1040qds.c
board/freescale/t104xrdb/t104xrdb.c
board/freescale/t208xqds/t208xqds.c
board/freescale/t208xrdb/t208xrdb.c
board/freescale/t4qds/t4240emu.c
board/freescale/t4qds/t4240qds.c
board/freescale/t4rdb/t4240rdb.c
board/galaxy5200/galaxy5200.c
board/gateworks/gw_ventana/gw_ventana.c
board/gdsys/intip/intip.c
board/gdsys/mpc8308/hrcon.c
board/gdsys/p1022/controlcenterd.c
board/highbank/highbank.c
board/icecube/icecube.c
board/ids/ids8313/ids8313.c
board/ifm/ac14xx/ac14xx.c
board/ifm/o2dnt2/o2dnt2.c
board/intercontrol/digsy_mtc/digsy_mtc.c
board/ipek01/ipek01.c
board/jupiter/jupiter.c
board/keymile/km82xx/km82xx.c
board/keymile/km83xx/km83xx.c
board/keymile/kmp204x/kmp204x.c
board/korat/korat.c
board/kup/kup4k/kup4k.c
board/manroland/mucmc52/mucmc52.c
board/manroland/uc101/uc101.c
board/motionpro/motionpro.c
board/mpc8308_p1m/mpc8308_p1m.c
board/muas3001/muas3001.c
board/munices/munices.c
board/pdm360ng/pdm360ng.c
board/phytec/pcm030/pcm030.c
board/raspberrypi/rpi_b/rpi_b.c
board/sbc8349/sbc8349.c
board/sbc8548/sbc8548.c
board/sbc8641d/sbc8641d.c
board/socrates/socrates.c
board/stx/stxssa/stxssa.c
board/ti/ks2_evm/board.c
board/tqc/tqm5200/tqm5200.c
board/tqc/tqm834x/tqm834x.c
board/tqc/tqm8xx/tqm8xx.c
board/tqc/tqma6/tqma6.c
board/ve8313/ve8313.c
board/xes/xpedite517x/xpedite517x.c
board/xes/xpedite520x/xpedite520x.c
board/xes/xpedite537x/xpedite537x.c
board/xes/xpedite550x/xpedite550x.c
common/board_f.c
common/cmd_fdt.c
common/fdt_support.c
common/image-fdt.c
include/fdt_support.h
include/fdtdec.h
include/image.h
lib/fdtdec.c

diff --git a/README b/README
index e7cd1bcb436dff45feb2be387eaee30323cc15ae..66770b648539701fe0fdd8b36b1076359557ddd3 100644 (file)
--- a/README
+++ b/README
@@ -783,6 +783,13 @@ The following options need to be configured:
                Board code has addition modification that it wants to make
                to the flat device tree before handing it off to the kernel
 
+               CONFIG_OF_SYSTEM_SETUP
+
+               Other code has addition modification that it wants to make
+               to the flat device tree before handing it off to the kernel.
+               This causes ft_system_setup() to be called before booting
+               the kernel.
+
                CONFIG_OF_BOOT_CPU
 
                This define fills in the correct boot CPU in the boot
@@ -3510,7 +3517,7 @@ FIT uImage format:
                to 128 or 256, although it does not have to be power of 2).
 
                default: 4096
-               
+
                CONFIG_MTD_UBI_BEB_LIMIT
                This option specifies the maximum bad physical eraseblocks UBI
                expects on the MTD device (per 1024 eraseblocks). If the
index 4d88f169df7c12c797c4e39b40ac769d0b56e0eb..502468208820a25b9f72905a10a8e49bdf418b9a 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-void __ft_board_setup(void *blob, bd_t *bd)
+int __ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
-void ft_board_setup(void *blob, bd_t *bd) \
+int ft_board_setup(void *blob, bd_t *bd)
        __attribute__((weak, alias("__ft_board_setup")));
 
 void ft_cpu_setup(void *blob, bd_t *bd)
@@ -32,5 +34,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
         * Note: aliases in the dts are required for this
         */
        fdt_fixup_ethernet(blob);
+
+       return 0;
 }
 #endif /* CONFIG_OF_LIBFDT && CONFIG_OF_BOARD_SETUP */
index bd905d15863b99ca6c0e81f75bf2d5c69dee514b..eef9c5a17fa78cabf27de3d4d834cd9f335b592c 100644 (file)
@@ -18,7 +18,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-void __ft_board_setup(void *blob, bd_t *bd)
+int __ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
        int i;
@@ -60,8 +60,11 @@ void __ft_board_setup(void *blob, bd_t *bd)
                printf("Unable to update property EBC mappings, err=%s\n",
                       fdt_strerror(rc));
        }
+
+       return 0;
 }
-void ft_board_setup(void *blob, bd_t *bd) __attribute__((weak, alias("__ft_board_setup")));
+int ft_board_setup(void *blob, bd_t *bd)
+               __attribute__((weak, alias("__ft_board_setup")));
 
 /*
  * Fixup all PCIe nodes by setting the device_type property
index b96ba811fa2823f7ac6e021597cb3ccf06995c94..ee1681b5db18ca08d6126bb6c042f5d7e71b79e1 100644 (file)
@@ -392,9 +392,11 @@ int misc_init_r(void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t * bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */
 
index d3d4c181afad83d3b3dd8d43b449ce90b7d6ff58..c5d161bca3bcc6df2fb228d380e0e2482c2e5d90 100644 (file)
@@ -171,10 +171,11 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
 
index 79d4babe067146fac76fa18a6ed11c8400389000..c5cc4ffa690d9c69f595525b6d9ccc9988f6eb92 100644 (file)
@@ -490,9 +490,9 @@ int misc_init_r(void)
 #endif /* !defined(CONFIG_ARCHES) */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-extern void __ft_board_setup(void *blob, bd_t *bd);
+extern int __ft_board_setup(void *blob, bd_t *bd);
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        __ft_board_setup(blob, bd);
 
@@ -515,5 +515,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                fdt_find_and_setprop(blob, "/plb/sata@bffd1000", "status",
                                     "disabled", sizeof("disabled"), 1);
        }
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 53f9b3419faa4961d3eb10a60471ae69edd4cdc4..91c6cbf7aa80d95e2d351940774e9df9f03b7187 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <errno.h>
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <asm/ppc4xx.h>
@@ -363,7 +364,7 @@ void board_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
  * On NAND-booting sequoia, we need to patch the chips select numbers
  * in the dtb (CS0 - NAND, CS3 - NOR)
  */
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
        int len;
@@ -381,15 +382,14 @@ void ft_board_setup(void *blob, bd_t *bd)
        prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);
        if (prop == NULL) {
                printf("Unable to update NOR chip select for NAND booting\n");
-               return;
+               return -FDT_ERR_NOTFOUND;
        }
        reg = (u32 *)&prop->data[0];
        reg[0] = 3;
        rc = fdt_find_and_setprop(blob, path, "reg", reg, 3 * sizeof(u32), 1);
        if (rc) {
-               printf("Unable to update property NOR mappings, err=%s\n",
-                      fdt_strerror(rc));
-               return;
+               printf("Unable to update property NOR mappings\n");
+               return rc;
        }
 
        /* And now configure NAND chip select to 0 instead of 3 */
@@ -398,15 +398,16 @@ void ft_board_setup(void *blob, bd_t *bd)
        prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);
        if (prop == NULL) {
                printf("Unable to update NDFC chip select for NAND booting\n");
-               return;
+               return len;
        }
        reg = (u32 *)&prop->data[0];
        reg[0] = 0;
        rc = fdt_find_and_setprop(blob, path, "reg", reg, 3 * sizeof(u32), 1);
        if (rc) {
-               printf("Unable to update property NDFC mappings, err=%s\n",
-                      fdt_strerror(rc));
-               return;
+               printf("Unable to update property NDFC mapping\n");
+               return rc;
        }
+
+       return 0;
 }
 #endif /* CONFIG_SYS_RAMBOOT */
index 048aa6c2e914aa806d52d03e7c8b53d0922ab54b..5276907b45ca249ad46f71c13aea47ae5dd4c316 100644 (file)
@@ -359,9 +359,11 @@ int last_stage_init(void)
 
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        ft_blob_update(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 09e285b74db81b34e4e32790cd06887f786fb7dd..84e36439fa18ddf10040043f63abd2fba478562f 100644 (file)
@@ -458,7 +458,7 @@ int cm_fx6_setup_ecspi(void) { return 0; }
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        uint8_t enetaddr[6];
 
@@ -467,6 +467,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                fdt_find_and_setprop(blob, "/fec", "local-mac-address",
                                     enetaddr, 6, 1);
        }
+
+       return 0;
 }
 #endif
 
index b1a067d8816fddeec015d3652595141040de7077..2c2530ab3fd1e6ce5c3e200276bebaac51daea43 100644 (file)
@@ -121,7 +121,7 @@ int board_mmc_init(bd_t *bis)
 
 #ifdef CONFIG_USB_HOST_ETHER
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        uint8_t enetaddr[6];
 
@@ -130,6 +130,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                fdt_find_and_setprop(blob, "/smsc95xx@0", "mac-address",
                                     enetaddr, 6, 1);
        }
+
+       return 0;
 }
 
 static void generate_mac_addr(uint8_t *enetaddr)
index c740669f33ea2ca2c488674454c1bfa13eaa7557..a15a9edac4569a633e002fa00fb2fde26f5be903 100644 (file)
@@ -107,8 +107,10 @@ int checkboard (void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 63cd862d2d2ff6b31dc94042eee924b430cc0c49..e23ec55f2bbeb6018ec6905148ed191229667b3b 100644 (file)
@@ -508,7 +508,7 @@ int pci_pre_init(struct pci_controller *hose)
 #endif /* defined(CONFIG_PCI) */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
 
@@ -526,6 +526,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                               fdt_strerror(rc));
                }
        }
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 97006116f4ed6ee2479a28b2a0b4da3a5f519be0..cda1d7bccc5911b5a471e43c249f150ce08fe16c 100644 (file)
@@ -199,8 +199,10 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 4409ea6524feb0d708af89d540bdd0cec0644069..3e1713247d34c13cb052be830ae5706b529070b9 100644 (file)
@@ -300,7 +300,7 @@ int pci_pre_init(struct pci_controller *hose)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
 
@@ -318,6 +318,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                               fdt_strerror(rc));
                }
        }
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 062ae67276157e3287a0fdec2bde0fd235281e34..15c3151b8421587947d447504323be366e72efce 100644 (file)
@@ -882,7 +882,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
 #endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_BOARD_INIT) */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
 
@@ -899,5 +899,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                        printf("err=%s\n", fdt_strerror(rc));
                }
        }
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 01365dcbd3aeddd59013340364aed70fa4b79027..f8f1834b59c119a1669fd453ef1eb2360a798a25 100644 (file)
@@ -74,13 +74,15 @@ int board_eth_init(bd_t *bis)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
 
index 34d66d5fd2dd59891d77288cbaeb39988dc2b12e..bed8f56be43a0adb187e7bd87cdede01b89d6b1f 100644 (file)
@@ -1110,7 +1110,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -1136,6 +1136,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 
 /*
index 9146f492626e5a3e378e83d11cb7d5bececca404..75e114217b6a6d94ccd0a7ed7dc4483bb0e8aeca 100644 (file)
@@ -58,7 +58,7 @@ struct node_info nodes[] = {
        { "fsl,ifc-nand",               MTD_DEV_TYPE_NAND, },
 };
 #endif
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -74,5 +74,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 
        fdt_fixup_dr_usb(blob, bd);
+
+       return 0;
 }
 #endif
index c88838b3dfac59a7d83e002c222e14128e167b82..36a68dbc4dba95ae0990c9f3a900a4b487f5ee85 100644 (file)
@@ -363,7 +363,7 @@ struct node_info nodes[] = {
        { "fsl,ifc-nand",               MTD_DEV_TYPE_NAND, },
 };
 #endif
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -423,5 +423,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                        printf("\nRemove sim from hwconfig and reset\n");
                }
        }
+
+       return 0;
 }
 #endif
index 534c6d11b056034b72e409d6f809aae11aee1468..d75770969b1891f56dea3b077a5e77377999b037 100644 (file)
@@ -128,7 +128,7 @@ void fdt_del_sec(void *blob, int offset)
        }
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -150,5 +150,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                fdt_del_sec(blob, 1);
        else if (cpu->soc_ver == SVR_C292)
                fdt_del_sec(blob, 2);
+
+       return 0;
 }
 #endif
index 2e5dcdf0e285a00f771e1e8fdec6146a18540915..571dfbbaada6e6607ebd1f416259a2dd43d16470 100644 (file)
@@ -63,13 +63,14 @@ static void cds_pci_fixup(void *blob)
        }
 }
 
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
        cds_pci_fixup(blob);
 #endif
+
+       return 0;
 }
 #endif
index 65b386741e166c9e0d0c56d69ef7a2a6ba853111..6f0fea1a3566a57c4efb4fec5078149bc767168e 100644 (file)
@@ -190,7 +190,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -213,4 +213,6 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
index 5fafc8567207d3d777f40567dfb90aec92670196..7441a6b464321b95e9731af65545e9c25de2ab75 100644 (file)
@@ -240,9 +240,11 @@ int board_init(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 
 u8 flash_read8(void *addr)
index 50d564055b173ddd2ee46db63b2797168e7e2544..ee7876969e0ca389af35099eaf032b8ce6c66b6e 100644 (file)
@@ -290,9 +290,11 @@ int misc_init_r(void)
 }
 #endif
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 
 u8 flash_read8(void *addr)
index 2c79a7181ecc53db55eb50591470f44e3ea1efc2..163a4c486a6acb03c43b377902af8e2112a8c54d 100644 (file)
@@ -100,7 +100,7 @@ void fdt_fixup_board_enet(void *fdt)
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -115,5 +115,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_FSL_MC_ENET
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 #endif
index 940978e649e6b6dbe1d44eee5f40c9b70f6d4bc0..40bd55dfba6c6fa8ea27d6959a987f099790a0b9 100644 (file)
@@ -275,8 +275,10 @@ int checkboard (void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 71b760c4a98ee715dea8fe0c2e729167b4236ee3..11747ca4a4ebc037e3be876d3894d84bb5f4b335 100644 (file)
@@ -70,11 +70,12 @@ phys_size_t initdram (int board_type)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
+
+       return 0;
 }
 #endif
 
index fba41fe504a7ca616655792ba6860410eb45c4a4..93e1c50f393a0cccbd5a429607eb3b8859382ee5 100644 (file)
@@ -161,11 +161,13 @@ int misc_init_r(void)
        return 0;
 }
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        fdt_fixup_dr_usb(blob, bd);
        fdt_fixup_esdhc(blob, bd);
+
+       return 0;
 }
 #endif
 
index 69e98a50074b581761893eae0c1a0ffcb5de77ba..eac193e8177620aa57efe29c249dfb1f921a2410 100644 (file)
@@ -116,12 +116,14 @@ int misc_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
 #else /* CONFIG_SPL_BUILD */
index e6f091fd2f4c6060d1c1aa9dc0e465c267ecc30b..ed611c56c3f11dc700351c14b38c52746ece3b19 100644 (file)
@@ -188,7 +188,7 @@ void fdt_tsec1_fixup(void *fdt, bd_t *bd)
        do_fixup_by_path(fdt, path, "status", disabled, sizeof(disabled), 1);
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
@@ -196,6 +196,8 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
        fdt_fixup_dr_usb(blob, bd);
        fdt_tsec1_fixup(blob, bd);
+
+       return 0;
 }
 #endif
 
index 3dce3623a411acb147d19518a664a141cc246eeb..0a0152ad9ea30969d8c4de54c5fcbe2a495a1c8a 100644 (file)
@@ -172,12 +172,14 @@ void pci_init_board(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
 
index b7ea0e44c39034d991c39da68b6b77f280297b30..adf425486e1edb92e9ccc89a84d245c413fffa51 100644 (file)
@@ -154,11 +154,13 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index d9092201aa549552bd2792a56b070d459f428131..02b5040ef4af177b18f3421bd709e14b3fb48c3f 100644 (file)
@@ -273,11 +273,13 @@ void spi_cs_deactivate(struct spi_slave *slave)
 #endif /* CONFIG_HARD_SPI */
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index 803d722806046ab3fc296631b6094d0641e9895a..22a1d99c8846ae6bb2115b994f1c90711cd2ed2b 100644 (file)
@@ -378,11 +378,13 @@ int misc_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index 5ff9dff5870791aa085426f3f1ebc18c88d22bf0..f0a55f8a8d8c3ef27f61161c1e2741dffe864432 100644 (file)
@@ -402,7 +402,7 @@ static void ft_board_fixup_qe_usb(void *blob, bd_t *bd)
                           "peripheral", sizeof("peripheral"), 1);
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
@@ -447,5 +447,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
                }
        }
+
+       return 0;
 }
 #endif
index fef230bfbd5683bead9042b7cd13ceec08f302c9..478f8205a9c780bcdfa40334a3b3f90584d0d2a9 100644 (file)
@@ -340,9 +340,11 @@ void pci_init_board(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        ft_pci_setup(blob, bd);
+
+       return 0;
 }
 #endif
index c749e5553a785c115a4571752048ca645bb22057..572913c7ac521ce1f55758079bf49ea6a2ec031f 100644 (file)
@@ -328,7 +328,7 @@ static void ft_pci_fixup(void *blob, bd_t *bd)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        ft_tsec_fixup(blob, bd);
@@ -340,5 +340,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                ft_pci_fixup(blob, bd);
        ft_pcie_fixup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
index 9afdcaf7aefbbd18f361d3f4e39016eb2a5f881e..e0a10313808d519206eb5b0df1f827973cff4152 100644 (file)
@@ -199,7 +199,7 @@ int misc_init_r(void)
 
 #if defined(CONFIG_OF_BOARD_SETUP)
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
@@ -207,5 +207,7 @@ void ft_board_setup(void *blob, bd_t *bd)
        ft_cpu_setup(blob, bd);
        fdt_fixup_dr_usb(blob, bd);
        fdt_fixup_esdhc(blob, bd);
+
+       return 0;
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
index 93eed59b1a95b23dda37ec20c2b06798bf9604ae..7b0f46197147b36db16cd790aad7a253663da687 100644 (file)
@@ -271,7 +271,7 @@ int board_eth_init(bd_t *bis)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
@@ -285,5 +285,6 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_dr_usb(blob, bd);
 #endif
 
+       return 0;
 }
 #endif
index 93288c7e9ce0252f8a7ee1ecdaa3b2e9f9153919..1069e2c8c86b803d29cd997bfc638b3314ddf160 100644 (file)
@@ -218,8 +218,7 @@ pci_init_board(void)
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int node, tmp[2];
        const char *path;
@@ -237,5 +236,7 @@ ft_board_setup(void *blob, bd_t *bd)
                }
 #endif
        }
+
+       return 0;
 }
 #endif
index 1b33db6f31448b58651ebb5d8971f2f1f4caccf4..66fb228a908943fced11e9d2178e4d112658ca8b 100644 (file)
@@ -305,7 +305,7 @@ int board_eth_init(bd_t *bis)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
@@ -314,5 +314,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_FSL_SGMII_RISER
        fsl_sgmii_riser_fdt_fixup(blob);
 #endif
+
+       return 0;
 }
 #endif
index 7104e33156efc2f7918b301bec24d23deebe8352..f99d639b2fbfda636c3dfa5b42c5642d15958b12 100644 (file)
@@ -438,8 +438,7 @@ pci_init_board(void)
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int node, tmp[2];
        const char *path;
@@ -457,5 +456,7 @@ ft_board_setup(void *blob, bd_t *bd)
                }
 #endif
        }
+
+       return 0;
 }
 #endif
index a8fdcb5f917704ab824b9cde76a74bc578c7d012..a5c5d9dd1acae394921b1fe9fedd455fc5fd5385 100644 (file)
@@ -345,10 +345,12 @@ void pci_init_board(void)
 #endif /* CONFIG_PCI */
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
index cb55e1c98c0dba1059bbd8afad4157d5456aec06..836578f3cb827935fefd7b0acff3aafb1e6f1ce0 100644 (file)
@@ -514,7 +514,7 @@ void pci_init_board(void)
 #endif /* CONFIG_PCI */
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #if defined(CONFIG_SYS_UCC_RMII_MODE)
        int nodeoff, off, err;
@@ -579,5 +579,7 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_board_fixup_esdhc(blob, bd);
        fdt_board_fixup_qe_uart(blob, bd);
        fdt_board_fixup_qe_usb(blob, bd);
+
+       return 0;
 }
 #endif
index 1bbf83214873d35a41974dddca61f6c9d8de3181..3f68cf496a45487e3c0888cb5d8f78adf1876c20 100644 (file)
@@ -232,7 +232,7 @@ int board_eth_init(bd_t *bis)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -249,5 +249,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_FSL_SGMII_RISER
        fsl_sgmii_riser_fdt_fixup(blob);
 #endif
+
+       return 0;
 }
 #endif
index d8740ddaccf4e22e0ee783f63d40e53e96dc4c5f..95e398c9f4958d540026648638c2de16029e7c44 100644 (file)
@@ -258,12 +258,13 @@ void pci_init_board(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
 
index a58b5f9cd4bc8e178a17451765dc3636ece2345a..94633b5c99dcc38334c939e24524d14ea1b4ed14 100644 (file)
@@ -119,12 +119,11 @@ void pci_init_board(void)
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int off;
        u64 *tmp;
-       u32 *addrcells;
+       int addrcells;
 
        ft_cpu_setup(blob, bd);
 
@@ -136,12 +135,13 @@ ft_board_setup(void *blob, bd_t *bd)
         * which is defined by the "reg" property in the soc node.
         */
        off = fdt_path_offset(blob, "/soc8641");
-       addrcells = (u32 *)fdt_getprop(blob, 0, "#address-cells", NULL);
+       addrcells = fdt_address_cells(blob, 0);
        tmp = (u64 *)fdt_getprop(blob, off, "reg", NULL);
 
        if (tmp) {
                u64 addr;
-               if (addrcells && (*addrcells == 1))
+
+               if (addrcells == 1)
                        addr = *(u32 *)tmp;
                else
                        addr = *tmp;
@@ -152,6 +152,8 @@ ft_board_setup(void *blob, bd_t *bd)
                               "in u-boot.  This means your .dts might "
                               "be old.\n");
        }
+
+       return 0;
 }
 #endif
 
index 491b576258cd7f972bb81df4ef22e677bfa04497..1cf0ab78b71fe992ab454b65d3531f0a3a92a43f 100644 (file)
@@ -444,7 +444,7 @@ void fdt_disable_uart1(void *blob)
        }
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -496,6 +496,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                fdt_del_flexcan(blob);
                fdt_disable_uart1(blob);
        }
+
+       return 0;
 }
 #endif
 
index f5e18515a0f867b511bf66a0ce24582c8e453ed1..d7dd478dff903f6d0495ae1939b2f1a6aed78b84 100644 (file)
@@ -332,7 +332,7 @@ static void ft_codec_setup(void *blob, const char *compatible)
        }
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -356,5 +356,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 
        /* Update the WM8776 node's clock frequency property */
        ft_codec_setup(blob, "wlf,wm8776");
+
+       return 0;
 }
 #endif
index d4d277ba6d3c1ba866a1a1a8dfdd0f551167625f..56f561a50582f6d76b0e61ee2db540d0709bc970 100644 (file)
@@ -130,7 +130,7 @@ int board_eth_init(bd_t *bis)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -147,5 +147,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 
        fdt_fixup_fman_ethernet(blob);
+
+       return 0;
 }
 #endif
index aba4f534b8655b5d532dd36e2086328013cbcc84..61ed466fa7f7e421550ed1b60116792cb0686434 100644 (file)
@@ -234,7 +234,7 @@ int board_eth_init(bd_t *bis)
 #if defined(CONFIG_OF_BOARD_SETUP)
 extern void ft_pci_board_setup(void *blob);
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        const char *soc_usb_compat = "fsl-usb2-dr";
        int err, usb1_off, usb2_off;
@@ -263,39 +263,41 @@ void ft_board_setup(void *blob, bd_t *bd)
                int off = fdt_node_offset_by_compatible(blob, -1,
                        soc_elbc_compat);
                if (off < 0) {
-                       printf("WARNING: could not find compatible node"
-                               " %s: %s.\n", soc_elbc_compat,
-                               fdt_strerror(off));
-                               return;
+                       printf("WARNING: could not find compatible node %s\n",
+                              soc_elbc_compat);
+                       return off;
                }
                err = fdt_del_node(blob, off);
                if (err < 0) {
-                       printf("WARNING: could not remove %s: %s.\n",
-                               soc_elbc_compat, fdt_strerror(err));
+                       printf("WARNING: could not remove %s\n",
+                              soc_elbc_compat);
+                       return err;
                }
-               return;
+               return 0;
        }
 #endif
        /* Delete USB2 node as it is muxed with eLBC */
        usb1_off = fdt_node_offset_by_compatible(blob, -1,
                soc_usb_compat);
        if (usb1_off < 0) {
-               printf("WARNING: could not find compatible node"
-                       " %s: %s.\n", soc_usb_compat,
-                       fdt_strerror(usb1_off));
-               return;
+               printf("WARNING: could not find compatible node %s\n",
+                      soc_usb_compat);
+               return usb1_off;
        }
        usb2_off = fdt_node_offset_by_compatible(blob, usb1_off,
                        soc_usb_compat);
        if (usb2_off < 0) {
-               printf("WARNING: could not find compatible node"
-                       " %s: %s.\n", soc_usb_compat,
-                       fdt_strerror(usb2_off));
-               return;
+               printf("WARNING: could not find compatible node %s\n",
+                      soc_usb_compat);
+               return usb2_off;
        }
        err = fdt_del_node(blob, usb2_off);
-       if (err < 0)
-               printf("WARNING: could not remove %s: %s.\n",
-                       soc_usb_compat, fdt_strerror(err));
+       if (err < 0) {
+               printf("WARNING: could not remove %s\n", soc_usb_compat);
+               return err;
+       }
+
+       return 0;
 }
+
 #endif
index a6756c68f40f3698a330249299a13b3bb9317a95..3f47cfbb82aa3e9b2b547a31feaa0ea39d18f44b 100644 (file)
@@ -424,7 +424,7 @@ static void fdt_board_fixup_qe_pins(void *blob)
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -459,17 +459,17 @@ void ft_board_setup(void *blob, bd_t *bd)
                int off = fdt_node_offset_by_compatible(blob, -1,
                                soc_elbc_compat);
                if (off < 0) {
-                       printf("WARNING: could not find compatible node %s: %s.\n",
-                              soc_elbc_compat,
-                              fdt_strerror(off));
-                               return;
+                       printf("WARNING: could not find compatible node %s\n",
+                              soc_elbc_compat);
+                       return off;
                }
                err = fdt_del_node(blob, off);
                if (err < 0) {
-                       printf("WARNING: could not remove %s: %s.\n",
-                              soc_elbc_compat, fdt_strerror(err));
+                       printf("WARNING: could not remove %s\n",
+                              soc_elbc_compat);
+                       return err;
                }
-               return;
+               return 0;
        }
 #endif
 
@@ -477,24 +477,23 @@ void ft_board_setup(void *blob, bd_t *bd)
        usb1_off = fdt_node_offset_by_compatible(blob, -1,
                soc_usb_compat);
        if (usb1_off < 0) {
-               printf("WARNING: could not find compatible node %s: %s.\n",
-                      soc_usb_compat,
-                      fdt_strerror(usb1_off));
-               return;
+               printf("WARNING: could not find compatible node %s\n",
+                      soc_usb_compat);
+               return usb1_off;
        }
        usb2_off = fdt_node_offset_by_compatible(blob, usb1_off,
                        soc_usb_compat);
        if (usb2_off < 0) {
-               printf("WARNING: could not find compatible node %s: %s.\n",
-                      soc_usb_compat,
-                      fdt_strerror(usb2_off));
-               return;
+               printf("WARNING: could not find compatible node %s\n",
+                      soc_usb_compat);
+               return usb2_off;
        }
        err = fdt_del_node(blob, usb2_off);
        if (err < 0) {
-               printf("WARNING: could not remove %s: %s.\n",
-                      soc_usb_compat, fdt_strerror(err));
+               printf("WARNING: could not remove %s\n", soc_usb_compat);
+               return err;
        }
 
+       return 0;
 }
 #endif
index a0a416ba17667784044ab961376ce1532830dd11..a40bea328b02154a0ffa925c32c86f72cc538d80 100644 (file)
@@ -261,7 +261,7 @@ static void fdt_board_fixup_qe_pins(void *blob)
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -283,5 +283,7 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_board_fixup_qe_pins(blob);
 #endif
        fdt_fixup_dr_usb(blob, bd);
+
+       return 0;
 }
 #endif
index f777bb9d679d45237a5481346ee74b5a14d5e369..1db37e3be8e4d0ad856c5ac142939741f3e0c361 100644 (file)
@@ -250,7 +250,7 @@ int board_eth_init(bd_t *bis)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -269,5 +269,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_HAS_FSL_DR_USB
        fdt_fixup_dr_usb(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index b72fcffdd08dd9e579ae901a50902ff9e328692a..5d18e8de75a3de7384847c36ed02d5426b4aa6d2 100644 (file)
@@ -236,7 +236,7 @@ int board_eth_init(bd_t *bis)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -257,5 +257,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_FSL_SGMII_RISER
        fsl_sgmii_riser_fdt_fixup(blob);
 #endif
+
+       return 0;
 }
 #endif
index a14b43b5a503e4a272e7e6baab96e37ce858467c..e600bdbc2a87a38ab014d268aac95cbcfd733ed3 100644 (file)
@@ -215,7 +215,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -239,4 +239,6 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_SYS_DPAA_FMAN
        fdt_fixup_fman_ethernet(blob);
 #endif
+
+       return 0;
 }
index 230870d90e442d2d1ac7c6730218bfe725467116..a0fca0d88083105e07a71cb4cccd23ed0751f325 100644 (file)
@@ -235,9 +235,11 @@ int board_eth_init(bd_t *bis)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
 
index 19af46e48fdb1ba15a7d828cf40fdd49eb577f28..13285be42cf394a3b711e24a79cf8df969319286 100644 (file)
@@ -233,7 +233,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -259,6 +259,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 
 void qixis_dump_switch(void)
index ddb669fb06c9b8b5e982863477395f9eb971571a..4734f9dd93b17faf924661fc1a16efcd82214461 100644 (file)
@@ -85,7 +85,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -110,6 +110,8 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_SYS_DPAA_FMAN
        fdt_fixup_fman_ethernet(blob);
 #endif
+
+       return 0;
 }
 
 #ifdef CONFIG_DEEP_SLEEP
index fc6d25611171603fb1963c58392270b3dbffd5da..5c470c3a497123abc79c8bb92664908dc73ca5e0 100644 (file)
@@ -437,7 +437,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -460,4 +460,6 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
index be99fb806dd73648918bd8eaf829912f4b85fb4e..341453bc74e8c6b9d434fd264edccd4b9e1e5ab6 100644 (file)
@@ -103,7 +103,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -126,4 +126,6 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
index 479e124a3969d13f9b2bc6b5c95dc44827267529..54410943f28123b693480bd32ff6873181de6942 100644 (file)
@@ -69,7 +69,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -83,4 +83,6 @@ void ft_board_setup(void *blob, bd_t *bd)
 
        fdt_fixup_liodn(blob);
        fdt_fixup_dr_usb(blob, bd);
+
+       return 0;
 }
index 6205fea35e72dc9fbaad6ec18e567997212c7d7d..4f2cccd709d6554dbda9fd30e432265fb9b3e0b2 100644 (file)
@@ -683,7 +683,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -706,6 +706,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 
 /*
index 2ff77b8487313d0862adbd5df93d85edd0a0fec0..fac442bfc8c8e9ab68eda0a9be8ad5fb74914a28 100644 (file)
@@ -88,7 +88,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -111,6 +111,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 
 /*
index 29e40eb58aafb78379913168cbe461216f7a04d3..5d957b7e70f032eedfe3fd7aef88cb8b98e184c9 100644 (file)
@@ -146,9 +146,11 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t * bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index df491a8fc8869afc5a531302a315f5fc713c51d2..bb08cd272ef28b439326c3c63499f87a58788e8e 100644 (file)
@@ -1483,7 +1483,7 @@ int misc_init_r(void)
  *  - board (full model from EEPROM)
  *  - peripherals removed from DTB if not loaded on board (per EEPROM config)
  */
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        struct ventana_board_info *info = &ventana_info;
        struct ventana_eeprom_config *cfg;
@@ -1495,7 +1495,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 
        if (getenv("fdt_noauto")) {
                puts("   Skiping ft_board_setup (fdt_noauto defined)\n");
-               return;
+               return 0;
        }
 
        /* Update partition nodes using info from mtdparts env var */
@@ -1504,7 +1504,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 
        if (!model) {
                puts("invalid board info: Leaving FDT fully enabled\n");
-               return;
+               return 0;
        }
        printf("   Adjusting FDT per EEPROM for %s...\n", model);
 
@@ -1523,7 +1523,7 @@ void ft_board_setup(void *blob, bd_t *bd)
         */
        if (getenv("fdt_noconfig")) {
                puts("   Skiping periperhal config (fdt_noconfig defined)\n");
-               return;
+               return 0;
        }
        cfg = econfig;
        while (cfg->name) {
@@ -1533,6 +1533,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                }
                cfg++;
        }
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */
 
index ee6f9e06c354d526534fd542e287a2e281b376cc..8d01d8b116f510a3181c614277302f95f080f4c8 100644 (file)
@@ -206,7 +206,7 @@ int misc_init_r(void)
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 extern void __ft_board_setup(void *blob, bd_t *bd);
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        __ft_board_setup(blob, bd);
 
@@ -215,5 +215,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 
        fdt_find_and_setprop(blob, "/plb/sata@bffd1000", "status",
                             "disabled", sizeof("disabled"), 1);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index a0516824bc61f482287f6b8c82dd059c972ed025..e4434b3b6b71c483588010783b0f2261ec997d76 100644 (file)
@@ -531,11 +531,13 @@ ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        fdt_fixup_dr_usb(blob, bd);
        fdt_fixup_esdhc(blob, bd);
+
+       return 0;
 }
 #endif
 
index f76d968962711a5612633b13a24b54d8ca826390..64d90dd3fde076ae2d88c82c57fcb5c484db1d50 100644 (file)
@@ -326,7 +326,7 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -343,6 +343,8 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
 
index a1b67494f6c526d6659a75f460c050d58f196978..fc2385cf31a527a7225abe142928edbc6aa4939e 100644 (file)
@@ -94,7 +94,7 @@ void dram_init_banksize(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *fdt, bd_t *bd)
+int ft_board_setup(void *fdt, bd_t *bd)
 {
        static const char disabled[] = "disabled";
        u32 reg = readl(HB_SREG_A9_PWRDOM_STAT);
@@ -106,6 +106,8 @@ void ft_board_setup(void *fdt, bd_t *bd)
        if (!(reg & PWRDOM_STAT_EMMC))
                do_fixup_by_compat(fdt, "calxeda,hb-sdhci", "status",
                        disabled, sizeof(disabled), 1);
+
+       return 0;
 }
 #endif
 
index a99416b3aaf211e79ff784be6ce00e08bdcb1824..f0af24ad9bd7d36ab054cdf38ed8fa5907823f94 100644 (file)
@@ -311,10 +311,11 @@ void ide_set_reset (int idereset)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
 
index f742143bb9de1d6b94accd6f1f6758a230ab23fd..e7838dcd2a6e73e3c1af7318e78d72129f6c8c34 100644 (file)
@@ -138,9 +138,11 @@ phys_size_t initdram(int board_type)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
 
index 0fbdfdbf71a3af6a69e1822ec8e70f7929cd71e7..5d2ab2fad3ca0218261c3987d9d09f795accf5bc 100644 (file)
@@ -608,8 +608,10 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 6716ffc9d0e09c9c53d3d0c8d12e44c72f90964b..ca09767d287b6b366033c39d5d3d13862ea4405f 100644 (file)
@@ -364,7 +364,7 @@ int update_flash_size(int flash_size)
 }
 #endif /* defined(CONFIG_SYS_UPDATE_FLASH_SIZE) */
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int phy_addr = CONFIG_PHY_ADDR;
        char eth_path[] = "/soc5200@f0000000/mdio@3000/ethernet-phy@0";
@@ -380,5 +380,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
        /* fix up the phy address */
        do_fixup_by_path(blob, eth_path, "reg", &phy_addr, sizeof(int), 0);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 584372521b43b58436fdbb13a80185f25ea97657..4ab71609c0363c760a30a2828505ee902683ad2f 100644 (file)
@@ -454,7 +454,7 @@ int update_flash_size (int flash_size)
 }
 #endif /* defined(CONFIG_SYS_UPDATE_FLASH_SIZE) */
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int phy_addr = CONFIG_PHY_ADDR;
        char eth_path[] = "/soc5200@f0000000/mdio@3000/ethernet-phy@0";
@@ -478,5 +478,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
        /* fix up the phy address */
        do_fixup_by_path(blob, eth_path, "reg", &phy_addr, sizeof(int), 0);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index d44c4bf6695bc9a8b9edd94279d6baff477b1565..2078f537690000eb41833fb885ed7c42fce12844 100644 (file)
@@ -196,10 +196,12 @@ void pci_init_board (void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup (void *blob, bd_t * bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup (blob, bd);
        fdt_fixup_memory (blob, (u64) bd->bi_memstart, (u64) bd->bi_memsize);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 78e4b5d1e9164dd76e793a518a01b5083456a9be..8856393686955c0bbdbee994b8e13d8bdc1f080b 100644 (file)
@@ -283,9 +283,10 @@ void ide_set_reset (int idereset)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index dfbfab81369b4acce51bca58ae09d850976a4837..e2009357de8c648587086abca8370afb8b960145 100644 (file)
@@ -460,8 +460,10 @@ static void setports(int gpio)
 }
 #endif
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index 0543483d5a91d06e81d04299dcc55f7baa154f7e..1da0dcb9d8a03354db82fc72385b7ba52407cc7a 100644 (file)
@@ -359,9 +359,11 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
 
index 4a736137e3fcffd72e3846f4a218542733d1270d..a74f75bad41dc09af5d9caf680f6f1bf08bb2a3e 100644 (file)
@@ -261,7 +261,7 @@ void fdt_fixup_fman_mac_addresses(void *blob)
 }
 #endif
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -286,6 +286,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_fman_mac_addresses(blob);
 #endif
+
+       return 0;
 }
 
 #if defined(CONFIG_POST)
index 8b8300050909c6092109dd7edfac7ba765cb8cab..d9ab2fd421651df92c7784424cb7dc0441835056 100644 (file)
@@ -610,7 +610,7 @@ void pci_target_init(struct pci_controller *hose)
 #endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT) */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        u32 val[4];
        int rc;
@@ -627,5 +627,7 @@ void ft_board_setup(void *blob, bd_t *bd)
        if (rc)
                printf("Unable to update property NOR mapping, err=%s\n",
                       fdt_strerror(rc));
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index a4c199859c3d66b29fd2acf1f3d3a4792d17a097..71c6a79ae14a6bfe95d4150e3c79873f0d587114 100644 (file)
@@ -280,8 +280,10 @@ static unsigned char swapbyte(unsigned char c)
  * Device Tree Support
  */
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index c3ce66d8d0649c66df79d64a085089a1cb7c4bd1..c8ed5b73f423c723473d4eec82c7d93302a4403f 100644 (file)
@@ -385,8 +385,10 @@ void pci_init_board (void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 5c5afa21ef57ea14bfd476bbcce246d3a5670ceb..e794c4645ee702196d102f294334a950b2160101 100644 (file)
@@ -358,8 +358,10 @@ void hw_watchdog_reset(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index a6235e53945fa56ecee3541d29ea95df5097c16e..4d0ebaab74567008c5718cd082fcfe1e751c5a3d 100644 (file)
@@ -185,9 +185,11 @@ int checkboard(void)
 
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 2009e62a1a7bfcbb575cc0f2308841e37e34e8fc..688cc12a6c9a7f816f0f75a863d7835b64f775ea 100644 (file)
@@ -62,10 +62,12 @@ void pci_init_board(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        fdt_fixup_dr_usb(blob, bd);
+
+       return 0;
 }
 #endif
 
index 08eb5e829039d86f5395fdfdb140a23bf262327e..529a58c222114a6ca8a889c1400533073e20ad41 100644 (file)
@@ -329,9 +329,11 @@ void ft_blob_update (void *blob, bd_t *bd)
        }
 }
 
-void ft_board_setup (void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup (blob, bd);
        ft_blob_update (blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index 319fa8cba41c1c779d0d528f2d9d93163afa67e6..23d0f56bd625a20ed1a1daa47904d6c14dee7527 100644 (file)
@@ -146,9 +146,10 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index 15f8f3163d7fac3ed0a0577bd1d2273bda7245be..81f3024ed995be04a950cc53542f75ea630818ce 100644 (file)
@@ -477,7 +477,7 @@ static unsigned char edid_buf[128] = {
 };
 #endif
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        u32 val[8];
        int rc, i = 0;
@@ -526,6 +526,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        if (rc)
                printf("Unable to update flash reg property, err=%s\n",
                       fdt_strerror(rc));
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index ce515d834c6dfc2c324f373c12af8bd024591fe2..ed41de13d474b4a84add031bf068959d70b39cb3 100644 (file)
@@ -164,9 +164,11 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t * bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 7445f5318ad2ed44525ea8bf8a11cc5ae95cbc42..db904a4107f6bb477fcf95604711354798ddd1c0 100644 (file)
@@ -154,7 +154,7 @@ int board_mmc_init(bd_t *bis)
                                  msg_clk->get_clock_rate.body.resp.rate_hz);
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        /*
         * For now, we simply always add the simplefb DT node. Later, we
@@ -162,4 +162,6 @@ void ft_board_setup(void *blob, bd_t *bd)
         * node exists for the "real" graphics driver.
         */
        lcd_dt_simplefb_add_node(blob);
+
+       return 0;
 }
index 89da47ed12d0d301f790d02787d05462f78d1798..72786d2ace6516f9ebe251f3bf1371c9107ad00b 100644 (file)
@@ -214,11 +214,13 @@ void sdram_init(void)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index d584276253a5e33414a085d2e5414844cfd11a94..25329e44736eba2b47f18c8505b9ca0351866152 100644 (file)
@@ -301,12 +301,14 @@ int last_stage_init(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_FSL_PCI_INIT
        FT_FSL_PCI_SETUP;
 #endif
+
+       return 0;
 }
 #endif
index 4906be488934d22d67eef6e9d4b6307dd5e7445d..6bdf1a28e97bbea16eff991718df3bad378b0c98 100644 (file)
@@ -173,11 +173,13 @@ void pci_init_board(void)
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup (void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
 
index 2caefbbe5844a217b4380160b00044c60b609826..953a43ff3163526b58c993bea7ba46bb9772520a 100644 (file)
@@ -218,8 +218,7 @@ int board_early_init_r (void)
 #endif /* CONFIG_BOARD_EARLY_INIT_R */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        u32 val[12];
        int rc, i = 0;
@@ -251,6 +250,8 @@ ft_board_setup(void *blob, bd_t *bd)
        if (rc)
                printf("Unable to update localbus ranges, err=%s\n",
                       fdt_strerror(rc));
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index f5c3d750cee634d9dae12b316ace5260d5a1b87a..6e4eed86a5f3419a54dd5f754df7d7a5591435b4 100644 (file)
@@ -233,9 +233,11 @@ reset_phy(void)
 }
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup (blob, bd);
+
+       return 0;
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
 
index ff7bc4bb18d695feac087803a04ad37a881a1430..04ec675103630c35af3dd7eaaeaee9f7800b6ab0 100644 (file)
@@ -114,7 +114,7 @@ u32 spl_boot_device(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int lpae;
        char *env;
@@ -217,6 +217,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                        }
                }
        }
+
+       return 0;
 }
 
 void ft_board_setup_ex(void *blob, bd_t *bd)
index a1f56cde2962a96053a289068c412a37096e0325..e9363ea394823a24b6d4cf9f8007d160f73b7e7d 100644 (file)
@@ -863,12 +863,14 @@ int board_get_height (void)
 #endif /* CONFIG_VIDEO_SM501 */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #if defined(CONFIG_VIDEO)
        fdt_add_edid(blob, "smi,sm501", edid_buf);
 #endif
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 814fcb26573f61ce4dba176e3c16b3a38afdda5d..d891a3844ca3836284a907faa7e5514840bcdd84 100644 (file)
@@ -414,12 +414,14 @@ static void set_ddr_config(void) {
 }
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif /* CONFIG_PCI */
+
+       return 0;
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
index 9ce2a5739f321b936c884d29f6f7621661fbf4d2..3b5230abc0d43f95cf787292a84475ffd90a5f3c 100644 (file)
@@ -674,10 +674,12 @@ void ft_blob_update (void *blob, bd_t *bd)
        }
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        ft_blob_update(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
 
index e480d57e7dbe9c7f54929743f14e7d89003ef1f7..c9e163e7d5e8e492a5a4e3e04d948031f6808e3e 100644 (file)
@@ -266,12 +266,14 @@ int checkboard(void)
  * Device Tree Support
  */
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        /* bring in eMMC dsr settings */
        do_fixup_by_path_u32(blob,
                             "/soc/aips-bus@02100000/usdhc@02198000",
                             "dsr", tqma6_emmc_dsr, 2);
        tqma6_bb_ft_board_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index c4feef8196ec3c979cbd62a4449a1ccf68b5e811..7f24a30688ac2468b1048deae5854502ec736b3d 100644 (file)
@@ -192,11 +192,13 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index b7ad3495025f85a8966c19b219ae65ce01572c0c..0028870db07784a6e417cd4f39b305cbecf33dc2 100644 (file)
@@ -69,11 +69,13 @@ phys_size_t initdram(int board_type)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_board_pci_setup(blob, bd);
 #endif
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index aa9e99d108ea5dac3d0be1ebff694ea7169715a8..6a3df52391e782007602c093ae5372ed038fff9b 100644 (file)
@@ -70,11 +70,13 @@ int board_early_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_board_pci_setup(blob, bd);
 #endif
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index efd563b266b655885448d95e1943b939ca5f3712..41419feb178a955d2e4b4049f31fb82895e7f0b7 100644 (file)
@@ -72,11 +72,13 @@ int board_early_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_board_pci_setup(blob, bd);
 #endif
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index e64d682afe7e7f92ef56df857ec8bb52781123f3..1f05150d0ff245b1fc897aac709e4260645d068c 100644 (file)
@@ -72,11 +72,13 @@ int board_early_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_board_pci_setup(blob, bd);
 #endif
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index f8fd324d0d79741c0741f24d38645895c22a2fbb..98c9c728ce7358b5efd42c5fb50d51d6da94296b 100644 (file)
@@ -581,7 +581,7 @@ static int reserve_stacks(void)
        gd->irq_sp = gd->start_addr_sp;
 # endif
 #else
-# if defined(CONFIG_PPC) || defined(CONFIG_MIPS)
+# ifdef CONFIG_PPC
        ulong *s;
 # endif
 
@@ -611,12 +611,6 @@ static int reserve_stacks(void)
        s = (ulong *) gd->start_addr_sp;
        *s = 0; /* Terminate back chain */
        *++s = 0; /* NULL return address */
-# elif defined(CONFIG_MIPS)
-       /* Clear initial stack frame */
-       s = (ulong *) gd->start_addr_sp;
-       *s-- = 0;
-       *s-- = 0;
-       gd->start_addr_sp = (ulong) s;
 # endif /* Architecture specific code */
 
        return 0;
index 5640ded296895d8bf2dbd6b1e99ba565d52e1377..25b4675744f57f8e58f7390159a88f5ea9b772d1 100644 (file)
@@ -566,8 +566,27 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 #ifdef CONFIG_OF_BOARD_SETUP
        /* Call the board-specific fixup routine */
-       else if (strncmp(argv[1], "boa", 3) == 0)
-               ft_board_setup(working_fdt, gd->bd);
+       else if (strncmp(argv[1], "boa", 3) == 0) {
+               int err = ft_board_setup(working_fdt, gd->bd);
+
+               if (err) {
+                       printf("Failed to update board information in FDT: %s\n",
+                              fdt_strerror(err));
+                       return CMD_RET_FAILURE;
+               }
+       }
+#endif
+#ifdef CONFIG_OF_SYSTEM_SETUP
+       /* Call the board-specific fixup routine */
+       else if (strncmp(argv[1], "sys", 3) == 0) {
+               int err = ft_system_setup(working_fdt, gd->bd);
+
+               if (err) {
+                       printf("Failed to add system information to FDT: %s\n",
+                              fdt_strerror(err));
+                       return CMD_RET_FAILURE;
+               }
+       }
 #endif
        /* Create a chosen node */
        else if (strncmp(argv[1], "cho", 3) == 0) {
@@ -1007,6 +1026,9 @@ static char fdt_help_text[] =
        "addr [-c]  <addr> [<length>]   - Set the [control] fdt location to <addr>\n"
 #ifdef CONFIG_OF_BOARD_SETUP
        "fdt boardsetup                      - Do board-specific set up\n"
+#endif
+#ifdef CONFIG_OF_SYSTEM_SETUP
+       "fdt systemsetup                     - Do system-specific set up\n"
 #endif
        "fdt move   <fdt> <newaddr> <length> - Copy the fdt to <addr> and make it active\n"
        "fdt resize                          - Resize fdt to size + padding to 4k addr\n"
index 2a20147286e6bfa53c164d93838482423d561039..ea42c63eaafd74300374dd5734726f6a64aaf8e3 100644 (file)
 #include <fdt_support.h>
 #include <exports.h>
 
-/*
- * Get cells len in bytes
- *     if #NNNN-cells property is 2 then len is 8
- *     otherwise len is 4
- */
-static int get_cells_len(const void *fdt, const char *nr_cells_name)
-{
-       const fdt32_t *cell;
-
-       cell = fdt_getprop(fdt, 0, nr_cells_name, NULL);
-       if (cell && fdt32_to_cpu(*cell) == 2)
-               return 8;
-
-       return 4;
-}
-
 /**
  * fdt_getprop_u32_default_node - Return a node's property or a default
  *
@@ -113,7 +97,8 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
 }
 
 /**
- * fdt_find_or_add_subnode - find or possibly add a subnode of a given node
+ * fdt_find_or_add_subnode() - find or possibly add a subnode of a given node
+ *
  * @fdt: pointer to the device tree blob
  * @parentoffset: structure block offset of a node
  * @name: name of the subnode to locate
@@ -121,8 +106,7 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
  * fdt_subnode_offset() finds a subnode of the node with a given name.
  * If the subnode does not exist, it will be created.
  */
-static int fdt_find_or_add_subnode(void *fdt, int parentoffset,
-                                  const char *name)
+int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name)
 {
        int offset;
 
@@ -246,7 +230,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end)
                return err;
        }
 
-       is_u64 = (get_cells_len(fdt, "#address-cells") == 8);
+       is_u64 = (fdt_address_cells(fdt, 0) == 2);
 
        err = fdt_setprop_uxx(fdt, nodeoffset, "linux,initrd-start",
                              (uint64_t)initrd_start, is_u64);
@@ -382,22 +366,22 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat,
 /*
  * fdt_pack_reg - pack address and size array into the "reg"-suitable stream
  */
-static int fdt_pack_reg(const void *fdt, void *buf, uint64_t *address,
-                       uint64_t *size, int n)
+static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
+                       int n)
 {
        int i;
-       int address_len = get_cells_len(fdt, "#address-cells");
-       int size_len = get_cells_len(fdt, "#size-cells");
+       int address_len = fdt_address_cells(fdt, 0);
+       int size_len = fdt_size_cells(fdt, 0);
        char *p = buf;
 
        for (i = 0; i < n; i++) {
-               if (address_len == 8)
+               if (address_len == 2)
                        *(fdt64_t *)p = cpu_to_fdt64(address[i]);
                else
                        *(fdt32_t *)p = cpu_to_fdt32(address[i]);
                p += address_len;
 
-               if (size_len == 8)
+               if (size_len == 2)
                        *(fdt64_t *)p = cpu_to_fdt64(size[i]);
                else
                        *(fdt32_t *)p = cpu_to_fdt32(size[i]);
@@ -968,13 +952,8 @@ void of_bus_default_count_cells(void *blob, int parentoffset,
 {
        const fdt32_t *prop;
 
-       if (addrc) {
-               prop = fdt_getprop(blob, parentoffset, "#address-cells", NULL);
-               if (prop)
-                       *addrc = be32_to_cpup(prop);
-               else
-                       *addrc = 2;
-       }
+       if (addrc)
+               *addrc = fdt_address_cells(blob, parentoffset);
 
        if (sizec) {
                prop = fdt_getprop(blob, parentoffset, "#size-cells", NULL);
@@ -1420,11 +1399,7 @@ u64 fdt_get_base_address(void *fdt, int node)
        u32 naddr;
        const fdt32_t *prop;
 
-       prop = fdt_getprop(fdt, node, "#address-cells", &size);
-       if (prop && size == 4)
-               naddr = be32_to_cpup(prop);
-       else
-               naddr = 2;
+       naddr = fdt_address_cells(fdt, node);
 
        prop = fdt_getprop(fdt, node, "ranges", &size);
 
index a39ae1b4cce9f172dea99f9459f2320f6b98e8a7..1d76bd60da843404d9dda64e4c5a93630e7ecb5e 100644 (file)
@@ -460,19 +460,32 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 {
        ulong *initrd_start = &images->initrd_start;
        ulong *initrd_end = &images->initrd_end;
-       int ret;
+       int ret = -EPERM;
+       int fdt_ret;
 
        if (fdt_chosen(blob) < 0) {
-               puts("ERROR: /chosen node create failed");
-               puts(" - must RESET the board to recover.\n");
-               return -1;
+               printf("ERROR: /chosen node create failed\n");
+               goto err;
        }
        if (arch_fixup_fdt(blob) < 0) {
-               puts("ERROR: arch specific fdt fixup failed");
-               return -1;
+               printf("ERROR: arch-specific fdt fixup failed\n");
+               goto err;
+       }
+       if (IMAGE_OF_BOARD_SETUP) {
+               fdt_ret = ft_board_setup(blob, gd->bd);
+               if (fdt_ret) {
+                       printf("ERROR: board-specific fdt fixup failed: %s\n",
+                              fdt_strerror(fdt_ret));
+                       goto err;
+               }
+       }
+       if (IMAGE_OF_SYSTEM_SETUP) {
+               if (ft_system_setup(blob, gd->bd)) {
+                       printf("ERROR: system-specific fdt fixup failed: %s\n",
+                              fdt_strerror(fdt_ret));
+                       goto err;
+               }
        }
-       if (IMAGE_OF_BOARD_SETUP)
-               ft_board_setup(blob, gd->bd);
        fdt_fixup_ethernet(blob);
 
        /* Delete the old LMB reservation */
@@ -481,7 +494,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 
        ret = fdt_shrink_to_minimum(blob);
        if (ret < 0)
-               return ret;
+               goto err;
        of_size = ret;
 
        if (*initrd_start && *initrd_end) {
@@ -493,7 +506,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 
        fdt_initrd(blob, *initrd_start, *initrd_end);
        if (!ft_verify_fdt(blob))
-               return -1;
+               goto err;
 
 #if defined(CONFIG_SOC_KEYSTONE)
        if (IMAGE_OF_BOARD_SETUP)
@@ -501,4 +514,8 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 #endif
 
        return 0;
+err:
+       printf(" - must RESET the board to recover.\n\n");
+
+       return ret;
 }
index d5e09e658cda2160ce4714d5eef47ab49e5f8f13..1f19fe4c9622a84c365f500ff80b2b72bb61baf1 100644 (file)
@@ -64,7 +64,20 @@ static inline void fdt_fixup_crypto_node(void *blob, int sec_rev) {}
 int fdt_pci_dma_ranges(void *blob, int phb_off, struct pci_controller *hose);
 #endif
 
-void ft_board_setup(void *blob, bd_t *bd);
+int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name);
+
+/**
+ * Add board-specific data to the FDT before booting the OS.
+ *
+ * Use CONFIG_SYS_FDT_PAD to ensure there is sufficient space.
+ * This function is called if CONFIG_OF_BOARD_SETUP is defined
+ *
+ * @param blob         FDT blob to update
+ * @param bd_t         Pointer to board data
+ * @return 0 if ok, or -FDT_ERR_... on error
+ */
+int ft_board_setup(void *blob, bd_t *bd);
+
 /*
  * The keystone2 SOC requires all 32 bit aliased addresses to be converted
  * to their 36 physical format. This has to happen after all fdt nodes
@@ -75,6 +88,18 @@ void ft_board_setup_ex(void *blob, bd_t *bd);
 void ft_cpu_setup(void *blob, bd_t *bd);
 void ft_pci_setup(void *blob, bd_t *bd);
 
+/**
+ * Add system-specific data to the FDT before booting the OS.
+ *
+ * Use CONFIG_SYS_FDT_PAD to ensure there is sufficient space.
+ * This function is called if CONFIG_OF_SYSTEM_SETUP is defined
+ *
+ * @param blob         FDT blob to update
+ * @param bd_t         Pointer to board data
+ * @return 0 if ok, or -FDT_ERR_... on error
+ */
+int ft_system_setup(void *blob, bd_t *bd);
+
 void set_working_fdt_addr(void *addr);
 int fdt_shrink_to_minimum(void *blob);
 int fdt_increase_size(void *fdt, int add_len);
index abfd678424b5521d7cf941f1542b4dacef163cbd..3da9fab95ce8c10280a363e0590ec9e8135d5d3d 100644 (file)
@@ -613,17 +613,33 @@ const u8 *fdtdec_locate_byte_array(const void *blob, int node,
  * @param blob         FDT blob
  * @param node         node to examine
  * @param prop_name    name of property to find
- * @param ptrp         returns pointer to region, or NULL if no address
- * @param size         returns size of region
- * @return 0 if ok, -1 on error (propery not found)
+ * @param basep                Returns base address of region
+ * @param size         Returns size of region
+ * @return 0 if ok, -1 on error (property not found)
  */
-int fdtdec_decode_region(const void *blob, int node,
-               const char *prop_name, void **ptrp, size_t *size);
+int fdtdec_decode_region(const void *blob, int node, const char *prop_name,
+                        fdt_addr_t *basep, fdt_size_t *sizep);
+
+enum fmap_compress_t {
+       FMAP_COMPRESS_NONE,
+       FMAP_COMPRESS_LZO,
+};
+
+enum fmap_hash_t {
+       FMAP_HASH_NONE,
+       FMAP_HASH_SHA1,
+       FMAP_HASH_SHA256,
+};
 
 /* A flash map entry, containing an offset and length */
 struct fmap_entry {
        uint32_t offset;
        uint32_t length;
+       uint32_t used;                  /* Number of bytes used in region */
+       enum fmap_compress_t compress_algo;     /* Compression type */
+       enum fmap_hash_t hash_algo;             /* Hash algorithm */
+       const uint8_t *hash;                    /* Hash value */
+       int hash_size;                          /* Hash size */
 };
 
 /**
@@ -679,4 +695,31 @@ int fdt_get_named_resource(const void *fdt, int node, const char *property,
  */
 int fdtdec_pci_get_bdf(const void *fdt, int node, int *bdf);
 
+/**
+ * Decode a named region within a memory bank of a given type.
+ *
+ * This function handles selection of a memory region. The region is
+ * specified as an offset/size within a particular type of memory.
+ *
+ * The properties used are:
+ *
+ *     <mem_type>-memory<suffix> for the name of the memory bank
+ *     <mem_type>-offset<suffix> for the offset in that bank
+ *
+ * The property value must have an offset and a size. The function checks
+ * that the region is entirely within the memory bank.5
+ *
+ * @param blob         FDT blob
+ * @param node         Node containing the properties (-1 for /config)
+ * @param mem_type     Type of memory to use, which is a name, such as
+ *                     "u-boot" or "kernel".
+ * @param suffix       String to append to the memory/offset
+ *                     property names
+ * @param basep                Returns base of region
+ * @param sizep                Returns size of region
+ * @return 0 if OK, -ive on error
+ */
+int fdtdec_decode_memory_region(const void *blob, int node,
+                               const char *mem_type, const char *suffix,
+                               fdt_addr_t *basep, fdt_size_t *sizep);
 #endif
index 07e9aed16d95190b3cebe2f19dcb29ef15ab63b2..af30d601585e3bf0124b590a41a3cf863e494a31 100644 (file)
@@ -119,6 +119,12 @@ struct lmb;
 # define IMAGE_OF_BOARD_SETUP          0
 #endif
 
+#ifdef CONFIG_OF_SYSTEM_SETUP
+# define IMAGE_OF_SYSTEM_SETUP 1
+#else
+# define IMAGE_OF_SYSTEM_SETUP 0
+#endif
+
 /*
  * Operating System Codes
  */
index e8775df5d00b135972799040d03cc76932af759d..7c7e673aeb79e975f0a725967eb298da4212d99d 100644 (file)
@@ -691,20 +691,25 @@ char *fdtdec_get_config_string(const void *blob, const char *prop_name)
        return (char *)nodep;
 }
 
-int fdtdec_decode_region(const void *blob, int node,
-               const char *prop_name, void **ptrp, size_t *size)
+int fdtdec_decode_region(const void *blob, int node, const char *prop_name,
+                        fdt_addr_t *basep, fdt_size_t *sizep)
 {
        const fdt_addr_t *cell;
        int len;
 
-       debug("%s: %s\n", __func__, prop_name);
+       debug("%s: %s: %s\n", __func__, fdt_get_name(blob, node, NULL),
+             prop_name);
        cell = fdt_getprop(blob, node, prop_name, &len);
-       if (!cell || (len != sizeof(fdt_addr_t) * 2))
+       if (!cell || (len < sizeof(fdt_addr_t) * 2)) {
+               debug("cell=%p, len=%d\n", cell, len);
                return -1;
+       }
+
+       *basep = fdt_addr_to_cpu(*cell);
+       *sizep = fdt_size_to_cpu(cell[1]);
+       debug("%s: base=%08lx, size=%lx\n", __func__, (ulong)*basep,
+             (ulong)*sizep);
 
-       *ptrp = map_sysmem(fdt_addr_to_cpu(*cell), *size);
-       *size = fdt_size_to_cpu(cell[1]);
-       debug("%s: size=%zx\n", __func__, *size);
        return 0;
 }
 
@@ -720,6 +725,7 @@ int fdtdec_decode_region(const void *blob, int node,
 int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
                           struct fmap_entry *entry)
 {
+       const char *prop;
        u32 reg[2];
 
        if (fdtdec_get_int_array(blob, node, "reg", reg, 2)) {
@@ -728,6 +734,13 @@ int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
        }
        entry->offset = reg[0];
        entry->length = reg[1];
+       entry->used = fdtdec_get_int(blob, node, "used", entry->length);
+       prop = fdt_getprop(blob, node, "compress", NULL);
+       entry->compress_algo = prop && !strcmp(prop, "lzo") ?
+               FMAP_COMPRESS_LZO : FMAP_COMPRESS_NONE;
+       prop = fdt_getprop(blob, node, "hash", &entry->hash_size);
+       entry->hash_algo = prop ? FMAP_HASH_SHA256 : FMAP_HASH_NONE;
+       entry->hash = (uint8_t *)prop;
 
        return 0;
 }
@@ -802,4 +815,65 @@ int fdtdec_pci_get_bdf(const void *fdt, int node, int *bdf)
 
        return 0;
 }
+
+int fdtdec_decode_memory_region(const void *blob, int config_node,
+                               const char *mem_type, const char *suffix,
+                               fdt_addr_t *basep, fdt_size_t *sizep)
+{
+       char prop_name[50];
+       const char *mem;
+       fdt_size_t size, offset_size;
+       fdt_addr_t base, offset;
+       int node;
+
+       if (config_node == -1) {
+               config_node = fdt_path_offset(blob, "/config");
+               if (config_node < 0) {
+                       debug("%s: Cannot find /config node\n", __func__);
+                       return -ENOENT;
+               }
+       }
+       if (!suffix)
+               suffix = "";
+
+       snprintf(prop_name, sizeof(prop_name), "%s-memory%s", mem_type,
+                suffix);
+       mem = fdt_getprop(blob, config_node, prop_name, NULL);
+       if (!mem) {
+               debug("%s: No memory type for '%s', using /memory\n", __func__,
+                     prop_name);
+               mem = "/memory";
+       }
+
+       node = fdt_path_offset(blob, mem);
+       if (node < 0) {
+               debug("%s: Failed to find node '%s': %s\n", __func__, mem,
+                     fdt_strerror(node));
+               return -ENOENT;
+       }
+
+       /*
+        * Not strictly correct - the memory may have multiple banks. We just
+        * use the first
+        */
+       if (fdtdec_decode_region(blob, node, "reg", &base, &size)) {
+               debug("%s: Failed to decode memory region %s\n", __func__,
+                     mem);
+               return -EINVAL;
+       }
+
+       snprintf(prop_name, sizeof(prop_name), "%s-offset%s", mem_type,
+                suffix);
+       if (fdtdec_decode_region(blob, config_node, prop_name, &offset,
+                                &offset_size)) {
+               debug("%s: Failed to decode memory region '%s'\n", __func__,
+                     prop_name);
+               return -EINVAL;
+       }
+
+       *basep = base + offset;
+       *sizep = offset_size;
+
+       return 0;
+}
 #endif