diff options
author | Aaron Durbin <adurbin@chromium.org> | 2020-07-01 00:01:33 -0600 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2020-07-02 15:55:46 +0000 |
commit | c5bb02f2ecb96a2a4cabba139c8ca1e15af2621a (patch) | |
tree | 1a8daa96a532f24626db1a9b02692fb4696adc77 /src/soc/amd | |
parent | 57285820a3a31dfd8cd80861e0f772a74d98c9ec (diff) | |
download | coreboot-c5bb02f2ecb96a2a4cabba139c8ca1e15af2621a.tar.xz |
soc/amd/common: fix SPI bar resource usage
The ACPI code was not masking off the correct bits for publishing
the SPI bar to the OS.
It resulted in a dmesg messagelike:
system 00:00: [mem 0xfec10002-0xfec11001] has been reserved
And /proc/iomem entry
fec10002-fec11001 : pnp 00:00
These addresses are wrong because they are including bits of a
register that are not a part of the address.
Moreover, the code does not publish the eSPI register area either.
The eSPI registers live at 0x10000 added to the SPI bar. Lastly,
both regions are less than a page so only report a page of usage
for each.
Stoney Ridge's SPI bar register defines the address as 31:6 while
Picasso's SPI bar register defines the address as 31:8. Use Picasso's
valid mask for both cases because no one is assigning addresses
that are aligned to less than 256 bytes.
With the fixes, dmesg reports:
system 00:00: [mem 0xfec10000-0xfec10fff] has been reserved
system 00:00: [mem 0xfec20000-0xfec20fff] has been reserved
And /proc/iomem indicates:
fec10000-fec10fff : pnp 00:00
fec20000-fec20fff : pnp 00:00
BUG=b:160290629
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Change-Id: I130b5ad26d9e13b44c25fbb35a05389f9e8841ab
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42959
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd')
-rw-r--r-- | src/soc/amd/common/acpi/lpc.asl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/soc/amd/common/acpi/lpc.asl b/src/soc/amd/common/acpi/lpc.asl index 5f290c4a84..e4b0689bd2 100644 --- a/src/soc/amd/common/acpi/lpc.asl +++ b/src/soc/amd/common/acpi/lpc.asl @@ -26,17 +26,25 @@ Device(LPCB) { { Memory32Fixed(ReadWrite, // Setup for fixed resource location for SPI base address 0x00000000, // Address Base - 0x00000000, // Address Length + 0x00001000, // Address Length BAR0 // Descriptor Name ) + + Memory32Fixed(ReadWrite, // Setup for fixed resource location for eSPI base address + 0x00000000, // Address Base + 0x00001000, // Address Length + BAR1 // Descriptor Name + ) }) Method(_CRS,0,Serialized) { CreateDwordField(^CRS,^BAR0._BAS,SPIB) // Field to hold SPI base address - CreateDwordField(^CRS,^BAR0._LEN,SPIL) // Field to hold SPI address length - Store(BAR,SPIB) // SPI base address mapped - Store(0x1000,SPIL) // 4k space mapped + CreateDwordField(^CRS,^BAR1._BAS,ESPB) // Field to hold eSPI base address + And(BAR, 0xffffff00, Local0) + Store(Local0, SPIB) // SPI base address mapped + Add(Local0, 0x10000, Local1) + Store(Local1, ESPB) // eSPI base address mapped Return(CRS) } } |