]> git.sur5r.net Git - u-boot/blobdiff - common/fdt_support.c
ColdFire 54455: Fix correct boot location for atmel and intel
[u-boot] / common / fdt_support.c
index d12c7516f018bb07d174954dd43c083a60489e95..175d59eb99432ccb36078a766043c0722eb9c2ec 100644 (file)
 #include <libfdt.h>
 #include <fdt_support.h>
 
-#ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd);
-#endif
-
 /*
  * Global data (for the gd->bd)
  */
@@ -50,7 +46,6 @@ struct fdt_header *fdt;
 
 int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
 {
-       bd_t *bd = gd->bd;
        int   nodeoffset;
        int   err;
        u32   tmp;              /* used to set 32 bit integer properties */
@@ -58,21 +53,10 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
 
        err = fdt_check_header(fdt);
        if (err < 0) {
-               printf("libfdt: %s\n", fdt_strerror(err));
+               printf("fdt_chosen: %s\n", fdt_strerror(err));
                return err;
        }
 
-#ifdef CONFIG_OF_BOARD_SETUP
-       /*
-        * ft_board_setup() sets various board-specific properties to
-        * the proper values.
-        *
-        * STRICTLY SPEAKING, this is out of place, but it isn't clear
-        * where a better place would be.
-        */
-       ft_board_setup(fdt, bd);
-#endif
-
        if (initrd_start && initrd_end) {
                struct fdt_reserve_entry re;
                int  used;
@@ -81,11 +65,11 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
 
                err = fdt_num_reservemap(fdt, &used, &total);
                if (err < 0) {
-                       printf("libfdt: %s\n", fdt_strerror(err));
+                       printf("fdt_chosen: %s\n", fdt_strerror(err));
                        return err;
                }
                if (used >= total) {
-                       printf("WARNING fdt_chosen: "
+                       printf("WARNING: "
                                "no room in the reserved map (%d of %d)\n",
                                used, total);
                        return -1;
@@ -103,7 +87,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
                err = fdt_replace_reservemap_entry(fdt, j,
                        initrd_start, initrd_end - initrd_start + 1);
                if (err < 0) {
-                       printf("libfdt: %s\n", fdt_strerror(err));
+                       printf("fdt_chosen: %s\n", fdt_strerror(err));
                        return err;
                }
        }
@@ -129,9 +113,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
                 */
                nodeoffset = fdt_add_subnode(fdt, 0, "chosen");
                if (nodeoffset < 0) {
-                       printf("WARNING fdt_chosen: "
-                               "could not create the \"/chosen node\" "
-                               "(libfdt error %s).\n",
+                       printf("WARNING: could not create /chosen %s.\n",
                                fdt_strerror(nodeoffset));
                        return nodeoffset;
                }
@@ -145,9 +127,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
                err = fdt_setprop(fdt, nodeoffset,
                        "bootargs", str, strlen(str)+1);
                if (err < 0)
-                       printf("WARNING fdt_chosen: "
-                               "could not set \"bootargs\" "
-                               "(libfdt error %s).\n",
+                       printf("WARNING: could not set bootargs %s.\n",
                                fdt_strerror(err));
        }
        if (initrd_start && initrd_end) {
@@ -155,26 +135,21 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
                err = fdt_setprop(fdt, nodeoffset,
                         "linux,initrd-start", &tmp, sizeof(tmp));
                if (err < 0)
-                       printf("WARNING fdt_chosen: "
-                               "could not set \"linux,initrd-start\" "
-                               "(libfdt error %s).\n",
+                       printf("WARNING: "
+                               "could not set linux,initrd-start %s.\n",
                                fdt_strerror(err));
                tmp = __cpu_to_be32(initrd_end);
                err = fdt_setprop(fdt, nodeoffset,
                        "linux,initrd-end", &tmp, sizeof(tmp));
                if (err < 0)
-                       printf("WARNING fdt_chosen: "
-                               "could not set \"linux,initrd-end\" "
-                               "(libfdt error %s).\n",
+                       printf("WARNING: could not set linux,initrd-end %s.\n",
                                fdt_strerror(err));
        }
 #ifdef OF_STDOUT_PATH
        err = fdt_setprop(fdt, nodeoffset,
                "linux,stdout-path", OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1);
        if (err < 0)
-               printf("WARNING fdt_chosen: "
-                       "could not set \"linux,stdout-path\" "
-                       "(libfdt error %s).\n",
+               printf("WARNING: could not set linux,stdout-path %s.\n",
                        fdt_strerror(err));
 #endif
 
@@ -199,7 +174,7 @@ int fdt_env(void *fdt)
 
        err = fdt_check_header(fdt);
        if (err < 0) {
-               printf("libfdt: %s\n", fdt_strerror(err));
+               printf("fdt_env: %s\n", fdt_strerror(err));
                return err;
        }
 
@@ -211,7 +186,7 @@ int fdt_env(void *fdt)
        if (nodeoffset >= 0) {
                err = fdt_del_node(fdt, nodeoffset);
                if (err < 0) {
-                       printf("libfdt: %s\n", fdt_strerror(err));
+                       printf("fdt_env: %s\n", fdt_strerror(err));
                        return err;
                }
        }
@@ -220,9 +195,7 @@ int fdt_env(void *fdt)
         */
        nodeoffset = fdt_add_subnode(fdt, 0, "u-boot-env");
        if (nodeoffset < 0) {
-               printf("WARNING fdt_env: "
-                       "could not create the \"/u-boot-env node\" "
-                       "(libfdt error %s).\n",
+               printf("WARNING: could not create /u-boot-env %s.\n",
                        fdt_strerror(nodeoffset));
                return nodeoffset;
        }
@@ -251,9 +224,7 @@ int fdt_env(void *fdt)
                        continue;
                err = fdt_setprop(fdt, nodeoffset, lval, rval, strlen(rval)+1);
                if (err < 0) {
-                       printf("WARNING fdt_env: "
-                               "could not set \"%s\" "
-                               "(libfdt error %s).\n",
+                       printf("WARNING: could not set %s %s.\n",
                                lval, fdt_strerror(err));
                        return err;
                }
@@ -325,7 +296,7 @@ int fdt_bd_t(void *fdt)
 
        err = fdt_check_header(fdt);
        if (err < 0) {
-               printf("libfdt: %s\n", fdt_strerror(err));
+               printf("fdt_bd_t: %s\n", fdt_strerror(err));
                return err;
        }
 
@@ -337,7 +308,7 @@ int fdt_bd_t(void *fdt)
        if (nodeoffset >= 0) {
                err = fdt_del_node(fdt, nodeoffset);
                if (err < 0) {
-                       printf("libfdt: %s\n", fdt_strerror(err));
+                       printf("fdt_bd_t: %s\n", fdt_strerror(err));
                        return err;
                }
        }
@@ -346,11 +317,9 @@ int fdt_bd_t(void *fdt)
         */
        nodeoffset = fdt_add_subnode(fdt, 0, "bd_t");
        if (nodeoffset < 0) {
-               printf("WARNING fdt_bd_t: "
-                       "could not create the \"/bd_t node\" "
-                       "(libfdt error %s).\n",
+               printf("WARNING: could not create /bd_t %s.\n",
                        fdt_strerror(nodeoffset));
-               printf("libfdt: %s\n", fdt_strerror(nodeoffset));
+               printf("fdt_bd_t: %s\n", fdt_strerror(nodeoffset));
                return nodeoffset;
        }
        /*
@@ -361,9 +330,7 @@ int fdt_bd_t(void *fdt)
                err = fdt_setprop(fdt, nodeoffset,
                        bd_map[i].name, &tmp, sizeof(tmp));
                if (err < 0)
-                       printf("WARNING fdt_bd_t: "
-                               "could not set \"%s\" "
-                               "(libfdt error %s).\n",
+                       printf("WARNING: could not set %s %s.\n",
                                bd_map[i].name, fdt_strerror(err));
        }
        /*
@@ -371,15 +338,11 @@ int fdt_bd_t(void *fdt)
         */
        err = fdt_setprop(fdt, nodeoffset, "enetaddr", &bd->bi_enetaddr, 6);
        if (err < 0)
-               printf("WARNING fdt_bd_t: "
-                       "could not set \"enetaddr\" "
-                       "(libfdt error %s).\n",
+               printf("WARNING: could not set enetaddr %s.\n",
                        fdt_strerror(err));
        err = fdt_setprop(fdt, nodeoffset, "ethspeed", &bd->bi_ethspeed, 4);
        if (err < 0)
-               printf("WARNING fdt_bd_t: "
-                       "could not set \"ethspeed\" "
-                       "(libfdt error %s).\n",
+               printf("WARNING: could not set ethspeed %s.\n",
                        fdt_strerror(err));
        return 0;
 }