From: Rob Herring Date: Wed, 12 Jan 2022 16:14:09 +0000 (-0600) Subject: Merge branch 'dt/linus' into dt/next X-Git-Tag: v5.17-rc1~14^2~20 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e623611b4d3f722b57ceeaf4368ac787837408e7;p=tomoyo%2Ftomoyo-test1.git Merge branch 'dt/linus' into dt/next Pick a fix which didn't make it into v5.16. --- e623611b4d3f722b57ceeaf4368ac787837408e7 diff --cc drivers/of/fdt.c index cf7608f0537b,65af475dfa95..ca2cfb3012a4 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@@ -1130,22 -1130,23 +1136,23 @@@ int __init early_init_dt_scan_memory(vo return 0; } -int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, - int depth, void *data) +int __init early_init_dt_scan_chosen(char *cmdline) { - int l; + int l, node; const char *p; const void *rng_seed; + const void *fdt = initial_boot_params; - pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname); - - if (depth != 1 || !data || - (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) - return 0; + node = fdt_path_offset(fdt, "/chosen"); + if (node < 0) + node = fdt_path_offset(fdt, "/chosen@0"); + if (node < 0) + return -ENOENT; + chosen_node_offset = node; + early_init_dt_check_for_initrd(node); early_init_dt_check_for_elfcorehdr(node); - early_init_dt_check_for_usable_mem_range(node); /* Retrieve command line */ p = of_get_flat_dt_prop(node, "bootargs", &l); @@@ -1277,10 -1279,10 +1284,10 @@@ void __init early_init_dt_scan_nodes(vo pr_warn("No chosen node found, continuing without\n"); /* Setup memory, calling early_init_dt_add_memory_arch */ - of_scan_flat_dt(early_init_dt_scan_memory, NULL); + early_init_dt_scan_memory(); /* Handle linux,usable-memory-range property */ - memblock_cap_memory_range(cap_mem_addr, cap_mem_size); + early_init_dt_check_for_usable_mem_range(); } bool __init early_init_dt_scan(void *params) diff --cc include/linux/of_fdt.h index 914739f3c192,ad09beb6d13c..d69ad5bb1eb1 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h @@@ -58,8 -58,11 +58,9 @@@ extern int of_flat_dt_is_compatible(uns extern unsigned long of_get_flat_dt_root(void); extern uint32_t of_get_flat_dt_phandle(unsigned long node); -extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, - int depth, void *data); -extern int early_init_dt_scan_memory(unsigned long node, const char *uname, - int depth, void *data); +extern int early_init_dt_scan_chosen(char *cmdline); +extern int early_init_dt_scan_memory(void); + extern void early_init_dt_check_for_usable_mem_range(void); extern int early_init_dt_scan_chosen_stdout(void); extern void early_init_fdt_scan_reserved_mem(void); extern void early_init_fdt_reserve_self(void);