diff --git a/README.md b/README.md
index 7a555d46..31b9752b 100644
--- a/README.md
+++ b/README.md
@@ -148,6 +148,7 @@ The paths above are relative to the root of the file system. That is, the `dtb`
| `rk3588s-orangepi-5` | Orange Pi 5 |
| `rk3588-orangepi-5-plus` | Orange Pi 5 Plus |
| `rk3588s-9tripod-linux` | Indiedroid Nova |
+| `rk3588s-fydetab-duo` | Fydetab Duo |
| `rk3588-firefly-aio-3588q` | Firefly AIO-3588Q |
| `itx-3588j` | Firefly ITX-3588J |
| `roc-rk3588s-pc` | ROC-RK3588S-PC / Station M3 |
diff --git a/edk2-rockchip-non-osi/Platform/Rockchip/DeviceTree/README.md b/edk2-rockchip-non-osi/Platform/Rockchip/DeviceTree/README.md
index cd1b1696..716d477b 100644
--- a/edk2-rockchip-non-osi/Platform/Rockchip/DeviceTree/README.md
+++ b/edk2-rockchip-non-osi/Platform/Rockchip/DeviceTree/README.md
@@ -13,5 +13,8 @@
* rk3588-rock-5b-plus:
+* rk3588s-fydetab-duo:
+ (note: dtb taken from the `noble` branch which is based on the rockchip 6.1 rkr3 bsp kernel)
+
## License
SPDX-License-Identifier: GPL-2.0-only
diff --git a/edk2-rockchip-non-osi/Platform/Rockchip/DeviceTree/rk3588s-fydetab-duo.dtb b/edk2-rockchip-non-osi/Platform/Rockchip/DeviceTree/rk3588s-fydetab-duo.dtb
new file mode 100755
index 00000000..213d3a0a
Binary files /dev/null and b/edk2-rockchip-non-osi/Platform/Rockchip/DeviceTree/rk3588s-fydetab-duo.dtb differ
diff --git a/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/FydetabDuo.Modules.fdf.inc b/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/FydetabDuo.Modules.fdf.inc
index b9331eb5..25791fcd 100644
--- a/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/FydetabDuo.Modules.fdf.inc
+++ b/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/FydetabDuo.Modules.fdf.inc
@@ -10,9 +10,9 @@
INF RuleOverride = ACPITABLE $(PLATFORM_DIRECTORY)/AcpiTables/AcpiTables.inf
# TODO: Device Tree Support
- # FILE FREEFORM = gDtPlatformDefaultDtbFileGuid {
- # SECTION RAW = Platform/Rockchip/DeviceTree/rk3588s-9tripod-linux.dtb
- # }
+ FILE FREEFORM = gDtPlatformDefaultDtbFileGuid {
+ SECTION RAW = Platform/Rockchip/DeviceTree/rk3588s-fydetab-duo.dtb
+ }
# Splash screen logo
INF $(PLATFORM_DIRECTORY)/Drivers/LogoDxe/LogoDxe.inf
diff --git a/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/FydetabDuo.dsc b/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/FydetabDuo.dsc
index df88dc59..82ede3e4 100644
--- a/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/FydetabDuo.dsc
+++ b/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/FydetabDuo.dsc
@@ -62,7 +62,7 @@
gRockchipTokenSpaceGuid.PcdPlatformVendorName|"Fyde Innovations"
gRockchipTokenSpaceGuid.PcdFamilyName|"Fydetab"
gRockchipTokenSpaceGuid.PcdProductUrl|"https://fydetabduo.com/"
- gRockchipTokenSpaceGuid.PcdDeviceTreeName|"rk3588s-12c"
+ gRockchipTokenSpaceGuid.PcdDeviceTreeName|"rk3588s-fydetab-duo"
# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x50, 0x51, 0x11 }
@@ -98,7 +98,7 @@
gRK3588TokenSpaceGuid.PcdI2S0Supported|TRUE
# SD card detect signal is inverted
- gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectBroken|TRUE
+ gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectInverted|TRUE
################################################################################
#
diff --git a/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/Library/RockchipPlatformLib/RockchipPlatformLib.c b/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/Library/RockchipPlatformLib/RockchipPlatformLib.c
index 1e85741c..d7303112 100644
--- a/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/Library/RockchipPlatformLib/RockchipPlatformLib.c
+++ b/edk2-rockchip/Platform/FydeInnovations/FydetabDuo/Library/RockchipPlatformLib/RockchipPlatformLib.c
@@ -51,6 +51,8 @@ SdmmcIoMux (
BUS_IOC->GPIO4D_IOMUX_SEL_L = (0xFFFFUL << 16) | (0x1111); //SDMMC_D0,SDMMC_D1,SDMMC_D2,SDMMC_D3
BUS_IOC->GPIO4D_IOMUX_SEL_H = (0x00FFUL << 16) | (0x0011); //SDMMC_CLK,SDMMC_CMD
PMU1_IOC->GPIO0A_IOMUX_SEL_H = (0x000FUL << 16) | (0x0001); //SDMMC_DET
+ GpioPinSetDirection (4, GPIO_PIN_PB4, GPIO_PIN_OUTPUT);
+ GpioPinWrite (4, GPIO_PIN_PB4, TRUE);
}
VOID
diff --git a/edk2-rockchip/Silicon/Rockchip/Drivers/RkSdmmcDxe/RkSdmmcDxe.c b/edk2-rockchip/Silicon/Rockchip/Drivers/RkSdmmcDxe/RkSdmmcDxe.c
index a890fc32..cdef259b 100644
--- a/edk2-rockchip/Silicon/Rockchip/Drivers/RkSdmmcDxe/RkSdmmcDxe.c
+++ b/edk2-rockchip/Silicon/Rockchip/Drivers/RkSdmmcDxe/RkSdmmcDxe.c
@@ -128,7 +128,11 @@ RkSdmmcCardDetect (
return TRUE; // let the driver do software detection
}
- return PresenceState == RkSdmmcCardPresent;
+ if (FixedPcdGetBool (PcdRkSdmmcCardDetectInverted)) {
+ return PresenceState != RkSdmmcCardPresent;
+ } else {
+ return PresenceState == RkSdmmcCardPresent;
+ }
}
STATIC PLATFORM_DW_MMC_PROTOCOL mDwMmcDeviceProtocol = {
diff --git a/edk2-rockchip/Silicon/Rockchip/Drivers/RkSdmmcDxe/RkSdmmcDxe.inf b/edk2-rockchip/Silicon/Rockchip/Drivers/RkSdmmcDxe/RkSdmmcDxe.inf
index 61433031..f4b6c6c7 100644
--- a/edk2-rockchip/Silicon/Rockchip/Drivers/RkSdmmcDxe/RkSdmmcDxe.inf
+++ b/edk2-rockchip/Silicon/Rockchip/Drivers/RkSdmmcDxe/RkSdmmcDxe.inf
@@ -44,6 +44,7 @@
[Pcd]
gRockchipTokenSpaceGuid.PcdRkSdmmcBaseAddress
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectBroken
+ gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectInverted
[Depex]
TRUE
diff --git a/edk2-rockchip/Silicon/Rockchip/RockchipPkg.dec b/edk2-rockchip/Silicon/Rockchip/RockchipPkg.dec
index 440d6ae1..c291298b 100644
--- a/edk2-rockchip/Silicon/Rockchip/RockchipPkg.dec
+++ b/edk2-rockchip/Silicon/Rockchip/RockchipPkg.dec
@@ -63,6 +63,7 @@
gRockchipTokenSpaceGuid.PcdRkSdmmcBaseAddress|0x0|UINT32|0x40000030
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectBroken|FALSE|BOOLEAN|0x40000031
+ gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectInverted|FALSE|BOOLEAN|0x40000032
gRockchipTokenSpaceGuid.PcdDwcSdhciBaseAddress|0x0|UINT32|0x40000035
gRockchipTokenSpaceGuid.PcdDwcSdhciForceHighSpeed|FALSE|BOOLEAN|0x40000036