provide QCA AR9344 support
cover provide QCA AR9344 support
This patch set is providing initial support for QCA AR9344 SoC. So far it provides PLL and DDR2 initialization.
UART and SPI controller should work as well.
Following variants was tested:
- load PBL to SRAM over JTAG for PLL and DDR2 initialization or configure them with JTAG.
- load and start complete zbarebox.bin or barebox.bin to previously configured DDR2 RAM. Both variants are working.
- start zbarebox.bin from SPI flash
JTAG config for OpenOCD can be found here:
https://github.com/olerem/openocd/commits/ar9344
or maybe later upstrean in OpenOCD directly.
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 | 50 ++ arch/mips/dts/ar9344.dtsi | 53 ++ arch/mips/dts/ar9344_tl_wdr3400.dts | 47 ++ 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, 1182 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_wdr3400.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
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
@@ -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
PATCH 2/3 MIPS: ath79: add initial QCA AR9344 SoC support
In reply to Oleksij RempelAccording 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
@@ -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
@@ -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
PATCH 3/3 MIPS: ath79: add TP-Link WDR4300 board support
In reply to Oleksij RempelThis 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 | 50 +++++++++++++++++ arch/mips/dts/ar9344_tl_wdr3400.dts | 47 ++++++++++++++++ arch/mips/mach-ath79/Kconfig | 10 ++++ 7 files changed, 199 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_wdr3400.dts
arch/mips/Makefile +1 -0
@@ -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
@@ -0,0 +1 @@ +obj-y += board.o
arch/mips/boards/tplink-wdr4300/board.c new file +28 -0
@@ -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 +50 -0
50 lines not on this page · raw message
arch/mips/dts/ar9344_tl_wdr3400.dts new file +47 -0
47 lines not on this page · raw message
arch/mips/mach-ath79/Kconfig +10 -0
@@ -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
Re: [PATCH v1 3/3] MIPS: ath79: add TP-Link WDR4300 board support
Am 01.08.2017 um 20:06 schrieb Oleksij Rempel:
Quoted 5 lines
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.
Signed-off-by Oleksij Rempel <[email protected]>
Quoted 14 lines
--- 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 | 50 +++++++++++++++++ arch/mips/dts/ar9344_tl_wdr3400.dts | 47 ++++++++++++++++ arch/mips/mach-ath79/Kconfig | 10 ++++ 7 files changed, 199 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_defconfi create mode 100644 arch/mips/dts/ar9344_tl_wdr3400.dts
DTS file has wrong name. Should be wdr4300 instead of wdr3400
Quoted 249 lines
arch/mips/Makefile +1
-0@@ -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) := bcm47xxarch/mips/boards/tplink-wdr4300/Makefile new file +1
-0@@ -0,0 +1 @@ +obj-y += board.oarch/mips/boards/tplink-wdr4300/board.c new file +28
-0@@ -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@@ -0,0 +1,62 @@ +/* +* Copyright (C) 2017 Oleksij Rempel <[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 <mach/debug_ll_ar9344.h> +#include <asm/pbl_macros.h> +#include <mach/pbl_macros.h> +#include <mach/pbl_ll_init_ar9344_1.1.h> +#include <asm/pbl_nmon.h> + + .macro board_pbl_start + .set push + .set noreorder + + mips_barebox_10h + + debug_ll_ar9344_init + + debug_ll_outc '1' + +hornet_mips24k_cp0_setup + debug_ll_outc '2' + + /* test if we are in the SRAM */ + pbl_blt 0xbd000000 1f t8 + debug_ll_outc '3' + b skip_flash_test + nop +1: +/* test if we are in the flash */ + pbl_blt 0xbf000000 skip_pll_ram_config t8 + debug_ll_outc '4' +skip_flash_test: + +pbl_ar9344_v11_pll_config + debug_ll_outc '5' + + pbl_ar9344_v11_ddr2_config + +skip_pll_ram_config: + debug_ll_outc '6' + debug_ll_outnl + +mips_nmon + + copy_to_link_location pbl_start + + .set pop + .endmarch/mips/configs/tplink-wdr4300_defconfig new file +50
-0@@ -0,0 +1,50 @@ +CONFIG_BUILTIN_DTB=y +CONFIG_BUILTIN_DTB_NAME="ar9344_tl_wdr3400" +CONFIG_MACH_MIPS_ATH79=y +CONFIG_BOARD_TPLINK_WDR4300=y +CONFIG_PBL_IMAGE=y +CONFIG_IMAGE_COMPRESSION_XZKERN=y +CONFIG_MMU=y +CONFIG_TEXT_BASE=0xbfc00000 +CONFIG_MALLOC_TLSF=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_INITCALLS=y +CONFIG_LONGHELP=y +CONFIG_CMD_IOMEM=y +CONFIG_CMD_MEMINFO=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y +# CONFIG_CMD_BOOTM is not set +CONFIG_CMD_GO=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_LOADY=y +CONFIG_CMD_RESET=y +CONFIG_CMD_SHA1SUM=y +CONFIG_CMD_LET=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_EDIT=y +CONFIG_CMD_MM=y +CONFIG_CMD_CLK=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_LED=y +CONFIG_CMD_SPI=y +CONFIG_CMD_LED_TRIGGER=y +CONFIG_CMD_OF_NODE=y +CONFIG_CMD_OF_PROPERTY=y +CONFIG_CMD_OFTREE=y +CONFIG_OFDEVICE=y +CONFIG_DRIVER_SERIAL_NS16550=y +CONFIG_DRIVER_SPI_ATH79=y +CONFIG_MTD=y +# CONFIG_MTD_OOB_DEVICE is not set +CONFIG_MTD_M25P80=y +CONFIG_LED=y +CONFIG_LED_GPIO=y +CONFIG_LED_GPIO_OF=y +CONFIG_LED_TRIGGERS=y +CONFIG_DIGEST_SHA224_GENERIC=y +CONFIG_DIGEST_SHA256_GENERIC=yarch/mips/dts/ar9344_tl_wdr3400.dts new file +47
-0@@ -0,0 +1,47 @@ +/dts-v1/; + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> + +#include "ar9344.dtsi" + +/ { + model = "TP-Link WDR4300"; + compatible = "tplink,tl-wdr4300"; + + aliases { + serial0 = &uart0; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + chosen { + stdout-path = &uart0; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart0 { + status = "okay"; + clock-frequency = <40000000>; +}; + +&spi { + num-chipselects = <1>; + status = "okay"; + + /* Winbond W25Q64CV SPI flash */ + spiflash: w25q64cv@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "winbond,w25q64cv", "jedec,spi-nor"; + spi-max-frequency = <104000000>; + reg = <0>; + }; +};arch/mips/mach-ath79/Kconfig +3
-0@@ -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
arch/mips/mach-ath79/Kconfig config BOARD_TPLINK_MR3020 · line 32
Quoted 10 lines
arch/mips/mach-ath79/Kconfig +7
-0+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
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox