Print this page
loader: allow 1MB device maps
There's no reason we shouldn't allow 1MB PTEs for use on device memory.
loader: map as much as possible using 1MB pages
Chances are that we never actually executed this bit of code since all the
maps we ever deal with are either very short or much larger than 1MB.
unix: enable caches in locore
The loader should really be as simple as possible to be as small as
possible.  It should configure the machine so that unix can make certain
assumptions but it should leave more complex initialization to unix.

*** 33,43 **** * o Determine the set of mappings we need to add for the following: * - unix * - boot_archive * - atags * o Enable unaligned access ! * o Enable the caches + virtual memory * * There are several important constraints that we have here: * * o We cannot use any .data! Several loaders that come before us are broken * and only provide us with the ability to map our .text and potentially our --- 33,43 ---- * o Determine the set of mappings we need to add for the following: * - unix * - boot_archive * - atags * o Enable unaligned access ! * o Enable virtual memory * * There are several important constraints that we have here: * * o We cannot use any .data! Several loaders that come before us are broken * and only provide us with the ability to map our .text and potentially our
*** 161,175 **** if (ARMPT_L1E_ISVALID(*pte)) fakeload_panic("armboot_mmu: asked to map a mapped region!\n"); l1e = (arm_l1s_t *)pte; *pte = 0; l1e->al_type = ARMPT_L1_TYPE_SECT; ! /* Assume it's not device memory */ l1e->al_bbit = 1; l1e->al_cbit = 1; l1e->al_tex = 1; l1e->al_sbit = 1; if (!(prot & PF_X)) l1e->al_xn = 1; l1e->al_domain = 0; --- 161,182 ---- if (ARMPT_L1E_ISVALID(*pte)) fakeload_panic("armboot_mmu: asked to map a mapped region!\n"); l1e = (arm_l1s_t *)pte; *pte = 0; l1e->al_type = ARMPT_L1_TYPE_SECT; ! ! if (prot & PF_DEVICE) { ! l1e->al_bbit = 1; ! l1e->al_cbit = 0; ! l1e->al_tex = 0; ! l1e->al_sbit = 1; ! } else { l1e->al_bbit = 1; l1e->al_cbit = 1; l1e->al_tex = 1; l1e->al_sbit = 1; + } if (!(prot & PF_X)) l1e->al_xn = 1; l1e->al_domain = 0;
*** 444,454 **** if (!ARMPT_L1E_ISVALID(*pte)) { uintptr_t l2table; if (!(vstart & MMU_PAGEOFFSET1M) && !(pstart & MMU_PAGEOFFSET1M) && ! len == MMU_PAGESIZE1M) { fakeload_map_1mb(pstart, vstart, prot); vstart += MMU_PAGESIZE1M; pstart += MMU_PAGESIZE1M; len -= MMU_PAGESIZE1M; continue; --- 451,461 ---- if (!ARMPT_L1E_ISVALID(*pte)) { uintptr_t l2table; if (!(vstart & MMU_PAGEOFFSET1M) && !(pstart & MMU_PAGEOFFSET1M) && ! len >= MMU_PAGESIZE1M) { fakeload_map_1mb(pstart, vstart, prot); vstart += MMU_PAGESIZE1M; pstart += MMU_PAGESIZE1M; len -= MMU_PAGESIZE1M; continue;
*** 701,713 **** FAKELOAD_DPRINTF("see you on the other side\n"); fakeload_mmu_enable(); FAKELOAD_DPRINTF("why helo thar\n"); - /* Renable caches */ - armv6_dcache_enable(); - armv6_icache_enable(); - /* we should never come back */ fakeload_exec(ident, ident2, chain, unix_start); fakeload_panic("hit the end of the world\n"); } --- 708,716 ----