Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04b73b15 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Sascha Hauer
Browse files

ARM: mx51: dynamically register imx-uart devices

parent 2b82e64d
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -11,6 +11,7 @@ comment "MX5 platforms:"
config MACH_MX51_BABBAGE
config MACH_MX51_BABBAGE
	bool "Support MX51 BABBAGE platforms"
	bool "Support MX51 BABBAGE platforms"
	select IMX_HAVE_PLATFORM_IMX_I2C
	select IMX_HAVE_PLATFORM_IMX_I2C
	select IMX_HAVE_PLATFORM_IMX_UART
	help
	help
	  Include support for MX51 Babbage platform, also known as MX51EVK in
	  Include support for MX51 Babbage platform, also known as MX51EVK in
	  u-boot. This includes specific configurations for the board and its
	  u-boot. This includes specific configurations for the board and its
@@ -18,6 +19,7 @@ config MACH_MX51_BABBAGE


config MACH_MX51_3DS
config MACH_MX51_3DS
	bool "Support MX51PDK (3DS)"
	bool "Support MX51PDK (3DS)"
	select IMX_HAVE_PLATFORM_IMX_UART
	select IMX_HAVE_PLATFORM_SPI_IMX
	select IMX_HAVE_PLATFORM_SPI_IMX
	select MXC_DEBUG_BOARD
	select MXC_DEBUG_BOARD
	help
	help
@@ -27,6 +29,7 @@ config MACH_MX51_3DS
config MACH_EUKREA_CPUIMX51
config MACH_EUKREA_CPUIMX51
	bool "Support Eukrea CPUIMX51 module"
	bool "Support Eukrea CPUIMX51 module"
	select IMX_HAVE_PLATFORM_IMX_I2C
	select IMX_HAVE_PLATFORM_IMX_I2C
	select IMX_HAVE_PLATFORM_IMX_UART
	help
	help
	  Include support for Eukrea CPUIMX51 platform. This includes
	  Include support for Eukrea CPUIMX51 platform. This includes
	  specific configurations for the module and its peripherals.
	  specific configurations for the module and its peripherals.
+3 −3
Original line number Original line Diff line number Diff line
@@ -28,7 +28,6 @@
#include <mach/eukrea-baseboards.h>
#include <mach/eukrea-baseboards.h>
#include <mach/common.h>
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <mach/imx-uart.h>
#include <mach/iomux-mx51.h>
#include <mach/iomux-mx51.h>
#include <mach/mxc_ehci.h>
#include <mach/mxc_ehci.h>


@@ -38,6 +37,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/time.h>


#include "devices-imx51.h"
#include "devices.h"
#include "devices.h"


#define CPUIMX51_USBH1_STP	(0*32 + 27)
#define CPUIMX51_USBH1_STP	(0*32 + 27)
@@ -147,7 +147,7 @@ static struct pad_desc eukrea_cpuimx51_pads[] = {
	MX51_PAD_USBH1_STP__USBH1_STP,
	MX51_PAD_USBH1_STP__USBH1_STP,
};
};


static struct imxuart_platform_data uart_pdata = {
static const struct imxuart_platform_data uart_pdata __initconst = {
	.flags = IMXUART_HAVE_RTSCTS,
	.flags = IMXUART_HAVE_RTSCTS,
};
};


@@ -239,7 +239,7 @@ static void __init eukrea_cpuimx51_init(void)
	mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads,
	mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads,
					ARRAY_SIZE(eukrea_cpuimx51_pads));
					ARRAY_SIZE(eukrea_cpuimx51_pads));


	mxc_register_device(&mxc_uart_device0, &uart_pdata);
	imx51_add_imx_uart(0, &uart_pdata);
	gpio_request(CPUIMX51_QUARTA_GPIO, "quarta_irq");
	gpio_request(CPUIMX51_QUARTA_GPIO, "quarta_irq");
	gpio_direction_input(CPUIMX51_QUARTA_GPIO);
	gpio_direction_input(CPUIMX51_QUARTA_GPIO);
	gpio_free(CPUIMX51_QUARTA_GPIO);
	gpio_free(CPUIMX51_QUARTA_GPIO);
+4 −5
Original line number Original line Diff line number Diff line
@@ -22,7 +22,6 @@
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/common.h>
#include <mach/iomux-mx51.h>
#include <mach/iomux-mx51.h>
#include <mach/imx-uart.h>
#include <mach/3ds_debugboard.h>
#include <mach/3ds_debugboard.h>


#include "devices-imx51.h"
#include "devices-imx51.h"
@@ -74,15 +73,15 @@ static struct pad_desc mx51_3ds_pads[] = {


/* Serial ports */
/* Serial ports */
#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
static struct imxuart_platform_data uart_pdata = {
static const struct imxuart_platform_data uart_pdata __initconst = {
	.flags = IMXUART_HAVE_RTSCTS,
	.flags = IMXUART_HAVE_RTSCTS,
};
};


static inline void mxc_init_imx_uart(void)
static inline void mxc_init_imx_uart(void)
{
{
	mxc_register_device(&mxc_uart_device0, &uart_pdata);
	imx51_add_imx_uart(0, &uart_pdata);
	mxc_register_device(&mxc_uart_device1, &uart_pdata);
	imx51_add_imx_uart(1, &uart_pdata);
	mxc_register_device(&mxc_uart_device2, &uart_pdata);
	imx51_add_imx_uart(2, &uart_pdata);
}
}
#else /* !SERIAL_IMX */
#else /* !SERIAL_IMX */
static inline void mxc_init_imx_uart(void)
static inline void mxc_init_imx_uart(void)
+5 −5
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@


#include <mach/common.h>
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <mach/imx-uart.h>
#include <mach/iomux-mx51.h>
#include <mach/iomux-mx51.h>
#include <mach/mxc_ehci.h>
#include <mach/mxc_ehci.h>


@@ -31,6 +30,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/time.h>


#include "devices-imx51.h"
#include "devices.h"
#include "devices.h"


#define BABBAGE_USB_HUB_RESET	(0*32 + 7)	/* GPIO_1_7 */
#define BABBAGE_USB_HUB_RESET	(0*32 + 7)	/* GPIO_1_7 */
@@ -120,15 +120,15 @@ static struct pad_desc mx51babbage_pads[] = {


/* Serial ports */
/* Serial ports */
#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
static struct imxuart_platform_data uart_pdata = {
static const struct imxuart_platform_data uart_pdata __initconst = {
	.flags = IMXUART_HAVE_RTSCTS,
	.flags = IMXUART_HAVE_RTSCTS,
};
};


static inline void mxc_init_imx_uart(void)
static inline void mxc_init_imx_uart(void)
{
{
	mxc_register_device(&mxc_uart_device0, &uart_pdata);
	imx51_add_imx_uart(0, &uart_pdata);
	mxc_register_device(&mxc_uart_device1, &uart_pdata);
	imx51_add_imx_uart(1, &uart_pdata);
	mxc_register_device(&mxc_uart_device2, &uart_pdata);
	imx51_add_imx_uart(2, &uart_pdata);
}
}
#else /* !SERIAL_IMX */
#else /* !SERIAL_IMX */
static inline void mxc_init_imx_uart(void)
static inline void mxc_init_imx_uart(void)
+4 −0
Original line number Original line Diff line number Diff line
@@ -13,6 +13,10 @@ extern const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst;
#define imx51_add_imx_i2c(id, pdata)	\
#define imx51_add_imx_i2c(id, pdata)	\
	imx_add_imx_i2c(&imx51_imx_i2c_data[id], pdata)
	imx_add_imx_i2c(&imx51_imx_i2c_data[id], pdata)


extern const struct imx_imx_uart_1irq_data imx51_imx_uart_data[] __initconst;
#define imx51_add_imx_uart(id, pdata)	\
	imx_add_imx_uart_1irq(&imx51_imx_uart_data[id], pdata)

extern const struct imx_spi_imx_data imx51_cspi_data __initconst;
extern const struct imx_spi_imx_data imx51_cspi_data __initconst;
#define imx51_add_cspi(pdata)	\
#define imx51_add_cspi(pdata)	\
	imx_add_spi_imx(&imx51_cspi_data, pdata)
	imx_add_spi_imx(&imx51_cspi_data, pdata)
Loading