Commit ca0d69c6 authored by Simon Dawson's avatar Simon Dawson Committed by Thomas Petazzoni
Browse files

at91bootstrap3: new package



Note that this new package, at91bootstrap3, is being added alongside the
existing at91bootstrap. This was suggested by Thomas Petazzoni, whose
comments on the mailing list are quoted below.

  For this package, I am not sure we can do a simple version bump. Since
  there is (was?) no upstream for AT91Bootstrap 1.x, many
  vendors/companies had to maintain their patches on top of AT91Bootstrap
  1.x. See for example
  board/calao/usb-a9263/at91bootstrap-1.16-usb-a9263.patch. Therefore,
  removing AT91Bootstrap 1.x from the tree will prevent those platforms
  to work. I know people should upgrade, but AT91Bootstrap 3.x is quite
  significantly different, so the porting effort is not that simple.

  Therefore, I'm wondering whether we should kee at91bootstrap as it is,
  and create a separate package at91bootstrap3 for the 3.x generation.

Signed-off-by: default avatarSimon Dawson <spdawson@gmail.com>
Acked-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent b18ed921
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
menu "Bootloaders"

source "boot/at91bootstrap/Config.in"
source "boot/at91bootstrap3/Config.in"
source "boot/at91dataflashboot/Config.in"
source "boot/barebox/Config.in"
source "boot/grub/Config.in"
+53 −0
Original line number Diff line number Diff line
config BR2_TARGET_AT91BOOTSTRAP3
	depends on BR2_arm926t
	bool "AT91 Bootstrap 3"
	help
	  AT91Bootstrap is a first level bootloader for the Atmel AT91
	  devices. It integrates algorithms for:
	  - Device initialization such as clock configuration, PIO settings...
	  - Peripheral drivers such as PIO, PMC or SDRAMC...
	  - Physical media algorithm such as DataFlash, NandFlash, NOR Flash...

if BR2_TARGET_AT91BOOTSTRAP3

config BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR
	string "custom patch dir"
	help
	  If your board requires custom patches, add the path to the
	  directory containing the patches here. The patches must be
	  named at91bootstrap3-<something>.patch.

	  Most users may leave this empty

#
# Configuration selection
#

choice
	prompt "AT91 Bootstrap 3 configuration"
	default BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG

config BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG
	bool "Using a defconfig"

config BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG
	bool "Using a custom config file"

endchoice

config BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG
	string "Defconfig name"
	depends on BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG
	help
	  Name of the at91bootstrap3 defconfig file to use, without the
	  trailing _defconfig.  The defconfig is located at
	  board/<processor>/<board>_defconfig in the at91bootstrap3
	  tree.

config BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE
	string "Configuration file path"
	depends on BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG
	help
	  Path to the at91bootstrap3 configuration file

endif # BR2_TARGET_AT91BOOTSTRAP3
+747 −0

File added.

Preview size limit exceeded, changes collapsed.

+67 −0
Original line number Diff line number Diff line
#############################################################
#
# at91bootstrap3
#
#############################################################
AT91BOOTSTRAP3_VERSION = 3.2
AT91BOOTSTRAP3_SITE = \
	ftp://www.at91.com/pub/at91bootstrap/AT91Bootstrap$(AT91BOOTSTRAP3_VERSION)
AT91BOOTSTRAP3_SOURCE = at91bootstrap_9n12.tar.gz

AT91BOOTSTRAP3_INSTALL_IMAGES = YES
AT91BOOTSTRAP3_INSTALL_TARGET = NO

AT91BOOTSTRAP3_DEFCONFIG = \
	$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))
AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE = \
	$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE))
AT91BOOTSTRAP3_CUSTOM_PATCH_DIR = \
	$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR))

AT91BOOTSTRAP3_MAKE_OPT = CROSS_COMPILE=$(TARGET_CROSS) DESTDIR=$(BINARIES_DIR)

ifneq ($(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR),)
define AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
	support/scripts/apply-patches.sh $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \
		at91bootstrap3-\*.patch
endef

AT91BOOTSTRAP3_POST_PATCH_HOOKS += AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
endif

ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
AT91BOOTSTRAP3_SOURCE_CONFIG = \
	$(@D)/board/*/$(AT91BOOTSTRAP3_DEFCONFIG)_defconfig
else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
AT91BOOTSTRAP3_SOURCE_CONFIG = $(AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE)
endif

define AT91BOOTSTRAP3_CONFIGURE_CMDS
	cp $(AT91BOOTSTRAP3_SOURCE_CONFIG) $(@D)/.config
	$(SED) 's/image.bin/uImage/' $(@D)/.config
endef

define AT91BOOTSTRAP3_BUILD_CMDS
	$(MAKE) $(AT91BOOTSTRAP3_MAKE_OPT) -C $(@D) boot
endef

define AT91BOOTSTRAP3_INSTALL_IMAGES_CMDS
	$(MAKE) $(AT91BOOTSTRAP3_MAKE_OPT) -C $(@D) bootstrap
endef

$(eval $(generic-package))

# Checks to give errors that the user can understand
ifeq ($(filter source,$(MAKECMDGOALS)),)
ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
ifeq ($(AT91BOOTSTRAP3_DEFCONFIG),)
$(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
endif
endif

ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
ifeq ($(AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE),)
$(error No at91bootstrap3 configuration file specified, check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE setting)
endif
endif
endif