[coreboot-gerrit] Patch set updated for coreboot: Payloads: Add U-Boot as a coreboot-payload
Leroy P Leahy (leroy.p.leahy@intel.com)
gerrit at coreboot.org
Wed Feb 10 17:21:20 CET 2016
Leroy P Leahy (leroy.p.leahy at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12714
-gerrit
commit ccbb5d570902e3ee45691bb234962cddd508c2a7
Author: Martin Roth <martinroth at google.com>
Date: Fri Dec 11 12:24:33 2015 -0700
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.
I haven't tried graphics.
Tested in QEMU and on Minnowboard Max
Change-Id: Ia122a4ad7cd7d96107c1552b0376c8106ca8fb92
Signed-off-by: Martin Roth <martinroth at google.com>
Signed-off-by: Lee Leahy <leroy.p.leahy at intel.com>
---
.gitignore | 1 +
Makefile.inc | 10 +++++-
payloads/Kconfig | 12 +++++++
payloads/external/Makefile.inc | 5 +++
payloads/external/U-Boot/Kconfig | 36 +++++++++++++++++++
payloads/external/U-Boot/Kconfig.name | 11 ++++++
payloads/external/U-Boot/Makefile.inc | 68 +++++++++++++++++++++++++++++++++++
7 files changed, 142 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 114d78f..581c4a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@ coreboot-builds/
payloads/external/FILO/filo/
payloads/external/GRUB2/grub2/
payloads/external/SeaBIOS/seabios/
+payloads/external/U-Boot/u-boot/
util/crossgcc/acpica-unix-*/
util/crossgcc/binutils-*/
util/crossgcc/build-*BINUTILS/
diff --git a/Makefile.inc b/Makefile.inc
index c29ae34..808ab0a 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -448,6 +448,7 @@ clean-for-update-target:
rm -f $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.* $(obj)/dsdt.*
rm -f $(obj)/cpu/x86/smm/smm_bin.c $(obj)/cpu/x86/smm/smm.* $(obj)/cpu/x86/smm/smm
$(MAKE) -C payloads/external/SeaBIOS -f Makefile.inc clean
+ $(MAKE) -C payloads/external/U-Boot -f Makefile.inc clean
clean-target:
rm -f $(obj)/coreboot*
@@ -593,7 +594,7 @@ define cbfs-add-cmd-for-region
add$(if $(filter stage,$(call extract_nth,3,$(1))),-stage)$(if $(filter payload,$(call extract_nth,3,$(1))),-payload) \
-f $(call extract_nth,1,$(1)) \
-n $(call extract_nth,2,$(1)) \
- $(if $(filter-out stage,$(call extract_nth,3,$(1))),-t $(call extract_nth,3,$(1))) \
+ $(if $(filter-out flat-binary,$(filter-out stage,$(call extract_nth,3,$(1)))),-t $(call extract_nth,3,$(1))) \
$(if $(call extract_nth,4,$(1)),-c $(call extract_nth,4,$(1))) \
$(cbfs-autogen-attributes) \
-r $(2) \
@@ -730,6 +731,9 @@ ifneq ($(strip $(call strip_quotes,$(CONFIG_LINUX_INITRD))),)
ADDITIONAL_PAYLOAD_CONFIG+=-I $(CONFIG_LINUX_INITRD)
endif
endif
+ifneq ($(strip $(call strip_quotes,$(CONFIG_PAYLOAD_OPTIONS))),)
+ ADDITIONAL_PAYLOAD_CONFIG+=$(strip $(call strip_quotes,$(CONFIG_PAYLOAD_OPTIONS)))
+endif
ifeq ($(CONFIG_HAVE_REFCODE_BLOB),y)
REFCODE_BLOB=$(obj)/refcode.rmod
@@ -790,7 +794,11 @@ $(CONFIG_CBFS_PREFIX)/ramstage-compression := $(CBFS_COMPRESS_FLAG)
cbfs-files-y += $(CONFIG_CBFS_PREFIX)/payload
$(CONFIG_CBFS_PREFIX)/payload-file := $(CONFIG_PAYLOAD_FILE)
+ifeq ($(CONFIG_PAYLOAD_IS_FLAT_BINARY),y)
+$(CONFIG_CBFS_PREFIX)/payload-type := flat-binary
+else
$(CONFIG_CBFS_PREFIX)/payload-type := payload
+endif
$(CONFIG_CBFS_PREFIX)/payload-compression := $(CBFS_PAYLOAD_COMPRESS_FLAG)
$(CONFIG_CBFS_PREFIX)/payload-options := $(ADDITIONAL_PAYLOAD_CONFIG)
diff --git a/payloads/Kconfig b/payloads/Kconfig
index 51c89ea..9037b30 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 3743507..94904b7 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:
+ $(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 0000000..e9fc4ac
--- /dev/null
+++ b/payloads/external/U-Boot/Kconfig
@@ -0,0 +1,36 @@
+config PAYLOAD_UBOOT
+ select PAYLOAD_IS_FLAT_BINARY
+
+if PAYLOAD_UBOOT
+
+choice
+ prompt "U-Boot version"
+ default UBOOT_STABLE
+
+config UBOOT_STABLE
+ bool "v2015.10"
+ 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"
+
+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 0000000..960869a
--- /dev/null
+++ b/payloads/external/U-Boot/Kconfig.name
@@ -0,0 +1,11 @@
+config PAYLOAD_UBOOT
+ bool "U-Boot"
+ 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 0000000..1e05886
--- /dev/null
+++ b/payloads/external/U-Boot/Makefile.inc
@@ -0,0 +1,68 @@
+##
+## 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.
+##
+
+TAG-$(CONFIG_UBOOT_MASTER)=origin/master
+TAG-$(CONFIG_UBOOT_STABLE)=5ec0003b19cbdf06ccd6941237cbc0d1c3468e2d
+
+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)
+ 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
+
+checkout: 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: checkout
+ 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
+endif
+ cat $(project_dir)/configs/coreboot-x86_defconfig >> $(project_config_file)
+ $(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: checkout config build clean distclean clone fetch
More information about the coreboot-gerrit
mailing list