| 4a5d8898 | 29-Jan-2015 |
Paul Burton <paul.burton@imgtec.com> |
MIPS: unify cache initialization code
The mips32 & mips64 cache initialization code differs only in that the mips32 code supports reading the cache size from coprocessor 0 registers at runtime. Move
MIPS: unify cache initialization code
The mips32 & mips64 cache initialization code differs only in that the mips32 code supports reading the cache size from coprocessor 0 registers at runtime. Move the more developed mips32 version to a common arch/mips/lib/cache_init.S & remove the now-redundant mips64 version in order to reduce duplication. The temporary registers used are shuffled slightly in order to work for both mips32 & mips64 builds. The RA register is defined differently to suit mips32 & mips64, but will be removed by a later commit in the series after further cleanup.
Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
show more ...
|
| e5200238 | 18-Jan-2015 |
Daniel Schwierzeck <daniel.schwierzeck@gmail.com> |
MIPS: add support for pre-relocation malloc
Implement MIPS specific setup of the gd_t structure to support pre-relocation malloc. If CONFIG_SYS_MALLOC_F_LEN is specified, a memory area will be reser
MIPS: add support for pre-relocation malloc
Implement MIPS specific setup of the gd_t structure to support pre-relocation malloc. If CONFIG_SYS_MALLOC_F_LEN is specified, a memory area will be reserved after the initial stack area and the gd->malloc_base pointer will be initialized.
After this patch the new driver model can be used on MIPS.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
show more ...
|
| 04380c65 | 12-Feb-2013 |
Gabor Juhos <juhosg@openwrt.org> |
MIPS: add dynamic relocation support
The code handles relocation entries with the following relocation types only: mips32: R_MIPS_REL32 mips64: R_MIPS_REL+R_MIPS_64 xburst: R_MIPS_REL32
Other
MIPS: add dynamic relocation support
The code handles relocation entries with the following relocation types only: mips32: R_MIPS_REL32 mips64: R_MIPS_REL+R_MIPS_64 xburst: R_MIPS_REL32
Other relocation entries are skipped without processing. The code must be extended if other relocation types must be supported.
Add -pie to LDFLAGS_FINAL to generate the .rel.dyn fixup table, which will be applied to the relocated image before transferring control to it.
The CONFIG_NEEDS_MANUAL_RELOC is not needed after the patch, so remove that as well.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
show more ...
|
| 696a3b2a | 12-Feb-2013 |
Daniel Schwierzeck <daniel.schwierzeck@gmail.com> |
MIPS: start.S: optimize BSS initialization
Get the start and end address for clearing BSS from the newly introduced symbols __bss_start and __bss_end. After GOT is relocated, those symbols are alrea
MIPS: start.S: optimize BSS initialization
Get the start and end address for clearing BSS from the newly introduced symbols __bss_start and __bss_end. After GOT is relocated, those symbols are already pointing to the correct addresses.
Also optimize the loop by moving the address incrementation to the delay slot to avoid the initial sub instruction.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
show more ...
|
| 025f2b33 | 30-Jan-2013 |
Gabor Juhos <juhosg@openwrt.org> |
MIPS: simplify relocated _G_O_T_ address calculation
The difference between the address of the original and the relocated _GLOBAL_OFFSET_TABLE_ is always the same as the relocation offset.
The relo
MIPS: simplify relocated _G_O_T_ address calculation
The difference between the address of the original and the relocated _GLOBAL_OFFSET_TABLE_ is always the same as the relocation offset.
The relocation offset is already computed and it is available in the 's1/t6' register. Use that to adjust the relocated _G_O_T_ address, instead of calculating the offset again from the _gp value.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com> Cc: Xiangfu Liu <xiangfu@openmobilefree.net>
show more ...
|
| 67d80c9f | 24-Jan-2013 |
Gabor Juhos <juhosg@openwrt.org> |
MIPS: start.S: don't save flush_cache parameters in advance
Saving the parameters in advance unnecessarily complicates the code. The destination address is already saved in the 's2' register, and th
MIPS: start.S: don't save flush_cache parameters in advance
Saving the parameters in advance unnecessarily complicates the code. The destination address is already saved in the 's2' register, and that register is not clobbered by the copy loop. The size of the copied data can be computed after the copy loop is done.
Change the code to compute the size parameter right before calling flush_cache, and set the destination address parameter in the delay slot of the actuall call.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
show more ...
|
| 248fe03f | 24-Jan-2013 |
Gabor Juhos <juhosg@openwrt.org> |
MIPS: start.S: simplify relocation offset calculation
The current code uses four instructions and a temporary register to calculate the relocation offset and to adjust the gp register.
The relocati
MIPS: start.S: simplify relocation offset calculation
The current code uses four instructions and a temporary register to calculate the relocation offset and to adjust the gp register.
The relocation offset can be calculated directly from the CONFIG_SYS_MONITOR_BASE constant and from the destination address. The resulting offset can be used to adjust the gp pointer.
This approach makes the code a bit simpler because it needs two instructions only.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
show more ...
|
| b2fe86f8 | 24-Jan-2013 |
Gabor Juhos <juhosg@openwrt.org> |
MIPS: start.S: save reused arguments earlier in relocate_code
Save the reused parameters at the beginning of the 'relocate_code' function. This makes the function a bit more readable.
Signed-off-by
MIPS: start.S: save reused arguments earlier in relocate_code
Save the reused parameters at the beginning of the 'relocate_code' function. This makes the function a bit more readable.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
show more ...
|
| f321b0f9 | 24-Jan-2013 |
Gabor Juhos <juhosg@openwrt.org> |
MIPS: start.S: set sp register directly
The current code uses two instructions to load the stack pointer into the 'sp' register.
This results in the following assembly code:
468: 3c088040
MIPS: start.S: set sp register directly
The current code uses two instructions to load the stack pointer into the 'sp' register.
This results in the following assembly code:
468: 3c088040 lui t0,0x8040 46c: 251d0000 addiu sp,t0,0
The first instuction loads the stack pointer into the 't0' register then the value of the 'sp' register is computed by adding zero to the value of the 't0' register. The same issue present on the 64-bit version as well:
56c: 3c0c8040 lui t0,0x8040 570: 659d0000 daddiu sp,t0,0
Change the code to load the stack pointer directly into the 'sp' register. The generated code is functionally equivalent to the previous version but it is simpler.
32-bit: 468: 3c1d8040 lui sp,0x8040
64-bit: 56c: 3c1d8040 lui sp,0x8040
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
show more ...
|