aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/serial.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-18 09:19:26 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-18 09:19:26 -0700
commit73c583e4e2dd0fbbf2fafe0cc57ff75314fe72df (patch)
treeb2fb05a6d199c0f6653fff84b67159af8f228760 /arch/arm/mach-omap2/serial.c
parent5ce00289875a853280985aee671258795b77e089 (diff)
parent1f685b36dbf27db55072fb738aac57aaf37d2c71 (diff)
Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (47 commits) OMAP clock: use debugfs_remove_recursive() for rewinding OMAP2/3/4 core: create omap_device layer OMAP: omap_hwmod: call omap_hwmod init at boot; create interconnects OMAP2/3/4: create omap_hwmod layer OMAP2/3 board-*.c files: read bootloader configuration earlier OMAP2/3/4 PRCM: add module IDLEST wait code OMAP2/3 PM: create the OMAP PM interface and add a default OMAP PM no-op layer OMAP3 clock: remove superfluous calls to omap2_init_clk_clkdm OMAP clock: associate MPU clocks with the mpu_clkdm OMAP3 clock: Fixed processing of bootarg 'mpurate' OMAP: SDRC: Add several new register definitions OMAP: powerdomain: Fix overflow when doing powerdomain deps lookups. OMAP: PM: Added suspend target state control to debugfs for OMAP3 OMAP: PM debug: Add PRCM register dump support OMAP: PM debug: make powerdomains use PM-debug counters OMAP: PM: Add pm-debug counters OMAP: PM: Add closures to clkdm_for_each and pwrdm_for_each. OMAP: PM: Hook into PM counters OMAP: PM counter infrastructure. OMAP3: PM: fix lockdep warning caused by omap3_pm_init ...
Diffstat (limited to 'arch/arm/mach-omap2/serial.c')
-rw-r--r--arch/arm/mach-omap2/serial.c67
1 files changed, 48 insertions, 19 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index ce22344b94e..3a529c77daa 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -73,7 +73,7 @@ static LIST_HEAD(uart_list);
static struct plat_serial8250_port serial_platform_data0[] = {
{
- .membase = IO_ADDRESS(OMAP_UART1_BASE),
+ .membase = OMAP2_IO_ADDRESS(OMAP_UART1_BASE),
.mapbase = OMAP_UART1_BASE,
.irq = 72,
.flags = UPF_BOOT_AUTOCONF,
@@ -87,7 +87,7 @@ static struct plat_serial8250_port serial_platform_data0[] = {
static struct plat_serial8250_port serial_platform_data1[] = {
{
- .membase = IO_ADDRESS(OMAP_UART2_BASE),
+ .membase = OMAP2_IO_ADDRESS(OMAP_UART2_BASE),
.mapbase = OMAP_UART2_BASE,
.irq = 73,
.flags = UPF_BOOT_AUTOCONF,
@@ -101,7 +101,7 @@ static struct plat_serial8250_port serial_platform_data1[] = {
static struct plat_serial8250_port serial_platform_data2[] = {
{
- .membase = IO_ADDRESS(OMAP_UART3_BASE),
+ .membase = OMAP2_IO_ADDRESS(OMAP_UART3_BASE),
.mapbase = OMAP_UART3_BASE,
.irq = 74,
.flags = UPF_BOOT_AUTOCONF,
@@ -123,6 +123,21 @@ static struct plat_serial8250_port serial_platform_data2[] = {
}
};
+#ifdef CONFIG_ARCH_OMAP4
+static struct plat_serial8250_port serial_platform_data3[] = {
+ {
+ .membase = IO_ADDRESS(OMAP_UART4_BASE),
+ .mapbase = OMAP_UART4_BASE,
+ .irq = 70,
+ .flags = UPF_BOOT_AUTOCONF,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = OMAP24XX_BASE_BAUD * 16,
+ }, {
+ .flags = 0
+ }
+};
+#endif
static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
int offset)
{
@@ -470,7 +485,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
uart->padconf = 0;
}
- p->flags |= UPF_SHARE_IRQ;
+ p->irqflags |= IRQF_SHARED;
ret = request_irq(p->irq, omap_uart_interrupt, IRQF_SHARED,
"serial idle", (void *)uart);
WARN_ON(ret);
@@ -560,12 +575,22 @@ static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = {
},
},
},
+#ifdef CONFIG_ARCH_OMAP4
+ {
+ .pdev = {
+ .name = "serial8250",
+ .id = 3
+ .dev = {
+ .platform_data = serial_platform_data3,
+ },
+ },
+ },
+#endif
};
-void __init omap_serial_init(void)
+void __init omap_serial_early_init(void)
{
int i;
- const struct omap_uart_config *info;
char name[16];
/*
@@ -574,23 +599,12 @@ void __init omap_serial_init(void)
* if not needed.
*/
- info = omap_get_config(OMAP_TAG_UART, struct omap_uart_config);
-
- if (info == NULL)
- return;
-
for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
struct omap_uart_state *uart = &omap_uart[i];
struct platform_device *pdev = &uart->pdev;
struct device *dev = &pdev->dev;
struct plat_serial8250_port *p = dev->platform_data;
- if (!(info->enabled_uarts & (1 << i))) {
- p->membase = NULL;
- p->mapbase = 0;
- continue;
- }
-
sprintf(name, "uart%d_ick", i+1);
uart->ick = clk_get(NULL, name);
if (IS_ERR(uart->ick)) {
@@ -605,8 +619,11 @@ void __init omap_serial_init(void)
uart->fck = NULL;
}
- if (!uart->ick || !uart->fck)
- continue;
+ /* FIXME: Remove this once the clkdev is ready */
+ if (!cpu_is_omap44xx()) {
+ if (!uart->ick || !uart->fck)
+ continue;
+ }
uart->num = i;
p->private_data = uart;
@@ -617,6 +634,18 @@ void __init omap_serial_init(void)
p->irq += 32;
omap_uart_enable_clocks(uart);
+ }
+}
+
+void __init omap_serial_init(void)
+{
+ int i;
+
+ for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
+ struct omap_uart_state *uart = &omap_uart[i];
+ struct platform_device *pdev = &uart->pdev;
+ struct device *dev = &pdev->dev;
+
omap_uart_reset(uart);
omap_uart_idle_init(uart);