]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Merge branch 'dt/linus' into dt/next
authorRob Herring <robh@kernel.org>
Wed, 12 Jan 2022 16:14:09 +0000 (10:14 -0600)
committerRob Herring <robh@kernel.org>
Wed, 12 Jan 2022 16:14:09 +0000 (10:14 -0600)
Pick a fix which didn't make it into v5.16.

1  2 
drivers/of/fdt.c
include/linux/of_fdt.h

index cf7608f0537bed2b64e18366c79472d0fb1748dd,65af475dfa9508f3df833cfb105ea70f6c3fe268..ca2cfb3012a49400b7279d03688f1b3c3c966780
@@@ -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)
index 914739f3c19266e74e22a859bc9cd83653c9615a,ad09beb6d13c447053601034a6b6e5607d440aa2..d69ad5bb1eb1e64d3a13927c16767bc6716fd7b2
@@@ -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);