]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/fdt_support.c
Merge branch 'master' of git://www.denx.de/git/u-boot-mmc
[karo-tx-uboot.git] / common / fdt_support.c
index 812acb401c176f81976fceb05e637fec024dc91c..9a6f6b7d8b16c822496c53a62df26d3850081b29 100644 (file)
@@ -387,7 +387,11 @@ static void write_cell(u8 *addr, u64 val, int size)
        }
 }
 
+#ifdef CONFIG_NR_DRAM_BANKS
+#define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS
+#else
 #define MEMORY_BANKS_MAX 4
+#endif
 int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
 {
        int err, nodeoffset;
@@ -454,7 +458,7 @@ void fdt_fixup_ethernet(void *fdt)
 {
        int node, i, j;
        char enet[16], *tmp, *end;
-       char mac[16] = "ethaddr";
+       char mac[16];
        const char *path;
        unsigned char mac_addr[6];
 
@@ -463,6 +467,7 @@ void fdt_fixup_ethernet(void *fdt)
                return;
 
        i = 0;
+       strcpy(mac, "ethaddr");
        while ((tmp = getenv(mac)) != NULL) {
                sprintf(enet, "ethernet%d", i);
                path = fdt_getprop(fdt, node, enet, NULL);