Skip to contentSkip to conversation

provide basic support for TP-Link WDR4300

PATCH New Oleksij Rempel 1 participant 4 messages Aug 9, 2017 MIPS

lore
Share & tools
lore
#0 lore raw

cover provide basic support for TP-Link WDR4300

this set also including support of QCA AR9344 too.

Oleksij Rempel (3):
MIPS: ath79: provide CONFIG_SOC_QCA_AR9331 option
MIPS: ath79: add initial QCA AR9344 SoC support
MIPS: ath79: add TP-Link WDR4300 board support

 arch/mips/Makefile                                 |   1 +
 arch/mips/boards/tplink-wdr4300/Makefile           |   1 +
 arch/mips/boards/tplink-wdr4300/board.c            |  28 ++
 .../tplink-wdr4300/include/board/board_pbl_start.h |  62 +++
 arch/mips/configs/tplink-wdr4300_defconfig         |  78 +++
 arch/mips/dts/ar9344.dtsi                          |  53 ++
 arch/mips/dts/ar9344_tl_wdr4300.dts                |  63 +++
 arch/mips/mach-ath79/Kconfig                       |  15 +
 arch/mips/mach-ath79/include/mach/ar71xx_regs.h    |   9 +
 arch/mips/mach-ath79/include/mach/debug_ll.h       | 167 +------
 .../mips/mach-ath79/include/mach/debug_ll_ar9331.h | 176 +++++++
 .../mips/mach-ath79/include/mach/debug_ll_ar9344.h | 191 ++++++++
 .../include/mach/pbl_ll_init_ar9344_1.1.h          | 540 +++++++++++++++++++++
 13 files changed, 1226 insertions(+), 158 deletions(-)
 create mode 100644 arch/mips/boards/tplink-wdr4300/Makefile
 create mode 100644 arch/mips/boards/tplink-wdr4300/board.c
 create mode 100644 arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h
 create mode 100644 arch/mips/configs/tplink-wdr4300_defconfig
 create mode 100644 arch/mips/dts/ar9344.dtsi
 create mode 100644 arch/mips/dts/ar9344_tl_wdr4300.dts
 create mode 100644 arch/mips/mach-ath79/include/mach/debug_ll_ar9331.h
 create mode 100644 arch/mips/mach-ath79/include/mach/debug_ll_ar9344.h
 create mode 100644 arch/mips/mach-ath79/include/mach/pbl_ll_init_ar9344_1.1.h
Signature · 7 lines
2.11.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/3 MIPS: ath79: provide CONFIG_SOC_QCA_AR9331 option

QCA AR9331 and QCA AR9344 have some similar part but different uart engines. We need this flag to provide common debug_ll support.

---
 arch/mips/mach-ath79/Kconfig | 5 +++++
 1 file changed, 5 insertions(+)
arch/mips/mach-ath79/Kconfig +5 -0
index 9b8e3946e..f2eae2532 100644
@@ -4,17 +4,22 @@ config ARCH_TEXT_BASE
 	hex
 	default 0xa0800000
 
+config SOC_QCA_AR9331
+	bool
+
 choice
 	prompt "Board type"
 
 config BOARD_TPLINK_MR3020
 	bool "TP-LINK MR3020"
+	select SOC_QCA_AR9331
 	select HAVE_PBL_IMAGE
 	select HAVE_IMAGE_COMPRESSION
 	select HAS_NMON
 
 config BOARD_BLACK_SWIFT
 	bool "Black Swift"
+	select SOC_QCA_AR9331
 	select HAVE_PBL_IMAGE
 	select HAVE_IMAGE_COMPRESSION
 	select HAS_NMON
Signature · 7 lines
2.11.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/3 MIPS: ath79: add initial QCA AR9344 SoC support

In reply to Oleksij Rempel

According to the documentation:
"The AR9344 is a highly integrated and feature-rich IEEE 802.11n 2x2 2.4/5 GHz System-on-a-Chip (SoC) for advanced WLAN platforms.

It includes a MIPS 74Kc processor, PCI Express 1.1 Root Complex and Endpoint interfaces, five port IEEE 802.3 Fast Ethernet Switch with MAC/PHY, one MII/RMII/RGMII interface, one USB 2.0 MAC/PHY, and external memory interface for serial Flash, SDRAM, DDR1 or DDR2, I2S/SPDIF-Out audio interface, SLIC VOIP/PCM interface, two UARTs, and GPIOs that can be used for LED controls or other general purpose interface configurations.
The AR9344 supports 802.11n operations up to 144 Mbps for 20 MHz and 300 Mbps for 40 MHz respectively, and 802.11a/b/g data rates.
Additional features include Maximal Likelihood (ML) decoding, Low-Density Parity Check (LDPC), Maximal Ratio Combining (MRC), Tx Beamforming (TxBF), and On-Chip One-Time Programmable (OTP) memory."

---
 arch/mips/dts/ar9344.dtsi                          |  53 ++
 arch/mips/mach-ath79/include/mach/ar71xx_regs.h    |   9 +
 arch/mips/mach-ath79/include/mach/debug_ll.h       | 167 +------
 .../mips/mach-ath79/include/mach/debug_ll_ar9331.h | 176 +++++++
 .../mips/mach-ath79/include/mach/debug_ll_ar9344.h | 191 ++++++++
 .../include/mach/pbl_ll_init_ar9344_1.1.h          | 540 +++++++++++++++++++++
 6 files changed, 978 insertions(+), 158 deletions(-)
 create mode 100644 arch/mips/dts/ar9344.dtsi
 create mode 100644 arch/mips/mach-ath79/include/mach/debug_ll_ar9331.h
 create mode 100644 arch/mips/mach-ath79/include/mach/debug_ll_ar9344.h
 create mode 100644 arch/mips/mach-ath79/include/mach/pbl_ll_init_ar9344_1.1.h
arch/mips/dts/ar9344.dtsi new file +53 -0
new file mode 100644
index 000000000..0838e8d7f
@@ -0,0 +1,53 @@
+#include <dt-bindings/clock/ath79-clk.h>
+
+/ {
+	compatible = "qca,ar9344";
+
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "mips,mips74Kc";
+			reg = <0>;
+		};
+	};
+
+	ref: ref {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+	};
+
+	ahb {
+		compatible = "simple-bus";
+		ranges;
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		uart0: uart@18020000 {
+			compatible = "ns16550a", "qca,ar9344-uart0";
+			reg = <0x18020000 0x20>;
+
+			reg-shift = <2>;
+			reg-io-width = <4>;
+			big-endian;
+
+			status = "disabled";
+		};
+
+		spi: spi@1f000000 {
+			compatible = "qca,ar7100-spi", "qca,ar9344-spi";
+			reg = <0x1f000000 0x1c>;
+
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			status = "disabled";
+		};
+	};
+};
arch/mips/mach-ath79/include/mach/ar71xx_regs.h +9 -0
index de96c565a..f56c3f724 100644
@@ -37,6 +37,15 @@
 #define AR933X_UART_BASE	(AR71XX_APB_BASE + 0x00020000)
 #define AR933X_UART_SIZE	0x14
 
+#define AR934X_UART0_BASE	(AR71XX_APB_BASE + 0x00020000)
+#define AR934X_UART0_SIZE	0x18
+#define AR934X_UART0_SHIFT	2
+
+/* WASP BootStrap Register */
+#define WASP_BOOTSTRAP_REG		(AR71XX_RESET_BASE + 0xb0)
+#define WASP_REF_CLK_25			(1 << 4) /* 0 - 25MHz	1 - 40 MHz */
+#define WASP_RAM_TYPE(a)		((a) & 0x3)
+
 /*
  * RTC block
  */
arch/mips/mach-ath79/include/mach/debug_ll.h +9 -158

176 lines not on this page · raw message

arch/mips/mach-ath79/include/mach/debug_ll_ar9331.h new file +176 -0

176 lines not on this page · raw message

arch/mips/mach-ath79/include/mach/debug_ll_ar9344.h new file +191 -0

191 lines not on this page · raw message

arch/mips/mach-ath79/include/mach/pbl_ll_init_ar9344_1.1.h new file +540 -0

540 lines not on this page · raw message

Signature · 7 lines
2.11.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/3 MIPS: ath79: add TP-Link WDR4300 board support

In reply to Oleksij Rempel

This provides low level initialization of pll and ddr2. Resulting binary should work from SRAM, DDR2 and SPI flash. If started from DDR2 RAM level initialization will skipped.

---
 arch/mips/Makefile                                 |  1 +
 arch/mips/boards/tplink-wdr4300/Makefile           |  1 +
 arch/mips/boards/tplink-wdr4300/board.c            | 28 ++++++++
 .../tplink-wdr4300/include/board/board_pbl_start.h | 62 +++++++++++++++++
 arch/mips/configs/tplink-wdr4300_defconfig         | 78 ++++++++++++++++++++++
 arch/mips/dts/ar9344_tl_wdr4300.dts                | 63 +++++++++++++++++
 arch/mips/mach-ath79/Kconfig                       | 10 +++
 7 files changed, 243 insertions(+)
 create mode 100644 arch/mips/boards/tplink-wdr4300/Makefile
 create mode 100644 arch/mips/boards/tplink-wdr4300/board.c
 create mode 100644 arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h
 create mode 100644 arch/mips/configs/tplink-wdr4300_defconfig
 create mode 100644 arch/mips/dts/ar9344_tl_wdr4300.dts
arch/mips/Makefile +1 -0
index 75761b5e7..dd5ceea20 100644
@@ -80,6 +80,7 @@ board-$(CONFIG_BOARD_NETGEAR_WG102)	:= netgear-wg102
 
 machine-$(CONFIG_MACH_MIPS_ATH79)	:= ath79
 board-$(CONFIG_BOARD_TPLINK_MR3020)	:= tplink-mr3020
+board-$(CONFIG_BOARD_TPLINK_WDR4300)	:= tplink-wdr4300
 board-$(CONFIG_BOARD_BLACK_SWIFT)	:= black-swift
 
 machine-$(CONFIG_MACH_MIPS_BCM47XX)	:= bcm47xx
arch/mips/boards/tplink-wdr4300/Makefile new file +1 -0
new file mode 100644
index 000000000..dcfc2937d
@@ -0,0 +1 @@
+obj-y += board.o
arch/mips/boards/tplink-wdr4300/board.c new file +28 -0
new file mode 100644
index 000000000..d6126fcb6
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2017 Oleksij Rempel <[email protected]>
+ * Copyright (C) 2014 Antony Pavlov <[email protected]>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <common.h>
+#include <init.h>
+
+static int model_hostname_init(void)
+{
+	barebox_set_hostname("wdr4300");
+
+	return 0;
+}
+postcore_initcall(model_hostname_init);
arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h new file +62 -0

62 lines not on this page · raw message

arch/mips/configs/tplink-wdr4300_defconfig new file +78 -0

78 lines not on this page · raw message

arch/mips/dts/ar9344_tl_wdr4300.dts new file +63 -0

63 lines not on this page · raw message

arch/mips/mach-ath79/Kconfig +10 -0
index f2eae2532..9fec00c98 100644
@@ -7,6 +7,9 @@ config ARCH_TEXT_BASE
 config SOC_QCA_AR9331
 	bool
 
+config SOC_QCA_AR9344
+	bool
+
 choice
 	prompt "Board type"
 
@@ -17,6 +20,13 @@ config BOARD_TPLINK_MR3020
 	select HAVE_IMAGE_COMPRESSION
 	select HAS_NMON
 
+config BOARD_TPLINK_WDR4300
+	bool "TP-LINK WDR4300"
+	select SOC_QCA_AR9344
+	select HAVE_PBL_IMAGE
+	select HAVE_IMAGE_COMPRESSION
+	select HAS_NMON
+
 config BOARD_BLACK_SWIFT
 	bool "Black Swift"
 	select SOC_QCA_AR9331
Signature · 7 lines
2.11.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox