From owner-svn-src-head@FreeBSD.ORG Sat Jan 4 22:09:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2898E70; Sat, 4 Jan 2014 22:09:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C4E96153A; Sat, 4 Jan 2014 22:09:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s04M9rWd025349; Sat, 4 Jan 2014 22:09:53 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s04M9rJs025348; Sat, 4 Jan 2014 22:09:53 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201401042209.s04M9rJs025348@svn.freebsd.org> From: Ian Lepore Date: Sat, 4 Jan 2014 22:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260292 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jan 2014 22:09:54 -0000 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 -/* 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); }