mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-05 09:38:07 +08:00
chore: format repo using treefmt-nix and nixfmt-rfc-style
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
boot = {
|
||||
@@ -11,9 +16,11 @@
|
||||
"sdhci_sophgo"
|
||||
];
|
||||
};
|
||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./linux.nix {
|
||||
inherit (config.boot) kernelPatches;
|
||||
});
|
||||
kernelPackages = pkgs.linuxPackagesFor (
|
||||
pkgs.callPackage ./linux.nix {
|
||||
inherit (config.boot) kernelPatches;
|
||||
}
|
||||
);
|
||||
kernelParams = lib.mkDefault [
|
||||
"earlycon"
|
||||
"console=ttyS0,115200"
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
{ stdenv
|
||||
, writeText
|
||||
, opensbi
|
||||
, fip
|
||||
, zsbl
|
||||
, linuxboot-kernel
|
||||
, linuxboot-initrd
|
||||
, dtbs ? "${linuxboot-kernel}/dtbs"
|
||||
, ...
|
||||
{
|
||||
stdenv,
|
||||
writeText,
|
||||
opensbi,
|
||||
fip,
|
||||
zsbl,
|
||||
linuxboot-kernel,
|
||||
linuxboot-initrd,
|
||||
dtbs ? "${linuxboot-kernel}/dtbs",
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
@@ -1,44 +1,58 @@
|
||||
{ buildLinux, fetchFromGitHub, kernelPatches, lib, ... } @ args:
|
||||
{
|
||||
buildLinux,
|
||||
fetchFromGitHub,
|
||||
kernelPatches,
|
||||
lib,
|
||||
...
|
||||
}@args:
|
||||
|
||||
let
|
||||
modDirVersion = "6.6.20";
|
||||
in
|
||||
buildLinux (args // {
|
||||
inherit kernelPatches modDirVersion;
|
||||
version = "${modDirVersion}-milkv-pioneer";
|
||||
src = fetchFromGitHub {
|
||||
owner = "sophgo";
|
||||
repo = "linux-riscv";
|
||||
rev = "caa949e3690fe8a4656313b2b56f52666fa880db";
|
||||
hash = "sha256-qJpR3KMgvP4tfPfBfQ/MiEWg/uuuxHYuACK8taKKK3E=";
|
||||
};
|
||||
buildLinux (
|
||||
args
|
||||
// {
|
||||
inherit kernelPatches modDirVersion;
|
||||
version = "${modDirVersion}-milkv-pioneer";
|
||||
src = fetchFromGitHub {
|
||||
owner = "sophgo";
|
||||
repo = "linux-riscv";
|
||||
rev = "caa949e3690fe8a4656313b2b56f52666fa880db";
|
||||
hash = "sha256-qJpR3KMgvP4tfPfBfQ/MiEWg/uuuxHYuACK8taKKK3E=";
|
||||
};
|
||||
|
||||
defconfig = "sophgo_mango_normal_defconfig";
|
||||
structuredExtraConfig = let inherit (lib.kernel) freeform module yes; in {
|
||||
# LinuxBoot will override the console bootparams which will result
|
||||
# in the distro kernel to be booted with e.g. console=tty1 only.
|
||||
# https://github.com/sophgo/bootloader-riscv/issues/71
|
||||
# Force output on serial console through the config. This is also
|
||||
# needed to get the forced serial-getty to be started.
|
||||
# We also list tty1 again because according to
|
||||
# https://docs.kernel.org/admin-guide/serial-console.html and
|
||||
# https://0pointer.de/blog/projects/serial-console.html
|
||||
# this will be the main console.
|
||||
CMDLINE = freeform "console=ttyS0,115200 console=tty1";
|
||||
CMDLINE_EXTEND = yes;
|
||||
defconfig = "sophgo_mango_normal_defconfig";
|
||||
structuredExtraConfig =
|
||||
let
|
||||
inherit (lib.kernel) freeform module yes;
|
||||
in
|
||||
{
|
||||
# LinuxBoot will override the console bootparams which will result
|
||||
# in the distro kernel to be booted with e.g. console=tty1 only.
|
||||
# https://github.com/sophgo/bootloader-riscv/issues/71
|
||||
# Force output on serial console through the config. This is also
|
||||
# needed to get the forced serial-getty to be started.
|
||||
# We also list tty1 again because according to
|
||||
# https://docs.kernel.org/admin-guide/serial-console.html and
|
||||
# https://0pointer.de/blog/projects/serial-console.html
|
||||
# this will be the main console.
|
||||
CMDLINE = freeform "console=ttyS0,115200 console=tty1";
|
||||
CMDLINE_EXTEND = yes;
|
||||
|
||||
# Enable these explicitly because they are not enabled by the defconfig.
|
||||
# The all-hardware profile expects these to be built.
|
||||
VIRTIO_MENU = yes;
|
||||
VIRTIO_PCI = module;
|
||||
# Enable these explicitly because they are not enabled by the defconfig.
|
||||
# The all-hardware profile expects these to be built.
|
||||
VIRTIO_MENU = yes;
|
||||
VIRTIO_PCI = module;
|
||||
|
||||
# There is an i2c mcu driver (drivers/soc/sophgo/umcu) which is always
|
||||
# compiled into the kernel. Hence some of the i2c support also needs to
|
||||
# be compiled in instead of being compiled as a module.
|
||||
I2C = yes;
|
||||
I2C_CHARDEV = yes;
|
||||
I2C_DESIGNWARE_PLATFORM = yes;
|
||||
};
|
||||
# There is an i2c mcu driver (drivers/soc/sophgo/umcu) which is always
|
||||
# compiled into the kernel. Hence some of the i2c support also needs to
|
||||
# be compiled in instead of being compiled as a module.
|
||||
I2C = yes;
|
||||
I2C_CHARDEV = yes;
|
||||
I2C_DESIGNWARE_PLATFORM = yes;
|
||||
};
|
||||
|
||||
extraMeta.branch = "sg2042-dev-6.6";
|
||||
} // (args.argsOverride or { }))
|
||||
extraMeta.branch = "sg2042-dev-6.6";
|
||||
}
|
||||
// (args.argsOverride or { })
|
||||
)
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{ buildPackages
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, linux-firmware
|
||||
, buildGoModule
|
||||
, ...
|
||||
{
|
||||
buildPackages,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
linux-firmware,
|
||||
buildGoModule,
|
||||
...
|
||||
}:
|
||||
|
||||
# Based on
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ fetchFromGitHub, lib, linuxManualConfig, stdenv, ... }:
|
||||
{
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
linuxManualConfig,
|
||||
stdenv,
|
||||
...
|
||||
}:
|
||||
|
||||
linuxManualConfig rec {
|
||||
inherit lib stdenv;
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ config, lib, modulesPath, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (pkgs) callPackage;
|
||||
@@ -10,7 +16,14 @@ let
|
||||
linuxboot-initrd = callPackage ./linuxboot-initrd.nix { };
|
||||
dtbs = config.hardware.deviceTree.package;
|
||||
firmware = callPackage ./firmware.nix {
|
||||
inherit fip zsbl opensbi linuxboot-kernel linuxboot-initrd dtbs;
|
||||
inherit
|
||||
fip
|
||||
zsbl
|
||||
opensbi
|
||||
linuxboot-kernel
|
||||
linuxboot-initrd
|
||||
dtbs
|
||||
;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{ buildPackages
|
||||
, bison
|
||||
, fetchFromGitHub
|
||||
, flex
|
||||
, lib
|
||||
, stdenv
|
||||
{
|
||||
buildPackages,
|
||||
bison,
|
||||
fetchFromGitHub,
|
||||
flex,
|
||||
lib,
|
||||
stdenv,
|
||||
|
||||
, ...
|
||||
...
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "zsbl-sg2042";
|
||||
|
||||
Reference in New Issue
Block a user