Index: head/sys/arm/conf/EFIKA_MX =================================================================== --- head/sys/arm/conf/EFIKA_MX +++ head/sys/arm/conf/EFIKA_MX @@ -59,6 +59,7 @@ 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 Index: head/sys/arm/conf/IMX53 =================================================================== --- head/sys/arm/conf/IMX53 +++ head/sys/arm/conf/IMX53 @@ -56,6 +56,7 @@ 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 Index: head/sys/arm/conf/IMX6 =================================================================== --- head/sys/arm/conf/IMX6 +++ head/sys/arm/conf/IMX6 @@ -53,6 +53,7 @@ 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 Index: head/sys/arm/freescale/imx/imx51_machdep.c =================================================================== --- head/sys/arm/freescale/imx/imx51_machdep.c +++ head/sys/arm/freescale/imx/imx51_machdep.c @@ -39,36 +39,28 @@ #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 @@ * * 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 @@ 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"); Index: head/sys/arm/freescale/imx/imx53_machdep.c =================================================================== --- head/sys/arm/freescale/imx/imx53_machdep.c +++ head/sys/arm/freescale/imx/imx53_machdep.c @@ -39,36 +39,28 @@ #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 @@ * * 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 @@ 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"); Index: head/sys/arm/freescale/imx/imx6_machdep.c =================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c +++ head/sys/arm/freescale/imx/imx6_machdep.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -50,6 +50,8 @@ #include #include +#include "platform_if.h" + struct fdt_fixup_entry fdt_fixup_table[] = { { NULL, NULL } }; @@ -90,29 +92,25 @@ 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 @@ * 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 @@ 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");