}; 要想修改bootargs则调用fdt_setprop_string; Ps:其中fdt_setprop_string等接口是FDT提供的标准接口,boot和kernel源码中都可调用。 3)将dtb从flash拷贝到dram上。假设拷贝到dram=0x200100的地址,则uboot跳转到kernel时再通过cpu的通用寄存器r2告知系统这个地址,这一点与tag没有
这个代码示例使用open和mmap打开和读取设备树文件,然后使用fdt_path_offset获取FDT Chosen节点的偏移量。接着,使用fdt_setprop_string设置FDT Chosen Bootargs属性的值。最后,使用fdt_pack保存设备树文件并关闭文件描述符。 总结 FDT Chosen Bootargs属性是设备树中用于传递内核启动参数的重要属性。通过修改FDT Chosen Bootargs...
ret = fdt_setprop_string(blob, newoff, "label", part->name); if (ret == -FDT_ERR_NOSPACE) { ret = fdt_increase_size(blob, 512); if (!ret) goto add_label; else goto err_size; } else if (ret < 0) goto err_prop; part_num++; } return 0; err_size: printf("Can't incr...
100 95 fdt_setprop_string(fdt, off, "compatible", 101 96 "fsl,lx2160ar2-pcie-ep"); 102 97 prop = fdt_getprop(fdt, off, "apio-wins", NULL); @@ -113,9 +108,6 @@ static int lx2_board_fix_fdt(void *fdt) 113 108 fdt_setprop_u32(fdt, off, "num-ib-windows", ib_win...
err = fdt_setprop(*blob, node, property, buf, len); } if (err) { report_error(property, -1, err); return -1; } return 0; } /** * Create paths as needed for all components of a path * * Any components of the path that do not exist are created. Errors are...
int qemu_fdt_setprop_string(void *fdt, const char *node_path, const char *property, const char *string) { int r; @@ -183,8 +183,8 @@ int qemu_devtree_setprop_string(void *fdt, const char *node_path, return r; } const void *qemu_devtree_getprop(void *fdt, const char *node...
fdt_get_string fdt_find_max_phandle fdt_generate_phandle fdt_parent_offset fdt_stringlist_count fdt_stringlist_search fdt_stringlist_get fdt_setprop_inplace_namelen_partial fdt_create_with_flags fdt_property_placeholder fdt_setprop_placeholder fdt_appendprop_addrrange fdt_overlay_target_offset 228...
ret = fdt_setprop_placeholder(fdt, root_sym, name,len + (len > 1) + rel_path_len + 1, &p); if (ret < 0) return ret;if (!target_path) { /* again in case setprop_placeholder changed it */ ret = overlay_get_target(fdt, fdto, fragment, &target_path);...
char *str; /* used to set string properties */ err = fdt_check_header(fdt); @@ -294,28 +299,31 @@ int fdt_chosen(void *fdt) #ifdef CONFIG_ARCH_ROCKCHIP const char *bootargs; bootargs = fdt_getprop(fdt, nodeoffset, "bootargs", NULL); if (bootargs) { /* * Append kernel boo...
as * fdt_add_subnode() and fdt_setprop(), then this problem isavoided. * * The nodes/properties to include/exclude are defined byafunction * provided by the caller. This function is called for eachnode and * property, and return: * * 0 - to exclude this part * 1 -...