add RT-ACRH17 pcie drivers full support with new DTD

This commit is contained in:
coolsnowwolf 2018-01-24 15:48:45 +08:00
parent ae33ef74dc
commit 5888dc95bd
11 changed files with 5257 additions and 35 deletions

View File

@ -1,34 +0,0 @@
From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001
From: "Andrey Jr. Melnikov" <temnota.am@gmail.com>
Date: Thu, 8 Dec 2016 19:57:08 +0300
Subject: [PATCH] mtd: nand: Add Winbond manufacturer id
Add WINBOND manufacturer id.
Signed-off-by: Andrey Jr. Melnikov <temnota.am@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
drivers/mtd/nand/nand_ids.c | 1 +
include/linux/mtd/nand.h | 1 +
2 files changed, 2 insertions(+)
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -182,6 +182,7 @@ struct nand_manufacturers nand_manuf_ids
{NAND_MFR_SANDISK, "SanDisk"},
{NAND_MFR_INTEL, "Intel"},
{NAND_MFR_ATO, "ATO"},
+ {NAND_MFR_WINBOND, "Winbond"},
{0x0, "Unknown"}
};
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -928,6 +928,7 @@ static inline void nand_set_controller_d
#define NAND_MFR_SANDISK 0x45
#define NAND_MFR_INTEL 0x89
#define NAND_MFR_ATO 0x9b
+#define NAND_MFR_WINBOND 0xef
/* The maximum expected count of bytes in the NAND ID sequence */
#define NAND_MAX_ID_LEN 8

View File

@ -11,6 +11,16 @@ board=$(board_name)
boardname="${board##*,}"
case "$board" in
asus,rt-acrh17)
ucidef_set_led_default "status" "STATUS" "${boardname}:blue:status" "1"
ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:blue:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:blue:wlan5g" "phy0tpt"
ucidef_set_led_switch "wan" "WAN(blue)" "${boardname}:blue:wan" "switch0" "0x20"
ucidef_set_led_switch "lan1" "LAN1" "${boardname}:blue:lan1" "switch0" "0x02"
ucidef_set_led_switch "lan2" "LAN2" "${boardname}:blue:lan2" "switch0" "0x04"
ucidef_set_led_switch "lan3" "LAN3" "${boardname}:blue:lan3" "switch0" "0x08"
ucidef_set_led_switch "lan4" "LAN4" "${boardname}:blue:lan4" "switch0" "0x10"
;;
asus,rt-ac58u)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:blue:wlan2G" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:blue:wlan5G" "phy1tpt"

View File

@ -12,6 +12,15 @@ board_config_update
board=$(board_name)
case "$board" in
asus,rt-acrh17)
CI_UBIPART=UBI_DEV
lan_mac_addr=$(mtd_get_mac_binary_ubi Factory 4102)
wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 36870)
ucidef_add_switch "switch0" \
"0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
ucidef_set_interface_macaddr "lan" "$lan_mac_addr"
ucidef_set_interface_macaddr "wan" "$wan_mac_addr"
;;
asus,rt-ac58u)
CI_UBIPART=UBI_DEV
wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486)

View File

@ -62,6 +62,11 @@ board=$(board_name)
case "$FIRMWARE" in
"ath10k/pre-cal-ahb-a000000.wifi.bin")
case "$board" in
asus,rt-acrh17)
CI_UBIPART=UBI_DEV
. /lib/upgrade/nand.sh
ath10kcal_ubi_extract "Factory" 4096 12064
;;
asus,rt-ac58u)
. /lib/upgrade/nand.sh
@ -101,6 +106,11 @@ case "$FIRMWARE" in
"ath10k/pre-cal-pci-0000:01:00.0.bin")
case $board in
asus,rt-acrh17)
CI_UBIPART=UBI_DEV
. /lib/upgrade/nand.sh
ath10kcal_ubi_extract "Factory" 36864 12064
;;
linksys,ea8500)
hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
ath10kcal_extract "art" 4096 12064

View File

@ -0,0 +1,20 @@
#
# Copyright (C) 2014-2015 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
preinit_set_mac_address() {
local mac
. /lib/functions.sh
case $(board_name) in
asus,rt-acrh17)
CI_UBIPART=UBI_DEV
mac=$(mtd_get_mac_binary_ubi Factory 4102)
ifconfig eth0 hw ether $mac 2>/dev/null
;;
esac
}
boot_hook_add preinit_main preinit_set_mac_address

View File

@ -33,6 +33,17 @@ EOF
platform_do_upgrade() {
case "$(board_name)" in
asus,rt-acrh17)
CI_UBIPART="UBI_DEV"
CI_KERNPART="linux"
local ubidev=$(nand_find_ubi $CI_UBIPART)
local jffs2=$(nand_find_volume $ubidev jffs2)
local linux2=$(nand_find_volume $ubidev linux2)
[ -n "$jffs2" ] && ubirmvol /dev/$ubidev --name=jffs2
[ -n "$linux2" ] && ubirmvol /dev/$ubidev --name=linux2
nand_do_upgrade "$1"
;;
asus,rt-ac58u)
CI_UBIPART="UBI_DEV"
CI_KERNPART="linux"

View File

@ -478,6 +478,7 @@ CONFIG_USB=y
CONFIG_USB_COMMON=y
# CONFIG_USB_EHCI_HCD is not set
CONFIG_USB_IPQ4019_PHY=y
CONFIG_USB_PHY=y
CONFIG_USB_SUPPORT=y
# CONFIG_USB_UHCI_HCD is not set
CONFIG_USE_OF=y
@ -493,3 +494,4 @@ CONFIG_ZBOOT_ROM_BSS=0
CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZLIB_DEFLATE=y
CONFIG_ZLIB_INFLATE=y
CONFIG_MSM_PCIE=y

View File

@ -0,0 +1,291 @@
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
#include "qcom-ipq4019-ap.dk04.1.dtsi"
#include "qcom-ipq4019-bus.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/soc/qcom,tcsr.h>
/ {
model = "ASUS RT-ACRH17";
compatible = "asus,rt-acrh17", "qcom,ipq4019";
memory {
device_type = "memory";
reg = <0x80000000 0x10000000>;
};
aliases {
led-boot = &power;
led-failsafe = &power;
led-running = &power;
led-upgrade = &power;
};
reserved-memory {
#address-cells = <0x1>;
#size-cells = <0x1>;
ranges;
rsvd1@87E00000 {
reg = <0x87e00000 0x200000>;
no-map;
};
};
soc {
spi_0: spi@78b5000 {
status = "disabled";
};
pcie0: qcom,pcie@80000 {
compatible = "qcom,msm_pcie";
cell-index = <0>;
qcom,ctrl-amt = <1>;
reg = <0x80000 0x2000>,
<0x99000 0x800>,
<0x40000000 0xf1d>,
<0x40000f20 0xa8>,
<0x40100000 0x1000>,
<0x40200000 0x100000>,
<0x40300000 0xd00000>;
reg-names = "parf", "phy", "dm_core", "elbi",
"conf", "io", "bars";
#address-cells = <0>;
interrupt-parent = <&pcie0>;
interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12>;
#interrupt-cells = <1>;
interrupt-map-mask = <0xffffffff>;
interrupt-map = <0 &intc 0 141 0
1 &intc 0 142 0
2 &intc 0 143 0
3 &intc 0 144 0
4 &intc 0 145 0
5 &intc 0 146 0
6 &intc 0 147 0
7 &intc 0 148 0
8 &intc 0 149 0
9 &intc 0 150 0
10 &intc 0 151 0
11 &intc 0 152 0 >;
interrupt-names = "int_msi", "int_a", "int_b", "int_c", "int_d",
"int_pls_pme", "int_pme_legacy", "int_pls_err",
"int_aer_legacy", "int_pls_link_up",
"int_pls_link_down", "int_bridge_flush_n","int_wake";
qcom,ep-latency = <10>;
clocks = <&gcc GCC_PCIE_AHB_CLK>,
<&gcc GCC_PCIE_AXI_M_CLK>,
<&gcc GCC_PCIE_AXI_S_CLK>;
clock-names = "pcie_0_cfg_ahb_clk",
"pcie_0_mstr_axi_clk",
"pcie_0_slv_axi_clk";
max-clock-frequency-hz = <0>, <0>, <0>;
resets = <&gcc PCIE_AXI_M_ARES>,
<&gcc PCIE_AXI_S_ARES>,
<&gcc PCIE_PIPE_ARES>,
<&gcc PCIE_AXI_M_VMIDMT_ARES>,
<&gcc PCIE_AXI_S_XPU_ARES>,
<&gcc PCIE_PARF_XPU_ARES>,
<&gcc PCIE_PHY_ARES>,
<&gcc PCIE_AXI_M_STICKY_ARES>,
<&gcc PCIE_PIPE_STICKY_ARES>,
<&gcc PCIE_PWR_ARES>,
<&gcc PCIE_AHB_ARES>,
<&gcc PCIE_PHY_AHB_ARES>;
reset-names = "pcie_rst_axi_m_ares",
"pcie_rst_axi_s_ares",
"pcie_rst_pipe_ares",
"pcie_rst_axi_m_vmidmt_ares",
"pcie_rst_axi_s_xpu_ares",
"pcie_rst_parf_xpu_ares",
"pcie_rst_phy_ares",
"pcie_rst_axi_m_sticky_ares",
"pcie_rst_pipe_sticky_ares",
"pcie_rst_pwr_ares",
"pcie_rst_ahb_res",
"pcie_rst_phy_ahb_ares";
status = "ok";
perst-gpio = <&tlmm 38 0>;
wake-gpio = <&tlmm 50 0>;
clkreq-gpio = <&tlmm 39 0>;
};
tcsr@194b000 {
/* select hostmode */
compatible = "qcom,tcsr";
reg = <0x194b000 0x100>;
qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
status = "ok";
};
ess_tcsr@1953000 {
compatible = "qcom,tcsr";
reg = <0x1953000 0x1000>;
qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
};
tcsr@1949000 {
compatible = "qcom,tcsr";
reg = <0x1949000 0x100>;
qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
};
tcsr@1957000 {
compatible = "qcom,tcsr";
reg = <0x1957000 0x100>;
qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
};
mdio@90000 {
status = "okay";
};
ess-switch@c000000 {
status = "okay";
};
ess-psgmii@98000 {
status = "okay";
};
edma@c080000 {
status = "okay";
};
wifi0: wifi@a000000 {
status = "ok";
core-id = <0x0>;
qca,msi_addr = <0x0b006040>;
qca,msi_base = <0x40>;
wifi_led_num = <2>; /* Wifi 2G */
wifi_led_source = <0>; /* source id 0 */
qcom,mtd-name = "0:ART";
qcom,cal-offset = <0x1000>;
qcom,cal-len = <12064>;
};
wifi1: wifi@a800000 {
status = "disabled";
};
};
gpio-keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
gpio-leds {
compatible = "gpio-leds";
power: status {
label = "rt-acrh17:blue:status";
gpios = <&tlmm 40 GPIO_ACTIVE_LOW>;
};
lan1 {
label = "rt-acrh17:blue:lan1";
gpios = <&tlmm 45 GPIO_ACTIVE_LOW>;
};
lan2 {
label = "rt-acrh17:blue:lan2";
gpios = <&tlmm 43 GPIO_ACTIVE_LOW>;
};
lan3 {
label = "rt-acrh17:blue:lan3";
gpios = <&tlmm 42 GPIO_ACTIVE_LOW>;
};
lan4 {
label = "rt-acrh17:blue:lan4";
gpios = <&tlmm 49 GPIO_ACTIVE_LOW>;
};
wan_blue {
label = "rt-acrh17:blue:wan";
gpios = <&tlmm 61 GPIO_ACTIVE_HIGH>;
};
wan_red {
label = "rt-acrh17:red:wan";
gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>;
};
wlan2g {
label = "rt-acrh17:blue:wlan2g";
gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
};
wlan5g {
label = "rt-acrh17:blue:wlan5g";
gpios = <&tlmm 54 GPIO_ACTIVE_LOW>;
};
};
};
&nand_pins {
pullups {
pins = "gpio53", "gpio58",
"gpio59";
function = "qpic";
bias-pull-up;
};
pulldowns {
pins = "gpio55", "gpio56",
"gpio57", "gpio60",
"gpio62", "gpio63", "gpio64",
"gpio65", "gpio66", "gpio67",
"gpio69";
function = "qpic";
bias-pull-down;
};
};
&i2c_0_pins {
pinmux {
function = "blsp_i2c0";
pins = "gpio10";
};
pinconf {
pins = "gpio10";
drive-strength = <16>;
bias-disable;
};
};

View File

@ -194,6 +194,25 @@ define Device/asus_rt-ac58u
endef
TARGET_DEVICES += asus_rt-ac58u
define Device/asus_rt-acrh17
$(call Device/FitImageLzma)
DEVICE_DTS := qcom-ipq4019-rt-acrh17
BLOCKSIZE := 128k
PAGESIZE := 2048
DTB_SIZE := 65536
BOARD_NAME := rt-acrh17
KERNEL_LOADADDR := 0x80208000
DEVICE_TITLE := Asus RT-ACRH17
IMAGE_SIZE := 20439364
FILESYSTEMS := squashfs
UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC82U')
IMAGES = sysupgrade.tar flash-factory.trx
IMAGE/flash-factory.trx := copy-file $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) | uImage none
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES := ath10k-firmware-qca4019 ath10k-firmware-qca9984
endef
TARGET_DEVICES += asus_rt-acrh17
define Device/openmesh_a42
$(call Device/FitImageLzma)
DEVICE_DTS := qcom-ipq4019-a42

View File

@ -10,13 +10,14 @@ Signed-off-by: John Crispin <john@phrozen.org>
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -618,7 +618,18 @@ dtb-$(CONFIG_ARCH_QCOM) += \
@@ -618,7 +618,19 @@ dtb-$(CONFIG_ARCH_QCOM) += \
qcom-apq8084-mtp.dtb \
qcom-ipq4019-ap.dk01.1-c1.dtb \
qcom-ipq4019-ap.dk04.1-c1.dtb \
+ qcom-ipq4019-fritz4040.dtb \
+ qcom-ipq4019-a42.dtb \
+ qcom-ipq4019-rt-ac58u.dtb \
+ qcom-ipq4019-rt-acrh17.dtb \
qcom-ipq8064-ap148.dtb \
+ qcom-ipq8064-c2600.dtb \
+ qcom-ipq8064-d7800.dtb \

File diff suppressed because it is too large Load Diff