jaredmcneill / quartz64_uefi

EDK2 UEFI for Rockchip RK3566 and RK3568 based SBCs.
151 stars 58 forks source link

Lack of eMMC and ethernet support in Linux #31

Closed andreamtp closed 2 years ago

andreamtp commented 2 years ago

Hi, thanks for your amazing port: I've been able to install Fedora 36 that is working fine with kernel 5.18.16-200.fc36 on Firefly ROC-RK3566-PC.

Unfortunately the lack of support to eMMC prevent the installation on the embedded storage, forcing the use of NVMe or external USB drive for the OS. Same for the internal ethernet nic, that is not detected and force the use of usb<->ethernet dongle.

Can you please clarify if the missing functionalities are due to code needed to be implemented on EDK2 side, or if the lack of support rely on the linux kernel side? Is it a Firefly limitation or common to all RK356x SBCs?

For sure with the support of at least the nic, this project will be even more hugely appealing for a lot of users. eMMC is definitely appreciated as well, esp for >= 4Gb ram sbc, that often are delivered with large embedded storage.

Thanks for clarifications

jaredmcneill commented 2 years ago

Those devices are exposed by the ACPI tables to the OS. The hardware IDs used tell the OS which driver / settings to use to configure the device.

For eMMC and ethernet, Linux supports the hardware, but needs changes to teach the the driver how to bind to the ACPI devices exposed by my firmware.

The eMMC device should work with the sdhci driver, and some changes to use the special _DSM introduced in this port and documented in the README to work around a SoC specific quirk: https://github.com/jaredmcneill/quartz64_uefi/blob/main/edk2-rockchip/Platform/Rockchip/Rk356x/AcpiTables/Emmc.asl#L12

Ethernet is declared here and could be supported by the stmmac driver. I tried to keep this one as close to the device tree bindings as possible using a DeviceTree (DT) link device, but last I checked the stmmac driver doesn’t use the correct APIs to support both DeviceTree and ACPI bindings: https://github.com/jaredmcneill/quartz64_uefi/blob/main/edk2-rockchip/Platform/Rockchip/Rk356x/AcpiTables/Gmac.asl#L11

I spend most of my time working on other OSes so I haven’t looked in to it any more than that. Hoping someone else would pick up that work :)