x86: coreboot: Add generic coreboot payload support

Currently building U-Boot as the coreboot payload requires user
to change the build configuration for a specific board during
menuconfig process. This uses the board's native device tree
to configure the hardware. For example, the device tree provides
PCI address range for the PCI host controller and U-Boot will
re-program all PCI devices' BAR to be within this range. In order
to make sure we don't mess up the hardware, we should guarantee
the range matches what coreboot programs the chipset.

But we really should make the coreboot payload support easier.
Just like EFI payload, we can create a generic coreboot payload
for all x86 boards as well. The payload is configured to include
as many generic drivers as possible. All stuff that touches low
level initialization are not allowed as such is the coreboot's
responsibility. Platform specific drivers (like gpio, spi, etc)
are not included.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
This commit is contained in:
Bin Meng
2018-08-10 02:39:33 -07:00
parent 6ace36e19a
commit ceeee8f7b5
11 changed files with 116 additions and 67 deletions

View File

@@ -9,35 +9,15 @@ config SYS_VENDOR
config SYS_SOC
default "coreboot"
config SYS_CONFIG_NAME
default "coreboot"
config SYS_TEXT_BASE
default 0x01110000
config BOARD_SPECIFIC_OPTIONS # dummy
def_bool y
imply SPI_FLASH_ATMEL
imply SPI_FLASH_EON
imply SPI_FLASH_GIGADEVICE
imply SPI_FLASH_MACRONIX
imply SPI_FLASH_SPANSION
imply SPI_FLASH_STMICRO
imply SPI_FLASH_SST
imply SPI_FLASH_WINBOND
comment "coreboot-specific options"
config SYS_CONFIG_NAME
string "Board configuration file"
default "qemu-x86"
help
This option selects the board configuration file in include/configs/
directory to be used to build U-Boot for coreboot.
config DEFAULT_DEVICE_TREE
string "Board Device Tree Source (dts) file"
default "qemu-x86_i440fx"
help
This option selects the board Device Tree Source (dts) file in
arch/x86/dts/ directory to be used to build U-Boot for coreboot.
select BOARD_EARLY_INIT_R
config SYS_CAR_ADDR
hex "Board specific Cache-As-RAM (CAR) address"

View File

@@ -10,4 +10,4 @@
# (C) Copyright 2002
# Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
obj-y += coreboot_start.o
obj-y += start.o coreboot.o

View File

@@ -0,0 +1,17 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
*/
#include <common.h>
int board_early_init_r(void)
{
/*
* Make sure PCI bus is enumerated so that peripherals on the PCI bus
* can be discovered by their drivers
*/
pci_init();
return 0;
}