diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c index 1730a29f33f..01e366b1f0b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c @@ -58,6 +58,52 @@ static struct mdio_board_info rambutan_mdio1_info[] = { }, }; +static struct spi_board_info rambutan_spi_info[] = { + { + .bus_num = 0, + .chip_select = 0, + .max_speed_hz = 25000000, + .modalias = "spidev", + }, + { + .bus_num = 0, + .chip_select = 1, + .max_speed_hz = 25000000, + .modalias = "spidev", + }, + { + .bus_num = 0, + .chip_select = 2, + .max_speed_hz = 25000000, + .modalias = "spidev", + } +}; + +static struct ath79_spi_platform_data rambutan_spi_data = { + .bus_num = 0, + .num_chipselect = 3, +}; + +static struct resource rambutan_uart1_resources[] = { + { + .start = QCA955X_UART1_BASE, + .end = QCA955X_UART1_BASE + QCA955X_UART1_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + { + .start = ATH79_MISC_IRQ(6), + .end = ATH79_MISC_IRQ(6), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device rambutan_uart1_device = { + .name = "ar933x-uart", + .id = -1, + .resource = rambutan_uart1_resources, + .num_resources = ARRAY_SIZE(rambutan_uart1_resources), +}; + static void __init rambutan_setup(void) { ath79_nfc_set_ecc_mode(AR934X_NFC_ECC_HW); @@ -65,6 +111,8 @@ static void __init rambutan_setup(void) ath79_register_usb(); ath79_register_pci(); ath79_register_wmac_simple(); + platform_device_register(&rambutan_uart1_device); + ath79_register_spi(&rambutan_spi_data, rambutan_spi_info, 3); mdiobus_register_board_info(rambutan_mdio0_info, ARRAY_SIZE(rambutan_mdio0_info)); diff --git a/target/linux/ar71xx/patches-4.14/0061-tty-serial-drop-ATH79-specific-SoC-symbols.patch b/target/linux/ar71xx/patches-4.14/0061-tty-serial-drop-ATH79-specific-SoC-symbols.patch new file mode 100644 index 00000000000..c71d7eb063c --- /dev/null +++ b/target/linux/ar71xx/patches-4.14/0061-tty-serial-drop-ATH79-specific-SoC-symbols.patch @@ -0,0 +1,36 @@ +From fffd7173ac3210279896f8726ec31699b28c93b4 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Mon, 7 May 2018 15:14:07 +0200 +Subject: tty: serial: drop ATH79 specific SoC symbols + +QCA MIPS support is being converted to pure OF. As part of this we are +dropping the SOC_AR* symbols. Additionally the SERIAL_AR933X style tty +is also found on a few SoCs newer that the AR933x. + +This patch changes the dependency to ATH79, thus fixing the 2 issues +described above. + +Signed-off-by: John Crispin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +(limited to 'drivers/tty/serial/Kconfig') + +diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig +index eca55187539a..df8bd0c7b97d 100644 +--- a/drivers/tty/serial/Kconfig ++++ b/drivers/tty/serial/Kconfig +@@ -1294,7 +1294,7 @@ config SERIAL_XILINX_PS_UART_CONSOLE + + config SERIAL_AR933X + tristate "AR933X serial port support" +- depends on HAVE_CLK && SOC_AR933X ++ depends on HAVE_CLK && ATH79 + select SERIAL_CORE + help + If you have an Atheros AR933X SOC based board and want to use the +-- +cgit 1.2-0.3.lf.el7 + diff --git a/target/linux/ar71xx/patches-4.14/917-MIPS-ath79-add-qca955x-uart1-reg-defs.patch b/target/linux/ar71xx/patches-4.14/917-MIPS-ath79-add-qca955x-uart1-reg-defs.patch new file mode 100644 index 00000000000..db19bfcbbec --- /dev/null +++ b/target/linux/ar71xx/patches-4.14/917-MIPS-ath79-add-qca955x-uart1-reg-defs.patch @@ -0,0 +1,11 @@ +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -137,6 +137,8 @@ + #define QCA955X_GMAC_SIZE 0x40 + #define QCA955X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) + #define QCA955X_WMAC_SIZE 0x20000 ++#define QCA955X_UART1_BASE (AR71XX_APB_BASE + 0x00500000) ++#define QCA955X_UART1_SIZE 0x14 + #define QCA955X_EHCI0_BASE 0x1b000000 + #define QCA955X_EHCI1_BASE 0x1b400000 + #define QCA955X_EHCI_SIZE 0x1000