arm:remove pre 1:1 mapping workarounds.

Change-Id: I5a690cf5a561cdca9b9c1f031402f80fd203c92d
This commit is contained in:
Kees Jongenburger 2013-06-12 10:19:22 +02:00 committed by Gerrit Code Review
parent a5a693a046
commit a2fcba659c
2 changed files with 1 additions and 55 deletions

View file

@ -20,7 +20,6 @@
#include "kernel/debug.h" #include "kernel/debug.h"
#include "omap_timer.h" #include "omap_timer.h"
phys_bytes device_mem_vaddr = 0;
#define HASPT(procptr) ((procptr)->p_seg.p_ttbr != 0) #define HASPT(procptr) ((procptr)->p_seg.p_ttbr != 0)
static int nfreepdes = 0; static int nfreepdes = 0;
@ -678,12 +677,10 @@ void arch_proc_init(struct proc *pr, const u32_t ip, const u32_t sp, char *name)
pr->p_reg.sp = sp; pr->p_reg.sp = sp;
} }
static int device_mem_mapping_index = -1, static int frclock_index = -1,
frclock_index = -1,
usermapped_glo_index = -1, usermapped_glo_index = -1,
usermapped_index = -1, first_um_idx = -1; usermapped_index = -1, first_um_idx = -1;
char *device_mem;
/* defined in kernel.lds */ /* defined in kernel.lds */
extern char usermapped_start, usermapped_end, usermapped_nonglo_start; extern char usermapped_start, usermapped_end, usermapped_nonglo_start;
@ -702,7 +699,6 @@ int arch_phys_map(const int index,
if(first) { if(first) {
memset(&minix_kerninfo, 0, sizeof(minix_kerninfo)); memset(&minix_kerninfo, 0, sizeof(minix_kerninfo));
device_mem_mapping_index = freeidx++;
frclock_index = freeidx++; frclock_index = freeidx++;
if(glo_len > 0) { if(glo_len > 0) {
usermapped_glo_index = freeidx++; usermapped_glo_index = freeidx++;
@ -736,21 +732,6 @@ int arch_phys_map(const int index,
*flags = VMMF_USER; *flags = VMMF_USER;
return OK; 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) { else if (index == frclock_index) {
#ifdef DM37XX #ifdef DM37XX
@ -808,10 +789,6 @@ int arch_phys_map_reply(const int index, const vir_bytes addr)
if (index == usermapped_index) { if (index == usermapped_index) {
return OK; return OK;
} }
else if (index == device_mem_mapping_index) {
device_mem_vaddr = addr;
return OK;
}
else if (index == frclock_index) { else if (index == frclock_index) {
#ifdef DM37XX #ifdef DM37XX
minix_kerninfo.minix_frclock = addr; minix_kerninfo.minix_frclock = addr;
@ -862,9 +839,6 @@ int arch_enable_paging(struct proc * caller)
phys_maps = phys_maps->next; phys_maps = phys_maps->next;
} }
device_mem = (char *) device_mem_vaddr;
return OK; return OK;
} }

View file

@ -1397,34 +1397,6 @@ int pt_mapkernel(pt_t *pt)
/* Kernel also wants various mappings of its own. */ /* Kernel also wants various mappings of its own. */
for(i = 0; i < kernmappings; i++) { for(i = 0; i < kernmappings; i++) {
int r; 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, if((r=pt_writemap(NULL, pt,
kern_mappings[i].vir_addr, kern_mappings[i].vir_addr,
kern_mappings[i].phys_addr, kern_mappings[i].phys_addr,