]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mpc8260: move FDT memory node fixup into common CPU code.
authorMarcel Ziswiler <marcel@ziswiler.com>
Thu, 1 Oct 2009 21:55:17 +0000 (23:55 +0200)
committerWolfgang Denk <wd@denx.de>
Sun, 22 Nov 2009 22:16:28 +0000 (23:16 +0100)
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@noser.com>
Tested-by: Heiko Schocher <hs@denx.de>
board/freescale/mpc8260ads/mpc8260ads.c
board/ids8247/ids8247.c
board/keymile/mgcoge/mgcoge.c
board/muas3001/muas3001.c
cpu/mpc8260/cpu.c

index 49a88bbdd14b72a1ab0417368186bb2840b67051..be55626104b0c68b663ad840c7f6cf36681a2ade 100644 (file)
@@ -550,24 +550,11 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_blob_update(void *blob, bd_t *bd)
-{
-       int ret;
-
-       ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-       if (ret < 0) {
-               printf("ft_blob_update(): cannot set /memory/reg "
-                       "property err:%s\n", fdt_strerror(ret));
-       }
-}
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
-       ft_blob_update(blob, bd);
 }
 #endif
index 79fe9da5baf64677e7f8cac31709a63d5d275424..d621833cc117939288b95e8e8ed3c7424adf3633 100644 (file)
@@ -400,24 +400,8 @@ int board_nand_init(struct nand_chip *nand)
 #endif /* CONFIG_CMD_NAND */
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-/*
- * update "memory" property in the blob
- */
-void ft_blob_update(void *blob, bd_t *bd)
-{
-       int ret;
-
-       ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-       if (ret < 0) {
-               printf("ft_blob_update(): cannot set /memory/reg "
-                       "property err:%s\n", fdt_strerror(ret));
-       }
-}
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup( blob, bd);
-       ft_blob_update(blob, bd);
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index b16a01ccc5bc75fd369fc3f295411ad2630709cd..932a80547f183b7145f2a075df3269db2c339004 100644 (file)
@@ -312,11 +312,10 @@ int hush_init_var (void)
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 /*
- * update "memory" property in the blob
+ * update "flash" property in the blob
  */
 void ft_blob_update (void *blob, bd_t *bd)
 {
-       ulong memory_data[2] = {0};
        ulong *flash_data = NULL;
        ulong   flash_reg[6] = {0};
        flash_info_t    *info;
@@ -324,11 +323,6 @@ void ft_blob_update (void *blob, bd_t *bd)
        int     size;
        int     i = 0;
 
-       memory_data[0] = cpu_to_be32 (bd->bi_memstart);
-       memory_data[1] = cpu_to_be32 (bd->bi_memsize);
-       fdt_set_node_and_value (blob, "/memory", "reg", memory_data,
-                               sizeof (memory_data));
-
        len = fdt_get_node_and_value (blob, "/localbus", "ranges",
                                        (void *)&flash_data);
 
index 36caed813dde8c2a23895f91a02f5e56e35c698f..e0a7f32fd9def0f1a6cbe47e6221e6a0fbe87c37 100644 (file)
@@ -308,25 +308,9 @@ int board_early_init_r (void)
 void ft_blob_update (void *blob, bd_t *bd)
 {
        int ret, nodeoffset = 0;
-       ulong memory_data[2] = {0};
        ulong flash_data[4] = {0};
        ulong   speed = 0;
 
-       memory_data[0] = cpu_to_be32 (bd->bi_memstart);
-       memory_data[1] = cpu_to_be32 (bd->bi_memsize);
-
-       nodeoffset = fdt_path_offset (blob, "/memory");
-       if (nodeoffset >= 0) {
-               ret = fdt_setprop (blob, nodeoffset, "reg", memory_data,
-                                       sizeof(memory_data));
-       if (ret < 0)
-               printf ("ft_blob_update): cannot set /memory/reg "
-                       "property err:%s\n", fdt_strerror (ret));
-       } else {
-               /* memory node is required in dts */
-               printf ("ft_blob_update(): cannot find /memory node "
-                       "err:%s\n", fdt_strerror(nodeoffset));
-       }
        /* update Flash addr, size */
        flash_data[2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
        flash_data[3] = cpu_to_be32 (CONFIG_SYS_FLASH_SIZE);
index 17e6248722644651101fe0b01a948d771d46f9a7..aedbf297ab7833810c4c20b573fcf7841c923c00 100644 (file)
@@ -318,6 +318,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
                "timebase-frequency", OF_TBCLK, 1);
        do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
                "clock-frequency", bd->bi_intfreq, 1);
+       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 }
 #endif /* CONFIG_OF_LIBFDT */