From owner-svn-src-all@FreeBSD.ORG Wed Dec 24 12:26:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1033DF32; Wed, 24 Dec 2014 12:26:47 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4EB766EFD; Wed, 24 Dec 2014 12:26:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBOCQkSj000626; Wed, 24 Dec 2014 12:26:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBOCQivF000604; Wed, 24 Dec 2014 12:26:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412241226.sBOCQivF000604@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 24 Dec 2014 12:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276177 - in head/sys/arm: conf 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Dec 2014 12:26:47 -0000 Author: andrew Date: Wed Dec 24 12:26:43 2014 New Revision: 276177 URL: https://svnweb.freebsd.org/changeset/base/276177 Log: Switch i.MX to use the platform code to help with a single Freescale kernel. Differential Revision: https://reviews.freebsd.org/D1349 Reviewed by: ian, rpaulo Modified: head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/imx51_machdep.c head/sys/arm/freescale/imx/imx53_machdep.c head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Wed Dec 24 10:13:53 2014 (r276176) +++ head/sys/arm/conf/EFIKA_MX Wed Dec 24 12:26:43 2014 (r276177) @@ -59,6 +59,7 @@ options SYSVMSG # SYSV-style message options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel options VFP # Enable floating point hardware support Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Wed Dec 24 10:13:53 2014 (r276176) +++ head/sys/arm/conf/IMX53 Wed Dec 24 12:26:43 2014 (r276177) @@ -56,6 +56,7 @@ options SYSVMSG # SYSV-style message options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel options VFP # Enable floating point hardware support Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Wed Dec 24 10:13:53 2014 (r276176) +++ head/sys/arm/conf/IMX6 Wed Dec 24 12:26:43 2014 (r276177) @@ -53,6 +53,7 @@ options SYSVSEM # SYSV-style semaphor options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options INCLUDE_CONFIG_FILE # Include this file in kernel +options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options SMP # Enable multiple cores Modified: head/sys/arm/freescale/imx/imx51_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_machdep.c Wed Dec 24 10:13:53 2014 (r276176) +++ head/sys/arm/freescale/imx/imx51_machdep.c Wed Dec 24 12:26:43 2014 (r276177) @@ -39,36 +39,28 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include -vm_offset_t -platform_lastaddr(void) +#include "platform_if.h" + +static vm_offset_t +imx51_lastaddr(platform_t plat) { return (arm_devmap_lastaddr()); } -void -platform_probe_and_attach(void) +static int +imx51_attach(platform_t plat) { /* XXX - Get rid of this stuff soon. */ boothowto |= RB_VERBOSE|RB_MULTIPLE; bootverbose = 1; -} - -void -platform_gpio_init(void) -{ - -} - -void -platform_late_init(void) -{ + return (0); } /* @@ -78,8 +70,8 @@ platform_late_init(void) * * Notably missing are entries for GPU, IPU, in general anything video related. */ -int -platform_devmap_init(void) +static int +imx51_devmap_init(platform_t plat) { arm_devmap_add_entry(0x70000000, 0x00100000); @@ -101,3 +93,12 @@ u_int imx_soc_type() return (IMXSOC_51); } +static platform_method_t imx51_methods[] = { + PLATFORMMETHOD(platform_attach, imx51_attach), + PLATFORMMETHOD(platform_devmap_init, imx51_devmap_init), + PLATFORMMETHOD(platform_lastaddr, imx51_lastaddr), + + PLATFORMMETHOD_END, +}; + +FDT_PLATFORM_DEF(imx51, "i.MX51", 0, "fsl,imx51"); Modified: head/sys/arm/freescale/imx/imx53_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx53_machdep.c Wed Dec 24 10:13:53 2014 (r276176) +++ head/sys/arm/freescale/imx/imx53_machdep.c Wed Dec 24 12:26:43 2014 (r276177) @@ -39,36 +39,28 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include -vm_offset_t -platform_lastaddr(void) +#include "platform_if.h" + +static vm_offset_t +imx53_lastaddr(platform_t plat) { return (arm_devmap_lastaddr()); } -void -platform_probe_and_attach(void) +static int +imx53_attach(platform_t plat) { /* XXX - Get rid of this stuff soon. */ boothowto |= RB_VERBOSE|RB_MULTIPLE; bootverbose = 1; -} - -void -platform_gpio_init(void) -{ - -} - -void -platform_late_init(void) -{ + return (0); } /* @@ -78,8 +70,8 @@ platform_late_init(void) * * Notably missing are entries for GPU, IPU, in general anything video related. */ -int -platform_devmap_init(void) +static int +imx53_devmap_init(platform_t plat) { arm_devmap_add_entry(0x50000000, 0x00100000); @@ -101,4 +93,13 @@ u_int imx_soc_type() return (IMXSOC_53); } +static platform_method_t imx53_methods[] = { + PLATFORMMETHOD(platform_attach, imx53_attach), + PLATFORMMETHOD(platform_devmap_init, imx53_devmap_init), + PLATFORMMETHOD(platform_lastaddr, imx53_lastaddr), + + PLATFORMMETHOD_END, +}; + +FDT_PLATFORM_DEF(imx53, "i.MX53", 0, "fsl,imx53"); Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Wed Dec 24 10:13:53 2014 (r276176) +++ head/sys/arm/freescale/imx/imx6_machdep.c Wed Dec 24 12:26:43 2014 (r276177) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "platform_if.h" + struct fdt_fixup_entry fdt_fixup_table[] = { { NULL, NULL } }; @@ -90,29 +92,25 @@ fdt_pic_decode_t fdt_pic_table[] = { NULL }; -vm_offset_t -platform_lastaddr(void) +static vm_offset_t +imx6_lastaddr(platform_t plat) { return (arm_devmap_lastaddr()); } -void -platform_probe_and_attach(void) +static int +imx6_attach(platform_t plat) { /* Inform the MPCore timer driver that its clock is variable. */ arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES); -} - -void -platform_gpio_init(void) -{ + return (0); } -void -platform_late_init(void) +static void +imx6_late_init(platform_t plat) { /* Cache the gpio1 node handle for imx6_decode_fdt() workaround code. */ @@ -136,8 +134,8 @@ platform_late_init(void) * 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. */ -int -platform_devmap_init(void) +static int +imx6_devmap_init(platform_t plat) { const uint32_t IMX6_ARMMP_PHYS = 0x00a00000; const uint32_t IMX6_ARMMP_SIZE = 0x00100000; @@ -271,3 +269,15 @@ imx6_early_putc(int c) early_putc_t *early_putc = imx6_early_putc; #endif +static platform_method_t imx6_methods[] = { + PLATFORMMETHOD(platform_attach, imx6_attach), + PLATFORMMETHOD(platform_lastaddr, imx6_lastaddr), + PLATFORMMETHOD(platform_devmap_init, imx6_devmap_init), + PLATFORMMETHOD(platform_late_init, imx6_late_init), + + PLATFORMMETHOD_END, +}; + +FDT_PLATFORM_DEF2(imx6, imx6s, "i.MX6 Solo", 0, "fsl,imx6s"); +FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6d"); +FDT_PLATFORM_DEF2(imx6, imx6q, "i.MX6 Quad", 0, "fsl,imx6q");