diff options
Diffstat (limited to 'arch/mips/ath79/dev-common.c')
-rw-r--r-- | arch/mips/ath79/dev-common.c | 38 |
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 | ||
58 | static 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 | |||
71 | static struct ar933x_uart_platform_data ar933x_uart_data; | ||
72 | static 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 | |||
57 | void __init ath79_register_uart(void) | 82 | void __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 | ||
69 | static struct platform_device ath79_wdt_device = { | 103 | static struct platform_device ath79_wdt_device = { |