Lines Matching +full:dt +full:- +full:node

1 // SPDX-License-Identifier: GPL-2.0+
30 * good reason why driver-model conversion is infeasible. Examples include
36 COMPAT(NVIDIA_TEGRA20_EMC, "nvidia,tegra20-emc"),
37 COMPAT(NVIDIA_TEGRA20_EMC_TABLE, "nvidia,tegra20-emc-table"),
38 COMPAT(NVIDIA_TEGRA20_NAND, "nvidia,tegra20-nand"),
39 COMPAT(NVIDIA_TEGRA124_XUSB_PADCTL, "nvidia,tegra124-xusb-padctl"),
40 COMPAT(NVIDIA_TEGRA210_XUSB_PADCTL, "nvidia,tegra210-xusb-padctl"),
42 COMPAT(SAMSUNG_EXYNOS5_SROMC, "samsung,exynos-sromc"),
43 COMPAT(SAMSUNG_EXYNOS_USB_PHY, "samsung,exynos-usb-phy"),
44 COMPAT(SAMSUNG_EXYNOS5_USB3_PHY, "samsung,exynos5250-usb3-phy"),
45 COMPAT(SAMSUNG_EXYNOS_TMU, "samsung,exynos-tmu"),
46 COMPAT(SAMSUNG_EXYNOS_MIPI_DSI, "samsung,exynos-mipi-dsi"),
47 COMPAT(SAMSUNG_EXYNOS_DWMMC, "samsung,exynos-dwmmc"),
48 COMPAT(GENERIC_SPI_FLASH, "spi-flash"),
49 COMPAT(SAMSUNG_EXYNOS_SYSMMU, "samsung,sysmmu-v3.3"),
51 COMPAT(INTEL_QRK_MRC, "intel,quark-mrc"),
52 COMPAT(ALTERA_SOCFPGA_DWMAC, "altr,socfpga-stmmac"),
53 COMPAT(ALTERA_SOCFPGA_DWMMC, "altr,socfpga-dw-mshc"),
55 COMPAT(INTEL_BAYTRAIL_FSP, "intel,baytrail-fsp"),
56 COMPAT(INTEL_BAYTRAIL_FSP_MDP, "intel,baytrail-fsp-mdp"),
57 COMPAT(INTEL_IVYBRIDGE_FSP, "intel,ivybridge-fsp"),
58 COMPAT(COMPAT_SUNXI_NAND, "allwinner,sun4i-a10-nand"),
59 COMPAT(ALTERA_SOCFPGA_CLK, "altr,clk-mgr"),
60 COMPAT(ALTERA_SOCFPGA_PINCTRL_SINGLE, "pinctrl-single"),
61 COMPAT(ALTERA_SOCFPGA_H2F_BRG, "altr,socfpga-hps2fpga-bridge"),
62 COMPAT(ALTERA_SOCFPGA_LWH2F_BRG, "altr,socfpga-lwhps2fpga-bridge"),
63 COMPAT(ALTERA_SOCFPGA_F2H_BRG, "altr,socfpga-fpga2hps-bridge"),
64 COMPAT(ALTERA_SOCFPGA_F2SDR0, "altr,socfpga-fpga2sdram0-bridge"),
65 COMPAT(ALTERA_SOCFPGA_F2SDR1, "altr,socfpga-fpga2sdram1-bridge"),
66 COMPAT(ALTERA_SOCFPGA_F2SDR2, "altr,socfpga-fpga2sdram2-bridge"),
67 COMPAT(ALTERA_SOCFPGA_FPGA0, "altr,socfpga-a10-fpga-mgr"),
68 COMPAT(ALTERA_SOCFPGA_NOC, "altr,socfpga-a10-noc"),
69 COMPAT(ALTERA_SOCFPGA_CLK_INIT, "altr,socfpga-a10-clk-init")
79 fdt_addr_t fdtdec_get_addr_size_fixed(const void *blob, int node, in fdtdec_get_addr_size_fixed() argument
91 prop = fdt_getprop(blob, node, prop_name, &len); in fdtdec_get_addr_size_fixed()
103 (u32)(prop_after_size - prop), ((u32)(prop_end - prop))); in fdtdec_get_addr_size_fixed()
109 addr = fdt_translate_address(blob, node, prop_addr); in fdtdec_get_addr_size_fixed()
126 int node, const char *prop_name, in fdtdec_get_addr_size_auto_parent() argument
136 debug("(bad #address-cells)\n"); in fdtdec_get_addr_size_auto_parent()
142 debug("(bad #size-cells)\n"); in fdtdec_get_addr_size_auto_parent()
148 return fdtdec_get_addr_size_fixed(blob, node, prop_name, index, na, in fdtdec_get_addr_size_auto_parent()
152 fdt_addr_t fdtdec_get_addr_size_auto_noparent(const void *blob, int node, in fdtdec_get_addr_size_auto_noparent() argument
161 parent = fdt_parent_offset(blob, node); in fdtdec_get_addr_size_auto_noparent()
167 return fdtdec_get_addr_size_auto_parent(blob, parent, node, prop_name, in fdtdec_get_addr_size_auto_noparent()
171 fdt_addr_t fdtdec_get_addr_size(const void *blob, int node, in fdtdec_get_addr_size() argument
176 return fdtdec_get_addr_size_fixed(blob, node, prop_name, 0, in fdtdec_get_addr_size()
181 fdt_addr_t fdtdec_get_addr(const void *blob, int node, const char *prop_name) in fdtdec_get_addr() argument
183 return fdtdec_get_addr_size(blob, node, prop_name, NULL); in fdtdec_get_addr()
187 int fdtdec_get_pci_addr(const void *blob, int node, enum fdt_pci_space type, in fdtdec_get_pci_addr() argument
192 int ret = -ENOENT; in fdtdec_get_pci_addr()
198 * the value of the node's parent node's #address-cells and in fdtdec_get_pci_addr()
199 * #size-cells. They need to be 3 and 2 accordingly. However, in fdtdec_get_pci_addr()
202 cell = fdt_getprop(blob, node, prop_name, &len); in fdtdec_get_pci_addr()
216 addr->phys_hi = fdt32_to_cpu(cell[0]); in fdtdec_get_pci_addr()
217 addr->phys_mid = fdt32_to_cpu(cell[1]); in fdtdec_get_pci_addr()
218 addr->phys_lo = fdt32_to_cpu(cell[1]); in fdtdec_get_pci_addr()
227 ret = -ENXIO; in fdtdec_get_pci_addr()
234 ret = -EINVAL; in fdtdec_get_pci_addr()
241 int fdtdec_get_pci_vendev(const void *blob, int node, u16 *vendor, u16 *device) in fdtdec_get_pci_vendev() argument
246 list = fdt_getprop(blob, node, "compatible", &len); in fdtdec_get_pci_vendev()
248 return -ENOENT; in fdtdec_get_pci_vendev()
274 return -ENOENT; in fdtdec_get_pci_vendev()
283 barnum = addr->phys_hi & 0xff; in fdtdec_get_pci_bar32()
285 return -EINVAL; in fdtdec_get_pci_bar32()
287 barnum = (barnum - PCI_BASE_ADDRESS_0) / 4; in fdtdec_get_pci_bar32()
294 uint64_t fdtdec_get_uint64(const void *blob, int node, const char *prop_name, in fdtdec_get_uint64() argument
300 cell64 = fdt_getprop(blob, node, prop_name, &length); in fdtdec_get_uint64()
307 int fdtdec_get_is_enabled(const void *blob, int node) in fdtdec_get_is_enabled() argument
316 * http://www.mail-archive.com/u-boot@lists.denx.de/msg71598.html in fdtdec_get_is_enabled()
318 cell = fdt_getprop(blob, node, "status", NULL); in fdtdec_get_is_enabled()
324 enum fdt_compat_id fdtdec_lookup(const void *blob, int node) in fdtdec_lookup() argument
330 if (fdt_node_check_compatible(blob, node, in fdtdec_lookup()
336 int fdtdec_next_compatible(const void *blob, int node, enum fdt_compat_id id) in fdtdec_next_compatible() argument
338 return fdt_node_offset_by_compatible(blob, node, compat_names[id]); in fdtdec_next_compatible()
341 int fdtdec_next_compatible_subnode(const void *blob, int node, in fdtdec_next_compatible_subnode() argument
345 node = fdt_next_node(blob, node, depthp); in fdtdec_next_compatible_subnode()
350 blob, node, compat_names[id])) in fdtdec_next_compatible_subnode()
351 return node; in fdtdec_next_compatible_subnode()
353 return -FDT_ERR_NOTFOUND; in fdtdec_next_compatible_subnode()
361 int node, err; in fdtdec_next_alias() local
366 node = fdt_path_offset(blob, str); in fdtdec_next_alias()
367 if (node < 0) in fdtdec_next_alias()
368 return node; in fdtdec_next_alias()
369 err = fdt_node_check_compatible(blob, node, compat_names[id]); in fdtdec_next_alias()
373 return -FDT_ERR_NOTFOUND; in fdtdec_next_alias()
375 return node; in fdtdec_next_alias()
395 int offset, node; in fdtdec_add_aliases_for_id() local
400 /* find the alias node if present */ in fdtdec_add_aliases_for_id()
404 * start with nothing, and we can assume that the root node can't in fdtdec_add_aliases_for_id()
410 for (node = count = 0; node >= 0 && count < maxcount;) { in fdtdec_add_aliases_for_id()
411 node = fdtdec_next_compatible(blob, node, id); in fdtdec_add_aliases_for_id()
412 if (node >= 0) in fdtdec_add_aliases_for_id()
413 nodes[count++] = node; in fdtdec_add_aliases_for_id()
415 if (node >= 0) in fdtdec_add_aliases_for_id()
428 node = 0; in fdtdec_add_aliases_for_id()
430 path = fdt_string(blob, fdt32_to_cpu(prop->nameoff)); in fdtdec_add_aliases_for_id()
431 if (prop->len && 0 == strncmp(path, name, name_len)) in fdtdec_add_aliases_for_id()
432 node = fdt_path_offset(blob, prop->data); in fdtdec_add_aliases_for_id()
433 if (node <= 0) in fdtdec_add_aliases_for_id()
444 /* Make sure the node we found is actually in our list! */ in fdtdec_add_aliases_for_id()
445 found = -1; in fdtdec_add_aliases_for_id()
447 if (nodes[j] == node) { in fdtdec_add_aliases_for_id()
452 if (found == -1) { in fdtdec_add_aliases_for_id()
453 debug("%s: warning: alias '%s' points to a node " in fdtdec_add_aliases_for_id()
456 fdt_get_name(blob, node, NULL), in fdtdec_add_aliases_for_id()
462 * Add this node to our list in the right place, and mark in fdtdec_add_aliases_for_id()
465 if (fdtdec_get_is_enabled(blob, node)) { in fdtdec_add_aliases_for_id()
468 "a node be placed in the list in a " in fdtdec_add_aliases_for_id()
470 "node '%s'\n", __func__, path, in fdtdec_add_aliases_for_id()
471 fdt_get_name(blob, node, NULL)); in fdtdec_add_aliases_for_id()
474 node_list[number] = node; in fdtdec_add_aliases_for_id()
525 debug(" - %s, %s\n", name, prop); in fdtdec_get_alias_seq()
526 if (len < find_namelen || *prop != '/' || prop[len - 1] || in fdtdec_get_alias_seq()
534 if (val != -1) { in fdtdec_get_alias_seq()
542 return -ENOENT; in fdtdec_get_alias_seq()
550 int max = -1; in fdtdec_get_alias_highest_id()
563 debug(" - %s, %s\n", name, prop); in fdtdec_get_alias_highest_id()
564 if (*prop != '/' || prop[len - 1] || in fdtdec_get_alias_highest_id()
594 return -FDT_ERR_NOTFOUND; in fdtdec_get_chosen_node()
617 if (!gd->fdt_blob || ((uintptr_t)gd->fdt_blob & 3) || in fdtdec_prepare_fdt()
618 fdt_check_header(gd->fdt_blob)) { in fdtdec_prepare_fdt()
622 …device tree binary found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG… in fdtdec_prepare_fdt()
624 if (gd->fdt_blob) { in fdtdec_prepare_fdt()
625 printf("fdt_blob=%p\n", gd->fdt_blob); in fdtdec_prepare_fdt()
626 print_buffer((ulong)gd->fdt_blob, gd->fdt_blob, 4, in fdtdec_prepare_fdt()
631 return -1; in fdtdec_prepare_fdt()
636 int fdtdec_lookup_phandle(const void *blob, int node, const char *prop_name) in fdtdec_lookup_phandle() argument
642 phandle = fdt_getprop(blob, node, prop_name, NULL); in fdtdec_lookup_phandle()
644 return -FDT_ERR_NOTFOUND; in fdtdec_lookup_phandle()
651 * Look up a property in a node and check that it has a minimum length.
654 * @param node node to examine
657 * @param err 0 if ok, or -FDT_ERR_NOTFOUND if the property is not
658 found, or -FDT_ERR_BADLAYOUT if not enough data
661 static const void *get_prop_check_min_len(const void *blob, int node, in get_prop_check_min_len() argument
669 cell = fdt_getprop(blob, node, prop_name, &len); in get_prop_check_min_len()
671 *err = -FDT_ERR_NOTFOUND; in get_prop_check_min_len()
673 *err = -FDT_ERR_BADLAYOUT; in get_prop_check_min_len()
679 int fdtdec_get_int_array(const void *blob, int node, const char *prop_name, in fdtdec_get_int_array() argument
686 cell = get_prop_check_min_len(blob, node, prop_name, in fdtdec_get_int_array()
697 int fdtdec_get_int_array_count(const void *blob, int node, in fdtdec_get_int_array_count() argument
705 cell = fdt_getprop(blob, node, prop_name, &len); in fdtdec_get_int_array_count()
707 return -FDT_ERR_NOTFOUND; in fdtdec_get_int_array_count()
717 const u32 *fdtdec_locate_array(const void *blob, int node, in fdtdec_locate_array() argument
723 cell = get_prop_check_min_len(blob, node, prop_name, in fdtdec_locate_array()
728 int fdtdec_get_bool(const void *blob, int node, const char *prop_name) in fdtdec_get_bool() argument
734 cell = fdt_getprop(blob, node, prop_name, &len); in fdtdec_get_bool()
747 int node = -1; in fdtdec_parse_phandle_with_args() local
753 return -ENOENT; in fdtdec_parse_phandle_with_args()
758 rc = -EINVAL; in fdtdec_parse_phandle_with_args()
768 * Find the provider node and parse the #*-cells in fdtdec_parse_phandle_with_args()
771 * This is not needed if the cell count is hard-coded in fdtdec_parse_phandle_with_args()
773 * except when we're going to return the found node in fdtdec_parse_phandle_with_args()
777 node = fdt_node_offset_by_phandle(blob, in fdtdec_parse_phandle_with_args()
779 if (!node) { in fdtdec_parse_phandle_with_args()
788 count = fdtdec_get_int(blob, node, cells_name, in fdtdec_parse_phandle_with_args()
789 -1); in fdtdec_parse_phandle_with_args()
790 if (count == -1) { in fdtdec_parse_phandle_with_args()
795 fdt_get_name(blob, node, in fdtdec_parse_phandle_with_args()
818 * or return -ENOENT for an empty entry. in fdtdec_parse_phandle_with_args()
820 rc = -ENOENT; in fdtdec_parse_phandle_with_args()
834 out_args->node = node; in fdtdec_parse_phandle_with_args()
835 out_args->args_count = count; in fdtdec_parse_phandle_with_args()
837 out_args->args[i] = in fdtdec_parse_phandle_with_args()
846 node = -1; in fdtdec_parse_phandle_with_args()
853 * -ENOENT : index is for empty phandle in fdtdec_parse_phandle_with_args()
854 * -EINVAL : parsing error on data in fdtdec_parse_phandle_with_args()
855 * [1..n] : Number of phandle (count mode; when index = -1) in fdtdec_parse_phandle_with_args()
857 rc = index < 0 ? cur_index : -ENOENT; in fdtdec_parse_phandle_with_args()
862 int fdtdec_get_child_count(const void *blob, int node) in fdtdec_get_child_count() argument
867 fdt_for_each_subnode(subnode, blob, node) in fdtdec_get_child_count()
873 int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name, in fdtdec_get_byte_array() argument
879 cell = get_prop_check_min_len(blob, node, prop_name, count, &err); in fdtdec_get_byte_array()
885 const u8 *fdtdec_locate_byte_array(const void *blob, int node, in fdtdec_locate_byte_array() argument
891 cell = get_prop_check_min_len(blob, node, prop_name, count, &err); in fdtdec_locate_byte_array()
945 while (cells--) in fdtdec_get_number()
951 int fdt_get_resource(const void *fdt, int node, const char *property, in fdt_get_resource() argument
958 parent = fdt_parent_offset(fdt, node); in fdt_get_resource()
965 ptr = fdt_getprop(fdt, node, property, &len); in fdt_get_resource()
973 res->start = fdtdec_get_number(ptr, na); in fdt_get_resource()
974 res->end = res->start; in fdt_get_resource()
975 res->end += fdtdec_get_number(&ptr[na], ns) - 1; in fdt_get_resource()
983 return -FDT_ERR_NOTFOUND; in fdt_get_resource()
986 int fdt_get_named_resource(const void *fdt, int node, const char *property, in fdt_get_named_resource() argument
992 index = fdt_stringlist_search(fdt, node, prop_names, name); in fdt_get_named_resource()
996 return fdt_get_resource(fdt, node, property, index, res); in fdt_get_named_resource()
999 static int decode_timing_property(const void *blob, int node, const char *name, in decode_timing_property() argument
1005 prop = fdt_getprop(blob, node, name, &length); in decode_timing_property()
1008 fdt_get_name(blob, node, NULL), name); in decode_timing_property()
1013 result->typ = fdtdec_get_int(blob, node, name, 0); in decode_timing_property()
1014 result->min = result->typ; in decode_timing_property()
1015 result->max = result->typ; in decode_timing_property()
1017 ret = fdtdec_get_int_array(blob, node, name, &result->min, 3); in decode_timing_property()
1024 struct display_timing *dt) in fdtdec_decode_display_timing() argument
1026 int i, node, timings_node; in fdtdec_decode_display_timing() local
1030 timings_node = fdt_subnode_offset(blob, parent, "display-timings"); in fdtdec_decode_display_timing()
1034 for (i = 0, node = fdt_first_subnode(blob, timings_node); in fdtdec_decode_display_timing()
1035 node > 0 && i != index; in fdtdec_decode_display_timing()
1036 node = fdt_next_subnode(blob, node)) in fdtdec_decode_display_timing()
1039 if (node < 0) in fdtdec_decode_display_timing()
1040 return node; in fdtdec_decode_display_timing()
1042 memset(dt, 0, sizeof(*dt)); in fdtdec_decode_display_timing()
1044 ret |= decode_timing_property(blob, node, "hback-porch", in fdtdec_decode_display_timing()
1045 &dt->hback_porch); in fdtdec_decode_display_timing()
1046 ret |= decode_timing_property(blob, node, "hfront-porch", in fdtdec_decode_display_timing()
1047 &dt->hfront_porch); in fdtdec_decode_display_timing()
1048 ret |= decode_timing_property(blob, node, "hactive", &dt->hactive); in fdtdec_decode_display_timing()
1049 ret |= decode_timing_property(blob, node, "hsync-len", &dt->hsync_len); in fdtdec_decode_display_timing()
1050 ret |= decode_timing_property(blob, node, "vback-porch", in fdtdec_decode_display_timing()
1051 &dt->vback_porch); in fdtdec_decode_display_timing()
1052 ret |= decode_timing_property(blob, node, "vfront-porch", in fdtdec_decode_display_timing()
1053 &dt->vfront_porch); in fdtdec_decode_display_timing()
1054 ret |= decode_timing_property(blob, node, "vactive", &dt->vactive); in fdtdec_decode_display_timing()
1055 ret |= decode_timing_property(blob, node, "vsync-len", &dt->vsync_len); in fdtdec_decode_display_timing()
1056 ret |= decode_timing_property(blob, node, "clock-frequency", in fdtdec_decode_display_timing()
1057 &dt->pixelclock); in fdtdec_decode_display_timing()
1059 dt->flags = 0; in fdtdec_decode_display_timing()
1060 val = fdtdec_get_int(blob, node, "vsync-active", -1); in fdtdec_decode_display_timing()
1061 if (val != -1) { in fdtdec_decode_display_timing()
1062 dt->flags |= val ? DISPLAY_FLAGS_VSYNC_HIGH : in fdtdec_decode_display_timing()
1065 val = fdtdec_get_int(blob, node, "hsync-active", -1); in fdtdec_decode_display_timing()
1066 if (val != -1) { in fdtdec_decode_display_timing()
1067 dt->flags |= val ? DISPLAY_FLAGS_HSYNC_HIGH : in fdtdec_decode_display_timing()
1070 val = fdtdec_get_int(blob, node, "de-active", -1); in fdtdec_decode_display_timing()
1071 if (val != -1) { in fdtdec_decode_display_timing()
1072 dt->flags |= val ? DISPLAY_FLAGS_DE_HIGH : in fdtdec_decode_display_timing()
1075 val = fdtdec_get_int(blob, node, "pixelclk-active", -1); in fdtdec_decode_display_timing()
1076 if (val != -1) { in fdtdec_decode_display_timing()
1077 dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE : in fdtdec_decode_display_timing()
1081 if (fdtdec_get_bool(blob, node, "interlaced")) in fdtdec_decode_display_timing()
1082 dt->flags |= DISPLAY_FLAGS_INTERLACED; in fdtdec_decode_display_timing()
1083 if (fdtdec_get_bool(blob, node, "doublescan")) in fdtdec_decode_display_timing()
1084 dt->flags |= DISPLAY_FLAGS_DOUBLESCAN; in fdtdec_decode_display_timing()
1085 if (fdtdec_get_bool(blob, node, "doubleclk")) in fdtdec_decode_display_timing()
1086 dt->flags |= DISPLAY_FLAGS_DOUBLECLK; in fdtdec_decode_display_timing()
1096 mem = fdt_path_offset(gd->fdt_blob, "/memory"); in fdtdec_setup_mem_size_base()
1098 debug("%s: Missing /memory node\n", __func__); in fdtdec_setup_mem_size_base()
1099 return -EINVAL; in fdtdec_setup_mem_size_base()
1102 ret = fdt_get_resource(gd->fdt_blob, mem, "reg", 0, &res); in fdtdec_setup_mem_size_base()
1105 return -EINVAL; in fdtdec_setup_mem_size_base()
1108 gd->ram_size = (phys_size_t)(res.end - res.start + 1); in fdtdec_setup_mem_size_base()
1109 gd->ram_base = (unsigned long)res.start; in fdtdec_setup_mem_size_base()
1111 (unsigned long long)gd->ram_size); in fdtdec_setup_mem_size_base()
1121 mem = fdt_node_offset_by_prop_value(gd->fdt_blob, mem, in get_next_memory_node()
1133 mem = get_next_memory_node(gd->fdt_blob, -1); in fdtdec_setup_memory_banksize()
1135 debug("%s: Missing /memory node\n", __func__); in fdtdec_setup_memory_banksize()
1136 return -EINVAL; in fdtdec_setup_memory_banksize()
1140 ret = fdt_get_resource(gd->fdt_blob, mem, "reg", reg++, &res); in fdtdec_setup_memory_banksize()
1141 if (ret == -FDT_ERR_NOTFOUND) { in fdtdec_setup_memory_banksize()
1143 mem = get_next_memory_node(gd->fdt_blob, mem); in fdtdec_setup_memory_banksize()
1144 if (mem == -FDT_ERR_NOTFOUND) in fdtdec_setup_memory_banksize()
1147 ret = fdt_get_resource(gd->fdt_blob, mem, "reg", reg++, &res); in fdtdec_setup_memory_banksize()
1148 if (ret == -FDT_ERR_NOTFOUND) in fdtdec_setup_memory_banksize()
1152 return -EINVAL; in fdtdec_setup_memory_banksize()
1155 gd->bd->bi_dram[bank].start = (phys_addr_t)res.start; in fdtdec_setup_memory_banksize()
1156 gd->bd->bi_dram[bank].size = in fdtdec_setup_memory_banksize()
1157 (phys_size_t)(res.end - res.start + 1); in fdtdec_setup_memory_banksize()
1161 (unsigned long long)gd->bd->bi_dram[bank].start, in fdtdec_setup_memory_banksize()
1162 (unsigned long long)gd->bd->bi_dram[bank].size); in fdtdec_setup_memory_banksize()
1181 return -1; in uncompress_blob()
1184 return -EBADMSG; in uncompress_blob()
1190 return -ENOMEM; in uncompress_blob()
1196 return -ENOTSUPP; in uncompress_blob()
1210 return -EBADMSG; in uncompress_blob()
1255 gd->fdt_blob = __dtb_dt_spl_begin; in fdtdec_setup()
1257 gd->fdt_blob = __dtb_dt_begin; in fdtdec_setup()
1261 gd->fdt_blob = board_fdt_blob_setup(); in fdtdec_setup()
1265 return -1; in fdtdec_setup()
1271 gd->fdt_blob = (void *)prior_stage_fdt_address; in fdtdec_setup()
1273 gd->fdt_blob = map_sysmem in fdtdec_setup()
1275 (unsigned long)map_to_sysmem(gd->fdt_blob)), 0); in fdtdec_setup()
1286 if (uncompress_blob(gd->fdt_blob, 0x1000000, &fdt_blob) == 0) in fdtdec_setup()
1287 gd->fdt_blob = fdt_blob; in fdtdec_setup()
1293 fdt_blob = locate_dtb_in_fit(gd->fdt_blob); in fdtdec_setup()
1295 gd->multi_dtb_fit = gd->fdt_blob; in fdtdec_setup()
1296 gd->fdt_blob = fdt_blob; in fdtdec_setup()
1316 if (gd->multi_dtb_fit) { in fdtdec_resetup()
1317 fdt_blob = locate_dtb_in_fit(gd->multi_dtb_fit); in fdtdec_resetup()
1319 if (fdt_blob == gd->fdt_blob) { in fdtdec_resetup()
1329 gd->fdt_blob = fdt_blob; in fdtdec_resetup()
1334 * If multi_dtb_fit is NULL, it means that blob appended to u-boot is in fdtdec_resetup()
1336 * to teard down DM and rescan the DT in this case. in fdtdec_resetup()
1350 int node, child; in fdtdec_decode_ram_size() local
1358 node = fdt_path_offset(blob, area); in fdtdec_decode_ram_size()
1359 if (node < 0) { in fdtdec_decode_ram_size()
1360 debug("No %s node found\n", area); in fdtdec_decode_ram_size()
1361 return -ENOENT; in fdtdec_decode_ram_size()
1364 cell = fdt_getprop(blob, node, "reg", &len); in fdtdec_decode_ram_size()
1367 return -ENOENT; in fdtdec_decode_ram_size()
1370 addr_cells = fdt_address_cells(blob, node); in fdtdec_decode_ram_size()
1371 size_cells = fdt_size_cells(blob, node); in fdtdec_decode_ram_size()
1374 for (child = fdt_first_subnode(blob, node); in fdtdec_decode_ram_size()
1379 match_mask = fdtdec_get_int(blob, child, "match-mask", -1); in fdtdec_decode_ram_size()
1380 match_value = fdtdec_get_int(blob, child, "match-value", -1); in fdtdec_decode_ram_size()
1386 node = child; in fdtdec_decode_ram_size()
1387 cell = fdt_getprop(blob, node, "reg", &len); in fdtdec_decode_ram_size()
1389 debug("No memory-banks property found\n"); in fdtdec_decode_ram_size()
1390 return -EINVAL; in fdtdec_decode_ram_size()
1395 /* Note: if no matching subnode was found we use the parent node */ in fdtdec_decode_ram_size()
1398 memset(bd->bi_dram, '\0', sizeof(bd->bi_dram[0]) * in fdtdec_decode_ram_size()
1402 auto_size = fdtdec_get_bool(blob, node, "auto-size"); in fdtdec_decode_ram_size()
1405 end = cell + len / 4 - addr_cells - size_cells; in fdtdec_decode_ram_size()
1415 bd->bi_dram[bank].start = addr; in fdtdec_decode_ram_size()
1427 debug("Auto-sizing %llx, size %llx: ", addr, size); in fdtdec_decode_ram_size()
1438 bd->bi_dram[bank].size = size; in fdtdec_decode_ram_size()