Skip to content

Commit

Permalink
ath71xx: add custom Rambutan interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mantas-p committed Apr 8, 2020
1 parent 40de5e9 commit 6aa093f
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
48 changes: 48 additions & 0 deletions target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,61 @@ 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);
ath79_register_nfc();
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));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From fffd7173ac3210279896f8726ec31699b28c93b4 Mon Sep 17 00:00:00 2001
From: John Crispin <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
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

Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6aa093f

Please sign in to comment.