SAMA5D4 Xplained Ultra Board BSP
guowenxue
2019-08-24 f8f05031c8278c8ad6dd18714c2a82d930dbfcbd
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
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 19:29:04.983275344 +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-23 00:01:11.723588530 +0800
@@ -0,0 +1,274 @@
+#
+# Automatically generated make config: don't edit
+# Thu Aug 22 23:43:05 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="0x00080000"
+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 19:29:04.983275344 +0800
@@ -119,6 +119,7 @@
 
 HOSTARCH := $(shell uname -m | sed -e s/arm.*/arm/)
 
+CROSS_COMPILE=/opt/buildroot/cortex-a5/bin/arm-linux-
 AS=$(CROSS_COMPILE)gcc
 CC=$(CROSS_COMPILE)gcc
 LD=$(CROSS_COMPILE)ld