;;; Nonguix `linux' with the options a Raspberry Pi 4 needs to boot from ;;; microSD and bring up its onboard Ethernet. ;;; ;;; The stock config ships CLK_BCM2835 disabled (emmc2's clock comes from the ;;; cprman, so the SD card never probes), MMC/regulator/firmware-GPIO bits as ;;; modules (the SD regulators hang off the firmware GPIO expander), and no ;;; GENET Ethernet at all. Everything on the path to the root file system is ;;; built in so the initrd needs no Pi-specific modules. (define-module (rpi4-linux) #:use-module (gnu packages linux) #:use-module (guix packages) #:use-module (nongnu packages linux) #:export (linux-rpi4)) (define %rpi4-kernel-configs '(;; SD card (emmc2): clocks, regulators, controller, block device. "CONFIG_CLK_BCM2835=y" "CONFIG_CLK_RASPBERRYPI=y" "CONFIG_GPIO_RASPBERRYPI_EXP=y" "CONFIG_REGULATOR_FIXED_VOLTAGE=y" "CONFIG_REGULATOR_GPIO=y" "CONFIG_MMC_SDHCI=y" "CONFIG_MMC_SDHCI_PLTFM=y" "CONFIG_MMC_SDHCI_IPROC=y" "CONFIG_RPMB=y" ;MMC_BLOCK depends on RPMB || !RPMB "CONFIG_MMC_BLOCK=y" ;; VL805 USB 3 controller needs its firmware loaded via the reset driver. "CONFIG_RESET_RASPBERRYPI=y" ;; Onboard Gigabit Ethernet (BCM54213PE behind GENET). "CONFIG_BCMGENET=m" "CONFIG_MDIO_BCM_UNIMAC=m" "CONFIG_BROADCOM_PHY=m")) (define-public linux-rpi4 (customize-linux #:name "linux-rpi4" #:linux linux #:configs %rpi4-kernel-configs))