From owner-svn-src-head@FreeBSD.ORG Tue Nov 5 05:18:19 2013 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 ESMTP id 7AC58E7F; Tue, 5 Nov 2013 05:18:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) 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 595032C28; Tue, 5 Nov 2013 05:18:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA55IJ93010112; Tue, 5 Nov 2013 05:18:19 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA55IIwC010108; Tue, 5 Nov 2013 05:18:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311050518.rA55IIwC010108@svn.freebsd.org> From: Ian Lepore Date: Tue, 5 Nov 2013 05:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257678 - head/sys/arm/freescale/imx 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.14 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: Tue, 05 Nov 2013 05:18:19 -0000 Author: ian Date: Tue Nov 5 05:18:18 2013 New Revision: 257678 URL: http://svnweb.freebsd.org/changeset/base/257678 Log: Remove local devmap code and use the essentially identical common code that got moved from imx_machdep.c to arm/devmap.c. Modified: head/sys/arm/freescale/imx/imx51_machdep.c head/sys/arm/freescale/imx/imx53_machdep.c head/sys/arm/freescale/imx/imx6_machdep.c head/sys/arm/freescale/imx/imx_machdep.c Modified: head/sys/arm/freescale/imx/imx51_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_machdep.c Tue Nov 5 05:02:08 2013 (r257677) +++ head/sys/arm/freescale/imx/imx51_machdep.c Tue Nov 5 05:18:18 2013 (r257678) @@ -34,26 +34,58 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include +#include #include + #include +vm_offset_t +initarm_lastaddr(void) +{ + + return (arm_devmap_lastaddr()); +} + +void +initarm_early_init(void) +{ + + /* XXX - Get rid of this stuff soon. */ + boothowto |= RB_VERBOSE|RB_MULTIPLE; + bootverbose = 1; +} + +void +initarm_gpio_init(void) +{ + +} + +void +initarm_late_init(void) +{ + +} + /* * Set up static device mappings. This is hand-optimized platform-specific * config data which covers most of the common on-chip devices with a few 1MB * section mappings. * * Notably missing are entries for GPU, IPU, in general anything video related. - * - * Note that for imx this is called from initarm_lastaddr() so that the lowest - * kva address used for static device mapping can be known at that point. */ -void -imx_devmap_init(void) +int +initarm_devmap_init(void) { - imx_devmap_addentry(0x70000000, 0x00100000); - imx_devmap_addentry(0x73f00000, 0x00100000); - imx_devmap_addentry(0x83f00000, 0x00100000); + arm_devmap_add_entry(0x70000000, 0x00100000); + arm_devmap_add_entry(0x73f00000, 0x00100000); + arm_devmap_add_entry(0x83f00000, 0x00100000); + + return (0); } void Modified: head/sys/arm/freescale/imx/imx53_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx53_machdep.c Tue Nov 5 05:02:08 2013 (r257677) +++ head/sys/arm/freescale/imx/imx53_machdep.c Tue Nov 5 05:18:18 2013 (r257678) @@ -34,26 +34,57 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include +#include #include #include +vm_offset_t +initarm_lastaddr(void) +{ + + return (arm_devmap_lastaddr()); +} + +void +initarm_early_init(void) +{ + + /* XXX - Get rid of this stuff soon. */ + boothowto |= RB_VERBOSE|RB_MULTIPLE; + bootverbose = 1; +} + +void +initarm_gpio_init(void) +{ + +} + +void +initarm_late_init(void) +{ + +} + /* * Set up static device mappings. This is hand-optimized platform-specific * config data which covers most of the common on-chip devices with a few 1MB * section mappings. * * Notably missing are entries for GPU, IPU, in general anything video related. - * - * Note that for imx this is called from initarm_lastaddr() so that the lowest - * kva address used for static device mapping can be known at that point. */ -void -imx_devmap_init(void) +int +initarm_devmap_init(void) { - imx_devmap_addentry(0x50000000, 0x00100000); - imx_devmap_addentry(0x53f00000, 0x00100000); - imx_devmap_addentry(0x63f00000, 0x00100000); + arm_devmap_add_entry(0x50000000, 0x00100000); + arm_devmap_add_entry(0x53f00000, 0x00100000); + arm_devmap_add_entry(0x63f00000, 0x00100000); + + return (0); } void Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Tue Nov 5 05:02:08 2013 (r257677) +++ head/sys/arm/freescale/imx/imx6_machdep.c Tue Nov 5 05:18:18 2013 (r257678) @@ -35,19 +35,45 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include +#include #include #include #include +vm_offset_t +initarm_lastaddr(void) +{ + + return (arm_devmap_lastaddr()); +} + +void +initarm_early_init(void) +{ + + /* XXX - Get rid of this stuff soon. */ + boothowto |= RB_VERBOSE|RB_MULTIPLE; + bootverbose = 1; +} + +void +initarm_gpio_init(void) +{ + +} + +void +initarm_late_init(void) +{ + +} + /* - * Set up static device mappings. Note that for imx this is called from - * initarm_lastaddr() so that it can return the lowest address used for static - * device mapping, maximizing kva space. + * Set up static device mappings. * * This attempts to cover the most-used devices with 1MB section mappings, which * is good for performance (uses fewer TLB entries for device access). @@ -62,8 +88,8 @@ __FBSDID("$FreeBSD$"); * static map some of that area. Be careful with other things in that area such * as OCRAM that probably shouldn't be mapped as PTE_DEVICE memory. */ -void -imx_devmap_init(void) +int +initarm_devmap_init(void) { const uint32_t IMX6_ARMMP_PHYS = 0x00a00000; const uint32_t IMX6_ARMMP_SIZE = 0x00100000; @@ -72,9 +98,11 @@ imx_devmap_init(void) const uint32_t IMX6_AIPS2_PHYS = 0x02100000; const uint32_t IMX6_AIPS2_SIZE = 0x00100000; - imx_devmap_addentry(IMX6_ARMMP_PHYS, IMX6_ARMMP_SIZE); - imx_devmap_addentry(IMX6_AIPS1_PHYS, IMX6_AIPS1_SIZE); - imx_devmap_addentry(IMX6_AIPS2_PHYS, IMX6_AIPS2_SIZE); + arm_devmap_add_entry(IMX6_ARMMP_PHYS, IMX6_ARMMP_SIZE); + arm_devmap_add_entry(IMX6_AIPS1_PHYS, IMX6_AIPS1_SIZE); + arm_devmap_add_entry(IMX6_AIPS2_PHYS, IMX6_AIPS2_SIZE); + + return (0); } void Modified: head/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx_machdep.c Tue Nov 5 05:02:08 2013 (r257677) +++ head/sys/arm/freescale/imx/imx_machdep.c Tue Nov 5 05:18:18 2013 (r257678) @@ -45,99 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define IMX_MAX_DEVMAP_ENTRIES 8 - -static struct arm_devmap_entry devmap_entries[IMX_MAX_DEVMAP_ENTRIES]; -static u_int devmap_idx; -static vm_offset_t devmap_vaddr = ARM_VECTORS_HIGH; - -void -imx_devmap_addentry(vm_paddr_t pa, vm_size_t sz) -{ - struct arm_devmap_entry *m; - - /* - * The last table entry is the all-zeroes end-of-table marker. If we're - * about to overwrite it the world is coming to an end. This code runs - * too early for the panic to be printed unless a special early-debug - * console is in use, but there's nothing else we can do. - */ - if (devmap_idx == (IMX_MAX_DEVMAP_ENTRIES - 1)) - panic("IMX_MAX_DEVMAP_ENTRIES is too small!\n"); - - /* - * Allocate virtual address space from the top of kva downwards. If the - * range being mapped is aligned and sized to 1MB boundaries then also - * align the virtual address to the next-lower 1MB boundary so that we - * end up with a section mapping. - */ - if ((pa & 0x000fffff) == 0 && (sz & 0x000fffff) == 0) { - devmap_vaddr = (devmap_vaddr - sz) & ~0x000fffff; - } else { - devmap_vaddr = (devmap_vaddr - sz) & ~0x00000fff; - } - m = &devmap_entries[devmap_idx++]; - m->pd_va = devmap_vaddr; - m->pd_pa = pa; - m->pd_size = sz; - m->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - m->pd_cache = PTE_DEVICE; -} - -vm_offset_t -initarm_lastaddr(void) -{ - - return (devmap_vaddr); -} - -void -initarm_early_init(void) -{ - - /* XXX - Get rid of this stuff soon. */ - boothowto |= RB_VERBOSE|RB_MULTIPLE; - bootverbose = 1; -} - -int -initarm_devmap_init(void) -{ - - imx_devmap_init(); - arm_devmap_register_table(devmap_entries); - return (0); -} - -/* - * Set initial values of GPIO output ports - */ -void -initarm_gpio_init(void) -{ - -} - -void -initarm_late_init(void) -{ - struct arm_devmap_entry *m; - - /* - * We did the static devmap setup earlier, during initarm_lastaddr(), - * but now the console should be working and we can be verbose about - * what we did. - */ - if (bootverbose) { - for (m = devmap_entries; m->pd_va != 0; ++m) { - printf("Devmap: phys 0x%08x virt 0x%08x size %uK\n", - m->pd_pa, m->pd_va, m->pd_size / 1024); - } - } - - -} - struct arm32_dma_range * bus_dma_get_range(void) {