[OpenWrt-Devel] [PATCH 3/3] ipq806x: add Netgear EX6100v2/EX6150v2 support

Mathias Kresin dev at kresin.me
Thu Jan 11 01:35:47 EST 2018


Hey Thomas,

I only had a brief look at the patch. Might be there is more stuff to 
change. Find my comments inline.

10.01.2018 11:15, Thomas Hebb:
> This patch adds support for the Netgear EX6100v2 and EX6150v2 Wi-Fi
> range extenders.
> 
> Hardware:
> 
> SoC:    Qualcomm IPQ4018
> RAM:    256 MiB
> FLASH:  16 MiB Winbond W25Q128
> ETH:    Qualcomm IPQ4018 Gigabit PHY, 1 port
> WLAN1:  Qualcomm Atheros QCA4018 2.4GHz 802.11b/g/n 2x2
> WLAN2:  Qualcomm Atheros QCA4018 5GHz 802.11n/ac 1x1 (EX6100v2)
> WLAN2:  Qualcomm Atheros QCA4018 5GHz 802.11n/ac 2x2 (EX6150v2)
> INPUT:  Power, WPS, factory reset buttons, AP/extender mode toggle switch
> LEDS:   Power, router, client (dual color red/green)
>          Router activity, client activity (blue)
>          WPS (green)
> SERIAL: 3.3V unpopulated serial header connected to ttyMSM0. 11520n8.
>          Serial access is not required to install OpenWRT on the device.
> 
>          To access, unscrew the four Torx T10 screws on the back of the
>          unit and unclip the faceplate. Then, unclip the power supply
>          board (to which the logic board is mounted using four large
>          standoffs) from the large clips on the top and bottom that hold
>          it in place. Flip over the boards so the power supply board is
>          on top, making sure not to damage the Wi-Fi antenna wires.
>          Unscrew the four Phillips #1 screws connecting the power supply
>          board to the standoffs and carefully lift it off, unplugging the
>          eight-pin connector that supplies power to the logic board. Then
>          unscrew the four hexagonal standoffs from the logic board, flip
>          the board over again, and lift off the metal shield (watch out
>          for thermal compound). The unpopulated header is located at the
>          bottom edge of the logic board, with pins 1 (square pad), 2, 3,
>          and 4 carrying VDD (3.3V), TX, RX, and GND respectively.
> 
> To install, upload openwrt-ipq806x-EX61x0v2-squashfs-factory.img to the
> Netgear web interface as a firmware update and ensure that the listed
> update version matches that of the OpenWRT image you're trying to
> install. Note that OpenWRT will not bring up the wireless interfaces by
> default, so you must be able to connect to Ethernet for initial
> configuration.
> 
> Features, tested and working:
>   - Serial
>   - Flash
>   - Ethernet
>   - Wi-Fi, 2.4GHz and 5GHz
>   - Buttons (WPS and factory reset, which acts as restart)
>   - LEDs (most of which are driven by a shift register connected to SoC GPIOs)
>   - Factory OpenWRT install from Netgear firmware
>   - OpenWRT sysupgrade
> 
> Features, untested but should work:
>   - All above on the EX6150v2. I only own an EX6100v2 and so could not
>     verify the other device.
> 
> Features, not planned:
>   - AP/extender toggle switch
> 
> These two boards are unusual in that they both run the same stock image
> and share the same official update binaries. As far as I can tell, the
> only difference between the two units is the 5GHz MIMO configuration:
> 1x1 for the EX6100v2 and 2x2 for the EX6150v2. Since the boards are so
> similar, both are supported by a single OpenWRT image, which determines
> the board it's running on at runtime by reading the flash. The only
> runtime differences between the two boards are the board name, the model
> name, and the Wi-Fi calibration data that gets loaded.
> 
> U-Boot on this device is device-tree aware, and the stock firmware
> provides the kernel and device tree in a FIT image. We do the same
> because, even though this version of U-Boot ought to be able to boot a
> uImage with appended DTB, I was unable to make that configuration work
> for unknown reasons.
> 
> The Wi-Fi calibration data (board-2.dat) for both boards was taken from
> an official Netgear firmware update.
> 
> Signed-off-by: Thomas Hebb <tommyhebb at gmail.com>
> ---
>   package/firmware/ipq-wifi/Makefile                 |   4 +-
>   package/firmware/ipq-wifi/board-ex6100v2.bin       | Bin 0 -> 24276 bytes
>   package/firmware/ipq-wifi/board-ex6150v2.bin       | Bin 0 -> 24276 bytes
>   .../ipq806x/base-files/etc/board.d/02_network      |   4 +
>   .../etc/hotplug.d/firmware/11-ath10k-caldata       |   8 +-
>   .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |  13 ++
>   target/linux/ipq806x/base-files/lib/ipq806x.sh     |  24 +++
>   target/linux/ipq806x/config-4.9                    |   2 +
>   .../arch/arm/boot/dts/qcom-ipq4019-ex61x0v2.dts    | 211 +++++++++++++++++++++
>   target/linux/ipq806x/image/Makefile                |  41 +++-
>   .../patches-4.9/0069-arm-boot-add-dts-files.patch  |   3 +-
>   11 files changed, 300 insertions(+), 10 deletions(-)
>   create mode 100644 package/firmware/ipq-wifi/board-ex6100v2.bin
>   create mode 100644 package/firmware/ipq-wifi/board-ex6150v2.bin
>   create mode 100644 target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-ex61x0v2.dts
> 
> diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh b/target/linux/ipq806x/base-files/lib/ipq806x.sh
> index c4d2c8f258..1e011292eb 100644
> --- a/target/linux/ipq806x/base-files/lib/ipq806x.sh
> +++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh
> @@ -7,6 +7,8 @@
>   IPQ806X_BOARD_NAME=
>   IPQ806X_MODEL=
>   
> +. /lib/functions.sh
> +
>   ipq806x_board_detect() {
>   	local machine
>   	local name
> @@ -50,6 +52,28 @@ ipq806x_board_detect() {
>   	*"VR2600v")
>   		name="vr2600v"
>   		;;
> +	*"EX61x0v2")
> +		# There are two models in this series, which have identical
> +		# hardware save for the number of 5G antennas. Since we run
> +		# the exact same image on both, we need to check the flash
> +		# to distinguish which we're running on.
> +		local hw_id="$(dd if="$(find_mtd_part dnidata)" \
> +			       bs=1 skip=41 count=25 2>/dev/null)"
> +
> +		case "$hw_id" in
> +		*"1x1")
> +			name="ex6100v2"
> +			IPQ806X_MODEL="Netgear EX6100v2"
> +			;;
> +		*"2x2")
> +			name="ex6150v2"
> +			IPQ806X_MODEL="Netgear EX6150v2"
> +			;;
> +		*)
> +			name="ex6100v2"
> +			IPQ806X_MODEL="Netgear EX61?0v2 (ERROR: failed to parse hw_id)"
> +		esac
> +		;;

Please don't do this kind of hackery. Create two images with two 
devicetree source files instead. Move common stuff to a dtsi and include 
the dtsi for both dts.

Please use the compatible string from the dts as boardname. Have a look 
at the ipq806x branch in my staging tree [0] for upcoming changes

>   	esac
>   
>   	[ -z "$name" ] && name="unknown"
> diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-ex61x0v2.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-ex61x0v2.dts
> new file mode 100644
> index 0000000000..a2ae64a1dc
> --- /dev/null
> +++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-ex61x0v2.dts
> @@ -0,0 +1,211 @@
> +#include "qcom-ipq4019-ap.dk01.1.dtsi"

Don't include qcom-ipq4019-ap.dk01.1.dtsi here. It is an common file for 
the QCA ap.dk01 eval board and your board isn't an eval board. Copy 
relevant parts to your own dts.

> +#include "qcom-ipq4019-bus.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +
> +/ {
> +	model = "Netgear EX61x0v2";
> +	compatible = "netgear,ex61x0v2", "qcom,ipq4019";
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x80000000 0x10000000>;
> +	};
> +
> +	reserved-memory {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +
> +		rsvd at 87E00000 {
> +			reg = <0x87E00000 0x0200000>;
> +			no-map;
> +		};
> +	};
> +
> +	aliases {
> +		led-boot = &power_amber;
> +		led-failsafe = &power_amber;
> +		led-running = &power_green;
> +		led-upgrade = &power_amber;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +
> +	led_spi {
> +		compatible = "spi-gpio";
> +		#address-cells = <1>;
> +		ranges;
> +
> +		gpio-sck = <&tlmm 5 GPIO_ACTIVE_HIGH>;
> +		gpio-mosi = <&tlmm 4 GPIO_ACTIVE_HIGH>;
> +		num-chipselects = <0>;
> +
> +		led_gpio: led_gpio at 0 {
> +			compatible = "fairchild,74hc595";
> +			reg = <0>;
> +			gpio-controller;
> +			#gpio-cells = <2>;
> +			registers-number = <1>;
> +			spi-max-frequency = <1000000>;
> +		};
> +	};
> +
> +	gpio-keys {
> +		compatible = "gpio-keys";
> +
> +		wps {
> +			label = "wps";
> +			gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_WPS_BUTTON>;
> +		};
> +
> +		reset {
> +			label = "reset";
> +			gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_RESTART>;
> +		};
> +	};
> +
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +
> +		power_amber: power_amber {
> +			label = "ex61x0v2:amber:power";
> +			gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		power_green: power_green {
> +			label = "ex61x0v2:green:power";
> +			gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		right {
> +			label = "ex61x0v2:blue:right";
> +			gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		left {
> +			label = "ex61x0v2:blue:left";
> +			gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		client_green {
> +			label = "ex61x0v2:green:client";
> +			gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		client_red {
> +			label = "ex61x0v2:red:client";
> +			gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		router_green {
> +			label = "ex61x0v2:green:router";
> +			gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		router_red {
> +			label = "ex61x0v2:red:router";
> +			gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		wps {
> +			label = "ex61x0v2:green:wps";
> +			gpios = <&tlmm 1 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +};
> +
> +&spi_0 {
> +	flash at 0 {
> +		compatible = "winbond,w25q128", "jedec,spi-nor";
> +		reg = <0>;
> +		spi-max-frequency = <24000000>;
> +
> +		partitions {
> +			compatible = "fixed-partitions";
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			partition0 at 0 {
> +				label = "SBL1";
> +				reg = <0x00000000 0x00040000>;
> +				read-only;
> +			};
> +
> +			partition1 at 40000 {
> +				label = "MIBIB";
> +				reg = <0x00040000 0x00020000>;
> +				read-only;
> +			};
> +
> +			partition2 at 60000 {
> +				label = "QSEE";
> +				reg = <0x00060000 0x00060000>;
> +				read-only;
> +			};
> +
> +			partition3 at c0000 {
> +				label = "CDT";
> +				reg = <0x000c0000 0x00010000>;
> +				read-only;
> +			};
> +
> +			partition4 at d0000 {
> +				label = "DDRPARAMS";
> +				reg = <0x000d0000 0x00010000>;
> +				read-only;
> +			};
> +
> +			partition5 at e0000 {
> +				label = "APPSBLENV";
> +				reg = <0x000e0000 0x00010000>;
> +				read-only;
> +			};
> +
> +			partition6 at f0000 {
> +				label = "APPSBL";
> +				reg = <0x000f0000 0x00080000>;
> +				read-only;
> +			};
> +
> +			partition7 at 170000 {
> +				label = "ART";
> +				reg = <0x00170000 0x00010000>;
> +				read-only;
> +			};
> +
> +			partition8 at 180000 {
> +				label = "config";
> +				reg = <0x00180000 0x00010000>;
> +				read-only;
> +			};
> +
> +			partition9 at 190000 {
> +				label = "pot";
> +				reg = <0x00190000 0x00010000>;
> +				read-only;
> +			};
> +
> +			partition10 at 1a0000 {
> +				label = "dnidata";
> +				reg = <0x001a0000 0x00010000>;
> +				read-only;
> +			};
> +
> +			partition11 at 1b0000 {
> +				label = "firmware";
> +				reg = <0x001b0000 0x00e10000>;
> +			};
> +
> +			partition12 at fc0000 {
> +				label = "language";
> +				reg = <0x00fc0000 0x00040000>;
> +				read-only;
> +			};
> +		};
> +	};
> +};


Mathias

[0] https://git.openwrt.org/?p=openwrt/staging/mkresin.git;a=summary
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list