svn commit: r260374 - head/sys/arm/allwinner

Ian Lepore ian at FreeBSD.org
Mon Jan 6 16:57:23 UTC 2014


Author: ian
Date: Mon Jan  6 16:57:22 2014
New Revision: 260374
URL: http://svnweb.freebsd.org/changeset/base/260374

Log:
  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.

Modified:
  head/sys/arm/allwinner/a10_machdep.c

Modified: head/sys/arm/allwinner/a10_machdep.c
==============================================================================
--- head/sys/arm/allwinner/a10_machdep.c	Mon Jan  6 16:33:16 2014	(r260373)
+++ head/sys/arm/allwinner/a10_machdep.c	Mon Jan  6 16:57:22 2014	(r260374)
@@ -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);
 }


More information about the svn-src-all mailing list