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 <machine/bus.h>
 #include <machine/devmap.h>
 #include <machine/machdep.h>
-#include <machine/platform.h> 
+#include <machine/platformvar.h> 
 
 #include <arm/freescale/imx/imx_machdep.h>
 
-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 <machine/bus.h>
 #include <machine/devmap.h>
 #include <machine/machdep.h>
-#include <machine/platform.h> 
+#include <machine/platformvar.h> 
 
 #include <arm/freescale/imx/imx_machdep.h>
 
-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 <machine/devmap.h>
 #include <machine/intr.h>
 #include <machine/machdep.h>
-#include <machine/platform.h> 
+#include <machine/platformvar.h>
 
 #include <arm/arm/mpcore_timervar.h>
 #include <arm/freescale/imx/imx6_anatopreg.h>
@@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$");
 #include <dev/fdt/fdt_common.h>
 #include <dev/ofw/openfirm.h>
 
+#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");
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to