aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-06-20 13:26:12 -0400
committerRalf Baechle <ralf@linux-mips.org>2011-12-07 17:02:46 -0500
commit13051c5cc3dd2600afe980049eb566b9b6a4afda (patch)
treead094f4f9ac12d55d78d2d2e5c60312d673c2ac1
parentd57f341ba08c9f34ccd45a89729e73174d4a3325 (diff)
MIPS: ath79: register UART device for the AR933X SoCs
The AR933X SoCs does not have a 8250 compatible UART, they are using a different UART core. Register a different platform device for the different UART. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: linux-mips@linux-mips.org Cc: Kathy Giori <kgiori@qca.qualcomm.com> Cc: "Luis R. Rodriguez" <rodrigue@qca.qualcomm.com> Patchwork: https://patchwork.linux-mips.org/patch/2528/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/ath79/dev-common.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/arch/mips/ath79/dev-common.c b/arch/mips/ath79/dev-common.c
index 3b82e325bebf..f4956f809072 100644
--- a/arch/mips/ath79/dev-common.c
+++ b/arch/mips/ath79/dev-common.c
@@ -20,6 +20,7 @@
20 20
21#include <asm/mach-ath79/ath79.h> 21#include <asm/mach-ath79/ath79.h>
22#include <asm/mach-ath79/ar71xx_regs.h> 22#include <asm/mach-ath79/ar71xx_regs.h>
23#include <asm/mach-ath79/ar933x_uart_platform.h>
23#include "common.h" 24#include "common.h"
24#include "dev-common.h" 25#include "dev-common.h"
25 26
@@ -54,6 +55,30 @@ static struct platform_device ath79_uart_device = {
54 }, 55 },
55}; 56};
56 57
58static struct resource ar933x_uart_resources[] = {
59 {
60 .start = AR933X_UART_BASE,
61 .end = AR933X_UART_BASE + AR71XX_UART_SIZE - 1,
62 .flags = IORESOURCE_MEM,
63 },
64 {
65 .start = ATH79_MISC_IRQ_UART,
66 .end = ATH79_MISC_IRQ_UART,
67 .flags = IORESOURCE_IRQ,
68 },
69};
70
71static struct ar933x_uart_platform_data ar933x_uart_data;
72static struct platform_device ar933x_uart_device = {
73 .name = "ar933x-uart",
74 .id = -1,
75 .resource = ar933x_uart_resources,
76 .num_resources = ARRAY_SIZE(ar933x_uart_resources),
77 .dev = {
78 .platform_data = &ar933x_uart_data,
79 },
80};
81
57void __init ath79_register_uart(void) 82void __init ath79_register_uart(void)
58{ 83{
59 struct clk *clk; 84 struct clk *clk;
@@ -62,8 +87,17 @@ void __init ath79_register_uart(void)
62 if (IS_ERR(clk)) 87 if (IS_ERR(clk))
63 panic("unable to get UART clock, err=%ld", PTR_ERR(clk)); 88 panic("unable to get UART clock, err=%ld", PTR_ERR(clk));
64 89
65 ath79_uart_data[0].uartclk = clk_get_rate(clk); 90 if (soc_is_ar71xx() ||
66 platform_device_register(&ath79_uart_device); 91 soc_is_ar724x() ||
92 soc_is_ar913x()) {
93 ath79_uart_data[0].uartclk = clk_get_rate(clk);
94 platform_device_register(&ath79_uart_device);
95 } else if (soc_is_ar933x()) {
96 ar933x_uart_data.uartclk = clk_get_rate(clk);
97 platform_device_register(&ar933x_uart_device);
98 } else {
99 BUG();
100 }
67} 101}
68 102
69static struct platform_device ath79_wdt_device = { 103static struct platform_device ath79_wdt_device = {