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
This commit is contained in:
parent
799cf446be
commit
ef7eac4353
@ -59,6 +59,7 @@ options SYSVMSG # SYSV-style message queues
|
|||||||
options SYSVSEM # SYSV-style semaphores
|
options SYSVSEM # SYSV-style semaphores
|
||||||
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
|
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
|
||||||
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
|
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
|
||||||
|
options PLATFORM
|
||||||
options INCLUDE_CONFIG_FILE # Include this file in kernel
|
options INCLUDE_CONFIG_FILE # Include this file in kernel
|
||||||
options VFP # Enable floating point hardware support
|
options VFP # Enable floating point hardware support
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ options SYSVMSG # SYSV-style message queues
|
|||||||
options SYSVSEM # SYSV-style semaphores
|
options SYSVSEM # SYSV-style semaphores
|
||||||
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
|
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
|
||||||
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
|
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
|
||||||
|
options PLATFORM
|
||||||
options INCLUDE_CONFIG_FILE # Include this file in kernel
|
options INCLUDE_CONFIG_FILE # Include this file in kernel
|
||||||
options VFP # Enable floating point hardware support
|
options VFP # Enable floating point hardware support
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ options SYSVSEM # SYSV-style semaphores
|
|||||||
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
|
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
|
||||||
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
|
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
|
||||||
options INCLUDE_CONFIG_FILE # Include this file in kernel
|
options INCLUDE_CONFIG_FILE # Include this file in kernel
|
||||||
|
options PLATFORM
|
||||||
options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8)
|
options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8)
|
||||||
options VFP # Enable floating point hardware support
|
options VFP # Enable floating point hardware support
|
||||||
options SMP # Enable multiple cores
|
options SMP # Enable multiple cores
|
||||||
|
@ -39,36 +39,28 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <machine/bus.h>
|
#include <machine/bus.h>
|
||||||
#include <machine/devmap.h>
|
#include <machine/devmap.h>
|
||||||
#include <machine/machdep.h>
|
#include <machine/machdep.h>
|
||||||
#include <machine/platform.h>
|
#include <machine/platformvar.h>
|
||||||
|
|
||||||
#include <arm/freescale/imx/imx_machdep.h>
|
#include <arm/freescale/imx/imx_machdep.h>
|
||||||
|
|
||||||
vm_offset_t
|
#include "platform_if.h"
|
||||||
platform_lastaddr(void)
|
|
||||||
|
static vm_offset_t
|
||||||
|
imx51_lastaddr(platform_t plat)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (arm_devmap_lastaddr());
|
return (arm_devmap_lastaddr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static int
|
||||||
platform_probe_and_attach(void)
|
imx51_attach(platform_t plat)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* XXX - Get rid of this stuff soon. */
|
/* XXX - Get rid of this stuff soon. */
|
||||||
boothowto |= RB_VERBOSE|RB_MULTIPLE;
|
boothowto |= RB_VERBOSE|RB_MULTIPLE;
|
||||||
bootverbose = 1;
|
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.
|
* Notably missing are entries for GPU, IPU, in general anything video related.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
platform_devmap_init(void)
|
imx51_devmap_init(platform_t plat)
|
||||||
{
|
{
|
||||||
|
|
||||||
arm_devmap_add_entry(0x70000000, 0x00100000);
|
arm_devmap_add_entry(0x70000000, 0x00100000);
|
||||||
@ -101,3 +93,12 @@ u_int imx_soc_type()
|
|||||||
return (IMXSOC_51);
|
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");
|
||||||
|
@ -39,36 +39,28 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <machine/bus.h>
|
#include <machine/bus.h>
|
||||||
#include <machine/devmap.h>
|
#include <machine/devmap.h>
|
||||||
#include <machine/machdep.h>
|
#include <machine/machdep.h>
|
||||||
#include <machine/platform.h>
|
#include <machine/platformvar.h>
|
||||||
|
|
||||||
#include <arm/freescale/imx/imx_machdep.h>
|
#include <arm/freescale/imx/imx_machdep.h>
|
||||||
|
|
||||||
vm_offset_t
|
#include "platform_if.h"
|
||||||
platform_lastaddr(void)
|
|
||||||
|
static vm_offset_t
|
||||||
|
imx53_lastaddr(platform_t plat)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (arm_devmap_lastaddr());
|
return (arm_devmap_lastaddr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static int
|
||||||
platform_probe_and_attach(void)
|
imx53_attach(platform_t plat)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* XXX - Get rid of this stuff soon. */
|
/* XXX - Get rid of this stuff soon. */
|
||||||
boothowto |= RB_VERBOSE|RB_MULTIPLE;
|
boothowto |= RB_VERBOSE|RB_MULTIPLE;
|
||||||
bootverbose = 1;
|
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.
|
* Notably missing are entries for GPU, IPU, in general anything video related.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
platform_devmap_init(void)
|
imx53_devmap_init(platform_t plat)
|
||||||
{
|
{
|
||||||
|
|
||||||
arm_devmap_add_entry(0x50000000, 0x00100000);
|
arm_devmap_add_entry(0x50000000, 0x00100000);
|
||||||
@ -101,4 +93,13 @@ u_int imx_soc_type()
|
|||||||
return (IMXSOC_53);
|
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");
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <machine/devmap.h>
|
#include <machine/devmap.h>
|
||||||
#include <machine/intr.h>
|
#include <machine/intr.h>
|
||||||
#include <machine/machdep.h>
|
#include <machine/machdep.h>
|
||||||
#include <machine/platform.h>
|
#include <machine/platformvar.h>
|
||||||
|
|
||||||
#include <arm/arm/mpcore_timervar.h>
|
#include <arm/arm/mpcore_timervar.h>
|
||||||
#include <arm/freescale/imx/imx6_anatopreg.h>
|
#include <arm/freescale/imx/imx6_anatopreg.h>
|
||||||
@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <dev/fdt/fdt_common.h>
|
#include <dev/fdt/fdt_common.h>
|
||||||
#include <dev/ofw/openfirm.h>
|
#include <dev/ofw/openfirm.h>
|
||||||
|
|
||||||
|
#include "platform_if.h"
|
||||||
|
|
||||||
struct fdt_fixup_entry fdt_fixup_table[] = {
|
struct fdt_fixup_entry fdt_fixup_table[] = {
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
@ -90,29 +92,25 @@ fdt_pic_decode_t fdt_pic_table[] = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
vm_offset_t
|
static vm_offset_t
|
||||||
platform_lastaddr(void)
|
imx6_lastaddr(platform_t plat)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (arm_devmap_lastaddr());
|
return (arm_devmap_lastaddr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static int
|
||||||
platform_probe_and_attach(void)
|
imx6_attach(platform_t plat)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Inform the MPCore timer driver that its clock is variable. */
|
/* Inform the MPCore timer driver that its clock is variable. */
|
||||||
arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES);
|
arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES);
|
||||||
|
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
platform_gpio_init(void)
|
imx6_late_init(platform_t plat)
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
platform_late_init(void)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Cache the gpio1 node handle for imx6_decode_fdt() workaround code. */
|
/* 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
|
* 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.
|
* as OCRAM that probably shouldn't be mapped as PTE_DEVICE memory.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
platform_devmap_init(void)
|
imx6_devmap_init(platform_t plat)
|
||||||
{
|
{
|
||||||
const uint32_t IMX6_ARMMP_PHYS = 0x00a00000;
|
const uint32_t IMX6_ARMMP_PHYS = 0x00a00000;
|
||||||
const uint32_t IMX6_ARMMP_SIZE = 0x00100000;
|
const uint32_t IMX6_ARMMP_SIZE = 0x00100000;
|
||||||
@ -271,3 +269,15 @@ imx6_early_putc(int c)
|
|||||||
early_putc_t *early_putc = imx6_early_putc;
|
early_putc_t *early_putc = imx6_early_putc;
|
||||||
#endif
|
#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");
|
||||||
|
Loading…
Reference in New Issue
Block a user