]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib/fdtdec.c
sandbox: Correct data sizes and printf() strings in fdtdec.c
[karo-tx-uboot.git] / lib / fdtdec.c
index 1b3c810588b66a9064bc080da51776c5f8136768..207314fa72fb34f643c0d9424916c9dbfefba4c9 100644 (file)
@@ -1,22 +1,6 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
- * 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>
@@ -62,7 +46,9 @@ static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(GOOGLE_CROS_EC, "google,cros-ec"),
        COMPAT(GOOGLE_CROS_EC_KEYB, "google,cros-ec-keyb"),
        COMPAT(SAMSUNG_EXYNOS_EHCI, "samsung,exynos-ehci"),
+       COMPAT(SAMSUNG_EXYNOS5_XHCI, "samsung,exynos5250-xhci"),
        COMPAT(SAMSUNG_EXYNOS_USB_PHY, "samsung,exynos-usb-phy"),
+       COMPAT(SAMSUNG_EXYNOS5_USB3_PHY, "samsung,exynos5250-usb3-phy"),
        COMPAT(SAMSUNG_EXYNOS_TMU, "samsung,exynos-tmu"),
        COMPAT(SAMSUNG_EXYNOS_FIMD, "samsung,exynos-fimd"),
        COMPAT(SAMSUNG_EXYNOS5_DP, "samsung,exynos5-dp"),
@@ -73,6 +59,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(MAXIM_98095_CODEC, "maxim,max98095-codec"),
        COMPAT(INFINEON_SLB9635_TPM, "infineon,slb9635-tpm"),
        COMPAT(INFINEON_SLB9645_TPM, "infineon,slb9645-tpm"),
+       COMPAT(SAMSUNG_EXYNOS5_I2C, "samsung,exynos5-hsi2c"),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
@@ -99,10 +86,10 @@ fdt_addr_t fdtdec_get_addr_size(const void *blob, int node,
                        size = (fdt_size_t *)((char *)cell +
                                        sizeof(fdt_addr_t));
                        *sizep = fdt_size_to_cpu(*size);
-                       debug("addr=%p, size=%p\n", (void *)addr,
-                             (void *)*sizep);
+                       debug("addr=%08lx, size=%08x\n",
+                             (ulong)addr, *sizep);
                } else {
-                       debug("%p\n", (void *)addr);
+                       debug("%08lx\n", (ulong)addr);
                }
                return addr;
        }
@@ -624,7 +611,7 @@ int fdtdec_decode_region(const void *blob, int node,
        if (!cell || (len != sizeof(fdt_addr_t) * 2))
                return -1;
 
-       *ptrp = (void *)fdt_addr_to_cpu(*cell);
+       *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;