Commit c75eba3b4140187cd0d9bd8049f5df4c49b6889b
1 parent
4a86d779ff
Exists in
master
and in
55 other branches
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
CHANGELOG
... | ... | @@ -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. |
common/cmd_ide.c
cpu/mips/config.mk
cpu/mips/start.S
... | ... | @@ -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 |
lib_mips/board.c
... | ... | @@ -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); |