diff -Nuar at91bootstrap/build.sh at91bootstrap-sama5d4/build.sh --- at91bootstrap/build.sh 1970-01-01 08:00:00.000000000 +0800 +++ at91bootstrap-sama5d4/build.sh 2019-08-22 18:54:20.707235362 +0800 @@ -0,0 +1,71 @@ +#!/bin/bash + +BOARD=sama5d4 +TFTP_PATH=/tftp +IMGS_PATH=../images +IMG_NAME=bootstrap-${BOARD}.bin + +CROSSTOOL=/opt/buildroot/cortex-a5/bin/arm-linux- +JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` + + +function do_clean() +{ + make CROSS_COMPILE=${CROSSTOOL} mrproper + find -iname "*.pyc" | xargs rm -rf {} \; + rm -f $IMG_NAME + rm -f cscope* tags +} + +function do_modify() +{ + grep "arm-linux-gnueabi" Makefile > /dev/null + + if [ $? == 0 ] ; then + return ; + fi + + echo "Modify Makefile for ARCH and cross compiler" + sed -i -e "s|^CROSS_COMPILE=.*|CROSS_COMPILE=${CROSSTOOL}|g" Makefile +} + +function do_build() +{ + if [ ! -f .config ] ; then + echo "cp .cfg-${BOARD} .config" + cp .cfg-${BOARD} .config + fi + + make + + cp binaries/sama5d4_xplained-nandflashboot-uboot-3.8.13.bin bootstrap-${BOARD}.bin + + chmod a+x ${IMG_NAME} +} + +function do_install() +{ + if [ -d $TFTP_PATH ] ;then + cp ${IMG_NAME} $TFTP_PATH + fi + + if [ -d ${IMGS_PATH} ] ; then + cp ${IMG_NAME} $IMGS_PATH + fi +} + +if [ "$1" == "clean" ] ; then + + do_clean + exit 0; +fi + +do_modify + +set -e + +do_build + +do_install + + diff -Nuar at91bootstrap/.cfg-sama5d4 at91bootstrap-sama5d4/.cfg-sama5d4 --- at91bootstrap/.cfg-sama5d4 1970-01-01 08:00:00.000000000 +0800 +++ at91bootstrap-sama5d4/.cfg-sama5d4 2019-08-22 13:18:47.498849159 +0800 @@ -0,0 +1,274 @@ +# +# Automatically generated make config: don't edit +# Thu Aug 22 13:18:42 2019 +# +HAVE_DOT_CONFIG=y +# CONFIG_AT91SAM9260EK is not set +# CONFIG_AT91SAM9261EK is not set +# CONFIG_AT91SAM9263EK is not set +# CONFIG_AT91SAM9RLEK is not set +# CONFIG_AT91SAM9XEEK is not set +# CONFIG_AT91SAM9G10EK is not set +# CONFIG_AT91SAM9G20EK is not set +# CONFIG_AT91SAM9M10G45EK is not set +# CONFIG_AT91SAM9X5EK is not set +# CONFIG_AT91SAM9N12EK is not set +# CONFIG_SAMA5D3XEK is not set +# CONFIG_SAMA5D3_XPLAINED is not set +# CONFIG_SAMA5D3X_CMP is not set +# CONFIG_SAMA5D4EK is not set +CONFIG_SAMA5D4_XPLAINED=y +# CONFIG_SAMA5D2_PTC_EK is not set +# CONFIG_SAMA5D2_XPLAINED is not set +# CONFIG_SAMA5D27_SOM1_EK is not set +# CONFIG_SAMA5D2_LPDDR2SIP_VB is not set +# CONFIG_SAMA5D2_ICP is not set +# CONFIG_VINCO is not set +# CONFIG_AT91SAM9X5_ARIA is not set +# CONFIG_AT91SAM9X5_ARIETTA is not set +# CONFIG_SAMA5D3_ACQUA is not set +# CONFIG_SAMA5D2_ROADRUNNER is not set +# CONFIG_CORE9G25 is not set +# CONFIG_SAMA5D3_LINEA is not set +# CONFIG_PICOSAM9G45 is not set +# CONFIG_SAMA5D3_STEPHAN is not set +CONFIG_BOARDNAME="sama5d4_xplained" +SAMA5D4=y +CONFIG_MACH_TYPE="9999" +# CONFIG_OVERRIDE_MACH_TYPE is not set +CONFIG_LINK_ADDR="0x200000" +CONFIG_TOP_OF_MEMORY="0x210000" + +# +# Main Crystal configuration +# +CONFIG_CRYSTAL_12_000MHZ=y +# CONFIG_CRYSTAL_16_000MHZ is not set +# CONFIG_CRYSTAL_16_36766MHZ is not set +# CONFIG_CRYSTAL_18_432MHZ is not set +# CONFIG_CRYSTAL_24_000MHZ is not set +# CONFIG_MCK_BYPASS is not set +ALLOW_CRYSTAL_12_000MHZ=y +CONFIG_CRYSTAL="CRYSTAL_12_000MHZ" +# CONFIG_CPU_CLK_166MHZ is not set +# CONFIG_CPU_CLK_180MHZ is not set +# CONFIG_CPU_CLK_200MHZ is not set +# CONFIG_CPU_CLK_240MHZ is not set +# CONFIG_CPU_CLK_266MHZ is not set +# CONFIG_CPU_CLK_332MHZ is not set +# CONFIG_CPU_CLK_348MHZ is not set +# CONFIG_CPU_CLK_396MHZ is not set +# CONFIG_CPU_CLK_400MHZ is not set +# CONFIG_CPU_CLK_444MHZ is not set +# CONFIG_CPU_CLK_492MHZ is not set +# CONFIG_CPU_CLK_498MHZ is not set +# CONFIG_CPU_CLK_510MHZ is not set +# CONFIG_CPU_CLK_528MHZ is not set +# CONFIG_CPU_CLK_594MHZ is not set +CONFIG_CPU_CLK_600MHZ=y +ALLOW_CPU_CLK_444MHZ=y +ALLOW_CPU_CLK_510MHZ=y +ALLOW_CPU_CLK_528MHZ=y +ALLOW_CPU_CLK_594MHZ=y +ALLOW_CPU_CLK_600MHZ=y +# DISABLE_CPU_CLK_240MHZ is not set +# CONFIG_BUS_SPEED_83MHZ is not set +# CONFIG_BUS_SPEED_90MHZ is not set +# CONFIG_BUS_SPEED_100MHZ is not set +# CONFIG_BUS_SPEED_116MHZ is not set +# CONFIG_BUS_SPEED_124MHZ is not set +# CONFIG_BUS_SPEED_133MHZ is not set +# CONFIG_BUS_SPEED_148MHZ is not set +# CONFIG_BUS_SPEED_164MHZ is not set +# CONFIG_BUS_SPEED_166MHZ is not set +# CONFIG_BUS_SPEED_170MHZ is not set +# CONFIG_BUS_SPEED_176MHZ is not set +CONFIG_BUS_SPEED_200MHZ=y +SUPPORT_BUS_SPEED_148MHZ=y +SUPPORT_BUS_SPEED_170MHZ=y +SUPPORT_BUS_SPEED_176MHZ=y +SUPPORT_BUS_SPEED_200MHZ=y +CPU_HAS_TRUSTZONE=y +CONFIG_CPU_V7=y +CONFIG_HAS_PMIC_ACT8865=y +CONFIG_SUPPORT_PM=y +# CONFIG_HAS_ONE_WIRE is not set +CONFIG_HAS_EEPROM=y +CONFIG_HAS_EHT0_PHY=y +# CONFIG_HAS_EHT1_PHY is not set +# CONFIG_HAS_AUDIO_CODEC is not set +CONFIG_HAS_HDMI=y +# CORE_ARM926EJS is not set +CORE_CORTEX_A5=y +CPU_HAS_SCKC=y +CPU_HAS_H32MXDIV=y +CPU_HAS_HSMCI0=y +CPU_HAS_HSMCI1=y +# CPU_HAS_HSMCI2 is not set +# CPU_HAS_MCI0 is not set +# CPU_HAS_MCI1 is not set +# CPU_HAS_SDHC0 is not set +# CPU_HAS_SDHC1 is not set +CPU_HAS_SPI0=y +CPU_HAS_SPI1=y +# CPU_HAS_SPI0_IOSET1 is not set +# CPU_HAS_SPI0_IOSET2 is not set +# CPU_HAS_SPI1_IOSET1 is not set +# CPU_HAS_SPI1_IOSET2 is not set +# CPU_HAS_SPI1_IOSET3 is not set +# CPU_HAS_QSPI0 is not set +# CPU_HAS_QSPI1 is not set +# CPU_HAS_QSPI0_IOSET1 is not set +# CPU_HAS_QSPI0_IOSET2 is not set +# CPU_HAS_QSPI0_IOSET3 is not set +# CPU_HAS_QSPI1_IOSET1 is not set +# CPU_HAS_QSPI1_IOSET2 is not set +# CPU_HAS_QSPI1_IOSET3 is not set +# BOARD_HAS_2_BANKS is not set +# CPU_HAS_SCLK_BYPASS is not set +CPU_HAS_PIO3=y +CPU_HAS_L2CC=y +CPU_HAS_PMECC=y +CONFIG_HAS_HW_INFO=y +CONFIG_TWI=y +CONFIG_TWI0=y +CONFIG_TWI1=y +CONFIG_TWI2=y +CONFIG_TWI3=y +# CONFIG_MACB is not set +# CONFIG_AES is not set +# CONFIG_LOAD_HW_INFO is not set +CPU_HAS_TWI0=y +CPU_HAS_TWI1=y +CPU_HAS_TWI2=y +CPU_HAS_TWI3=y +CPU_HAS_AES=y +# CPU_HAS_PIO4 is not set +# CONFIG_FLEXCOM is not set +# CPU_HAS_FLEXCOM is not set + +# +# Memory selection +# +# CONFIG_SDRAM is not set +# CONFIG_SDDRC is not set +CONFIG_DDRC=y +ALLOW_DATAFLASH=y +# ALLOW_FLASH is not set +ALLOW_NANDFLASH=y +ALLOW_SDCARD=y +# ALLOW_PSRAM is not set +# ALLOW_SDRAM_16BIT is not set + +# +# RAM Configuration +# +# CONFIG_RAM_32MB is not set +# CONFIG_RAM_64MB is not set +# CONFIG_RAM_128MB is not set +# CONFIG_RAM_256MB is not set +CONFIG_RAM_512MB=y +# CONFIG_LPDDR1 is not set +# CONFIG_LPDDR2 is not set +# CONFIG_LPDDR3 is not set +CONFIG_DDR2=y +# CONFIG_DDR3 is not set +# CONFIG_SAMA5D2_LPDDR2 is not set +# CONFIG_DATAFLASH is not set +# CONFIG_FLASH is not set +CONFIG_NANDFLASH=y +# CONFIG_SDCARD is not set +CONFIG_MEMORY="nandflash" +ALLOW_BOOT_FROM_DATAFLASH_CS0=y + +# +# NAND flash configuration +# +# CONFIG_ENABLE_SW_ECC is not set +CONFIG_USE_PMECC=y +# CONFIG_ON_DIE_ECC is not set + +# +# PMECC Configuration +# +CONFIG_PMECC_AUTO_DETECT=y +# CONFIG_NANDFLASH_SMALL_BLOCKS is not set +CONFIG_ONFI_DETECT_SUPPORT=y +CONFIG_USE_ON_DIE_ECC_SUPPORT=y +# ALLOW_NANDFLASH_RECOVERY is not set +CONFIG_BOOTSTRAP_MAXSIZE="65536" +CONFIG_PROJECT="nandflash" +CONFIG_LOAD_UBOOT=y +# CONFIG_LOAD_LINUX is not set +# CONFIG_LOAD_NONE is not set +# CONFIG_LOAD_ANDROID is not set +# CONFIG_LOAD_1MB is not set +# CONFIG_LOAD_4MB is not set +# CONFIG_LOAD_64KB is not set +# CONFIG_SKIP_COPY_IMAGE is not set +CONFIG_IMG_ADDRESS="0x00040000" +CONFIG_JUMP_ADDR="0x26F00000" + +# +# U-Boot Image Storage Setup +# +CONFIG_IMG_SIZE="0x000a0000" +CONFIG_DEBUG=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_LOUD is not set +# CONFIG_DEBUG_VERY_LOUD is not set +# CONFIG_SECURE is not set +CONFIG_DISABLE_WATCHDOG=y + +# +# Hardware Initialization Options +# +CONFIG_HW_DISPLAY_BANNER=y +CONFIG_HW_BANNER="\"\\n\\nAT91Bootstrap \" AT91BOOTSTRAP_VERSION \" (\" COMPILE_TIME \")\\n\\n\"" +CONFIG_HW_INIT=y +# CONFIG_USER_HW_INIT is not set + +# +# Slow Clock Configuration Options +# +CONFIG_SCLK=y + +# +# ARM TrustZone Options +# +CONFIG_MATRIX=y +# CONFIG_ENTER_NWD is not set +CONFIG_REDIRECT_ALL_INTS_AIC=y +CONFIG_PM=y + +# +# Select the Devices to the Low-power mode +# +# CONFIG_MAC0_PHY is not set +# CONFIG_HDMI is not set +CONFIG_PM_PMIC=y +# CONFIG_BACKUP_MODE is not set + +# +# Board's Workaround Options +# +CONFIG_ACT8865_SET_VOLTAGE=y +CONFIG_DISABLE_ACT8865_I2C=y +# CONFIG_SUSPEND_ACT8945A_CHARGER is not set +CONFIG_ACT8865=y + +# +# Board Hardware Information Options +# +# CONFIG_LOAD_EEPROM is not set +CONFIG_AUTOCONFIG_TWI_BUS=y + +# +# Basic Drivers support +# +CONFIG_PIT=y +CONFIG_WDT=y +CONFIG_RSTC=y +CONFIG_USART=y +CONFIG_PIO=y +CONFIG_PMC=y diff -Nuar at91bootstrap/Makefile at91bootstrap-sama5d4/Makefile --- at91bootstrap/Makefile 2019-08-02 17:30:35.000000000 +0800 +++ at91bootstrap-sama5d4/Makefile 2019-08-22 11:46:05.882742473 +0800 @@ -119,6 +119,7 @@ HOSTARCH := $(shell uname -m | sed -e s/arm.*/arm/) +CROSS_COMPILE=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi- AS=$(CROSS_COMPILE)gcc CC=$(CROSS_COMPILE)gcc LD=$(CROSS_COMPILE)ld