diff --git a/src/coreboot/default.nix b/src/coreboot/default.nix index e54366b..096b1e6 100644 --- a/src/coreboot/default.nix +++ b/src/coreboot/default.nix @@ -128,7 +128,7 @@ stdenv.mkDerivation { echo 'CONFIG_LINUX_INITRD="${initramfs_image}"' >> .config sed -i 's/^CONFIG_UART_FOR_CONSOLE=.*//' .config '' + lib.optionalString (uart-for-console != null) '' - echo 'CONFIG_UART_FOR_CONSOLE=${builtins.toString uart-for-console}"' >> .config + echo 'CONFIG_UART_FOR_CONSOLE=${builtins.toString uart-for-console}' >> .config '' + lib.optionalString (iasl != null) '' echo CONFIG_ANY_TOOLCHAIN=y >> .config '' + '' diff --git a/src/platform/am1i/coreboot.config b/src/platform/am1i/coreboot.config index 0d6927a..f9242fc 100644 --- a/src/platform/am1i/coreboot.config +++ b/src/platform/am1i/coreboot.config @@ -88,17 +88,7 @@ CONFIG_MAINBOARD_DIR="asus/am1i-a" CONFIG_MAINBOARD_PART_NUMBER="AM1I-A" CONFIG_MAX_CPUS=4 CONFIG_CBFS_SIZE=8387272 - -# this is the internal header, which exists on both board variants -CONFIG_UART_FOR_CONSOLE=0 -CONFIG_TTYS0_BASE=0x3f8 - -# this is the back-panel connector, which exists only on the "more back-panel stuff" board variant -#CONFIG_UART_FOR_CONSOLE=1 -#CONFIG_TTYS0_BASE=0x2f8 - CONFIG_LINUX_INITRD="" - CONFIG_MAINBOARD_VENDOR="ASUS" CONFIG_HW_MEM_HOLE_SIZEK=0x200000 # CONFIG_HW_MEM_HOLE_SIZE_AUTO_INC is not set diff --git a/src/platform/am1i/default.nix b/src/platform/am1i/default.nix index 6c36025..0044d1c 100644 --- a/src/platform/am1i/default.nix +++ b/src/platform/am1i/default.nix @@ -16,7 +16,7 @@ ''; }); - console-device = "ttyS0"; + console-device = "ttyS1"; coreboot = final.lib.makeOverridable (prev.coreboot.override { iasl = final.iasl_20180531; @@ -24,6 +24,11 @@ coreboot-toolchain = with final.coreboot-toolchain; [ x64 i386 ]; fmap = ./custom.fmap; config = ./coreboot.config; + uart-for-console = + if final.console-device == "ttyS0" then 0 # IDC ribbon-cable header on the motherboarod + else if final.console-device == "ttyS1" then 1 # DB9 connector on rear I/O panel; omitted from some board variants + else if final.console-device == null then null + else throw "am1i currently supports only `null` and `ttyS{0,1}` for `console-device`"; }).overrideAttrs (a: { /* postConfigure = (a.postConfigure or "") + '' diff --git a/src/platform/kevin/coreboot.config b/src/platform/kevin/coreboot.config index 75f8794..e6d3e09 100644 --- a/src/platform/kevin/coreboot.config +++ b/src/platform/kevin/coreboot.config @@ -88,7 +88,6 @@ CONFIG_MAINBOARD_DIR="google/gru" CONFIG_MAINBOARD_PART_NUMBER="Kevin" CONFIG_MAX_CPUS=1 CONFIG_CBFS_SIZE=7138520 -CONFIG_UART_FOR_CONSOLE=0 CONFIG_MAINBOARD_VENDOR="Google" CONFIG_DIMM_SPD_SIZE=256 CONFIG_DEVICETREE="devicetree.cb" diff --git a/src/platform/kevin/default.nix b/src/platform/kevin/default.nix index 1a13b5f..800174a 100644 --- a/src/platform/kevin/default.nix +++ b/src/platform/kevin/default.nix @@ -79,6 +79,10 @@ in { fmap = ./custom.fmap; config = ./coreboot.config; coreboot-toolchain = with final.coreboot-toolchain; [ aarch64 ]; + uart-for-console = + if final.console-device == "ttyS2" then 0 + else if final.console-device == null then null + else throw "gru-kevin currently supports only `null` and `ttyS2` for `console-device`"; }).overrideAttrs (a: { postConfigure = '' echo CONFIG_ARM64_BL31_EXTERNAL_FILE=\"${atf}/bl31.elf\" >> .config diff --git a/src/platform/kgpe/coreboot.config b/src/platform/kgpe/coreboot.config index fcec086..b6cbb1b 100644 --- a/src/platform/kgpe/coreboot.config +++ b/src/platform/kgpe/coreboot.config @@ -89,8 +89,6 @@ CONFIG_MAINBOARD_DIR="asus/kgpe-d16" CONFIG_MAINBOARD_PART_NUMBER="KGPE-D16" CONFIG_MAX_CPUS=32 CONFIG_CBFS_SIZE=8387584 -#CONFIG_UART_FOR_CONSOLE=0 -CONFIG_UART_FOR_CONSOLE=1 CONFIG_MAINBOARD_VENDOR="ASUS" CONFIG_APIC_ID_OFFSET=0x0 CONFIG_HW_MEM_HOLE_SIZEK=0x100000 @@ -193,7 +191,6 @@ CONFIG_PCIEXP_CLK_PM=y CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT="northbridge/amd/amdfam10/bootblock.c" CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT="southbridge/amd/sb700/bootblock.c" CONFIG_TTYS0_BASE=0x3f8 -#CONFIG_TTYS0_BASE=0x2f8 CONFIG_RAMTOP=0x400000 # CONFIG_CONSOLE_CBMEM is not set CONFIG_UART_PCI_ADDR=0x0 diff --git a/src/platform/kgpe/default.nix b/src/platform/kgpe/default.nix index 3dbb4ab..2abf4df 100644 --- a/src/platform/kgpe/default.nix +++ b/src/platform/kgpe/default.nix @@ -31,6 +31,8 @@ # insecure configurations? (63xx without microcode) microcode-blob = null; + console-device = "ttyS0"; # the DB9 connector on the rear panel + # This contains the default values written into the # battery-backed nvram when you boot with the recovery jumper # installed (which is something you should do the first time you @@ -41,15 +43,17 @@ # TODO: use a NixOS-style structuredConfig for this. cmos-default = null; - console-device = "ttyS0"; # the DB9 connector on the rear panel - #console-device = "ttyS1"; # the IDC header on the motherboard - coreboot = final.lib.makeOverridable (prev.coreboot.override { iasl = final.iasl_20180531; payload = "${final.kernel}/bzImage"; fmap = ./custom.fmap; config = ./coreboot.config; coreboot-toolchain = with final.coreboot-toolchain; [ x64 i386 ]; + uart-for-console = + if final.console-device == "ttyS0" then 0 # the DB9 connector on the rear panel + else if final.console-device == "ttyS1" then 1 # the IDC header on the motherboard + else if final.console-device == null then null + else throw "kgpe currently supports only `null` and `ttyS{0,1}` for `console-device`"; }).overrideAttrs (a: { postConfigure = if final.microcode-blob != null then '' echo CONFIG_CPU_MICROCODE_MULTIPLE_FILES=y >> .config