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

Platform/RK3588: Enable and add I2S0 or I2S1 and codec depending on board. #114

Merged
merged 12 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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 @@ -12,6 +12,7 @@
**/

#include "AcpiTables.h"
#include "../onboard.h"

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Expand All @@ -28,8 +29,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 (\_SB_.I2C7) {
coolstar marked this conversation as resolved.
Show resolved Hide resolved
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, FALSE, TRUE }
coolstar marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -13,6 +13,7 @@
#include <Library/Rk3588Pcie.h>
#include <Library/PWMLib.h>
#include <Soc.h>
#include "../../onboard.h"

static struct regulator_init_data rk806_init_data[] = {
/* Master PMIC */
Expand Down Expand Up @@ -292,4 +293,5 @@ PlatformEarlyInit (
)
{
// Configure various things specific to this platform
GpioPinSetFunction(4, BOARD_CODEC_GPIO_PIN, 0); //jdet
}
8 changes: 8 additions & 0 deletions edk2-rockchip/Platform/Ameridroid/IndiedroidNova/onboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define BOARD_ENABLE_I2S0
coolstar marked this conversation as resolved.
Show resolved Hide resolved
#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
mariobalanica marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
**/

#include "AcpiTables.h"
#include "../onboard.h"

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Expand All @@ -28,8 +29,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 (\_SB_.I2C3) {
include ("Es8388.asl")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <Library/PWMLib.h>
#include <Soc.h>
#include <Library/UefiBootServicesTableLib.h>
#include "../../onboard.h"

static struct regulator_init_data rk806_init_data[] = {
/* Master PMIC */
Expand Down Expand Up @@ -364,5 +365,5 @@ PlatformEarlyInit (
VOID
)
{

GpioPinSetFunction(1, BOARD_CODEC_GPIO_PIN, 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
8 changes: 8 additions & 0 deletions edk2-rockchip/Platform/Firefly/ROC-RK3588S-PC/onboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define BOARD_ENABLE_I2S0
#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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

#include "AcpiTables.h"

#define BOARD_ENABLE_I2S0
#define BOARD_I2S0_TPLG "i2s-jack"

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Scope (\_SB_)
Expand All @@ -28,6 +31,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
7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
**/

#include "AcpiTables.h"
#include "../onboard.h"

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Expand All @@ -28,9 +29,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 (\_SB_.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 @@ -13,6 +13,7 @@
#include <Library/Rk3588Pcie.h>
#include <Soc.h>
#include <Library/TimerLib.h>
#include "../../onboard.h"

static struct regulator_init_data rk806_init_data[] = {
/* Master PMIC */
Expand Down Expand Up @@ -382,4 +383,5 @@ PlatformEarlyInit (
)
{
// Configure various things specific to this platform
GpioPinSetFunction(1, BOARD_CODEC_GPIO_PIN, 0); //jdet
}
8 changes: 8 additions & 0 deletions edk2-rockchip/Platform/Hinlink/H88K/onboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define BOARD_ENABLE_I2S0
#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
7 changes: 7 additions & 0 deletions edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
**/

#include "AcpiTables.h"
#include "../onboard.h"

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Expand All @@ -28,8 +29,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 (\_SB_.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 @@ -17,6 +17,7 @@
#include <Library/RK806.h>
#include <Library/Rk3588Pcie.h>
#include <Soc.h>
#include "../../onboard.h"

#include <Protocol/KhadasMcu.h>

Expand Down Expand Up @@ -378,4 +379,6 @@ PlatformEarlyInit (
)
{
// Configure various things specific to this platform
GpioPinSetFunction(1, BOARD_CODEC_GPIO_PIN, 0); //jdet
GpioPinSetFunction(1, GPIO_PIN_PD0, 0); //spk_con
}
8 changes: 8 additions & 0 deletions edk2-rockchip/Platform/Khadas/Edge2/onboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define BOARD_ENABLE_I2S1
#define BOARD_I2S1_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
9 changes: 8 additions & 1 deletion edk2-rockchip/Platform/Mekotronics/R58X/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
**/

#include "AcpiTables.h"
#include "../onboard.h"

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Expand All @@ -24,14 +25,20 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
include ("Dma.asl")
include ("Gmac0.asl")
include ("Gmac1.asl")
// include ("Gpio.asl")
include ("Gpio.asl")
include ("I2c.asl")
include ("Uart.asl")
// include ("Spi.asl")

include ("I2s.asl")

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

Scope (\_SB_.I2C3) {
include ("Es8388.asl")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <Library/RK806.h>
#include <Library/Rk3588Pcie.h>
#include <Soc.h>
#include "../../onboard.h"

static struct regulator_init_data rk806_init_data[] = {
/* Master PMIC */
Expand Down Expand Up @@ -380,5 +381,5 @@ PlatformEarlyInit (
VOID
)
{

GpioPinSetFunction(3, BOARD_CODEC_GPIO_PIN, 0); //jdet
}
13 changes: 9 additions & 4 deletions edk2-rockchip/Platform/Mekotronics/R58X/R58X.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
gRockchipTokenSpaceGuid.PcdDeviceTreeName|"rk3588-blueberry-edge-v12-linux"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x6 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBusesRuntimeSupport|{ FALSE, FALSE, TRUE }
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51, 0x10 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x6, 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 @@ -106,7 +106,12 @@
gRK3588TokenSpaceGuid.PcdGmac0Supported|TRUE
gRK3588TokenSpaceGuid.PcdGmac1Supported|TRUE
gRK3588TokenSpaceGuid.PcdGmac0TxDelay|0x44
gRK3588TokenSpaceGuid.PcdGmac1TxDelay|0x42
gRK3588TokenSpaceGuid.PcdGmac1TxDelay|0x42

#
# I2S
#
gRK3588TokenSpaceGuid.PcdI2S0Supported|TRUE

################################################################################
#
Expand Down
Loading