1 # Note: lib/systems/default.nix takes care of producing valid,
2 # fully-formed "platform" values (e.g. hostPlatform, buildPlatform,
3 # targetPlatform, etc) containing at least the minimal set of attrs
4 # required (see types.parsedPlatform in lib/systems/parse.nix). This
5 # file takes an already-valid platform and further elaborates it with
6 # optional fields; currently these are: linux-kernel, gcc, and rustc.
14 baseConfig = "defconfig";
15 # Build whatever possible as a module, if not stated in the extra config.
21 pc_simplekernel = lib.recursiveUpdate pc {
22 linux-kernel.autoModules = false;
29 baseConfig = "powernv_defconfig";
32 # avoid driver/FS trouble arising from unusual page size
53 baseConfig = "multi_v5_defconfig";
60 UBIFS_FS_ADVANCED_COMPR y
65 makeFlags = [ "LOADADDR=0x8000" ];
67 # TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working
79 baseConfig = "multi_v5_defconfig";
93 USB_STORAGE_CYPRESS_ATACB m
95 # mv cesa requires this sw fallback, for mv-sha1
99 CRYPTO_TWOFISH_COMMON y
101 CRYPTO_BLOWFISH_COMMON y
119 IP_NF_MATCH_ADDRTYPE y
138 # Disable OABI to have seccomp_filter (required for systemd)
139 # https://github.com/raspberrypi/firmware/issues/651
155 BLK_DEV_CMD640_ENHANCED n
159 # systemd uses cgroups
169 UBIFS_FS_ADVANCED_COMPR y
174 # Kdb, for kernel troubles
176 KGDB_SERIAL_CONSOLE y
179 makeFlags = [ "LOADADDR=0x0200000" ];
181 DTB = true; # Beyond 3.10
190 name = "raspberrypi";
192 baseConfig = "bcm2835_defconfig";
195 preferBuiltin = true;
197 # Disable OABI to have seccomp_filter (required for systemd)
198 # https://github.com/raspberrypi/firmware/issues/651
204 # https://en.wikipedia.org/wiki/Raspberry_Pi#Specifications
210 # Legacy attribute, for compatibility with existing configs only.
211 raspberrypi2 = armv7l-hf-multiplatform;
213 # Nvidia Bluefield 2 (w. crypto support)
216 arch = "armv8-a+fp+simd+crc+crypto";
222 name = "zero-gravitas";
224 baseConfig = "zero-gravitas_defconfig";
225 # Target verified by checking /boot on reMarkable 1 device
240 baseConfig = "zero-sugar_defconfig";
243 preferBuiltin = true;
256 maseConfig = "multi_v7_defconfig";
263 UBIFS_FS_ADVANCED_COMPR y
268 makeFlags = [ "LOADADDR=0x10800000" ];
278 guruplug = lib.recursiveUpdate sheevaplug {
279 # Define `CONFIG_MACH_GURUPLUG' (see
280 # <http://kerneltrap.org/mailarchive/git-commits-head/2010/5/19/33618>)
281 # and other GuruPlug-specific things. Requires the `guruplug-defconfig'
283 linux-kernel.baseConfig = "guruplug_defconfig";
286 beaglebone = lib.recursiveUpdate armv7l-hf-multiplatform {
289 baseConfig = "bb.org_defconfig";
291 extraConfig = ""; # TBD kernel config
296 # https://developer.android.com/ndk/guides/abis#v7a
298 linux-kernel.name = "armeabi-v7a";
301 float-abi = "softfp";
306 armv7l-hf-multiplatform = {
308 name = "armv7l-hf-multiplatform";
309 Major = "2.6"; # Using "2.6" enables 2.6 kernel syscalls in glibc.
310 baseConfig = "multi_v7_defconfig";
313 preferBuiltin = true;
316 # Serial port for Raspberry Pi 3. Wasn't included in ARMv7 defconfig
318 SERIAL_8250_BCM2835AUX y
319 SERIAL_8250_EXTENDED y
320 SERIAL_8250_SHARE_IRQ y
323 ARM_BIG_LITTLE_CPUIDLE n
325 # Disable OABI to have seccomp_filter (required for systemd)
326 # https://github.com/raspberrypi/firmware/issues/651
330 # drivers/net/ethernet/micrel/ks8851_common.o: in function `ks8851_probe_common':
331 # ks8851_common.c:(.text+0x179c): undefined reference to `__this_module'
332 # See: https://lore.kernel.org/netdev/20210116164828.40545-1-marex@denx.de/T/
337 # Some table about fpu flags:
338 # http://community.arm.com/servlet/JiveServlet/showImage/38-1981-3827/blogentry-103749-004812900+1365712953_thumb.png
339 # Cortex-A5: -mfpu=neon-fp16
340 # Cortex-A7 (rpi2): -mfpu=neon-vfpv4
341 # Cortex-A8 (beaglebone): -mfpu=neon
342 # Cortex-A9: -mfpu=neon-fp16
343 # Cortex-A15: -mfpu=neon-vfpv4
346 # https://wiki.debian.org/ArmHardFloatPort/VfpComparison
348 # vfpv3-d16 is what Debian uses and seems to be the best compromise: NEON is not supported in e.g. Scaleway or Tegra 2,
349 # and the above page suggests NEON is only an improvement with hand-written assembly.
353 # For Raspberry Pi the 2 the best would be:
355 # fpu = "neon-vfpv4";
359 aarch64-multiplatform = {
361 name = "aarch64-multiplatform";
362 baseConfig = "defconfig";
365 preferBuiltin = true;
367 # Raspberry Pi 3 stuff. Not needed for s >= 4.10.
371 RASPBERRYPI_FIRMWARE y
373 SERIAL_8250_BCM2835AUX y
374 SERIAL_8250_EXTENDED y
375 SERIAL_8250_SHARE_IRQ y
377 # Cavium ThunderX stuff.
378 PCI_HOST_THUNDER_ECAM y
380 # Nvidia Tegra stuff.
383 # The default (=y) forces us to have the XHCI firmware available in initrd,
384 # which our initrd builder can't currently do easily.
396 arch = "armv8.3-a+crypto+sha2+aes+crc+fp16+lse+simd+ras+rdm+rcpc";
407 name = "ben_nanonote";
417 name = "fuloong2f_n32";
418 baseConfig = "lemote2f_defconfig";
424 # nixos mounts some cgroup
435 USB_STORAGE_CYPRESS_ATACB m
465 BLK_DEV_CMD640_ENHANCED n
469 # Needed for udev >= 150
470 SYSFS_DEPRECATED_V2 n
473 VT_HW_CONSOLE_BINDING y
474 SERIAL_8250_CONSOLE y
475 FRAMEBUFFER_CONSOLE y
481 # The kernel doesn't boot at all, with FTRACE
493 # can execute on 32bit chip
494 gcc_mips32r2_o32 = { gcc = { arch = "mips32r2"; abi = "32"; }; };
495 gcc_mips32r6_o32 = { gcc = { arch = "mips32r6"; abi = "32"; }; };
496 gcc_mips64r2_n32 = { gcc = { arch = "mips64r2"; abi = "n32"; }; };
497 gcc_mips64r6_n32 = { gcc = { arch = "mips64r6"; abi = "n32"; }; };
498 gcc_mips64r2_64 = { gcc = { arch = "mips64r2"; abi = "64"; }; };
499 gcc_mips64r6_64 = { gcc = { arch = "mips64r6"; abi = "64"; }; };
502 # https://www.mail-archive.com/qemu-discuss@nongnu.org/msg05179.html
503 # https://gmplib.org/~tege/qemu.html#mips64-debian
504 mips64el-qemu-linux-gnuabi64 = {
507 baseConfig = "64r2el_defconfig";
511 # for qemu 9p passthrough filesystem
534 riscv-multiplatform = {
536 name = "riscv-multiplatform";
539 preferBuiltin = true;
540 baseConfig = "defconfig";
545 # This function takes a minimally-valid "platform" and returns an
546 # attrset containing zero or more additional attrs which should be
547 # included in the platform in order to further elaborate it.
550 /**/ if platform.isx86 then pc
553 else if platform.isAarch32 then let
554 version = platform.parsed.cpu.version or null;
555 in if version == null then pc
556 else if lib.versionOlder version "6" then sheevaplug
557 else if lib.versionOlder version "7" then raspberrypi
558 else armv7l-hf-multiplatform
560 else if platform.isAarch64 then
561 if platform.isDarwin then apple-m1
562 else aarch64-multiplatform
564 else if platform.isRiscV then riscv-multiplatform
566 else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then (import ./examples.nix { inherit lib; }).mipsel-linux-gnu
568 else if platform.parsed.cpu == lib.systems.parse.cpuTypes.powerpc64le then powernv