docs(kernel): Switch to kernel 6.6.x LTS for I2C/LED compatibility

Kernel 6.12.x has mv64xxx I2C driver timing issues causing LED write
failures (-EIO). OpenWrt kernel 6.6.119 works perfectly with the same
IS31FL3199 LED chip.

Updated build instructions to use kernel 6.6.137 LTS (same generation
as OpenWrt) for reliable I2C/LED support on MOCHAbin.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-05-08 08:47:30 +02:00
parent dbf76b7f29
commit af1f9b441a

160
kernel-build/README.md Normal file
View File

@ -0,0 +1,160 @@
# SecuBox MOCHAbin Kernel Build
Custom Linux **6.6.x LTS** kernel for Marvell Armada 7040 (MOCHAbin) with OpenWrt-style built-in drivers.
> **Important**: Use kernel 6.6.x (same as OpenWrt) for reliable I2C/LED support.
> Kernel 6.12.x has mv64xxx I2C driver timing issues that cause LED write failures.
## Features
### Built-in Drivers (=y)
Unlike standard Debian kernels that use modules (=m), this kernel builds critical drivers directly into the image to avoid boot-time deferred probe issues:
| Category | Driver | Config |
|----------|--------|--------|
| **LED** | IS31FL319X I2C LED controller | `CONFIG_LEDS_IS31FL319X=y` |
| **DSA** | mv88e6xxx switch | `CONFIG_NET_DSA_MV88E6XXX=y` |
| **Ethernet** | Marvell PPv2 | `CONFIG_MVPP2=y` |
| **PHY** | Marvell 1G/10G | `CONFIG_MARVELL_PHY=y`, `CONFIG_MARVELL_10G_PHY=y` |
| **Storage** | Xenon SDHCI (eMMC) | `CONFIG_MMC_SDHCI_XENON=y` |
| **Storage** | AHCI SATA | `CONFIG_AHCI_MVEBU=y` |
| **USB** | XHCI Host | `CONFIG_USB_XHCI_HCD=y` |
| **ComPHY** | CP110 PHY | `CONFIG_PHY_MVEBU_CP110_COMPHY=y` |
### Module Drivers (=m)
USB network drivers for Eye Remote gadget support:
| Module | Purpose |
|--------|---------|
| `usbnet` | USB network framework |
| `cdc_ether` | CDC-ECM USB Ethernet |
| `cdc_ncm` | CDC-NCM USB Ethernet |
| `rndis_host` | RNDIS USB Ethernet |
## Build Instructions
### Prerequisites
```bash
# Install cross-compiler
sudo apt install gcc-aarch64-linux-gnu
# Get kernel source
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.6.137.tar.xz
tar xf linux-6.6.137.tar.xz
cd linux-6.6.137
```
### Configuration
```bash
# Start with defconfig
make ARCH=arm64 defconfig
# Merge SecuBox fragment
scripts/kconfig/merge_config.sh -m .config \
../board/mochabin/kernel/config-6.12-openwrt-merged.fragment
# Finalize config
make ARCH=arm64 olddefconfig
```
### Build
```bash
# Build kernel (cross-compile for ARM64)
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j$(nproc)
# Output: arch/arm64/boot/Image
```
### Deploy
```bash
# Copy to MOCHAbin
scp arch/arm64/boot/Image root@C3BOX:/boot/Image-openwrt
# Update boot menu (already configured in extlinux.conf)
ssh root@C3BOX reboot
```
## Config Fragment
The main configuration is in:
```
board/mochabin/kernel/config-6.12-openwrt-merged.fragment
```
This fragment merges:
- OpenWrt MVEBU/Cortex-A72 kernel config (built-in drivers)
- Debian systemd compatibility requirements
- SecuBox-specific features (LED, USB network)
### Key Sections
1. **ARCHITECTURE** - ARM64 Cortex-A72, 4K pages, 39-bit VA
2. **MVEBU PLATFORM** - Armada 8K/7040, GIC-v3, clock/reset
3. **BOOT CRITICAL** - Storage (MMC, SATA), filesystems (ext4, FAT)
4. **NETWORK** - PPv2 Ethernet, DSA switch, PHYs
5. **USB HOST** - XHCI, EHCI, OHCI
6. **I2C/LED** - MV64XXX I2C, IS31FL319X LED
7. **SYSTEMD** - cgroups, namespaces, BPF, seccomp
8. **CRYPTO** - ChaCha20, AES, hardware CESA
## Boot Configuration
Extlinux boot menu at `/boot/extlinux/extlinux.conf`:
```
DEFAULT openwrt
TIMEOUT 50
PROMPT 1
MENU TITLE SecuBox MOCHAbin Boot Menu
LABEL openwrt
MENU LABEL 1. OpenWrt-style Kernel (DSA built-in)
KERNEL /Image-openwrt
FDT /armada-7040-mochabin-openwrt.dtb
APPEND root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait console=ttyS0,115200
```
## LED Hardware
MOCHAbin has 9 RGB LEDs controlled by an IS31FL3199 chip:
- **Bus:** I2C-1
- **Address:** 0x64
- **Driver:** `leds-is31fl319x`
After boot, LEDs should appear at:
```bash
ls /sys/class/leds/
# is31fl3199:led0 ... is31fl3199:led8
```
## Troubleshooting
### DSA switch not working
- Ensure `CONFIG_NET_DSA_MV88E6XXX=y` (not =m)
- Check dmesg for `mv88e6xxx` probe messages
### LEDs not appearing
- Check I2C bus: `i2cdetect -y 1` (should show 0x64)
- Check driver loaded: `dmesg | grep is31fl`
- Verify DTS has correct node
### USB network not working
- Load modules: `modprobe cdc_ether`
- Check dmesg when plugging Eye Remote
## Related Issues
- GitHub Issue #60: Kernel build tracking
- GitHub Issue #45: IS31FL3199 driver
- GitHub Issue #39: LED heartbeat port
## Author
Gerald KERMA <devel@cybermind.fr>
CyberMind — https://cybermind.fr