summaryrefslogtreecommitdiffstats
path: root/payloads
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2015-12-11 12:24:33 -0700
committerMartin Roth <martinroth@google.com>2016-02-18 20:53:42 +0100
commitdbae4d03ef6f1915a9508116e1bc9777f4ba33ec (patch)
treec3e80fb4395087c734a3bcba65120805bb966296 /payloads
parent654fd0703ad8f785faa49b22bf59036c6eb47f6c (diff)
downloadcoreboot-dbae4d03ef6f1915a9508116e1bc9777f4ba33ec.tar.gz
coreboot-dbae4d03ef6f1915a9508116e1bc9777f4ba33ec.tar.bz2
coreboot-dbae4d03ef6f1915a9508116e1bc9777f4ba33ec.zip
Payloads: Add U-Boot as a coreboot-payload
- Add Kconfig and Makefile options to use U-Boot as a payload. - Add Kconfig option for extra cbfstool command line arguments. - Add Kconfig & Makefile option to load the payload as a flat binary. - Add u-boot directory to .gitignore. This is currently working for X-86 only. Graphics worked in U-Boot correctly by initializing the VBIOS and setting up a console mode. Tested in QEMU and on Minnowboard Max. Got into U-Boot, have not booted an OS yet. Change-Id: Ia122a4ad7cd7d96107c1552b0376c8106ca8fb92 Signed-off-by: Martin Roth <martinroth@google.com> Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/12714 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads')
-rw-r--r--payloads/Kconfig12
-rw-r--r--payloads/external/Makefile.inc5
-rw-r--r--payloads/external/U-Boot/Kconfig40
-rw-r--r--payloads/external/U-Boot/Kconfig.name11
-rw-r--r--payloads/external/U-Boot/Makefile.inc82
5 files changed, 150 insertions, 0 deletions
diff --git a/payloads/Kconfig b/payloads/Kconfig
index 51c89eae4517..9037b30a67ac 100644
--- a/payloads/Kconfig
+++ b/payloads/Kconfig
@@ -47,5 +47,17 @@ config COMPRESSED_PAYLOAD_LZMA
In order to reduce the size payloads take up in the ROM chip
coreboot can compress them using the LZMA algorithm.
+config PAYLOAD_OPTIONS
+ string
+ default ""
+ help
+ Additional cbfstool options for the payload
+
+config PAYLOAD_IS_FLAT_BINARY
+ def_bool n
+ help
+ Add the payload to cbfs as a flat binary type instead of as an
+ elf payload
+
endmenu
diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc
index 37435071ce74..6a76020ffe2c 100644
--- a/payloads/external/Makefile.inc
+++ b/payloads/external/Makefile.inc
@@ -77,3 +77,8 @@ grub2:
CONFIG_GRUB2_MASTER=$(CONFIG_GRUB2_MASTER)
payloads/external/GRUB2/grub2/build/default_payload.elf: grub2
+
+payloads/external/U-Boot/u-boot/u-boot-dtb.bin u-boot: $(top)/$(DOTCONFIG)
+ $(MAKE) -C payloads/external/U-Boot -f Makefile.inc \
+ CONFIG_UBOOT_MASTER=$(CONFIG_UBOOT_MASTER) \
+ CONFIG_UBOOT_STABLE=$(CONFIG_UBOOT_STABLE)
diff --git a/payloads/external/U-Boot/Kconfig b/payloads/external/U-Boot/Kconfig
new file mode 100644
index 000000000000..2afe1cd5e113
--- /dev/null
+++ b/payloads/external/U-Boot/Kconfig
@@ -0,0 +1,40 @@
+if PAYLOAD_UBOOT
+
+config PAYLOAD_SPECIFIC_OPTIONS # dummy
+ def_bool y
+ select PAYLOAD_IS_FLAT_BINARY
+
+choice
+ prompt "U-Boot version"
+ default UBOOT_STABLE
+
+config UBOOT_STABLE
+ bool "v2016.1"
+ help
+ Stable U-Boot version
+
+config UBOOT_MASTER
+ bool "master"
+ help
+ Newest U-Boot version
+
+endchoice
+
+config PAYLOAD_CONFIGFILE
+ string "U-Boot config file"
+ default ""
+ help
+ This option allows a platform to set Kconfig options for a basic
+ U-Boot payload. In general, if the option is used, the default
+ would be "$(top)/src/mainboard/$(MAINBOARDDIR)/config_uboot"
+ for a config stored in the coreboot mainboard directory, or
+ "$(project_dir)/configs/coreboot-x86_defconfig" to use a config
+ from the U-Boot config directory
+
+config PAYLOAD_FILE
+ default "payloads/external/U-Boot/u-boot/u-boot-dtb.bin"
+
+config PAYLOAD_OPTIONS
+ default "-l 0x1110000 -e 0x1110015"
+
+endif
diff --git a/payloads/external/U-Boot/Kconfig.name b/payloads/external/U-Boot/Kconfig.name
new file mode 100644
index 000000000000..2e6a64c2ad22
--- /dev/null
+++ b/payloads/external/U-Boot/Kconfig.name
@@ -0,0 +1,11 @@
+config PAYLOAD_UBOOT
+ bool "U-Boot (Experimental)"
+ depends on ARCH_X86
+ help
+ Select this option if you want to build a coreboot image
+ with a U-Boot payload.
+
+ See http://coreboot.org/Payloads and U-Boot's documentation
+ at http://git.denx.de/?p=u-boot.git;a=blob;f=doc/README.x86
+ for more information.
+
diff --git a/payloads/external/U-Boot/Makefile.inc b/payloads/external/U-Boot/Makefile.inc
new file mode 100644
index 000000000000..f0abee170edc
--- /dev/null
+++ b/payloads/external/U-Boot/Makefile.inc
@@ -0,0 +1,82 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2015 Google Inc.
+##
+## 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; version 2 of the License.
+##
+## 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.
+##
+
+# 2016-1 tag
+STABLE_COMMIT_ID=fa85e826c16b9ce1ad302a57e9c4b24db0d8b930
+
+TAG-$(CONFIG_UBOOT_MASTER)=origin/master
+TAG-$(CONFIG_UBOOT_STABLE)=$(STABLE_COMMIT_ID)
+
+project_name=U-Boot
+project_dir=u-boot
+project_git_repo=http://git.denx.de/u-boot.git
+project_config_file=$(project_dir)/.config
+
+unexport KCONFIG_AUTOHEADER
+unexport KCONFIG_AUTOCONFIG
+unexport KCONFIG_DEPENDENCIES
+unexport KCONFIG_SPLITCONFIG
+unexport KCONFIG_TRISTATE
+unexport KCONFIG_NEGATIVES
+
+all: build
+
+$(project_dir):
+ echo " Cloning $(project_name) from Git"
+ git clone $(project_git_repo) $(project_dir)
+
+fetch: $(project_dir)
+ifeq ($(CONFIG_UBOOT_MASTER),y)
+ echo " Fetching new commits from the $(project_name) git repo"
+ git fetch
+
+ #master doesn't get a file, so it's continuously updated
+ rm -f $(project_dir)/$(STABLE_COMMIT_ID)
+else
+ cd $(project_dir); git show $(TAG-y) >/dev/null 2>&1 ; if [ $$? -ne 0 ]; \
+ then echo " Fetching new commits from the $(project_name) git repo"; git fetch; fi
+ touch $(project_dir)/$(STABLE_COMMIT_ID)
+endif
+
+$(project_dir)/$(TAG-y): fetch
+ echo " Checking out $(project_name) revision $(TAG-y)"
+ cd $(project_dir); git checkout master; git branch -D coreboot 2>/dev/null; git checkout -b coreboot $(TAG-y)
+
+config: $(project_dir)/$(TAG-y)
+ rm -f $(project_config_file)
+ifneq ($(CONFIG_PAYLOAD_CONFIGFILE),)
+ifneq ("$(wildcard $(CONFIG_PAYLOAD_CONFIGFILE))","")
+ cat $(CONFIG_PAYLOAD_CONFIGFILE)" > $(project_config_file)
+else
+ echo "Error: File $(CONFIG_PAYLOAD_CONFIGFILE) does not exist"
+ false
+endif
+else
+ cat $(project_dir)/configs/coreboot-x86_defconfig >> $(project_config_file)
+endif
+
+ $(MAKE) -C $(project_dir) olddefconfig
+
+build: config
+ echo " MAKE $(project_name) $(TAG-y)"
+ $(MAKE) -C $(project_dir)
+
+clean:
+ test -d $(project_dir) && $(MAKE) -C $(project_dir) clean || exit 0
+
+distclean:
+ rm -rf $(project_dir)
+
+.PHONY: config build clean distclean fetch