Skip to content

Commit

Permalink
Enable DRM_I915 for now
Browse files Browse the repository at this point in the history
Until we can get FB_EFI working with the coreboot linux trampoline
  • Loading branch information
jmbaur committed Jul 28, 2024
1 parent 68ba4d7 commit e7faac3
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 36 deletions.
2 changes: 2 additions & 0 deletions boards/fizz-fizz/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
coreboot.kconfig = with lib.kernel; {
BOARD_GOOGLE_FIZZ = yes;
FMDFILE = freeform ./layout.fmd;
GENERIC_LINEAR_FRAMEBUFFER = yes;
RUN_FSP_GOP = yes;
VENDOR_GOOGLE = yes;
};
};
Expand Down
12 changes: 3 additions & 9 deletions boards/qemu-x86_64/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@
platform.qemu = true;
network = true;
debug = true;
video = false;
linux.consoles = [ "ttyS0,115200n8" ];
linux.kconfig = lib.mkIf config.video (
with lib.kernel;
{
FB_VESA = yes;
FB_VGA16 = yes;
VGA_ARB = yes;
}
);
coreboot.kconfig = with lib.kernel; {
BOARD_EMULATION_QEMU_X86_Q35 = yes;
VENDOR_EMULATION = yes;
FMDFILE = freeform ./layout.fmd;
GENERIC_LINEAR_FRAMEBUFFER = yes;
VENDOR_EMULATION = yes;
};
};
}
1 change: 0 additions & 1 deletion kernel-configs/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ in
JUMP_LABEL = yes;
KEXEC = yes;
KEXEC_FILE = yes;
KEYBOARD_ATKBD = yes;
KEYS = yes;
LSM = freeform "integrity";
LTO_NONE = yes;
Expand Down
55 changes: 34 additions & 21 deletions kernel-configs/video.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,39 @@
}:
{
linux = lib.mkIf config.video {
consoles = [ "tty0" ];
kconfig = with lib.kernel; {
# TODO(jared): FB_SIMPLE = yes;
ACPI_VIDEO = lib.mkIf pkgs.stdenv.hostPlatform.isx86_64 yes;
BACKLIGHT_CLASS_DEVICE = yes;
CONSOLE_TRANSLATIONS = yes;
DRM = yes;
DRM_SIMPLEDRM = yes;
FB = yes;
FONTS = yes;
FONT_SUPPORT = yes;
FONT_TER16x32 = yes;
FRAMEBUFFER_CONSOLE = yes;
FRAMEBUFFER_CONSOLE_DETECT_PRIMARY = yes;
GOOGLE_FRAMEBUFFER_COREBOOT = yes;
LOGO = yes;
LOGO_LINUX_VGA16 = yes;
VGA_CONSOLE = lib.mkIf pkgs.stdenv.hostPlatform.isx86_64 yes;
VT = yes;
VT_CONSOLE = yes;
};
consoles = lib.mkAfter [ "tty0" ];
kconfig =
with lib.kernel;
lib.mkMerge [
{
CONSOLE_TRANSLATIONS = yes;
DUMMY_CONSOLE = yes;
FB = yes;
FONTS = yes;
FONT_SUPPORT = yes;
FONT_TER16x32 = yes;
FRAMEBUFFER_CONSOLE = yes;
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER = yes;
FRAMEBUFFER_CONSOLE_DETECT_PRIMARY = yes;
LOGO = yes;
LOGO_LINUX_VGA16 = yes;
VT = yes;
VT_CONSOLE = yes;
}
(lib.mkIf pkgs.stdenv.hostPlatform.isx86_64 {
# TODO(jared): make this work with GOP so we can turn off i915
# depends on coreboot linux_trampoline
EFI = yes;
FB_EFI = yes;

ACPI_VIDEO = yes;
BACKLIGHT_CLASS_DEVICE = yes;
DRM = yes;
DRM_FBDEV_EMULATION = yes;
DRM_I915 = yes;
VGA_CONSOLE = yes;
})
(lib.mkIf pkgs.stdenv.hostPlatform.isAarch64 { GOOGLE_FRAMEBUFFER_COREBOOT = yes; })
];
};
}
6 changes: 5 additions & 1 deletion kernel-configs/x86_64.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
CRYPTO_SHA256_SSSE3 = yes;
CRYPTO_SHA512_SSSE3 = yes;
DMA_ACPI = yes;
DMI = yes;
DW_DMAC = yes;
GPIO_ACPI = yes;
INTEL_IOMMU = yes;
INTEL_IOMMU_DEFAULT_ON = yes;
IRQ_REMAP = yes;
KERNEL_BZIP2 = unset;
KERNEL_GZIP = unset;
KERNEL_LZ4 = unset;
KERNEL_LZMA = unset;
KERNEL_LZO = unset;
KERNEL_XZ = yes;
KEYBOARD_ATKBD = yes;
MFD_INTEL_LPSS_ACPI = yes;
MFD_INTEL_LPSS_PCI = yes;
MITIGATION_RETHUNK = yes;
Expand All @@ -32,6 +36,7 @@
MTRR = yes;
PCI_MSI = yes;
PNP = yes;
PNPACPI = yes;
PREEMPT_VOLUNTARY = yes;
RTC_DRV_CMOS = yes;
SERIAL_8250 = yes;
Expand All @@ -52,7 +57,6 @@
SPI_MEM = yes;
SPI_PXA2XX = yes;
SPI_PXA2XX_PCI = yes;
SYSFB_SIMPLEFB = yes;
UNIX98_PTYS = yes;
UNWINDER_FRAME_POINTER = unset;
UNWINDER_GUESS = yes;
Expand Down
2 changes: 1 addition & 1 deletion options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ in
"ttyO0"
"ttySAC2"
])
++ [ "tty1" ]
++ [ "tty0" ]
);
in
pkgs.writeShellScriptBin "tboot-test" ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/coreboot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
configurePhase = ''
runHook preConfigure
cat $kconfigPath > .config
make olddefconfig
make -j$NIX_BUILD_CORES olddefconfig
runHook postConfigure
'';
makeFlags = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/linux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ stdenv.mkDerivation {
passAsFile = [ "kconfig" ];
postConfigure = ''
cat $kconfigPath $extraConfigPath > all.config
make ARCH=${stdenv.hostPlatform.linuxArch} KCONFIG_ALLCONFIG=1 allnoconfig
make -j$NIX_BUILD_CORES ARCH=${stdenv.hostPlatform.linuxArch} KCONFIG_ALLCONFIG=1 allnoconfig
bash ${./check_config.bash} all.config .config
'';
buildFlags = [
"DTC_FLAGS=-@"
"KBUILD_BUILD_VERSION=1-TinyBoot"
"KBUILD_BUILD_VERSION=1-tinyboot"
];
installFlags =
[ "INSTALL_PATH=$(out)" ]
Expand Down
18 changes: 18 additions & 0 deletions src/console.zig
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ fn runCommand(

pub const Command = struct {
const NoContext = enum {
autoboot,
clear,
history,
list,
Expand Down Expand Up @@ -1096,4 +1097,21 @@ pub const Command = struct {
return error.NotFound;
}
};

const autoboot = struct {
const short_help = "autoboot from all bootloaders";
const long_help =
\\Autoboot from all bootloaders currently available. Bootloaders
\\that don't support autobooting will be skipped.
\\
\\Usage:
\\autoboot
;

fn run(_: *Console, _: *ArgsIterator, _: []*BootLoader) !?Event {
// TODO(jared):

return null;
}
};
};

0 comments on commit e7faac3

Please sign in to comment.