diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx index 4eae506fb11b0..d475e56629941 100644 --- a/package/boot/uboot-envtools/files/ipq40xx +++ b/package/boot/uboot-envtools/files/ipq40xx @@ -31,7 +31,8 @@ ubootenv_mtdinfo () { } case "$board" in -openmesh,a42) +openmesh,a42 |\ +openmesh,a62) ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000" ;; esac diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile index 79af6b7f11df4..6b81e1a00bbc9 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-firmware -PKG_SOURCE_DATE:=2018-02-09 -PKG_SOURCE_VERSION:=8f4bafdd400d21a65966004d0ce6e0686ef4d9bc -PKG_MIRROR_HASH:=4f4f0678b9d07c0282f18c69bd63a5e2a2ae015b9ce7298cedb88a60be87ed3a +PKG_SOURCE_DATE:=2018-04-19 +PKG_SOURCE_VERSION:=71e50312b54cc972657a7b08c470088447cb9676 +PKG_MIRROR_HASH:=726e7bce9917532e3b39ced6a17ca2d4c39fdf4c9bec4a3f8f2ea3e5defa6a54 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index 38e8e3ff3fc53..dad70b2ea0d62 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -7,7 +7,7 @@ # usage() { - echo "Usage: $0 " + echo "Usage: $0 " rm -f $CFG_OUT exit 1 } @@ -44,6 +44,14 @@ case $CE_TYPE in SIZE_FACTOR=1024 SIZE_FORMAT="0x%08x" ;; + A62) + MAX_PART_SIZE=15552 + KERNEL_FLASH_ADDR=0x1a0000 + FLASH_BS=65536 + MD5_SKIP_BLOCKS=4 + SIZE_FACTOR=1024 + SIZE_FORMAT="0x%08x" + ;; *) echo "Error - unsupported ce type: $CE_TYPE" exit 1 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 ade1b054583ed..cbccbf92ef44c 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -38,7 +38,8 @@ glinet,gl-b1300) ucidef_add_switch "switch0" \ "0u@eth0" "3:lan" "4:lan" ;; -openmesh,a42) +openmesh,a42 |\ +openmesh,a62) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; meraki,mr33 |\ 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 0a5780cbf0a0f..1eb93ba41db05 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 @@ -110,6 +110,13 @@ case "$FIRMWARE" in ;; esac ;; +"ath10k/pre-cal-pci-0000:01:00.0.bin") + case "$board" in + openmesh,a62) + ath10kcal_extract "0:ART" 36864 12064 + ;; + esac + ;; "ath10k/pre-cal-ahb-a000000.wifi.bin") case "$board" in 8dev,jalapeno |\ @@ -135,7 +142,8 @@ case "$FIRMWARE" in ath10kcal_patch_mac_crc $(mtd_get_mac_binary dnidata 0) ;; compex,wpj428 |\ - openmesh,a42) + openmesh,a42 |\ + openmesh,a62) ath10kcal_extract "0:ART" 4096 12064 ;; esac @@ -165,7 +173,8 @@ case "$FIRMWARE" in ath10kcal_patch_mac_crc $(mtd_get_mac_binary dnidata 12) ;; compex,wpj428 |\ - openmesh,a42) + openmesh,a42 |\ + openmesh,a62) ath10kcal_extract "0:ART" 20480 12064 ;; esac diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh index 71ab247ead141..f7aed7c9b6452 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh @@ -47,6 +47,9 @@ platform_do_upgrade_openmesh() { openmesh,a42) primary_kernel_mtd=8 ;; + openmesh,a62) + primary_kernel_mtd=10 + ;; *) echo "failed to detect primary kernel mtd partition for board" return 1 diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 5493c47b63208..4096e127ea9ea 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -39,7 +39,8 @@ platform_do_upgrade() { CI_KERNPART="linux" nand_do_upgrade "$1" ;; - openmesh,a42) + openmesh,a42 |\ + openmesh,a62) PART_NAME="inactive" platform_do_upgrade_openmesh "$ARGV" ;; diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts index d365a7e530412..20330afc664f3 100644 --- a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts +++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts @@ -25,27 +25,6 @@ model = "OpenMesh A42"; compatible = "openmesh,a42", "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"; diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi index 14c1caa969895..dd0098eb8bd7c 100644 --- a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi +++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi @@ -25,22 +25,6 @@ model = "Netgear EX61X0v2"; compatible = "netgear,ex61x0v2", "qcom,ipq4019"; - reserved-memory { - #address-cells = <0x1>; - #size-cells = <0x1>; - ranges; - - smem@87e00000 { - reg = <0x87e00000 0x080000>; - no-map; - }; - - tz@87e80000 { - reg = <0x87e80000 0x180000>; - no-map; - }; - }; - soc { mdio@90000 { status = "okay"; diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-fritz4040.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-fritz4040.dts index 4b5cbcac33b71..3768cd87b9d83 100644 --- a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-fritz4040.dts +++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-fritz4040.dts @@ -31,27 +31,6 @@ led-upgrade = &flash; }; - reserved-memory { - #address-cells = <0x1>; - #size-cells = <0x1>; - ranges; - - tz_apps@87b80000 { - reg = <0x87b80000 0x280000>; - reusable; - }; - - smem@87e00000 { - reg = <0x87e00000 0x080000>; - no-map; - }; - - tz@87e80000 { - reg = <0x87e80000 0x180000>; - no-map; - }; - }; - soc { mdio@90000 { status = "okay"; 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 index 7e2bdcc7cda60..ee203b0f1e24a 100644 --- 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 @@ -25,27 +25,6 @@ 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"; diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts index 446da0451b108..e0bb968f5bb46 100644 --- a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts +++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts @@ -36,22 +36,6 @@ led-upgrade = &power; }; - reserved-memory { - #address-cells = <0x1>; - #size-cells = <0x1>; - ranges; - - smem@87e00000 { - reg = <0x87e00000 0x080000>; - no-map; - }; - - tz@87e80000 { - reg = <0x87e80000 0x180000>; - no-map; - }; - }; - soc { mdio@90000 { status = "okay"; diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-a62.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-a62.dts new file mode 100644 index 0000000000000..dd6d6bd775799 --- /dev/null +++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-a62.dts @@ -0,0 +1,240 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, Sven Eckelmann + * + * 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 = "OpenMesh A62"; + compatible = "openmesh,a62", "qcom,ipq4019"; + + soc { + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + 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"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + switch_lan_bmp = <0x10>; + switch_wan_bmp = <0x20>; + + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + aliases { + led-boot = &power; + led-failsafe = &power; + led-running = &power; + led-upgrade = &power; + }; + + gpio-leds { + compatible = "gpio-leds"; + + red { + label = "a62:red:status"; + gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-off"; + }; + + power: green { + label = "a62:green:status"; + gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>; + }; + + blue { + label = "a62:blue:status"; + gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-off"; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&tlmm 59 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + enable-usb-power { + gpio-hog; + gpios = <58 GPIO_ACTIVE_HIGH>; + output-low; + line-name = "enable USB2 power"; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&spi_0 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + /* partitions are passed via bootloader */ + }; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; + + pcie@0 { + reg = <0 0 0 0 0>; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + + ath10k@0,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0 0 0 0 0>; + device_type = "pci"; + qcom,ath10k-calibration-variant = "OM-A62"; + }; + }; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "OM-A62"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "OM-A62"; +}; diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts index 88ea370858859..f9f0f96ae9c9a 100644 --- a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts +++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts @@ -26,27 +26,6 @@ model = "Compex WPJ428"; compatible = "compex,wpj428", "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"; diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts index c4b002bdd67bb..b55d9453bf82d 100644 --- a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts +++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts @@ -35,47 +35,6 @@ reg = <0x80000000 0x10000000>; }; - reserved-memory { - #address-cells = <0x1>; - #size-cells = <0x1>; - ranges; - - apps_bl@87000000 { - reg = <0x87000000 0x400000>; - no-map; - }; - - sbl@87400000 { - reg = <0x87400000 0x100000>; - no-map; - }; - - cnss_debug@87500000 { - reg = <0x87500000 0x600000>; - no-map; - }; - - cpu_context_dump@87b00000 { - reg = <0x87b00000 0x080000>; - no-map; - }; - - 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"; diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-mr33.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-mr33.dts index a709ae96bd0cd..8bbfb0ba0bb1e 100644 --- a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-mr33.dts +++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-mr33.dts @@ -34,27 +34,6 @@ reg = <0x80000000 0x10000000>; }; - reserved-memory { - #address-cells = <0x1>; - #size-cells = <0x1>; - ranges; - - tz_apps@87b80000 { - reg = <0x87b80000 0x280000>; - reusable; - }; - - smem@87e00000 { - reg = <0x87e00000 0x080000>; - no-map; - }; - - tz@87e80000 { - reg = <0x87e80000 0x180000>; - no-map; - }; - }; - soc { mdio@90000 { status = "okay"; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 058cab339961a..45e8bd993a774 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -163,6 +163,22 @@ define Device/openmesh_a42 endef TARGET_DEVICES += openmesh_a42 +define Device/openmesh_a62 + $(call Device/FitImageLzma) + DEVICE_DTS := qcom-ipq4019-a62 + DEVICE_DTS_CONFIG := config@om.a62 + BLOCKSIZE := 64k + DEVICE_TITLE := OpenMesh A62 + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15552k + IMAGES = factory.bin sysupgrade.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9888 uboot-envtools +endef + +TARGET_DEVICES += openmesh_a62 + define Device/qcom_ap-dk01.1-c1 DEVICE_TITLE := QCA AP-DK01.1-C1 BOARD_NAME := ap-dk01.1-c1 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 99417d3e36cc3..5b9317eb0eee4 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,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -697,7 +697,17 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -697,7 +697,18 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -21,6 +21,7 @@ Signed-off-by: John Crispin + qcom-ipq4018-jalapeno.dtb \ + qcom-ipq4018-rt-ac58u.dtb \ qcom-ipq4019-ap.dk01.1-c1.dtb \ ++ qcom-ipq4019-a62.dtb \ + qcom-ipq4019-ap.dk04.1-c1.dtb \ + qcom-ipq4028-wpj428.dtb \ + qcom-ipq4029-gl-b1300.dtb \ diff --git a/target/linux/ipq40xx/patches-4.14/105-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch b/target/linux/ipq40xx/patches-4.14/105-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch new file mode 100644 index 0000000000000..820a1bffcd28d --- /dev/null +++ b/target/linux/ipq40xx/patches-4.14/105-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch @@ -0,0 +1,269 @@ +From: Christian Lamparter +Date: Thu, 12 Apr 2018 21:01:38 +0200 +Subject: [PATCH] pinctrl: msm: fix gpio-hog related boot issues + +Sven Eckelmann reported an issue with the current IPQ4019 pinctrl. +Setting up any gpio-hog in the device-tree for his device would +"kill the bootup completely": + +| [ 0.477838] msm_serial 78af000.serial: could not find pctldev for node /soc/pinctrl@1000000/serial_pinmux, deferring probe +| [ 0.499828] spi_qup 78b5000.spi: could not find pctldev for node /soc/pinctrl@1000000/spi_0_pinmux, deferring probe +| [ 1.298883] requesting hog GPIO enable USB2 power (chip 1000000.pinctrl, offset 58) failed, -517 +| [ 1.299609] gpiochip_add_data: GPIOs 0..99 (1000000.pinctrl) failed to register +| [ 1.308589] ipq4019-pinctrl 1000000.pinctrl: Failed register gpiochip +| [ 1.316586] msm_serial 78af000.serial: could not find pctldev for node /soc/pinctrl@1000000/serial_pinmux, deferring probe +| [ 1.322415] spi_qup 78b5000.spi: could not find pctldev for node /soc/pinctrl@1000000/spi_0_pinmux, deferri + +This was also verified on a RT-AC58U (IPQ4018) which would +no longer boot, if a gpio-hog was specified. (Tried forcing +the USB LED PIN (GPIO0) to high.). + +The problem is that Pinctrl+GPIO registration is currently +peformed in the following order in pinctrl-msm.c: + 1. pinctrl_register() + 2. gpiochip_add() + 3. gpiochip_add_pin_range() + +The actual error code -517 == -EPROBE_DEFER is coming from +pinctrl_get_device_gpio_range(), which is called through: + gpiochip_add + of_gpiochip_add + of_gpiochip_scan_gpios + gpiod_hog + gpiochip_request_own_desc + __gpiod_request + chip->request + gpiochip_generic_request + pinctrl_gpio_request + pinctrl_get_device_gpio_range + +pinctrl_get_device_gpio_range() is unable to find any valid +pin ranges, since nothing has been added to the pinctrldev_list yet. +so the range can't be found, and the operation fails with -EPROBE_DEFER. + +This patch fixes the issue by adding the "gpio-ranges" property to +the pinctrl device node of all upstream Qcom SoC. The pin ranges are +then added by the gpio core. + +In order to remain compatible with older, existing DTs (and ACPI) +a check for the "gpio-ranges" property has been added to +msm_gpio_init(). This prevents the driver of adding the same entry +to the pinctrldev_list twice. + +Reported-by: Sven Eckelmann +Signed-off-by: Christian Lamparter + +Origin: other, https://patchwork.kernel.org/patch/10339127/ +--- + arch/arm/boot/dts/qcom-apq8064.dtsi | 1 + + arch/arm/boot/dts/qcom-apq8084.dtsi | 1 + + arch/arm/boot/dts/qcom-ipq4019.dtsi | 1 + + arch/arm/boot/dts/qcom-ipq8064.dtsi | 1 + + arch/arm/boot/dts/qcom-mdm9615.dtsi | 1 + + arch/arm/boot/dts/qcom-msm8660.dtsi | 1 + + arch/arm/boot/dts/qcom-msm8960.dtsi | 1 + + arch/arm/boot/dts/qcom-msm8974.dtsi | 1 + + arch/arm64/boot/dts/qcom/ipq8074.dtsi | 3 ++- + arch/arm64/boot/dts/qcom/msm8916.dtsi | 1 + + arch/arm64/boot/dts/qcom/msm8992.dtsi | 1 + + arch/arm64/boot/dts/qcom/msm8994.dtsi | 1 + + arch/arm64/boot/dts/qcom/msm8996.dtsi | 1 + + drivers/pinctrl/qcom/pinctrl-msm.c | 23 ++++++++++++++++++----- + 14 files changed, 32 insertions(+), 6 deletions(-) + +diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi +index 6089c8d56cd549c6476a519bb5efe82f29258315..131e27308d01e9af5fd8fd0c7dcbee658dbb5fae 100644 +--- a/arch/arm/boot/dts/qcom-apq8064.dtsi ++++ b/arch/arm/boot/dts/qcom-apq8064.dtsi +@@ -327,6 +327,7 @@ + reg = <0x800000 0x4000>; + + gpio-controller; ++ gpio-ranges = <&tlmm_pinmux 0 0 90>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; +diff --git a/arch/arm/boot/dts/qcom-apq8084.dtsi b/arch/arm/boot/dts/qcom-apq8084.dtsi +index 0e1e98707e3f25602bbe35b12a5e93891fc1ee17..d9481d0838024c8bd395dccdd091c4961c3c896e 100644 +--- a/arch/arm/boot/dts/qcom-apq8084.dtsi ++++ b/arch/arm/boot/dts/qcom-apq8084.dtsi +@@ -396,6 +396,7 @@ + compatible = "qcom,apq8084-pinctrl"; + reg = <0xfd510000 0x4000>; + gpio-controller; ++ gpio-ranges = <&tlmm 0 0 147>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; +diff --git a/arch/arm/boot/dts/qcom-ipq4019.dtsi b/arch/arm/boot/dts/qcom-ipq4019.dtsi +index 10d112a4078ecef3c1a70dc3482de7a7511e599b..9a81d2da87a0ff79fd816bd09ffbb35ad45db561 100644 +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -146,6 +146,7 @@ + compatible = "qcom,ipq4019-pinctrl"; + reg = <0x01000000 0x300000>; + gpio-controller; ++ gpio-ranges = <&tlmm 0 0 100>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; +diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi +index 1e0a3b446f7a8ab7a6625dd7cfe093251b73c7bc..26eab9a68d90646e23946fbe724bba66eb261f4f 100644 +--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi +@@ -108,6 +108,7 @@ + reg = <0x800000 0x4000>; + + gpio-controller; ++ gpio-ranges = <&qcom_pinmux 0 0 69>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; +diff --git a/arch/arm/boot/dts/qcom-mdm9615.dtsi b/arch/arm/boot/dts/qcom-mdm9615.dtsi +index c852b69229c977281a6f7e7192d88c3275e80817..cfdaca5f259acc1b9ad2796f4fcae17cc66618d5 100644 +--- a/arch/arm/boot/dts/qcom-mdm9615.dtsi ++++ b/arch/arm/boot/dts/qcom-mdm9615.dtsi +@@ -128,6 +128,7 @@ + msmgpio: pinctrl@800000 { + compatible = "qcom,mdm9615-pinctrl"; + gpio-controller; ++ gpio-ranges = <&msmgpio 0 0 88>; + #gpio-cells = <2>; + interrupts = ; + interrupt-controller; +diff --git a/arch/arm/boot/dts/qcom-msm8660.dtsi b/arch/arm/boot/dts/qcom-msm8660.dtsi +index 221c4584552f9df40ababa4dc3cc22c2216d0811..526c6cbce86a15eca5da2546221d49903998746c 100644 +--- a/arch/arm/boot/dts/qcom-msm8660.dtsi ++++ b/arch/arm/boot/dts/qcom-msm8660.dtsi +@@ -110,6 +110,7 @@ + reg = <0x800000 0x4000>; + + gpio-controller; ++ gpio-ranges = <&tlmm 0 0 173>; + #gpio-cells = <2>; + interrupts = <0 16 0x4>; + interrupt-controller; +diff --git a/arch/arm/boot/dts/qcom-msm8960.dtsi b/arch/arm/boot/dts/qcom-msm8960.dtsi +index 1733d8f40ab15ddf39f2ad716d8b00e5c5dbb759..f6d8b1af5a8a9ce186628589f95cb70ef412b261 100644 +--- a/arch/arm/boot/dts/qcom-msm8960.dtsi ++++ b/arch/arm/boot/dts/qcom-msm8960.dtsi +@@ -102,6 +102,7 @@ + msmgpio: pinctrl@800000 { + compatible = "qcom,msm8960-pinctrl"; + gpio-controller; ++ gpio-ranges = <&msmgpio 0 0 152>; + #gpio-cells = <2>; + interrupts = <0 16 0x4>; + interrupt-controller; +diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi +index 33002fed8cc3023d4e08a4f942c9bd0193439be5..b6ca0a1efb02fae77e67623549f9b7cc055b9c87 100644 +--- a/arch/arm/boot/dts/qcom-msm8974.dtsi ++++ b/arch/arm/boot/dts/qcom-msm8974.dtsi +@@ -682,6 +682,7 @@ + compatible = "qcom,msm8974-pinctrl"; + reg = <0xfd510000 0x4000>; + gpio-controller; ++ gpio-ranges = <&msmgpio 0 0 146>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; +diff --git a/arch/arm64/boot/dts/qcom/ipq8074.dtsi b/arch/arm64/boot/dts/qcom/ipq8074.dtsi +index 2bc5dec5614dec40962e987e0646321a888d4549..d2c36b4674660b36ba3365400b6806a274cc9fc0 100644 +--- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi ++++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi +@@ -24,11 +24,12 @@ + ranges = <0 0 0 0xffffffff>; + compatible = "simple-bus"; + +- pinctrl@1000000 { ++ tlmm: pinctrl@1000000 { + compatible = "qcom,ipq8074-pinctrl"; + reg = <0x1000000 0x300000>; + interrupts = ; + gpio-controller; ++ gpio-ranges = <&tlmm 0 0 70>; + #gpio-cells = <0x2>; + interrupt-controller; + #interrupt-cells = <0x2>; +diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi +index dc3817593e144708a514a5605491801056e662ab..7d5ee4e6a62a8e5c145dc87259391a3340ad667e 100644 +--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi ++++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi +@@ -276,6 +276,7 @@ + reg = <0x1000000 0x300000>; + interrupts = ; + gpio-controller; ++ gpio-ranges = <&msmgpio 0 0 122>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; +diff --git a/arch/arm64/boot/dts/qcom/msm8992.dtsi b/arch/arm64/boot/dts/qcom/msm8992.dtsi +index 171578747ed083873d19e5c2152bea18d319f1e7..173b6bc60816bd13f960d290bbe9dac2b1a404b9 100644 +--- a/arch/arm64/boot/dts/qcom/msm8992.dtsi ++++ b/arch/arm64/boot/dts/qcom/msm8992.dtsi +@@ -179,6 +179,7 @@ + reg = <0xfd510000 0x4000>; + interrupts = ; + gpio-controller; ++ gpio-ranges = <&msmgpio 0 0 146>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; +diff --git a/arch/arm64/boot/dts/qcom/msm8994.dtsi b/arch/arm64/boot/dts/qcom/msm8994.dtsi +index f33c41d01c8604260b643fac7c4e076d34291bf3..68705db4696bdd5ae7e0495c92e85cffdd4fc96a 100644 +--- a/arch/arm64/boot/dts/qcom/msm8994.dtsi ++++ b/arch/arm64/boot/dts/qcom/msm8994.dtsi +@@ -141,6 +141,7 @@ + reg = <0xfd510000 0x4000>; + interrupts = ; + gpio-controller; ++ gpio-ranges = <&msmgpio 0 0 146>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; +diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi +index 887b61c872dd15b697e4d1969b26be5010a18d4e..2be05e22fa1dc81932bbda7630c95d8cc4eedb94 100644 +--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi ++++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi +@@ -517,6 +517,7 @@ + reg = <0x01010000 0x300000>; + interrupts = ; + gpio-controller; ++ gpio-ranges = <&msmgpio 0 0 150>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; +diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c +index ff491da64dab8420298c9e00d22eddac908b310c..75030f4b57e06a05490d60108bb9195906ea8c76 100644 +--- a/drivers/pinctrl/qcom/pinctrl-msm.c ++++ b/drivers/pinctrl/qcom/pinctrl-msm.c +@@ -831,11 +831,24 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl) + return ret; + } + +- ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev), 0, 0, chip->ngpio); +- if (ret) { +- dev_err(pctrl->dev, "Failed to add pin range\n"); +- gpiochip_remove(&pctrl->chip); +- return ret; ++ /* ++ * For DeviceTree-supported systems, the gpio core checks the ++ * pinctrl's device node for the "gpio-ranges" property. ++ * If it is present, it takes care of adding the pin ranges ++ * for the driver. In this case the driver can skip ahead. ++ * ++ * In order to remain compatible with older, existing DeviceTree ++ * files which don't set the "gpio-ranges" property or systems that ++ * utilize ACPI the driver has to call gpiochip_add_pin_range(). ++ */ ++ if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) { ++ ret = gpiochip_add_pin_range(&pctrl->chip, ++ dev_name(pctrl->dev), 0, 0, chip->ngpio); ++ if (ret) { ++ dev_err(pctrl->dev, "Failed to add pin range\n"); ++ gpiochip_remove(&pctrl->chip); ++ return ret; ++ } + } + + ret = gpiochip_irqchip_add(chip, diff --git a/target/linux/ipq40xx/patches-4.14/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch b/target/linux/ipq40xx/patches-4.14/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch index e9d262069f7e3..a358a56eae69b 100644 --- a/target/linux/ipq40xx/patches-4.14/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch +++ b/target/linux/ipq40xx/patches-4.14/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts +++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts -@@ -19,4 +19,112 @@ +@@ -19,4 +19,71 @@ / { model = "Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C1"; @@ -8,47 +8,6 @@ + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; -+ -+ reserved-memory { -+ #address-cells = <0x1>; -+ #size-cells = <0x1>; -+ ranges; -+ -+ apps_bl@87000000 { -+ reg = <0x87000000 0x400000>; -+ no-map; -+ }; -+ -+ sbl@87400000 { -+ reg = <0x87400000 0x100000>; -+ no-map; -+ }; -+ -+ cnss_debug@87500000 { -+ reg = <0x87500000 0x600000>; -+ no-map; -+ }; -+ -+ cpu_context_dump@87b00000 { -+ reg = <0x87b00000 0x080000>; -+ no-map; -+ }; -+ -+ tz_apps@87b80000 { -+ reg = <0x87b80000 0x280000>; -+ no-map; -+ }; -+ -+ smem@87e00000 { -+ reg = <0x87e00000 0x080000>; -+ no-map; -+ }; -+ -+ tz@87e80000 { -+ reg = <0x87e80000 0x180000>; -+ no-map; -+ }; -+ }; +}; + +&spi_0 { diff --git a/target/linux/ipq40xx/patches-4.14/865-ARM-dts-ipq4019-Add-TZ-and-SMEM-reserved-regions.patch b/target/linux/ipq40xx/patches-4.14/865-ARM-dts-ipq4019-Add-TZ-and-SMEM-reserved-regions.patch new file mode 100644 index 0000000000000..56ae66b0897a8 --- /dev/null +++ b/target/linux/ipq40xx/patches-4.14/865-ARM-dts-ipq4019-Add-TZ-and-SMEM-reserved-regions.patch @@ -0,0 +1,88 @@ +From fc566294610fa49e9d8c31c4ecc9c82f49b11f59 Mon Sep 17 00:00:00 2001 +From: Sven Eckelmann +Date: Wed, 18 Apr 2018 09:10:44 +0200 +Subject: [PATCH] ARM: dts: ipq4019: Add TZ and SMEM reserved regions + +The QSEE (trustzone) is started on IPQ4019 before Linux is started. +According to QCA, it is placed in in the the memory region +0x87e80000-0x88000000 and must not be accessed directly. There is an +additional memory region 0x87e00000-0x87E80000 smem which which can be used +for communication with the TZ. The driver for the latter is not yet ready +but it is still not allowed to use this memory region like any other +memory region. + +Not reserving this memory region either leads to kernel crashes, kernel +hangs (often during the boot) or bus errors for userspace programs. The +latter happens when a program is using a memory region which is mapped to +these physical memory regions. + + [ 571.758058] Unhandled fault: imprecise external abort (0xc06) at 0x01715ff8 + [ 571.758099] pgd = cebec000 + [ 571.763826] [01715ff8] *pgd=8e7fa835, *pte=87e7f75f, *ppte=87e7fc7f + Bus error + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.kernel.org/patch/10347459/ +--- +Cc: Sricharan Ramabadhran +Cc: Senthilkumar N L + +There are additional memory regions which have to be initialized first by +Linux. So they are currently not used. We were told by QCA that the +features QSDK uses them for are: + +* crash dump feature + - a couple of regions used when 'qca,scm_restart_reason' dt node has the + value 'dload_status' not set to 1 + + apps_bl <0x87000000 0x400000> + + sbl <0x87400000 0x100000> + + cnss_debug <0x87400000 0x100000> + + cpu_context_dump <0x87b00000 0x080000> + - required driver not available in Linux + - safe to remove +* QSEE app execution + - region tz_apps <0x87b80000 0x280000> + - required driver not available in Linux + - safe to remove +* communication with TZ/QSEE + - region smem <0x87b80000 0x280000> + - driver changes not yet upstreamed + - must not be removed because any access can crash kernel/program +* trustzone (QSEE) private memory + - region tz <0x87e80000 0x180000> + - must not be removed because any access can crash kernel/program + +The problem with the missing regions was reported in 2016 [1]. So maybe +this change qualifies for a stable@vger.kernel.org submission. + +[1] https://www.spinics.net/lists/linux-arm-msm/msg21536.html +--- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -23,6 +23,22 @@ + compatible = "qcom,ipq4019"; + interrupt-parent = <&intc>; + ++ reserved-memory { ++ #address-cells = <0x1>; ++ #size-cells = <0x1>; ++ ranges; ++ ++ smem_region: smem@87e00000 { ++ reg = <0x87e00000 0x080000>; ++ no-map; ++ }; ++ ++ tz@87e80000 { ++ reg = <0x87e80000 0x180000>; ++ no-map; ++ }; ++ }; ++ + aliases { + spi0 = &spi_0; + spi1 = &spi_1;