Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ampere I2C changes (expand set of buses listed in Ac01.h and bump SSIF speed to 400 kHz) #218

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
#include <Uefi.h>

#include <Library/BaseLib.h>
#include <Library/PcdLib.h>
#include <Library/RealTimeClockLib.h>

//
// I2C bus address that RTC connected to
//
#define I2C_RTC_BUS_ADDRESS 1
#define I2C_RTC_BUS_ADDRESS (FixedPcdGet8 (PcdRtcBusNumber))

//
// I2C RTC bus speed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
GpioLib
DxeServicesTableLib
I2cLib
PcdLib
TimeBaseLib
TimerLib
UefiLib
Expand All @@ -44,3 +45,6 @@

[Guids]
gEfiEventVirtualAddressChangeGuid

[Pcd]
gAmpereTokenSpaceGuid.PcdRtcBusNumber
21 changes: 19 additions & 2 deletions Silicon/Ampere/AmpereAltraPkg/Include/Platform/Ac01.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
#
gAmpereTokenSpaceGuid.PcdPlatformConfigUuid|"C416535D-970B-41B9-859A-3CAF0FAF198C"|VOID*|0x00000010

#
# RTC
#
gAmpereTokenSpaceGuid.PcdRtcBusNumber|0x4|UINT8|0x00000011

#
# SMpro PMpro Pcds
#
Expand All @@ -78,8 +83,8 @@
#
# I2C PCDs for SMBUS
#
gAmpereTokenSpaceGuid.PcdSmbusI2cBusNumber|0x00|UINT8|0x00000007
gAmpereTokenSpaceGuid.PcdSmbusI2cBusSpeed|100000|UINT32|0x00000008 # Hz
gAmpereTokenSpaceGuid.PcdSmbusI2cBusNumber|0x02|UINT8|0x00000007
gAmpereTokenSpaceGuid.PcdSmbusI2cBusSpeed|400000|UINT32|0x00000008 # Hz

#
# GPIO pin to support BMC ready check
Expand Down
Loading