1 Auto-detection works just fine, so use it instead of specifying the type
2 manually. Also define a platform device for the uart, as suggested by
5 Signed-off-by: Phil Sutter <n0-1@freewrt.org>
7 arch/mips/rb532/devices.c | 26 ++++++++++++++++++++++++++
8 arch/mips/rb532/serial.c | 2 +-
9 2 files changed, 27 insertions(+), 1 deletions(-)
11 diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c
12 index c1c2918..9b6b744 100644
13 --- a/arch/mips/rb532/devices.c
14 +++ b/arch/mips/rb532/devices.c
16 #include <linux/mtd/partitions.h>
17 #include <linux/gpio_keys.h>
18 #include <linux/input.h>
19 +#include <linux/serial_8250.h>
21 #include <asm/bootinfo.h>
24 #define ETH0_RX_DMA_ADDR (DMA0_BASE_ADDR + 0 * DMA_CHAN_OFFSET)
25 #define ETH0_TX_DMA_ADDR (DMA0_BASE_ADDR + 1 * DMA_CHAN_OFFSET)
27 +extern unsigned int idt_cpu_freq;
29 static struct resource korina_dev0_res[] = {
31 .name = "korina_regs",
32 @@ -214,12 +217,32 @@ static struct platform_device rb532_wdt = {
33 .num_resources = ARRAY_SIZE(rb532_wdt_res),
36 +static struct plat_serial8250_port rb532_uart_res[] = {
38 + .membase = (char *)KSEG1ADDR(REGBASE + UART0BASE),
42 + .flags = UPF_BOOT_AUTOCONF,
49 +static struct platform_device rb532_uart = {
50 + .name = "serial8250",
51 + .id = PLAT8250_DEV_PLATFORM,
52 + .dev.platform_data = &rb532_uart_res,
55 static struct platform_device *rb532_devs[] = {
65 @@ -294,6 +317,9 @@ static int __init plat_setup_devices(void)
66 /* Initialise the NAND device */
69 + /* set the uart clock to the current cpu frequency */
70 + rb532_uart_res[0].uartclk = idt_cpu_freq;
72 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs));
75 diff --git a/arch/mips/rb532/serial.c b/arch/mips/rb532/serial.c
76 index 3e0d7ec..00ed19f 100644
77 --- a/arch/mips/rb532/serial.c
78 +++ b/arch/mips/rb532/serial.c
80 extern unsigned int idt_cpu_freq;
82 static struct uart_port rb532_uart = {
83 - .type = PORT_16550A,
84 + .flags = UPF_BOOT_AUTOCONF,