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>lime2-spi
parent
6ace36e19a
commit
ceeee8f7b5
@ -0,0 +1,41 @@ |
||||
// SPDX-License-Identifier: GPL-2.0+ |
||||
/* |
||||
* Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com> |
||||
* |
||||
* Generic coreboot payload device tree for x86 targets |
||||
*/ |
||||
|
||||
/dts-v1/; |
||||
|
||||
/include/ "skeleton.dtsi" |
||||
/include/ "serial.dtsi" |
||||
/include/ "keyboard.dtsi" |
||||
/include/ "reset.dtsi" |
||||
/include/ "rtc.dtsi" |
||||
/include/ "tsc_timer.dtsi" |
||||
|
||||
/ { |
||||
model = "coreboot x86 payload"; |
||||
compatible = "coreboot,x86-payload"; |
||||
|
||||
aliases { |
||||
serial0 = &serial; |
||||
}; |
||||
|
||||
config { |
||||
silent_console = <0>; |
||||
}; |
||||
|
||||
chosen { |
||||
stdout-path = "/serial"; |
||||
}; |
||||
|
||||
pci { |
||||
compatible = "pci-x86"; |
||||
u-boot,dm-pre-reloc; |
||||
}; |
||||
|
||||
coreboot-fb { |
||||
compatible = "coreboot-fb"; |
||||
}; |
||||
}; |
@ -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; |
||||
} |
@ -0,0 +1,32 @@ |
||||
/* SPDX-License-Identifier: GPL-2.0+ */ |
||||
/*
|
||||
* Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com> |
||||
*/ |
||||
|
||||
/*
|
||||
* board/config.h - configuration options, board specific |
||||
*/ |
||||
|
||||
#ifndef __CONFIG_H |
||||
#define __CONFIG_H |
||||
|
||||
#include <configs/x86-common.h> |
||||
|
||||
#define CONFIG_SYS_MONITOR_LEN (1 << 20) |
||||
|
||||
#define CONFIG_STD_DEVICES_SETTINGS "stdin=serial,i8042-kbd,usbkbd\0" \ |
||||
"stdout=serial,vidconsole\0" \
|
||||
"stderr=serial,vidconsole\0" |
||||
|
||||
/* ATA/IDE support */ |
||||
#define CONFIG_SYS_IDE_MAXBUS 2 |
||||
#define CONFIG_SYS_IDE_MAXDEVICE 4 |
||||
#define CONFIG_SYS_ATA_BASE_ADDR 0 |
||||
#define CONFIG_SYS_ATA_DATA_OFFSET 0 |
||||
#define CONFIG_SYS_ATA_REG_OFFSET 0 |
||||
#define CONFIG_SYS_ATA_ALT_OFFSET 0 |
||||
#define CONFIG_SYS_ATA_IDE0_OFFSET 0x1f0 |
||||
#define CONFIG_SYS_ATA_IDE1_OFFSET 0x170 |
||||
#define CONFIG_ATAPI |
||||
|
||||
#endif /* __CONFIG_H */ |
Loading…
Reference in new issue