#include "kernel/debug.h"
#include "omap_timer.h"
-phys_bytes device_mem_vaddr = 0;
#define HASPT(procptr) ((procptr)->p_seg.p_ttbr != 0)
static int nfreepdes = 0;
pr->p_reg.sp = sp;
}
-static int device_mem_mapping_index = -1,
- frclock_index = -1,
+static int frclock_index = -1,
usermapped_glo_index = -1,
usermapped_index = -1, first_um_idx = -1;
-char *device_mem;
/* defined in kernel.lds */
extern char usermapped_start, usermapped_end, usermapped_nonglo_start;
if(first) {
memset(&minix_kerninfo, 0, sizeof(minix_kerninfo));
- device_mem_mapping_index = freeidx++;
frclock_index = freeidx++;
if(glo_len > 0) {
usermapped_glo_index = freeidx++;
*flags = VMMF_USER;
return OK;
}
- else if (index == device_mem_mapping_index) {
-#ifdef DM37XX
- /* map device memory */
- *addr = 0x48000000;
- *len = 0x02000000;
-#endif
-#ifdef AM335X
- /* map device memory until 0x5700 SGX */
- *addr = 0x44000000;
- *len = 0x06000000;
-
-#endif
- *flags = VMMF_UNCACHED | VMMF_WRITE;
- return OK;
- }
else if (index == frclock_index) {
#ifdef DM37XX
if (index == usermapped_index) {
return OK;
}
- else if (index == device_mem_mapping_index) {
- device_mem_vaddr = addr;
- return OK;
- }
else if (index == frclock_index) {
#ifdef DM37XX
minix_kerninfo.minix_frclock = addr;
phys_maps = phys_maps->next;
}
-
- device_mem = (char *) device_mem_vaddr;
-
return OK;
}
/* Kernel also wants various mappings of its own. */
for(i = 0; i < kernmappings; i++) {
int r;
-#if defined(__arm__)
-
-#ifdef DM37XX
-//FIXME this special case will be removed once we have non 1:1 mapping
-#define XXX 0x48000000
-#endif
-#ifdef AM335X
-#define XXX 0x44000000
-#endif
- if(kern_mappings[i].phys_addr == XXX) {
- addr = kern_mappings[i].phys_addr;
- assert(!(kern_mappings[i].len % ARCH_BIG_PAGE_SIZE));
- for(mapped = 0; mapped < kern_mappings[i].len;
- mapped += ARCH_BIG_PAGE_SIZE) {
- int map_pde = addr / ARCH_BIG_PAGE_SIZE;
- assert(!(addr % ARCH_BIG_PAGE_SIZE));
- assert(addr == (addr & ARCH_VM_PDE_MASK));
- assert(!pt->pt_dir[map_pde]);
- pt->pt_dir[map_pde] = addr |
- ARM_VM_SECTION | ARM_VM_SECTION_DOMAIN |
- ARM_VM_SECTION_DEVICE |
- ARM_VM_SECTION_SUPER;
- addr += ARCH_BIG_PAGE_SIZE;
- }
- continue;
- }
-#endif
-
if((r=pt_writemap(NULL, pt,
kern_mappings[i].vir_addr,
kern_mappings[i].phys_addr,