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>
This commit is contained in:
Felix Held 2022-10-13 01:06:22 +02:00
parent 39f2aa0904
commit 30b3660956
4 changed files with 25 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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