From e0b80e41eb0b24e76285b9355725d2f4f66ada50 Mon Sep 17 00:00:00 2001 From: juhosg Date: Sun, 22 Jan 2012 22:38:19 +0000 Subject: ar71xx: add initial support for 3.2 Tested on the following boards: ALFA AP96 TL-MR3220 v1 TL-WR1043ND v1 TL-WR2543ND v1 TL-WR703N v1 TL-WR741ND v1 TL-WR741ND v4 WNDR3700 v1 WZR-HP-G300NH git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29868 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...-register-UART-device-for-the-AR933X-SoCs.patch | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 target/linux/ar71xx/patches-3.2/015-MIPS-ath79-register-UART-device-for-the-AR933X-SoCs.patch (limited to 'target/linux/ar71xx/patches-3.2/015-MIPS-ath79-register-UART-device-for-the-AR933X-SoCs.patch') diff --git a/target/linux/ar71xx/patches-3.2/015-MIPS-ath79-register-UART-device-for-the-AR933X-SoCs.patch b/target/linux/ar71xx/patches-3.2/015-MIPS-ath79-register-UART-device-for-the-AR933X-SoCs.patch new file mode 100644 index 000000000..8a36c9845 --- /dev/null +++ b/target/linux/ar71xx/patches-3.2/015-MIPS-ath79-register-UART-device-for-the-AR933X-SoCs.patch @@ -0,0 +1,80 @@ +From d9215f4c69b414f589eeeff002af7ef58b96b172 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Mon, 20 Jun 2011 19:26:12 +0200 +Subject: [PATCH 15/27] 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 +Cc: linux-mips@linux-mips.org +Cc: Kathy Giori +Cc: "Luis R. Rodriguez" +Patchwork: https://patchwork.linux-mips.org/patch/2528/ +Signed-off-by: Ralf Baechle +--- + arch/mips/ath79/dev-common.c | 38 ++++++++++++++++++++++++++++++++++++-- + 1 files changed, 36 insertions(+), 2 deletions(-) + +--- a/arch/mips/ath79/dev-common.c ++++ b/arch/mips/ath79/dev-common.c +@@ -20,6 +20,7 @@ + + #include + #include ++#include + #include "common.h" + #include "dev-common.h" + +@@ -54,6 +55,30 @@ static struct platform_device ath79_uart + }, + }; + ++static struct resource ar933x_uart_resources[] = { ++ { ++ .start = AR933X_UART_BASE, ++ .end = AR933X_UART_BASE + AR71XX_UART_SIZE - 1, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = ATH79_MISC_IRQ_UART, ++ .end = ATH79_MISC_IRQ_UART, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct ar933x_uart_platform_data ar933x_uart_data; ++static struct platform_device ar933x_uart_device = { ++ .name = "ar933x-uart", ++ .id = -1, ++ .resource = ar933x_uart_resources, ++ .num_resources = ARRAY_SIZE(ar933x_uart_resources), ++ .dev = { ++ .platform_data = &ar933x_uart_data, ++ }, ++}; ++ + void __init ath79_register_uart(void) + { + struct clk *clk; +@@ -62,8 +87,17 @@ void __init ath79_register_uart(void) + if (IS_ERR(clk)) + panic("unable to get UART clock, err=%ld", PTR_ERR(clk)); + +- ath79_uart_data[0].uartclk = clk_get_rate(clk); +- platform_device_register(&ath79_uart_device); ++ if (soc_is_ar71xx() || ++ soc_is_ar724x() || ++ soc_is_ar913x()) { ++ ath79_uart_data[0].uartclk = clk_get_rate(clk); ++ platform_device_register(&ath79_uart_device); ++ } else if (soc_is_ar933x()) { ++ ar933x_uart_data.uartclk = clk_get_rate(clk); ++ platform_device_register(&ar933x_uart_device); ++ } else { ++ BUG(); ++ } + } + + static struct platform_device ath79_wdt_device = { -- cgit v1.2.3