0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include <linux/init.h>
0025 #include <linux/serial_8250.h>
0026 #include <linux/irq.h>
0027 #include <linux/platform_device.h>
0028 #include <asm/mips-boards/maltaint.h>
0029
0030 #define SMC_PORT(base, int) \
0031 { \
0032 .iobase = base, \
0033 .irq = int, \
0034 .uartclk = 1843200, \
0035 .iotype = UPIO_PORT, \
0036 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | \
0037 UPF_MAGIC_MULTIPLIER, \
0038 .regshift = 0, \
0039 }
0040
0041 #define CBUS_UART_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP)
0042
0043 static struct plat_serial8250_port uart8250_data[] = {
0044 SMC_PORT(0x3F8, 4),
0045 SMC_PORT(0x2F8, 3),
0046 #ifndef CONFIG_MIPS_CMP
0047 {
0048 .mapbase = 0x1f000900,
0049 .irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_MB2,
0050 .uartclk = 3686400,
0051 .iotype = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) ?
0052 UPIO_MEM32BE : UPIO_MEM32,
0053 .flags = CBUS_UART_FLAGS,
0054 .regshift = 3,
0055 },
0056 #endif
0057 { },
0058 };
0059
0060 static struct platform_device malta_uart8250_device = {
0061 .name = "serial8250",
0062 .id = PLAT8250_DEV_PLATFORM,
0063 .dev = {
0064 .platform_data = uart8250_data,
0065 },
0066 };
0067
0068 static struct platform_device *malta_devices[] __initdata = {
0069 &malta_uart8250_device,
0070 };
0071
0072 static int __init malta_add_devices(void)
0073 {
0074 return platform_add_devices(malta_devices, ARRAY_SIZE(malta_devices));
0075 }
0076
0077 device_initcall(malta_add_devices);