Andreas Rammhold 2a12187d58 of/fdt: run soc memory setup when early_init_dt_scan_memory fails
If memory has been found early_init_dt_scan_memory now returns 1. If
it hasn't found any memory it will return 0, allowing other memory
setup mechanisms to carry on.

Previously early_init_dt_scan_memory always returned 0 without
distinguishing between any kind of memory setup being done or not. Any
code path after the early_init_dt_scan memory call in the ramips
plat_mem_setup code wouldn't be executed anymore. Making
early_init_dt_scan_memory the only way to initialize the memory.

Some boards, including my mt7621 based Cudy X6 board, depend on memory
initialization being done via the soc_info.mem_detect function
pointer. Those wouldn't be able to obtain memory and panic the kernel
during early bootup with the message "early_init_dt_alloc_memory_arch:
Failed to allocate 12416 bytes align=0x40".

Fixes: 1f012283e936 ("of/fdt: Rework early_init_dt_scan_memory() to call directly")
Cc: stable@vger.kernel.org
Signed-off-by: Andreas Rammhold <andreas@rammhold.de>
Link: https://lore.kernel.org/r/20221223112748.2935235-1-andreas@rammhold.de
Signed-off-by: Rob Herring <robh@kernel.org>
2023-01-03 18:41:01 -06:00
..
2022-05-04 22:22:59 +02:00
2022-07-17 14:52:47 +02:00
2022-05-04 22:22:59 +02:00
2022-12-12 17:28:58 -08:00
2022-10-03 09:31:55 -07:00
2022-09-12 15:33:24 +02:00
2021-01-22 11:40:00 +01:00
2021-10-18 18:09:54 +02:00
2022-05-04 22:22:59 +02:00
2022-05-04 22:22:59 +02:00
2022-07-14 11:52:29 +02:00
2022-12-15 10:37:27 -08:00