SAMA5D4 Xplained Ultra Board BSP
guowenxue
2019-08-05 8105b7510a3b06e208fbc46d8a329a750db014b6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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 @@
+#!/bin/bash
+
+BOARD=sama5d4
+TFTP_PATH=/tftp
+IMGS_PATH=../images
+IMG_NAME=u-boot-${BOARD}.bin
+
+CROSSTOOL=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi-
+JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l`
+
+
+function do_clean()
+{
+    make CROSS_COMPILE=${CROSSTOOL} distclean
+    rm -f ${IMG_NAME}
+}
+
+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()
+{
+    make ${BOARD}_xplained_nandflash_config
+
+    make -j${JOBS}
+
+    cp u-boot.bin ${IMG_NAME}
+
+    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 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
@@ -194,6 +194,9 @@
 
 #########################################################################
 
+ARCH=arm
+CROSS_COMPILE=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi-
+
 # set default to nothing for native builds
 ifeq ($(HOSTARCH),$(ARCH))
 CROSS_COMPILE ?=