code:
#
# Automatically generated file; DO NOT EDIT.
# coreboot configuration
#

#
# General setup
#
CONFIG_EXPERT=y
CONFIG_LOCALVERSION=""
CONFIG_CBFS_PREFIX="fallback"
CONFIG_COMPILER_GCC=y
# CONFIG_COMPILER_LLVM_CLANG is not set
# CONFIG_ANY_TOOLCHAIN is not set
# CONFIG_CCACHE is not set
# CONFIG_FMD_GENPARSER is not set
# CONFIG_SCONFIG_GENPARSER is not set
CONFIG_USE_OPTION_TABLE=y
# CONFIG_STATIC_OPTION_TABLE is not set
# CONFIG_UNCOMPRESSED_RAMSTAGE is not set
CONFIG_COMPRESS_RAMSTAGE=y
CONFIG_INCLUDE_CONFIG_FILE=y
CONFIG_EARLY_CBMEM_INIT=y
# CONFIG_COLLECT_TIMESTAMPS is not set
# CONFIG_USE_BLOBS is not set
# CONFIG_COVERAGE is not set
# CONFIG_RELOCATABLE_MODULES is not set
# CONFIG_RELOCATABLE_RAMSTAGE is not set
CONFIG_FLASHMAP_OFFSET=0x0
CONFIG_BOOTBLOCK_SIMPLE=y
# CONFIG_BOOTBLOCK_NORMAL is not set
CONFIG_BOOTBLOCK_SOURCE="bootblock_simple.c"
# CONFIG_SKIP_MAX_REBOOT_CNT_CLEAR is not set
# CONFIG_UPDATE_IMAGE is not set
# CONFIG_GENERIC_GPIO_LIB is not set
# CONFIG_BOARD_ID_AUTO is not set
# CONFIG_BOARD_ID_MANUAL is not set
# CONFIG_RAM_CODE_SUPPORT is not set
# CONFIG_ACPI_SATA_GENERATOR is not set

#
# Mainboard
#
# CONFIG_VENDOR_A_TREND is not set
# CONFIG_VENDOR_AAEON is not set
# CONFIG_VENDOR_ABIT is not set
# CONFIG_VENDOR_ADLINK is not set
# CONFIG_VENDOR_ADVANSUS is not set
# CONFIG_VENDOR_AMD is not set
# CONFIG_VENDOR_AOPEN is not set
# CONFIG_VENDOR_APPLE is not set
# CONFIG_VENDOR_ARIMA is not set
# CONFIG_VENDOR_ARTECGROUP is not set
# CONFIG_VENDOR_ASROCK is not set
# CONFIG_VENDOR_ASUS is not set
# CONFIG_VENDOR_AVALUE is not set
# CONFIG_VENDOR_AZZA is not set
# CONFIG_VENDOR_BACHMANN is not set
# CONFIG_VENDOR_BAP is not set
# CONFIG_VENDOR_BCOM is not set
# CONFIG_VENDOR_BIFFEROS is not set
# CONFIG_VENDOR_BIOSTAR is not set
# CONFIG_VENDOR_BROADCOM is not set
# CONFIG_VENDOR_COMPAQ is not set
# CONFIG_VENDOR_CUBIETECH is not set
# CONFIG_VENDOR_DIGITALLOGIC is not set
# CONFIG_VENDOR_DMP is not set
# CONFIG_VENDOR_ECS is not set
# CONFIG_VENDOR_EMULATION is not set
# CONFIG_VENDOR_GETAC is not set
# CONFIG_VENDOR_GIGABYTE is not set
# CONFIG_VENDOR_GIZMOSPHERE is not set
# CONFIG_VENDOR_GOOGLE is not set
# CONFIG_VENDOR_HP is not set
# CONFIG_VENDOR_IBASE is not set
# CONFIG_VENDOR_IBM is not set
# CONFIG_VENDOR_IEI is not set
# CONFIG_VENDOR_INTEL is not set
# CONFIG_VENDOR_IWAVE is not set
# CONFIG_VENDOR_IWILL is not set
# CONFIG_VENDOR_JETWAY is not set
# CONFIG_VENDOR_KONTRON is not set
# CONFIG_VENDOR_LANNER is not set
CONFIG_VENDOR_LENOVO=y
# CONFIG_VENDOR_LINUTOP is not set
# CONFIG_VENDOR_LIPPERT is not set
# CONFIG_VENDOR_MITAC is not set
# CONFIG_VENDOR_MSI is not set
# CONFIG_VENDOR_NEC is not set
# CONFIG_VENDOR_NEWISYS is not set
# CONFIG_VENDOR_NOKIA is not set
# CONFIG_VENDOR_NVIDIA is not set
# CONFIG_VENDOR_PACKARDBELL is not set
# CONFIG_VENDOR_PCENGINES is not set
# CONFIG_VENDOR_RCA is not set
# CONFIG_VENDOR_RODA is not set
# CONFIG_VENDOR_SAMSUNG is not set
# CONFIG_VENDOR_SIEMENS is not set
# CONFIG_VENDOR_SOYO is not set
# CONFIG_VENDOR_SUNW is not set
# CONFIG_VENDOR_SUPERMICRO is not set
# CONFIG_VENDOR_TECHNEXION is not set
# CONFIG_VENDOR_THOMSON is not set
# CONFIG_VENDOR_TI is not set
# CONFIG_VENDOR_TRAVERSE is not set
# CONFIG_VENDOR_TYAN is not set
# CONFIG_VENDOR_VIA is not set
# CONFIG_VENDOR_WINENT is not set
# CONFIG_VENDOR_WYSE is not set
CONFIG_BOARD_SPECIFIC_OPTIONS=y
CONFIG_MAINBOARD_DIR="lenovo/x200"
CONFIG_MAINBOARD_PART_NUMBER="ThinkPad X200"
CONFIG_MAINBOARD_VENDOR="LENOVO"
CONFIG_MAX_CPUS=2
CONFIG_VGA_BIOS_ID="8086,2a42"
# CONFIG_ONBOARD_VGA_IS_PRIMARY is not set
# CONFIG_VGA_BIOS is not set
CONFIG_UDELAY_IO=y
CONFIG_DCACHE_RAM_BASE=0xffaf8000
CONFIG_DCACHE_RAM_SIZE=0x8000
CONFIG_MMCONF_BASE_ADDRESS=0xf0000000
CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT=y
CONFIG_ID_SECTION_OFFSET=0x80
CONFIG_RAMTOP=0x200000
CONFIG_USBDEBUG_HCD_INDEX=2
CONFIG_CACHE_ROM_SIZE_OVERRIDE=0
CONFIG_CBFS_SIZE=0x7FD000
CONFIG_POST_IO=y
CONFIG_POST_DEVICE=y
# CONFIG_BOARD_LENOVO_G505S is not set
# CONFIG_BOARD_LENOVO_R400 is not set
# CONFIG_BOARD_LENOVO_T400 is not set
# CONFIG_BOARD_LENOVO_T420S is not set
# CONFIG_BOARD_LENOVO_T430S is not set
# CONFIG_BOARD_LENOVO_T500 is not set
# CONFIG_BOARD_LENOVO_T520 is not set
# CONFIG_BOARD_LENOVO_T530 is not set
# CONFIG_BOARD_LENOVO_T60 is not set
CONFIG_BOARD_LENOVO_X200=y
# CONFIG_BOARD_LENOVO_X201 is not set
# CONFIG_BOARD_LENOVO_X220 is not set
# CONFIG_BOARD_LENOVO_X230 is not set
# CONFIG_BOARD_LENOVO_X60 is not set
CONFIG_CPU_ADDR_BITS=36
CONFIG_DEFAULT_CONSOLE_LOGLEVEL=8
CONFIG_USBDEBUG=y
CONFIG_DRIVERS_PS2_KEYBOARD=y
CONFIG_IOMMU=y
CONFIG_BOARD_ROMSIZE_KB_8192=y
# CONFIG_COREBOOT_ROMSIZE_KB_64 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_128 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_256 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_512 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_1024 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_2048 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_4096 is not set
CONFIG_COREBOOT_ROMSIZE_KB_8192=y
# CONFIG_COREBOOT_ROMSIZE_KB_12288 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_16384 is not set
CONFIG_COREBOOT_ROMSIZE_KB=8192
CONFIG_ROM_SIZE=0x800000
CONFIG_SYSTEM_TYPE_LAPTOP=y

#
# Chipset
#

#
# SoC
#
# CONFIG_SOC_BROADCOM_CYGNUS is not set
CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT="northbridge/intel/gm45/bootblock.c"
CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT="southbridge/intel/i82801ix/bootblock.c"
CONFIG_EHCI_BAR=0xfef00000
CONFIG_HEAP_SIZE=0x4000
# CONFIG_SOC_MARVELL_BG4CD is not set
# CONFIG_SOC_NVIDIA_TEGRA124 is not set
# CONFIG_SOC_NVIDIA_TEGRA132 is not set
# CONFIG_SOC_NVIDIA_TEGRA210 is not set
# CONFIG_SOC_QC_IPQ806X is not set
# CONFIG_SOC_ROCKCHIP_RK3288 is not set
# CONFIG_CPU_SAMSUNG_EXYNOS5250 is not set
# CONFIG_CPU_SAMSUNG_EXYNOS5420 is not set
# CONFIG_SOC_UCB_RISCV is not set

#
# CPU
#
# CONFIG_CPU_ALLWINNER_A10 is not set
CONFIG_XIP_ROM_SIZE=0x10000
CONFIG_NUM_IPI_STARTS=2
# CONFIG_CPU_AMD_AGESA is not set
# CONFIG_CPU_AMD_PI is not set
# CONFIG_CPU_ARMLTD_CORTEX_A9 is not set
CONFIG_CPU_INTEL_MODEL_1067X=y
CONFIG_CPU_INTEL_SOCKET_BGA956=y
CONFIG_SSE2=y
# CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE is not set
# CONFIG_CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED is not set
# CONFIG_CPU_TI_AM335X is not set
# CONFIG_PARALLEL_CPU_INIT is not set
# CONFIG_UDELAY_LAPIC is not set
# CONFIG_UDELAY_TSC is not set
# CONFIG_UDELAY_TIMER2 is not set
# CONFIG_TSC_CALIBRATE_WITH_IO is not set
# CONFIG_TSC_SYNC_LFENCE is not set
CONFIG_TSC_SYNC_MFENCE=y
CONFIG_LOGICAL_CPUS=y
# CONFIG_SMM_TSEG is not set
# CONFIG_X86_AMD_FIXED_MTRRS is not set
# CONFIG_PLATFORM_USES_FSP1_0 is not set
# CONFIG_PARALLEL_MP is not set
# CONFIG_BACKUP_DEFAULT_SMM_REGION is not set
# CONFIG_MIRROR_PAYLOAD_TO_RAM_BEFORE_LOADING is not set
CONFIG_CACHE_AS_RAM=y
CONFIG_SMP=y
CONFIG_AP_SIPI_VECTOR=0xfffff000
CONFIG_MMX=y
CONFIG_SSE=y
CONFIG_SUPPORT_CPU_UCODE_IN_CBFS=y
# CONFIG_CPU_MICROCODE_CBFS_GENERATE is not set
# CONFIG_CPU_MICROCODE_CBFS_EXTERNAL is not set
CONFIG_CPU_MICROCODE_CBFS_NONE=y

#
# Northbridge
#
# CONFIG_NORTHBRIDGE_AMD_AGESA is not set
# CONFIG_AMD_NB_CIMX is not set
# CONFIG_NORTHBRIDGE_AMD_CIMX_RD890 is not set
CONFIG_VIDEO_MB=0
# CONFIG_NORTHBRIDGE_AMD_PI is not set
CONFIG_RAMBASE=0x100000
CONFIG_NORTHBRIDGE_SPECIFIC_OPTIONS=y
CONFIG_NORTHBRIDGE_INTEL_GM45=y
CONFIG_HPET_ADDRESS=0xfed00000
CONFIG_HPET_MIN_TICKS=0x80
CONFIG_MAX_PIRQ_LINKS=4

#
# Southbridge
#
# CONFIG_AMD_SB_CIMX is not set
# CONFIG_SOUTHBRIDGE_AMD_CIMX_SB800 is not set
# CONFIG_SOUTHBRIDGE_AMD_CIMX_SB900 is not set
CONFIG_SOUTHBRIDGE_INTEL_COMMON=y
# CONFIG_LOCK_DOWN_BIOS is not set
CONFIG_SOUTHBRIDGE_INTEL_I82801IX=y

#
# Super I/O
#
CONFIG_SUPERIO_NSC_PC87382=y

#
# Embedded Controllers
#
CONFIG_EC_ACPI=y
CONFIG_EC_LENOVO_H8=y
CONFIG_EC_LENOVO_PMH7=y
# CONFIG_MAINBOARD_HAS_CHROMEOS is not set
# CONFIG_ARCH_ARM is not set
# CONFIG_ARCH_BOOTBLOCK_ARM is not set
# CONFIG_ARCH_VERSTAGE_ARM is not set
# CONFIG_ARCH_ROMSTAGE_ARM is not set
# CONFIG_ARCH_RAMSTAGE_ARM is not set
# CONFIG_ARCH_BOOTBLOCK_ARMV4 is not set
# CONFIG_ARCH_VERSTAGE_ARMV4 is not set
# CONFIG_ARCH_ROMSTAGE_ARMV4 is not set
# CONFIG_ARCH_RAMSTAGE_ARMV4 is not set
# CONFIG_ARCH_BOOTBLOCK_ARMV7 is not set
# CONFIG_ARCH_VERSTAGE_ARMV7 is not set
# CONFIG_ARCH_ROMSTAGE_ARMV7 is not set
# CONFIG_ARCH_RAMSTAGE_ARMV7 is not set
# CONFIG_ARCH_BOOTBLOCK_ARMV7_M is not set
# CONFIG_ARCH_VERSTAGE_ARMV7_M is not set
# CONFIG_ARM_BOOTBLOCK_CUSTOM is not set
# CONFIG_ARM_LPAE is not set
# CONFIG_ARCH_ARM64 is not set
# CONFIG_ARCH_BOOTBLOCK_ARM64 is not set
# CONFIG_ARCH_VERSTAGE_ARM64 is not set
# CONFIG_ARCH_ROMSTAGE_ARM64 is not set
# CONFIG_ARCH_RAMSTAGE_ARM64 is not set
# CONFIG_ARCH_BOOTBLOCK_ARMV8_64 is not set
# CONFIG_ARCH_VERSTAGE_ARMV8_64 is not set
# CONFIG_ARCH_ROMSTAGE_ARMV8_64 is not set
# CONFIG_ARCH_RAMSTAGE_ARMV8_64 is not set
# CONFIG_ARM64_BOOTBLOCK_CUSTOM is not set
# CONFIG_ARCH_MIPS is not set
# CONFIG_ARCH_BOOTBLOCK_MIPS is not set
# CONFIG_ARCH_VERSTAGE_MIPS is not set
# CONFIG_ARCH_ROMSTAGE_MIPS is not set
# CONFIG_ARCH_RAMSTAGE_MIPS is not set
# CONFIG_ARCH_RISCV is not set
# CONFIG_ARCH_BOOTBLOCK_RISCV is not set
# CONFIG_ARCH_VERSTAGE_RISCV is not set
# CONFIG_ARCH_ROMSTAGE_RISCV is not set
# CONFIG_ARCH_RAMSTAGE_RISCV is not set
# CONFIG_RISCV_BOOTBLOCK_CUSTOM is not set
CONFIG_ARCH_X86=y
CONFIG_ARCH_BOOTBLOCK_X86_32=y
CONFIG_ARCH_VERSTAGE_X86_32=y
CONFIG_ARCH_ROMSTAGE_X86_32=y
CONFIG_ARCH_RAMSTAGE_X86_32=y
# CONFIG_ARCH_BOOTBLOCK_X86_64 is not set
# CONFIG_ARCH_VERSTAGE_X86_64 is not set
# CONFIG_ARCH_ROMSTAGE_X86_64 is not set
# CONFIG_ARCH_RAMSTAGE_X86_64 is not set
# CONFIG_AP_IN_SIPI_WAIT is not set
# CONFIG_SIPI_VECTOR_IN_ROM is not set
# CONFIG_ROMCC is not set
# CONFIG_LATE_CBMEM_INIT is not set
CONFIG_PC80_SYSTEM=y
CONFIG_HAVE_CMOS_DEFAULT=y
CONFIG_CMOS_DEFAULT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.default"
CONFIG_IOAPIC_INTERRUPTS_ON_FSB=y
# CONFIG_IOAPIC_INTERRUPTS_ON_APIC_SERIAL_BUS is not set
# CONFIG_COMPILE_IN_DSDT is not set

#
# Devices
#
CONFIG_MAINBOARD_HAS_NATIVE_VGA_INIT=y
CONFIG_NATIVE_VGA_INIT_USE_EDID=y
CONFIG_MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG=y
# CONFIG_VGA_ROM_RUN is not set
# CONFIG_ON_DEVICE_ROM_RUN is not set
# CONFIG_MULTIPLE_VGA_ADAPTERS is not set
# CONFIG_SPD_CACHE is not set
CONFIG_PCI=y
# CONFIG_HYPERTRANSPORT_PLUGIN_SUPPORT is not set
CONFIG_PCIX_PLUGIN_SUPPORT=y
CONFIG_PCIEXP_PLUGIN_SUPPORT=y
CONFIG_CARDBUS_PLUGIN_SUPPORT=y
# CONFIG_AZALIA_PLUGIN_SUPPORT is not set
# CONFIG_PCIEXP_COMMON_CLOCK is not set
# CONFIG_PCIEXP_ASPM is not set
# CONFIG_PCIEXP_CLK_PM is not set
# CONFIG_EARLY_PCI_BRIDGE is not set
# CONFIG_PCIEXP_L1_SUB_STATE is not set
CONFIG_SUBSYSTEM_VENDOR_ID=0x0000
CONFIG_SUBSYSTEM_DEVICE_ID=0x0000
# CONFIG_PXE_ROM is not set
# CONFIG_SOFTWARE_I2C is not set

#
# Display
#
# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set

#
# Generic Drivers
#
# CONFIG_DRIVERS_AS3722_RTC is not set
CONFIG_DRIVERS_GENERIC_IOAPIC=y
# CONFIG_GIC is not set
CONFIG_SMBIOS_PROVIDED_BY_MOBO=y
# CONFIG_DRIVERS_I2C_RTD2132 is not set
CONFIG_DRIVERS_ICS_954309=y
# CONFIG_INTEL_DP is not set
# CONFIG_INTEL_DDI is not set
CONFIG_INTEL_EDID=y
CONFIG_INTEL_INT15=y
CONFIG_INTEL_GMA_ACPI=y
# CONFIG_DRIVER_INTEL_I210 is not set
# CONFIG_IPMI_KCS is not set
CONFIG_DRIVERS_LENOVO_WACOM=y
# CONFIG_DIGITIZER_AUTODETECT is not set
CONFIG_DIGITIZER_PRESENT=y
# CONFIG_DIGITIZER_ABSENT is not set
# CONFIG_DRIVER_MAXIM_MAX77686 is not set
# CONFIG_DRIVER_PARADE_PS8625 is not set
CONFIG_DRIVERS_MC146818=y
# CONFIG_MAINBOARD_HAS_LPC_TPM is not set
# CONFIG_DRIVERS_RICOH_RCE822 is not set
# CONFIG_DRIVERS_SIL_3114 is not set
# CONFIG_SPI_FLASH is not set
# CONFIG_DRIVER_TI_TPS65090 is not set
# CONFIG_DRIVERS_TI_TPS65913 is not set
# CONFIG_DRIVERS_TI_TPS65913_RTC is not set
# CONFIG_DRIVERS_UART is not set
# CONFIG_DRIVERS_UART_8250IO is not set
CONFIG_NO_UART_ON_SUPERIO=y
# CONFIG_DRIVERS_UART_8250MEM is not set
# CONFIG_HAVE_UART_SPECIAL is not set
# CONFIG_DRIVERS_UART_OXPCIE is not set
# CONFIG_DRIVERS_UART_PL011 is not set
CONFIG_HAVE_USBDEBUG=y
CONFIG_HAVE_USBDEBUG_OPTIONS=y
CONFIG_USBDEBUG_IN_ROMSTAGE=y
CONFIG_USBDEBUG_DEFAULT_PORT=0
CONFIG_USBDEBUG_DONGLE_STD=y
# CONFIG_USBDEBUG_DONGLE_BEAGLEBONE is not set
# CONFIG_USBDEBUG_DONGLE_BEAGLEBONE_BLACK is not set
# CONFIG_USBDEBUG_DONGLE_FTDI_FT232H is not set
CONFIG_USBDEBUG_OPTIONAL_HUB_PORT=0
# CONFIG_DRIVER_XPOWERS_AXP209 is not set
CONFIG_RTC=y
# CONFIG_TPM is not set
CONFIG_STACK_SIZE=0x1000
CONFIG_MMCONF_SUPPORT_DEFAULT=y
CONFIG_MMCONF_SUPPORT=y
# CONFIG_BOOTMODE_STRAPS is not set

#
# Console
#
CONFIG_SQUELCH_EARLY_SMP=y
# CONFIG_SPKMODEM is not set
CONFIG_CONSOLE_USB=y
# CONFIG_CONSOLE_NE2K is not set
CONFIG_CONSOLE_CBMEM=y
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000
# CONFIG_CONSOLE_CBMEM_DUMP_TO_UART is not set
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=y
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_7 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_6 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_5 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_4 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_3 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_2 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_1 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_0 is not set
# CONFIG_NO_POST is not set
# CONFIG_CMOS_POST is not set
# CONFIG_CONSOLE_POST is not set
CONFIG_POST_DEVICE_NONE=y
# CONFIG_POST_DEVICE_LPC is not set
# CONFIG_POST_DEVICE_PCI_PCIE is not set
CONFIG_POST_IO_PORT=0x80
CONFIG_HAVE_ACPI_RESUME=y
CONFIG_HAVE_HARD_RESET=y
# CONFIG_HAVE_MONOTONIC_TIMER is not set
CONFIG_HAVE_OPTION_TABLE=y
# CONFIG_PIRQ_ROUTE is not set
CONFIG_HAVE_SMI_HANDLER=y
# CONFIG_PCI_IO_CFG_EXT is not set
CONFIG_IOAPIC=y
CONFIG_USE_WATCHDOG_ON_BOOT=y
CONFIG_VGA=y
# CONFIG_GFXUMA is not set
CONFIG_HAVE_ACPI_TABLES=y
CONFIG_HAVE_MP_TABLE=y
# CONFIG_COMMON_FADT is not set

#
# System tables
#
CONFIG_GENERATE_MP_TABLE=y
# CONFIG_GENERATE_PIRQ_TABLE is not set
CONFIG_GENERATE_SMBIOS_TABLES=y

#
# Payload
#
# CONFIG_PAYLOAD_NONE is not set
CONFIG_PAYLOAD_ELF=y
# CONFIG_PAYLOAD_FILO is not set
# CONFIG_PAYLOAD_GRUB2 is not set
# CONFIG_PAYLOAD_SEABIOS is not set
# CONFIG_PAYLOAD_LINUX is not set
# CONFIG_PAYLOAD_TIANOCORE is not set
CONFIG_PAYLOAD_FILE="grub.elf"
CONFIG_COMPRESSED_PAYLOAD_LZMA=y

#
# Debugging
#
# CONFIG_GDB_STUB is not set
# CONFIG_FATAL_ASSERTS is not set
# CONFIG_DEBUG_CBFS is not set
CONFIG_HAVE_DEBUG_RAM_SETUP=y
# CONFIG_DEBUG_RAM_SETUP is not set
# CONFIG_HAVE_DEBUG_CAR is not set
# CONFIG_HAVE_DEBUG_SMBUS is not set
# CONFIG_DEBUG_SMI is not set
# CONFIG_DEBUG_SMM_RELOCATION is not set
# CONFIG_DEBUG_MALLOC is not set
# CONFIG_DEBUG_ACPI is not set
# CONFIG_DEBUG_USBDEBUG is not set
# CONFIG_TRACE is not set
# CONFIG_ENABLE_APIC_EXT_ID is not set
CONFIG_WARNINGS_ARE_ERRORS=y
# CONFIG_POWER_BUTTON_DEFAULT_ENABLE is not set
# CONFIG_POWER_BUTTON_DEFAULT_DISABLE is not set
# CONFIG_POWER_BUTTON_FORCE_ENABLE is not set
# CONFIG_POWER_BUTTON_FORCE_DISABLE is not set
# CONFIG_POWER_BUTTON_IS_OPTIONAL is not set
# CONFIG_REG_SCRIPT is not set
CONFIG_MAX_REBOOT_CNT=3


code:
#
# Automatically generated file; DO NOT EDIT.
# coreboot configuration
#

#
# General setup
#
CONFIG_EXPERT=y
CONFIG_LOCALVERSION=""
CONFIG_CBFS_PREFIX="fallback"
CONFIG_COMPILER_GCC=y
# CONFIG_COMPILER_LLVM_CLANG is not set
# CONFIG_ANY_TOOLCHAIN is not set
# CONFIG_CCACHE is not set
# CONFIG_FMD_GENPARSER is not set
# CONFIG_SCONFIG_GENPARSER is not set
CONFIG_USE_OPTION_TABLE=y
# CONFIG_STATIC_OPTION_TABLE is not set
# CONFIG_UNCOMPRESSED_RAMSTAGE is not set
CONFIG_COMPRESS_RAMSTAGE=y
CONFIG_INCLUDE_CONFIG_FILE=y
CONFIG_EARLY_CBMEM_INIT=y
# CONFIG_COLLECT_TIMESTAMPS is not set
# CONFIG_USE_BLOBS is not set
# CONFIG_COVERAGE is not set
# CONFIG_RELOCATABLE_MODULES is not set
# CONFIG_RELOCATABLE_RAMSTAGE is not set
CONFIG_FLASHMAP_OFFSET=0x0
CONFIG_BOOTBLOCK_SIMPLE=y
# CONFIG_BOOTBLOCK_NORMAL is not set
CONFIG_BOOTBLOCK_SOURCE="bootblock_simple.c"
# CONFIG_SKIP_MAX_REBOOT_CNT_CLEAR is not set
# CONFIG_UPDATE_IMAGE is not set
# CONFIG_GENERIC_GPIO_LIB is not set
# CONFIG_BOARD_ID_AUTO is not set
# CONFIG_BOARD_ID_MANUAL is not set
# CONFIG_RAM_CODE_SUPPORT is not set
# CONFIG_ACPI_SATA_GENERATOR is not set

#
# Mainboard
#
# CONFIG_VENDOR_A_TREND is not set
# CONFIG_VENDOR_AAEON is not set
# CONFIG_VENDOR_ABIT is not set
# CONFIG_VENDOR_ADLINK is not set
# CONFIG_VENDOR_ADVANSUS is not set
# CONFIG_VENDOR_AMD is not set
# CONFIG_VENDOR_AOPEN is not set
# CONFIG_VENDOR_APPLE is not set
# CONFIG_VENDOR_ARIMA is not set
# CONFIG_VENDOR_ARTECGROUP is not set
# CONFIG_VENDOR_ASROCK is not set
# CONFIG_VENDOR_ASUS is not set
# CONFIG_VENDOR_AVALUE is not set
# CONFIG_VENDOR_AZZA is not set
# CONFIG_VENDOR_BACHMANN is not set
# CONFIG_VENDOR_BAP is not set
# CONFIG_VENDOR_BCOM is not set
# CONFIG_VENDOR_BIFFEROS is not set
# CONFIG_VENDOR_BIOSTAR is not set
# CONFIG_VENDOR_BROADCOM is not set
# CONFIG_VENDOR_COMPAQ is not set
# CONFIG_VENDOR_CUBIETECH is not set
# CONFIG_VENDOR_DIGITALLOGIC is not set
# CONFIG_VENDOR_DMP is not set
# CONFIG_VENDOR_ECS is not set
# CONFIG_VENDOR_EMULATION is not set
# CONFIG_VENDOR_GETAC is not set
# CONFIG_VENDOR_GIGABYTE is not set
# CONFIG_VENDOR_GIZMOSPHERE is not set
# CONFIG_VENDOR_GOOGLE is not set
# CONFIG_VENDOR_HP is not set
# CONFIG_VENDOR_IBASE is not set
# CONFIG_VENDOR_IBM is not set
# CONFIG_VENDOR_IEI is not set
# CONFIG_VENDOR_INTEL is not set
# CONFIG_VENDOR_IWAVE is not set
# CONFIG_VENDOR_IWILL is not set
# CONFIG_VENDOR_JETWAY is not set
# CONFIG_VENDOR_KONTRON is not set
# CONFIG_VENDOR_LANNER is not set
CONFIG_VENDOR_LENOVO=y
# CONFIG_VENDOR_LINUTOP is not set
# CONFIG_VENDOR_LIPPERT is not set
# CONFIG_VENDOR_MITAC is not set
# CONFIG_VENDOR_MSI is not set
# CONFIG_VENDOR_NEC is not set
# CONFIG_VENDOR_NEWISYS is not set
# CONFIG_VENDOR_NOKIA is not set
# CONFIG_VENDOR_NVIDIA is not set
# CONFIG_VENDOR_PACKARDBELL is not set
# CONFIG_VENDOR_PCENGINES is not set
# CONFIG_VENDOR_RCA is not set
# CONFIG_VENDOR_RODA is not set
# CONFIG_VENDOR_SAMSUNG is not set
# CONFIG_VENDOR_SIEMENS is not set
# CONFIG_VENDOR_SOYO is not set
# CONFIG_VENDOR_SUNW is not set
# CONFIG_VENDOR_SUPERMICRO is not set
# CONFIG_VENDOR_TECHNEXION is not set
# CONFIG_VENDOR_THOMSON is not set
# CONFIG_VENDOR_TI is not set
# CONFIG_VENDOR_TRAVERSE is not set
# CONFIG_VENDOR_TYAN is not set
# CONFIG_VENDOR_VIA is not set
# CONFIG_VENDOR_WINENT is not set
# CONFIG_VENDOR_WYSE is not set
CONFIG_BOARD_SPECIFIC_OPTIONS=y
CONFIG_MAINBOARD_DIR="lenovo/x60"
CONFIG_MAINBOARD_PART_NUMBER="ThinkPad X60"
CONFIG_IRQ_SLOT_COUNT=18
CONFIG_MAINBOARD_VENDOR="LENOVO"
CONFIG_MAX_CPUS=2
CONFIG_VGA_BIOS_ID="8086,27a2"
# CONFIG_ONBOARD_VGA_IS_PRIMARY is not set
# CONFIG_VGA_BIOS is not set
# CONFIG_UDELAY_IO is not set
CONFIG_DCACHE_RAM_BASE=0xffdf8000
CONFIG_DCACHE_RAM_SIZE=0x8000
CONFIG_MMCONF_BASE_ADDRESS=0xf0000000
CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT=y
CONFIG_UART_FOR_CONSOLE=0
CONFIG_ID_SECTION_OFFSET=0x80
CONFIG_RAMTOP=0x200000
CONFIG_USBDEBUG_HCD_INDEX=0
CONFIG_TTYS0_LCS=3
CONFIG_CACHE_ROM_SIZE_OVERRIDE=0
CONFIG_CBFS_SIZE=0x200000
CONFIG_POST_IO=y
CONFIG_POST_DEVICE=y
# CONFIG_BOARD_LENOVO_G505S is not set
# CONFIG_BOARD_LENOVO_R400 is not set
# CONFIG_BOARD_LENOVO_T400 is not set
# CONFIG_BOARD_LENOVO_T420S is not set
# CONFIG_BOARD_LENOVO_T430S is not set
# CONFIG_BOARD_LENOVO_T500 is not set
# CONFIG_BOARD_LENOVO_T520 is not set
# CONFIG_BOARD_LENOVO_T530 is not set
# CONFIG_BOARD_LENOVO_T60 is not set
# CONFIG_BOARD_LENOVO_X200 is not set
# CONFIG_BOARD_LENOVO_X201 is not set
# CONFIG_BOARD_LENOVO_X220 is not set
# CONFIG_BOARD_LENOVO_X230 is not set
CONFIG_BOARD_LENOVO_X60=y
CONFIG_SEABIOS_PS2_TIMEOUT=3000
CONFIG_CPU_ADDR_BITS=36
CONFIG_DEFAULT_CONSOLE_LOGLEVEL=8
CONFIG_USBDEBUG=y
CONFIG_DRIVERS_PS2_KEYBOARD=y
CONFIG_MAXIMUM_SUPPORTED_FREQUENCY=0
CONFIG_BOARD_ROMSIZE_KB_2048=y
# CONFIG_COREBOOT_ROMSIZE_KB_64 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_128 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_256 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_512 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_1024 is not set
CONFIG_COREBOOT_ROMSIZE_KB_2048=y
# CONFIG_COREBOOT_ROMSIZE_KB_4096 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_8192 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_12288 is not set
# CONFIG_COREBOOT_ROMSIZE_KB_16384 is not set
CONFIG_COREBOOT_ROMSIZE_KB=2048
CONFIG_ROM_SIZE=0x200000
CONFIG_SYSTEM_TYPE_LAPTOP=y

#
# Chipset
#

#
# SoC
#
# CONFIG_SOC_BROADCOM_CYGNUS is not set
CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT="northbridge/intel/i945/bootblock.c"
CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT="southbridge/intel/i82801gx/bootblock.c"
CONFIG_TTYS0_BASE=0x3f8
CONFIG_EHCI_BAR=0xfef00000
CONFIG_HEAP_SIZE=0x4000
# CONFIG_SOC_MARVELL_BG4CD is not set
# CONFIG_SOC_NVIDIA_TEGRA124 is not set
# CONFIG_SOC_NVIDIA_TEGRA132 is not set
# CONFIG_SOC_NVIDIA_TEGRA210 is not set
# CONFIG_SOC_QC_IPQ806X is not set
# CONFIG_SOC_ROCKCHIP_RK3288 is not set
# CONFIG_CPU_SAMSUNG_EXYNOS5250 is not set
# CONFIG_CPU_SAMSUNG_EXYNOS5420 is not set
# CONFIG_SOC_UCB_RISCV is not set

#
# CPU
#
# CONFIG_CPU_ALLWINNER_A10 is not set
CONFIG_SOCKET_SPECIFIC_OPTIONS=y
CONFIG_XIP_ROM_SIZE=0x10000
CONFIG_NUM_IPI_STARTS=2
# CONFIG_CPU_AMD_AGESA is not set
# CONFIG_CPU_AMD_PI is not set
# CONFIG_CPU_ARMLTD_CORTEX_A9 is not set
CONFIG_CPU_INTEL_MODEL_6EX=y
CONFIG_CPU_INTEL_MODEL_6FX=y
CONFIG_CPU_INTEL_SOCKET_MFCPGA478=y
CONFIG_SSE2=y
# CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE is not set
# CONFIG_CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED is not set
# CONFIG_CPU_TI_AM335X is not set
# CONFIG_PARALLEL_CPU_INIT is not set
CONFIG_UDELAY_LAPIC=y
CONFIG_LAPIC_MONOTONIC_TIMER=y
# CONFIG_UDELAY_TSC is not set
# CONFIG_UDELAY_TIMER2 is not set
# CONFIG_TSC_CALIBRATE_WITH_IO is not set
# CONFIG_TSC_SYNC_LFENCE is not set
CONFIG_TSC_SYNC_MFENCE=y
CONFIG_LOGICAL_CPUS=y
# CONFIG_SMM_TSEG is not set
# CONFIG_X86_AMD_FIXED_MTRRS is not set
# CONFIG_PLATFORM_USES_FSP1_0 is not set
# CONFIG_PARALLEL_MP is not set
# CONFIG_BACKUP_DEFAULT_SMM_REGION is not set
# CONFIG_MIRROR_PAYLOAD_TO_RAM_BEFORE_LOADING is not set
CONFIG_CACHE_AS_RAM=y
CONFIG_SMP=y
CONFIG_AP_SIPI_VECTOR=0xfffff000
CONFIG_MMX=y
CONFIG_SSE=y
CONFIG_SUPPORT_CPU_UCODE_IN_CBFS=y
# CONFIG_CPU_MICROCODE_CBFS_GENERATE is not set
# CONFIG_CPU_MICROCODE_CBFS_EXTERNAL is not set
CONFIG_CPU_MICROCODE_CBFS_NONE=y

#
# Northbridge
#
# CONFIG_NORTHBRIDGE_AMD_AGESA is not set
# CONFIG_AMD_NB_CIMX is not set
# CONFIG_NORTHBRIDGE_AMD_CIMX_RD890 is not set
CONFIG_VIDEO_MB=0
# CONFIG_NORTHBRIDGE_AMD_PI is not set
CONFIG_RAMBASE=0x100000
CONFIG_NORTHBRIDGE_SPECIFIC_OPTIONS=y
CONFIG_NORTHBRIDGE_INTEL_I945=y
# CONFIG_NORTHBRIDGE_INTEL_SUBTYPE_I945GC is not set
CONFIG_NORTHBRIDGE_INTEL_SUBTYPE_I945GM=y
CONFIG_CHANNEL_XOR_RANDOMIZATION=y
# CONFIG_OVERRIDE_CLOCK_DISABLE is not set
# CONFIG_CHECK_SLFRCS_ON_RESUME is not set
CONFIG_HPET_ADDRESS=0xfed00000
CONFIG_HPET_MIN_TICKS=0x80
CONFIG_MAX_PIRQ_LINKS=4

#
# Southbridge
#
# CONFIG_AMD_SB_CIMX is not set
# CONFIG_SOUTHBRIDGE_AMD_CIMX_SB800 is not set
# CONFIG_SOUTHBRIDGE_AMD_CIMX_SB900 is not set
CONFIG_SOUTHBRIDGE_INTEL_COMMON=y
# CONFIG_LOCK_DOWN_BIOS is not set
CONFIG_SOUTHBRIDGE_INTEL_I82801GX=y
CONFIG_SOUTHBRIDGE_RICOH_RL5C476=y

#
# Super I/O
#
CONFIG_SUPERIO_NSC_PC87382=y
CONFIG_SUPERIO_NSC_PC87392=y

#
# Embedded Controllers
#
CONFIG_EC_ACPI=y
CONFIG_EC_LENOVO_H8=y
CONFIG_H8_DOCK_EARLY_INIT=y
CONFIG_EC_LENOVO_PMH7=y
# CONFIG_MAINBOARD_HAS_CHROMEOS is not set
# CONFIG_ARCH_ARM is not set
# CONFIG_ARCH_BOOTBLOCK_ARM is not set
# CONFIG_ARCH_VERSTAGE_ARM is not set
# CONFIG_ARCH_ROMSTAGE_ARM is not set
# CONFIG_ARCH_RAMSTAGE_ARM is not set
# CONFIG_ARCH_BOOTBLOCK_ARMV4 is not set
# CONFIG_ARCH_VERSTAGE_ARMV4 is not set
# CONFIG_ARCH_ROMSTAGE_ARMV4 is not set
# CONFIG_ARCH_RAMSTAGE_ARMV4 is not set
# CONFIG_ARCH_BOOTBLOCK_ARMV7 is not set
# CONFIG_ARCH_VERSTAGE_ARMV7 is not set
# CONFIG_ARCH_ROMSTAGE_ARMV7 is not set
# CONFIG_ARCH_RAMSTAGE_ARMV7 is not set
# CONFIG_ARCH_BOOTBLOCK_ARMV7_M is not set
# CONFIG_ARCH_VERSTAGE_ARMV7_M is not set
# CONFIG_ARM_BOOTBLOCK_CUSTOM is not set
# CONFIG_ARM_LPAE is not set
# CONFIG_ARCH_ARM64 is not set
# CONFIG_ARCH_BOOTBLOCK_ARM64 is not set
# CONFIG_ARCH_VERSTAGE_ARM64 is not set
# CONFIG_ARCH_ROMSTAGE_ARM64 is not set
# CONFIG_ARCH_RAMSTAGE_ARM64 is not set
# CONFIG_ARCH_BOOTBLOCK_ARMV8_64 is not set
# CONFIG_ARCH_VERSTAGE_ARMV8_64 is not set
# CONFIG_ARCH_ROMSTAGE_ARMV8_64 is not set
# CONFIG_ARCH_RAMSTAGE_ARMV8_64 is not set
# CONFIG_ARM64_BOOTBLOCK_CUSTOM is not set
# CONFIG_ARCH_MIPS is not set
# CONFIG_ARCH_BOOTBLOCK_MIPS is not set
# CONFIG_ARCH_VERSTAGE_MIPS is not set
# CONFIG_ARCH_ROMSTAGE_MIPS is not set
# CONFIG_ARCH_RAMSTAGE_MIPS is not set
# CONFIG_ARCH_RISCV is not set
# CONFIG_ARCH_BOOTBLOCK_RISCV is not set
# CONFIG_ARCH_VERSTAGE_RISCV is not set
# CONFIG_ARCH_ROMSTAGE_RISCV is not set
# CONFIG_ARCH_RAMSTAGE_RISCV is not set
# CONFIG_RISCV_BOOTBLOCK_CUSTOM is not set
CONFIG_ARCH_X86=y
CONFIG_ARCH_BOOTBLOCK_X86_32=y
CONFIG_ARCH_VERSTAGE_X86_32=y
CONFIG_ARCH_ROMSTAGE_X86_32=y
CONFIG_ARCH_RAMSTAGE_X86_32=y
# CONFIG_ARCH_BOOTBLOCK_X86_64 is not set
# CONFIG_ARCH_VERSTAGE_X86_64 is not set
# CONFIG_ARCH_ROMSTAGE_X86_64 is not set
# CONFIG_ARCH_RAMSTAGE_X86_64 is not set
CONFIG_AP_IN_SIPI_WAIT=y
# CONFIG_SIPI_VECTOR_IN_ROM is not set
# CONFIG_ROMCC is not set
# CONFIG_LATE_CBMEM_INIT is not set
CONFIG_PC80_SYSTEM=y
CONFIG_HAVE_CMOS_DEFAULT=y
CONFIG_CMOS_DEFAULT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.default"
CONFIG_IOAPIC_INTERRUPTS_ON_FSB=y
# CONFIG_IOAPIC_INTERRUPTS_ON_APIC_SERIAL_BUS is not set
# CONFIG_COMPILE_IN_DSDT is not set

#
# Devices
#
CONFIG_MAINBOARD_HAS_NATIVE_VGA_INIT=y
CONFIG_NATIVE_VGA_INIT_USE_EDID=y
CONFIG_MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG=y
# CONFIG_VGA_ROM_RUN is not set
# CONFIG_ON_DEVICE_ROM_RUN is not set
# CONFIG_MULTIPLE_VGA_ADAPTERS is not set
# CONFIG_SPD_CACHE is not set
CONFIG_PCI=y
# CONFIG_HYPERTRANSPORT_PLUGIN_SUPPORT is not set
CONFIG_PCIX_PLUGIN_SUPPORT=y
CONFIG_PCIEXP_PLUGIN_SUPPORT=y
CONFIG_CARDBUS_PLUGIN_SUPPORT=y
# CONFIG_AZALIA_PLUGIN_SUPPORT is not set
# CONFIG_PCIEXP_COMMON_CLOCK is not set
# CONFIG_PCIEXP_ASPM is not set
# CONFIG_PCIEXP_CLK_PM is not set
# CONFIG_EARLY_PCI_BRIDGE is not set
# CONFIG_PCIEXP_L1_SUB_STATE is not set
CONFIG_SUBSYSTEM_VENDOR_ID=0x0000
CONFIG_SUBSYSTEM_DEVICE_ID=0x0000
# CONFIG_PXE_ROM is not set
# CONFIG_SOFTWARE_I2C is not set

#
# Display
#
# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set

#
# Generic Drivers
#
# CONFIG_DRIVERS_AS3722_RTC is not set
# CONFIG_GIC is not set
CONFIG_SMBIOS_PROVIDED_BY_MOBO=y
# CONFIG_DRIVERS_I2C_RTD2132 is not set
CONFIG_DRIVERS_ICS_954309=y
# CONFIG_INTEL_DP is not set
# CONFIG_INTEL_DDI is not set
CONFIG_INTEL_EDID=y
CONFIG_INTEL_INT15=y
CONFIG_INTEL_GMA_ACPI=y
# CONFIG_DRIVER_INTEL_I210 is not set
# CONFIG_IPMI_KCS is not set
CONFIG_DRIVERS_LENOVO_WACOM=y
# CONFIG_DIGITIZER_AUTODETECT is not set
CONFIG_DIGITIZER_PRESENT=y
# CONFIG_DIGITIZER_ABSENT is not set
# CONFIG_DRIVER_MAXIM_MAX77686 is not set
# CONFIG_DRIVER_PARADE_PS8625 is not set
CONFIG_DRIVERS_MC146818=y
# CONFIG_MAINBOARD_HAS_LPC_TPM is not set
# CONFIG_DRIVERS_RICOH_RCE822 is not set
# CONFIG_DRIVERS_SIL_3114 is not set
# CONFIG_SPI_FLASH is not set
# CONFIG_DRIVER_TI_TPS65090 is not set
# CONFIG_DRIVERS_TI_TPS65913 is not set
# CONFIG_DRIVERS_TI_TPS65913_RTC is not set
CONFIG_DRIVERS_UART=y
CONFIG_DRIVERS_UART_8250IO=y
# CONFIG_NO_UART_ON_SUPERIO is not set
# CONFIG_DRIVERS_UART_8250MEM is not set
# CONFIG_HAVE_UART_SPECIAL is not set
# CONFIG_DRIVERS_UART_OXPCIE is not set
# CONFIG_DRIVERS_UART_PL011 is not set
CONFIG_HAVE_USBDEBUG=y
# CONFIG_HAVE_USBDEBUG_OPTIONS is not set
CONFIG_USBDEBUG_IN_ROMSTAGE=y
CONFIG_USBDEBUG_DEFAULT_PORT=0
CONFIG_USBDEBUG_DONGLE_STD=y
# CONFIG_USBDEBUG_DONGLE_BEAGLEBONE is not set
# CONFIG_USBDEBUG_DONGLE_BEAGLEBONE_BLACK is not set
# CONFIG_USBDEBUG_DONGLE_FTDI_FT232H is not set
CONFIG_USBDEBUG_OPTIONAL_HUB_PORT=0
# CONFIG_DRIVER_XPOWERS_AXP209 is not set
CONFIG_RTC=y
# CONFIG_TPM is not set
CONFIG_STACK_SIZE=0x1000
CONFIG_MMCONF_SUPPORT_DEFAULT=y
CONFIG_MMCONF_SUPPORT=y
# CONFIG_BOOTMODE_STRAPS is not set

#
# Console
#
CONFIG_SQUELCH_EARLY_SMP=y
CONFIG_CONSOLE_SERIAL=y

#
# I/O mapped, 8250-compatible
#
CONFIG_CONSOLE_SERIAL_115200=y
# CONFIG_CONSOLE_SERIAL_57600 is not set
# CONFIG_CONSOLE_SERIAL_38400 is not set
# CONFIG_CONSOLE_SERIAL_19200 is not set
# CONFIG_CONSOLE_SERIAL_9600 is not set
CONFIG_TTYS0_BAUD=115200
# CONFIG_SPKMODEM is not set
CONFIG_CONSOLE_USB=y
# CONFIG_CONSOLE_NE2K is not set
CONFIG_CONSOLE_CBMEM=y
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=y
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_7 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_6 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_5 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_4 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_3 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_2 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_1 is not set
# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_0 is not set
# CONFIG_NO_POST is not set
# CONFIG_CMOS_POST is not set
# CONFIG_CONSOLE_POST is not set
CONFIG_POST_DEVICE_NONE=y
# CONFIG_POST_DEVICE_LPC is not set
# CONFIG_POST_DEVICE_PCI_PCIE is not set
CONFIG_POST_IO_PORT=0x80
CONFIG_HAVE_ACPI_RESUME=y
CONFIG_HAVE_HARD_RESET=y
CONFIG_HAVE_MONOTONIC_TIMER=y
# CONFIG_GENERIC_UDELAY is not set
# CONFIG_TIMER_QUEUE is not set
CONFIG_HAVE_OPTION_TABLE=y
# CONFIG_PIRQ_ROUTE is not set
CONFIG_HAVE_SMI_HANDLER=y
# CONFIG_PCI_IO_CFG_EXT is not set
CONFIG_IOAPIC=y
CONFIG_USE_WATCHDOG_ON_BOOT=y
CONFIG_VGA=y
# CONFIG_GFXUMA is not set
CONFIG_HAVE_ACPI_TABLES=y
CONFIG_HAVE_MP_TABLE=y
CONFIG_HAVE_PIRQ_TABLE=y
CONFIG_COMMON_FADT=y

#
# System tables
#
CONFIG_GENERATE_MP_TABLE=y
CONFIG_GENERATE_PIRQ_TABLE=y
CONFIG_GENERATE_SMBIOS_TABLES=y

#
# Payload
#
# CONFIG_PAYLOAD_NONE is not set
CONFIG_PAYLOAD_ELF=y
# CONFIG_PAYLOAD_FILO is not set
# CONFIG_PAYLOAD_GRUB2 is not set
# CONFIG_PAYLOAD_SEABIOS is not set
# CONFIG_PAYLOAD_LINUX is not set
# CONFIG_PAYLOAD_TIANOCORE is not set
CONFIG_PAYLOAD_FILE="grub.elf"
CONFIG_COMPRESSED_PAYLOAD_LZMA=y

#
# Debugging
#
# CONFIG_GDB_STUB is not set
# CONFIG_FATAL_ASSERTS is not set
# CONFIG_DEBUG_CBFS is not set
CONFIG_HAVE_DEBUG_RAM_SETUP=y
# CONFIG_DEBUG_RAM_SETUP is not set
# CONFIG_HAVE_DEBUG_CAR is not set
# CONFIG_DEBUG_PIRQ is not set
# CONFIG_HAVE_DEBUG_SMBUS is not set
# CONFIG_DEBUG_SMI is not set
# CONFIG_DEBUG_SMM_RELOCATION is not set
# CONFIG_DEBUG_MALLOC is not set
# CONFIG_DEBUG_ACPI is not set
# CONFIG_DEBUG_USBDEBUG is not set
# CONFIG_TRACE is not set
# CONFIG_ENABLE_APIC_EXT_ID is not set
CONFIG_WARNINGS_ARE_ERRORS=y
# CONFIG_POWER_BUTTON_DEFAULT_ENABLE is not set
# CONFIG_POWER_BUTTON_DEFAULT_DISABLE is not set
# CONFIG_POWER_BUTTON_FORCE_ENABLE is not set
# CONFIG_POWER_BUTTON_FORCE_DISABLE is not set
# CONFIG_POWER_BUTTON_IS_OPTIONAL is not set
# CONFIG_REG_SCRIPT is not set
CONFIG_MAX_REBOOT_CNT=3

repo_name: Amlouden/libreboot

license: mit


code:
From 60b17a1eee72342ff226761caea2501960d44a30 Mon Sep 17 00:00:00 2001
From: Timothy Pearson <tpearson@raptorengineeringinc.com>
Date: Tue, 7 Apr 2015 13:45:06 -0500
Subject: [PATCH 01/13] southbridge/intel/common/spi: Add Flash lockdown option

Under certain circumstances it is desirable to prevent
software from altering the contents of the Flash device.

This Expert-mode option allows the hardware write protect
to be set on bootup.

Change-Id: I92d3c60a69f1688579d954d0476e30a6892cf4d5
Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
---
 src/southbridge/intel/common/Kconfig |  9 +++++++++
 src/southbridge/intel/common/spi.c   | 20 ++++++++++++++------
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/src/southbridge/intel/common/Kconfig b/src/southbridge/intel/common/Kconfig
index 949310b..52ada30 100644
--- a/src/southbridge/intel/common/Kconfig
+++ b/src/southbridge/intel/common/Kconfig
@@ -1,2 +1,11 @@
 config SOUTHBRIDGE_INTEL_COMMON
 	def_bool n
+
+config LOCK_DOWN_BIOS
+	bool "Lock down the Flash"
+	default n
+	depends on EXPERT
+	help
+	  Lock down the Flash chip to prevent further modification by software.
+	  WARNING: Altering the contents of the Flash chip further WILL require
+	  a hardware programmer AND physical access to the Flash device!
\ No newline at end of file
diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c
index 1d3ebf6..04f05ed 100644
--- a/src/southbridge/intel/common/spi.c
+++ b/src/southbridge/intel/common/spi.c
@@ -2,6 +2,7 @@
  * Copyright (c) 2011 The Chromium OS Authors.
  * Copyright (C) 2009, 2010 Carl-Daniel Hailfinger
  * Copyright (C) 2011 Stefan Tauner
+ * Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -353,11 +354,19 @@ void spi_init(void)

 	ich_set_bbar(0);

-	/* Disable the BIOS write protect so write commands are allowed. */
-	pci_read_config_byte(dev, 0xdc, &bios_cntl);
-	/* Deassert SMM BIOS Write Protect Disable. */
-	bios_cntl &= ~(1 << 5);
-	pci_write_config_byte(dev, 0xdc, bios_cntl | 0x1);
+	if (IS_ENABLED(CONFIG_LOCK_DOWN_BIOS)) {
+		/* Engage lockdown */
+		hsfs = readw_(&ich9_spi->hsfs);
+		hsfs = hsfs | HSFS_FLOCKDN;
+		writew_(hsfs, &ich9_spi->hsfs);
+	}
+	else {
+		/* Disable the BIOS write protect so write commands are allowed. */
+		pci_read_config_byte(dev, 0xdc, &bios_cntl);
+		/* Deassert SMM BIOS Write Protect Disable. */
+		bios_cntl &= ~(1 << 5);
+		pci_write_config_byte(dev, 0xdc, bios_cntl | 0x1);
+	}
 }
 #ifndef __SMM__
 static void spi_init_cb(void *unused)
@@ -927,7 +936,6 @@ static int ich_hwseq_write(struct spi_flash *flash,
 	return 0;
 }

-
 static struct spi_flash *spi_flash_hwseq(struct spi_slave *spi)
 {
 	struct spi_flash *flash = NULL;
--
1.9.1


code:
From 26cfb399e15e9e2afa311bcd7774926a07c545c1 Mon Sep 17 00:00:00 2001
From: Timothy Pearson <tpearson@raptorengineeringinc.com>
Date: Sun, 5 Apr 2015 18:10:09 -0500
Subject: [PATCH 02/13] mainboard/lenovo/t400: Add initial hybrid graphics
 support

TEST: Booted T400 with Intel/ATI hybrid graphics in integrated
mode with native Intel graphics init and verified integrated
panel framebuffer functionality in SeaBIOS and Linux.

Change-Id: I37e72c5dad0d7ab3915cc3d439ae9a4a9b3787e3
Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
---
 src/mainboard/lenovo/t400/cmos.default |   1 +
 src/mainboard/lenovo/t400/cmos.layout  |   8 +-
 src/mainboard/lenovo/t400/romstage.c   | 143 +++++++++++++++++++++++++++++++++
 3 files changed, 151 insertions(+), 1 deletion(-)

diff --git a/src/mainboard/lenovo/t400/cmos.default b/src/mainboard/lenovo/t400/cmos.default
index 67b8920..06eec57 100644
--- a/src/mainboard/lenovo/t400/cmos.default
+++ b/src/mainboard/lenovo/t400/cmos.default
@@ -14,3 +14,4 @@ sticky_fn=Disable
 power_management_beeps=Enable
 low_battery_beep=Enable
 sata_mode=AHCI
+hybrid_graphics_mode=Integrated Only
\ No newline at end of file
diff --git a/src/mainboard/lenovo/t400/cmos.layout b/src/mainboard/lenovo/t400/cmos.layout
index 2dc91bf..44f5d04 100644
--- a/src/mainboard/lenovo/t400/cmos.layout
+++ b/src/mainboard/lenovo/t400/cmos.layout
@@ -85,7 +85,10 @@ entries
 # coreboot config options: northbridge
 941         3       e       11       gfx_uma_size

-#944          2       r       0        unused
+# coreboot config options: graphics
+944         2       e       12       hybrid_graphics_mode
+
+#946          2       r       0        unused

 # coreboot config options: check sums
 984          16       h       0        check_sum
@@ -137,6 +140,9 @@ enumerations
 11    3     128M
 11    5     96M
 11    6     160M
+12    0     Integrated Only
+12    1     Discrete Only
+12    2     Switchable

 # -----------------------------------------------------------------
 checksums
diff --git a/src/mainboard/lenovo/t400/romstage.c b/src/mainboard/lenovo/t400/romstage.c
index a739d18..c62df60 100644
--- a/src/mainboard/lenovo/t400/romstage.c
+++ b/src/mainboard/lenovo/t400/romstage.c
@@ -1,6 +1,7 @@
 /*
  * This file is part of the coreboot project.
  *
+ * Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering
  * Copyright (C) 2012 secunet Security Networks AG
  *
  * This program is free software; you can redistribute it and/or
@@ -37,6 +38,118 @@
 #define LPC_DEV PCI_DEV(0, 0x1f, 0)
 #define MCH_DEV PCI_DEV(0, 0, 0)

+#define HYBRID_GRAPHICS_INTEGRATED_ONLY 0
+#define HYBRID_GRAPHICS_DISCRETE_ONLY 1
+#define HYBRID_GRAPHICS_SWITCHABLE 2
+
+#define HYBRID_GRAPHICS_GP_LVL_BITS 0x004a0000
+#define HYBRID_GRAPHICS_GP_LVL2_BITS 0x00020000
+
+#define HYBRID_GRAPHICS_DETECT_GP_BITS 0x00000010
+
+#define HYBRID_GRAPHICS_INT_CLAIM_VGA 0x2
+#define HYBRID_GRAPHICS_SEC_VGA_EN 0x2
+
+static void hybrid_graphics_configure_switchable_graphics(bool enable)
+{
+	uint32_t tmp;
+
+	if (enable) {
+		/* Disable integrated graphics legacy VGA cycles */
+		tmp = pci_read_config16(MCH_DEV, D0F0_GGC);
+		pci_write_config16(MCH_DEV, D0F0_GGC, tmp | HYBRID_GRAPHICS_INT_CLAIM_VGA);
+
+		/* Enable secondary VGA controller */
+		tmp = pci_read_config16(MCH_DEV, D0F0_DEVEN);
+		pci_write_config16(MCH_DEV, D0F0_DEVEN, tmp | HYBRID_GRAPHICS_SEC_VGA_EN);
+	}
+	else {
+		/* Enable integrated graphics legacy VGA cycles */
+		tmp = pci_read_config16(MCH_DEV, D0F0_GGC);
+		pci_write_config16(MCH_DEV, D0F0_GGC, tmp & ~HYBRID_GRAPHICS_INT_CLAIM_VGA);
+
+		/* Disable secondary VGA controller */
+		tmp = pci_read_config16(MCH_DEV, D0F0_DEVEN);
+		pci_write_config16(MCH_DEV, D0F0_DEVEN, tmp & ~HYBRID_GRAPHICS_SEC_VGA_EN);
+	}
+}
+
+static void hybrid_graphics_set_up_gpio(void)
+{
+	uint32_t tmp;
+
+	/* Enable hybrid graphics GPIO lines */
+	tmp = inl(DEFAULT_GPIOBASE + GP_IO_USE_SEL);
+	tmp = tmp | HYBRID_GRAPHICS_GP_LVL_BITS;
+	outl(tmp, DEFAULT_GPIOBASE + GP_IO_USE_SEL);
+
+	tmp = inl(DEFAULT_GPIOBASE + GP_IO_USE_SEL2);
+	tmp = tmp | HYBRID_GRAPHICS_GP_LVL2_BITS;
+	outl(tmp, DEFAULT_GPIOBASE + GP_IO_USE_SEL2);
+
+	/* Set hybrid graphics control GPIO lines to output */
+	tmp = inl(DEFAULT_GPIOBASE + GP_IO_SEL);
+	tmp = tmp & ~HYBRID_GRAPHICS_GP_LVL_BITS;
+	outl(tmp, DEFAULT_GPIOBASE + GP_IO_SEL);
+
+	tmp = inl(DEFAULT_GPIOBASE + GP_IO_SEL2);
+	tmp = tmp & ~HYBRID_GRAPHICS_GP_LVL2_BITS;
+	outl(tmp, DEFAULT_GPIOBASE + GP_IO_SEL2);
+
+	/* Set hybrid graphics detect GPIO lines to input */
+	tmp = inl(DEFAULT_GPIOBASE + GP_IO_SEL);
+	tmp = tmp | HYBRID_GRAPHICS_DETECT_GP_BITS;
+	outl(tmp, DEFAULT_GPIOBASE + GP_IO_SEL);
+}
+
+static bool hybrid_graphics_installed(void)
+{
+	if (inl(DEFAULT_GPIOBASE + GP_LVL) & HYBRID_GRAPHICS_DETECT_GP_BITS)
+		return false;
+	else
+		return true;
+}
+
+static void hybrid_graphics_switch_to_integrated_graphics(void)
+{
+	uint32_t tmp;
+
+	/* Disable switchable graphics */
+	hybrid_graphics_configure_switchable_graphics(false);
+
+	/* Configure muxes */
+	tmp = inl(DEFAULT_GPIOBASE + GP_LVL);
+	tmp = tmp & ~HYBRID_GRAPHICS_GP_LVL_BITS;
+	outl(tmp, DEFAULT_GPIOBASE + GP_LVL);
+
+	tmp = inl(DEFAULT_GPIOBASE + GP_LVL2);
+	tmp = tmp & ~HYBRID_GRAPHICS_GP_LVL2_BITS;
+	outl(tmp, DEFAULT_GPIOBASE + GP_LVL2);
+}
+
+static void hybrid_graphics_switch_to_discrete_graphics(void)
+{
+	uint32_t tmp;
+
+	/* Disable switchable graphics */
+	hybrid_graphics_configure_switchable_graphics(false);
+
+	/* Configure muxes */
+	tmp = inl(DEFAULT_GPIOBASE + GP_LVL);
+	tmp = tmp | HYBRID_GRAPHICS_GP_LVL_BITS;
+	outl(tmp, DEFAULT_GPIOBASE + GP_LVL);
+
+	tmp = inl(DEFAULT_GPIOBASE + GP_LVL2);
+	tmp = tmp | HYBRID_GRAPHICS_GP_LVL2_BITS;
+	outl(tmp, DEFAULT_GPIOBASE + GP_LVL2);
+}
+
+static void hybrid_graphics_switch_to_dual_graphics(void)
+{
+	/* Enable switchable graphics */
+	hybrid_graphics_configure_switchable_graphics(true);
+}
+
 static void default_southbridge_gpio_setup(void)
 {
 	outl(0x197e23fe, DEFAULT_GPIOBASE + GP_IO_USE_SEL);
@@ -98,6 +211,31 @@ void main(unsigned long bist)

 	default_southbridge_gpio_setup();

+	uint8_t hybrid_graphics_mode = HYBRID_GRAPHICS_INTEGRATED_ONLY;
+	get_option(&hybrid_graphics_mode, "hybrid_graphics_mode");
+
+	/* Set up hybrid graphics */
+	hybrid_graphics_set_up_gpio();
+	if (hybrid_graphics_installed()) {
+		/* Select appropriate hybrid graphics device */
+		printk(BIOS_DEBUG, "Hybrid graphics available, setting mode %d\n", hybrid_graphics_mode);
+		if (hybrid_graphics_mode == HYBRID_GRAPHICS_INTEGRATED_ONLY)
+			hybrid_graphics_switch_to_integrated_graphics();
+		else if (hybrid_graphics_mode == HYBRID_GRAPHICS_DISCRETE_ONLY)
+			hybrid_graphics_switch_to_discrete_graphics();
+		else if (hybrid_graphics_mode == HYBRID_GRAPHICS_SWITCHABLE)
+			hybrid_graphics_switch_to_integrated_graphics();
+			/* Switchable graphics are fully enabled after raminit */
+			/* FIXME
+			 * Enabling switchable graphics prevents bootup!
+			 * Debug and fix appropriately...
+			 */
+	}
+	else {
+		printk(BIOS_DEBUG, "Hybrid graphics not installed\n");
+		hybrid_graphics_switch_to_integrated_graphics();
+	}
+
 	/* ASPM related setting, set early by original BIOS. */
 	DMIBAR16(0x204) &= ~(3 << 10);

@@ -177,6 +315,11 @@ void main(unsigned long bist)
 	outl(inl(DEFAULT_GPIOBASE + 0x38) & ~0x400, DEFAULT_GPIOBASE + 0x38);

 	cbmem_initted = !cbmem_recovery(s3resume);
+
+	if (hybrid_graphics_installed())
+		if (hybrid_graphics_mode == HYBRID_GRAPHICS_SWITCHABLE)
+			hybrid_graphics_switch_to_dual_graphics();
+
 #if CONFIG_HAVE_ACPI_RESUME
 	/* If there is no high memory area, we didn't boot before, so
 	 * this is not a resume. In that case we just create the cbmem toc.
--
1.9.1


code:
From dad7e30fcaf87af2d51232896b2cabc59bba4a88 Mon Sep 17 00:00:00 2001
From: Francis Rowe <info@gluglug.org.uk>
Date: Mon, 15 Jun 2015 03:44:15 +0100
Subject: [PATCH 03/13] NOTFORMERGE: lenovo/t400: hard-code enable
 integrated-only video

Written with libreboot in mind. Libreboot uses native graphics
initialization only, so we want to ensure that these systems
only use the integrated (Intel) GPU for which native init exists.

Native graphics initialization does not yet exist for the ATI GPUs
on these laptops...

Change-Id: I2c056a8fb498972f87c4ec1122b239fdc9a4c666
Signed-off-by: Francis Rowe <info@gluglug.org.uk>
---
 src/mainboard/lenovo/t400/romstage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mainboard/lenovo/t400/romstage.c b/src/mainboard/lenovo/t400/romstage.c
index c62df60..daf6fa8 100644
--- a/src/mainboard/lenovo/t400/romstage.c
+++ b/src/mainboard/lenovo/t400/romstage.c
@@ -212,7 +212,8 @@ void main(unsigned long bist)
 	default_southbridge_gpio_setup();

 	uint8_t hybrid_graphics_mode = HYBRID_GRAPHICS_INTEGRATED_ONLY;
-	get_option(&hybrid_graphics_mode, "hybrid_graphics_mode");
+	/* Not for merge! Hard-code enable integrated-only by commenting this line: */
+	/* get_option(&hybrid_graphics_mode, "hybrid_graphics_mode");  */

 	/* Set up hybrid graphics */
 	hybrid_graphics_set_up_gpio();
--
1.9.1


code:
From c18e0e855487069dd2c836d9a48b1e63fb7d47d3 Mon Sep 17 00:00:00 2001
From: Francis Rowe <info@gluglug.org.uk>
Date: Mon, 22 Jun 2015 17:37:06 +0100
Subject: [PATCH 04/13] lenovo/x60: use correct BLC_PWM_CTL value

Bit 16 in BLC_PWM_CTL enables brightness controls, but the
current value is generic. Use the proper value, obtained
by reading BLC_PWM_CTL while running the VBIOS.

Change-Id: Ib273359e1c285b405a9bb26fc217c2f7e255b99f
Signed-off-by: Francis Rowe <info@gluglug.org.uk>
---
 src/mainboard/lenovo/x60/devicetree.cb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mainboard/lenovo/x60/devicetree.cb b/src/mainboard/lenovo/x60/devicetree.cb
index b20dde5..9c3c524 100644
--- a/src/mainboard/lenovo/x60/devicetree.cb
+++ b/src/mainboard/lenovo/x60/devicetree.cb
@@ -27,7 +27,7 @@ chip northbridge/intel/i945
 	register "gpu_hotplug" = "0x00000220"
 	register "gpu_lvds_use_spread_spectrum_clock" = "1"
 	register "gpu_lvds_is_dual_channel" = "0"
-	register "gpu_backlight" = "0x1290128"
+	register "gpu_backlight" = "0x879F879E"

 	device cpu_cluster 0 on
 		chip cpu/intel/socket_mFCPGA478
--
1.9.1


code:
From 4c337212bd77ab456f018d05b69bd8d0ef5d7761 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Tue, 4 Mar 2014 18:08:26 +0100
Subject: [PATCH 05/13] lenovo/t60: Enable native intel gfx init.

Tested on T60 with intel graphics.

Change-Id: Id74d0a1315749052e7313135242e6b64862aa5e1
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
 src/mainboard/lenovo/t60/Kconfig       | 3 +++
 src/mainboard/lenovo/t60/devicetree.cb | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/src/mainboard/lenovo/t60/Kconfig b/src/mainboard/lenovo/t60/Kconfig
index 0cf19a1..2254185 100644
--- a/src/mainboard/lenovo/t60/Kconfig
+++ b/src/mainboard/lenovo/t60/Kconfig
@@ -20,8 +20,11 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	select CHANNEL_XOR_RANDOMIZATION
 	select HAVE_ACPI_TABLES
 	select HAVE_ACPI_RESUME
+	select MAINBOARD_HAS_NATIVE_VGA_INIT
 	select H8_DOCK_EARLY_INIT
 	select HAVE_CMOS_DEFAULT
+	select INTEL_EDID
+
 config MAINBOARD_DIR
 	string
 	default lenovo/t60
diff --git a/src/mainboard/lenovo/t60/devicetree.cb b/src/mainboard/lenovo/t60/devicetree.cb
index 719fa9a..fdced26 100644
--- a/src/mainboard/lenovo/t60/devicetree.cb
+++ b/src/mainboard/lenovo/t60/devicetree.cb
@@ -24,6 +24,11 @@ chip northbridge/intel/i945
 	register "gfx.ndid" = "3"
 	register "gfx.did" = "{ 0x80000100, 0x80000240, 0x80000410, 0x80000410, 0x00000005 }"

+	register "gpu_hotplug" = "0x00000220"
+	register "gpu_lvds_use_spread_spectrum_clock" = "1"
+	register "gpu_lvds_is_dual_channel" = "1"
+	register "gpu_backlight" = "0x1280128"
+
 	device cpu_cluster 0 on
 		chip cpu/intel/socket_mFCPGA478
 			device lapic 0 on end
--
1.9.1


code:
From 1623f381e7c5b8329d035d666d5498a75e81d635 Mon Sep 17 00:00:00 2001
From: Francis Rowe <info@gluglug.org.uk>
Date: Mon, 15 Jun 2015 19:56:29 +0100
Subject: [PATCH 06/13] lenovo/t60: Enable VESA framebuffer mode (native
 graphics)

At present, no option exists for "Keep VESA framebuffer", which
means that text-mode will be used. Add the appropriate Kconfig
option.

Change-Id: Ie8c91fc04c8d6a8ff41977be0b730e86e34546af
Signed-off-by: Francis Rowe <info@gluglug.org.uk>
---
 src/mainboard/lenovo/t60/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mainboard/lenovo/t60/Kconfig b/src/mainboard/lenovo/t60/Kconfig
index 2254185..52eeda3 100644
--- a/src/mainboard/lenovo/t60/Kconfig
+++ b/src/mainboard/lenovo/t60/Kconfig
@@ -21,6 +21,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	select HAVE_ACPI_TABLES
 	select HAVE_ACPI_RESUME
 	select MAINBOARD_HAS_NATIVE_VGA_INIT
+	select MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG
 	select H8_DOCK_EARLY_INIT
 	select HAVE_CMOS_DEFAULT
 	select INTEL_EDID
--
1.9.1


code:
From 172b2fad7663f3c52cd8830cf064234b0ae53575 Mon Sep 17 00:00:00 2001
From: Francis Rowe <info@gluglug.org.uk>
Date: Mon, 15 Jun 2015 19:59:46 +0100
Subject: [PATCH 07/13] lenovo/t60: Enable brightness controls (native
 graphics)

This makes the Fn Home/End keys work for controlling the
brightness of the display. Value obtained by reading
BLC_PWM_CTL when running the VBIOS (option ROM).

On i945 legacy brightness control is enabled by a single
bit in BLC_PWM_CTL. It's bit 16 or bit 0 (the other one
reverses polarity). Set the bit to enable brightness
controls.

Change-Id: I22e261f2ce28ec81cd208a73e6311ec67146eb72
Signed-off-by: Francis Rowe <info@gluglug.org.uk>
---
 src/mainboard/lenovo/t60/devicetree.cb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mainboard/lenovo/t60/devicetree.cb b/src/mainboard/lenovo/t60/devicetree.cb
index fdced26..5f90a73 100644
--- a/src/mainboard/lenovo/t60/devicetree.cb
+++ b/src/mainboard/lenovo/t60/devicetree.cb
@@ -27,7 +27,7 @@ chip northbridge/intel/i945
 	register "gpu_hotplug" = "0x00000220"
 	register "gpu_lvds_use_spread_spectrum_clock" = "1"
 	register "gpu_lvds_is_dual_channel" = "1"
-	register "gpu_backlight" = "0x1280128"
+	register "gpu_backlight" = "0x58BF58BE"

 	device cpu_cluster 0 on
 		chip cpu/intel/socket_mFCPGA478
--
1.9.1


code:
From 49c5977adafea4b0953e1fc7e9e830353273b76e Mon Sep 17 00:00:00 2001
From: Francis Rowe <info@gluglug.org.uk>
Date: Mon, 13 Oct 2014 00:14:53 +0100
Subject: [PATCH 08/13] NOTFORMERGE: ec/lenovo/h8:
 wlan/trackpoint/touchpad/bluetooth/wwan

Permanently enable them.

Change-Id: Ic76ab9ab9c865f30312378e18af58bece6c3260a
Signed-off-by: Francis Rowe <info@gluglug.org.uk>
---
 src/ec/lenovo/h8/h8.c     | 21 +++++++++++----------
 src/ec/lenovo/pmh7/pmh7.c | 11 ++++-------
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index 2cafc88..a6cb6b6 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -255,9 +255,11 @@ static void h8_enable(struct device *dev)

 	ec_write(H8_FAN_CONTROL, H8_FAN_CONTROL_AUTO);

-	if (get_option(&val, "wlan") != CB_SUCCESS)
-		val = 1;
-	h8_wlan_enable(val);
+	// Permanently enable wifi
+	// Intel wifi could be a security risk because it uses firmware. Wlan chip has DMA
+	// and could leak data over a side-channel. Using another manufacturer is recommended.
+	// see http://libreboot.org/docs/index.html#recommended_wifi
+	h8_wlan_enable(1);

 	h8_trackpoint_enable(1);
 	h8_usb_power_enable(1);
@@ -265,14 +267,13 @@ static void h8_enable(struct device *dev)
 	if (get_option(&val, "volume") == CB_SUCCESS)
 		ec_write(H8_VOLUME_CONTROL, val);

-	if (get_option(&val, "bluetooth") != CB_SUCCESS)
-		val = 1;
-	h8_bluetooth_enable(val);
-
-	if (get_option(&val, "wwan") != CB_SUCCESS)
-		val = 1;
+	// Permanently enable bluetooth.
+	// NOTE: bluetooth is a potential security risk. Physical removal of the bluetooth module is recommended.
+	h8_bluetooth_enable(1);

-	h8_wwan_enable(val);
+	// Permanently enable wwan.
+	// NOTE: wwan is a security risk (remove access plus DMA). Physical removal of both the wwan and sim card is recommended.
+	h8_wwan_enable(1);

 	if (conf->has_uwb) {
 		if (get_option(&val, "uwb") != CB_SUCCESS)
diff --git a/src/ec/lenovo/pmh7/pmh7.c b/src/ec/lenovo/pmh7/pmh7.c
index cc6e891..38aef16 100644
--- a/src/ec/lenovo/pmh7/pmh7.c
+++ b/src/ec/lenovo/pmh7/pmh7.c
@@ -106,7 +106,6 @@ static void enable_dev(struct device *dev)
 {
 	struct ec_lenovo_pmh7_config *conf = dev->chip_info;
 	struct resource *resource;
-	u8 val;

 	resource = new_resource(dev, EC_LENOVO_PMH7_INDEX);
 	resource->flags = IORESOURCE_IO | IORESOURCE_FIXED;
@@ -118,13 +117,11 @@ static void enable_dev(struct device *dev)
 	pmh7_backlight_enable(conf->backlight_enable);
 	pmh7_dock_event_enable(conf->dock_event_enable);

-	if (get_option(&val, "touchpad") != CB_SUCCESS)
-		val = 1;
-	pmh7_touchpad_enable(val);
+	// Permanently enable touchpad
+	pmh7_touchpad_enable(1);

-	if (get_option(&val, "trackpoint") != CB_SUCCESS)
-		val = 1;
-	pmh7_trackpoint_enable(val);
+	// Permanently enable trackpoint
+	pmh7_trackpoint_enable(1);
 }

 struct chip_operations ec_lenovo_pmh7_ops = {
--
1.9.1


code:
From a59b0e652911627cb00b748bb71f07ce0fa90534 Mon Sep 17 00:00:00 2001
From: Steve Shenton <sgsit@libreboot.org>
Date: Fri, 12 Dec 2014 12:42:01 +0000
Subject: [PATCH] northbridge/gm45/raminit.c: enable GS45 high-performance mode

The datasheets for GS45 describe a high- and low-performance mode
for different CPUs. Coreboot currently disables GS45 altogether,
but forcing coreboot to treat high-performance GS45 as GM45 makes
the X200S and X200 Tablet boot if it has the right CPU type.

Hardcode-enable GS45 high-performance mode in coreboot, passing it
off as GM45. This is known to work with all CPUs except the SU
(low performance) models.

Change-Id: I57032bb6e1ebdaf4e2aa09548e73d253afb9b078
Signed-off-by: Steve Shenton <sgsit@libreboot.org>
Signed-off-by: Francis Rowe <info@gluglug.org.uk>
---
 src/northbridge/intel/gm45/raminit.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/northbridge/intel/gm45/raminit.c b/src/northbridge/intel/gm45/raminit.c
index 9c4fecd..9f5aa06 100644
--- a/src/northbridge/intel/gm45/raminit.c
+++ b/src/northbridge/intel/gm45/raminit.c
@@ -108,8 +108,8 @@ void get_gmch_info(sysinfo_t *sysinfo)
 			printk(BIOS_SPEW, "GMCH: GS40\n");
 			break;
 		case GMCH_GS45:
-			printk(BIOS_SPEW, "GMCH: GS45, using low power mode by default\n");
-			sysinfo->gs45_low_power_mode = 1;
+			printk(BIOS_SPEW, "GMCH: GS45, using high performance mode by default\n");
+			sysinfo->gs45_low_power_mode = 0;
 			break;
 		case GMCH_PM45:
 			printk(BIOS_SPEW, "GMCH: PM45\n");
@@ -1692,7 +1692,7 @@ void raminit(sysinfo_t *const sysinfo, const int s3resume)
 {
 	const dimminfo_t *const dimms = sysinfo->dimms;
 	const timings_t *const timings = &sysinfo->selected_timings;
-	const int sff = sysinfo->gfx_type == GMCH_GS45;
+	const int sff = (sysinfo->gfx_type == GMCH_GS45) && (sysinfo->gs45_low_power_mode == 1);

 	int ch;
 	u8 reg8;
--
1.9.1


code:
From bea0f09575914be6f2d35dbc53220bce6ac03aac Mon Sep 17 00:00:00 2001
From: Francis Rowe <info@gluglug.org.uk>
Date: Mon, 29 Dec 2014 21:02:48 +0000
Subject: [PATCH 10/13] gm45: fix uneven backlight (native gfx init)

When setting brightness levels low, backlight becomes uneven.
This patch fixes that.

Tested on X200.

Change-Id: Ie71bf696ba4431ab25076f92dd5fdc9fdc167b09
Signed-off-by: Francis Rowe <info@gluglug.org.uk>
---
 src/northbridge/intel/gm45/acpi/igd.asl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/northbridge/intel/gm45/acpi/igd.asl b/src/northbridge/intel/gm45/acpi/igd.asl
index 696cc2b..39fefb2 100644
--- a/src/northbridge/intel/gm45/acpi/igd.asl
+++ b/src/northbridge/intel/gm45/acpi/igd.asl
@@ -62,15 +62,15 @@ Device (GFX0)

 	Method (XBCM, 1, NotSerialized)
 	{
-		Store (ShiftLeft (Arg0, 4), BCLV)
+		Store (ShiftLeft (Arg0, 8), BCLV)
 		Store (0x80000000, CR1)
-		Store (0x0610, BCLM)
+		Store (ShiftLeft (0x61, 8), BCLM)
 	}

 	Method (XBQC, 0, NotSerialized)
 	{
 		Store (BCLV, Local0)
-		ShiftRight (Local0, 4, Local0)
+		ShiftRight (Local0, 8, Local0)
 		Return (Local0)
 	}
 #include <drivers/intel/gma/igd.asl>
--
1.9.1


code:
From 93c1510605981a38c6d616a9c77a7675d7c66b59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= <mtjm@mtjm.eu>
Date: Tue, 3 Feb 2015 23:26:05 +0100
Subject: [PATCH 11/13] lenovo/r400: Add clone of Lenovo T400
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The existing code for the Lenovo T400 works without changes on the
Lenovo R400.  Same HDA verbs are provided by Lenovo BIOS on both
laptops.

Change-Id: I1dadddd7250ab80a4c40c2435865d72e3e5d99c9
Signed-off-by: Michał Masłowski <mtjm@mtjm.eu>
Signed-off-by: Francis Rowe <info@gluglug.org.uk>
---
 src/mainboard/lenovo/r400/Kconfig        | 7 +++++++
 src/mainboard/lenovo/r400/Kconfig.name   | 2 ++
 src/mainboard/lenovo/r400/board_info.txt | 6 ++++++
 src/mainboard/lenovo/t400/Kconfig        | 6 +++++-
 4 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 src/mainboard/lenovo/r400/Kconfig
 create mode 100644 src/mainboard/lenovo/r400/Kconfig.name
 create mode 100644 src/mainboard/lenovo/r400/board_info.txt

diff --git a/src/mainboard/lenovo/r400/Kconfig b/src/mainboard/lenovo/r400/Kconfig
new file mode 100644
index 0000000..0966bf1
--- /dev/null
+++ b/src/mainboard/lenovo/r400/Kconfig
@@ -0,0 +1,7 @@
+if BOARD_LENOVO_R400
+
+config MAINBOARD_PART_NUMBER
+	string
+	default "ThinkPad R400"
+
+endif
diff --git a/src/mainboard/lenovo/r400/Kconfig.name b/src/mainboard/lenovo/r400/Kconfig.name
new file mode 100644
index 0000000..15a99b1
--- /dev/null
+++ b/src/mainboard/lenovo/r400/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_LENOVO_R400
+	bool "ThinkPad R400"
diff --git a/src/mainboard/lenovo/r400/board_info.txt b/src/mainboard/lenovo/r400/board_info.txt
new file mode 100644
index 0000000..007ec6c
--- /dev/null
+++ b/src/mainboard/lenovo/r400/board_info.txt
@@ -0,0 +1,6 @@
+Category: laptop
+ROM package: SOIC-16 or SOIC-8
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: n
+Clone of: lenovo/t400
diff --git a/src/mainboard/lenovo/t400/Kconfig b/src/mainboard/lenovo/t400/Kconfig
index e410f20..467cd63 100644
--- a/src/mainboard/lenovo/t400/Kconfig
+++ b/src/mainboard/lenovo/t400/Kconfig
@@ -1,4 +1,4 @@
-if BOARD_LENOVO_T400
+if BOARD_LENOVO_T400 || BOARD_LENOVO_R400

 config BOARD_SPECIFIC_OPTIONS # dummy
 	def_bool y
@@ -27,10 +27,14 @@ config MAINBOARD_DIR
 	string
 	default lenovo/t400

+if BOARD_LENOVO_T400
+
 config MAINBOARD_PART_NUMBER
 	string
 	default "ThinkPad T400"

+endif
+
 config MMCONF_BASE_ADDRESS
 	hex
 	default 0xf0000000
--
1.9.1


code:
From 330670470afd0b12fd58f8cf734cb3c85c3a20f5 Mon Sep 17 00:00:00 2001
From: Francis Rowe <info@gluglug.org.uk>
Date: Sun, 14 Jun 2015 15:40:00 +0100
Subject: [PATCH 12/13] lenovo/t500: Add clone of Lenovo T400

The existing code for the Lenovo T400 works without changes on the
Lenovo T500.  Same HDA verbs are provided by Lenovo BIOS on both
laptops.

Change-Id: I300408a8a0ed00476aee6061925befc2822fb505
Signed-off-by: Francis Rowe <info@gluglug.org.uk>
---
 src/mainboard/lenovo/t400/Kconfig        | 2 +-
 src/mainboard/lenovo/t500/Kconfig        | 7 +++++++
 src/mainboard/lenovo/t500/Kconfig.name   | 2 ++
 src/mainboard/lenovo/t500/board_info.txt | 6 ++++++
 4 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 src/mainboard/lenovo/t500/Kconfig
 create mode 100644 src/mainboard/lenovo/t500/Kconfig.name
 create mode 100644 src/mainboard/lenovo/t500/board_info.txt

diff --git a/src/mainboard/lenovo/t400/Kconfig b/src/mainboard/lenovo/t400/Kconfig
index 467cd63..0eac311 100644
--- a/src/mainboard/lenovo/t400/Kconfig
+++ b/src/mainboard/lenovo/t400/Kconfig
@@ -1,4 +1,4 @@
-if BOARD_LENOVO_T400 || BOARD_LENOVO_R400
+if BOARD_LENOVO_T400 || BOARD_LENOVO_T500 || BOARD_LENOVO_R400

 config BOARD_SPECIFIC_OPTIONS # dummy
 	def_bool y
diff --git a/src/mainboard/lenovo/t500/Kconfig b/src/mainboard/lenovo/t500/Kconfig
new file mode 100644
index 0000000..e1e8420
--- /dev/null
+++ b/src/mainboard/lenovo/t500/Kconfig
@@ -0,0 +1,7 @@
+if BOARD_LENOVO_T500
+
+config MAINBOARD_PART_NUMBER
+	string
+	default "ThinkPad T500"
+
+endif
diff --git a/src/mainboard/lenovo/t500/Kconfig.name b/src/mainboard/lenovo/t500/Kconfig.name
new file mode 100644
index 0000000..89c6087
--- /dev/null
+++ b/src/mainboard/lenovo/t500/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_LENOVO_T500
+	bool "ThinkPad T500"
diff --git a/src/mainboard/lenovo/t500/board_info.txt b/src/mainboard/lenovo/t500/board_info.txt
new file mode 100644
index 0000000..007ec6c
--- /dev/null
+++ b/src/mainboard/lenovo/t500/board_info.txt
@@ -0,0 +1,6 @@
+Category: laptop
+ROM package: SOIC-16 or SOIC-8
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: n
+Clone of: lenovo/t400
--
1.9.1


code:
From fc3e9f93b5b08abe1a684550d2ddda998657882b Mon Sep 17 00:00:00 2001
From: Francis Rowe <info@gluglug.org.uk>
Date: Fri, 12 Jun 2015 23:10:52 +0100
Subject: [PATCH 13/13] ec/lenovo/h8: re-factor handling of
 power_management_beeps

The current code duplicates the same check unnecessarily,
and has no handling of when the option power_management_beeps
is not set.

Change-Id: I189c5ce382e1a270d24b9b6e897358268b9a141d
Signed-off-by: Francis Rowe <info@gluglug.org.uk>
---
 src/ec/lenovo/h8/h8.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index a6cb6b6..6493ec2 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -2,6 +2,7 @@
  * This file is part of the coreboot project.
  *
  * Copyright (C) 2011 Sven Schnelle <svens@stackframe.org>
+ * Copyright (C) 2015 Francis Rowe <info@gluglug.org.uk>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -212,14 +213,14 @@ static void h8_enable(struct device *dev)
 	beepmask0 = conf->beepmask0;
 	beepmask1 = conf->beepmask1;

-	if (conf->has_power_management_beeps
-	    && get_option(&val, "power_management_beeps") == CB_SUCCESS
-	    && val == 0) {
-		beepmask0 = 0x00;
-		beepmask1 = 0x00;
-	}
-
 	if (conf->has_power_management_beeps) {
+		if (get_option(&val, "power_management_beeps") != CB_SUCCESS)
+			val = 1;
+		if (!val) {
+			beepmask0 = 0x00;
+			beepmask1 = 0x00;
+		}
+
 		if (get_option(&val, "low_battery_beep") != CB_SUCCESS)
 			val = 1;
 		if (val)
--
1.9.1


code:
# Makefile for MemTest86+
#
# Author:		Chris Brady
# Created:		January 1, 1996

#
# Path for the floppy disk device
#
FDISK=/dev/fd0

AS=as -32
CC=gcc

CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
	-ffreestanding -fPIC $(SMP_FL) -fno-stack-protector

OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
      config.o cpuid.o linuxbios.o pci.o memsize.o spd.o error.o dmi.o controller.o \
      smp.o vmem.o random.o

all: clean memtest.bin memtest
#		 scp memtest.bin root@192.168.0.12:/srv/tftp/mt86plus

# Link it statically once so I know I don't have undefined
# symbols and then link it dynamically so I have full
# relocation information
memtest_shared: $(OBJS) memtest_shared.lds Makefile
	$(LD) --warn-constructors --warn-common -static -T memtest_shared.lds \
	 -o $@ $(OBJS) && \
	$(LD) -shared -Bsymbolic -T memtest_shared.lds -o $@ $(OBJS)

memtest_shared.bin: memtest_shared
	objcopy -O binary $< memtest_shared.bin

memtest: memtest_shared.bin memtest.lds
	$(LD) -s -T memtest.lds -b binary memtest_shared.bin -o $@

head.s: head.S config.h defs.h test.h
	$(CC) -E -traditional $< -o $@

bootsect.s: bootsect.S config.h defs.h
	$(CC) -E -traditional $< -o $@

setup.s: setup.S config.h defs.h
	$(CC) -E -traditional $< -o $@

memtest.bin: memtest_shared.bin bootsect.o setup.o memtest.bin.lds
	$(LD) -T memtest.bin.lds bootsect.o setup.o -b binary \
	memtest_shared.bin -o memtest.bin

reloc.o: reloc.c
	$(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c

test.o: test.c
	$(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding test.c

random.o: random.c
	$(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding random.c

# rule for build number generation
build_number:
	sh make_buildnum.sh

clean:
	rm -f *.o *.s *.iso memtest.bin memtest memtest_shared \
		memtest_shared.bin memtest.iso

iso:
	make all
	./makeiso.sh

install: all
	dd <memtest.bin >$(FDISK) bs=8192

install-precomp:
	dd <precomp.bin >$(FDISK) bs=8192

dos: all
	cat mt86+_loader memtest.bin > memtest.exe


code:
/*
 * MemTest86+ V5 Specific code (GPL V2.0)
 * By Samuel DEMEULEMEESTER, sdemeule@memtest.org
 * http://www.canardpc.com - http://www.memtest.org
 * ------------------------------------------------
 * config.h - MemTest-86  Version 3.3
 *
 * Compile time configuration options
 *
 * Released under version 2 of the Gnu Public License.
 * By Chris Brady
 */

/* CONSERVATIVE_SMP - If set to 0, SMP will be enabled by default */
/* Might be enabled in future revision after extensive testing */
/* In all cases, SMP is disabled by defaut on server platform */
#define CONSERVATIVE_SMP 1

/* BEEP_MODE - Beep on error. Default off, Change to 1 to enable */
#define BEEP_MODE 1

/* BEEP_END_NO_ERROR - Beep at end of each pass without error. Default off, Change to 1 to enable */
#define BEEP_END_NO_ERROR 0

/* PARITY_MEM - Enables support for reporting memory parity errors */
/*	Experimental, normally enabled */
#define PARITY_MEM

/* SERIAL_CONSOLE_DEFAULT -  The default state of the serial console. */
/*	This is normally off since it slows down testing.  Change to a 1 */
/*	to enable. */
#define SERIAL_CONSOLE_DEFAULT 0

/* SERIAL_TTY - The default serial port to use. 0=ttyS0, 1=ttyS1 */
#define SERIAL_TTY 0

/* SERIAL_BAUD_RATE - Baud rate for the serial console */
#define SERIAL_BAUD_RATE 115200

/* SCRN_DEBUG - extra check for SCREEN_BUFFER
 */
/* #define SCRN_DEBUG */

/* APM - Turns off APM at boot time to avoid blanking the screen */
/*	Normally enabled */
#define APM_OFF

/* USB_WAR - Enables a workaround for errors caused by BIOS USB keyboard */
/*	and mouse support*/
/*	Normally enabled */
#define USB_WAR


code:
#!/bin/bash

#  helper script: clean the dependencies that were built in bucts
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the current working directory is the root
# of libreboot_src or libreboot git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# clean bucts
# --------------------------------------------------------

printf "Cleaning the previous build of bucts\n"

cd "bucts/"
make clean

printf "\n\n"

# done. go back to main directory.
cd "../"


code:
#!/bin/bash

#  helper script: clean the dependencies that were built in coreboot
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the current working directory is the root
# of libreboot_src or libreboot git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# clean coreboot utilities (dependencies for 'build'):
# -------------------------------------------------------

printf "Cleaning the previous build of the utilities in coreboot\n"

cd "coreboot/"

# ----------------------
# clean coreboot itself:
# ----------------------
make clean

# -------------------
# clean the utilities
# -------------------
# clean cbfstool
cd "util/cbfstool/"
make clean

# go back to coreboot dir
cd "../../"

# -------------------------------------
# clean reference crossGCC for coreboot
# source archive not deleted (intended)
# -------------------------------------
make crossgcc-clean

# done. go back to main directory
cd "../"

printf "\n\n"


code:
#!/bin/bash

#  helper script: clean the dependencies that were built in flashrom
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the current working directory is the root
# of libreboot_src or libreboot git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# clean flashrom
# --------------------------------------------------------

printf "Cleaning the previous build of flashrom\n"

cd "flashrom/"

make clean
# remove patched binaries
rm -f "flashrom_lenovobios_sst"
rm -f "flashrom_lenovobios_macronix"

# done. go back to main directory
cd "../"

printf "\n\n"


code:
#!/bin/bash

#  helper script: clean the dependencies that were built in GRUB
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the current working directory is the root
# of libreboot_src or libreboot git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# clean grub
# --------------------------------------------------------

cd "grub/"

printf "Cleaning the previous build of GRUB\n"
[ -f "Makefile" ] && make distclean

# done. go back to main directoy
cd "../"

printf "\n\n"


code:
#!/bin/bash

#  helper script: clean the dependencies that were built in i945pwm
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the current working directory is the root
# of libreboot_src or libreboot git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# clean i945-pwm utility
# --------------------------------------------------------------------

printf "Cleaning the previous build of i945-pwm\n"
cd "resources/utilities/i945-pwm/"
make clean
cd "../../../"
printf "\n\n"


code:
#!/bin/bash

#  helper script: clean the dependencies that were built in ich9deblob
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the current working directory is the root
# of libreboot_src or libreboot git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# clean ich9deblob utility
# --------------------------------------------------------------------

printf "Cleaning the previous build of ich9deblob\n"
cd "resources/utilities/ich9deblob/"
make clean
cd "../../../"
printf "\n\n"


code:
#!/bin/bash

#  helper script: clean the dependencies that were built in memtest86+
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the current working directory is the root
# of libreboot_src or libreboot git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# clean memtest86+
# --------------------------------------------------------

printf "Cleaning the previous build of MemTest86+\n"

cd "memtest86plus"/

make clean

# done. go back to main directory
cd "../"

printf "\n\n"


code:
#!/bin/bash

#  helper script: delete the ROM images
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the current working directory is the root
# of libreboot_src or libreboot git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# Delete the ROM images
# --------------------------------------------------------

# delete the bin/ directory
rm -Rf "bin/"

printf "Deleted the bin/ directory containing the ROM images.\n\n"


code:
#!/bin/bash

#
#  helper script: run "make menuconfig" on config(s) to modify them
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the working directory is the root
# of libreboot_src or git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

configpath="resources/libreboot/config/grub"

hackconfig () {
	cd "coreboot/"

	printf "Modifying config for %s\n" "${1}"
	sleep 2

	if [ ! -d "../${configpath}/${1}/" ]; then
		printf "build/config/corebootmodify WARNING: config '%s' does not exist. Skipping.\n" "${1}"
		cd "../"
		return
	fi

	mv "../${configpath}/${1}/config" ".config"
	make menuconfig
	mv ".config" "../${configpath}/${1}/config"

	cd "../"
}

if [ $# -lt 1 ]; then
	for config in ${configpath}/*; do hackconfig "${config##*/}"; done
else
	for config in "${@}"; do hackconfig "${config}"; done
fi


code:
#!/bin/bash

#
#  helper script: run "make menuconfig" on config(s) to replace them
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the working directory is the root
# of libreboot_src or git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

configpath="resources/libreboot/config/grub"

hackconfig () {
	cd "coreboot/"

	printf "Replacing or creating new config for %s\n" "${1}"
	sleep 2

	make menuconfig

	[ ! -d "../${configpath}/${1}/" ] && mkdir -p "../${configpath}/${1}/"
	mv ".config" "../${configpath}/${1}/config"

	cd "../"
}

if [ $# -lt 1 ]; then
	for config in ${configpath}/*; do hackconfig "${config##*/}"; done
else
	for config in "${@}"; do hackconfig "${config}"; done
fi


code:
#!/bin/bash

#
#  helper script: run "make oldconfig" on all coreboot config files
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the working directory is the root
# of libreboot_src or git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

configpath="resources/libreboot/config/grub"

hackconfig () {
	cd "coreboot/"

	printf "Updating config for %s\n" "${1}"
	sleep 2

	if [ ! -d "../${configpath}/${1}/" ]; then
		printf "build/config/corebootupdate WARNING: config '%s' does not exist. Skipping.\n" "${1}"
		cd "../"
		return
	fi

	mv "../${configpath}/${1}/config" ".config"
	make oldconfig
	mv ".config" "../${configpath}/${1}/config"

	cd "../"
}

if [ $# -lt 1 ]; then
	for config in ${configpath}/*; do hackconfig "${config##*/}"; done
else
	for config in "${@}"; do hackconfig "${config}"; done
fi


code:
#!/bin/bash

#  helper script: installs build dependencies for Parabola

# this script is based on the script for Trisquel 7
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#	Copyright (C) 2015 Klemens Nanni <klemens@posteo.de>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

if [ $EUID -ne 0 ]; then
   printf "This script must be run as root\n"
   exit 1
fi

# Duplications are intentional. Please do not re-factor.
#
# This is so that they can moved to separate scripts.
#

pacman -S --needed wget

# For downloading source code
# ------------------------------------------------------------

printf "Source Code: In order to download the it, git is needed\n"
pacman -S --needed git

# For building source code:
# ------------------------------------------------------------

printf "Building Source Code: development packages\n"
pacman -S --needed base-devel libstdc++5

pacman -S arm-none-eabi-gcc

pacman -S --needed libpciaccess

# For cross-compiling i686 target on x86_64 host.
if [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
	then
		printf "Cross-Compiling: You are running on 64-bit architecture, however 32-bit libraries are needed\n"
		pacman -Sl --needed multilib 1&>/dev/null || (printf "You must enable the multilib repository in /etc/pacman.conf first\n"; exit 1)
		pacman -S --needed gcc{,-libs}-multilib lib32-{lib{ltdl,pciaccess,stdc++5},glibc,fakeroot}
fi

# Memtest86+ build dependencies
# ------------------------------------------------------------

# pacman -S --needed base-devel

# i945-pwm build dependencies
# ------------------------------------------------------------

# pacman -S base-devel

# Coreboot build dependencies (also requires build-essential and git)
# ------------------------------------------------------------

printf "Coreboot: Ncurses for menuconfig and a few other tools\n"
pacman -S ncurses doxygen iasl gdb flex bison
# pacman -S git base-devel

# For cross-compiling i686 target on x86_64 host.
if [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
	then
		printf "Cross-Compiling: You are running on 64-bit architecture, however 32-bit libraries are needed\n"
		pacman -S --needed lib32-ncurses
fi

# GRUB build dependencies (also requires build-essential, bison and flex)
# ------------------------------------------------------------

# pacman -S --needed base-devel bison flex

printf "GRUB: Fonts, (crypto) filesystem support, automake, etc.\n"
pacman -S --needed autogen m4 autoconf help2man freetype2 automake fuse fuse-exfat xz gawk device-mapper libtool python
pacman -S --needed bdf-unifont # trying this, otherwise there was an error. I'll try AUR if this won't work.

# BucTS build dependencies (external script)
# ------------------------------------------------------------

# pacman -S --needed base-devel

# Flashrom build dependencies (also requires build-essential)
# ------------------------------------------------------------

printf "Flashrom: Your external programmer will be most probably using PCI bus, FTDI chips need additional libraries\n"
pacman -S --needed pciutils zlib libftdi libftdi-compat
# pacman -S --needed base-devel


code:
#!/bin/bash

# for_trisquel7 script: installs build dependencies for Trisquel 7
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

if [ $EUID -ne 0 ]; then
   printf "This script must be run as root\n"
   exit 1
fi

# Duplications are intentional. Please do not re-factor.
#
# This is so that they can moved to separate scripts.
#

apt-get -y install wget

# For downloading source code
# ------------------------------------------------------------

apt-get -y install git

# For building source code:
# ------------------------------------------------------------

apt-get -y install build-essential

# for cross-compiling ARM binaries
apt-get -y install gcc-arm-linux-gnueabi

# For cross-compiling i686 target on x86_64 host.
if [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
	then
		apt-get -y install gcc-multilib libc6-i386 libc6-dev-i386
		apt-get -y install lib32stdc++6 g++-multilib dh-autoreconf
		# recommended, but not sure what for:
		apt-get -y install lib32tinfo-dev texi2html
fi

# Memtest86+ build dependencies
# ------------------------------------------------------------

apt-get -y install build-essential

# i945-pwm build dependencies
# ------------------------------------------------------------

apt-get -y install build-essential

# Coreboot build dependencies (also requires build-essential and git)
# ------------------------------------------------------------

apt-get -y install libncurses5-dev doxygen iasl gdb flex bison build-essential git

# For cross-compiling i686 target on x86_64 host.
if [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
	then
		apt-get -y install lib32ncurses5-dev
fi

# GRUB build dependencies (also requires build-essential, bison and flex)
# ------------------------------------------------------------

apt-get -y install ttf-unifont libopts25 libselinux1-dev autogen m4 autoconf help2man libopts25-dev libfont-freetype-perl automake autotools-dev build-essential bison flex libfuse-dev liblzma-dev gawk libdevmapper-dev libtool libfreetype6-dev

# BucTS build dependencies (external script)
# ------------------------------------------------------------

apt-get -y install build-essential

# Flashrom build dependencies (also requires build-essential)
# ------------------------------------------------------------

apt-get -y install libpci-dev pciutils zlib1g-dev libftdi-dev build-essential

# For cross-compiling i686 target on x86_64 host.
if [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
	then
		apt-get -y install lib32z1-dev
fi


code:
#!/bin/bash

#  helper script: builds bucts source code
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#	Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the working directory is the root
# of libreboot_src or git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# Build BUC.TS utility (needed for flashing ROM's on X60/T60 while Lenovo BIOS is running)
# --------------------------------------------------------------------

printf "Building bucts\n"

cd "bucts/"

buildtype="unknown"
if (( $# != 1 )); then
	buildtype="dynamic"
else
	buildtype="static"
fi

if [ "${buildtype}" = "static" ]; then
	patch "Makefile" < "../resources/bucts/patch/staticlink.diff"
fi

make clean
make -j"$(nproc)"

if [ "${buildtype}" = "static" ]; then
	patch "Makefile" -R < "../resources/bucts/patch/staticlink.diff"
fi

# done. go back to main directory
cd "../"

printf "\n\n"


code:
#!/bin/bash

#  helper script: builds the dependencies that coreboot needs before building a ROM image
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#	Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the working directory is the root
# of libreboot_src or git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# Build utilities needed in coreboot directory
# --------------------------------------------------------------------

printf "Building the utilities in coreboot\n"

cd "coreboot/"

# -----------------------------------------
# Build the utilities required by libreboot
# -----------------------------------------

# cbfstool
cd "util/cbfstool/"
make -j"$(nproc)"

# done. go back to coreboot dir
cd "../../"

# done. go back to main libreboot_src directory
cd "../"

printf "\n\n"


code:
#!/bin/bash

#  helper script: builds flashrom source code
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#	Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the working directory is the root
# of libreboot_src or git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# Build "flashrom" (utility for flashing/dumping ROM's)
# --------------------------------------------------------------------

printf "Building flashrom\n"

cd "flashrom/"

make clean
if (( $# != 1 )); then
	make -j"$(nproc)"
else
	if [ "${1}" = "static" ]; then
		make SHARED=0 CC='gcc -static' -j"$(nproc)"
	else
		make -j"$(nproc)"
	fi
fi

mv "flashrom" "flashrom_normal"

# build patched binaries for MX25L1605D and SST25VF016B flash chips
# - these patches are needed for initial installation on an X60 or T60
# - these patches are for people who have lenovo bios running
for patchname in "lenovobios_macronix" "lenovobios_sst"
do
	# first remove the existing build
	rm -f "flashrom_${patchname}"

	# backup the unpatched flashchips.c (it will be patched)
	cp "flashchips.c" "flashchips.c_"
	# patch flashchips.c
	patch "flashchips.c" < "../resources/flashrom/patch/${patchname}.diff"

	make clean
	if (( $# != 1 )); then
		make -j"$(nproc)"
	else
		if [ "${1}" = "static" ]; then
			make SHARED=0 CC='gcc -static' -j"$(nproc)"
		else
			make -j"$(nproc)"
		fi
	fi

	# Rename the binary based on the patch name
	mv "flashrom" "flashrom_${patchname}"

	# restore unpatched flashchips.c
	rm -f "flashchips.c"
	mv "flashchips.c_" "flashchips.c"
done

mv "flashrom_normal" "flashrom"

cd "../"

printf "\n\n"


code:
#!/bin/bash

#  helper script: builds GRUB source code
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#	Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the working directory is the root
# of libreboot_src or git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# Build utilies needed for building GRUB payloads
# ---------------------------------------------------------------------

printf "Building GRUB\n"

cd "grub/"

# clean it first
[ -f Makefile ] && make distclean

# build grub
./autogen.sh
./configure --with-platform=coreboot
make -j"$(nproc)"

printf "\n\n"

# done. go back to main directory
cd "../"


code:
#!/bin/bash

#  helper script: builds i945-pwm source code
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#	Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the working directory is the root
# of libreboot_src or git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# Build i945-pwm utility
# --------------------------------------------------------------------

printf "Building i945-pwm\n"

cd "resources/utilities/i945-pwm/"

make clean
# build it
make -j"$(nproc)"

# done. go back to main directory
cd "../../../"

printf "\n\n"


code:
#!/bin/bash

#  helper script: builds ich9deblob source code
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#	Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the working directory is the root
# of libreboot_src or git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# Build ich9deblob utility
# --------------------------------------------------------------------

printf "Building ich9deblob\n"

cd "resources/utilities/ich9deblob/"

# clean it first
make clean

# build ich9deblob
make -j"$(nproc)"

# done. go back to main directory
cd "../../../"

printf "\n\n"


code:
#!/bin/bash

#  helper script: builds memtest86+ source code
#
#	Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
#	Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This script assumes that the working directory is the root
# of libreboot_src or git

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

# Build MemTest86+ payload (for GRUB)
# --------------------------------------------------------------------

printf "Building MemTest86+\n"

cd "memtest86plus/"

# clean it first
make clean

# build memtest86+
make -j"$(nproc)"

# done. go back to main directory
cd "../"

printf "\n\n"


code:
#!/bin/bash

#
#  helper script: generate the documentation release archive
#
#	Copyright (C) 2015 Patrick "P. J." McDermott <pj@pehjota.net>
#	Copyright (C) 2015 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e

printf 'Building the documentation release archive\n'

if [ -f "version" ]; then
	# _src release archive is being used
	version="$(cat version)"
else
	# git repo is being used
	version="$(git describe --tags HEAD)"
fi
versiondir="release/${version}"
distname="libreboot_${version}_docs"
distdir="${versiondir}/${distname}"

[ -d "${versiondir}/" ] || mkdir -p "${versiondir}/"

printf 'Deleting old documentation release archives\n'
rm -f "${distdir}.tar.xz"
rm -Rf "${distdir:?}/"

mkdir -p "${distdir}/"
cp -r docs/* "${distdir}/"

printf '%s\n' "${version}" >"${distdir}/version"

printf 'Creating compressed documentation archive at %s\n' "${distdir}.tar.xz"
(cd "${versiondir}/" && tar -c "${distname}/" | xz -9e >"${distname}.tar.xz")

rm -Rf "${distdir:?}/"

printf 'Documentation release archive is stored in %s/\n' "${versiondir}"