svn commit: r260292 - head/sys/arm/ti

Ian Lepore ian at FreeBSD.org
Sat Jan 4 22:09:54 UTC 2014


Author: ian
Date: Sat Jan  4 22:09:53 2014
New Revision: 260292
URL: http://svnweb.freebsd.org/changeset/base/260292

Log:
  Convert static device mapping to use the new arm_devmap_add_entry(),
  and add static mappings that cover most of the on-chip peripherals with
  1MB section mappings.  This adds about 220MB or so available kva space
  by not using a hard-coded 0xF0000000 as the mapping address.

Modified:
  head/sys/arm/ti/ti_machdep.c

Modified: head/sys/arm/ti/ti_machdep.c
==============================================================================
--- head/sys/arm/ti/ti_machdep.c	Sat Jan  4 22:00:07 2014	(r260291)
+++ head/sys/arm/ti/ti_machdep.c	Sat Jan  4 22:09:53 2014	(r260292)
@@ -54,23 +54,18 @@ __FBSDID("$FreeBSD$");
 
 #include <arm/ti/omap4/omap4_reg.h>
 
-/* Start of address space used for bootstrap map */
-#define DEVMAP_BOOTSTRAP_MAP_START	0xF0000000
-
-void (*ti_cpu_reset)(void);
+void (*ti_cpu_reset)(void) = NULL;
 
 vm_offset_t
 initarm_lastaddr(void)
 {
 
-	return (DEVMAP_BOOTSTRAP_MAP_START);
+	return (arm_devmap_lastaddr());
 }
 
 void
 initarm_early_init(void)
 {
-
-	ti_cpu_reset = NULL;
 }
 
 void
@@ -83,38 +78,27 @@ initarm_late_init(void)
 {
 }
 
-#define FDT_DEVMAP_MAX	(2)		// FIXME
-static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = {
-	{ 0, 0, 0, 0, 0, }
-};
-
-
 /*
- * Construct pmap_devmap[] with DT-derived config data.
+ * Construct static devmap entries to map out the most frequently used
+ * peripherals using 1mb section mappings.
  */
 int
 initarm_devmap_init(void)
 {
-	int i = 0;
 #if defined(SOC_OMAP4)
-	fdt_devmap[i].pd_va = 0xF8000000;
-	fdt_devmap[i].pd_pa = 0x48000000;
-	fdt_devmap[i].pd_size = 0x1000000;
-	fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
-	fdt_devmap[i].pd_cache = PTE_DEVICE;
-	i++;
+	arm_devmap_add_entry(0x48000000, 0x01000000); // 16mb L4_PER devices
+	arm_devmap_add_entry(0x4A000000, 0x01000000); // 16mb L4_CFG devices
 #elif defined(SOC_TI_AM335X)
-	fdt_devmap[i].pd_va = 0xF4C00000;
-	fdt_devmap[i].pd_pa = 0x44C00000;       /* L4_WKUP */
-	fdt_devmap[i].pd_size = 0x400000;       /* 4 MB */
-	fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
-	fdt_devmap[i].pd_cache = PTE_DEVICE;
-	i++;
+	arm_devmap_add_entry(0x44C00000, 0x00400000); //  4mb L4_WKUP devices
+	arm_devmap_add_entry(0x47400000, 0x00100000); //  1mb USB
+	arm_devmap_add_entry(0x47800000, 0x00100000); //  1mb mmchs2
+	arm_devmap_add_entry(0x48000000, 0x01000000); // 16mb L4_PER devices
+	arm_devmap_add_entry(0x49000000, 0x00100000); //  1mb edma3
+	arm_devmap_add_entry(0x49800000, 0x00300000); //  3mb edma3
+	arm_devmap_add_entry(0x4A000000, 0x01000000); // 16mb L4_FAST devices
 #else
 #error "Unknown SoC"
 #endif
-
-	arm_devmap_register_table(&fdt_devmap[0]);
 	return (0);
 }
 


More information about the svn-src-head mailing list