Home
last modified time | relevance | path

Searched full:fdt (Results 1 – 25 of 175) sorted by relevance

1234567

/linux/scripts/dtc/libfdt/
H A Dfdt_sw.c8 #include <fdt.h>
13 static int fdt_sw_probe_(void *fdt) in fdt_sw_probe_() argument
16 if (fdt_magic(fdt) == FDT_MAGIC) in fdt_sw_probe_()
18 else if (fdt_magic(fdt) != FDT_SW_MAGIC) in fdt_sw_probe_()
25 #define FDT_SW_PROBE(fdt) \ argument
28 if ((err = fdt_sw_probe_(fdt)) != 0) \
38 static int fdt_sw_probe_memrsv_(void *fdt) in fdt_sw_probe_memrsv_() argument
40 int err = fdt_sw_probe_(fdt); in fdt_sw_probe_memrsv_()
44 if (!can_assume(VALID_INPUT) && fdt_off_dt_strings(fdt) != 0) in fdt_sw_probe_memrsv_()
49 #define FDT_SW_PROBE_MEMRSV(fdt) \ argument
[all …]
H A Dfdt_rw.c8 #include <fdt.h>
13 static int fdt_blocks_misordered_(const void *fdt, in fdt_blocks_misordered_() argument
16 return (fdt_off_mem_rsvmap(fdt) < FDT_ALIGN(sizeof(struct fdt_header), 8)) in fdt_blocks_misordered_()
17 || (fdt_off_dt_struct(fdt) < in fdt_blocks_misordered_()
18 (fdt_off_mem_rsvmap(fdt) + mem_rsv_size)) in fdt_blocks_misordered_()
19 || (fdt_off_dt_strings(fdt) < in fdt_blocks_misordered_()
20 (fdt_off_dt_struct(fdt) + struct_size)) in fdt_blocks_misordered_()
21 || (fdt_totalsize(fdt) < in fdt_blocks_misordered_()
22 (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt))); in fdt_blocks_misordered_()
25 static int fdt_rw_probe_(void *fdt) in fdt_rw_probe_() argument
[all …]
H A Dfdt_ro.c8 #include <fdt.h>
13 static int fdt_nodename_eq_(const void *fdt, int offset, in fdt_nodename_eq_() argument
17 const char *p = fdt_get_name(fdt, offset, &olen); in fdt_nodename_eq_()
34 const char *fdt_get_string(const void *fdt, int stroffset, int *lenp) in fdt_get_string() argument
43 s = (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset; in fdt_get_string()
49 totalsize = fdt_ro_probe_(fdt); in fdt_get_string()
55 absoffset = stroffset + fdt_off_dt_strings(fdt); in fdt_get_string()
60 if (fdt_magic(fdt) == FDT_MAGIC) { in fdt_get_string()
63 if (can_assume(LATEST) || fdt_version(fdt) >= 17) { in fdt_get_string()
64 if ((unsigned)stroffset >= fdt_size_dt_strings(fdt)) in fdt_get_string()
[all …]
H A Dfdt.c8 #include <fdt.h>
18 int32_t fdt_ro_probe_(const void *fdt) in fdt_ro_probe_() argument
20 uint32_t totalsize = fdt_totalsize(fdt); in fdt_ro_probe_()
26 if ((uintptr_t)fdt & 7) in fdt_ro_probe_()
29 if (fdt_magic(fdt) == FDT_MAGIC) { in fdt_ro_probe_()
32 if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION) in fdt_ro_probe_()
34 if (fdt_last_comp_version(fdt) > in fdt_ro_probe_()
38 } else if (fdt_magic(fdt) == FDT_SW_MAGIC) { in fdt_ro_probe_()
40 if (!can_assume(VALID_INPUT) && fdt_size_dt_struct(fdt) == 0) in fdt_ro_probe_()
83 size_t fdt_header_size(const void *fdt) in fdt_header_size() argument
[all …]
H A Dlibfdt.h10 #include "fdt.h"
53 /* FDT_ERR_TRUNCATED: FDT or a sub-block is improperly
120 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
122 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen) in fdt_offset_ptr_w() argument
124 return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen); in fdt_offset_ptr_w()
127 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
193 int fdt_next_node(const void *fdt, int offset, int *depth);
197 * @fdt: FDT blob
202 int fdt_first_subnode(const void *fdt, int offset);
206 * @fdt: FDT blob
[all …]
H A Dfdt_overlay.c9 #include <fdt.h>
43 int fdt_overlay_target_offset(const void *fdt, const void *fdto, in fdt_overlay_target_offset() argument
60 ret = fdt_path_offset(fdt, path); in fdt_overlay_target_offset()
64 ret = fdt_node_offset_by_phandle(fdt, phandle); in fdt_overlay_target_offset()
89 * @fdt: Base device tree blob
101 static int overlay_phandle_add_offset(void *fdt, int node, in overlay_phandle_add_offset() argument
107 valp = fdt_getprop_w(fdt, node, name, &len); in overlay_phandle_add_offset()
310 * @fdt: Base Device Tree blob
331 static int overlay_fixup_one_phandle(void *fdt, void *fdto, in overlay_fixup_one_phandle() argument
358 * @fdt: Base Device Tree blob
[all …]
H A Dfdt_wip.c8 #include <fdt.h>
13 int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset, in fdt_setprop_inplace_namelen_partial() argument
21 propval = fdt_getprop_namelen_w(fdt, nodeoffset, name, namelen, in fdt_setprop_inplace_namelen_partial()
33 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name, in fdt_setprop_inplace() argument
39 propval = fdt_getprop(fdt, nodeoffset, name, &proplen); in fdt_setprop_inplace()
46 return fdt_setprop_inplace_namelen_partial(fdt, nodeoffset, name, in fdt_setprop_inplace()
59 int fdt_nop_property(void *fdt, int nodeoffset, const char *name) in fdt_nop_property() argument
64 prop = fdt_get_property_w(fdt, nodeoffset, name, &len); in fdt_nop_property()
73 int fdt_node_end_offset_(void *fdt, int offset) in fdt_node_end_offset_() argument
78 offset = fdt_next_node(fdt, offset, &depth); in fdt_node_end_offset_()
[all …]
H A Dfdt_addresses.c9 #include <fdt.h>
14 static int fdt_cells(const void *fdt, int nodeoffset, const char *name) in fdt_cells() argument
20 c = fdt_getprop(fdt, nodeoffset, name, &len); in fdt_cells()
34 int fdt_address_cells(const void *fdt, int nodeoffset) in fdt_address_cells() argument
38 val = fdt_cells(fdt, nodeoffset, "#address-cells"); in fdt_address_cells()
46 int fdt_size_cells(const void *fdt, int nodeoffset) in fdt_size_cells() argument
50 val = fdt_cells(fdt, nodeoffset, "#size-cells"); in fdt_size_cells()
57 int fdt_appendprop_addrrange(void *fdt, int parent, int nodeoffset, in fdt_appendprop_addrrange() argument
63 ret = fdt_address_cells(fdt, parent); in fdt_appendprop_addrrange()
68 ret = fdt_size_cells(fdt, parent); in fdt_appendprop_addrrange()
[all …]
H A Dlibfdt_internal.h8 #include <fdt.h>
13 int32_t fdt_ro_probe_(const void *fdt);
14 #define FDT_RO_PROBE(fdt) \ argument
17 if ((totalsize_ = fdt_ro_probe_(fdt)) < 0) \
21 int fdt_check_node_offset_(const void *fdt, int offset);
22 int fdt_check_prop_offset_(const void *fdt, int offset);
24 int fdt_node_end_offset_(void *fdt, int nodeoffset);
26 static inline const void *fdt_offset_ptr_(const void *fdt, int offset) in fdt_offset_ptr_() argument
28 return (const char *)fdt + fdt_off_dt_struct(fdt) + offset; in fdt_offset_ptr_()
31 static inline void *fdt_offset_ptr_w_(void *fdt, int offset) in fdt_offset_ptr_w_() argument
[all …]
/linux/drivers/of/
H A Dkexec.c26 * Additional space needed for the FDT buffer so that we can add initrd,
34 * @fdt: Flattened device tree for the current kernel.
40 static int fdt_find_and_del_mem_rsv(void *fdt, unsigned long start, unsigned long size) in fdt_find_and_del_mem_rsv() argument
42 int i, ret, num_rsvs = fdt_num_mem_rsv(fdt); in fdt_find_and_del_mem_rsv()
47 ret = fdt_get_mem_rsv(fdt, i, &rsv_start, &rsv_size); in fdt_find_and_del_mem_rsv()
54 ret = fdt_del_mem_rsv(fdt, i); in fdt_find_and_del_mem_rsv()
193 * remove_ima_buffer - remove the IMA buffer property and reservation from @fdt
195 * @fdt: Flattened Device Tree to update
201 static void remove_ima_buffer(void *fdt, int chosen_node) in remove_ima_buffer() argument
211 prop = fdt_getprop(fdt, chosen_node, "linux,ima-kexec-buffer", &len); in remove_ima_buffer()
[all …]
/linux/arch/arm/boot/compressed/
H A Datags_to_fdt.c15 static int node_offset(void *fdt, const char *node_path) in node_offset() argument
17 int offset = fdt_path_offset(fdt, node_path); in node_offset()
20 offset = fdt_add_subnode(fdt, 0, node_path + 1); in node_offset()
24 static int setprop(void *fdt, const char *node_path, const char *property, in setprop() argument
27 int offset = node_offset(fdt, node_path); in setprop()
30 return fdt_setprop(fdt, offset, property, val_array, size); in setprop()
33 static int setprop_string(void *fdt, const char *node_path, in setprop_string() argument
36 int offset = node_offset(fdt, node_path); in setprop_string()
39 return fdt_setprop_string(fdt, offset, property, string); in setprop_string()
42 static int setprop_cell(void *fdt, const char *node_path, in setprop_cell() argument
[all …]
H A Dfdt_check_mem_start.c8 static const void *get_prop(const void *fdt, const char *node_path, in get_prop() argument
14 offset = fdt_path_offset(fdt, node_path); in get_prop()
18 prop = fdt_getprop(fdt, offset, property, &len); in get_prop()
25 static uint32_t get_cells(const void *fdt, const char *name) in get_cells() argument
27 const fdt32_t *prop = get_prop(fdt, "/", name, sizeof(fdt32_t)); in get_cells()
64 uint32_t fdt_check_mem_start(uint32_t mem_start, const void *fdt) in fdt_check_mem_start() argument
73 if (!fdt) in fdt_check_mem_start()
76 if (fdt_magic(fdt) != FDT_MAGIC) in fdt_check_mem_start()
80 addr_cells = get_cells(fdt, "#address-cells"); in fdt_check_mem_start()
81 size_cells = get_cells(fdt, "#size-cells"); in fdt_check_mem_start()
[all …]
/linux/drivers/firmware/efi/libstub/
H A Dfdt.c3 * FDT related Helper functions used by the EFI stub on multiple
19 static void fdt_update_cell_size(void *fdt) in fdt_update_cell_size() argument
23 offset = fdt_path_offset(fdt, "/"); in fdt_update_cell_size()
26 fdt_setprop_u32(fdt, offset, "#address-cells", EFI_DT_ADDR_CELLS_DEFAULT); in fdt_update_cell_size()
27 fdt_setprop_u32(fdt, offset, "#size-cells", EFI_DT_SIZE_CELLS_DEFAULT); in fdt_update_cell_size()
31 void *fdt, int new_fdt_size, char *cmdline_ptr) in update_fdt() argument
38 /* Do some checks on provided FDT, if it exists: */ in update_fdt()
45 * We don't get the size of the FDT if we get if from a in update_fdt()
55 status = fdt_open_into(orig_fdt, fdt, new_fdt_size); in update_fdt()
57 status = fdt_create_empty_tree(fdt, new_fdt_size); in update_fdt()
[all …]
/linux/arch/powerpc/boot/
H A Dlibfdt-wrapper.c40 static void *fdt; variable
47 int size = fdt_totalsize(fdt); in expand_buf()
54 rc = fdt_open_into(fdt, buf, size); in expand_buf()
56 fatal("Couldn't expand fdt into new buffer: %s\n\r", in expand_buf()
59 fdt = buf; in expand_buf()
64 return offset_devp(fdt_path_offset(fdt, path)); in fdt_wrapper_finddevice()
73 p = fdt_getprop(fdt, devp_offset(devp), name, &len); in fdt_wrapper_getprop()
85 rc = fdt_setprop(fdt, devp_offset(devp), name, buf, len); in fdt_wrapper_setprop()
88 rc = fdt_setprop(fdt, devp_offset(devp), name, buf, len); in fdt_wrapper_setprop()
96 return fdt_del_node(fdt, devp_offset(devp)); in fdt_wrapper_del_node()
[all …]
/linux/arch/mips/generic/
H A DKconfig10 kernel is booted without being provided with an FDT via the UHI
54 bool "Include FDT for MIPS Boston boards"
56 Enable this to include the FDT for the MIPS Boston development board
62 bool "Include FDT for IMG Pistachio Marduk (CI40) boards"
64 Enable this to include the FDT for the IMG Pistachio Marduk (CI40)
68 bool "Include FDT for NI 169445"
70 Enable this to include the FDT for the 169445 platform from
74 bool "Include FDT for Xilfpga"
76 Enable this to include the FDT for the MIPSfpga platform
80 bool "Include FDT for Microsemi Ocelot development platforms"
[all …]
H A Dboard-sead3.c43 static __init int append_memory(void *fdt) in append_memory() argument
45 return yamon_dt_append_memory(fdt, mem_regions); in append_memory()
48 static __init int remove_gic(void *fdt) in remove_gic() argument
61 gic_off = fdt_node_offset_by_compatible(fdt, -1, "mti,gic"); in remove_gic()
67 err = fdt_nop_node(fdt, gic_off); in remove_gic()
73 cpu_off = fdt_node_offset_by_compatible(fdt, -1, in remove_gic()
80 cpu_phandle = fdt_get_phandle(fdt, cpu_off); in remove_gic()
86 uart_off = fdt_node_offset_by_compatible(fdt, -1, "ns16550a"); in remove_gic()
88 err = fdt_setprop_u32(fdt, uart_off, "interrupt-parent", in remove_gic()
96 err = fdt_setprop_u32(fdt, uart_off, "interrupts", in remove_gic()
[all …]
H A Dinit.c23 static __initconst const void *fdt; variable
30 BUG_ON(!fdt); in prom_init()
38 if (fdt) in plat_get_fdt()
40 return (void *)fdt; in plat_get_fdt()
42 fdt = (void *)get_fdt(); in plat_get_fdt()
43 if (fdt && !fdt_check_header(fdt)) { in plat_get_fdt()
50 match = mips_machine_is_compatible(check_mach, fdt); in plat_get_fdt()
79 /* Retrieve the machine's FDT */ in plat_get_fdt()
80 fdt = mach->fdt; in plat_get_fdt()
82 return (void *)fdt; in plat_get_fdt()
[all …]
H A Dboard-realtek.c14 static __init int realtek_add_initrd(void *fdt) in realtek_add_initrd() argument
19 node = fdt_path_offset(fdt, "/chosen"); in realtek_add_initrd()
33 err = fdt_setprop_u32(fdt, node, "linux,initrd-start", start); in realtek_add_initrd()
39 err = fdt_setprop_u32(fdt, node, "linux,initrd-end", start + size); in realtek_add_initrd()
53 static __init const void *realtek_fixup_fdt(const void *fdt, const void *match_data) in realtek_fixup_fdt() argument
58 if (fdt_check_header(fdt)) in realtek_fixup_fdt()
63 err = apply_mips_fdt_fixups(fdt_buf, sizeof(fdt_buf), fdt, realtek_fdt_fixups); in realtek_fixup_fdt()
65 panic("Unable to fixup FDT: %d", err); in realtek_fixup_fdt()
/linux/arch/mips/include/asm/
H A Dmachine.h15 const void *fdt; member
17 const void *(*fixup_fdt)(const void *fdt, const void *match_data);
34 * mips_machine_is_compatible() - check if a machine is compatible with an FDT
36 * @fdt: the FDT to check for compatibility with
39 * device tree @fdt, based upon the compatibility property of the root node.
44 mips_machine_is_compatible(const struct mips_machine *mach, const void *fdt) in mips_machine_is_compatible() argument
52 if (fdt_node_check_compatible(fdt, 0, match->compatible) == 0) in mips_machine_is_compatible()
60 * struct mips_fdt_fixup - Describe a fixup to apply to an FDT
61 * @apply: applies the fixup to @fdt, returns zero on success else -errno
64 * Describes a fixup applied to an FDT blob by the @apply function. The
[all …]
H A Dyamon-dt.h26 * @fdt: the FDT blob
29 * /chosen node in @fdt.
33 extern __init int yamon_dt_append_cmdline(void *fdt);
37 * @fdt: the FDT blob
40 * Generate a /memory node in @fdt based upon memory size information provided
45 extern __init int yamon_dt_append_memory(void *fdt,
50 * @fdt: the FDT blob
52 * Generate a stdout-path property in the /chosen node of @fdt, based upon
58 extern __init int yamon_dt_serial_config(void *fdt);
/linux/arch/powerpc/mm/nohash/
H A Dkaslr_booke.c40 static __init void kaslr_get_cmdline(void *fdt) in kaslr_get_cmdline() argument
64 static unsigned long __init get_boot_seed(void *fdt) in get_boot_seed() argument
70 hash = rotate_xor(hash, fdt, fdt_totalsize(fdt)); in get_boot_seed()
75 static __init u64 get_kaslr_seed(void *fdt) in get_kaslr_seed() argument
81 node = fdt_path_offset(fdt, "/chosen"); in get_kaslr_seed()
85 prop = fdt_getprop_w(fdt, node, "kaslr-seed", &len); in get_kaslr_seed()
99 static __init bool overlaps_reserved_region(const void *fdt, u32 start, in overlaps_reserved_region() argument
106 for (i = 0; i < fdt_num_mem_rsv(fdt); i++) { in overlaps_reserved_region()
107 if (fdt_get_mem_rsv(fdt, i, &base, &size) < 0) in overlaps_reserved_region()
117 for (subnode = fdt_first_subnode(fdt, regions.reserved_mem); in overlaps_reserved_region()
[all …]
/linux/arch/riscv/kernel/pi/
H A Dfdt_early.c31 * @fdt: pointer to the device tree blob
37 static bool fdt_device_is_available(const void *fdt, int node) in fdt_device_is_available() argument
42 status = fdt_getprop(fdt, node, "status", &statlen); in fdt_device_is_available()
55 static int fdt_node_name_eq(const void *fdt, int offset, in fdt_node_name_eq() argument
60 const char *p = fdt_get_name(fdt, offset, &olen); in fdt_node_name_eq()
130 * @fdt: pointer to the device tree blob
137 static bool early_cpu_isa_ext_available(const void *fdt, int node, const char *ext_name) in early_cpu_isa_ext_available() argument
142 prop = fdt_getprop(fdt, node, "riscv,isa-extensions", &len); in early_cpu_isa_ext_available()
146 prop = fdt_getprop(fdt, node, "riscv,isa", &len); in early_cpu_isa_ext_available()
156 * @fdt: pointer to the device tree blob
[all …]
/linux/tools/testing/selftests/net/
H A Dtxring_overwrite.c90 int fdt; in setup_tx() local
92 fdt = socket(PF_PACKET, SOCK_RAW, 0); in setup_tx()
93 if (fdt == -1) in setup_tx()
102 if (bind(fdt, (void *)&laddr, sizeof(laddr))) in setup_tx()
103 error(1, errno, "bind fdt"); in setup_tx()
110 if (setsockopt(fdt, SOL_PACKET, PACKET_TX_RING, in setup_tx()
115 PROT_READ | PROT_WRITE, MAP_SHARED, fdt, 0); in setup_tx()
119 return fdt; in setup_tx()
122 static void send_pkt(int fdt, void *slot, char payload_char) in send_pkt() argument
135 ret = sendto(fdt, NULL, 0, 0, NULL, 0); in send_pkt()
[all …]
/linux/arch/mips/mti-malta/
H A Dmalta-dtshim.c131 static void __init append_memory(void *fdt, int root_off) in append_memory() argument
144 mem_off = fdt_path_offset(fdt, "/memory"); in append_memory()
206 mem_off = fdt_add_subnode(fdt, root_off, "memory"); in append_memory()
210 err = fdt_setprop_string(fdt, mem_off, "device_type", "memory"); in append_memory()
215 err = fdt_setprop(fdt, mem_off, "reg", mem_array, in append_memory()
221 err = fdt_setprop(fdt, mem_off, "linux,usable-memory", mem_array, in append_memory()
227 static void __init remove_gic(void *fdt) in remove_gic() argument
254 gic_off = fdt_node_offset_by_compatible(fdt, -1, "mti,gic"); in remove_gic()
261 err = fdt_nop_node(fdt, gic_off); in remove_gic()
265 i8259_off = fdt_node_offset_by_compatible(fdt, -1, "intel,i8259"); in remove_gic()
[all …]
/linux/arch/powerpc/kexec/
H A Delf_64.c36 void *fdt; in elf64_load() local
111 fdt = of_kexec_alloc_and_setup_fdt(image, initrd_load_addr, in elf64_load()
114 if (!fdt) { in elf64_load()
120 ret = setup_new_fdt_ppc64(image, fdt, rmem); in elf64_load()
125 fdt_pack(fdt); in elf64_load()
127 kbuf.buffer = fdt; in elf64_load()
128 kbuf.bufsz = kbuf.memsz = fdt_totalsize(fdt); in elf64_load()
136 /* FDT will be freed in arch_kimage_file_post_load_cleanup */ in elf64_load()
137 image->arch.fdt = fdt; in elf64_load()
144 ret = setup_purgatory_ppc64(image, slave_code, fdt, kernel_load_addr, in elf64_load()
[all …]

1234567