forked from eewiki/u-boot-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001-sama5d4ek-uEnv.txt-bootz-n-fixes.patch
111 lines (103 loc) · 3.21 KB
/
0001-sama5d4ek-uEnv.txt-bootz-n-fixes.patch
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
From 914b65ce5b59918dc64fac032bec13c985daf4d0 Mon Sep 17 00:00:00 2001
From: Robert Nelson <[email protected]>
Date: Wed, 3 Jun 2015 15:59:05 -0500
Subject: [PATCH] sama5d4ek: uEnv.txt, bootz, n fixes
Signed-off-by: Robert Nelson <[email protected]>
---
include/configs/at91-sama5_common.h | 49 ++++++++++++++++++++++++++++++++++---
include/configs/sama5d4ek.h | 12 ++++++---
2 files changed, 54 insertions(+), 7 deletions(-)
diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
index 9289964..af65566 100644
--- a/include/configs/at91-sama5_common.h
+++ b/include/configs/at91-sama5_common.h
@@ -35,7 +35,7 @@
/* general purpose I/O */
#define CONFIG_AT91_GPIO
-#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTDELAY 1
/*
* BOOTP options
@@ -56,9 +56,50 @@
#define CONFIG_CMD_DHCP
#ifdef CONFIG_SYS_USE_MMC
-#define CONFIG_BOOTARGS \
- "console=ttyS0,115200 earlyprintk " \
- "root=/dev/mmcblk0p2 rw rootwait"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "loadaddr=0x22000000\0" \
+ "ftdaddr=0x21000000\0" \
+ "bootfile=zImage\0" \
+ "fdt_file=/dtbs/at91-sama5d4ek.dtb\0" \
+ "console=ttyS0,115200n8\0" \
+ "optargs=\0" \
+ "video=\0" \
+ "mmcdev=0\0" \
+ "mmcpart=1\0" \
+ "mmcroot=/dev/mmcblk0p2 ro\0" \
+ "mmcrootfstype=ext4 rootwait\0" \
+ "mmcargs=setenv bootargs console=${console} " \
+ "${optargs} " \
+ "root=${mmcroot} " \
+ "rootfstype=${mmcrootfstype}\0" \
+ "video=${video}\0" \
+ "loadbootenv=load mmc ${mmcdev}:${mmcpart} ${loadaddr} uEnv.txt\0" \
+ "importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \
+ "env import -t $loadaddr $filesize\0" \
+ "loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage\0" \
+ "loadfdt=load mmc ${mmcdev}:${mmcpart} ${ftdaddr} ${fdt_file}\0" \
+ "mmcboot=echo Booting from mmc ...; " \
+ "run mmcargs; " \
+ "bootz ${loadaddr} - ${ftdaddr}\0"
+
+#define CONFIG_BOOTCOMMAND \
+ "mmc dev ${mmcdev};" \
+ "if mmc rescan; then " \
+ "echo SD/MMC found on device ${mmcdev};" \
+ "if run loadbootenv; then " \
+ "run importbootenv;" \
+ "fi;" \
+ "echo Checking if uenvcmd is set ...;" \
+ "if test -n $uenvcmd; then " \
+ "echo Running uenvcmd ...;" \
+ "run uenvcmd;" \
+ "fi;" \
+ "echo Running default loadzimage ...;" \
+ "if run loadzimage; then " \
+ "run loadfdt;" \
+ "run mmcboot;" \
+ "fi;" \
+ "fi;"
#else
#define CONFIG_BOOTARGS \
"console=ttyS0,115200 earlyprintk " \
diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h
index 546d7a3..5d8185f 100644
--- a/include/configs/sama5d4ek.h
+++ b/include/configs/sama5d4ek.h
@@ -95,6 +95,15 @@
#if defined(CONFIG_CMD_USB) || defined(CONFIG_CMD_MMC)
#define CONFIG_CMD_FAT
#define CONFIG_DOS_PARTITION
+
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
+#define CONFIG_CMD_FS_GENERIC
+
+#define CONFIG_CMD_BOOTZ
+#define CONFIG_SUPPORT_RAW_INITRD
+
#endif
/* Ethernet Hardware */
@@ -149,9 +158,6 @@
#define FAT_ENV_DEVICE_AND_PART "0"
#define FAT_ENV_FILE "uboot.env"
#define CONFIG_ENV_SIZE 0x4000
-#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 sama5d4ek.dtb; " \
- "fatload mmc 0:1 0x22000000 zImage; " \
- "bootz 0x22000000 - 0x21000000"
#endif
/* SPL */
--
2.1.4