Skip to content

Commit

Permalink
feat: 6.1 DTB + fixes for SDcard on the Fydetab Duo
Browse files Browse the repository at this point in the history
Co-authored-by: Yang Tsao <[email protected]>
  • Loading branch information
2 people authored and MollySophia committed Sep 9, 2024
1 parent 47b54dd commit e98af13
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
3 changes: 3 additions & 0 deletions edk2-rockchip-non-osi/Platform/Rockchip/DeviceTree/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@

* rk3588-rock-5b-plus: <https://github.com/radxa/kernel/blob/3b95df6d8bf567857b69e5266f1cb0651a6cfb3e/arch/arm64/boot/dts/rockchip/>

* rk3588s-fydetab-duo: <https://github.com/Linux-for-Fydetab-Duo/linux-rockchip/tree/14294048d2a0deb7f38c890329aded87038d3299/arch/arm64/boot/dts/rockchip>
(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
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -98,7 +98,7 @@
gRK3588TokenSpaceGuid.PcdI2S0Supported|TRUE

# SD card detect signal is inverted
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectBroken|TRUE
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectInverted|TRUE

################################################################################
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
[Pcd]
gRockchipTokenSpaceGuid.PcdRkSdmmcBaseAddress
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectBroken
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectInverted

[Depex]
TRUE
1 change: 1 addition & 0 deletions edk2-rockchip/Silicon/Rockchip/RockchipPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e98af13

Please sign in to comment.