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.
Patch Version 2: * Cleanup of Kconfig files * Added patch to align U-boot load addr to dataflash sector boundaries This is what mainline U-boot demands, and what clearly is a bug in the original Atmel's Bootstrap code. * Added Kconfig option for selection between dataflash and nandflash * Upgraded template of Makefile. Signed-off-by: Remy Bohmer <[EMAIL PROTECTED]> --- patches/Bootstrap-v1.9/generic/align-u-boot-start-address-to-dataflash-sectors.patch | 108 +++++++++ patches/Bootstrap-v1.9/generic/series | 1 platforms/Kconfig | 1 platforms/at91bootstrap.in | 55 ++++ rules/at91bootstrap.make | 111 ++++++++++ 5 files changed, 276 insertions(+) Index: ptxdist-trunk/platforms/at91bootstrap.in =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ptxdist-trunk/platforms/at91bootstrap.in 2008-08-09 00:14:17.000000000 +0200 @@ -0,0 +1,55 @@ +menuconfig AT91BOOTSTRAP + bool + depends on ARCH_ARM_AT91SAM926X + prompt "Build AT91 bootstrap for AT91SAM926*" + help + The AT91Bootstrap application is a first level bootloader + for Atmel AT91SAM9 ARM Thumb-based microcontrollers. + AT91Bootstrap also provides examples, for a particular device, on + how to perform basic static configurations, such as PMC and + PIOs. + 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, etc. + For example, using this set of algorithms, it is possible to + obtain a basic bootloader that is located in DataFlash and is + copied to internal SRAM by SAM-BA Boot. The bootloader performs + the processor initialization (PLLs, PIOs, SDRAMC, SPI), loads UBoot + from DataFlash sectors to SDRAM and then jumps to it. + http://www.atmel.com/dyn/resources/prod_documents/doc6277.pdf + +if AT91BOOTSTRAP + +config AT91BOOTSTRAP_VERSION + string + default 1.9 + prompt "AT91 Bootstrap version" + help + Enter the AT91 Bootstrap version you want to build. + Usally something like "1.9" + +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 "AT91 Bootstrap boot media" + help + The Bootstrap code can be build for several types of flash. + Please choose one. + + config AT91BOOTSTRAP_DATAFLASH + bool "AT45 Dataflash" + + config AT91BOOTSTRAP_NANDFLASH + bool "NAND-flash " + +endchoice + +endif Index: ptxdist-trunk/rules/at91bootstrap.make =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ptxdist-trunk/rules/at91bootstrap.make 2008-08-09 00:14:17.000000000 +0200 @@ -0,0 +1,111 @@ +# -*-makefile-*- +# $Id: template-make 8509 2008-06-12 12:45:40Z mkl $ +# +# Copyright (C) 2008 by Remy Bohmer <[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_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) + +ifdef PTXCONF_AT91BOOTSTRAP_DATAFLASH +AT91BOOTSTRAP_TYPE := dataflash +endif + +ifdef PTXCONF_AT91BOOTSTRAP_NANDFLASH +AT91BOOTSTRAP_TYPE := nandflash +endif + +AT91BOOTSTRAP_BUILDDIR := ${AT91BOOTSTRAP_DIR}/board/${PTXCONF_AT91BOOTSTRAP_CONFIG}/${AT91BOOTSTRAP_TYPE} +AT91BOOTSTRAP_IMAGE := ${AT91BOOTSTRAP_TYPE}_${PTXCONF_AT91BOOTSTRAP_CONFIG}.bin + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +$(AT91BOOTSTRAP_SOURCE): + @$(call targetinfo) + @$(call get, AT91BOOTSTRAP) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +$(STATEDIR)/at91bootstrap.extract: + @$(call targetinfo) + @$(call clean, $(AT91BOOTSTRAP_DIR)) + @$(call extract, AT91BOOTSTRAP) + @$(call patchin, AT91BOOTSTRAP_EXTRACT) + @$(call touch) + + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +AT91BOOTSTRAP_PATH := PATH=$(CROSS_PATH) +AT91BOOTSTRAP_ENV := $(CROSS_ENV) CROSS_COMPILE=$(COMPILER_PREFIX) + +# +# autoconf +# +AT91BOOTSTRAP_AUTOCONF := $(CROSS_AUTOCONF_USR) + +$(STATEDIR)/at91bootstrap.prepare: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +$(STATEDIR)/at91bootstrap.compile: + @$(call targetinfo) + @cd $(AT91BOOTSTRAP_BUILDDIR) && \ + $(AT91BOOTSTRAP_PATH) $(AT91BOOTSTRAP_ENV) $(MAKE) $(PARALLELMFLAGS_BROKEN) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/at91bootstrap.install: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/at91bootstrap.targetinstall: + @$(call targetinfo) + @cp $(AT91BOOTSTRAP_BUILDDIR)/$(AT91BOOTSTRAP_IMAGE) $(IMAGEDIR)/at91bootstrap.bin + @$(call touch) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +at91bootstrap_clean: + rm -rf $(STATEDIR)/at91bootstrap.* + rm -rf $(PKGDIR)/at91bootstrap_* + rm -rf $(AT91BOOTSTRAP_DIR) + +# vim: syntax=make Index: ptxdist-trunk/platforms/Kconfig =================================================================== --- ptxdist-trunk.orig/platforms/Kconfig 2008-08-09 00:13:13.000000000 +0200 +++ ptxdist-trunk/platforms/Kconfig 2008-08-09 00:14:17.000000000 +0200 @@ -31,6 +31,7 @@ menu "bootloaders " source "platforms/grub.in" source "platforms/u-boot.in" source "platforms/u-boot-v2.in" +source "platforms/at91bootstrap.in" endmenu source "platforms/images.in" Index: ptxdist-trunk/patches/Bootstrap-v1.9/generic/align-u-boot-start-address-to-dataflash-sectors.patch =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ptxdist-trunk/patches/Bootstrap-v1.9/generic/align-u-boot-start-address-to-dataflash-sectors.patch 2008-08-09 00:14:17.000000000 +0200 @@ -0,0 +1,108 @@ +Align image address to sector boundaries in dataflash + +U-boot (since version 1.3.4) expects that the bootstrap code +puts U-boot at sector boundaries. (at address 0x8400 in +dataflash) + +Signed-off-by: Remy Bohmer <[EMAIL PROTECTED]> +--- + board/at91cap9adk/norflash/at91cap9adk.h | 2 +- + board/at91sam9260ek/dataflash/at91sam9260ek.h | 2 +- + board/at91sam9261ek/dataflash/at91sam9261ek.h | 2 +- + board/at91sam9263ek/dataflash/at91sam9263ek.h | 2 +- + board/at91sam9g20ek/dataflash/at91sam9g20ek.h | 2 +- + board/at91sam9rlek/dataflash/at91sam9rlek.h | 2 +- + board/at91sam9xeek/dataflash/at91sam9xeek.h | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + +Index: Bootstrap-v1.9/board/at91cap9adk/norflash/at91cap9adk.h +=================================================================== +--- Bootstrap-v1.9.orig/board/at91cap9adk/norflash/at91cap9adk.h 2008-04-09 18:01:31.000000000 +0200 ++++ Bootstrap-v1.9/board/at91cap9adk/norflash/at91cap9adk.h 2008-08-08 23:47:50.000000000 +0200 +@@ -72,7 +72,7 @@ + /* */ + /* ******************************************************************* */ + +-#define IMG_ADDRESS 0x8000 /* Image Address in DataFlash */ ++#define IMG_ADDRESS 0x8400 /* Image Address in DataFlash */ + #define IMG_SIZE 0x38000 /* Image Size in NorFlash */ + + #define MACH_TYPE 1442 /* AT91CAP9ADK */ +Index: Bootstrap-v1.9/board/at91sam9260ek/dataflash/at91sam9260ek.h +=================================================================== +--- Bootstrap-v1.9.orig/board/at91sam9260ek/dataflash/at91sam9260ek.h 2007-10-30 12:38:40.000000000 +0100 ++++ Bootstrap-v1.9/board/at91sam9260ek/dataflash/at91sam9260ek.h 2008-08-08 23:47:57.000000000 +0200 +@@ -76,7 +76,7 @@ + /* ******************************************************************* */ + #define AT91C_SPI_PCS_DATAFLASH AT91C_SPI_PCS1_DATAFLASH /* Boot on SPI NCS0 */ + +-#define IMG_ADDRESS 0x8000 /* Image Address in DataFlash */ ++#define IMG_ADDRESS 0x8400 /* Image Address in DataFlash */ + #define IMG_SIZE 0x30000 /* Image Size in DataFlash */ + + #define MACH_TYPE 0x44B /* AT91SAM9260-EK */ +Index: Bootstrap-v1.9/board/at91sam9261ek/dataflash/at91sam9261ek.h +=================================================================== +--- Bootstrap-v1.9.orig/board/at91sam9261ek/dataflash/at91sam9261ek.h 2006-11-13 14:14:04.000000000 +0100 ++++ Bootstrap-v1.9/board/at91sam9261ek/dataflash/at91sam9261ek.h 2008-08-08 23:47:55.000000000 +0200 +@@ -99,7 +99,7 @@ + /* ******************************************************************* */ + #define AT91C_SPI_PCS_DATAFLASH AT91C_SPI_PCS0_DATAFLASH /* Boot on SPI NCS0 */ + +-#define IMG_ADDRESS 0x8000 /* Image Address in DataFlash */ ++#define IMG_ADDRESS 0x8400 /* Image Address in DataFlash */ + #define IMG_SIZE 0x32000 /* Image Size in DataFlash */ + + #define MACH_TYPE 0x350 /* AT91SAM9261-EK */ +Index: Bootstrap-v1.9/board/at91sam9263ek/dataflash/at91sam9263ek.h +=================================================================== +--- Bootstrap-v1.9.orig/board/at91sam9263ek/dataflash/at91sam9263ek.h 2006-11-30 14:57:53.000000000 +0100 ++++ Bootstrap-v1.9/board/at91sam9263ek/dataflash/at91sam9263ek.h 2008-08-08 23:47:53.000000000 +0200 +@@ -98,7 +98,7 @@ + /* ******************************************************************* */ + #define AT91C_SPI_PCS_DATAFLASH AT91C_SPI_PCS0_DATAFLASH /* Boot on SPI NCS0 */ + +-#define IMG_ADDRESS 0x8000 /* Image Address in DataFlash */ ++#define IMG_ADDRESS 0x8400 /* Image Address in DataFlash */ + #define IMG_SIZE 0x32000 /* Image Size in DataFlash */ + + #define MACH_TYPE 0x4B2 /* AT91SAM9263-EK */ +Index: Bootstrap-v1.9/board/at91sam9g20ek/dataflash/at91sam9g20ek.h +=================================================================== +--- Bootstrap-v1.9.orig/board/at91sam9g20ek/dataflash/at91sam9g20ek.h 2008-02-27 09:45:25.000000000 +0100 ++++ Bootstrap-v1.9/board/at91sam9g20ek/dataflash/at91sam9g20ek.h 2008-08-08 23:47:47.000000000 +0200 +@@ -77,7 +77,7 @@ + /* ******************************************************************* */ + #define AT91C_SPI_PCS_DATAFLASH AT91C_SPI_PCS1_DATAFLASH /* Boot on SPI NCS1 */ + +-#define IMG_ADDRESS 0x8000 /* Image Address in DataFlash */ ++#define IMG_ADDRESS 0x8400 /* Image Address in DataFlash */ + #define IMG_SIZE 0x30000 /* Image Size in DataFlash */ + + #define MACH_TYPE 0x658 /* AT91SAM9G20-EK */ +Index: Bootstrap-v1.9/board/at91sam9rlek/dataflash/at91sam9rlek.h +=================================================================== +--- Bootstrap-v1.9.orig/board/at91sam9rlek/dataflash/at91sam9rlek.h 2007-12-10 16:03:54.000000000 +0100 ++++ Bootstrap-v1.9/board/at91sam9rlek/dataflash/at91sam9rlek.h 2008-08-08 23:47:59.000000000 +0200 +@@ -91,7 +91,7 @@ + /* ******************************************************************* */ + #define AT91C_SPI_PCS_DATAFLASH AT91C_SPI_PCS0_DATAFLASH /* Boot on SPI NCS0 */ + +-#define IMG_ADDRESS 0x8000 /* Image Address in DataFlash */ ++#define IMG_ADDRESS 0x8400 /* Image Address in DataFlash */ + #define IMG_SIZE 0x32000 /* Image Size in DataFlash */ + + #define MACH_TYPE 1326 /* AT91SAM9RL-EK */ +Index: Bootstrap-v1.9/board/at91sam9xeek/dataflash/at91sam9xeek.h +=================================================================== +--- Bootstrap-v1.9.orig/board/at91sam9xeek/dataflash/at91sam9xeek.h 2008-04-17 12:02:03.000000000 +0200 ++++ Bootstrap-v1.9/board/at91sam9xeek/dataflash/at91sam9xeek.h 2008-08-08 23:47:52.000000000 +0200 +@@ -76,7 +76,7 @@ + /* ******************************************************************* */ + #define AT91C_SPI_PCS_DATAFLASH AT91C_SPI_PCS1_DATAFLASH /* Boot on SPI NCS1 */ + +-#define IMG_ADDRESS 0x8000 /* Image Address in DataFlash */ ++#define IMG_ADDRESS 0x8400 /* Image Address in DataFlash */ + #define IMG_SIZE 0x30000 /* Image Size in DataFlash */ + + #define MACH_TYPE 0x44B /* AT91SAM9XE-EK same id as AT91SAM9260-EK*/ Index: ptxdist-trunk/patches/Bootstrap-v1.9/generic/series =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ptxdist-trunk/patches/Bootstrap-v1.9/generic/series 2008-08-09 00:14:17.000000000 +0200 @@ -0,0 +1 @@ +align-u-boot-start-address-to-dataflash-sectors.patch -- -- ptxdist mailing list ptxdist@pengutronix.de