Skip to content
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

ipq806x: Add support for OpenMesh A42 #1550

Closed
wants to merge 8 commits into from
Closed

ipq806x: Add support for OpenMesh A42 #1550

wants to merge 8 commits into from

Conversation

ecsv
Copy link
Contributor

@ecsv ecsv commented Nov 28, 2017

OpenMesh A42 is a dual-band () router, based on QCA IPQ401x. More information can be found at https://wikidevi.com/wiki/Open_Mesh_A42

  • QCA IPQ401x
  • 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=16,variant=OM-A42
  • 2T2R 5 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=17,variant=OM-A42
  • multi-color LED (controlled via red/green/yellow GPIOs)
  • 1x button (reset; kmod-input-gpio-keys compatible)
  • external watchdog
    • triggered GPIO
    • see om-watchdog
  • 1x USB
  • TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
  • 2x gigabit ethernet
  • powered only via POE
    • 802.3af POE on Ethernet 1
    • 18-24v passive POE (mode B) on Ethernet 2

The sysupgrade image can also be used to install LEDE. The tool ap51-flash (https://dev.cloudtrax.com/git/ap51-flash.git) should be used to transfer the image to the u-boot when the device boots up.


The u-boot is currently only available from https://drive.google.com/drive/folders/1lagQhi80R3UMnY_8qo_5zC02gbLpSpYZ?usp=sharing

@ecsv
Copy link
Contributor Author

ecsv commented Nov 28, 2017

The upstreaming progress of the ath10k "qcom,ath10k-calibration-variant" patch can be found in https://patchwork.kernel.org/patch/9615185/

The upstreaming progress of the BDFs can be found in http://lists.infradead.org/pipermail/ath10k/2017-November/010470.html

Copy link
Contributor

@chunkeey chunkeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to do @mkresin a favor. You could change the boardname to openmesh,a42 (i.e the same as the first compatible string in the dts for the device).

&spi_0 { /* BLSP1 QUP1 */
status = "ok";

mx25l25635e@0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roman recently removed the mx25l25635e node in LEDE. There's no need to disable this unless you aim to upstream this.

Node: you can also nuke the node with /delete-node/...;

m25p80@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "s25fl256s1";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add the "jedec,spi-nor" to the compatible string after "s25f1256s1".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use only jedec,spi-nor. It is the standard since kernel 4.4. Everything else exists only for backwards compatibility.


soc {
wifi@a000000 {
status = "okay";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qcom-ipq4019-ap.dk01.1.dtsi enables it by default.

};

wifi@a800000 {
status = "okay";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qcom-ipq4019-ap.dk01.1.dtsi enables it by default

@ecsv
Copy link
Contributor Author

ecsv commented Nov 29, 2017

Thanks for the review, will change that tomorrow. I will also change the board_name (as in "$(board_name)") & BOARD_NAME) to "openmesh,a42". I will have to change how the combined-ext-image knows the CE ID but this should be fine.

@ecsv
Copy link
Contributor Author

ecsv commented Nov 30, 2017

I have now changed following:

  • 0002-build-add-image-command-for-CE-images.patch
    • disabled use of BOARD_NAME as CE_ID/CE_TYPE
    • introduced optional parameter ce_type to overwrite the CE_TYPE (in case it should be different than the DEVICE_NAME)
  • 0003-ipq806x-add-DTS-for-the-OpenMesh-A42-board.patch
    • removed status = "okay"; from wifi nodes
    • removed mx25l25635e@0 node
    • changed m25p80 node compatible to "jedec,spi-nor"
  • 0004-ipq806x-add-user-space-support-for-OpenMesh-A42.patch
    • changed checks which compare against "$(board_name)" to "openmesh,a42" (but kept "a42:$color:status" as LED names)
    • changed $(board_name)" result to "openmesh,a42"
  • 0005-ipq806x-add-sysupgrade-for-OpenMesh-A42.patch
    • changed checks which compare against "$(board_name)" to "openmesh,a42"
  • 0007-om-watchdog-add-OpenMesh-A42-support.patch
    • changed checks which compare against "$(board_name)" to "openmesh,a42"
  • 0008-ipq806x-extract-ath10k-pre-cal-for-OpenMesh-A42.patch
    • changed checks which compare against "$(board_name)" to "openmesh,a42"
  • 0009-uboot-envtools-add-OpenMesh-A42-support.patch
    • changed checks which compare against "$(board_name)" to "openmesh,a42"
  • 0012-ipq806x-create-profile-for-the-OpenMesh-A42.patch
    • changed BOARD_NAME to "openmesh,a42"

I've also kept the package name ipq-wifi-a42. But I can also change it to ipq-wifi-openmesh-a42 when this is preferred.

@mkresin mkresin self-assigned this Dec 1, 2017
@ecsv
Copy link
Contributor Author

ecsv commented Dec 14, 2017

The "qcom,ath10k-calibration-variant" patches were just added to ath.git https://patchwork.kernel.org/patch/10102249/

@blogic
Copy link
Contributor

blogic commented Jan 2, 2018

With the remerge in progress, all PRs on the lede-project organisation will be closed. Please help getting this merged or rebase/post it on the openwrt project page (https://github.com/openwrt/openwrt/pulls). All remaining PRs will be closed in 30 days.

ecsv and others added 8 commits January 9, 2018 11:05
Board Data File (BDF) is loaded upon driver boot-up procedure. The right
board data file is identified on QCA4019 using bus, bmi-chip-id and
bmi-board-id.

The problem, however, can occur when the (default) board data file cannot
fulfill the vendor requirements and it is necessary to use a different
board data file.

This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
Something similar has to be provided for systems without SMBIOS but with
device trees. No solution was specified by QCA and therefore a new one has
to be found for ath10k.

The device tree requires addition strings to define the variant name

    wifi@a000000 {
    	status = "okay";
    	qcom,ath10k-calibration-variant = "RT-AC58U";
    };

    wifi@a800000 {
    	status = "okay";
    	qcom,ath10k-calibration-variant = "RT-AC58U";
    };

This would create the boarddata identifiers for the board-2.bin search

 *  bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U
 *  bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
The new build commands operate on the input image and use it again as
output image. This conflicts with the way combined-ext-image.sh was
operating. It required that input and output files are different files and
and that it can write freely to the output file.

This can be avoided when all intermediate build steps by
combined-ext-image.sh are done in a temporary directory. The output file is
then only overwritten in the last step.

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
Combined Extended Images V1 can be created easily via the new image
commands using

    BOARD_NAME = OM2P
    IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | combined-ext-image

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
The kernel driver gpio-wdt or the userspace tool om-watchdog can be used to
trigger external gpio watchdog chips. The gpio-wdt driver has the benefit
that it can be configured together with the rest of the device in the DTS
and better integrates in the OpenWrt via procd.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
* QCA IPQ401x
* 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=16,variant=OM-A42
* 2T2R 5 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=17,variant=OM-A42
* 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
* powered only via POE
  - 802.3af POE on Ethernet 1
  - 18-24v passive POE (mode B) on Ethernet 2

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.

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
@ecsv
Copy link
Contributor Author

ecsv commented Jan 9, 2018

The PR can now be found in openwrt/openwrt#633

@ecsv ecsv closed this Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants