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
209 # Legacy attribute, for compatibility with existing configs only.
210 raspberrypi2 = armv7l-hf-multiplatform;
212 # Nvidia Bluefield 2 (w. crypto support)
215 arch = "armv8-a+fp+simd+crc+crypto";
221 name = "zero-gravitas";
223 baseConfig = "zero-gravitas_defconfig";
224 # Target verified by checking /boot on reMarkable 1 device
239 baseConfig = "zero-sugar_defconfig";
242 preferBuiltin = true;
255 maseConfig = "multi_v7_defconfig";
262 UBIFS_FS_ADVANCED_COMPR y
267 makeFlags = [ "LOADADDR=0x10800000" ];
277 guruplug = lib.recursiveUpdate sheevaplug {
278 # Define `CONFIG_MACH_GURUPLUG' (see
279 # <http://kerneltrap.org/mailarchive/git-commits-head/2010/5/19/33618>)
280 # and other GuruPlug-specific things. Requires the `guruplug-defconfig'
282 linux-kernel.baseConfig = "guruplug_defconfig";
285 beaglebone = lib.recursiveUpdate armv7l-hf-multiplatform {
288 baseConfig = "bb.org_defconfig";
290 extraConfig = ""; # TBD kernel config
295 # https://developer.android.com/ndk/guides/abis#v7a
297 linux-kernel.name = "armeabi-v7a";
300 float-abi = "softfp";
305 armv7l-hf-multiplatform = {
307 name = "armv7l-hf-multiplatform";
308 Major = "2.6"; # Using "2.6" enables 2.6 kernel syscalls in glibc.
309 baseConfig = "multi_v7_defconfig";
312 preferBuiltin = true;
315 # Serial port for Raspberry Pi 3. Wasn't included in ARMv7 defconfig
317 SERIAL_8250_BCM2835AUX y
318 SERIAL_8250_EXTENDED y
319 SERIAL_8250_SHARE_IRQ y
322 ARM_BIG_LITTLE_CPUIDLE n
324 # Disable OABI to have seccomp_filter (required for systemd)
325 # https://github.com/raspberrypi/firmware/issues/651
329 # drivers/net/ethernet/micrel/ks8851_common.o: in function `ks8851_probe_common':
330 # ks8851_common.c:(.text+0x179c): undefined reference to `__this_module'
331 # See: https://lore.kernel.org/netdev/20210116164828.40545-1-marex@denx.de/T/
336 # Some table about fpu flags:
337 # http://community.arm.com/servlet/JiveServlet/showImage/38-1981-3827/blogentry-103749-004812900+1365712953_thumb.png
338 # Cortex-A5: -mfpu=neon-fp16
339 # Cortex-A7 (rpi2): -mfpu=neon-vfpv4
340 # Cortex-A8 (beaglebone): -mfpu=neon
341 # Cortex-A9: -mfpu=neon-fp16
342 # Cortex-A15: -mfpu=neon-vfpv4
345 # https://wiki.debian.org/ArmHardFloatPort/VfpComparison
347 # vfpv3-d16 is what Debian uses and seems to be the best compromise: NEON is not supported in e.g. Scaleway or Tegra 2,
348 # and the above page suggests NEON is only an improvement with hand-written assembly.
352 # For Raspberry Pi the 2 the best would be:
354 # fpu = "neon-vfpv4";
358 aarch64-multiplatform = {
360 name = "aarch64-multiplatform";
361 baseConfig = "defconfig";
364 preferBuiltin = true;
366 # Raspberry Pi 3 stuff. Not needed for s >= 4.10.
370 RASPBERRYPI_FIRMWARE y
372 SERIAL_8250_BCM2835AUX y
373 SERIAL_8250_EXTENDED y
374 SERIAL_8250_SHARE_IRQ y
376 # Cavium ThunderX stuff.
377 PCI_HOST_THUNDER_ECAM y
379 # Nvidia Tegra stuff.
382 # The default (=y) forces us to have the XHCI firmware available in initrd,
383 # which our initrd builder can't currently do easily.
395 arch = "armv8.3-a+crypto+sha2+aes+crc+fp16+lse+simd+ras+rdm+rcpc";
406 name = "ben_nanonote";
416 name = "fuloong2f_n32";
417 baseConfig = "lemote2f_defconfig";
423 # nixos mounts some cgroup
434 USB_STORAGE_CYPRESS_ATACB m
464 BLK_DEV_CMD640_ENHANCED n
468 # Needed for udev >= 150
469 SYSFS_DEPRECATED_V2 n
472 VT_HW_CONSOLE_BINDING y
473 SERIAL_8250_CONSOLE y
474 FRAMEBUFFER_CONSOLE y
480 # The kernel doesn't boot at all, with FTRACE
492 # can execute on 32bit chip
493 gcc_mips32r2_o32 = { gcc = { arch = "mips32r2"; abi = "32"; }; };
494 gcc_mips32r6_o32 = { gcc = { arch = "mips32r6"; abi = "32"; }; };
495 gcc_mips64r2_n32 = { gcc = { arch = "mips64r2"; abi = "n32"; }; };
496 gcc_mips64r6_n32 = { gcc = { arch = "mips64r6"; abi = "n32"; }; };
497 gcc_mips64r2_64 = { gcc = { arch = "mips64r2"; abi = "64"; }; };
498 gcc_mips64r6_64 = { gcc = { arch = "mips64r6"; abi = "64"; }; };
501 # https://www.mail-archive.com/qemu-discuss@nongnu.org/msg05179.html
502 # https://gmplib.org/~tege/qemu.html#mips64-debian
503 mips64el-qemu-linux-gnuabi64 = {
506 baseConfig = "64r2el_defconfig";
510 # for qemu 9p passthrough filesystem
533 riscv-multiplatform = {
535 name = "riscv-multiplatform";
538 baseConfig = "defconfig";
546 # This function takes a minimally-valid "platform" and returns an
547 # attrset containing zero or more additional attrs which should be
548 # included in the platform in order to further elaborate it.
551 /**/ if platform.isx86 then pc
554 else if platform.isAarch32 then let
555 version = platform.parsed.cpu.version or null;
556 in if version == null then pc
557 else if lib.versionOlder version "6" then sheevaplug
558 else if lib.versionOlder version "7" then raspberrypi
559 else armv7l-hf-multiplatform
561 else if platform.isAarch64 then
562 if platform.isDarwin then apple-m1
563 else aarch64-multiplatform
565 else if platform.isRiscV then riscv-multiplatform
567 else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then (import ./examples.nix { inherit lib; }).mipsel-linux-gnu
569 else if platform.parsed.cpu == lib.systems.parse.cpuTypes.powerpc64le then powernv