From: Rob Herring Date: Wed, 12 Jan 2022 16:14:09 +0000 (-0600) Subject: Merge branch 'dt/linus' into dt/next X-Git-Tag: baikal/mips/sdk6.1~6655^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=dfbd67de418eb177c80e6fe7cd80d1719d1df59a;p=kernel.git Merge branch 'dt/linus' into dt/next Pick a fix which didn't make it into v5.16. --- dfbd67de418eb177c80e6fe7cd80d1719d1df59a diff --cc drivers/of/fdt.c index cf7608f0537be,65af475dfa950..ca2cfb3012a49 --- 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 914739f3c1926,ad09beb6d13c4..d69ad5bb1eb1e --- 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);