You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-rmk' of git://pasiphae.extern.pengutronix.de/git/imx/linux-2.6.git
Merge branch 'imx-devel' into devel
This commit is contained in:
@@ -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
|
||||
|
||||
+28
-4
@@ -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.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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,
|
||||
@@ -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,
|
||||
@@ -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,
|
||||
@@ -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,
|
||||
@@ -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,
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
@@ -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,
|
||||
@@ -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,
|
||||
@@ -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,
|
||||
@@ -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] = {
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
+113
-1
@@ -22,6 +22,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <asm/mach-types.h>
|
||||
@@ -31,6 +32,8 @@
|
||||
#include <asm/mach/map.h>
|
||||
#include <mach/common.h>
|
||||
#include <mach/board-mx31ads.h>
|
||||
#include <mach/imx-uart.h>
|
||||
#include <mach/iomux-mx3.h>
|
||||
|
||||
/*!
|
||||
* @file mx31ads.c
|
||||
@@ -84,6 +87,108 @@ static inline int mxc_init_extuart(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
|
||||
static struct imxuart_platform_data uart_pdata = {
|
||||
.flags = IMXUART_HAVE_RTSCTS,
|
||||
};
|
||||
|
||||
static inline void mxc_init_imx_uart(void)
|
||||
{
|
||||
mxc_iomux_mode(MX31_PIN_CTS1__CTS1);
|
||||
mxc_iomux_mode(MX31_PIN_RTS1__RTS1);
|
||||
mxc_iomux_mode(MX31_PIN_TXD1__TXD1);
|
||||
mxc_iomux_mode(MX31_PIN_RXD1__RXD1);
|
||||
|
||||
mxc_register_device(&mxc_uart_device0, &uart_pdata);
|
||||
}
|
||||
#else /* !SERIAL_IMX */
|
||||
static inline void mxc_init_imx_uart(void)
|
||||
{
|
||||
}
|
||||
#endif /* !SERIAL_IMX */
|
||||
|
||||
static void mx31ads_expio_irq_handler(u32 irq, struct irq_desc *desc)
|
||||
{
|
||||
u32 imr_val;
|
||||
u32 int_valid;
|
||||
u32 expio_irq;
|
||||
|
||||
imr_val = __raw_readw(PBC_INTMASK_SET_REG);
|
||||
int_valid = __raw_readw(PBC_INTSTATUS_REG) & imr_val;
|
||||
|
||||
expio_irq = MXC_EXP_IO_BASE;
|
||||
for (; int_valid != 0; int_valid >>= 1, expio_irq++) {
|
||||
if ((int_valid & 1) == 0)
|
||||
continue;
|
||||
|
||||
generic_handle_irq(expio_irq);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable an expio pin's interrupt by setting the bit in the imr.
|
||||
* @param irq an expio virtual irq number
|
||||
*/
|
||||
static void expio_mask_irq(u32 irq)
|
||||
{
|
||||
u32 expio = MXC_IRQ_TO_EXPIO(irq);
|
||||
/* mask the interrupt */
|
||||
__raw_writew(1 << expio, PBC_INTMASK_CLEAR_REG);
|
||||
__raw_readw(PBC_INTMASK_CLEAR_REG);
|
||||
}
|
||||
|
||||
/*
|
||||
* Acknowledge an expanded io pin's interrupt by clearing the bit in the isr.
|
||||
* @param irq an expanded io virtual irq number
|
||||
*/
|
||||
static void expio_ack_irq(u32 irq)
|
||||
{
|
||||
u32 expio = MXC_IRQ_TO_EXPIO(irq);
|
||||
/* clear the interrupt status */
|
||||
__raw_writew(1 << expio, PBC_INTSTATUS_REG);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable a expio pin's interrupt by clearing the bit in the imr.
|
||||
* @param irq a expio virtual irq number
|
||||
*/
|
||||
static void expio_unmask_irq(u32 irq)
|
||||
{
|
||||
u32 expio = MXC_IRQ_TO_EXPIO(irq);
|
||||
/* unmask the interrupt */
|
||||
__raw_writew(1 << expio, PBC_INTMASK_SET_REG);
|
||||
}
|
||||
|
||||
static struct irq_chip expio_irq_chip = {
|
||||
.ack = expio_ack_irq,
|
||||
.mask = expio_mask_irq,
|
||||
.unmask = expio_unmask_irq,
|
||||
};
|
||||
|
||||
static void __init mx31ads_init_expio(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printk(KERN_INFO "MX31ADS EXPIO(CPLD) hardware\n");
|
||||
|
||||
/*
|
||||
* Configure INT line as GPIO input
|
||||
*/
|
||||
mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO));
|
||||
|
||||
/* disable the interrupt and clear the status */
|
||||
__raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG);
|
||||
__raw_writew(0xFFFF, PBC_INTSTATUS_REG);
|
||||
for (i = MXC_EXP_IO_BASE; i < (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES);
|
||||
i++) {
|
||||
set_irq_chip(i, &expio_irq_chip);
|
||||
set_irq_handler(i, handle_level_irq);
|
||||
set_irq_flags(i, IRQF_VALID);
|
||||
}
|
||||
set_irq_type(EXPIO_PARENT_INT, IRQ_TYPE_LEVEL_HIGH);
|
||||
set_irq_chained_handler(EXPIO_PARENT_INT, mx31ads_expio_irq_handler);
|
||||
}
|
||||
|
||||
/*!
|
||||
* This structure defines static mappings for the i.MX31ADS board.
|
||||
*/
|
||||
@@ -120,12 +225,19 @@ void __init mx31ads_map_io(void)
|
||||
iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc));
|
||||
}
|
||||
|
||||
void __init mx31ads_init_irq(void)
|
||||
{
|
||||
mxc_init_irq();
|
||||
mx31ads_init_expio();
|
||||
}
|
||||
|
||||
/*!
|
||||
* Board specific initialization.
|
||||
*/
|
||||
static void __init mxc_board_init(void)
|
||||
{
|
||||
mxc_init_extuart();
|
||||
mxc_init_imx_uart();
|
||||
}
|
||||
|
||||
static void __init mx31ads_timer_init(void)
|
||||
@@ -148,7 +260,7 @@ MACHINE_START(MX31ADS, "Freescale MX31ADS")
|
||||
.io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
|
||||
.boot_params = PHYS_OFFSET + 0x100,
|
||||
.map_io = mx31ads_map_io,
|
||||
.init_irq = mxc_init_irq,
|
||||
.init_irq = mx31ads_init_irq,
|
||||
.init_machine = mxc_board_init,
|
||||
.timer = &mx31ads_timer,
|
||||
MACHINE_END
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include <mach/iomux-mx3.h>
|
||||
#include <mach/board-pcm037.h>
|
||||
|
||||
#include "devices.h"
|
||||
|
||||
static struct physmap_flash_data pcm037_flash_data = {
|
||||
.width = 2,
|
||||
};
|
||||
@@ -73,12 +75,12 @@ static void __init mxc_board_init(void)
|
||||
mxc_iomux_mode(MX31_PIN_TXD1__TXD1);
|
||||
mxc_iomux_mode(MX31_PIN_RXD1__RXD1);
|
||||
|
||||
imx_init_uart(0, &uart_pdata);
|
||||
mxc_register_device(&mxc_uart_device0, &uart_pdata);
|
||||
|
||||
mxc_iomux_mode(MX31_PIN_CSPI3_MOSI__RXD3);
|
||||
mxc_iomux_mode(MX31_PIN_CSPI3_MISO__TXD3);
|
||||
|
||||
imx_init_uart(2, &uart_pdata);
|
||||
mxc_register_device(&mxc_uart_device2, &uart_pdata);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -23,4 +23,15 @@ source "arch/arm/mach-mx3/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
config MXC_IRQ_PRIOR
|
||||
bool "Use IRQ priority"
|
||||
depends on ARCH_MXC
|
||||
help
|
||||
Select this if you want to use prioritized IRQ handling.
|
||||
This feature prevents higher priority ISR to be interrupted
|
||||
by lower priority IRQ even IRQF_DISABLED flag is not set.
|
||||
This may be useful in embedded applications, where are strong
|
||||
requirements for timing.
|
||||
Say N here, unless you have a specialized requirement.
|
||||
|
||||
endif
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
#
|
||||
|
||||
# Common support
|
||||
obj-y := irq.o clock.o gpio.o time.o
|
||||
obj-y := irq.o clock.o gpio.o time.o devices.o
|
||||
|
||||
obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o
|
||||
obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2008 Sascha Hauer, kernel@pengutronix.de
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
int __init mxc_register_device(struct platform_device *pdev, void *data)
|
||||
{
|
||||
int ret;
|
||||
|
||||
pdev->dev.platform_data = data;
|
||||
|
||||
ret = platform_device_register(pdev);
|
||||
if (ret)
|
||||
pr_debug("Unable to register platform device '%s': %d\n",
|
||||
pdev->name, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -90,6 +90,9 @@
|
||||
#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS)
|
||||
#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4)
|
||||
|
||||
#define MXC_EXP_IO_BASE (MXC_MAX_INT_LINES + MXC_MAX_GPIO_LINES)
|
||||
#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)
|
||||
|
||||
#define EXPIO_INT_LOW_BAT (MXC_EXP_IO_BASE + 0)
|
||||
#define EXPIO_INT_PB_IRQ (MXC_EXP_IO_BASE + 1)
|
||||
#define EXPIO_INT_OTG_FS_OVR (MXC_EXP_IO_BASE + 2)
|
||||
|
||||
@@ -39,7 +39,7 @@ struct clk {
|
||||
/* Register bit position for clock's enable/disable control. */
|
||||
u8 enable_shift;
|
||||
/* Register address for clock's enable/disable control. */
|
||||
u32 enable_reg;
|
||||
void __iomem *enable_reg;
|
||||
u32 flags;
|
||||
/* get the current clock rate (always a fresh value) */
|
||||
unsigned long (*get_rate) (struct clk *);
|
||||
|
||||
@@ -11,10 +11,13 @@
|
||||
#ifndef __ASM_ARCH_MXC_COMMON_H__
|
||||
#define __ASM_ARCH_MXC_COMMON_H__
|
||||
|
||||
struct platform_device;
|
||||
|
||||
extern void mxc_map_io(void);
|
||||
extern void mxc_init_irq(void);
|
||||
extern void mxc_timer_init(const char *clk_timer);
|
||||
extern int mxc_clocks_init(unsigned long fref);
|
||||
extern int mxc_register_gpios(void);
|
||||
extern int mxc_register_device(struct platform_device *pdev, void *data);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* linux/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h
|
||||
*
|
||||
* i.MX DMA registration and IRQ dispatching
|
||||
*
|
||||
* Copyright 2006 Pavel Pisa <pisa@cmp.felk.cvut.cz>
|
||||
* Copyright 2008 Juergen Beisert, <kernel@pengutronix.de>
|
||||
* Copyright 2008 Sascha Hauer, <s.hauer@pengutronix.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <asm/dma.h>
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_DMA_H
|
||||
#define __ASM_ARCH_MXC_DMA_H
|
||||
|
||||
#define IMX_DMA_CHANNELS 16
|
||||
|
||||
#define DMA_BASE IO_ADDRESS(DMA_BASE_ADDR)
|
||||
|
||||
#define IMX_DMA_MEMSIZE_32 (0 << 4)
|
||||
#define IMX_DMA_MEMSIZE_8 (1 << 4)
|
||||
#define IMX_DMA_MEMSIZE_16 (2 << 4)
|
||||
#define IMX_DMA_TYPE_LINEAR (0 << 10)
|
||||
#define IMX_DMA_TYPE_2D (1 << 10)
|
||||
#define IMX_DMA_TYPE_FIFO (2 << 10)
|
||||
|
||||
#define IMX_DMA_ERR_BURST (1 << 0)
|
||||
#define IMX_DMA_ERR_REQUEST (1 << 1)
|
||||
#define IMX_DMA_ERR_TRANSFER (1 << 2)
|
||||
#define IMX_DMA_ERR_BUFFER (1 << 3)
|
||||
#define IMX_DMA_ERR_TIMEOUT (1 << 4)
|
||||
|
||||
int
|
||||
imx_dma_config_channel(int channel, unsigned int config_port,
|
||||
unsigned int config_mem, unsigned int dmareq, int hw_chaining);
|
||||
|
||||
void
|
||||
imx_dma_config_burstlen(int channel, unsigned int burstlen);
|
||||
|
||||
int
|
||||
imx_dma_setup_single(int channel, dma_addr_t dma_address,
|
||||
unsigned int dma_length, unsigned int dev_addr,
|
||||
dmamode_t dmamode);
|
||||
|
||||
int
|
||||
imx_dma_setup_sg(int channel, struct scatterlist *sg,
|
||||
unsigned int sgcount, unsigned int dma_length,
|
||||
unsigned int dev_addr, dmamode_t dmamode);
|
||||
|
||||
int
|
||||
imx_dma_setup_handlers(int channel,
|
||||
void (*irq_handler) (int, void *),
|
||||
void (*err_handler) (int, void *, int), void *data);
|
||||
|
||||
int
|
||||
imx_dma_setup_progression_handler(int channel,
|
||||
void (*prog_handler) (int, void*, struct scatterlist*));
|
||||
|
||||
void imx_dma_enable(int channel);
|
||||
|
||||
void imx_dma_disable(int channel);
|
||||
|
||||
int imx_dma_request(int channel, const char *name);
|
||||
|
||||
void imx_dma_free(int channel);
|
||||
|
||||
enum imx_dma_prio {
|
||||
DMA_PRIO_HIGH = 0,
|
||||
DMA_PRIO_MEDIUM = 1,
|
||||
DMA_PRIO_LOW = 2
|
||||
};
|
||||
|
||||
int imx_dma_request_by_prio(const char *name, enum imx_dma_prio prio);
|
||||
|
||||
#endif /* _ASM_ARCH_MXC_DMA_H */
|
||||
@@ -9,11 +9,17 @@
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#define AVIC_NIMASK 0x04
|
||||
|
||||
@ this macro disables fast irq (not implemented)
|
||||
.macro disable_fiq
|
||||
.endm
|
||||
|
||||
.macro get_irqnr_preamble, base, tmp
|
||||
ldr \base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR)
|
||||
#ifdef CONFIG_MXC_IRQ_PRIOR
|
||||
ldr r4, [\base, #AVIC_NIMASK]
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro arch_ret_to_user, tmp1, tmp2
|
||||
@@ -23,7 +29,6 @@
|
||||
@ and returns its number in irqnr
|
||||
@ and returns if an interrupt occured in irqstat
|
||||
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp
|
||||
ldr \base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR)
|
||||
@ Load offset & priority of the highest priority
|
||||
@ interrupt pending from AVIC_NIVECSR
|
||||
ldr \irqstat, [\base, #0x40]
|
||||
@@ -32,6 +37,11 @@
|
||||
mov \irqnr, \irqstat, asr #16
|
||||
@ set zero flag if IRQ + 1 == 0
|
||||
adds \tmp, \irqnr, #1
|
||||
#ifdef CONFIG_MXC_IRQ_PRIOR
|
||||
bicne \tmp, \irqstat, #0xFFFFFFE0
|
||||
strne \tmp, [\base, #AVIC_NIMASK]
|
||||
streq r4, [\base, #AVIC_NIMASK]
|
||||
#endif
|
||||
.endm
|
||||
|
||||
@ irq priority table (not used)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user