diff mbox series

[OpenWrt-Devel] ath79: add support for gl-e750

Message ID 1588852019-6929-1-git-send-email-luochongjun@gl-inet.com
State Changes Requested
Delegated to: Petr Štetiar
Headers show
Series [OpenWrt-Devel] ath79: add support for gl-e750 | expand

Commit Message

Luochongjun May 7, 2020, 11:46 a.m. UTC
The gl-e750 is a portable travel router that gives you safe access to
the internet while traveling.

Specifications:
- SoC: Qualcomm Atheros AR9531 (650MHz)
- RAM: 128 MB DDR2
- Flash: 16 MB SPI NOR (W25Q128FVSG) + 128 MB SPI NAND (GD5F1GQ4UFYIG)
- Ethernet: 10/100: 1xLAN
- Wireless: QCA9531 2.4GHz (bgn) + QCA9887 5GHz (ac)
- USB: 1x USB 2.0 port
- Switch: 1x switch
- Button: 1x reset button
- OLED Screen: 128*64 px

Flash instruction:
Support for sysupgrade directive upgrades, as well as luci upgrades.

OLED screen control:
OLED controller is connected to QCA9531 through serial port, and can send
instructions to OLED controller directly through serial port.
Refer to the links below for a list of supported instructions:
https://github.com/gl-inet/GL-E750-MCU-instruction

Signed-off-by: Luochongjun <luochongjun@gl-inet.com>
---
 target/linux/ath79/dts/qca9531_glinet_gl-e750.dts  | 141 +++++++++++++++++++++
 .../generic/base-files/etc/board.d/02_network      |   1 +
 target/linux/ath79/image/nand.mk                   |  15 +++
 3 files changed, 157 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-e750.dts

Comments

Koen Vandeputte May 14, 2020, 8:08 a.m. UTC | #1
On 07.05.20 13:46, Luochongjun wrote:
> The gl-e750 is a portable travel router that gives you safe access to
> the internet while traveling.
>
> Specifications:
> - SoC: Qualcomm Atheros AR9531 (650MHz)
> - RAM: 128 MB DDR2
> - Flash: 16 MB SPI NOR (W25Q128FVSG) + 128 MB SPI NAND (GD5F1GQ4UFYIG)
> - Ethernet: 10/100: 1xLAN
> - Wireless: QCA9531 2.4GHz (bgn) + QCA9887 5GHz (ac)
> - USB: 1x USB 2.0 port
> - Switch: 1x switch
> - Button: 1x reset button
> - OLED Screen: 128*64 px
- Serial: TX pin marked as UART-SOUT, located near the switch (115200 
8N1, 3V3 level)

- Mobile: Quectel EP06-E in mini pci-e slot, USB 2.0 connected


Correct?
Koen Vandeputte May 14, 2020, 8:47 a.m. UTC | #2
On 07.05.20 13:46, Luochongjun wrote:
> The gl-e750 is a portable travel router that gives you safe access to
> the internet while traveling.
>
> Specifications:
> - SoC: Qualcomm Atheros AR9531 (650MHz)
> - RAM: 128 MB DDR2
> - Flash: 16 MB SPI NOR (W25Q128FVSG) + 128 MB SPI NAND (GD5F1GQ4UFYIG)
> - Ethernet: 10/100: 1xLAN
> - Wireless: QCA9531 2.4GHz (bgn) + QCA9887 5GHz (ac)
> - USB: 1x USB 2.0 port
> - Switch: 1x switch
> - Button: 1x reset button
> - OLED Screen: 128*64 px
>
> Flash instruction:
> Support for sysupgrade directive upgrades, as well as luci upgrades.


Warning: Permanently added '192.168.8.1' (RSA) to the list of known hosts.


BusyBox v1.28.3 () built-in shell (ash)

   _______                     ________        __
  |       |.-----.-----.-----.|  |  |  |.----.|  |_
  |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
  |_______||   __|_____|__|__||________||__|  |____|
           |__| W I R E L E S S   F R E E D O M
  -----------------------------------------------------
  OpenWrt 18.06.1, r7258-5eb055306f
  -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@GL-E750:~# cd /tmp/
root@GL-E750:/tmp# sysupgrade -n 
/tmp/openwrt-ath79-nand-glinet_gl-e750-squashfs
-sysupgrade.bin
Device gl-e750 not supported by this image
Supported devices: glinet,gl-e750
Image check 'fwtool_check_image' failed.
root@GL-E750:/tmp#
Adrian Schmutzler May 14, 2020, 9:57 a.m. UTC | #3
Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Luochongjun
> Sent: Donnerstag, 7. Mai 2020 13:47
> To: openwrt-devel@lists.openwrt.org
> Cc: Luochongjun <luochongjun@gl-inet.com>
> Subject: [OpenWrt-Devel] [PATCH] ath79: add support for gl-e750
> 
> The gl-e750 is a portable travel router that gives you safe access to the
> internet while traveling.
> 
> Specifications:
> - SoC: Qualcomm Atheros AR9531 (650MHz)
> - RAM: 128 MB DDR2
> - Flash: 16 MB SPI NOR (W25Q128FVSG) + 128 MB SPI NAND
> (GD5F1GQ4UFYIG)
> - Ethernet: 10/100: 1xLAN
> - Wireless: QCA9531 2.4GHz (bgn) + QCA9887 5GHz (ac)
> - USB: 1x USB 2.0 port
> - Switch: 1x switch
> - Button: 1x reset button
> - OLED Screen: 128*64 px

No LEDs?

Some other comments below.

> 
> Flash instruction:
> Support for sysupgrade directive upgrades, as well as luci upgrades.
> 
> OLED screen control:
> OLED controller is connected to QCA9531 through serial port, and can send
> instructions to OLED controller directly through serial port.
> Refer to the links below for a list of supported instructions:
> https://github.com/gl-inet/GL-E750-MCU-instruction
> 
> Signed-off-by: Luochongjun <luochongjun@gl-inet.com>
> ---
>  target/linux/ath79/dts/qca9531_glinet_gl-e750.dts  | 141
> +++++++++++++++++++++
>  .../generic/base-files/etc/board.d/02_network      |   1 +
>  target/linux/ath79/image/nand.mk                   |  15 +++
>  3 files changed, 157 insertions(+)
>  create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
> 
> diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
> b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
> new file mode 100644
> index 0000000..645c69a
> --- /dev/null
> +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
> @@ -0,0 +1,141 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/;
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +
> +#include "qca953x.dtsi"
> +
> +/ {
> +	compatible = "glinet,gl-e750", "qca,qca9531";
> +	model = "GL.iNet GL-E750";
> +
> +	keys {
> +		compatible = "gpio-keys";
> +
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&jtag_disable_pins>;
> +
> +		reset {
> +			label = "reset";
> +			linux,code = <KEY_RESTART>;
> +			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		switch {
> +			label = "switch";
> +			linux,code = <BTN_0>;
> +			gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +
> +        gpio-export {
> +                compatible = "gpio-export";
> +                #size-cells = <0>;
> +
> +                gpio_lte_power {
> +                        gpio-export,name = "lte";

I'd consider lte-power or lte_power as name here.

> +                        gpio-export,output = <1>;
> +                        gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
> +                };
> +        };
> +
> +};
> +
> +&pcie0 {
> +	status = "okay";
> +};
> +
> +&uart {
> +	status = "okay";
> +};
> +
> +&usb0 {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +	status = "okay";
> +
> +	hub_port: port@1 {
> +		reg = <1>;
> +		#trigger-source-cells = <0>;
> +	};
> +};
> +
> +&usb_phy {
> +	status = "okay";
> +};
> +
> +&spi {
> +	status = "okay";
> +	num-cs = <2>;
> +
> +	flash@0 {
> +		compatible = "jedec,spi-nor";
> +		reg = <0>;
> +		spi-max-frequency = <25000000>;
> +
> +		partitions {
> +			compatible = "fixed-partitions";
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			partition@0 {
> +				label = "u-boot";
> +				reg = <0x0 0x40000>;
> +				read-only;
> +			};
> +
> +			partition@40000 {
> +				label = "u-boot-env";
> +				reg = <0x40000 0x10000>;
> +			};
> +
> +			art: partition@50000 {
> +				label = "art";
> +				reg = <0x50000 0x10000>;
> +				read-only;
> +			};
> +
> +			partition@60000 {
> +				label = "kernel";
> +				reg = <0x60000 0x400000>;
> +			};
> +
> +			partition@460000 {
> +				label = "reserved";
> +				reg = <0x460000 0xba0000>;
> +			};
> +
> +		};
> +	};
> +
> +	flash@1 {
> +		compatible = "spi-nand";
> +		reg = <1>;
> +		spi-max-frequency = <25000000>;
> +
> +		partitions {
> +			compatible = "fixed-partitions";
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			partition@0 {
> +				label = "ubi";
> +				reg = <0x0 0x8000000>;
> +			};
> +		};
> +	};
> +};
> +
> +&eth0 {
> +	status = "okay";
> +
> +	mtd-mac-address = <&art 0x0>;
> +	phy-handle = <&swphy4>;
> +};
> +
> +&wmac {
> +	status = "okay";
> +	mtd-cal-data = <&art 0x1000>;
> +	mtd-mac-address = <&art 0x1002>;

mtd-mac-address can be dropped here, as it will be read from this offset by mtd-cal-data automatically.

> +};
> diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network
> b/target/linux/ath79/generic/base-files/etc/board.d/02_network
> index d7f7eed..a50dfec 100755
> --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
> +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
> @@ -23,6 +23,7 @@ ath79_setup_interfaces()
>  	dlink,dir-505|\
>  	engenius,ecb1750|\
>  	glinet,gl-ar300m-lite|\
> +	glinet,gl-e750|\
>  	netgear,ex6400|\
>  	netgear,ex7300|\
>  	ocedo,koala|\
> diff --git a/target/linux/ath79/image/nand.mk
> b/target/linux/ath79/image/nand.mk
> index 3ccd199..e6743e4 100644
> --- a/target/linux/ath79/image/nand.mk
> +++ b/target/linux/ath79/image/nand.mk
> @@ -130,6 +130,21 @@ define Device/glinet_gl-ar750s-nor  endef
> TARGET_DEVICES += glinet_gl-ar750s-nor
> 
> +define Device/glinet_gl-e750
> +  SOC := qca9531
> +  DEVICE_VENDOR := GL.iNet
> +  DEVICE_MODEL := GL-E750
> +  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-
> usb2 \
> +	kmod-usb-storage block-mount
> +  KERNEL_SIZE := 4096k
> +  IMAGE_SIZE := 131072k
> +  PAGESIZE := 2048
> +  VID_HDR_OFFSET := 2048
> +  BLOCKSIZE := 128k
> +  IMAGES += factory.img

Typically, GL.inet devices can be installed with sysupgrade, so a factory image is not necessary? (And it's not set up anyway)
I think this can be dropped.

If you send a newer patch, please make sure to add a v2 ...

Best

Adrian

> +endef
> +TARGET_DEVICES += glinet_gl-e750
> +
>  # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header +
> 0xff)  define Device/netgear_ath79_nand
>    DEVICE_VENDOR := NETGEAR
> --
> 2.7.4
> 
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Luochongjun May 14, 2020, 10:12 a.m. UTC | #4
Hi,adrian

I added a reply below your question.
 
> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Luochongjun
> Sent: Donnerstag, 7. Mai 2020 13:47
> To: openwrt-devel@lists.openwrt.org
> Cc: Luochongjun <luochongjun@gl-inet.com>
> Subject: [OpenWrt-Devel] [PATCH] ath79: add support for gl-e750
> 
> The gl-e750 is a portable travel router that gives you safe access to the
> internet while traveling.
> 
> Specifications:
> - SoC: Qualcomm Atheros AR9531 (650MHz)
> - RAM: 128 MB DDR2
> - Flash: 16 MB SPI NOR (W25Q128FVSG) + 128 MB SPI NAND
> (GD5F1GQ4UFYIG)
> - Ethernet: 10/100: 1xLAN
> - Wireless: QCA9531 2.4GHz (bgn) + QCA9887 5GHz (ac)
> - USB: 1x USB 2.0 port
> - Switch: 1x switch
> - Button: 1x reset button
> - OLED Screen: 128*64 px
 
No LEDs?
--->Yes, No LEDs
 
Some other comments below.
 
> 
> Flash instruction:
> Support for sysupgrade directive upgrades, as well as luci upgrades.
> 
> OLED screen control:
> OLED controller is connected to QCA9531 through serial port, and can send
> instructions to OLED controller directly through serial port.
> Refer to the links below for a list of supported instructions:
> https://github.com/gl-inet/GL-E750-MCU-instruction
> 
> Signed-off-by: Luochongjun <luochongjun@gl-inet.com>
> ---
>  target/linux/ath79/dts/qca9531_glinet_gl-e750.dts  | 141
> +++++++++++++++++++++
>  .../generic/base-files/etc/board.d/02_network      |   1 +
>  target/linux/ath79/image/nand.mk                   |  15 +++
>  3 files changed, 157 insertions(+)
>  create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
> 
> diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
> b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
> new file mode 100644
> index 0000000..645c69a
> --- /dev/null
> +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
> @@ -0,0 +1,141 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/;
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +
> +#include "qca953x.dtsi"
> +
> +/ {
> + compatible = "glinet,gl-e750", "qca,qca9531";
> + model = "GL.iNet GL-E750";
> +
> + keys {
> + compatible = "gpio-keys";
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&jtag_disable_pins>;
> +
> + reset {
> + label = "reset";
> + linux,code = <KEY_RESTART>;
> + gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
> + };
> +
> + switch {
> + label = "switch";
> + linux,code = <BTN_0>;
> + gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
> + };
> + };
> +
> +        gpio-export {
> +                compatible = "gpio-export";
> +                #size-cells = <0>;
> +
> +                gpio_lte_power {
> +                        gpio-export,name = "lte";
 
I'd consider lte-power or lte_power as name here.
--->I agree. It's easier to understand
 
> +                        gpio-export,output = <1>;
> +                        gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
> +                };
> +        };
> +
> +};
> +
> +&pcie0 {
> + status = "okay";
> +};
> +
> +&uart {
> + status = "okay";
> +};
> +
> +&usb0 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + status = "okay";
> +
> + hub_port: port@1 {
> + reg = <1>;
> + #trigger-source-cells = <0>;
> + };
> +};
> +
> +&usb_phy {
> + status = "okay";
> +};
> +
> +&spi {
> + status = "okay";
> + num-cs = <2>;
> +
> + flash@0 {
> + compatible = "jedec,spi-nor";
> + reg = <0>;
> + spi-max-frequency = <25000000>;
> +
> + partitions {
> + compatible = "fixed-partitions";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + partition@0 {
> + label = "u-boot";
> + reg = <0x0 0x40000>;
> + read-only;
> + };
> +
> + partition@40000 {
> + label = "u-boot-env";
> + reg = <0x40000 0x10000>;
> + };
> +
> + art: partition@50000 {
> + label = "art";
> + reg = <0x50000 0x10000>;
> + read-only;
> + };
> +
> + partition@60000 {
> + label = "kernel";
> + reg = <0x60000 0x400000>;
> + };
> +
> + partition@460000 {
> + label = "reserved";
> + reg = <0x460000 0xba0000>;
> + };
> +
> + };
> + };
> +
> + flash@1 {
> + compatible = "spi-nand";
> + reg = <1>;
> + spi-max-frequency = <25000000>;
> +
> + partitions {
> + compatible = "fixed-partitions";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + partition@0 {
> + label = "ubi";
> + reg = <0x0 0x8000000>;
> + };
> + };
> + };
> +};
> +
> +&eth0 {
> + status = "okay";
> +
> + mtd-mac-address = <&art 0x0>;
> + phy-handle = <&swphy4>;
> +};
> +
> +&wmac {
> + status = "okay";
> + mtd-cal-data = <&art 0x1000>;
> + mtd-mac-address = <&art 0x1002>;
 
mtd-mac-address can be dropped here, as it will be read from this offset by mtd-cal-data automatically.
---> Will the offset of 0x2 be automatically added?
 
> +};
> diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network
> b/target/linux/ath79/generic/base-files/etc/board.d/02_network
> index d7f7eed..a50dfec 100755
> --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
> +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
> @@ -23,6 +23,7 @@ ath79_setup_interfaces()
>  dlink,dir-505|\
>  engenius,ecb1750|\
>  glinet,gl-ar300m-lite|\
> + glinet,gl-e750|\
>  netgear,ex6400|\
>  netgear,ex7300|\
>  ocedo,koala|\
> diff --git a/target/linux/ath79/image/nand.mk
> b/target/linux/ath79/image/nand.mk
> index 3ccd199..e6743e4 100644
> --- a/target/linux/ath79/image/nand.mk
> +++ b/target/linux/ath79/image/nand.mk
> @@ -130,6 +130,21 @@ define Device/glinet_gl-ar750s-nor  endef
> TARGET_DEVICES += glinet_gl-ar750s-nor
> 
> +define Device/glinet_gl-e750
> +  SOC := qca9531
> +  DEVICE_VENDOR := GL.iNet
> +  DEVICE_MODEL := GL-E750
> +  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-
> usb2 \
> + kmod-usb-storage block-mount
> +  KERNEL_SIZE := 4096k
> +  IMAGE_SIZE := 131072k
> +  PAGESIZE := 2048
> +  VID_HDR_OFFSET := 2048
> +  BLOCKSIZE := 128k
> +  IMAGES += factory.img
 
Typically, GL.inet devices can be installed with sysupgrade, so a factory image is not necessary? (And it's not set up anyway)
I think this can be dropped.
--->Many GL users like to use uboot to upgrade their firmware, so I think it is necessary to generate a factory image.
 
If you send a newer patch, please make sure to add a v2 ...
--->Thank you. I will submit it as required
 
Best
 
Adrian
 
> +endef
> +TARGET_DEVICES += glinet_gl-e750
> +
>  # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header +
> 0xff)  define Device/netgear_ath79_nand
>    DEVICE_VENDOR := NETGEAR
> --
> 2.7.4
> 
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel 

Best regards,
Luochongjn
Adrian Schmutzler May 14, 2020, 10:49 a.m. UTC | #5
Hi,

> > +&wmac {
> > + status = "okay";
> > + mtd-cal-data = <&art 0x1000>;
> > + mtd-mac-address = <&art 0x1002>;
> 
> mtd-mac-address can be dropped here, as it will be read from this offset by mtd-cal-data automatically.
> ---> Will the offset of 0x2 be automatically added?

If you read caldata with mtd-cal-data, it will automatically apply a MAC address found with offset +2 compared to the start of the caldata.

So, cal-data at 0x1000 will use MAC address from 0x1002
caldata at 0x4000 will use MAC address from 0x4002
etc.

mtd-mac-address for wmac is only needed if that region does _not_ contain a proper/valid address, so you need to overwrite it with a sensible value (e.g. for many TP-Link devices, where there is only one valid MAC address in uboot partition, and all others need to be calculated with increments).

Further reading (still WIP): https://openwrt.org/docs/guide-developer/mac.address#mac_address_pulled_by_driver


> > +  IMAGES += factory.img
> 
> Typically, GL.inet devices can be installed with sysupgrade, so a factory image is not necessary? (And it's not set up anyway)
> I think this can be dropped.
> --->Many GL users like to use uboot to upgrade their firmware, so I think it is necessary to generate a factory image.

I'm only used to the old SPI-only devices from GL.inet, where you could just do anything with the sysupgrade image.

However, if you need a separate factory for u-boot now, go for it. But then, I'd prefer it to have the .bin extension as well.

And you still need to add a recipe for it ...

Best

Adrian
Luochongjun May 14, 2020, 11:09 a.m. UTC | #6
Hi adrian,

However, if you need a separate factory for u-boot now, go for it. But then, I'd prefer it to have the .bin extension as well.
--->In the uboot of gl-e750, the extension .bin is considered to be nor firmware and will be handled according to the upgrade process of nor firmware.
--->The reason for this is that in the original ar71xx target, the bin extension was nor firmware and the .img extension was nand firmware.
--->Although the E750 has not released nor firmware, we still have this feature in uboot.

Best regards,
Luochongjun
Koen Vandeputte May 27, 2020, 1:33 p.m. UTC | #7
On 07.05.20 13:46, Luochongjun wrote:
> The gl-e750 is a portable travel router that gives you safe access to
> the internet while traveling.
>
> Specifications:
> - SoC: Qualcomm Atheros AR9531 (650MHz)
> - RAM: 128 MB DDR2
> - Flash: 16 MB SPI NOR (W25Q128FVSG) + 128 MB SPI NAND (GD5F1GQ4UFYIG)
> - Ethernet: 10/100: 1xLAN
> - Wireless: QCA9531 2.4GHz (bgn) + QCA9887 5GHz (ac)
> - USB: 1x USB 2.0 port
> - Switch: 1x switch
> - Button: 1x reset button
> - OLED Screen: 128*64 px
>
> Flash instruction:
> Support for sysupgrade directive upgrades, as well as luci upgrades.

Hi,

I retested this patch just to be sure I didn't miss anything before.


Did you test this patch on actual hardware before sending this?

I've got 2x e750-Mudi devices which:

- I first flashed to the latest Gl.inet firmware (18.06 based) (works fine)

- Tried sysupgrade --> results in platform_check failure

- Tried forced sysupgrade --> does not boot afterwards

- Tried uboot recovery (both sysupgrade and factory images) --> does not 
boot


Using gl.inet official img, the uboot recovery mode works fine.

Thanks,

Koen
Koen Vandeputte May 27, 2020, 2:01 p.m. UTC | #8
On 27.05.20 15:33, Koen Vandeputte wrote:
>
> On 07.05.20 13:46, Luochongjun wrote:
>> The gl-e750 is a portable travel router that gives you safe access to
>> the internet while traveling.
>>
>> Specifications:
>> - SoC: Qualcomm Atheros AR9531 (650MHz)
>> - RAM: 128 MB DDR2
>> - Flash: 16 MB SPI NOR (W25Q128FVSG) + 128 MB SPI NAND (GD5F1GQ4UFYIG)
>> - Ethernet: 10/100: 1xLAN
>> - Wireless: QCA9531 2.4GHz (bgn) + QCA9887 5GHz (ac)
>> - USB: 1x USB 2.0 port
>> - Switch: 1x switch
>> - Button: 1x reset button
>> - OLED Screen: 128*64 px
>>
>> Flash instruction:
>> Support for sysupgrade directive upgrades, as well as luci upgrades.
>
> Hi,
>
> I retested this patch just to be sure I didn't miss anything before.
>
>
> Did you test this patch on actual hardware before sending this?
>
> I've got 2x e750-Mudi devices which:
>
> - I first flashed to the latest Gl.inet firmware (18.06 based) (works 
> fine)
>
> - Tried sysupgrade --> results in platform_check failure
>
> - Tried forced sysupgrade --> does not boot afterwards
>
> - Tried uboot recovery (both sysupgrade and factory images) --> does 
> not boot
>
>
> Using gl.inet official img, the uboot recovery mode works fine.
>
> Thanks,
>
> Koen
>
>
I just soldered UART to the board.

Ethernet is not coming up properly.

relevant prints:


[    0.551090] libphy: Fixed MDIO Bus: probed
[    0.872975] ag71xx 19000000.eth: Could not connect to PHY device. 
Deferring probe.
[    0.881098] ag71xx 1a000000.eth: invalid MAC address, using random 
address
[    1.139873] random: fast init done
[    1.520295] libphy: ag71xx_mdio: probed
[    1.525811] libphy: ar8xxx-mdio: probed
[    1.538905] switch0: Atheros AR8229 rev. 1 switch registered on mdio.0
[    1.587451] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 
[uid=00000000, driver=Generic PHY]
[    1.597499] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    1.605610] NET: Registered protocol family 10
[    1.614929] Segment Routing with IPv6
[    1.618900] NET: Registered protocol family 17
[    1.623601] 8021q: 802.1Q VLAN Support v1.8
[    1.631247] PCI host bridge /ahb/pcie-controller@180c0000 ranges:
[    1.637642]  MEM 0x0000000010000000..0x0000000013ffffff
[    1.643057]   IO 0x0000000000000000..0x0000000000000000
[    1.648655] PCI host bridge to bus 0000:00
[    1.652937] pci_bus 0000:00: root bus resource [mem 
0x10000000-0x13ffffff]
[    1.660051] pci_bus 0000:00: root bus resource [io  0x0000]
[    1.665824] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    1.672845] pci_bus 0000:00: No busn resource found for root bus, 
will use [bus 00-ff]
[    1.682374] pci 0000:00:00.0: BAR 0: assigned [mem 
0x10000000-0x101fffff 64bit]
[    1.690010] pci 0000:00:00.0: BAR 6: assigned [mem 
0x10200000-0x1020ffff pref]
[    2.013961] ag71xx 19000000.eth: connected to PHY at mdio.0:1f:04 
[uid=004dd042, driver=Generic PHY]
[    2.024473] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode: mii

[   10.293731] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   11.325088] eth0: link up (1000Mbps/Full duplex)

[   11.329934] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

[   17.716093] eth0: link down


this device also only has 1 ethernet port exposed on the board.

Regards,

Koen
Luochongjun May 28, 2020, 2:42 a.m. UTC | #9
Hi Koen,

I'm really sorry that I missed your previous email.

Tried sysupgrade --> results in platform_check failure.
In the original device naming convention, E750 was named glinet,gl-e750
However, in today's openwrt, the name of the device is glinet_gl-e750, so platform_check failure is prompted.
You'd better use uboot to upgrade your firmware, follow the link below for the uboot upgrade steps
https://docs.gl-inet.com/en/3/troubleshooting/debrick/

this device also only has 1 ethernet port exposed on the board.
Yes, the E750 has only one ethernet port,
In E750, we only use GMAC0, but in ATH79 target, I had to initialize P4 via GMAC1 connected to the Ethernet switch, so you'll see eth0 and eth1 on your system.
I have tried to use GMAC0 to initialize P4 directly, but after initializing P4 in this way, the speed of P4 can only be 100M, not 100M/10M.



Best Regards
 
Chongjun Luo | Software Engineer
Chongjun.Luo@gl-inet.com 
GL.iNet  WiFi for Things
Website: www.gl-inet.com   |   LinkedIn: gl-inet.com   |   Tel: +86-755-8660-6126
Room 305-306, Skyworth Digital Building , Shiyan Street, Baoan District, Shenzhen, China
Email Disclaimer: The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.
 
From: Koen Vandeputte
Date: 2020-05-27 22:01
To: Luochongjun; openwrt-devel
CC: Gianni Stubbe
Subject: Re: [OpenWrt-Devel] [PATCH] ath79: add support for gl-e750
 
On 27.05.20 15:33, Koen Vandeputte wrote:
>
> On 07.05.20 13:46, Luochongjun wrote:
>> The gl-e750 is a portable travel router that gives you safe access to
>> the internet while traveling.
>>
>> Specifications:
>> - SoC: Qualcomm Atheros AR9531 (650MHz)
>> - RAM: 128 MB DDR2
>> - Flash: 16 MB SPI NOR (W25Q128FVSG) + 128 MB SPI NAND (GD5F1GQ4UFYIG)
>> - Ethernet: 10/100: 1xLAN
>> - Wireless: QCA9531 2.4GHz (bgn) + QCA9887 5GHz (ac)
>> - USB: 1x USB 2.0 port
>> - Switch: 1x switch
>> - Button: 1x reset button
>> - OLED Screen: 128*64 px
>>
>> Flash instruction:
>> Support for sysupgrade directive upgrades, as well as luci upgrades.
>
> Hi,
>
> I retested this patch just to be sure I didn't miss anything before.
>
>
> Did you test this patch on actual hardware before sending this?
>
> I've got 2x e750-Mudi devices which:
>
> - I first flashed to the latest Gl.inet firmware (18.06 based) (works 
> fine)
>
> - Tried sysupgrade --> results in platform_check failure
>
> - Tried forced sysupgrade --> does not boot afterwards
>
> - Tried uboot recovery (both sysupgrade and factory images) --> does 
> not boot
>
>
> Using gl.inet official img, the uboot recovery mode works fine.
>
> Thanks,
>
> Koen
>
>
I just soldered UART to the board.
 
Ethernet is not coming up properly.
 
relevant prints:
 
 
[    0.551090] libphy: Fixed MDIO Bus: probed
[    0.872975] ag71xx 19000000.eth: Could not connect to PHY device. 
Deferring probe.
[    0.881098] ag71xx 1a000000.eth: invalid MAC address, using random 
address
[    1.139873] random: fast init done
[    1.520295] libphy: ag71xx_mdio: probed
[    1.525811] libphy: ar8xxx-mdio: probed
[    1.538905] switch0: Atheros AR8229 rev. 1 switch registered on mdio.0
[    1.587451] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 
[uid=00000000, driver=Generic PHY]
[    1.597499] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    1.605610] NET: Registered protocol family 10
[    1.614929] Segment Routing with IPv6
[    1.618900] NET: Registered protocol family 17
[    1.623601] 8021q: 802.1Q VLAN Support v1.8
[    1.631247] PCI host bridge /ahb/pcie-controller@180c0000 ranges:
[    1.637642]  MEM 0x0000000010000000..0x0000000013ffffff
[    1.643057]   IO 0x0000000000000000..0x0000000000000000
[    1.648655] PCI host bridge to bus 0000:00
[    1.652937] pci_bus 0000:00: root bus resource [mem 
0x10000000-0x13ffffff]
[    1.660051] pci_bus 0000:00: root bus resource [io  0x0000]
[    1.665824] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    1.672845] pci_bus 0000:00: No busn resource found for root bus, 
will use [bus 00-ff]
[    1.682374] pci 0000:00:00.0: BAR 0: assigned [mem 
0x10000000-0x101fffff 64bit]
[    1.690010] pci 0000:00:00.0: BAR 6: assigned [mem 
0x10200000-0x1020ffff pref]
[    2.013961] ag71xx 19000000.eth: connected to PHY at mdio.0:1f:04 
[uid=004dd042, driver=Generic PHY]
[    2.024473] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
 
[   10.293731] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   11.325088] eth0: link up (1000Mbps/Full duplex)
 
[   11.329934] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
 
[   17.716093] eth0: link down
 
 
this device also only has 1 ethernet port exposed on the board.
 
Regards,
 
Koen
Koen Vandeputte May 28, 2020, 8:04 a.m. UTC | #10
On 28.05.20 04:42, luochongjun@gl-inet.com wrote:
> Hi Koen,
>
> I'm really sorry that I missed your previous email.
>
> Tried sysupgrade --> results in platform_check failure.
> In the original device naming convention, E750 was named glinet,gl-e750
> However, in today's openwrt, the name of the device is glinet_gl-e750, 
> so platform_check failure is prompted.
> You'd better use uboot to upgrade your firmware, follow the link below 
> for the uboot upgrade steps
> https://docs.gl-inet.com/en/3/troubleshooting/debrick/
>
> this device also only has 1 ethernet port exposed on the board.
> Yes, the E750 has only one ethernet port,
> In E750, we only use GMAC0, but in ATH79 target, I had to initialize 
> P4 via GMAC1 connected to the Ethernet switch, so you'll see eth0 and 
> eth1 on your system.
> I have tried to use GMAC0 to initialize P4 directly, but after 
> initializing P4 in this way, the speed of P4 can only be 100M, not 
> 100M/10M.
>
> ------------------------------------------------------------------------
>
> */Best Regards/*
>

Hi Chongjun,


Thanks for the details.


Could you send a V3 to ensure ethernet is working?

Currently, there seems to be a mismatch and I suspect the wrong eth is 
being assigned with an IP.


Basically, the device is totally unreachable with the current patchset.


Thanks for your efforts,


Koen
Adrian Schmutzler May 28, 2020, 9:21 a.m. UTC | #11
Hi,

> > Tried sysupgrade --> results in platform_check failure.
> In the original device naming convention, E750 was named glinet,gl-e750
> However, in today's openwrt, the name of the device is glinet_gl-e750, so platform_check failure is prompted.

But SUPPORTED_DEVICES should still contain the string with comma: glinet,gl-e750

https://github.com/openwrt/openwrt/blob/master/target/linux/ath79/image/Makefile#L65

So, either that name is different on OEM firmware or the metadata is not present there, and we need custom code in upgrade/platform.sh

Best

Adrian
diff mbox series

Patch

diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
new file mode 100644
index 0000000..645c69a
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
@@ -0,0 +1,141 @@ 
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "qca953x.dtsi"
+
+/ {
+	compatible = "glinet,gl-e750", "qca,qca9531";
+	model = "GL.iNet GL-E750";
+
+	keys {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&jtag_disable_pins>;
+
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+		};
+
+		switch {
+			label = "switch";
+			linux,code = <BTN_0>;
+			gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+        gpio-export {
+                compatible = "gpio-export";
+                #size-cells = <0>;
+
+                gpio_lte_power {
+                        gpio-export,name = "lte";
+                        gpio-export,output = <1>;
+                        gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+                };
+        };
+
+};
+
+&pcie0 {
+	status = "okay";
+};
+
+&uart {
+	status = "okay";
+};
+
+&usb0 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	hub_port: port@1 {
+		reg = <1>;
+		#trigger-source-cells = <0>;
+	};
+};
+
+&usb_phy {
+	status = "okay";
+};
+
+&spi {
+	status = "okay";
+	num-cs = <2>;
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <25000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "u-boot";
+				reg = <0x0 0x40000>;
+				read-only;
+			};
+
+			partition@40000 {
+				label = "u-boot-env";
+				reg = <0x40000 0x10000>;
+			};
+
+			art: partition@50000 {
+				label = "art";
+				reg = <0x50000 0x10000>;
+				read-only;
+			};
+
+			partition@60000 {
+				label = "kernel";
+				reg = <0x60000 0x400000>;
+			};
+
+			partition@460000 {
+				label = "reserved";
+				reg = <0x460000 0xba0000>;
+			};
+
+		};
+	};
+
+	flash@1 {
+		compatible = "spi-nand";
+		reg = <1>;
+		spi-max-frequency = <25000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "ubi";
+				reg = <0x0 0x8000000>;
+			};
+		};
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	mtd-mac-address = <&art 0x0>;
+	phy-handle = <&swphy4>;
+};
+
+&wmac {
+	status = "okay";
+	mtd-cal-data = <&art 0x1000>;
+	mtd-mac-address = <&art 0x1002>;
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index d7f7eed..a50dfec 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -23,6 +23,7 @@  ath79_setup_interfaces()
 	dlink,dir-505|\
 	engenius,ecb1750|\
 	glinet,gl-ar300m-lite|\
+	glinet,gl-e750|\
 	netgear,ex6400|\
 	netgear,ex7300|\
 	ocedo,koala|\
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 3ccd199..e6743e4 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -130,6 +130,21 @@  define Device/glinet_gl-ar750s-nor
 endef
 TARGET_DEVICES += glinet_gl-ar750s-nor
 
+define Device/glinet_gl-e750
+  SOC := qca9531
+  DEVICE_VENDOR := GL.iNet
+  DEVICE_MODEL := GL-E750
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-usb2 \
+	kmod-usb-storage block-mount
+  KERNEL_SIZE := 4096k
+  IMAGE_SIZE := 131072k
+  PAGESIZE := 2048
+  VID_HDR_OFFSET := 2048
+  BLOCKSIZE := 128k
+  IMAGES += factory.img
+endef
+TARGET_DEVICES += glinet_gl-e750
+
 # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff)
 define Device/netgear_ath79_nand
   DEVICE_VENDOR := NETGEAR