From: Carsten Schlote <[email protected]> Added platform config to build a secondary u-boot and the u-boot env target tools.
Signed-off-by: Carsten Schlote <[email protected]> --- platforms/u-boot-lowboot.in | 27 +++++++++++ platforms/u-boot-utils.in | 20 ++++++++ rules/u-boot-lowboot.make | 99 ++++++++++++++++++++++++++++++++++++++++ rules/u-boot-utils.make | 104 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 250 insertions(+), 0 deletions(-) create mode 100644 platforms/u-boot-lowboot.in create mode 100644 platforms/u-boot-utils.in create mode 100644 rules/u-boot-lowboot.make create mode 100644 rules/u-boot-utils.make diff --git a/platforms/u-boot-lowboot.in b/platforms/u-boot-lowboot.in new file mode 100644 index 0000000..5d8e849 --- /dev/null +++ b/platforms/u-boot-lowboot.in @@ -0,0 +1,27 @@ +## SECTION=bootloader + +config U_BOOT_LOWBOOT + bool + prompt "u-boot-lowboot" + depends on U_BOOT && (ARCH_PPC) + help + Also compile and build for lowboot location bootloader + +if ARCH_PPC + +config U_BOOT_LOWBOOT_CONFIG + string + prompt "Alternate config name" + default "phycore_mpc5200b_tiny_LOWBOOT32_config" + help + Alternate config name for u-boot + +config U_BOOT_LOWBOOT_POSTFIX + string + prompt "u-boot.bin postfix" + default "fe" + help + Alternate name postfix for u-boot.bin + +endif + diff --git a/platforms/u-boot-utils.in b/platforms/u-boot-utils.in new file mode 100644 index 0000000..7c23182 --- /dev/null +++ b/platforms/u-boot-utils.in @@ -0,0 +1,20 @@ +## SECTION=bootloader + +config U_BOOT_UTILS + bool + prompt "u-boot target utils" + depends on U_BOOT + help + Also compile and build for u-boot target utils + +if U_BOOT_UTILS + +config U_BOOT_UTILS_FW_ENV + bool + prompt "Compile fw_env util" + help + Build the fw_env tool. Patch sources as needed for + your platform. + +endif + diff --git a/rules/u-boot-lowboot.make b/rules/u-boot-lowboot.make new file mode 100644 index 0000000..fbc1623 --- /dev/null +++ b/rules/u-boot-lowboot.make @@ -0,0 +1,99 @@ +# -*-makefile-*- +# $Id$ +# +# Copyright (C) 2009 by Carsten Schlote <[email protected]> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_U_BOOT_LOWBOOT) += u-boot-lowboot + +# +# Paths and names +# +U_BOOT_LOWBOOT := u-boot-lowboot-$(U_BOOT_VERSION) +U_BOOT_LOWBOOT_DIR := $(BUILDDIR)/$(U_BOOT_LOWBOOT) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +$(STATEDIR)/u-boot-lowboot.get: $(U_BOOT_SOURCE) + @$(call targetinfo) + @$(call touch) + +$(STATEDIR)/u-boot-lowboot.extract: + @$(call targetinfo) + @$(call clean, $(U_BOOT_LOWBOOT_DIR)) + @$(call extract, U_BOOT, $(U_BOOT_LOWBOOT_DIR)-tmp) + @mv $(U_BOOT_LOWBOOT_DIR)-tmp/$(U_BOOT) $(U_BOOT_LOWBOOT_DIR) + @rm -rf $(U_BOOT_LOWBOOT_DIR)-tmp + @$(call patchin, U_BOOT, $(U_BOOT_LOWBOOT_DIR)) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +U_BOOT_LOWBOOT_PATH := PATH=$(CROSS_PATH) +U_BOOT_LOWBOOT_ENV := CROSS_COMPILE=$(COMPILER_PREFIX) + +# +# autoconf +# +U_BOOT_LOWBOOT_AUTOCONF := $(CROSS_AUTOCONF_USR) + +$(STATEDIR)/u-boot-lowboot.prepare: + @$(call targetinfo) + @$(call clean, $(U_BOOT_LOWBOOT_DIR)/config.cache) + cd $(U_BOOT_LOWBOOT_DIR) && \ + $(U_BOOT_LOWBOOT_PATH) $(U_BOOT_LOWBOOT_ENV) \ + $(MAKE) $(PTXCONF_U_BOOT_LOWBOOT_CONFIG) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +$(STATEDIR)/u-boot-lowboot.compile: + @$(call targetinfo) + cd $(U_BOOT_LOWBOOT_DIR) && \ + $(U_BOOT_LOWBOOT_PATH) $(U_BOOT_LOWBOOT_ENV) \ + $(MAKE) $(PARALLELMFLAGS_BROKEN) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/u-boot-lowboot.install: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/u-boot-lowboot.targetinstall: + @$(call targetinfo) + + @install -D -m644 $(U_BOOT_LOWBOOT_DIR)/u-boot.bin $(IMAGEDIR)/u-boot.bin.$(PTXCONF_U_BOOT_LOWBOOT_POSTFIX) + + @$(call touch) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +u-boot-lowboot_clean: + rm -rf $(STATEDIR)/u-boot-lowboot.* + rm -rf $(PKGDIR)/u-boot-lowboot_* + rm -rf $(U_BOOT_LOWBOOT_DIR) + +# vim: syntax=make diff --git a/rules/u-boot-utils.make b/rules/u-boot-utils.make new file mode 100644 index 0000000..595832d --- /dev/null +++ b/rules/u-boot-utils.make @@ -0,0 +1,104 @@ +# -*-makefile-*- +# $Id$ +# +# Copyright (C) 2009 by Carsten Schlote <[email protected]> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_U_BOOT_UTILS) += u-boot-utils + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +$(STATEDIR)/u-boot-utils.get: $(U_BOOT_SOURCE) + @$(call targetinfo) + @$(call touch) + +$(STATEDIR)/u-boot-utils.extract: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +U_BOOT_UTILS_PATH := PATH=$(CROSS_PATH) +U_BOOT_UTILS_ENV = CROSS_COMPILE=$(COMPILER_PREFIX) \ + TOPDIR=$(U_BOOT_DIR) \ + SRCTREE=$(U_BOOT_DIR) \ + OBJTREE=$(U_BOOT_DIR) + + ifdef PTXCONF_U_BOOT_UTILS +$(STATEDIR)/u-boot-utils.prepare: $(STATEDIR)/u-boot.compile + endif + +$(STATEDIR)/u-boot-utils.prepare: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +$(STATEDIR)/u-boot-utils.compile: + @$(call targetinfo) + cd $(U_BOOT_DIR)/tools/env && \ + $(U_BOOT_PATH) $(U_BOOT_ENV) $(U_BOOT_UTILS_ENV) \ + $(MAKE) $(PARALLELMFLAGS_BROKEN) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/u-boot-utils.install: + @$(call targetinfo) + install -D -m644 $(U_BOOT_DIR)/tools/env/fw_env.config $(PTXCONF_SYSROOT_TARGET)/etc/fw_env.config + + install -D -m755 $(U_BOOT_DIR)/tools/env/fw_printenv $(PTXCONF_SYSROOT_TARGET)/sbin/fw_printenv + ln -sf fw_printenv $(PTXCONF_SYSROOT_TARGET)/sbin/fw_setenv + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/u-boot-utils.targetinstall: + @$(call targetinfo) + + @$(call install_init, u-boot-utils) + @$(call install_fixup, u-boot-utils,PACKAGE,u-boot-utils) + @$(call install_fixup, u-boot-utils,PRIORITY,optional) + @$(call install_fixup, u-boot-utils,VERSION,$(U_BOOT_VERSION)) + @$(call install_fixup, u-boot-utils,SECTION,base) + @$(call install_fixup, u-boot-utils,AUTHOR,"Carsten Schlote <[email protected]>") + @$(call install_fixup, u-boot-utils,DEPENDS,) + @$(call install_fixup, u-boot-utils,DESCRIPTION,missing) + + @$(call install_copy, u-boot-utils, 0, 0, 0755, $(U_BOOT_DIR)/tools/env/fw_env.config, /etc/fw_env.config) + + @$(call install_copy, u-boot-utils, 0, 0, 0755, $(U_BOOT_DIR)/tools/env/fw_printenv, /sbin/fw_printenv) + @$(call install_link, u-boot-utils, fw_printenv, /sbin/fw_setenv) + + @$(call install_finish, u-boot-utils) + + @$(call touch) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +u-boot-utils_clean: + rm -rf $(STATEDIR)/u-boot-utils.* + rm -rf $(PKGDIR)/u-boot-utils_* +# rm -rf $(U_BOOT_DIR) + +# vim: syntax=make -- 1.6.5.6.gb3118 -- ptxdist mailing list [email protected]
