MFp4: get the code that set the pc correctly to work, remove a few IQ31244
specific mappings from locore.S, re-organize iq31244_machdep.c to work with the new locore.S Spotted out by: jmg
This commit is contained in:
parent
509cfe6fb0
commit
6d4b3b4cb5
@ -164,16 +164,19 @@ mmu_done:
|
|||||||
ldr r4, =KERNVIRTADDR
|
ldr r4, =KERNVIRTADDR
|
||||||
cmp pc, r4
|
cmp pc, r4
|
||||||
#if KERNVIRTADDR > KERNPHYSADDR
|
#if KERNVIRTADDR > KERNPHYSADDR
|
||||||
ldrlt r4, =KERNVIRTADDR
|
bgt virt_done
|
||||||
ldrlt r5, =KERNPHYSADDR
|
ldr r4, =KERNVIRTADDR
|
||||||
sublt r4, r4, r5
|
ldr r5, =KERNPHYSADDR
|
||||||
addlt pc, pc, r4
|
sub r4, r4, r5
|
||||||
|
add pc, pc, r4
|
||||||
#else
|
#else
|
||||||
ldrgt r4, =KERNPHYSADDR
|
blt virt_done
|
||||||
ldrgt r5, =KERNVIRTADDR
|
ldr r4, =KERNPHYSADDR
|
||||||
subgt r4, r4, r5
|
ldr r5, =KERNVIRTADDR
|
||||||
sublt pc, pc, r4
|
sub r4, r4, r5
|
||||||
|
sub pc, pc, r4
|
||||||
#endif
|
#endif
|
||||||
|
virt_done:
|
||||||
ldr fp, =KERNVIRTADDR /* trace back starts here */
|
ldr fp, =KERNVIRTADDR /* trace back starts here */
|
||||||
bl _C_LABEL(initarm) /* Off we go */
|
bl _C_LABEL(initarm) /* Off we go */
|
||||||
|
|
||||||
@ -195,12 +198,10 @@ Lstartup_pagetable:
|
|||||||
.word STARTUP_PAGETABLE_ADDR
|
.word STARTUP_PAGETABLE_ADDR
|
||||||
mmu_init_table:
|
mmu_init_table:
|
||||||
/* fill all table VA==PA */
|
/* fill all table VA==PA */
|
||||||
MMU_INIT(0x00000000, 0x00000000, 1<<(32-L1_S_SHIFT), L1_TYPE_S|L1_S_AP(AP_KRW))
|
|
||||||
/* map SDRAM VA==PA, WT cacheable */
|
/* map SDRAM VA==PA, WT cacheable */
|
||||||
MMU_INIT(PHYSADDR, PHYSADDR , 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW))
|
MMU_INIT(PHYSADDR, PHYSADDR , 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW))
|
||||||
/* map VA 0xc0000000..0xc3ffffff to PA */
|
/* map VA 0xc0000000..0xc3ffffff to PA */
|
||||||
MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW))
|
MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW))
|
||||||
MMU_INIT(0xfe800000, 0xfe800000, 1<<(32-L1_S_SHIFT), L1_TYPE_S|L1_S_AP(AP_KRW))
|
|
||||||
|
|
||||||
.word 0 /* end of table */
|
.word 0 /* end of table */
|
||||||
#endif
|
#endif
|
||||||
|
@ -209,16 +209,9 @@ initarm(void *arg, void *arg2)
|
|||||||
uint32_t fake_preload[35];
|
uint32_t fake_preload[35];
|
||||||
uint32_t memsize, memstart;
|
uint32_t memsize, memstart;
|
||||||
|
|
||||||
i80321_calibrate_delay();
|
|
||||||
cninit();
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
set_cpufuncs();
|
set_cpufuncs();
|
||||||
/*
|
|
||||||
* Fetch the SDRAM start/size from the i80321 SDRAM configration
|
|
||||||
* registers.
|
|
||||||
*/
|
|
||||||
i80321_sdram_bounds(&obio_bs_tag, VERDE_PMMR_BASE + VERDE_MCU_BASE,
|
|
||||||
&memstart, &memsize);
|
|
||||||
fake_preload[i++] = MODINFO_NAME;
|
fake_preload[i++] = MODINFO_NAME;
|
||||||
fake_preload[i++] = strlen("elf kernel") + 1;
|
fake_preload[i++] = strlen("elf kernel") + 1;
|
||||||
strcpy((char*)&fake_preload[i++], "elf kernel");
|
strcpy((char*)&fake_preload[i++], "elf kernel");
|
||||||
@ -237,7 +230,6 @@ initarm(void *arg, void *arg2)
|
|||||||
fake_preload[i] = 0;
|
fake_preload[i] = 0;
|
||||||
preload_metadata = (void *)fake_preload;
|
preload_metadata = (void *)fake_preload;
|
||||||
|
|
||||||
physmem = memsize / PAGE_SIZE;
|
|
||||||
|
|
||||||
pcpu_init(pcpup, 0, sizeof(struct pcpu));
|
pcpu_init(pcpup, 0, sizeof(struct pcpu));
|
||||||
PCPU_SET(curthread, &thread0);
|
PCPU_SET(curthread, &thread0);
|
||||||
@ -308,7 +300,6 @@ initarm(void *arg, void *arg2)
|
|||||||
*/
|
*/
|
||||||
l1pagetable = kernel_l1pt.pv_va;
|
l1pagetable = kernel_l1pt.pv_va;
|
||||||
|
|
||||||
|
|
||||||
/* Map the L2 pages tables in the L1 page table */
|
/* Map the L2 pages tables in the L1 page table */
|
||||||
pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00100000 - 1),
|
pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00100000 - 1),
|
||||||
&kernel_pt_table[KERNEL_PT_SYS]);
|
&kernel_pt_table[KERNEL_PT_SYS]);
|
||||||
@ -400,7 +391,6 @@ initarm(void *arg, void *arg2)
|
|||||||
setttb(kernel_l1pt.pv_pa);
|
setttb(kernel_l1pt.pv_pa);
|
||||||
cpu_tlb_flushID();
|
cpu_tlb_flushID();
|
||||||
cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2));
|
cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pages were allocated during the secondary bootstrap for the
|
* Pages were allocated during the secondary bootstrap for the
|
||||||
* stacks for different CPU modes.
|
* stacks for different CPU modes.
|
||||||
@ -409,6 +399,7 @@ initarm(void *arg, void *arg2)
|
|||||||
* Since the ARM stacks use STMFD etc. we must set r13 to the top end
|
* Since the ARM stacks use STMFD etc. we must set r13 to the top end
|
||||||
* of the stack memory.
|
* of the stack memory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
set_stackptr(PSR_IRQ32_MODE,
|
set_stackptr(PSR_IRQ32_MODE,
|
||||||
irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE);
|
irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE);
|
||||||
@ -430,6 +421,15 @@ initarm(void *arg, void *arg2)
|
|||||||
* this problem will not occur after initarm().
|
* this problem will not occur after initarm().
|
||||||
*/
|
*/
|
||||||
cpu_idcache_wbinv_all();
|
cpu_idcache_wbinv_all();
|
||||||
|
/*
|
||||||
|
* Fetch the SDRAM start/size from the i80321 SDRAM configration
|
||||||
|
* registers.
|
||||||
|
*/
|
||||||
|
i80321_calibrate_delay();
|
||||||
|
i80321_sdram_bounds(&obio_bs_tag, IQ80321_80321_VBASE + VERDE_MCU_BASE,
|
||||||
|
&memstart, &memsize);
|
||||||
|
physmem = memsize / PAGE_SIZE;
|
||||||
|
cninit();
|
||||||
|
|
||||||
|
|
||||||
/* Set stack for exception handlers */
|
/* Set stack for exception handlers */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user