kernel: Enable loongarch64 kernel config MMC_LOONGSON2

Message ID 20261203023403.2049053-1-vincent.mc.li@gmail.com
State Staged
Commit e437d287f910d536d9e4888c1b9eb0c03c22de98
Headers
Series kernel: Enable loongarch64 kernel config MMC_LOONGSON2 |

Commit Message

Vincent Li 3 Dec 2026, 2:34 a.m. UTC
CONFIG_MMC_LOONGSON2 drives the Loongson-2K series SD/SDIO/eMMC
controller. It is required for onboard eMMC to be detected on
Loongson 2K3000 based boards (e.g. OrangePi Nova)

This mirrors the fix accepted upstream and in Debian, where the
missing driver was reported for the 2K3000/3B6000M platforms:
https://bugs.debian.org/1142793

Tested-by: Vincent Li <vincent.mc.li@gmail.com>
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
---
 config/kernel/config-loongarch64-generic | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Michael Tremer 3 Dec 2026, 5:03 p.m. UTC | #1
Hi Vincent,

Thanks for the patch. I have merged it into next.

I added a few things around it:

- The module needs an entry in the rootfile, which the patch didn't have. I added loongson2-mmc.ko.xz in a separate commit.
- I enabled the other drivers that the 2K SoCs and the LS7A bridge need: clock, pin control, GPIO, I2C, RTC, thermal and APB DMA. I also enabled SPI with the Loongson SPI controllers, plus the generic device-tree drivers that boards usually need (OF serial, reset via GPIO, regulators, PWM, cpufreq-dt, DWC2 USB, on-board USB hubs, EFI RTC).

The loongarch64 kernel configuration so far was only meant to compile quickly and has only been run in a VM, never on real hardware. Your testing on the OrangePi Nova is therefore very valuable.

Could you try a build of next on your board and tell me:

1. Does the eMMC show up, and does it work for you now?
2. What does dmesg say? In particular, are there errors from the new drivers, or devices that still have no driver?
3. What does lspci -k show for devices without a driver?
4. Does the serial console work and does the board reboot and power off cleanly?
5. Is the board booted from a device tree or from ACPI? That tells me which of the new drivers are used.

For future patches, please drop the Tested-by: line when it is from the same person as the Signed-off-by:, and please check the link to the Debian bug, because I could not open it. Both are small points.

Thanks again for working on LoongArch support!

Best,
Michael
  

Patch

diff --git a/config/kernel/config-loongarch64-generic b/config/kernel/config-loongarch64-generic
index 180dd57ef..d8659be09 100644
--- a/config/kernel/config-loongarch64-generic
+++ b/config/kernel/config-loongarch64-generic
@@ -743,7 +743,7 @@  CONFIG_MMC_SDHCI_PLTFM=m
 # CONFIG_MMC_SDHCI_OF_DWCMSHC is not set
 # CONFIG_MMC_SDHCI_CADENCE is not set
 # CONFIG_MMC_SDHCI_MILBEAUT is not set
-# CONFIG_MMC_LOONGSON2 is not set
+CONFIG_MMC_LOONGSON2=m
 # CONFIG_SCSI_UFS_DWC_TC_PLATFORM is not set
 
 #