@@ -0,0 +1,141 @@
1+From 53a8612ff19f360363edaaf70137968f7fd6a1cd Mon Sep 17 00:00:00 2001
2+From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
3+Date: Mon, 8 Jun 2015 22:29:23 +0300
4+Subject: [PATCH] vexpress: Use config_distro_bootcmd
5+
6+Also had to hack cli_readline.c, as one codepath in
7+cli_readline_into_buffer doesn't respect the timeout.
8+---
9+ common/cli_readline.c | 12 +++++++++++-
10+ include/configs/vexpress_ca9x4.h | 1 -
11+ include/configs/vexpress_common.h | 35 +++++++++++++++++++++++------------
12+ 3 files changed, 34 insertions(+), 14 deletions(-)
13+
14+diff --git a/common/cli_readline.c b/common/cli_readline.c
15+index 9a9fb35..ca997a9 100644
16+--- a/common/cli_readline.c
17++++ b/common/cli_readline.c
18+@@ -517,6 +517,7 @@ int cli_readline_into_buffer(const char *const prompt, char *buffer,
19+ int plen = 0; /* prompt length */
20+ int col; /* output column cnt */
21+ char c;
22++ int first = 1;
23+
24+ /* print prompt */
25+ if (prompt) {
26+@@ -528,7 +529,16 @@ int cli_readline_into_buffer(const char *const prompt, char *buffer,
27+ for (;;) {
28+ if (bootretry_tstc_timeout())
29+ return -2; /* timed out */
30+- WATCHDOG_RESET(); /* Trigger watchdog, if needed */
31++ if (first && timeout) {
32++ uint64_t etime = endtick(timeout);
33++
34++ while (!tstc()) { /* while no incoming data */
35++ if (get_ticks() >= etime)
36++ return -2; /* timed out */
37++ WATCHDOG_RESET();
38++ }
39++ first = 0;
40++ }
41+
42+ #ifdef CONFIG_SHOW_ACTIVITY
43+ while (!tstc()) {
44+diff --git a/include/configs/vexpress_ca9x4.h b/include/configs/vexpress_ca9x4.h
45+index 38ac4ed..993398c 100644
46+--- a/include/configs/vexpress_ca9x4.h
47++++ b/include/configs/vexpress_ca9x4.h
48+@@ -13,6 +13,5 @@
49+
50+ #define CONFIG_VEXPRESS_ORIGINAL_MEMORY_MAP
51+ #include "vexpress_common.h"
52+-#define CONFIG_BOOTP_VCI_STRING "U-boot.armv7.vexpress_ca9x4"
53+
54+ #endif /* VEXPRESS_CA9X4_H */
55+diff --git a/include/configs/vexpress_common.h b/include/configs/vexpress_common.h
56+index db78c85..1dd069b 100644
57+--- a/include/configs/vexpress_common.h
58++++ b/include/configs/vexpress_common.h
59+@@ -123,7 +123,6 @@
60+ #define CONFIG_SYS_L2CACHE_OFF 1
61+ #define CONFIG_INITRD_TAG 1
62+ #define CONFIG_SYS_GENERIC_BOARD
63+-#define CONFIG_OF_LIBFDT 1
64+
65+ /* Size of malloc() pool */
66+ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128 * 1024)
67+@@ -152,6 +151,8 @@
68+ #define CONFIG_SYS_SERIAL0 V2M_UART0
69+ #define CONFIG_SYS_SERIAL1 V2M_UART1
70+
71++#include <config_distro_defaults.h>
72++#include <config_cmd_default.h>
73+ /* Command line configuration */
74+ #define CONFIG_CMD_BDI
75+ #define CONFIG_CMD_DHCP
76+@@ -169,7 +170,6 @@
77+ #define CONFIG_SUPPORT_RAW_INITRD
78+
79+ #define CONFIG_CMD_FAT
80+-#define CONFIG_DOS_PARTITION 1
81+ #define CONFIG_MMC 1
82+ #define CONFIG_CMD_MMC
83+ #define CONFIG_GENERIC_MMC
84+@@ -207,17 +207,28 @@
85+ GENERATED_GBL_DATA_SIZE)
86+ #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_GBL_DATA_OFFSET
87+
88++#define BOOT_TARGET_DEVICES(func) \
89++ func(MMC, mmc, 0)
90++#include <config_distro_bootcmd.h>
91++
92+ /* Basic environment settings */
93+-#define CONFIG_BOOTCOMMAND "run bootflash;"
94+ #ifdef CONFIG_VEXPRESS_ORIGINAL_MEMORY_MAP
95++/*
96++ * RAM starts at 0x6000_0000
97++ * - U-Boot loaded @ 8M
98++ * - Kernel loaded @ 32M
99++ * - Initrd loaded @ 128M
100++ * - DTB loaded @ 240M
101++ */
102+ #define CONFIG_PLATFORM_ENV_SETTINGS \
103+- "loadaddr=0x80008000\0" \
104+- "ramdisk_addr_r=0x61000000\0" \
105+- "kernel_addr=0x44100000\0" \
106+- "ramdisk_addr=0x44800000\0" \
107+- "maxramdisk=0x1800000\0" \
108+- "pxefile_addr_r=0x88000000\0" \
109+- "kernel_addr_r=0x80008000\0"
110++ "fdtfile=vexpress-v2p-ca9.dtb\0" \
111++ "kernel_addr_r=0x62000000\0" \
112++ "ramdisk_addr_r=0x68000000\0" \
113++ "maxramdisk=0x06000000\0" \
114++ "fdt_addr_r=0x6f000000\0" \
115++ "loadaddr=0x70000000\0" \
116++ "pxefile_addr_r=0x71000000\0" \
117++ "scriptaddr=0x72000000\0"
118+ #elif defined(CONFIG_VEXPRESS_EXTENDED_MEMORY_MAP)
119+ #define CONFIG_PLATFORM_ENV_SETTINGS \
120+ "loadaddr=0xa0008000\0" \
121+@@ -240,7 +251,8 @@
122+ "devtmpfs.mount=0 vmalloc=256M\0" \
123+ "bootflash=run flashargs; " \
124+ "cp ${ramdisk_addr} ${ramdisk_addr_r} ${maxramdisk}; " \
125+- "bootm ${kernel_addr} ${ramdisk_addr_r}\0"
126++ "bootm ${kernel_addr} ${ramdisk_addr_r}\0" \
127++ BOOTENV
128+
129+ /* FLASH and environment organization */
130+ #define PHYS_FLASH_SIZE 0x04000000 /* 64MB */
131+@@ -294,7 +306,6 @@
132+ #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot args buffer */
133+ #define CONFIG_CMD_SOURCE
134+ #define CONFIG_SYS_LONGHELP
135+-#define CONFIG_CMDLINE_EDITING 1
136+ #define CONFIG_SYS_MAXARGS 16 /* max command args */
137+
138+ #endif /* VEXPRESS_COMMON_H */
139+--
140+2.4.4
141+