1 From d9215f4c69b414f589eeeff002af7ef58b96b172 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Mon, 20 Jun 2011 19:26:12 +0200
4 Subject: [PATCH 15/27] MIPS: ath79: register UART device for the AR933X SoCs
6 The AR933X SoCs does not have a 8250 compatible UART, they
7 are using a different UART core. Register a different platform
8 device for the different UART.
10 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
11 Cc: linux-mips@linux-mips.org
12 Cc: Kathy Giori <kgiori@qca.qualcomm.com>
13 Cc: "Luis R. Rodriguez" <rodrigue@qca.qualcomm.com>
14 Patchwork: https://patchwork.linux-mips.org/patch/2528/
15 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 arch/mips/ath79/dev-common.c | 38 ++++++++++++++++++++++++++++++++++++--
18 1 files changed, 36 insertions(+), 2 deletions(-)
20 --- a/arch/mips/ath79/dev-common.c
21 +++ b/arch/mips/ath79/dev-common.c
24 #include <asm/mach-ath79/ath79.h>
25 #include <asm/mach-ath79/ar71xx_regs.h>
26 +#include <asm/mach-ath79/ar933x_uart_platform.h>
28 #include "dev-common.h"
30 @@ -54,6 +55,30 @@ static struct platform_device ath79_uart
34 +static struct resource ar933x_uart_resources[] = {
36 + .start = AR933X_UART_BASE,
37 + .end = AR933X_UART_BASE + AR71XX_UART_SIZE - 1,
38 + .flags = IORESOURCE_MEM,
41 + .start = ATH79_MISC_IRQ_UART,
42 + .end = ATH79_MISC_IRQ_UART,
43 + .flags = IORESOURCE_IRQ,
47 +static struct ar933x_uart_platform_data ar933x_uart_data;
48 +static struct platform_device ar933x_uart_device = {
49 + .name = "ar933x-uart",
51 + .resource = ar933x_uart_resources,
52 + .num_resources = ARRAY_SIZE(ar933x_uart_resources),
54 + .platform_data = &ar933x_uart_data,
58 void __init ath79_register_uart(void)
61 @@ -62,8 +87,17 @@ void __init ath79_register_uart(void)
63 panic("unable to get UART clock, err=%ld", PTR_ERR(clk));
65 - ath79_uart_data[0].uartclk = clk_get_rate(clk);
66 - platform_device_register(&ath79_uart_device);
67 + if (soc_is_ar71xx() ||
70 + ath79_uart_data[0].uartclk = clk_get_rate(clk);
71 + platform_device_register(&ath79_uart_device);
72 + } else if (soc_is_ar933x()) {
73 + ar933x_uart_data.uartclk = clk_get_rate(clk);
74 + platform_device_register(&ar933x_uart_device);
80 static struct platform_device ath79_wdt_device = {