This bootstrap package is required on at91sam* boards where dataflash/nandflash is used to boot from. In these cases the internal bootROM of the AT91 core is used to boot the board with.
Signed-off-by: Remy Bohmer <li...@bohmer.net> --- platforms/Kconfig | 1 + platforms/at91bootstrap.in | 64 +++++++++++++++++++++++ rules/at91bootstrap.make | 119 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 184 insertions(+), 0 deletions(-) create mode 100644 platforms/at91bootstrap.in create mode 100644 rules/at91bootstrap.make diff --git a/platforms/Kconfig b/platforms/Kconfig index 5cd8787..389b9ef 100644 --- a/platforms/Kconfig +++ b/platforms/Kconfig @@ -41,6 +41,7 @@ menu "bootloaders " source "platforms/grub.in" source "platforms/u-boot.in" source "platforms/u-boot-v2.in" +source "platforms/at91bootstrap.in" endmenu diff --git a/platforms/at91bootstrap.in b/platforms/at91bootstrap.in new file mode 100644 index 0000000..d5bc117 --- /dev/null +++ b/platforms/at91bootstrap.in @@ -0,0 +1,64 @@ +menuconfig AT91BOOTSTRAP + bool + depends on ARCH_ARM_AT91SAM926X + prompt "Build dataflash bootstrap for AT91SAM926*" + help + The AT91Bootstrap application is a first level bootloader + for Atmel AT91SAM9 ARM Thumb-based microcontrollers. + It is used for booting these microcontrollers from SPI dataflash + or NAND-flash. + + For example, using this bootstrap, it is possible to + obtain a basic bootloader that is located in DataFlash and is + copied to internal SRAM by SAM-BA Boot (internal bootROM). The + bootloader performs the processor initialization (PLLs, PIOs, + SDRAMC, SPI), loads UBoot from DataFlash sectors to SDRAM and + then jumps to it. + + It is required for these microcontrollers, because the bootROM of some + of these cores can only handle a miximum of 4kB of the 1st stage + bootloader (e.g. SRAM limits). U-boot is usually much larger + than this. + + U-boot is normally build with the options CONFIG_SKIP_LOWLEVEL_INIT + and CONFIG_SKIP_RELOCATE_UBOOT + + AT91Bootstrap integrates several sets of algorithms: + - Device initialization such as clock speed configuration, PIO settings, etc. + - Peripheral drivers such as PIO, PMC, SDRAMC, etc. + - Physical media algorithms such as DataFlash, NANDFlash, Parallel Flash, etc. + + +if AT91BOOTSTRAP + +config AT91BOOTSTRAP_VERSION + string + default 1.11 + prompt "AT91 Bootstrap version" + help + Enter the AT91 Bootstrap version you want to build. Usally something like "1.11" + +config AT91BOOTSTRAP_CONFIG + string + prompt "AT91 Bootstrap config target" + help + The AT91 Bootstrap make config target. Usually something like + "at91sam9261ek". See AT91 Bootstrap's 'board' directory for possible + configuration targets. + +choice + prompt "Boot medium" + default AT91BOOTSTRAP_BOOT_DATAFLASH + + config AT91BOOTSTRAP_BOOT_DATAFLASH + bool + prompt "Boot from SPI dataflash" + + config AT91BOOTSTRAP_BOOT_NAND + bool + prompt "Boot from NAND-flash" + + +endchoice + +endif diff --git a/rules/at91bootstrap.make b/rules/at91bootstrap.make new file mode 100644 index 0000000..3540a14 --- /dev/null +++ b/rules/at91bootstrap.make @@ -0,0 +1,119 @@ +# -*-makefile-*- +# $Id: template 6655 2007-01-02 12:55:21Z rsc $ +# +# Copyright (C) 2008 by Remy Bohmer <li...@bohmer.net> +# +# 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_AT91BOOTSTRAP) += at91bootstrap + +# +# Paths and names +# +AT91BOOTSTRAP_VERSION := $(call remove_quotes,$(PTXCONF_AT91BOOTSTRAP_VERSION)) +AT91BOOTSTRAP := AT91Bootstrap$(AT91BOOTSTRAP_VERSION) +AT91BOOTSTRAP_EXTRACT := Bootstrap-v$(AT91BOOTSTRAP_VERSION) +AT91BOOTSTRAP_SUFFIX := zip +AT91BOOTSTRAP_URL := http://www.atmel.com/dyn/resources/prod_documents/$(AT91BOOTSTRAP).$(AT91BOOTSTRAP_SUFFIX) +AT91BOOTSTRAP_SOURCE := $(SRCDIR)/$(AT91BOOTSTRAP).$(AT91BOOTSTRAP_SUFFIX) +AT91BOOTSTRAP_DIR := $(BUILDDIR)/$(AT91BOOTSTRAP_EXTRACT) + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +at91bootstrap_get: $(STATEDIR)/at91bootstrap.get + +$(STATEDIR)/at91bootstrap.get: $(at91bootstrap_get_deps_default) + @$(call targetinfo, $@) + @$(call touch, $@) + +$(AT91BOOTSTRAP_SOURCE): + @$(call targetinfo, $@) + @$(call get, AT91BOOTSTRAP) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +at91bootstrap_extract: $(STATEDIR)/at91bootstrap.extract + +$(STATEDIR)/at91bootstrap.extract: $(at91bootstrap_extract_deps_default) + @$(call targetinfo, $@) + @$(call clean, $(AT91BOOTSTRAP_DIR)) + @$(call extract, AT91BOOTSTRAP) + @$(call patchin, AT91BOOTSTRAP_EXTRACT) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +at91bootstrap_prepare: $(STATEDIR)/at91bootstrap.prepare + +$(STATEDIR)/at91bootstrap.prepare: $(at91bootstrap_prepare_deps_default) + @$(call targetinfo, $@) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +at91bootstrap_compile: $(STATEDIR)/at91bootstrap.compile + +AT91BOOTSTRAP_PATH := PATH=$(CROSS_PATH) +AT91BOOTSTRAP_ENV := CROSS_COMPILE=$(COMPILER_PREFIX) + +ifdef PTXCONF_AT91BOOTSTRAP_BOOT_DATAFLASH +AT91BOOTSTRAP_BOOTMEDIA := dataflash +endif +ifdef PTXCONF_AT91BOOTSTRAP_BOOT_NAND +AT91BOOTSTRAP_BOOTMEDIA := nandflash +endif + +AT91BOOTSTRAP_BOARDDIR := $(AT91BOOTSTRAP_DIR)/board/${PTXCONF_AT91BOOTSTRAP_CONFIG}/$(AT91BOOTSTRAP_BOOTMEDIA) + +$(STATEDIR)/at91bootstrap.compile: $(at91bootstrap_compile_deps_default) + @$(call targetinfo, $@) + @cd $(AT91BOOTSTRAP_BOARDDIR) && $(AT91BOOTSTRAP_PATH) $(AT91BOOTSTRAP_ENV) $(MAKE) $(PARALLELMFLAGS_BROKEN) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +at91bootstrap_install: $(STATEDIR)/at91bootstrap.install + +$(STATEDIR)/at91bootstrap.install: $(at91bootstrap_install_deps_default) + @$(call targetinfo, $@) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +at91bootstrap_targetinstall: $(STATEDIR)/at91bootstrap.targetinstall + +$(STATEDIR)/at91bootstrap.targetinstall: $(at91bootstrap_targetinstall_deps_default) + @$(call targetinfo, $@) + @cp $(AT91BOOTSTRAP_BOARDDIR)/$(AT91BOOTSTRAP_BOOTMEDIA)_${PTXCONF_AT91BOOTSTRAP_CONFIG}.bin \ + $(IMAGEDIR)/at91bootstrap.bin + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +at91bootstrap_clean: + @rm -rf $(STATEDIR)/at91bootstrap.* + @rm -rf $(IMAGEDIR)/at91bootstrap_* + @rm -rf $(AT91BOOTSTRAP_DIR) + +# vim: syntax=make -- 1.5.6.3 -- ptxdist mailing list ptxdist@pengutronix.de