diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2022-10-13 01:06:22 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-10-13 23:56:57 +0000 |
commit | 30b3660956936301b750a1c065f0d97ddce14a2b (patch) | |
tree | d7c5bc97092bc8b857e26c34d81ec002b7b8e4d2 /src/mainboard | |
parent | 39f2aa09042d9690f6b474198d23f217413954c4 (diff) |
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 <felix-coreboot@felixheld.de>
Change-Id: Iddd317b27a838849fa40c0fb77d942609104cf04
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68312
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard')
-rw-r--r-- | src/mainboard/amd/padmelon/Kconfig | 5 | ||||
-rw-r--r-- | src/mainboard/amd/padmelon/devicetree.cb | 10 | ||||
-rw-r--r-- | src/mainboard/amd/padmelon/override-merlinfalcon.cb | 10 | ||||
-rw-r--r-- | src/mainboard/amd/padmelon/override-prairiefalcon.cb | 10 |
4 files changed, 25 insertions, 10 deletions
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 |