X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=arch%2Fnios2%2Fcpu%2Fstart.S;h=6af9b4e94334f80f22057646b12db3d1c58f7799;hb=6defdc0b5552ab1af4a66a8abac8196cbb6b9e15;hp=7ce0d34d7fadd61b2705eba5e3f0cfdd30fed5b5;hpb=8b485ba12b0defa0c4ed3559789250238f8331a8;p=karo-tx-uboot.git diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S index 7ce0d34d7f..6af9b4e943 100644 --- a/arch/nios2/cpu/start.S +++ b/arch/nios2/cpu/start.S @@ -134,11 +134,12 @@ _reloc: mov fp, sp /* - * Call board_init -- never returns + * Call board_init_f -- never returns */ - movhi r4, %hi(board_init@h) - ori r4, r4, %lo(board_init@h) - callr r4 + mov r4, r0 + movhi r2, %hi(board_init_f@h) + ori r2, r2, %lo(board_init_f@h) + callr r2 /* NEVER RETURNS -- but branch to the _start just * in case ;-) @@ -146,6 +147,31 @@ _reloc: br _start + +/* + * relocate_code -- Nios2 handles the relocation above. But + * the generic board code monkeys with the heap, stack, etc. + * (it makes some assumptions that may not be appropriate + * for Nios). Nevertheless, we capitulate here. + * + * We'll call the board_init_r from here since this isn't + * supposed to return. + * + * void relocate_code (ulong sp, gd_t *global_data, + * ulong reloc_addr) + * __attribute__ ((noreturn)); + */ + .text + .global relocate_code + +relocate_code: + mov sp, r4 /* Set the new sp */ + mov r4, r5 + movhi r8, %hi(board_init_r@h) + ori r8, r8, %lo(board_init_r@h) + callr r8 + ret + /* * dly_clks -- Nios2 (like Nios1) doesn't have a timebase in * the core. For simple delay loops, we do our best by counting