]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/fdt_support.c
karo: tx51: remove duplicate CONFIG_SYS_SDRAM_CLK definition
[karo-tx-uboot.git] / common / fdt_support.c
index 416100e394dc92d3c61f143aa807681b1a5c84ce..ce7527a931563f49fa585964451b60c1415a2816 100644 (file)
@@ -4,23 +4,7 @@
  *
  * Copyright 2010-2011 Freescale Semiconductor, Inc.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -458,7 +442,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];
 
@@ -467,6 +451,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);
@@ -530,7 +515,8 @@ int fdt_resize(void *blob)
        ret = fdt_add_mem_rsv(blob, (uintptr_t)blob, actualsize);
        if (ret < 0)
                return ret;
-
+       if (getenv("fdtsize"))
+               setenv_hex("fdtsize", actualsize);
        return actualsize;
 }
 
@@ -1099,7 +1085,7 @@ static u64 __of_translate_address(void *blob, int node_offset, const fdt32_t *in
                goto bail;
        bus = &of_busses[0];
 
-       /* Cound address cells & copy address locally */
+       /* Count address cells & copy address locally */
        bus->count_cells(blob, parent, &na, &ns);
        if (!OF_CHECK_COUNTS(na, ns)) {
                printf("%s: Bad cell count for %s\n", __FUNCTION__,