]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Revert "fdt: fix address cell count checking in fdt_translate_address()"
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Tue, 12 Jan 2016 14:40:44 +0000 (15:40 +0100)
committerSimon Glass <sjg@chromium.org>
Fri, 18 Mar 2016 03:27:39 +0000 (21:27 -0600)
This reverts commit 71105f50fedddfa5b0535d102c3d5078671721ad.

The reverted commit was applied for a temporary to unbreak
few Exynos boards on the release.

After the discussion about the change, this commit should be avoided.
Fixed device-tree for Exynos, allows reverting it without any issues.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
common/fdt_support.c

index 75d0858e76317e71fb1f8839e5e8f8f0b1499653..ced119e70d9f1010b5f6945d1e44e3d5c719dd44 100644 (file)
@@ -940,7 +940,8 @@ void fdt_del_node_and_alias(void *blob, const char *alias)
 /* Max address size we deal with */
 #define OF_MAX_ADDR_CELLS      4
 #define OF_BAD_ADDR    FDT_ADDR_T_NONE
-#define OF_CHECK_COUNTS(na)    ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)
+#define OF_CHECK_COUNTS(na, ns)        ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
+                       (ns) > 0)
 
 /* Debug utility */
 #ifdef DEBUG
@@ -1108,7 +1109,7 @@ static u64 __of_translate_address(void *blob, int node_offset, const fdt32_t *in
 
        /* Cound address cells & copy address locally */
        bus->count_cells(blob, parent, &na, &ns);
-       if (!OF_CHECK_COUNTS(na)) {
+       if (!OF_CHECK_COUNTS(na, ns)) {
                printf("%s: Bad cell count for %s\n", __FUNCTION__,
                       fdt_get_name(blob, node_offset, NULL));
                goto bail;
@@ -1135,7 +1136,7 @@ static u64 __of_translate_address(void *blob, int node_offset, const fdt32_t *in
                /* Get new parent bus and counts */
                pbus = &of_busses[0];
                pbus->count_cells(blob, parent, &pna, &pns);
-               if (!OF_CHECK_COUNTS(pna)) {
+               if (!OF_CHECK_COUNTS(pna, pns)) {
                        printf("%s: Bad cell count for %s\n", __FUNCTION__,
                                fdt_get_name(blob, node_offset, NULL));
                        break;