summaryrefslogtreecommitdiffstats
path: root/sys/arm/allwinner
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-01-06 16:57:22 +0000
committerian <ian@FreeBSD.org>2014-01-06 16:57:22 +0000
commit5d95c195b35598a3e27f75c14efb757aafb87454 (patch)
tree4c9be8c0efa3a30ddb02e3260a05c9e296116d9a /sys/arm/allwinner
parent5ffa5b0b13788d35f1e6b272fcea31c3a0b577c7 (diff)
downloadFreeBSD-src-5d95c195b35598a3e27f75c14efb757aafb87454.zip
FreeBSD-src-5d95c195b35598a3e27f75c14efb757aafb87454.tar.gz
Switch to using arm_devmap_add_entry() to set up static device mapping.
This eliminates the hard-coded max kva and roughly doubles the available kva space.
Diffstat (limited to 'sys/arm/allwinner')
-rw-r--r--sys/arm/allwinner/a10_machdep.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/sys/arm/allwinner/a10_machdep.c b/sys/arm/allwinner/a10_machdep.c
index c77a2a5..85cdb11 100644
--- a/sys/arm/allwinner/a10_machdep.c
+++ b/sys/arm/allwinner/a10_machdep.c
@@ -50,21 +50,16 @@ __FBSDID("$FreeBSD$");
#include <arm/allwinner/a10_wdog.h>
-/* 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);
}
OpenPOWER on IntegriCloud