From 2b3fa979471655fa0b834b457fe27ea8310aeea1 Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Mon, 30 Sep 2024 07:04:37 -0600 Subject: [PATCH 1/2] Ampere: Add full set of I2C buses to Ac01.h Boards based on the Altra SoC from vendors such as ADLINK are configured differently and require access to I2C buses not listed in Ac01.h. Fix this by expanding AC01_I2C_BASE_ADDRESS_LIST to contain the full set of buses available. Since this changes the indexing of the buses, update the Mt Jade files to match. Add a new PCD to contain the bus number of the RTC since this is different between Mt Jade and ADLINK's COM-HPC-ALT platform. Signed-off-by: Rebecca Cran --- .../Type09/PlatformSystemSlotFunction.c | 6 +++--- .../PCF85063RealTimeClockLib/PCF85063.h | 3 ++- .../PCF85063RealTimeClockLib.inf | 4 ++++ .../AmpereAltraPkg/Include/Platform/Ac01.h | 21 +++++++++++++++++-- .../AmpereSiliconPkg/AmpereSiliconPkg.dec | 7 ++++++- 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Platform/Ampere/JadePkg/Drivers/SmbiosPlatformDxe/Type09/PlatformSystemSlotFunction.c b/Platform/Ampere/JadePkg/Drivers/SmbiosPlatformDxe/Type09/PlatformSystemSlotFunction.c index 142d7387bf..24f88c0179 100644 --- a/Platform/Ampere/JadePkg/Drivers/SmbiosPlatformDxe/Type09/PlatformSystemSlotFunction.c +++ b/Platform/Ampere/JadePkg/Drivers/SmbiosPlatformDxe/Type09/PlatformSystemSlotFunction.c @@ -38,9 +38,9 @@ // // CPU I2C Bus for IO Expander // -#define S0_RISER_I2C_BUS 0x02 -#define S0_OCP_I2C_BUS 0x02 -#define S1_RISER_I2C_BUS 0x03 +#define S0_RISER_I2C_BUS 0x06 +#define S0_OCP_I2C_BUS 0x06 +#define S1_RISER_I2C_BUS 0x0F // // I2C address of IO Expander devices diff --git a/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063.h b/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063.h index 6c27247c8e..d3b7bdf8f1 100644 --- a/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063.h +++ b/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063.h @@ -12,12 +12,13 @@ #include #include +#include #include // // I2C bus address that RTC connected to // -#define I2C_RTC_BUS_ADDRESS 1 +#define I2C_RTC_BUS_ADDRESS (FixedPcdGet8 (PcdRtcBusNumber)) // // I2C RTC bus speed diff --git a/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.inf b/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.inf index 6ba0049bbd..4a6abb23b7 100644 --- a/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.inf +++ b/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063RealTimeClockLib.inf @@ -35,6 +35,7 @@ GpioLib DxeServicesTableLib I2cLib + PcdLib TimeBaseLib TimerLib UefiLib @@ -44,3 +45,6 @@ [Guids] gEfiEventVirtualAddressChangeGuid + +[Pcd] + gAmpereTokenSpaceGuid.PcdRtcBusNumber diff --git a/Silicon/Ampere/AmpereAltraPkg/Include/Platform/Ac01.h b/Silicon/Ampere/AmpereAltraPkg/Include/Platform/Ac01.h index a115619dfc..633f2ad978 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Include/Platform/Ac01.h +++ b/Silicon/Ampere/AmpereAltraPkg/Include/Platform/Ac01.h @@ -65,12 +65,29 @@ // // The maximum number of I2C bus // -#define AC01_I2C_MAX_BUS_NUM 4 +#define AC01_I2C_MAX_BUS_NUM 18 // // The base address of DW I2C // -#define AC01_I2C_BASE_ADDRESS_LIST 0x1000026B0000ULL, 0x100002750000ULL, 0x100002770000ULL, 0x500002770000ULL +#define AC01_I2C_BASE_ADDRESS_LIST 0x100002690000, /* Socket 0 IIC 2 */ \ + 0x1000026A0000, /* IIC 3 */ \ + 0x1000026B0000, /* IIC 4 */ \ + 0x1000026C0000, /* IIC 5 */ \ + 0x100002750000, /* IIC 6 */ \ + 0x100002760000, /* IIC 7 */ \ + 0x100002770000, /* IIC 8 */ \ + 0x100002780000, /* IIC 9 */ \ + 0x100002790000, /* IIC 10 */ \ + 0x500002690000, /* Socket 1 IIC 2 */ \ + 0x5000026A0000, /* IIC 3 */ \ + 0x5000026B0000, /* IIC 4 */ \ + 0x5000026C0000, /* IIC 5 */ \ + 0x500002750000, /* IIC 6 */ \ + 0x500002760000, /* IIC 7 */ \ + 0x500002770000, /* IIC 8 */ \ + 0x500002780000, /* IIC 9 */ \ + 0x500002790000 /* IIC 10 */ // // The Array of Soc Gpio Base Address diff --git a/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec b/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec index 6f312eb32a..831659db96 100644 --- a/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec +++ b/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec @@ -61,6 +61,11 @@ # gAmpereTokenSpaceGuid.PcdPlatformConfigUuid|"C416535D-970B-41B9-859A-3CAF0FAF198C"|VOID*|0x00000010 + # + # RTC + # + gAmpereTokenSpaceGuid.PcdRtcBusNumber|0x4|UINT8|0x00000011 + # # SMpro PMpro Pcds # @@ -78,7 +83,7 @@ # # I2C PCDs for SMBUS # - gAmpereTokenSpaceGuid.PcdSmbusI2cBusNumber|0x00|UINT8|0x00000007 + gAmpereTokenSpaceGuid.PcdSmbusI2cBusNumber|0x02|UINT8|0x00000007 gAmpereTokenSpaceGuid.PcdSmbusI2cBusSpeed|100000|UINT32|0x00000008 # Hz # From 97ffe020398981255e30ca09ed96dcfd946b58ed Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Mon, 30 Sep 2024 07:05:07 -0600 Subject: [PATCH 2/2] Silicon/Ampere: Bump IPMI SSIF speed from 100 to 400 kHz Bump the I2C bus speed used for the IPMI SSIF link to the BMC from 100 to 400 kHz to match the requirement listed in Platform/Ampere/JadePkg/PlatformPortingGuide.md. Signed-off-by: Rebecca Cran --- Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec b/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec index 831659db96..92d37bc727 100644 --- a/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec +++ b/Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec @@ -84,7 +84,7 @@ # I2C PCDs for SMBUS # gAmpereTokenSpaceGuid.PcdSmbusI2cBusNumber|0x02|UINT8|0x00000007 - gAmpereTokenSpaceGuid.PcdSmbusI2cBusSpeed|100000|UINT32|0x00000008 # Hz + gAmpereTokenSpaceGuid.PcdSmbusI2cBusSpeed|400000|UINT32|0x00000008 # Hz # # GPIO pin to support BMC ready check