From b5a0e1f270688ad03f0d20199d194c948b097bd2 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Thu, 22 Aug 2019 18:59:30 +0800 Subject: [PATCH] update at91bootstrap and u-boot-at91 patch, remove eeprom in bootstrap and add default env in u-boot --- linux-bsp/patches/at91bootstrap-sama5d4.patch | 24 ++++--- linux-bsp/patches/u-boot-at91-sama5d4.patch | 117 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 127 insertions(+), 14 deletions(-) diff --git a/linux-bsp/patches/at91bootstrap-sama5d4.patch b/linux-bsp/patches/at91bootstrap-sama5d4.patch index 729c735..91e26f8 100644 --- a/linux-bsp/patches/at91bootstrap-sama5d4.patch +++ b/linux-bsp/patches/at91bootstrap-sama5d4.patch @@ -1,7 +1,7 @@ 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-04 22:38:17.093670157 +0800 -@@ -0,0 +1,69 @@ ++++ at91bootstrap-sama5d4/build.sh 2019-08-22 18:54:20.707235362 +0800 +@@ -0,0 +1,71 @@ +#!/bin/bash + +BOARD=sama5d4 @@ -18,6 +18,7 @@ + make CROSS_COMPILE=${CROSSTOOL} mrproper + find -iname "*.pyc" | xargs rm -rf {} \; + rm -f $IMG_NAME ++ rm -f cscope* tags +} + +function do_modify() @@ -34,7 +35,8 @@ + +function do_build() +{ -+ if [ ! -f .confg ] ; then ++ if [ ! -f .config ] ; then ++ echo "cp .cfg-${BOARD} .config" + cp .cfg-${BOARD} .config + fi + @@ -73,11 +75,11 @@ + 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-04 22:39:19.309671350 +0800 ++++ at91bootstrap-sama5d4/.cfg-sama5d4 2019-08-22 13:18:47.498849159 +0800 @@ -0,0 +1,274 @@ +# +# Automatically generated make config: don't edit -+# Sun Aug 4 22:19:10 2019 ++# Thu Aug 22 13:18:42 2019 +# +HAVE_DOT_CONFIG=y +# CONFIG_AT91SAM9260EK is not set @@ -212,9 +214,9 @@ +CONFIG_TWI1=y +CONFIG_TWI2=y +CONFIG_TWI3=y -+CONFIG_MACB=y ++# CONFIG_MACB is not set +# CONFIG_AES is not set -+CONFIG_LOAD_HW_INFO=y ++# CONFIG_LOAD_HW_INFO is not set +CPU_HAS_TWI0=y +CPU_HAS_TWI1=y +CPU_HAS_TWI2=y @@ -321,8 +323,8 @@ +# +# Select the Devices to the Low-power mode +# -+CONFIG_MAC0_PHY=y -+CONFIG_HDMI=y ++# CONFIG_MAC0_PHY is not set ++# CONFIG_HDMI is not set +CONFIG_PM_PMIC=y +# CONFIG_BACKUP_MODE is not set + @@ -337,7 +339,7 @@ +# +# Board Hardware Information Options +# -+CONFIG_LOAD_EEPROM=y ++# CONFIG_LOAD_EEPROM is not set +CONFIG_AUTOCONFIG_TWI_BUS=y + +# @@ -351,7 +353,7 @@ +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-04 22:30:49.613661573 +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/) diff --git a/linux-bsp/patches/u-boot-at91-sama5d4.patch b/linux-bsp/patches/u-boot-at91-sama5d4.patch index b183388..a20c947 100644 --- a/linux-bsp/patches/u-boot-at91-sama5d4.patch +++ b/linux-bsp/patches/u-boot-at91-sama5d4.patch @@ -1,7 +1,7 @@ diff -Nuar u-boot-at91/build.sh u-boot-at91-sama5d4/build.sh --- u-boot-at91/build.sh 1970-01-01 08:00:00.000000000 +0800 -+++ u-boot-at91-sama5d4/build.sh 2019-08-04 22:47:21.589680602 +0800 -@@ -0,0 +1,66 @@ ++++ u-boot-at91-sama5d4/build.sh 2019-08-22 18:55:28.199236657 +0800 +@@ -0,0 +1,67 @@ +#!/bin/bash + +BOARD=sama5d4 @@ -16,6 +16,7 @@ +function do_clean() +{ + make CROSS_COMPILE=${CROSSTOOL} distclean ++ rm -f cscope* tags + rm -f ${IMG_NAME} +} + @@ -68,9 +69,119 @@ +do_install + + +diff -Nuar u-boot-at91/include/configs/sama5d4_xplained.h u-boot-at91-sama5d4/include/configs/sama5d4_xplained.h +--- u-boot-at91/include/configs/sama5d4_xplained.h 2019-08-04 21:52:13.000000000 +0800 ++++ u-boot-at91-sama5d4/include/configs/sama5d4_xplained.h 2019-08-22 16:37:32.807077915 +0800 +@@ -38,7 +38,7 @@ + #define CONFIG_USART_BASE ATMEL_BASE_USART3 + #define CONFIG_USART_ID ATMEL_ID_USART3 + +-#define CONFIG_BOOTDELAY 3 ++#define CONFIG_BOOTDELAY 1 + + /* + * BOOTP options +@@ -173,9 +173,9 @@ + #define CONFIG_ENV_OFFSET 0xc0000 + #define CONFIG_ENV_OFFSET_REDUND 0x100000 + #define CONFIG_ENV_SIZE 0x20000 +-#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \ ++#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x40000;" \ + "nand read 0x22000000 0x200000 0x600000;" \ +- "bootz 0x22000000 - 0x21000000" ++ "bootm 0x22000000 - 0x21000000" + #elif CONFIG_SYS_USE_MMC + /* bootstrap + u-boot + env in sd card */ + #define CONFIG_ENV_IS_IN_FAT +@@ -194,6 +194,37 @@ + "bootz 0x22000000 - 0x21000000" + #endif + ++/* add by guowenxue, 2019.08.22 */ ++#define CONFIG_ENV_OVERWRITE 1 ++#define CONFIG_ETHADDR 42:96:ab:be:a7:5e ++#define CONFIG_IPADDR 192.168.2.199 ++#define CONFIG_SERVERIP 192.168.2.2 ++ ++ ++#define CONFIG_TFTPBOOT "tftp 0x22000000 linuxrom-sama5d4.bin && tftp 0x21000000 linuxrom-sama5d4.dtb; " \ ++ "bootm 0x22000000 - 0x21000000" ++ ++#define CONFIG_BBL "tftp 0x21000000 u-boot-sama5d4.bin && nand erase 0x40000 0x140000;" \ ++ "nand write 0x21000000 0x40000 ${filesize}" ++ ++#define CONFIG_BDTB "tftp 0x21000000 linuxrom-sama5d4.dtb && nand erase 0x180000 0x80000; " \ ++ "nand write 0x21000000 0x180000 ${filesize}" ++ ++#define CONFIG_BKR "tftp 0x22000000 linuxrom-sama5d4.bin && nand erase 0x200000 0x600000; " \ ++ "nand write 0x22000000 0x200000 ${filesize}" ++ ++#define CONFIG_BFS "tftp 0x21000000 rootfs-sama5d4.ubi && nand erase 800000 c800000; " \ ++ "nand write 0x21000000 800000 ${filesize}" ++ ++#define CONFIG_BSYS "run bbl; run bdtb; run bkr; run bfs" ++ ++#define CONFIG_CLRAPPS "nand erase d000000 13000000" ++ ++#define CONFIG_DBGRUN "run bfs; run tb" ++ ++ ++ ++ + #ifdef CONFIG_SYS_USE_MMC + #define CONFIG_BOOTARGS \ + "console=ttyS0,115200 earlyprintk " \ +@@ -203,8 +234,8 @@ + "console=ttyS0,115200 earlyprintk " \ + "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \ + "256K(env),256k(evn_redundent),256k(spare)," \ +- "512k(dtb),6M(kernel)ro,-(rootfs) " \ +- "rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs" ++ "512k(dtb),6M(kernel)ro,200M(rootfs),-(apps) " \ ++ "rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs rw" + #endif + + #define CONFIG_BAUDRATE 115200 +diff -Nuar u-boot-at91/include/env_default.h u-boot-at91-sama5d4/include/env_default.h +--- u-boot-at91/include/env_default.h 2019-08-04 21:52:13.000000000 +0800 ++++ u-boot-at91-sama5d4/include/env_default.h 2019-08-22 16:33:49.407073630 +0800 +@@ -76,6 +76,33 @@ + #ifdef CONFIG_SERVERIP + "serverip=" __stringify(CONFIG_SERVERIP) "\0" + #endif ++ ++/* add by guowenxue, 2019.08.22 */ ++#ifdef CONFIG_TFTPBOOT ++ "tb=" CONFIG_TFTPBOOT "\0" ++#endif ++#ifdef CONFIG_BBL ++ "bbl=" CONFIG_BBL "\0" ++#endif ++#ifdef CONFIG_BDTB ++ "bdtb=" CONFIG_BDTB "\0" ++#endif ++#ifdef CONFIG_BKR ++ "bkr=" CONFIG_BKR "\0" ++#endif ++#ifdef CONFIG_BFS ++ "bfs=" CONFIG_BFS "\0" ++#endif ++#ifdef CONFIG_BSYS ++ "bsys=" CONFIG_BSYS "\0" ++#endif ++#ifdef CONFIG_CLRAPPS ++ "clrapps=" CONFIG_CLRAPPS "\0" ++#endif ++#ifdef CONFIG_DBGRUN ++ "dbg=" CONFIG_DBGRUN "\0" ++#endif ++ + #ifdef CONFIG_SYS_AUTOLOAD + "autoload=" CONFIG_SYS_AUTOLOAD "\0" + #endif diff -Nuar u-boot-at91/Makefile u-boot-at91-sama5d4/Makefile --- u-boot-at91/Makefile 2019-08-04 21:52:12.000000000 +0800 -+++ u-boot-at91-sama5d4/Makefile 2019-08-04 22:42:31.053675028 +0800 ++++ u-boot-at91-sama5d4/Makefile 2019-08-22 11:46:09.222742538 +0800 @@ -194,6 +194,9 @@ ######################################################################### -- Gitblit v1.9.1