linux/arch/nios2
Guenter Roeck de164a7f19 nios2: Only use built-in devicetree blob if configured to do so
Starting with commit 7b937cc243 ("of: Create of_root if no dtb provided
by firmware"), attempts to boot nios2 images with an external devicetree
blob result in a crash.

Kernel panic - not syncing: early_init_dt_alloc_memory_arch:
	Failed to allocate 72 bytes align=0x40

For nios2, a built-in devicetree blob always overrides devicetree blobs
provided by ROMMON/BIOS. This includes the new dummy devicetree blob.
Result is that the dummy devicetree blob is used even if an external
devicetree blob is provided. Since the dummy devicetree blob does not
include any memory information, memory allocations fail, resulting in
the crash.

To fix the problem, only use the built-in devicetree blob if
CONFIG_NIOS2_DTB_SOURCE_BOOL is enabled.

Fixes: 7b937cc243 ("of: Create of_root if no dtb provided by firmware")
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20240322065419.162416-1-linux@roeck-us.net
Signed-off-by: Rob Herring <robh@kernel.org>
2024-04-03 14:35:53 -05:00
..
boot nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-13 16:59:46 -05:00
configs treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
include - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
kernel nios2: Only use built-in devicetree blob if configured to do so 2024-04-03 14:35:53 -05:00
lib treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
mm nios2: fix flush_dcache_page() for usage from irq context 2023-08-24 16:20:31 -07:00
platform nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST 2021-10-27 09:29:07 -05:00
Kbuild nios2: move core-y in arch/nios2/Makefile to arch/nios2/Kbuild 2022-09-29 04:40:14 +09:00
Kconfig - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
Kconfig.debug NIOS2: fix kconfig unmet dependency warning for SERIAL_CORE_CONSOLE 2021-09-24 08:49:39 -05:00
Makefile kbuild: remove head-y syntax 2022-10-02 18:06:03 +09:00