Skip to content

Commit

Permalink
Platform/RK3588: Enable I2S and codec depending on board (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
coolstar authored Jan 12, 2024
1 parent 72385b1 commit e452f9d
Show file tree
Hide file tree
Showing 51 changed files with 390 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
Silicon/Rockchip/RockchipPkg.dec
Silicon/Rockchip/RK3588/RK3588.dec

[FixedPcd]
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
Expand All @@ -59,3 +60,5 @@
gArmTokenSpaceGuid.PcdGicDistributorBase
gArmTokenSpaceGuid.PcdGicRedistributorsBase
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gRK3588TokenSpaceGuid.PcdI2S0Supported
gRK3588TokenSpaceGuid.PcdI2S1Supported
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

#include "AcpiTables.h"

#define BOARD_I2S0_TPLG "i2s-jack"

#define BOARD_AUDIO_CODEC_HID "ESSX8388"
#define BOARD_CODEC_I2C "\\_SB.I2C7"
#define BOARD_CODEC_I2C_ADDR 0x11
#define BOARD_CODEC_GPIO "\\_SB.GPI4"
#define BOARD_CODEC_GPIO_PIN GPIO_PIN_PA7

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Scope (\_SB_)
Expand All @@ -28,8 +36,14 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
include ("Uart.asl")
// include ("Spi.asl")

include ("I2s.asl")

include ("Usb1Host.asl")
include ("Usb3Host0.asl")
include ("Usb3Host2.asl")

Scope (I2C7) {
include ("Es8388.asl")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
gRockchipTokenSpaceGuid.PcdDeviceTreeName|"rk3588s-9tripod-linux"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x6 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBusesRuntimeSupport|{ FALSE, FALSE, TRUE }
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51, 0x11 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x6, 0x7 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBusesRuntimeSupport|{ FALSE, FALSE, TRUE, FALSE }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ $(SCMI_CLK_CPUB01), $(SCMI_CLK_CPUB23) }
Expand All @@ -93,6 +93,11 @@
gRK3588TokenSpaceGuid.PcdUsbDpPhy0Supported|TRUE
gRK3588TokenSpaceGuid.PcdDp0LaneMux|{ 0x2, 0x3 }

#
# I2S
#
gRK3588TokenSpaceGuid.PcdI2S0Supported|TRUE

#
# On-Board fan output
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,5 @@ PlatformEarlyInit (
)
{
// Configure various things specific to this platform
GpioPinSetFunction(4, GPIO_PIN_PA7, 0); //jdet
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
Silicon/Rockchip/RockchipPkg.dec
Silicon/Rockchip/RK3588/RK3588.dec

[FixedPcd]
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
Expand All @@ -59,3 +60,5 @@
gArmTokenSpaceGuid.PcdGicDistributorBase
gArmTokenSpaceGuid.PcdGicRedistributorsBase
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gRK3588TokenSpaceGuid.PcdI2S0Supported
gRK3588TokenSpaceGuid.PcdI2S1Supported
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
Silicon/Rockchip/RockchipPkg.dec
Silicon/Rockchip/RK3588/RK3588.dec

[FixedPcd]
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
Expand All @@ -59,3 +60,5 @@
gArmTokenSpaceGuid.PcdGicDistributorBase
gArmTokenSpaceGuid.PcdGicRedistributorsBase
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gRK3588TokenSpaceGuid.PcdI2S0Supported
gRK3588TokenSpaceGuid.PcdI2S1Supported
14 changes: 14 additions & 0 deletions edk2-rockchip/Platform/Firefly/ROC-RK3588S-PC/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

#include "AcpiTables.h"

#define BOARD_I2S0_TPLG "i2s-jack"

#define BOARD_AUDIO_CODEC_HID "ESSX8388"
#define BOARD_CODEC_I2C "\\_SB.I2C3"
#define BOARD_CODEC_I2C_ADDR 0x11
#define BOARD_CODEC_GPIO "\\_SB.GPI1"
#define BOARD_CODEC_GPIO_PIN GPIO_PIN_PA6

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Scope (\_SB_)
Expand All @@ -28,8 +36,14 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
include ("Uart.asl")
// include ("Spi.asl")

include ("I2s.asl")

include ("Usb1Host.asl")
include ("Usb3Host0.asl")
include ("Usb3Host2.asl")

Scope (I2C3) {
include ("Es8388.asl")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -364,5 +364,5 @@ PlatformEarlyInit (
VOID
)
{

GpioPinSetFunction(1, GPIO_PIN_PA6, 0); //jdet
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
gRockchipTokenSpaceGuid.PcdBoardVendorName|"Firefly"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x2 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBusesRuntimeSupport|{ FALSE, FALSE, TRUE }
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51, 0x11 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x2, 0x3 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBusesRuntimeSupport|{ FALSE, FALSE, TRUE, FALSE }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ $(SCMI_CLK_CPUB01), $(SCMI_CLK_CPUB23) }
Expand Down Expand Up @@ -89,6 +89,11 @@
#
gRK3588TokenSpaceGuid.PcdHasOnBoardFanOutput|TRUE

#
# I2S
#
gRK3588TokenSpaceGuid.PcdI2S0Supported|TRUE

################################################################################
#
# Components Section - list of all EDK II Modules needed by this Platform.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
Silicon/Rockchip/RockchipPkg.dec
Silicon/Rockchip/RK3588/RK3588.dec

[FixedPcd]
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
Expand All @@ -59,3 +60,5 @@
gArmTokenSpaceGuid.PcdGicDistributorBase
gArmTokenSpaceGuid.PcdGicRedistributorsBase
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gRK3588TokenSpaceGuid.PcdI2S0Supported
gRK3588TokenSpaceGuid.PcdI2S1Supported
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#include "AcpiTables.h"

#define BOARD_I2S0_TPLG "i2s-jack"

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Scope (\_SB_)
Expand All @@ -28,6 +30,8 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
include ("Uart.asl")
// include ("Spi.asl")

include ("I2s.asl")

include ("Usb1Host.asl")
include ("Usb3Host0.asl")
include ("Usb3Host1.asl")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,5 @@ PlatformEarlyInit (
)
{
// Configure various things specific to this platform
GpioPinSetFunction(1, GPIO_PIN_PC4, 0); //jdet
}
5 changes: 5 additions & 0 deletions edk2-rockchip/Platform/FriendlyElec/NanoPC-T6/NanoPC-T6.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@
gRK3588TokenSpaceGuid.PcdDp0LaneMux|{ 0x2, 0x3 }
gRK3588TokenSpaceGuid.PcdDp1LaneMux|{ 0x0 }

#
# I2S
#
gRK3588TokenSpaceGuid.PcdI2S0Supported|TRUE

################################################################################
#
# Components Section - list of all EDK II Modules needed by this Platform.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@
gArmTokenSpaceGuid.PcdGicDistributorBase
gArmTokenSpaceGuid.PcdGicRedistributorsBase
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gRK3588TokenSpaceGuid.PcdI2S0Supported
gRK3588TokenSpaceGuid.PcdI2S1Supported
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
Silicon/Rockchip/RockchipPkg.dec
Silicon/Rockchip/RK3588/RK3588.dec

[FixedPcd]
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
Expand All @@ -59,3 +60,5 @@
gArmTokenSpaceGuid.PcdGicDistributorBase
gArmTokenSpaceGuid.PcdGicRedistributorsBase
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gRK3588TokenSpaceGuid.PcdI2S0Supported
gRK3588TokenSpaceGuid.PcdI2S1Supported
3 changes: 3 additions & 0 deletions edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/AcpiTables.inf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
Silicon/Rockchip/RockchipPkg.dec
Silicon/Rockchip/RK3588/RK3588.dec

[FixedPcd]
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
Expand All @@ -59,3 +60,5 @@
gArmTokenSpaceGuid.PcdGicDistributorBase
gArmTokenSpaceGuid.PcdGicRedistributorsBase
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gRK3588TokenSpaceGuid.PcdI2S0Supported
gRK3588TokenSpaceGuid.PcdI2S1Supported
14 changes: 14 additions & 0 deletions edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

#include "AcpiTables.h"

#define BOARD_I2S0_TPLG "i2s-jack"

#define BOARD_AUDIO_CODEC_HID "ESSX8388"
#define BOARD_CODEC_I2C "\\_SB.I2C7"
#define BOARD_CODEC_I2C_ADDR 0x11
#define BOARD_CODEC_GPIO "\\_SB.GPI1"
#define BOARD_CODEC_GPIO_PIN GPIO_PIN_PD5

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Scope (\_SB_)
Expand All @@ -28,9 +36,15 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
include ("Uart.asl")
// include ("Spi.asl")

include ("I2s.asl")

include ("Usb1Host.asl")
include ("Usb3Host0.asl")
include ("Usb3Host1.asl")
include ("Usb3Host2.asl")

Scope (I2C7) {
include ("Es8388.asl")
}
}
}
11 changes: 8 additions & 3 deletions edk2-rockchip/Platform/Hinlink/H88K/H88K.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
gRockchipTokenSpaceGuid.PcdDeviceTreeName|"rk3588-hinlink-h88k"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x2 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBusesRuntimeSupport|{ FALSE, FALSE, TRUE }
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51, 0x11 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x2, 0x7 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBusesRuntimeSupport|{ FALSE, FALSE, TRUE, FALSE }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ $(SCMI_CLK_CPUB01), $(SCMI_CLK_CPUB23) }
Expand Down Expand Up @@ -103,6 +103,11 @@
gRK3588TokenSpaceGuid.PcdGmac0Supported|TRUE
gRK3588TokenSpaceGuid.PcdGmac0TxDelay|0x44

#
# I2S
#
gRK3588TokenSpaceGuid.PcdI2S0Supported|TRUE

################################################################################
#
# Components Section - list of all EDK II Modules needed by this Platform.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,5 @@ PlatformEarlyInit (
)
{
// Configure various things specific to this platform
GpioPinSetFunction(1, GPIO_PIN_PD5, 0); //jdet
}
3 changes: 3 additions & 0 deletions edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/AcpiTables.inf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
Silicon/Rockchip/RockchipPkg.dec
Silicon/Rockchip/RK3588/RK3588.dec

[FixedPcd]
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
Expand All @@ -59,3 +60,5 @@
gArmTokenSpaceGuid.PcdGicDistributorBase
gArmTokenSpaceGuid.PcdGicRedistributorsBase
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gRK3588TokenSpaceGuid.PcdI2S0Supported
gRK3588TokenSpaceGuid.PcdI2S1Supported
14 changes: 14 additions & 0 deletions edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

#include "AcpiTables.h"

#define BOARD_I2S0_TPLG "i2s-jack"

#define BOARD_AUDIO_CODEC_HID "ESSX8316"
#define BOARD_CODEC_I2C "\\_SB.I2C3"
#define BOARD_CODEC_I2C_ADDR 0x10
#define BOARD_CODEC_GPIO "\\_SB.GPI1"
#define BOARD_CODEC_GPIO_PIN GPIO_PIN_PD3

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Scope (\_SB_)
Expand All @@ -28,8 +36,14 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
include ("Uart.asl")
// include ("Spi.asl")

include ("I2s.asl")

include ("Usb1Host.asl")
include ("Usb3Host0.asl")
include ("Usb3Host2.asl")

Scope (I2C3) {
include ("Es8388.asl")
}
}
}
11 changes: 8 additions & 3 deletions edk2-rockchip/Platform/Khadas/Edge2/Edge2.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
gRockchipTokenSpaceGuid.PcdDeviceTreeName|"rk3588s-khadas-edge2"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51, 0x18 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x2, 0x2 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBusesRuntimeSupport|{ FALSE, FALSE, TRUE, FALSE }
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51, 0x18, 0x10 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x2, 0x2, 0x3 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBusesRuntimeSupport|{ FALSE, FALSE, TRUE, FALSE, FALSE }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ $(SCMI_CLK_CPUB01), $(SCMI_CLK_CPUB23) }
Expand Down Expand Up @@ -94,6 +94,11 @@
gRK3588TokenSpaceGuid.PcdUsbDpPhy0Supported|TRUE
gRK3588TokenSpaceGuid.PcdDp0LaneMux|{ 0x2, 0x3 }

#
# I2S
#
gRK3588TokenSpaceGuid.PcdI2S0Supported|TRUE

#
# On-Board fan output
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,6 @@ PlatformEarlyInit (
)
{
// Configure various things specific to this platform
GpioPinSetFunction(1, GPIO_PIN_PD3, 0); //jdet
GpioPinSetFunction(1, GPIO_PIN_PD0, 0); //spk_con
}
Loading

0 comments on commit e452f9d

Please sign in to comment.