Skip to content

Commit

Permalink
Merge branch 'for-rmk' of git://pasiphae.extern.pengutronix.de/git/im…
Browse files Browse the repository at this point in the history
…x/linux-2.6.git

Merge branch 'imx-devel' into devel
  • Loading branch information
Russell King authored and Russell King committed Oct 9, 2008
2 parents 3f30a09 + 58a85f4 commit b1add04
Show file tree
Hide file tree
Showing 27 changed files with 1,270 additions and 115 deletions.
5 changes: 5 additions & 0 deletions arch/arm/mach-imx/include/mach/irqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@
/* decode irq number to use with IMR(x), ISR(x) and friends */
#define IRQ_TO_REG(irq) ((irq - IMX_IRQS) >> 5)

/* all normal IRQs can be FIQs */
#define FIQ_START 0
/* switch betwean IRQ and FIQ */
extern int imx_set_irq_fiq(unsigned int irq, unsigned int type);

#define NR_IRQS (IRQ_GPIOD(32) + 1)
#define IRQ_GPIO(x)
#endif
32 changes: 28 additions & 4 deletions arch/arm/mach-imx/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@
/*
*
* We simply use the ENABLE DISABLE registers inside of the IMX
* to turn on/off specific interrupts. FIXME- We should
* also add support for the accelerated interrupt controller
* by putting offets to irq jump code in the appropriate
* places.
* to turn on/off specific interrupts.
*
*/

Expand Down Expand Up @@ -102,6 +99,28 @@ imx_unmask_irq(unsigned int irq)
__raw_writel(irq, IMX_AITC_INTENNUM);
}

#ifdef CONFIG_FIQ
int imx_set_irq_fiq(unsigned int irq, unsigned int type)
{
unsigned int irqt;

if (irq >= IMX_IRQS)
return -EINVAL;

if (irq < IMX_IRQS / 2) {
irqt = __raw_readl(IMX_AITC_INTTYPEL) & ~(1 << irq);
__raw_writel(irqt | (!!type << irq), IMX_AITC_INTTYPEL);
} else {
irq -= IMX_IRQS / 2;
irqt = __raw_readl(IMX_AITC_INTTYPEH) & ~(1 << irq);
__raw_writel(irqt | (!!type << irq), IMX_AITC_INTTYPEH);
}

return 0;
}
EXPORT_SYMBOL(imx_set_irq_fiq);
#endif /* CONFIG_FIQ */

static int
imx_gpio_irq_type(unsigned int _irq, unsigned int type)
{
Expand Down Expand Up @@ -284,4 +303,9 @@ imx_init_irq(void)

/* Release masking of interrupts according to priority */
__raw_writel(-1, IMX_AITC_NIMASK);

#ifdef CONFIG_FIQ
/* Initialize FIQ */
init_FIQ();
#endif
}
15 changes: 15 additions & 0 deletions arch/arm/mach-mx2/devices.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

extern struct platform_device mxc_gpt1;
extern struct platform_device mxc_gpt2;
extern struct platform_device mxc_gpt3;
extern struct platform_device mxc_gpt4;
extern struct platform_device mxc_gpt5;
extern struct platform_device mxc_wdt;
extern struct platform_device mxc_irda_device;
extern struct platform_device mxc_uart_device0;
extern struct platform_device mxc_uart_device1;
extern struct platform_device mxc_uart_device2;
extern struct platform_device mxc_uart_device3;
extern struct platform_device mxc_uart_device4;
extern struct platform_device mxc_uart_device5;

12 changes: 8 additions & 4 deletions arch/arm/mach-mx2/mx27ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include <mach/iomux-mx1-mx2.h>
#include <mach/board-mx27ads.h>

#include "devices.h"

/* ADS's NOR flash */
static struct physmap_flash_data mx27ads_flash_data = {
.width = 2,
Expand Down Expand Up @@ -251,12 +253,14 @@ static struct imxuart_platform_data uart_pdata[] = {

static void __init mx27ads_board_init(void)
{
int i;

gpio_fec_active();

for (i = 0; i < 6; i++)
imx_init_uart(i, &uart_pdata[i]);
mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);
mxc_register_device(&mxc_uart_device3, &uart_pdata[3]);
mxc_register_device(&mxc_uart_device4, &uart_pdata[4]);
mxc_register_device(&mxc_uart_device5, &uart_pdata[5]);

platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
}
Expand Down
8 changes: 5 additions & 3 deletions arch/arm/mach-mx2/pcm038.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <mach/imx-uart.h>
#include <mach/board-pcm038.h>

#include "devices.h"

/*
* Phytec's phyCORE-i.MX27 comes with 32MiB flash,
* 16 bit width
Expand Down Expand Up @@ -170,11 +172,11 @@ static struct platform_device *platform_devices[] __initdata = {

static void __init pcm038_init(void)
{
int i;
gpio_fec_active();

for (i = 0; i < 3; i++)
imx_init_uart(i, &uart_pdata[i]);
mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);

platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));

Expand Down
51 changes: 6 additions & 45 deletions arch/arm/mach-mx2/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static struct resource uart0[] = {
},
};

static struct platform_device mxc_uart_device0 = {
struct platform_device mxc_uart_device0 = {
.name = "imx-uart",
.id = 0,
.resource = uart0,
Expand All @@ -54,7 +54,7 @@ static struct resource uart1[] = {
},
};

static struct platform_device mxc_uart_device1 = {
struct platform_device mxc_uart_device1 = {
.name = "imx-uart",
.id = 1,
.resource = uart1,
Expand All @@ -73,7 +73,7 @@ static struct resource uart2[] = {
},
};

static struct platform_device mxc_uart_device2 = {
struct platform_device mxc_uart_device2 = {
.name = "imx-uart",
.id = 2,
.resource = uart2,
Expand All @@ -92,7 +92,7 @@ static struct resource uart3[] = {
},
};

static struct platform_device mxc_uart_device3 = {
struct platform_device mxc_uart_device3 = {
.name = "imx-uart",
.id = 3,
.resource = uart3,
Expand All @@ -111,7 +111,7 @@ static struct resource uart4[] = {
},
};

static struct platform_device mxc_uart_device4 = {
struct platform_device mxc_uart_device4 = {
.name = "imx-uart",
.id = 4,
.resource = uart4,
Expand All @@ -130,48 +130,9 @@ static struct resource uart5[] = {
},
};

static struct platform_device mxc_uart_device5 = {
struct platform_device mxc_uart_device5 = {
.name = "imx-uart",
.id = 5,
.resource = uart5,
.num_resources = ARRAY_SIZE(uart5),
};

/*
* Register only those UARTs that physically exists
*/
int __init imx_init_uart(int uart_no, struct imxuart_platform_data *pdata)
{
switch (uart_no) {
case 0:
mxc_uart_device0.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device0);
break;
case 1:
mxc_uart_device1.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device1);
break;
#ifndef CONFIG_MXC_IRDA
case 2:
mxc_uart_device2.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device2);
break;
#endif
case 3:
mxc_uart_device3.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device3);
break;
case 4:
mxc_uart_device4.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device4);
break;
case 5:
mxc_uart_device5.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device5);
break;
default:
return -ENODEV;
}

return 0;
}
43 changes: 5 additions & 38 deletions arch/arm/mach-mx3/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static struct resource uart0[] = {
},
};

static struct platform_device mxc_uart_device0 = {
struct platform_device mxc_uart_device0 = {
.name = "imx-uart",
.id = 0,
.resource = uart0,
Expand All @@ -55,7 +55,7 @@ static struct resource uart1[] = {
},
};

static struct platform_device mxc_uart_device1 = {
struct platform_device mxc_uart_device1 = {
.name = "imx-uart",
.id = 1,
.resource = uart1,
Expand All @@ -74,7 +74,7 @@ static struct resource uart2[] = {
},
};

static struct platform_device mxc_uart_device2 = {
struct platform_device mxc_uart_device2 = {
.name = "imx-uart",
.id = 2,
.resource = uart2,
Expand All @@ -93,7 +93,7 @@ static struct resource uart3[] = {
},
};

static struct platform_device mxc_uart_device3 = {
struct platform_device mxc_uart_device3 = {
.name = "imx-uart",
.id = 3,
.resource = uart3,
Expand All @@ -112,46 +112,13 @@ static struct resource uart4[] = {
},
};

static struct platform_device mxc_uart_device4 = {
struct platform_device mxc_uart_device4 = {
.name = "imx-uart",
.id = 4,
.resource = uart4,
.num_resources = ARRAY_SIZE(uart4),
};

/*
* Register only those UARTs that physically exist
*/
int __init imx_init_uart(int uart_no, struct imxuart_platform_data *pdata)
{
switch (uart_no) {
case 0:
mxc_uart_device0.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device0);
break;
case 1:
mxc_uart_device1.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device1);
break;
case 2:
mxc_uart_device2.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device2);
break;
case 3:
mxc_uart_device3.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device3);
break;
case 4:
mxc_uart_device4.dev.platform_data = pdata;
platform_device_register(&mxc_uart_device4);
break;
default:
return -ENODEV;
}

return 0;
}

/* GPIO port description */
static struct mxc_gpio_port imx_gpio_ports[] = {
[0] = {
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/mach-mx3/devices.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

extern struct platform_device mxc_uart_device0;
extern struct platform_device mxc_uart_device1;
extern struct platform_device mxc_uart_device2;
extern struct platform_device mxc_uart_device3;
extern struct platform_device mxc_uart_device4;
6 changes: 4 additions & 2 deletions arch/arm/mach-mx3/iomux.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ static DEFINE_SPINLOCK(gpio_mux_lock);
*/
int mxc_iomux_mode(unsigned int pin_mode)
{
u32 reg, field, l, mode, ret = 0;
u32 field, l, mode, ret = 0;
void __iomem *reg;

reg = IOMUXSW_MUX_CTL + (pin_mode & IOMUX_REG_MASK);
field = pin_mode & 0x3;
Expand All @@ -70,7 +71,8 @@ EXPORT_SYMBOL(mxc_iomux_mode);
*/
void mxc_iomux_set_pad(enum iomux_pins pin, u32 config)
{
u32 reg, field, l;
u32 field, l;
void __iomem *reg;

reg = IOMUXSW_PAD_CTL + (pin + 2) / 3;
field = (pin + 2) % 3;
Expand Down
Loading

0 comments on commit b1add04

Please sign in to comment.