^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) //
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) // Copyright 2008 Openmoko, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) // Copyright 2008 Simtec Electronics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) // Ben Dooks <ben@simtec.co.uk>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) // http://armlinux.simtec.co.uk/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) //
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) // Base S3C64XX UART resource and device definitions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <asm/mach/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include "map.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <mach/irqs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include "devs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) /* Serial port registrations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) /* 64xx uarts are closer together */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) static struct resource s3c64xx_uart0_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) [0] = DEFINE_RES_MEM(S3C_PA_UART0, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) [1] = DEFINE_RES_IRQ(IRQ_UART0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) static struct resource s3c64xx_uart1_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) [0] = DEFINE_RES_MEM(S3C_PA_UART1, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) [1] = DEFINE_RES_IRQ(IRQ_UART1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) static struct resource s3c6xx_uart2_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) [0] = DEFINE_RES_MEM(S3C_PA_UART2, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) [1] = DEFINE_RES_IRQ(IRQ_UART2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) static struct resource s3c64xx_uart3_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) [0] = DEFINE_RES_MEM(S3C_PA_UART3, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) [1] = DEFINE_RES_IRQ(IRQ_UART3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) struct s3c24xx_uart_resources s3c64xx_uart_resources[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) [0] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) .resources = s3c64xx_uart0_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) .nr_resources = ARRAY_SIZE(s3c64xx_uart0_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) [1] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) .resources = s3c64xx_uart1_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) .nr_resources = ARRAY_SIZE(s3c64xx_uart1_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) [2] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) .resources = s3c6xx_uart2_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) .nr_resources = ARRAY_SIZE(s3c6xx_uart2_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) [3] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) .resources = s3c64xx_uart3_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) .nr_resources = ARRAY_SIZE(s3c64xx_uart3_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) };