2017-09-22 20:17:05 +00:00
|
|
|
modules-$(CONFIG_COREBOOT) += coreboot
|
2016-08-03 01:49:22 +00:00
|
|
|
|
2017-02-01 16:50:52 +00:00
|
|
|
#coreboot_version := git
|
|
|
|
#coreboot_repo := https://github.com/osresearch/coreboot
|
2018-01-21 01:29:43 +00:00
|
|
|
coreboot_version := 4.7
|
2018-05-02 15:38:39 +00:00
|
|
|
coreboot_base_dir := coreboot-$(coreboot_version)
|
|
|
|
coreboot_dir := $(coreboot_base_dir)/$(BOARD)
|
2017-02-01 16:50:52 +00:00
|
|
|
coreboot_tar := coreboot-$(coreboot_version).tar.xz
|
|
|
|
coreboot_url := https://www.coreboot.org/releases/$(coreboot_tar)
|
2018-01-21 01:29:43 +00:00
|
|
|
coreboot_hash := d68a83f8f687e8ea212b8c5bb501e24444b57c3f73896042d09628188c851368
|
2016-08-19 15:31:07 +00:00
|
|
|
|
2016-11-23 17:11:08 +00:00
|
|
|
# Coreboot builds are specialized on a per-target basis.
|
|
|
|
# The builds are done in a per-target subdirectory
|
2018-02-05 16:56:15 +00:00
|
|
|
CONFIG_COREBOOT_CONFIG ?= config/coreboot-$(BOARD).config
|
2016-11-23 17:11:08 +00:00
|
|
|
|
2017-01-29 01:21:47 +00:00
|
|
|
EXTRA_FLAGS := -fdebug-prefix-map=$(pwd)=heads -gno-record-gcc-switches
|
|
|
|
|
2016-11-23 17:11:08 +00:00
|
|
|
coreboot_configure := \
|
2018-05-02 15:38:39 +00:00
|
|
|
$(MAKE) -C $(build)/$(coreboot_base_dir) \
|
2017-01-29 01:21:47 +00:00
|
|
|
oldconfig \
|
2018-05-02 15:38:39 +00:00
|
|
|
obj=$(build)/$(coreboot_dir) \
|
2018-02-05 16:56:15 +00:00
|
|
|
DOTCONFIG=../../$(CONFIG_COREBOOT_CONFIG) \
|
2017-02-01 18:39:56 +00:00
|
|
|
BUILD_TIMELESS=1 \
|
2017-01-29 01:21:47 +00:00
|
|
|
CFLAGS_x86_32="$(EXTRA_FLAGS)" \
|
|
|
|
CFLAGS_x86_64="$(EXTRA_FLAGS)" \
|
2016-11-23 17:11:08 +00:00
|
|
|
|
|
|
|
coreboot_target := \
|
2018-05-02 15:38:39 +00:00
|
|
|
-C $(build)/$(coreboot_base_dir) \
|
|
|
|
obj=$(build)/$(coreboot_dir) \
|
2018-02-05 16:56:15 +00:00
|
|
|
DOTCONFIG=../../$(CONFIG_COREBOOT_CONFIG) \
|
2017-02-01 18:39:56 +00:00
|
|
|
BUILD_TIMELESS=1 \
|
2017-01-29 01:21:47 +00:00
|
|
|
CFLAGS_x86_32="$(EXTRA_FLAGS)" \
|
|
|
|
CFLAGS_x86_64="$(EXTRA_FLAGS)" \
|
2017-03-21 18:29:07 +00:00
|
|
|
$(MAKE_JOBS)
|
2016-11-23 17:11:08 +00:00
|
|
|
|
2018-05-02 15:38:39 +00:00
|
|
|
coreboot_output := coreboot.rom
|
|
|
|
coreboot_depend += linux initrd
|
2016-11-23 17:11:08 +00:00
|
|
|
|
2016-08-03 01:49:22 +00:00
|
|
|
# hack to force a build dependency on the cross compiler
|
2018-05-02 15:38:39 +00:00
|
|
|
$(build)/$(coreboot_dir)/.configured: $(build)/$(coreboot_base_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc
|
|
|
|
$(build)/$(coreboot_base_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc: $(build)/$(coreboot_base_dir)/.canary
|
2016-11-23 17:11:08 +00:00
|
|
|
echo '******* Building crossgcc-i386 (this might take a while) ******'
|
2018-05-02 15:38:39 +00:00
|
|
|
$(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=`nproc` crossgcc-i386
|
2016-11-23 17:11:08 +00:00
|
|
|
#echo '******* Building crossgcc-arm (this might take a while) ******'
|
2018-05-02 15:38:39 +00:00
|
|
|
#$(MAKE) -C "$(build)/$(coreboot_base_dir)" crossgcc-arm
|
|
|
|
|
|
|
|
# Force a rebuild if the inputs have changed
|
|
|
|
$(build)/$(coreboot_dir)/.build: \
|
|
|
|
$(build)/$(BOARD)/bzImage \
|
|
|
|
$(build)/$(BOARD)/initrd.cpio.xz \
|
|
|
|
|
2016-08-14 20:03:11 +00:00
|
|
|
|
2018-02-13 18:20:04 +00:00
|
|
|
#
|
|
|
|
# Helpful target for reconfiguring the coreboot target
|
|
|
|
#
|
|
|
|
coreboot.menuconfig:
|
|
|
|
$(MAKE) \
|
2018-05-02 15:38:39 +00:00
|
|
|
-C "$(build)/$(coreboot_base_dir)" \
|
2018-02-13 18:20:04 +00:00
|
|
|
DOTCONFIG="../../$(CONFIG_COREBOOT_CONFIG)" \
|
|
|
|
menuconfig
|
|
|
|
|
2017-02-01 16:50:52 +00:00
|
|
|
|
|
|
|
# if we are not building from a git checkout,
|
|
|
|
# we must also download the coreboot-blobs tree
|
2018-02-05 16:56:15 +00:00
|
|
|
ifneq "$(coreboot_version)" "git"
|
|
|
|
|
2017-02-01 16:50:52 +00:00
|
|
|
coreboot_depends += coreboot-blobs
|
2017-03-31 15:18:46 +00:00
|
|
|
modules-y += coreboot-blobs
|
2017-02-01 16:50:52 +00:00
|
|
|
|
|
|
|
coreboot-blobs_version := $(coreboot_version)
|
|
|
|
coreboot-blobs_tar := coreboot-blobs-$(coreboot-blobs_version).tar.xz
|
|
|
|
coreboot-blobs_dir := coreboot-$(coreboot-blobs_version)/3rdparty/blobs
|
|
|
|
coreboot-blobs_url := https://www.coreboot.org/releases/$(coreboot-blobs_tar)
|
2018-01-21 01:29:43 +00:00
|
|
|
coreboot-blobs_hash := 443379a2207e350747cbbfe7968ceafddc7dd8563b067476f755ff11791bb5f5
|
2017-02-01 16:50:52 +00:00
|
|
|
|
2016-08-14 20:03:11 +00:00
|
|
|
## there is nothing to build for the blobs, this should be
|
|
|
|
## made easier to make happen
|
2017-02-01 16:50:52 +00:00
|
|
|
coreboot-blobs_output := .built
|
|
|
|
coreboot-blobs_configure := echo -e 'all:\n\ttouch .built' > Makefile
|
2016-08-14 20:03:11 +00:00
|
|
|
|
2017-02-01 16:50:52 +00:00
|
|
|
endif
|