ARM: S5P64X0: Add UART serial support for S5P6450
authorKukjin Kim <kgene.kim@samsung.com>
Wed, 1 Sep 2010 06:13:44 +0000 (15:13 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Mon, 18 Oct 2010 09:33:04 +0000 (18:33 +0900)
This patch adds UART serial port support for S5P6450 SoC.
The S5P6450 has 6 UARTs, so adds resource of UART4 and UART5.
And to fix membase which is in serial/samsung.c is from Ben Dooks.

Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
arch/arm/plat-s5p/dev-uart.c
drivers/serial/Kconfig
drivers/serial/samsung.c

index a89331ef4ae172b97d6f21aba05fd8cd80c7eb09..6a7342886171fde25d9c531f4e86db6c7ef52f1b 100644 (file)
@@ -119,6 +119,56 @@ static struct resource s5p_uart3_resource[] = {
 #endif
 };
 
+static struct resource s5p_uart4_resource[] = {
+#if CONFIG_SERIAL_SAMSUNG_UARTS > 4
+       [0] = {
+               .start  = S5P_PA_UART4,
+               .end    = S5P_PA_UART4 + S5P_SZ_UART,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_S5P_UART_RX4,
+               .end    = IRQ_S5P_UART_RX4,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start  = IRQ_S5P_UART_TX4,
+               .end    = IRQ_S5P_UART_TX4,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [3] = {
+               .start  = IRQ_S5P_UART_ERR4,
+               .end    = IRQ_S5P_UART_ERR4,
+               .flags  = IORESOURCE_IRQ,
+       },
+#endif
+};
+
+static struct resource s5p_uart5_resource[] = {
+#if CONFIG_SERIAL_SAMSUNG_UARTS > 5
+       [0] = {
+               .start  = S5P_PA_UART5,
+               .end    = S5P_PA_UART5 + S5P_SZ_UART,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_S5P_UART_RX5,
+               .end    = IRQ_S5P_UART_RX5,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start  = IRQ_S5P_UART_TX5,
+               .end    = IRQ_S5P_UART_TX5,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [3] = {
+               .start  = IRQ_S5P_UART_ERR5,
+               .end    = IRQ_S5P_UART_ERR5,
+               .flags  = IORESOURCE_IRQ,
+       },
+#endif
+};
+
 struct s3c24xx_uart_resources s5p_uart_resources[] __initdata = {
        [0] = {
                .resources      = s5p_uart0_resource,
@@ -136,4 +186,12 @@ struct s3c24xx_uart_resources s5p_uart_resources[] __initdata = {
                .resources      = s5p_uart3_resource,
                .nr_resources   = ARRAY_SIZE(s5p_uart3_resource),
        },
+       [4] = {
+               .resources      = s5p_uart4_resource,
+               .nr_resources   = ARRAY_SIZE(s5p_uart4_resource),
+       },
+       [5] = {
+               .resources      = s5p_uart5_resource,
+               .nr_resources   = ARRAY_SIZE(s5p_uart5_resource),
+       },
 };
index 12900f7083b08819fdf31b3ab626d560bbfa01f8..3198c5335f0bcfae8f08680592164a0f1953281a 100644 (file)
@@ -458,6 +458,7 @@ config SERIAL_SAMSUNG_UARTS
        int
        depends on ARM && PLAT_SAMSUNG
        default 2 if ARCH_S3C2400
+       default 6 if ARCH_S5P6450
        default 4 if SERIAL_SAMSUNG_UARTS_4
        default 3
        help
@@ -526,12 +527,12 @@ config SERIAL_S3C24A0
          Serial port support for the Samsung S3C24A0 SoC
 
 config SERIAL_S3C6400
-       tristate "Samsung S3C6400/S3C6410/S5P6440/S5PC100 Serial port support"
-       depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440 || CPU_S5PC100)
+       tristate "Samsung S3C6400/S3C6410/S5P6440/S5P6450/S5PC100 Serial port support"
+       depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440 || CPU_S5P6450 || CPU_S5PC100)
        select SERIAL_SAMSUNG_UARTS_4
        default y
        help
-         Serial port support for the Samsung S3C6400, S3C6410, S5P6440
+         Serial port support for the Samsung S3C6400, S3C6410, S5P6440, S5P6450
          and S5PC100 SoCs
 
 config SERIAL_S5PV210
index b1156ba8ad1452c113fff20740a1d01596ab3cb2..7ac2bf5167cd8052f7f82b1361258f93643a03bd 100644 (file)
@@ -1101,7 +1101,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
        dbg("resource %p (%lx..%lx)\n", res, res->start, res->end);
 
        port->mapbase = res->start;
-       port->membase = S3C_VA_UART + res->start - (S3C_PA_UART & 0xfff00000);
+       port->membase = S3C_VA_UART + (res->start & 0xfffff);
        ret = platform_get_irq(platdev, 0);
        if (ret < 0)
                port->irq = 0;