Commit c75eba3b4140187cd0d9bd8049f5df4c49b6889b

Authored by Wolfgang Denk
1 parent 4a86d779ff
Exists in master and in 55 other branches 8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, u-boot-2013.01.y, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x

Fix U-Boot compilation for MIPS boards using ELDK 4.0

Showing 5 changed files with 29 additions and 26 deletions Side-by-side Diff

... ... @@ -2,6 +2,8 @@
2 2 Changes for U-Boot 1.1.4:
3 3 ======================================================================
4 4  
  5 +* Fix U-Boot compilation for MIPS boards using ELDK 4.0
  6 +
5 7 * Add support for TQM8541/8555 boards, TQM85xx support reworked:
6 8 - Support for TQM8541/8555 boards added.
7 9 - Complete rework of TQM8540/8560 support.
... ... @@ -49,7 +49,7 @@
49 49 #include <asm/io.h>
50 50 #ifdef __MIPS__
51 51 /* Macros depend on this variable */
52   -static unsigned long mips_io_port_base = 0;
  52 +unsigned long mips_io_port_base = 0;
53 53 #endif
54 54 #endif
55 55  
... ... @@ -26,7 +26,7 @@
26 26 if [ "$v" -lt "14" ]; then \
27 27 echo "-mcpu=4kc"; \
28 28 else \
29   - echo "-march=4kc -mtune=4kc -Wa,-mips_allow_branch_to_undefined"; \
  29 + echo "-march=4kc -mtune=4kc"; \
30 30 fi)
31 31  
32 32 ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
... ... @@ -234,21 +234,34 @@
234 234 li t0, CONF_CM_UNCACHED
235 235 mtc0 t0, CP0_CONFIG
236 236  
  237 + /* Initialize GOT pointer.
  238 + */
  239 + bal 1f
  240 + nop
  241 + .word _GLOBAL_OFFSET_TABLE_
  242 + 1:
  243 + move gp, ra
  244 + lw t1, 0(ra)
  245 + move gp, t1
  246 +
237 247 #ifdef CONFIG_INCA_IP
238 248 /* Disable INCA-IP Watchdog.
239 249 */
240   - bal disable_incaip_wdt
  250 + la t9, disable_incaip_wdt
  251 + jalr t9
241 252 nop
242 253 #endif
243 254  
244 255 /* Initialize any external memory.
245 256 */
246   - bal lowlevel_init
  257 + la t9, lowlevel_init
  258 + jalr t9
247 259 nop
248 260  
249 261 /* Initialize caches...
250 262 */
251   - bal mips_cache_reset
  263 + la t9, mips_cache_reset
  264 + jalr t9
252 265 nop
253 266  
254 267 /* ... and enable them.
255 268  
... ... @@ -260,21 +273,13 @@
260 273 /* Set up temporary stack.
261 274 */
262 275 li a0, CFG_INIT_SP_OFFSET
263   - bal mips_cache_lock
  276 + la t9, mips_cache_lock
  277 + jalr t9
264 278 nop
265 279  
266 280 li t0, CFG_SDRAM_BASE + CFG_INIT_SP_OFFSET
267 281 la sp, 0(t0)
268 282  
269   - /* Initialize GOT pointer.
270   - */
271   - bal 1f
272   - nop
273   - .word _GLOBAL_OFFSET_TABLE_ - 1f + 4
274   -1:
275   - move gp, ra
276   - lw t1, 0(ra)
277   - add gp, t1
278 283 la t9, board_init_f
279 284 j t9
280 285 nop
... ... @@ -29,6 +29,8 @@
29 29 #include <net.h>
30 30 #include <environment.h>
31 31  
  32 +DECLARE_GLOBAL_DATA_PTR;
  33 +
32 34 #if ( ((CFG_ENV_ADDR+CFG_ENV_SIZE) < CFG_MONITOR_BASE) || \
33 35 (CFG_ENV_ADDR >= (CFG_MONITOR_BASE + CFG_MONITOR_LEN)) ) || \
34 36 defined(CFG_ENV_IS_IN_NVRAM)
... ... @@ -66,8 +68,6 @@
66 68 */
67 69 static void mem_malloc_init (void)
68 70 {
69   - DECLARE_GLOBAL_DATA_PTR;
70   -
71 71 ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
72 72  
73 73 mem_malloc_end = dest_addr;
... ... @@ -94,8 +94,6 @@
94 94  
95 95 static int init_func_ram (void)
96 96 {
97   - DECLARE_GLOBAL_DATA_PTR;
98   -
99 97 #ifdef CONFIG_BOARD_TYPES
100 98 int board_type = gd->board_type;
101 99 #else
... ... @@ -127,8 +125,6 @@
127 125  
128 126 static int init_baudrate (void)
129 127 {
130   - DECLARE_GLOBAL_DATA_PTR;
131   -
132 128 uchar tmp[64]; /* long enough for environment variables */
133 129 int i = getenv_r ("baudrate", tmp, sizeof (tmp));
134 130  
135 131  
... ... @@ -180,12 +176,11 @@
180 176  
181 177 void board_init_f(ulong bootflag)
182 178 {
183   - DECLARE_GLOBAL_DATA_PTR;
184   -
185 179 gd_t gd_data, *id;
186 180 bd_t *bd;
187 181 init_fnc_t **init_fnc_ptr;
188 182 ulong addr, addr_sp, len = (ulong)&uboot_end - CFG_MONITOR_BASE;
  183 + ulong *s;
189 184 #ifdef CONFIG_PURPLE
190 185 void copy_code (ulong);
191 186 #endif
... ... @@ -262,8 +257,10 @@
262 257 */
263 258 addr_sp -= 16;
264 259 addr_sp &= ~0xF;
265   - *((ulong *) addr_sp)-- = 0;
266   - *((ulong *) addr_sp)-- = 0;
  260 + s = (ulong *)addr_sp;
  261 + *s-- = 0;
  262 + *s-- = 0;
  263 + addr_sp = (ulong)s;
267 264 debug ("Stack Pointer at: %08lx\n", addr_sp);
268 265  
269 266 /*
... ... @@ -298,7 +295,6 @@
298 295  
299 296 void board_init_r (gd_t *id, ulong dest_addr)
300 297 {
301   - DECLARE_GLOBAL_DATA_PTR;
302 298 cmd_tbl_t *cmdtp;
303 299 ulong size;
304 300 extern void malloc_bin_reloc (void);