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 --- a/arch/mips/rb532/devices.c
12 +++ b/arch/mips/rb532/devices.c
14 #include <linux/mtd/partitions.h>
15 #include <linux/gpio_keys.h>
16 #include <linux/input.h>
17 +#include <linux/serial_8250.h>
19 #include <asm/bootinfo.h>
22 #define ETH0_RX_DMA_ADDR (DMA0_BASE_ADDR + 0 * DMA_CHAN_OFFSET)
23 #define ETH0_TX_DMA_ADDR (DMA0_BASE_ADDR + 1 * DMA_CHAN_OFFSET)
25 +extern unsigned int idt_cpu_freq;
27 static struct resource korina_dev0_res[] = {
29 .name = "korina_regs",
30 @@ -214,12 +217,32 @@ static struct platform_device rb532_wdt
31 .num_resources = ARRAY_SIZE(rb532_wdt_res),
34 +static struct plat_serial8250_port rb532_uart_res[] = {
36 + .membase = (char *)KSEG1ADDR(REGBASE + UART0BASE),
40 + .flags = UPF_BOOT_AUTOCONF,
47 +static struct platform_device rb532_uart = {
48 + .name = "serial8250",
49 + .id = PLAT8250_DEV_PLATFORM,
50 + .dev.platform_data = &rb532_uart_res,
53 static struct platform_device *rb532_devs[] = {
63 @@ -294,6 +317,9 @@ static int __init plat_setup_devices(voi
64 /* Initialise the NAND device */
67 + /* set the uart clock to the current cpu frequency */
68 + rb532_uart_res[0].uartclk = idt_cpu_freq;
70 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs));
73 --- a/arch/mips/rb532/serial.c
74 +++ b/arch/mips/rb532/serial.c
76 extern unsigned int idt_cpu_freq;
78 static struct uart_port rb532_uart = {
79 - .type = PORT_16550A,
80 + .flags = UPF_BOOT_AUTOCONF,