/haiku/src/libs/libfdt/ |
H A D | fdt_sw.c | 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 52 if ((err = fdt_sw_probe_memrsv_(fdt)) != 0) \ [all …]
|
H A D | fdt_rw.c | 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 29 FDT_RO_PROBE(fdt); in fdt_rw_probe_() [all …]
|
H A D | fdt.c | 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 86 fdt_header_size_(fdt_version(fdt)); in fdt_header_size() [all …]
|
H A D | fdt_ro.c | 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() 66 if ((fdt_size_dt_strings(fdt) - stroffset) < len) in fdt_get_string() [all …]
|
H A D | fdt_wip.c | 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_() 83 int fdt_nop_node(void *fdt, int nodeoffset) in fdt_nop_node() argument [all …]
|
H A D | fdt_overlay.c | 58 static int overlay_get_target(const void *fdt, const void *fdto, in overlay_get_target() argument 75 ret = fdt_path_offset(fdt, path); in overlay_get_target() 79 ret = fdt_node_offset_by_phandle(fdt, phandle); in overlay_get_target() 116 static int overlay_phandle_add_offset(void *fdt, int node, in overlay_phandle_add_offset() argument 123 val = fdt_getprop(fdt, node, name, &len); in overlay_phandle_add_offset() 138 return fdt_setprop_inplace_u32(fdt, node, name, adj_val); in overlay_phandle_add_offset() 368 static int overlay_fixup_one_phandle(void *fdt, void *fdto, in overlay_fixup_one_phandle() argument 383 symbol_path = fdt_getprop(fdt, symbols_off, label, in overlay_fixup_one_phandle() 388 symbol_off = fdt_path_offset(fdt, symbol_path); in overlay_fixup_one_phandle() 392 phandle = fdt_get_phandle(fdt, symbol_off); in overlay_fixup_one_phandle() [all …]
|
H A D | fdt_addresses.c | 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() 99 return fdt_appendprop(fdt, nodeoffset, name, data, in fdt_appendprop_addrrange()
|
H A D | fdt_check.c | 13 int fdt_check_full(const void *fdt, size_t bufsize) in fdt_check_full() argument 26 if (bufsize < fdt_header_size(fdt)) in fdt_check_full() 28 err = fdt_check_header(fdt); in fdt_check_full() 31 if (bufsize < fdt_totalsize(fdt)) in fdt_check_full() 34 num_memrsv = fdt_num_mem_rsv(fdt); in fdt_check_full() 40 tag = fdt_next_tag(fdt, offset, &nextoffset); in fdt_check_full() 68 name = fdt_get_name(fdt, offset, &len); in fdt_check_full() 83 prop = fdt_getprop_by_offset(fdt, offset, &propname, in fdt_check_full()
|
H A D | Makefile.libfdt | 8 LIBFDT_INCLUDES = fdt.h libfdt.h libfdt_env.h 10 LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c fdt_empty_tree.c \
|
/haiku/headers/libs/libfdt/ |
H A D | libfdt.h | 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); 202 int fdt_first_subnode(const void *fdt, int offset); 215 int fdt_next_subnode(const void *fdt, int offset); 239 #define fdt_for_each_subnode(node, fdt, parent) \ argument 240 for (node = fdt_first_subnode(fdt, parent); \ 242 node = fdt_next_subnode(fdt, node)) [all …]
|
H A D | libfdt_internal.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 33 return (void *)(uintptr_t)fdt_offset_ptr_(fdt, offset); in fdt_offset_ptr_w_() [all …]
|
/haiku/src/system/boot/platform/efi/ |
H A D | dtb.cpp | 109 dump_fdt(const void *fdt) in dump_fdt() argument 111 if (!fdt) in dump_fdt() 114 int err = fdt_check_header(fdt); in dump_fdt() 124 while ((node = fdt_next_node(fdt, node, &depth)) >= 0 && depth >= 0) { in dump_fdt() 128 dprintf("node('%s')\n", fdt_get_name(fdt, node, NULL)); in dump_fdt() 130 …for (int prop = fdt_first_property_offset(fdt, node); prop >= 0; prop = fdt_next_property_offset(f… in dump_fdt() 132 const struct fdt_property *property = fdt_get_property_by_offset(fdt, prop, &len); in dump_fdt() 141 dprintf("prop('%s'): ", fdt_string(fdt, fdt32_to_cpu(property->nameoff))); in dump_fdt() 143 strcmp(fdt_string(fdt, fdt32_to_cpu(property->nameoff)), "compatible") == 0 || in dump_fdt() 144 strcmp(fdt_string(fdt, fdt32_to_cpu(property->nameoff)), "model") == 0 || in dump_fdt() [all …]
|
H A D | dtb.h | 18 bool dtb_get_reg(const void* fdt, int node, size_t idx, addr_range& range); 19 uint32 dtb_get_interrupt(const void* fdt, int node);
|
/haiku/src/system/boot/platform/riscv/ |
H A D | fdt.cpp | 55 GetReg(const void* fdt, int node, uint32 addressCells, uint32 sizeCells, size_t idx, in GetReg() argument 59 const uint8* prop = (const uint8*)fdt_getprop(fdt, node, "reg", &propSize); in GetReg() 84 GetInterrupt(const void* fdt, int node) in GetInterrupt() argument 86 if (uint32* prop = (uint32*)fdt_getprop(fdt, node, "interrupts-extended", NULL)) { in GetInterrupt() 89 if (uint32* prop = (uint32*)fdt_getprop(fdt, node, "interrupts", NULL)) { in GetInterrupt() 98 HandleFdt(const void* fdt, int node, uint32 addressCells, uint32 sizeCells, in HandleFdt() argument 103 const char* name = fdt_get_name(fdt, node, NULL); in HandleFdt() 105 if (uint32* prop = (uint32*)fdt_getprop(fdt, node, "timebase-frequency", NULL)) in HandleFdt() 109 const char* device_type = (const char*)fdt_getprop(fdt, node, in HandleFdt() 112 gMemBase = (uint8*)fdt64_to_cpu(*((uint64*)fdt_getprop(fdt, node, in HandleFdt() [all …]
|
H A D | start.cpp | 34 extern "C" void _start(int hartId, void* fdt); 123 fix_address(gKernelArgs.arch_args.fdt); in convert_kernel_args() 197 _start(int hartId, void* fdt) in _start() argument 202 fdt_init(fdt); in _start()
|
H A D | fdt.h | 14 void fdt_init(void* fdt);
|
/haiku/src/system/boot/platform/efi/arch/riscv64/ |
H A D | arch_dtb.cpp | 30 arch_handle_fdt(const void* fdt, int node) in arch_handle_fdt() argument 32 const char* deviceType = (const char*)fdt_getprop(fdt, node, in arch_handle_fdt() 35 const char* name = fdt_get_name(fdt, node, NULL); in arch_handle_fdt() 37 if (uint32* prop = (uint32*)fdt_getprop(fdt, node, "boot-hartid", NULL)) in arch_handle_fdt() 40 if (uint32* prop = (uint32*)fdt_getprop(fdt, node, "timebase-frequency", NULL)) in arch_handle_fdt() 47 if (!(fdt_getprop(fdt, node, "mmu-type", NULL) != NULL)) in arch_handle_fdt() 54 info->id = fdt32_to_cpu(*(uint32*)fdt_getprop(fdt, node, in arch_handle_fdt() 59 int subNode = fdt_subnode_offset(fdt, node, "interrupt-controller"); in arch_handle_fdt() 63 info->phandle = fdt_get_phandle(fdt, subNode); in arch_handle_fdt() 69 const char* compatible = (const char*)fdt_getprop(fdt, node, in arch_handle_fdt() [all …]
|
/haiku/src/system/boot/platform/efi/arch/arm/ |
H A D | arch_dtb.cpp | 46 arch_handle_fdt(const void* fdt, int node) in arch_handle_fdt() argument 48 const char* deviceType = (const char*)fdt_getprop(fdt, node, in arch_handle_fdt() 57 info->id = fdt32_to_cpu(*(uint32*)fdt_getprop(fdt, node, in arch_handle_fdt() 66 const char* compatible = (const char*)fdt_getprop(fdt, node, in arch_handle_fdt() 81 dtb_get_reg(fdt, node, 0, interrupt_controller.regs1); in arch_handle_fdt() 82 dtb_get_reg(fdt, node, 1, interrupt_controller.regs2); in arch_handle_fdt() 96 dtb_get_reg(fdt, node, 0, timer.regs); in arch_handle_fdt() 97 timer.interrupt = dtb_get_interrupt(fdt, node); in arch_handle_fdt()
|
/haiku/src/system/boot/platform/efi/arch/arm64/ |
H A D | arch_dtb.cpp | 38 arch_handle_fdt(const void* fdt, int node) in arch_handle_fdt() argument 40 const char* deviceType = (const char*)fdt_getprop(fdt, node, in arch_handle_fdt() 49 info->id = fdt32_to_cpu(*(uint32*)fdt_getprop(fdt, node, in arch_handle_fdt() 58 const char* compatible = (const char*)fdt_getprop(fdt, node, in arch_handle_fdt() 73 dtb_get_reg(fdt, node, 0, interrupt_controller.regs1); in arch_handle_fdt() 74 dtb_get_reg(fdt, node, 1, interrupt_controller.regs2); in arch_handle_fdt()
|
/haiku/src/add-ons/kernel/bus_managers/fdt/ |
H A D | Jamfile | 1 SubDir HAIKU_TOP src add-ons kernel bus_managers fdt ; 7 fdt.c 21 KernelAddon fdt :
|
/haiku/src/system/boot/platform/u-boot/ |
H A D | start.cpp | 68 struct image_header *uimage=NULL, void *fdt=NULL); 114 gKernelArgs.platform_args.fdt = kernel_args_malloc(fdtSize); in platform_start_kernel() 115 memcpy(gKernelArgs.platform_args.fdt, gFDT, fdtSize); in platform_start_kernel() 169 start_linux_ppc_fdt(void *fdt, long/*UNUSED*/, long/*UNUSED*/, in start_linux_ppc_fdt() argument 172 return start_gen(0, NULL, NULL, fdt); in start_linux_ppc_fdt() 184 start_gen(int argc, const char **argv, struct image_header *uimage, void *fdt) in start_gen() argument 200 gFDT = fdt; //XXX: make a copy? in start_gen()
|
H A D | serial.cpp | 121 serial_init(const void *fdt) in serial_init() argument 124 gUART = debug_uart_from_fdt(fdt); in serial_init()
|
/haiku/docs/develop/kernel/arch/arm/ |
H A D | efikamx.rst | 7 * http://svnweb.freebsd.org/base/head/sys/boot/fdt/dts/imx51x.dtsi?revision=248557&view=markup 8 * http://svnweb.freebsd.org/base/head/sys/boot/fdt/dts/efikamx.dts?revision=248557&view=markup
|
/haiku/headers/private/kernel/boot/platform/efi/ |
H A D | arch_dtb.h | 12 void arch_handle_fdt(const void* fdt, int node);
|
/haiku/data/boot/u-boot/ |
H A D | boot-riscv64.scr.txt | 14 env exists dtb && echo "Using custom DTB..." && fatload ${media} 0 ${fdt_addr_r} ${dtb} && fdt addr… 15 env exists dtb || echo "Using internal DTB..." && fdt addr ${fdtcontroladdr}
|