diff --git a/sys/arm/allwinner/a10_machdep.c b/sys/arm/allwinner/a10_machdep.c index c77a2a5b9738..85cdb11ef7ed 100644 --- a/sys/arm/allwinner/a10_machdep.c +++ b/sys/arm/allwinner/a10_machdep.c @@ -50,21 +50,16 @@ __FBSDID("$FreeBSD$"); #include -/* Start of address space used for bootstrap map */ -#define DEVMAP_BOOTSTRAP_MAP_START 0xE0000000 - - vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START); + return (arm_devmap_lastaddr()); } void initarm_early_init(void) { - } void @@ -77,28 +72,21 @@ initarm_late_init(void) { } -#define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, } -}; - /* - * Construct pmap_devmap[] with DT-derived config data. + * Set up static device mappings. + * + * This covers all the on-chip device with 1MB section mappings, which is good + * for performance (uses fewer TLB entries for device access). + * + * XXX It also covers a block of SRAM and some GPU (mali400) stuff that maybe + * shouldn't be device-mapped. The original code mapped a 4MB block, but + * perhaps a 1MB block would be more appropriate. */ int initarm_devmap_init(void) { - int i = 0; - fdt_devmap[i].pd_va = 0xE1C00000; - fdt_devmap[i].pd_pa = 0x01C00000; - fdt_devmap[i].pd_size = 0x00400000; /* 4 MB */ - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - - i++; - - arm_devmap_register_table(&fdt_devmap[0]); + arm_devmap_add_entry(0x01C00000, 0x00400000); /* 4MB */ return (0); }