From 1e341bb5ef9ba342a56ad2765c2876091fdc66db Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 11 Apr 2018 11:14:36 +0200 Subject: [PATCH] ipq40xx: add support for 8devices Jalapeno MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds support for 8devices Jalapeno. Specification: QCA IPQ4018, Quad core ARM v7 Cortex A7 717MHz 256 MB of DDR3 RAM 8 MB of SPI NOR flash 128 MB of Winbond SPI NAND flash WLAN1: Qualcomm Atheros QCA4018 2.4GHz 802.11bgn 2:2x2 requires special BDF in QCA4019/hw1.0/board-2.bin with: bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=8devices-Jalapeno WLAN2: Qualcomm Atheros QCA4018 5GHz 802.11a/n/ac 2:2x2 requires special BDF in QCA4019/hw1.0/board-2.bin with: bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=8devices-Jalapeno ETH: Qualcomm Atheros QCA8072 Gigabit Switch (1 x LAN, 1 x WAN) phy@mdio3: Label: eth0 gmac0 phy@mdio4: Label: eth1 gmac1 Installation instructions: Since boards ship with old version of LEDE installation is simple. Just use sysupgrade -n -F sysupgrade.bin Syuspgrade needs to be forced since OpenWRT uses DT detection in recent releases. If you get error that FIT configuration is not found during boot it is due to older U-boot used on your board. That is because 8devices used custom FIT configuration partition name as they internally had v1 and v2 boards. Only v2 boards are sold so now they are shipping boards with never U-boot using generic config@1 FIT partition name. Also for old uboot it is possible to force loading config@1 by changing uboot environment: setenv boot5 'bootm 0x84000000#config@1’ saveenv Signed-off-by: Robert Marko --- .../ipq40xx/base-files/etc/board.d/02_network | 3 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 18 +- .../base-files/lib/upgrade/platform.sh | 3 + .../arm/boot/dts/qcom-ipq4018-jalapeno.dts | 288 ++++++++++++++++++ target/linux/ipq40xx/image/Makefile | 11 + .../069-arm-boot-add-dts-files.patch | 3 +- 6 files changed, 317 insertions(+), 9 deletions(-) create mode 100644 target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dts diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index a53e2860ad..91343cd4b4 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -12,6 +12,9 @@ board_config_update board=$(board_name) case "$board" in +8dev,jalapeno) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ;; asus,rt-ac58u) CI_UBIPART=UBI_DEV wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486) diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 969983e6b9..56c10cbf00 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -112,6 +112,11 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-ahb-a000000.wifi.bin") case "$board" in + 8dev,jalapeno |\ + glinet,gl-b1300 |\ + qcom,ap-dk01.1-c1) + ath10kcal_extract "ART" 4096 12064 + ;; asus,rt-ac58u) CI_UBIPART=UBI_DEV ath10kcal_ubi_extract "Factory" 4096 12064 @@ -119,10 +124,6 @@ case "$FIRMWARE" in avm,fritzbox-4040) /usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config") ;; - glinet,gl-b1300 |\ - qcom,ap-dk01.1-c1) - ath10kcal_extract "ART" 4096 12064 - ;; meraki,mr33) ath10kcal_ubi_extract "ART" 4096 12064 ath10kcal_is_caldata_valid "202f" || ath10kcal_extract "ART" 4096 12064 @@ -136,6 +137,11 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-ahb-a800000.wifi.bin") case "$board" in + 8dev,jalapeno |\ + glinet,gl-b1300 |\ + qcom,ap-dk01.1-c1) + ath10kcal_extract "ART" 20480 12064 + ;; asus,rt-ac58u) CI_UBIPART=UBI_DEV ath10kcal_ubi_extract "Factory" 20480 12064 @@ -143,10 +149,6 @@ case "$FIRMWARE" in avm,fritzbox-4040) /usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config") ;; - glinet,gl-b1300 |\ - qcom,ap-dk01.1-c1) - ath10kcal_extract "ART" 20480 12064 - ;; meraki,mr33) ath10kcal_ubi_extract "ART" 20480 12064 ath10kcal_is_caldata_valid "202f" || ath10kcal_extract "ART" 20480 12064 diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 52aa2321e3..5493c47b63 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -31,6 +31,9 @@ EOF platform_do_upgrade() { case "$(board_name)" in + 8dev,jalapeno) + nand_do_upgrade "$ARGV" + ;; asus,rt-ac58u) CI_UBIPART="UBI_DEV" CI_KERNPART="linux" diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dts new file mode 100644 index 0000000000..7e2bdcc7cd --- /dev/null +++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dts @@ -0,0 +1,288 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2018, Robert Marko + * + * 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.dtsi" +#include "qcom-ipq4019-bus.dtsi" +#include +#include +#include + +/ { + model = "8devices Jalapeno"; + compatible = "8dev,jalapeno", "qcom,ipq4019"; + + reserved-memory { + #address-cells = <0x1>; + #size-cells = <0x1>; + ranges; + + tz_apps@87b80000 { + reg = <0x87b80000 0x280000>; + no-map; + }; + + smem@87e00000 { + reg = <0x87e00000 0x080000>; + no-map; + }; + + tz@87e80000 { + reg = <0x87e80000 0x180000>; + no-map; + }; + }; + + soc { + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2: usb2@60f8800 { + status = "okay"; + }; + + serial@78af000 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; + }; + + usb3: usb3@8af8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + switch_lan_bmp = <0x10>; /* lan port bitmap */ + }; + + edma@c080000 { + status = "okay"; + }; + }; +}; + +&tlmm { + mdio_pins: mdio_pinmux { + pinmux_1 { + pins = "gpio53"; + function = "mdio"; + }; + pinmux_2 { + pins = "gpio52"; + function = "mdc"; + }; + pinconf { + pins = "gpio52", "gpio53"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <2>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio54", "gpio59"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&spi_0 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, <&tlmm 59 GPIO_ACTIVE_HIGH>; + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition0@0 { + label = "SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + partition1@40000 { + label = "MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + partition2@60000 { + label = "QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + partition3@c0000 { + label = "CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + partition4@d0000 { + label = "DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + partition5@e0000 { + label = "APPSBLENV"; /* uboot env*/ + reg = <0x000e0000 0x00010000>; + read-only; + }; + partition5@f0000 { + label = "APPSBL"; /* uboot */ + reg = <0x000f0000 0x00080000>; + read-only; + }; + partition5@170000 { + label = "ART"; + reg = <0x00170000 0x00010000>; + read-only; + }; + }; + }; + + mt29f@1 { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + compatible = "spinand,mt29f", "w25n01gv"; + reg = <1>; + spi-max-frequency = <24000000>; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition0@0 { + label = "ubi"; + reg = <0x00000000 0x08000000>; + }; + }; + }; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + qcom,poll_required = <1>; + qcom,poll_required_dynamic = <1>; + qcom,phy_mdio_addr = <3>; + vlan_tag = <1 0x10>; +}; + +&gmac1 { + qcom,poll_required = <1>; + qcom,poll_required_dynamic = <1>; + qcom,phy_mdio_addr = <4>; + vlan_tag = <2 0x20>; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "8devices-Jalapeno"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "8devices-Jalapeno"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 125b3bf8e2..e3364c41cd 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -32,6 +32,17 @@ define Device/UbiFit endef +define Device/8dev_jalapeno + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_DTS := qcom-ipq4018-jalapeno + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_TITLE := 8devices Jalapeno + DEVICE_PACKAGES := ath10k-firmware-qca4019 +endef +TARGET_DEVICES += 8dev_jalapeno + define Device/asus_rt-ac58u $(call Device/FitImageLzma) DEVICE_DTS := qcom-ipq4018-rt-ac58u diff --git a/target/linux/ipq40xx/patches-4.14/069-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-4.14/069-arm-boot-add-dts-files.patch index c0bdd87fcc..9c09c1fa78 100644 --- a/target/linux/ipq40xx/patches-4.14/069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-4.14/069-arm-boot-add-dts-files.patch @@ -10,12 +10,13 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -697,7 +697,14 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -697,7 +697,15 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ + qcom-ipq4018-a42.dtb \ + qcom-ipq4018-fritz4040.dtb \ ++ qcom-ipq4018-jalapeno.dtb \ + qcom-ipq4018-rt-ac58u.dtb \ qcom-ipq4019-ap.dk01.1-c1.dtb \ + qcom-ipq4019-ap.dk04.1-c1.dtb \