New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipq40xx: add support for OpenMesh A62 #884
Conversation
* introduces the BDFs in /lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin for: - 8devices Jalapeno - Asus RT-AC58U - AVM FRITZ!Box 4040 - GL.iNet GL-B1300 - Meraki MR33 - Netgear EX6100v2 - Netgear EX6150v2 - OpenMesh A62 * introduces the BDFs in /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin - OpenMesh A62 * adds new firmware for QCA6174 hw3.0 - firmware-6.bin_RM.4.4.1.c1-00038-QCARMSWP-1 - firmware-6.bin_RM.4.4.1.c1-00041-QCARMSWP-1 * various undocumented BDF updates to: - QCA4019 hw1.0: + bus=ahb,bmi-chip-id=0,bmi-board-id=16 + bus=ahb,bmi-chip-id=0,bmi-board-id=17 + bus=ahb,bmi-chip-id=0,bmi-board-id=19 + bus=ahb,bmi-chip-id=0,bmi-board-id=20 + bus=ahb,bmi-chip-id=0,bmi-board-id=21 + bus=ahb,bmi-chip-id=0,bmi-board-id=29 + bus=ahb,bmi-chip-id=0,bmi-board-id=30 - QCA9888 hw2.0: + bus=pci,bmi-chip-id=0,bmi-board-id=16 + bus=pci,bmi-chip-id=0,bmi-board-id=17 + bus=pci,bmi-chip-id=0,bmi-board-id=18 + bus=pci,bmi-chip-id=0,bmi-board-id=23 + bus=pci,bmi-chip-id=0,bmi-board-id=24 + bus=pci,bmi-chip-id=0,bmi-board-id=25 - QCA9984 hw1.0: + bus=pci,bmi-chip-id=0,bmi-board-id=1 + bus=pci,bmi-chip-id=0,bmi-board-id=3 + bus=pci,bmi-chip-id=0,bmi-board-id=5 + bus=pci,bmi-chip-id=0,bmi-board-id=6 + bus=pci,bmi-chip-id=0,bmi-board-id=7 + bus=pci,bmi-chip-id=0,bmi-board-id=8 Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
The reserved-memory regions are mostly undocumented by QCA and are named very unspecific in the QSDK device trees. It was tried to clean them up by commit 71ed9f1 ("ipq40xx: Use detailed reserved memory for A42") and similar changes. The features which require these regions were mostly unknown but Senthilkumar N L <snlakshm@qti.qualcomm.com> and Sricharan Ramabadhran <srichara@qti.qualcomm.com> provided some more insight in some of them: * 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 Removing the unnecessary regions saves some kilobyte of reserved-memory and cleans up the device tree: * 2560 KiB - 8devices Jalapeno - AVM FRITZ!Box 4040 - Compex WPJ428 - Meraki MR33 Access Point - OpenMesh A42 * 14336 KiB - GL.iNet GL-B1300 - Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C1 Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
The tz and smem reserved-memory information handled in the upstream Linux sources by the SoC specific dtsi and not by the the boards dts. Using the same approach in OpenWrt avoids unneccessary duplication. Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
The pinctrl initialization fails with the MSM pinctrl code and gpio-hogs because either the gpio ranges are not yet initialized (missing gpio-range in DT) or that the msm driver unconditionally tries to re-initializes the ranges (gpio-range in DT). To allow gpio-hogs and similar early-boot gpio code, the gpio-ranges must be in the device tree and the pinctrl-msm code must check whether the range was already initialized by the DT. Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
* QCA IPQ4019 * 256 MB of RAM * 32 MB of SPI NOR flash (s25fl256s1) - 2x 15 MB available; but one of the 15 MB regions is the recovery image * 2T2R 2.4 GHz - QCA4019 hw1.0 (SoC) - requires special BDF in QCA4019/hw1.0/board-2.bin with bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=OM-A62 * 2T2R 5 GHz (channel 36-64) - QCA9888 hw2.0 (PCI) - requires special BDF in QCA9888/hw2.0/board-2.bin bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=OM-A62 * 2T2R 5 GHz (channel 100-165) - QCA4019 hw1.0 (SoC) - requires special BDF in QCA4019/hw1.0/board-2.bin with bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=OM-A62 * multi-color LED (controlled via red/green/blue GPIOs) * 1x button (reset; kmod-input-gpio-keys compatible) * external watchdog - triggered GPIO * 1x USB (xHCI) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x gigabit ethernet - phy@mdio3: + Label: Ethernet 1 + gmac0 (ethaddr) in original firmware + 802.3at POE+ - phy@mdio4: + Label: Ethernet 2 + gmac1 (eth1addr) in original firmware + 18-24V passive POE (mode B) * powered only via POE The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the factory image to the u-boot when the device boots up. The initramfs image can be started using setenv bootargs 'loglevel=8 earlycon=msm_serial_dm,0x78af000 console=ttyMSM0,115200 mtdparts=spi0.0:256k(0:SBL1),128k(0:MIBIB),384k(0:QSEE),64k(0:CDT),64k(0:DDRPARAMS),64k(0:APPSBLENV),512k(0:APPSBL),64k(0:ART),64k(0:custom),64k(0:KEYS),15552k(inactive),15552k(inactive2)' tftpboot 0x84000000 openwrt-ipq40xx-openmesh_a62-initramfs-fit-uImage.itb set fdt_high 0x85000000 bootm 0x84000000 Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
I haven't had a look at the driver nor do I have access to a board at the moment, but can't we use I mean, the hogged GPIO is a similar workaround as gpio-export and the One benefit of using It might that the following works out of the box (update: no it doesn't, neither the dwc3 core nor dwc3-of-simple.c have vbus supply support yet):
Options are already enabled
I remember that we had a similar issue with ipq806x back in the days and we went with setting the pin output-high/output-low in the pinmux. It is neither a proper solution and just another workaround instead of using the |
As you mentioned in your mail (and also updated your ticket), external vbus-supply is currently not supported by dcw3. And yes, in theory this might be a good idea to switch to - but it is a rather bad timing the dcw3-qcom is currently upstreamed https://lkml.org/lkml/2018/4/13/508. Not sure what must be done to this driver to correctly enable/disable vbus-supply for peripheral/host mode. At least dwc3-omap.c integrated it very tight to their mailbox system. |
Merged, thanks! I cherry picked the related commits and removed the patching of the unrelated dtsi from the gpio hog patch. |
Here some additional information about the VBUS: An OC protection circuit was added between powerrail and VBUS pin of the USB connector. The gpio58 is used to control this circuit and allows to disable the power (set it to high - which it is by default). There is a capacitor and thus voltage will not drop directly when setting GPIO58 to high. |
I was just asked in private about following situation:
This means that the device is unlocked but still has the signature check key for installed. I don't know whether this was intended by Datto/OpenMesh or not. But you just have to disable the key in this case to make u-boot accessible again:
A new OpenWrt image should be installed immediately to avoid that firmware-ng reinstalls the key again. I don't actually know whether it would do that in this situation but the disabling of the key works (see Datto's u-boot GPL source code for more details). |
@ecsv here is also related OpenWrt forum topic: https://forum.openwrt.org/t/openwrt-installation-on-openmesh-a62-router/23986 Cheers, |
bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=OM-A62
bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=OM-A62
bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=OM-A62
The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the factory image to the u-boot when the device boots up.
The initramfs image can be started using
As you can see, this PR currently contains some changes from #881 and #879. It doesn't seem to be a good idea to build the support without the other PRs in mind. So you can basically ignore following changes when the other PRs are accepted:
I would like to thank @chunkeey here because he investigated the gpio-hog problem with the pinctrl-msm and prepared several patches for upstream.
There are not many informations about this device but OpenMesh just added it to their shop https://store.openmesh.com/products/a62-universal-tri-band-802-11ac-wave-2-cloud-managed-wifi-access-point.html
The u-boot source code can currently only be downloaded from https://drive.google.com/drive/folders/1bBOQH5RCpwi0acJlLd0xs2OComopO5tn?usp=sharing