Skip to content

Commit

Permalink
Move some I2C PCD definitions to platform DSC and delete unused ones
Browse files Browse the repository at this point in the history
Even though regulator setup is the same on all platforms, other I2C devices are placed on different busses.
  • Loading branch information
mariobalanica committed Aug 2, 2023
1 parent 1ca239f commit 9ec4c35
Show file tree
Hide file tree
Showing 31 changed files with 105 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"Indiedroid"
gRockchipTokenSpaceGuid.PcdProductUrl|"https://indiedroid.us"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
gRockchipTokenSpaceGuid.PcdBoardName|"ROC-RK3588S-PC"
gRockchipTokenSpaceGuid.PcdBoardVendorName|"Firefly"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/FriendlyElec/NanoPC-T6/NanoPC-T6.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"NanoPi 6"
gRockchipTokenSpaceGuid.PcdProductUrl|"https://wiki.friendlyelec.com/wiki/index.php/NanoPC-T6"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/FriendlyElec/NanoPi-R6C/NanoPi-R6C.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"NanoPi"
gRockchipTokenSpaceGuid.PcdProductUrl|"https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R6"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/FriendlyElec/NanoPi-R6S/NanoPi-R6S.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"NanoPi 6"
gRockchipTokenSpaceGuid.PcdProductUrl|"https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R6S"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/Hinlink/H88K/H88K.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"H88K"
gRockchipTokenSpaceGuid.PcdProductUrl|"http://www.hinlink.com/"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/Khadas/Edge2/Edge2.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"Edge"
gRockchipTokenSpaceGuid.PcdProductUrl|"https://www.khadas.com/edge2"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/Mekotronics/R58-Mini/R58-Mini.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
gRockchipTokenSpaceGuid.PcdProductUrl|"https://www.mekotronics.com/h-pd-76.html"
gRockchipTokenSpaceGuid.PcdBoardName|"MINI-PC-RK3588-4D32-V1.0"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/Mekotronics/R58X/R58X.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
gRockchipTokenSpaceGuid.PcdProductUrl|"https://www.mekotronics.com/h-pd-75.html"
gRockchipTokenSpaceGuid.PcdBoardName|"EDGE-RK3588-4D32-V1.2"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/Mixtile/Blade3/Blade3.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"Blade"
gRockchipTokenSpaceGuid.PcdProductUrl|"https://www.mixtile.com/blade-3/"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/OrangePi/OrangePi5/OrangePi5.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"Orange Pi 5"
gRockchipTokenSpaceGuid.PcdProductUrl|"http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-5.html"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"Orange Pi 5"
gRockchipTokenSpaceGuid.PcdProductUrl|"http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-5-plus.html"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/Radxa/ROCK5A/ROCK5A.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"ROCK 5"
gRockchipTokenSpaceGuid.PcdProductUrl|"https://wiki.radxa.com/Rock5/hardware/5a"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@
[Sources.common]
RockchipPlatformLib.c
$(RKPLATLIB_COMMON_DIR)/RK3588CruLib.c

[Sources.AARCH64]

[Pcd]
gRockchipTokenSpaceGuid.PcdI2cBusCount

7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/Radxa/ROCK5B/ROCK5B.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
gRockchipTokenSpaceGuid.PcdFamilyName|"ROCK 5"
gRockchipTokenSpaceGuid.PcdProductUrl|"https://wiki.radxa.com/Rock5/hardware/5b"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ SCMI_CLK_CPUB01, SCMI_CLK_CPUB23 }

#
# CPU Performance default values
#
Expand Down
2 changes: 0 additions & 2 deletions edk2-rockchip/Silicon/Rockchip/Drivers/I2c/I2cDxe/I2cDxe.inf
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@
[Pcd]
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses
gRockchipTokenSpaceGuid.PcdI2cControllersEnabled
gRockchipTokenSpaceGuid.PcdI2cClockFrequency
gRockchipTokenSpaceGuid.PcdI2cBaudRate
gRockchipTokenSpaceGuid.PcdI2cBusCount

[Guids]
gEfiEndOfDxeEventGroupGuid
Expand Down
16 changes: 7 additions & 9 deletions edk2-rockchip/Silicon/Rockchip/RK3588/RK3588Base.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
DEFINE COMBO_PHY_MODE_SATA = 2
DEFINE COMBO_PHY_MODE_USB3 = 3

#
# Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/CpuPerformance.h
#
DEFINE SCMI_CLK_CPUL = 0
DEFINE SCMI_CLK_CPUB01 = 2
DEFINE SCMI_CLK_CPUB23 = 3

#
# Default peripheral support flags
#
Expand Down Expand Up @@ -129,17 +136,8 @@
gRockchipTokenSpaceGuid.PcdMemoryVendorName|"TBD"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdI2cControllersEnabled|{ 0x0 }
gRockchipTokenSpaceGuid.PcdI2cClockFrequency|198000000
gRockchipTokenSpaceGuid.PcdI2cBaudRate|100000
gRockchipTokenSpaceGuid.PcdI2cBusCount|1
gRockchipTokenSpaceGuid.PcdI2cDemoAddresses|{ 0x51 } #/* RTCYM8563TS 0x51@bus2 */
gRockchipTokenSpaceGuid.PcdI2cDemoBuses|{ 0x2 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ 2, 3 } # SCMI_CLK_CPUB01, SCMI_CLK_CPUB23
gRockchipTokenSpaceGuid.PcdRk860xRegulatorMinVoltages|{ UINT32(550000), UINT32(550000) }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorMaxVoltages|{ UINT32(1050000), UINT32(1050000) }

Expand Down
2 changes: 0 additions & 2 deletions edk2-rockchip/Silicon/Rockchip/RockchipPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@

gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x0 }|VOID*|0x02000001
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0 }|VOID*|0x02000002
gRockchipTokenSpaceGuid.PcdI2cControllersEnabled|{ 0x0 }|VOID*|0x02000003
gRockchipTokenSpaceGuid.PcdI2cClockFrequency|0|UINT32|0x02000004
gRockchipTokenSpaceGuid.PcdI2cBaudRate|0|UINT32|0x02000005
gRockchipTokenSpaceGuid.PcdI2cBusCount|0|UINT32|0x02000006
gRockchipTokenSpaceGuid.PcdI2cDemoAddresses|{ 0x0 }|VOID*|0x02000007
gRockchipTokenSpaceGuid.PcdI2cDemoBuses|{ 0x0 }|VOID*|0x02000008
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x0 }|VOID*|0x02000009
Expand Down

0 comments on commit 9ec4c35

Please sign in to comment.