From 30b3660956936301b750a1c065f0d97ddce14a2b Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 13 Oct 2022 01:06:22 +0200 Subject: mb/amd/padmelon: use override devicetrees for the different APUs Since the devicetree files are passed to util/sconfig without being processed by the C preprocessor, using #if in the devicetree won't give the behavior that might be expected. Instead sconfig treats the #if as a comment, but still processes all other lines. To get the intended behavior, replace the C preprocessor usage in the devicetree by moving the APU-specific parts to override devicetrees that get selected according to the selected APU type. Signed-off-by: Felix Held Change-Id: Iddd317b27a838849fa40c0fb77d942609104cf04 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68312 Reviewed-by: Matt DeVillier Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- src/mainboard/amd/padmelon/Kconfig | 5 +++++ src/mainboard/amd/padmelon/devicetree.cb | 10 ---------- src/mainboard/amd/padmelon/override-merlinfalcon.cb | 10 ++++++++++ src/mainboard/amd/padmelon/override-prairiefalcon.cb | 10 ++++++++++ 4 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 src/mainboard/amd/padmelon/override-merlinfalcon.cb create mode 100644 src/mainboard/amd/padmelon/override-prairiefalcon.cb (limited to 'src/mainboard') diff --git a/src/mainboard/amd/padmelon/Kconfig b/src/mainboard/amd/padmelon/Kconfig index 3c6449753b..08bc797e2c 100644 --- a/src/mainboard/amd/padmelon/Kconfig +++ b/src/mainboard/amd/padmelon/Kconfig @@ -38,6 +38,11 @@ config PADMELON_PRAIRIE_FALCON endchoice + +config OVERRIDE_DEVICETREE + default "override-merlinfalcon.cb" if PADMELON_MERLIN_FALCON + default "override-prairiefalcon.cb" if PADMELON_PRAIRIE_FALCON + config MAX_CPUS int default 4 diff --git a/src/mainboard/amd/padmelon/devicetree.cb b/src/mainboard/amd/padmelon/devicetree.cb index 87d2b1ae04..a80539029e 100644 --- a/src/mainboard/amd/padmelon/devicetree.cb +++ b/src/mainboard/amd/padmelon/devicetree.cb @@ -1,16 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only chip soc/amd/stoneyridge - - register "spd_addr_lookup" = " - { -#if CONFIG(AMD_APU_MERLINFALCON) - { {0xA0, 0x00}, {0xA4, 0x00} }, // socket 0 - Channel 0 & 1, slot 0 -#else - { {0xA0, 0x00} }, // socket 0 - Channel 0, slot 0 -#endif - }" - register "uma_mode" = "UMAMODE_AUTO_LEGACY" device cpu_cluster 0 on diff --git a/src/mainboard/amd/padmelon/override-merlinfalcon.cb b/src/mainboard/amd/padmelon/override-merlinfalcon.cb new file mode 100644 index 0000000000..160b458857 --- /dev/null +++ b/src/mainboard/amd/padmelon/override-merlinfalcon.cb @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0-only + +chip soc/amd/stoneyridge + register "spd_addr_lookup" = " + { + { {0xA0, 0x00}, {0xA4, 0x00} }, // socket 0 - Channel 0 & 1, slot 0 + }" + + device domain 0 on end +end diff --git a/src/mainboard/amd/padmelon/override-prairiefalcon.cb b/src/mainboard/amd/padmelon/override-prairiefalcon.cb new file mode 100644 index 0000000000..e1ee1214df --- /dev/null +++ b/src/mainboard/amd/padmelon/override-prairiefalcon.cb @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0-only + +chip soc/amd/stoneyridge + register "spd_addr_lookup" = " + { + { {0xA0, 0x00} }, // socket 0 - Channel 0, slot 0 + }" + + device domain 0 on end +end -- cgit v1.2.3