diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2022-12-08 19:14:43 +0100 |
---|---|---|
committer | Eric Lai <eric_lai@quanta.corp-partner.google.com> | 2022-12-12 01:26:03 +0000 |
commit | bd9ab06808e956135a961566d0644c404b1ab751 (patch) | |
tree | b4dff589f3ab726275079f5668d21fe3a9111f01 /src/vendorcode/amd | |
parent | 4f30539b476852b5f0da3174b84bf180e76e3ec7 (diff) |
vc/amd/fsp/morgana/FspmUpd: don't use pointers for usb_phy config
The size of a pointer changes between a 32 and 64 bit coreboot build. In
order to be able to use a 32 bit FSP in a 64 bit coreboot build, change
the pointer in the UPDs to a uint32_t to always have a 32 bit field in
the UPD for this. Also make sure that the address of the lcl_usb_phy
struct is located below the 4GB boundary, so that the truncation to 32
bits won't result in pointing to a different memory location than
intended. In this error case, which I don't expect to happen, print an
error and write 0 to mcfg->usb_phy_ptr so that the FSP will use its
default values.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I1394aa6ef5f401e0c7bdd4861f1e28ae46e56e4f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70505
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/vendorcode/amd')
-rw-r--r-- | src/vendorcode/amd/fsp/morgana/FspmUpd.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vendorcode/amd/fsp/morgana/FspmUpd.h b/src/vendorcode/amd/fsp/morgana/FspmUpd.h index 4a6d243da8..11d0db608f 100644 --- a/src/vendorcode/amd/fsp/morgana/FspmUpd.h +++ b/src/vendorcode/amd/fsp/morgana/FspmUpd.h @@ -96,7 +96,8 @@ typedef struct __packed { /** Offset 0x04CF**/ uint32_t telemetry_vddcrsocfull_scale_current; /** Offset 0x04D3**/ uint32_t telemetry_vddcrsocOffset; /** Offset 0x04D7**/ uint8_t UnusedUpdSpace1; - /** Offset 0x04D8**/ struct usb_phy_config *usb_phy; + /* usb_phy_ptr is actually struct usb_phy_config *, but that won't work for 64bit coreboot */ + /** Offset 0x04D8**/ uint32_t usb_phy_ptr; /** Offset 0x04DC**/ uint8_t UnusedUpdSpace2[292]; /** Offset 0x0600**/ uint16_t UpdTerminator; } FSP_M_CONFIG; |