mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
csky: Support dynamic start physical address
Before this patch csky-linux need CONFIG_RAM_BASE to determine start physical address. Now we use phys_offset variable to replace the macro of PHYS_OFFSET and we setup phys_offset with real physical address which is determined during startup in head.S. With this patch we needn't re-compile kernel for different start physical address. ie: 0x0 / 0xc0000000 start physical address could use the same vmlinux, be care different start address must be 512MB aligned. Signed-off-by: Guo Ren <ren_guo@c-sky.com> Cc: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
@@ -142,11 +142,16 @@ void __init setup_arch(char **cmdline_p)
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned long phys_offset;
|
||||
EXPORT_SYMBOL(phys_offset);
|
||||
|
||||
asmlinkage __visible void __init csky_start(unsigned int unused, void *param)
|
||||
{
|
||||
/* Clean up bss section */
|
||||
memset(__bss_start, 0, __bss_stop - __bss_start);
|
||||
|
||||
phys_offset = read_mmu_msa0() & ~(SSEG_SIZE - 1);
|
||||
|
||||
pre_trap_init();
|
||||
pre_mmu_init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user