[PATCH v2] ath79: add support for gl-e750

2020-07-11 Thread Luochongjun
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

MAC addresses based on vendor firmware:
LAN *:a0 art 0x0
2.4GHz *:a1 art 0x1002
5GHz *:a2 art calculated from art 0x0 + 2

Flash firmware:
Since openwrt's kernel already exceeds 2MB, upgrading from the official
version of GL-inet (v3.100) using the sysupgrade command will break the
kernel image. Users who are using version 3.100 can only upgrade via
uboot. The official guidance for GL-inet is as follows:
https://docs.gl-inet.com/en/3/troubleshooting/debrick/

In the future, GL-inet will modify the firmware to support the sysupgrade
command, so users will be able to upgrade directly with the sysupgrade
command in future releases.

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 
---
 target/linux/ath79/dts/qca9531_glinet_gl-e750.dts  | 140 +
 target/linux/ath79/image/nand.mk   |  18 +++
 .../ath79/nand/base-files/etc/board.d/02_network   |   3 +
 .../etc/hotplug.d/ieee80211/10-fix-wifi-mac|   8 ++
 4 files changed, 169 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 000..aba2087
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
@@ -0,0 +1,140 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca953x.dtsi"
+
+/ {
+   compatible = "glinet,gl-e750", "qca,qca9531";
+   model = "GL.iNet GL-E750";
+
+   aliases {
+   label-mac-device = 
+   };
+
+   keys {
+   compatible = "gpio-keys";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   switch {
+   label = "switch";
+   linux,code = ;
+   gpios = < 1 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+   gpio-export {
+   compatible = "gpio-export";
+   #size-cells = <0>;
+
+   gpio_lte_power {
+   gpio-export,name = "lte_power";
+   gpio-export,output = <1>;
+   gpios = < 0 GPIO_ACTIVE_HIGH>;
+   };
+};
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   num-cs = <2>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x4>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x4 0x1>;
+   };
+
+   art: partition@5 {
+   label = "art";
+   reg = <0x5 0x1>;
+   read-only;
+   };
+
+   partition@6 {
+   label = "kernel";
+   reg = <0x6 0x40>;
+   };
+
+   partition@46 {
+   label = "reserved";
+   reg = <0x46 0xba>;
+   };
+   };
+   };
+
+   flash@1 {
+ 

[PATCH] ath79: add support for gl-e750

2020-07-10 Thread Luochongjun
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 firmware:
Since openwrt's kernel already exceeds 2MB, upgrading from the official
version of GL-inet (v3.100) using the sysupgrade command will break the
kernel image. Users who are using version 3.100 can only upgrade via
uboot. The official guidance for GL-inet is as follows:
https://docs.gl-inet.com/en/3/troubleshooting/debrick/

In the future, GL-inet will modify the firmware to support the sysupgrade
command, so users will be able to upgrade directly with the sysupgrade
command in future releases.

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 
---
 target/linux/ath79/dts/qca9531_glinet_gl-e750.dts  | 140 +
 target/linux/ath79/image/nand.mk   |  19 +++
 .../ath79/nand/base-files/etc/board.d/02_network   |   3 +
 .../etc/hotplug.d/ieee80211/10-fix-wifi-mac|   8 ++
 4 files changed, 170 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 000..fc88bbd
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
@@ -0,0 +1,140 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca953x.dtsi"
+
+/ {
+   compatible = "glinet,gl-e750", "qca,qca9531";
+   model = "GL.iNet GL-E750";
+
+   keys {
+   compatible = "gpio-keys";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   switch {
+   label = "switch";
+   linux,code = ;
+   gpios = < 1 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+gpio-export {
+compatible = "gpio-export";
+#size-cells = <0>;
+
+gpio_lte_power {
+gpio-export,name = "lte_power";
+gpio-export,output = <1>;
+gpios = < 0 GPIO_ACTIVE_HIGH>;
+};
+};
+
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   hub_port: port@1 {
+   reg = <1>;
+   #trigger-source-cells = <0>;
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   num-cs = <2>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x4>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x4 0x1>;
+   };
+
+   art: partition@5 {
+   label = "art";
+   reg = <0x5 0x1>;
+   read-only;
+   };
+
+   partition@6 {
+   label = "kernel";
+   reg = <0x6 0x40>;
+   };
+
+   partition@46 {
+   label = "reserved";
+   reg = <0x46 0xba>;
+   };
+
+   };
+   };
+
+   

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

2020-05-07 Thread Luochongjun
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 
---
 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 000..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 
+#include 
+
+#include "qca953x.dtsi"
+
+/ {
+   compatible = "glinet,gl-e750", "qca,qca9531";
+   model = "GL.iNet GL-E750";
+
+   keys {
+   compatible = "gpio-keys";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   switch {
+   label = "switch";
+   linux,code = ;
+   gpios = < 1 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+gpio-export {
+compatible = "gpio-export";
+#size-cells = <0>;
+
+gpio_lte_power {
+gpio-export,name = "lte";
+gpio-export,output = <1>;
+gpios = < 0 GPIO_ACTIVE_HIGH>;
+};
+};
+
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   hub_port: port@1 {
+   reg = <1>;
+   #trigger-source-cells = <0>;
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   num-cs = <2>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x4>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x4 0x1>;
+   };
+
+   art: partition@5 {
+   label = "art";
+   reg = <0x5 0x1>;
+   read-only;
+   };
+
+   partition@6 {
+   label = "kernel";
+   reg = <0x6 0x40>;
+   };
+
+   partition@46 {
+   label = "reserved";
+   reg = <0x46 0xba>;
+   };
+
+   };
+   };
+
+   flash@1 {
+   compatible = "spi-nand";
+   reg = <1>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "ubi";
+   reg = <0x0 0x800>;
+ 

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

2020-04-28 Thread Luochongjun
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 
---
 target/linux/ath79/dts/qca9531_glinet_gl-e750.dts  | 146 +
 .../generic/base-files/etc/board.d/02_network  |   3 +
 target/linux/ath79/image/nand.mk   |  21 +++
 3 files changed, 170 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 000..36ba376
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts
@@ -0,0 +1,146 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca953x.dtsi"
+
+/ {
+   compatible = "glinet,gl-e750", "qca,qca9531";
+   model = "GL.iNet GL-E750";
+
+   keys {
+   compatible = "gpio-keys-polled";
+
+   poll-interval = <20>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   button0 {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   button1 {
+   label = "right";
+   linux,code = ;
+   gpios = < 1 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+gpio-export {
+compatible = "gpio-export";
+#size-cells = <0>;
+
+gpio_lte_power {
+gpio-export,name = "4G POWER";
+gpio-export,output = <1>;
+gpios = < 0 GPIO_ACTIVE_HIGH>;
+};
+};
+
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   hub_port: port@1 {
+   reg = <1>;
+   #trigger-source-cells = <0>;
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   num-cs = <2>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x04 0x01>;
+   };
+
+   art: partition@5 {
+   label = "art";
+   reg = <0x05 0x01>;
+   read-only;
+   };
+
+   partition@6 {
+   label = "kernel";
+   reg = <0x06 0x40>;
+   };
+
+   partition@46 {
+   label = "reserved";
+   reg = <0x46 0xba>;
+   };
+
+   };
+   };
+
+   flash@1 {
+   compatible = "spi-nand";
+   reg = <1>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "

[OpenWrt-Devel] [PATCH v2] ath79: add support for gl-ar750

2019-08-23 Thread Luochongjun
This patch supports gl-ar750, which was previously supported by ar71xx.

Specification:
- SOC: QCA9531 (650MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 10/100: 2xLAN + 10/100: 1xWAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Switch: 1x switch
- Button: 1x reset button
- LED: 3x LEDS (white)

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

Signed-off-by: Luochongjun 
---
 .../linux/ath79/base-files/etc/board.d/02_network  |   5 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts | 142 +
 target/linux/ath79/image/generic.mk|  10 ++
 4 files changed, 158 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index cb0853e..454f57d 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -156,6 +156,11 @@ ath79_setup_interfaces()
etactica,eg200)
ucidef_set_interface_lan "eth0" "dhcp"
;;
+   glinet,gl-ar750)
+   ucidef_set_interface_wan "eth1"
+   ucidef_add_switch "switch0" \
+   "0@eth0" "1:lan" "2:lan"
+   ;;
glinet,gl-ar750s)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:2" "3:lan:1" "1:wan"
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 421fb7d..ed34322 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -122,6 +122,7 @@ case "$FIRMWARE" in
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
;;
+   glinet,gl-ar750|\
glinet,gl-ar750s)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 
+1)
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts 
b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
new file mode 100644
index 000..54aad32
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
@@ -0,0 +1,142 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca953x.dtsi"
+
+/ {
+   compatible = "glinet,gl-ar750", "qca,qca9531";
+   model = "GL.iNet GL-AR750";
+
+   keys {
+   compatible = "gpio-keys";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   mode {
+   label = "mode";
+   linux,code = ;
+   gpios = < 0 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   power {
+   label = "gl-ar750:white:power";
+   gpios = < 12 GPIO_ACTIVE_LOW>;
+   default-state = "on";
+   };
+
+   wlan2g {
+   label = "gl-ar750:white:wlan2g";
+   gpios = < 14 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy1tpt";
+   };
+
+   wlan5g {
+   label = "gl-ar750:white:wlan5g";
+   gpios = < 13 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy0tpt";
+   };
+
+   };
+
+   i2c {
+   compatible = "i2c-gpio";
+
+   sda-gpios = < 17 GPIO_ACTIVE_LOW>;
+   scl-gpios = < 16 GPIO_ACTIVE_LOW>;
+   };
+
+
+};
+
+ {
+   status = "okay";
+
+   wifi@0,0 {
+   compatible = "qcom,ath10k";
+   reg = <0 0 0 0 0>;
+   device_type = "pci";
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   

[OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750

2019-07-25 Thread Luochongjun
This patch supports gl-ar750, which was previously supported by ar71xx.

Specification:
- SOC: QCA9531 (650MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 10/100: 2xLAN + 10/100: 1xWAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Switch: 1x switch
- Button: 1x reset button
- LED: 3x LEDS (white)

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

Signed-off-by: Luochongjun 
---
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts | 149 +
 target/linux/ath79/image/generic.mk|  10 ++
 3 files changed, 160 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts

diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 4118685..5c9fa2f 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -117,6 +117,7 @@ case "$FIRMWARE" in
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
;;
+   glinet,gl-ar750|\
glinet,gl-ar750s)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) 
+1)
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts 
b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
new file mode 100644
index 000..b8f9735
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca953x.dtsi"
+
+/ {
+   compatible = "glinet,gl-ar750", "qca,qca9531";
+   model = "GL.iNet GL-AR750";
+
+   keys {
+   compatible = "gpio-keys";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   mode {
+   label = "mode";
+   linux,code = ;
+   gpios = < 0 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   power {
+   label = "gl-ar750:white:power";
+   gpios = < 12 GPIO_ACTIVE_LOW>;
+   default-state = "on";
+   };
+
+   wlan2g {
+   label = "gl-ar750:white:wlan2g";
+   gpios = < 14 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy1tpt";
+   };
+
+   wlan5g {
+   label = "gl-ar750:white:wlan5g";
+   gpios = < 13 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy0tpt";
+   };
+
+   };
+
+   i2c {
+   compatible = "i2c-gpio";
+
+   sda-gpios = < 17 GPIO_ACTIVE_LOW>;
+   scl-gpios = < 16 GPIO_ACTIVE_LOW>;
+   };
+
+
+};
+
+ {
+   status = "okay";
+
+   wifi@0,0 {
+   compatible = "qcom,ath10k";
+   reg = <0 0 0 0 0>;
+   device_type = "pci";
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   hub_port: port@1 {
+   reg = <1>;
+   #trigger-source-cells = <0>;
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <

[OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750

2019-07-23 Thread Luochongjun
This patch supports gl-ar750, which was previously supported by ar71xx.

Specification:
- SOC: QCA9531 (650MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 10/100: 2xLAN + 10/100: 1xWAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Switch: 1x switch
- Button: 1x reset button
- LED: 3x LEDS (white)

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

Signed-off-by: Luochongjun 
---
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts | 149 +
 target/linux/ath79/image/generic.mk|   9 ++
 3 files changed, 159 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts

diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 8f0ea1d..6a9cb1c 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -116,6 +116,7 @@ case "$FIRMWARE" in
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
;;
+   glinet,gl-ar750|\
glinet,gl-ar750s)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) 
+1)
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts 
b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
new file mode 100644
index 000..b8f9735
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca953x.dtsi"
+
+/ {
+   compatible = "glinet,gl-ar750", "qca,qca9531";
+   model = "GL.iNet GL-AR750";
+
+   keys {
+   compatible = "gpio-keys";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   mode {
+   label = "mode";
+   linux,code = ;
+   gpios = < 0 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   power {
+   label = "gl-ar750:white:power";
+   gpios = < 12 GPIO_ACTIVE_LOW>;
+   default-state = "on";
+   };
+
+   wlan2g {
+   label = "gl-ar750:white:wlan2g";
+   gpios = < 14 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy1tpt";
+   };
+
+   wlan5g {
+   label = "gl-ar750:white:wlan5g";
+   gpios = < 13 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy0tpt";
+   };
+
+   };
+
+   i2c {
+   compatible = "i2c-gpio";
+
+   sda-gpios = < 17 GPIO_ACTIVE_LOW>;
+   scl-gpios = < 16 GPIO_ACTIVE_LOW>;
+   };
+
+
+};
+
+ {
+   status = "okay";
+
+   wifi@0,0 {
+   compatible = "qcom,ath10k";
+   reg = <0 0 0 0 0>;
+   device_type = "pci";
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   hub_port: port@1 {
+   reg = <1>;
+   #trigger-source-cells = <0>;
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <

[OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750

2019-06-26 Thread Luochongjun
This patch supports gl-ar750, which was previously supported by ar71xx.

Specification:
- SOC: QCA9531 (650MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 10/100: 2xLAN + 10/100: 1xWAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Switch: 1x switch
- Button: 1x reset button
- LED: 3x LEDS (white)

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

Signed-off-by: luochongjun 
---
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts | 151 +
 target/linux/ath79/image/generic.mk|   8 ++
 3 files changed, 160 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts

diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 8f0ea1d..6a9cb1c 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -116,6 +116,7 @@ case "$FIRMWARE" in
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
;;
+   glinet,gl-ar750|\
glinet,gl-ar750s)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) 
+1)
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts 
b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
new file mode 100644
index 000..c20cdf5
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
@@ -0,0 +1,151 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca953x.dtsi"
+
+/ {
+   compatible = "glinet,gl-ar750", "qca,qca9531";
+   model = "GL.iNet GL-AR750";
+
+   keys {
+   compatible = "gpio-keys";
+
+   poll-interval = <20>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   mode {
+   label = "mode";
+   linux,code = ;
+   gpios = < 0 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   power {
+   label = "gl-ar750:white:power";
+   gpios = < 12 GPIO_ACTIVE_LOW>;
+   default-state = "on";
+   };
+
+   wlan2g {
+   label = "gl-ar750:white:wlan2g";
+   gpios = < 14 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy1tpt";
+   };
+
+   wlan5g {
+   label = "gl-ar750:white:wlan5g";
+   gpios = < 13 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy0tpt";
+   };
+
+   };
+
+   i2c {
+   compatible = "i2c-gpio";
+
+   sda-gpios = < 17 GPIO_ACTIVE_LOW>;
+   scl-gpios = < 16 GPIO_ACTIVE_LOW>;
+   };
+
+
+};
+
+ {
+   status = "okay";
+
+   wifi@0,0 {
+   compatible = "qcom,ath10k";
+   reg = <0 0 0 0 0>;
+   device_type = "pci";
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   hub_port: port@1 {
+   reg = <1>;
+   #trigger-source-cells = <0>;
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   

[OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750

2019-06-24 Thread Luochongjun
This patch support gl-ar750 on ath79.

Signed-off-by: Luo chongjun 
---
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts | 149 +
 target/linux/ath79/image/generic.mk|   8 ++
 3 files changed, 158 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts

diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 8f0ea1d..6a9cb1c 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -116,6 +116,7 @@ case "$FIRMWARE" in
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
;;
+   glinet,gl-ar750|\
glinet,gl-ar750s)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) 
+1)
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts 
b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
new file mode 100644
index 000..c173f0d
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca953x.dtsi"
+
+/ {
+   compatible = "glinet,gl-ar750", "qca,qca9531";
+   model = "GL.iNet GL-AR750";
+
+   keys {
+   compatible = "gpio-keys-polled";
+
+   poll-interval = <20>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   mode {
+label = "mode";
+linux,code = ;
+gpios = < 0 GPIO_ACTIVE_LOW>;
+};
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   power {
+   label = "gl-ar750:green:power";
+   gpios = < 12 GPIO_ACTIVE_LOW>;
+   default-state = "on";
+   };
+
+   wlan2g {
+   label = "gl-ar750:green:wlan2g";
+   gpios = < 14 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy1tpt";
+   };
+
+   wlan5g {
+   label = "gl-ar750:green:wlan5g";
+   gpios = < 13 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy0tpt";
+   };
+
+   };
+
+   i2c {
+compatible = "i2c-gpio";
+
+sda-gpios = < 17 GPIO_ACTIVE_LOW>;
+scl-gpios = < 16 GPIO_ACTIVE_LOW>;
+
+/* can be removed on 4.19 */
+gpios = < 17 GPIO_ACTIVE_LOW>,
+< 16 GPIO_ACTIVE_LOW>;
+
+};
+
+
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   hub_port: port@1 {
+   reg = <1>;
+   #trigger-source-cells = <0>;
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x04 0x01>;
+   };
+
+   art: partition@5 {
+   label = "art";
+   reg = <0x05 0x01>;
+   read-only;
+   };
+
+   partition@6 {
+   compatible = "denx,uimage";
+   label = "firmware";
+   reg = <0x06 0xfa>;
+   };
+   };
+   };
+};
+
+ {
+   status = "okay";
+   mtd-mac-address = < 0x0>;
+   phy-handle = <>;
+};
+
+ {
+   mtd-mac-address = < 0x0>;
+   mtd-mac-address-increment = <1>;
+};
+
+ {
+   status = "okay";
+   mtd-cal-data = 

[OpenWrt-Devel] [PATCH] Modify glinet x750 and AR300m MAC address offsets

2019-02-22 Thread Luochongjun
In the production of glinet, the MAC address of ethernet port is only written
at the position where the ART area offset address is 0, and the MAC address of
eth1 is added 1 on the basis of eth0.

Signed-off-by: Luochongjun 
---
 target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi | 3 ++-
 target/linux/ath79/dts/qca9531_glinet_gl-x750.dts| 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi 
b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
index fe986bd..55002b4 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
@@ -84,7 +84,8 @@
 };
 
  {
-   mtd-mac-address = < 0x6>;
+   mtd-mac-address = < 0x0>;
+   mtd-mac-address-increment = <1>;
 };
 
  {
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts 
b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
index f8a5119..79cd516 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
@@ -126,7 +126,8 @@
 };
 
  {
-   mtd-mac-address = < 0x6>;
+   mtd-mac-address = < 0x0>;
+   mtd-mac-address-increment = <1>;
 };
 
  {
-- 
2.7.4




___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ath79:add partition compatiable gl_x750 and ar300m_nor

2018-11-29 Thread Luochongjun
This commit adds firmware partition compatible for the gl-x750 and gl-ar300m-nor

Signed-off-by: Luo chongjun 
---
 target/linux/ath79/dts/qca9533_glinet_ar300m_nor.dts | 1 +
 target/linux/ath79/dts/qca9533_glinet_gl-x750.dts| 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/ath79/dts/qca9533_glinet_ar300m_nor.dts 
b/target/linux/ath79/dts/qca9533_glinet_ar300m_nor.dts
index 9357ea6..7b444fa 100644
--- a/target/linux/ath79/dts/qca9533_glinet_ar300m_nor.dts
+++ b/target/linux/ath79/dts/qca9533_glinet_ar300m_nor.dts
@@ -31,6 +31,7 @@
};
 
partition@2 {
+   compatible = "denx,uimage";
label = "firmware";
reg = <0x05 0xfa>;
};
diff --git a/target/linux/ath79/dts/qca9533_glinet_gl-x750.dts 
b/target/linux/ath79/dts/qca9533_glinet_gl-x750.dts
index 14bad8a..65cc05e 100644
--- a/target/linux/ath79/dts/qca9533_glinet_gl-x750.dts
+++ b/target/linux/ath79/dts/qca9533_glinet_gl-x750.dts
@@ -113,6 +113,7 @@
};
 
partition@6 {
+   compatible = "denx,uimage";
label = "firmware";
reg = <0x06 0xfa>;
};
-- 
2.7.4




___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ath79: add support for GL-iNet GL-X750

2018-11-04 Thread Luochongjun
this patch adds supports for GL-X750.

Specification:
- SOC: QCA9531 (650MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 10/100: 1xLAN + 10/100: 1xWAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Button: 1x reset button
- LED: 5x LEDS (green)

Flash instruction:
The original firmware is openwrt, so both LuCI or sysupgrade can be used.

Signed-off-by: Luo chongjun 
---
 target/linux/ath79/base-files/etc/board.d/01_leds  |  3 +
 .../linux/ath79/base-files/etc/board.d/02_network  |  1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |  4 +
 target/linux/ath79/dts/qca9533_glinet_x750.dts | 46 +++
 target/linux/ath79/dts/qca9533_glinet_x750.dtsi| 95 ++
 target/linux/ath79/image/generic.mk|  8 ++
 6 files changed, 157 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9533_glinet_x750.dts
 create mode 100644 target/linux/ath79/dts/qca9533_glinet_x750.dtsi

diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds 
b/target/linux/ath79/base-files/etc/board.d/01_leds
index f04eb7f..62584e2 100755
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
@@ -33,6 +33,9 @@ etactica,eg200)
ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" 
"33"
ucidef_set_led_default "etactica" "etactica" "$boardname:red:etactica" 
"ignore"
;;
+glinet,x750)
+   ucidef_set_led_netdev "wan" "WAN" "gl-x750:green:wan" "eth0"
+   ;;
 netgear,wnr612-v2|\
 on,n150r)
ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0"
diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 56eb42f..c18558e 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -69,6 +69,7 @@ ath79_setup_interfaces()
ucidef_set_interface_lan "eth0" "dhcp"
;;
glinet,ar150|\
+   glinet,x750|\
glinet,ar300m)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 9365d67..dbd64af 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -87,6 +87,10 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath10k/cal-pci-:00:00.0.bin")
case $board in
+   glinet,x750)
+   ath10kcal_extract "art" 20480 2116
+   ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
+   ;;
iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr2)
ath10kcal_extract "art" 20480 2116
diff --git a/target/linux/ath79/dts/qca9533_glinet_x750.dts 
b/target/linux/ath79/dts/qca9533_glinet_x750.dts
new file mode 100644
index 000..7313f96
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_glinet_x750.dts
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca9533_glinet_x750.dtsi"
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x04 0x01>;
+   };
+
+art: partition@5 {
+label = "art";
+reg = <0x05 0x01>;
+};
+
+   partition@6 {
+   label = "firmware";
+   reg = <0x06 0xfa>;
+   };
+
+   };
+   };
+};
diff --git a/target/linux/ath79/dts/qca9533_glinet_x750.dtsi 
b/target/linux/ath79/dts/qca9533_glinet_x750.dtsi
new file mode 100644
index 000..b84c332
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_glinet_x750.dtsi
@@ -0,0 +1,95 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "qca9533.dtsi"
+
+/ {
+   compatible = "glinet,x750", "qca,qca9533";
+   model = "GL.iNet GL-X750";
+
+   keys {
+   compatible = "gpio-keys-polled";
+   poll-interval = <20>;

[OpenWrt-Devel] [PATCH] ath79: add support for GL-iNet GL-X750

2018-11-01 Thread Luochongjun
this patch adds supports for GL-X750.

Specification:
- SOC: QCA9531 (650MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 10/100: 1xLAN + 10/100: 1xWAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Button: 1x reset button
- LED: 5x LEDS (green)

Flash instruction:
The original firmware is openwrt, so both LuCI or sysupgrade can be used.

Signed-off-by: Luo chongjun 
---
 target/linux/ath79/base-files/etc/board.d/01_leds  |  3 +
 .../linux/ath79/base-files/etc/board.d/02_network  |  1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |  4 +
 target/linux/ath79/dts/qca9533_glinet_x750.dts | 45 +++
 target/linux/ath79/dts/qca9533_glinet_x750.dtsi| 92 ++
 target/linux/ath79/image/generic.mk|  8 ++
 6 files changed, 153 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9533_glinet_x750.dts
 create mode 100644 target/linux/ath79/dts/qca9533_glinet_x750.dtsi

diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds 
b/target/linux/ath79/base-files/etc/board.d/01_leds
index f04eb7f..62584e2 100755
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
@@ -33,6 +33,9 @@ etactica,eg200)
ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" 
"33"
ucidef_set_led_default "etactica" "etactica" "$boardname:red:etactica" 
"ignore"
;;
+glinet,x750)
+   ucidef_set_led_netdev "wan" "WAN" "gl-x750:green:wan" "eth0"
+   ;;
 netgear,wnr612-v2|\
 on,n150r)
ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0"
diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 56eb42f..c18558e 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -69,6 +69,7 @@ ath79_setup_interfaces()
ucidef_set_interface_lan "eth0" "dhcp"
;;
glinet,ar150|\
+   glinet,x750|\
glinet,ar300m)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 9365d67..dbd64af 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -87,6 +87,10 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath10k/cal-pci-:00:00.0.bin")
case $board in
+   glinet,x750)
+   ath10kcal_extract "art" 20480 2116
+   ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
+   ;;
iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr2)
ath10kcal_extract "art" 20480 2116
diff --git a/target/linux/ath79/dts/qca9533_glinet_x750.dts 
b/target/linux/ath79/dts/qca9533_glinet_x750.dts
new file mode 100644
index 000..e1ddb1d
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_glinet_x750.dts
@@ -0,0 +1,45 @@
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca9533_glinet_x750.dtsi"
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x04 0x01>;
+   };
+
+art: partition@5 {
+label = "art";
+reg = <0x05 0x01>;
+};
+
+   partition@6 {
+   label = "firmware";
+   reg = <0x06 0xfa>;
+   };
+
+   };
+   };
+};
diff --git a/target/linux/ath79/dts/qca9533_glinet_x750.dtsi 
b/target/linux/ath79/dts/qca9533_glinet_x750.dtsi
new file mode 100644
index 000..0654a1f
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_glinet_x750.dtsi
@@ -0,0 +1,92 @@
+#include "qca9533.dtsi"
+
+/ {
+   compatible = "glinet,x750", "qca,qca9533";
+   model = "GL.iNet GL-X750";
+
+   keys {
+   compatible = "gpio-keys-polled";
+   poll-interval = <20>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   button0 {
+  

[OpenWrt-Devel] [PATCH] ath79: add support for GL-iNet GL-X750

2018-10-11 Thread Luochongjun
this patch adds supports for GL-X750.

Specification:
- SOC: QCA9531 (650MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 10/100: 1xLAN + 10/100: 1xWAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Button: 1x reset button
- LED: 5x LEDS (green)

Flash instruction:
The original firmware is openwrt, so both LuCI or sysupgrade can be used.

Signed-off-by: Luo chongjun 
---
 target/linux/ath79/base-files/etc/board.d/01_leds  |  3 +
 .../linux/ath79/base-files/etc/board.d/02_network  |  1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |  4 +
 target/linux/ath79/dts/qca9533_glinet_x750.dts | 45 +++
 target/linux/ath79/dts/qca9533_glinet_x750.dtsi| 92 ++
 target/linux/ath79/image/generic.mk|  8 ++
 6 files changed, 153 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9533_glinet_x750.dts
 create mode 100644 target/linux/ath79/dts/qca9533_glinet_x750.dtsi

diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds 
b/target/linux/ath79/base-files/etc/board.d/01_leds
index f04eb7f..62584e2 100755
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
@@ -33,6 +33,9 @@ etactica,eg200)
ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" 
"33"
ucidef_set_led_default "etactica" "etactica" "$boardname:red:etactica" 
"ignore"
;;
+glinet,x750)
+   ucidef_set_led_netdev "wan" "WAN" "gl-x750:green:wan" "eth0"
+   ;;
 netgear,wnr612-v2|\
 on,n150r)
ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0"
diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 56eb42f..c18558e 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -69,6 +69,7 @@ ath79_setup_interfaces()
ucidef_set_interface_lan "eth0" "dhcp"
;;
glinet,ar150|\
+   glinet,x750|\
glinet,ar300m)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 9365d67..dbd64af 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -87,6 +87,10 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath10k/cal-pci-:00:00.0.bin")
case $board in
+   glinet,x750)
+   ath10kcal_extract "art" 20480 2116
+   ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
+   ;;
iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr2)
ath10kcal_extract "art" 20480 2116
diff --git a/target/linux/ath79/dts/qca9533_glinet_x750.dts 
b/target/linux/ath79/dts/qca9533_glinet_x750.dts
new file mode 100644
index 000..e1ddb1d
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_glinet_x750.dts
@@ -0,0 +1,45 @@
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca9533_glinet_x750.dtsi"
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x04 0x01>;
+   };
+
+art: partition@5 {
+label = "art";
+reg = <0x05 0x01>;
+};
+
+   partition@6 {
+   label = "firmware";
+   reg = <0x06 0xfa>;
+   };
+
+   };
+   };
+};
diff --git a/target/linux/ath79/dts/qca9533_glinet_x750.dtsi 
b/target/linux/ath79/dts/qca9533_glinet_x750.dtsi
new file mode 100644
index 000..0654a1f
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_glinet_x750.dtsi
@@ -0,0 +1,92 @@
+#include "qca9533.dtsi"
+
+/ {
+   compatible = "glinet,x750", "qca,qca9533";
+   model = "GL.iNet GL-X750";
+
+   keys {
+   compatible = "gpio-keys-polled";
+   poll-interval = <20>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   button0 {
+  

[OpenWrt-Devel] [PATCH] ath79: add support for GL-iNet GL-X750

2018-10-10 Thread Luochongjun
this patch adds supports for GL-X750.

Specification:
- SOC: QCA9531 (650MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 10/100: 1xLAN + 10/100: 1xWAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Button: 1x reset button
- LED: 5x LEDS (green)

Flash instruction:
The original firmware is openwrt, so both LuCI or sysupgrade can be used.

Signed-off-by: Luo chongjun 
---
 target/linux/ath79/base-files/etc/board.d/01_leds  |  3 +
 .../linux/ath79/base-files/etc/board.d/02_network  |  1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |  1 +
 target/linux/ath79/dts/qca9533_glinet_x750.dts | 45 ++
 target/linux/ath79/dts/qca9533_glinet_x750.dtsi| 97 ++
 target/linux/ath79/image/generic.mk|  9 ++
 6 files changed, 156 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9533_glinet_x750.dts
 create mode 100644 target/linux/ath79/dts/qca9533_glinet_x750.dtsi

diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds 
b/target/linux/ath79/base-files/etc/board.d/01_leds
index f04eb7f..46ea99a 100755
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
@@ -42,6 +42,9 @@ on,n150r)
 pcs,cap324)
ucidef_set_led_netdev "lan" "LAN" "pcs:lan:green" "eth0"
;;
+glinet,x750)
+   ucidef_set_led_netdev "wan" "WAN" "gl-x750:green:wan" "eth0"
+   ;;
 pcs,cr3000)
ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 56eb42f..c18558e 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -69,6 +69,7 @@ ath79_setup_interfaces()
ucidef_set_interface_lan "eth0" "dhcp"
;;
glinet,ar150|\
+   glinet,x750|\
glinet,ar300m)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 9365d67..4768488 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -104,6 +104,7 @@ case "$FIRMWARE" in
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth1/address) -1)
;;
+   glinet,x750|\
tplink,re450-v2)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
diff --git a/target/linux/ath79/dts/qca9533_glinet_x750.dts 
b/target/linux/ath79/dts/qca9533_glinet_x750.dts
new file mode 100644
index 000..2a4044b
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_glinet_x750.dts
@@ -0,0 +1,45 @@
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca9533_glinet_x750.dtsi"
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   compatible = "winbond,w25q128", "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@1 {
+   label = "u-boot-env";
+   reg = <0x04 0x01>;
+   };
+
+art: partition@2 {
+label = "art";
+reg = <0x05 0x01>;
+};
+
+   partition@3 {
+   label = "firmware";
+   reg = <0x06 0xfa>;
+   };
+
+   };
+   };
+};
diff --git a/target/linux/ath79/dts/qca9533_glinet_x750.dtsi 
b/target/linux/ath79/dts/qca9533_glinet_x750.dtsi
new file mode 100644
index 000..5cce0e7
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_glinet_x750.dtsi
@@ -0,0 +1,97 @@
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca9533.dtsi"
+
+/ {
+   compatible = "glinet,x750", "qca,qca9533";
+   model = "GL.iNet GL-X750";
+
+   keys {
+   compatible = "gpio-keys-polled";
+   poll-interval = <20>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   button0 {
+   label = 

[OpenWrt-Devel] [PATCH] this patch adds supports for GL-X750. Specification: - SOC: QCA9531 (650MHz) - Flash: 16 MiB (W25Q128FVSG) - RAM: 128 MiB DDR2 - Ethernet: 10/100: 1xLAN + 10/100: 1xWAN - Wirel

2018-10-10 Thread Luochongjun
Flash instruction:
The original firmware is openwrt, so both LuCI or sysupgrade can be used.

Signed-off-by: Luo chongjun 
---
 target/linux/ath79/base-files/etc/board.d/01_leds  |  3 +
 .../linux/ath79/base-files/etc/board.d/02_network  |  1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |  1 +
 target/linux/ath79/dts/qca9533_glinet_x750.dts | 45 ++
 target/linux/ath79/dts/qca9533_glinet_x750.dtsi| 97 ++
 target/linux/ath79/image/generic.mk|  9 ++
 6 files changed, 156 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9533_glinet_x750.dts
 create mode 100644 target/linux/ath79/dts/qca9533_glinet_x750.dtsi

diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds 
b/target/linux/ath79/base-files/etc/board.d/01_leds
index f04eb7f..46ea99a 100755
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
@@ -42,6 +42,9 @@ on,n150r)
 pcs,cap324)
ucidef_set_led_netdev "lan" "LAN" "pcs:lan:green" "eth0"
;;
+glinet,x750)
+   ucidef_set_led_netdev "wan" "WAN" "gl-x750:green:wan" "eth0"
+   ;;
 pcs,cr3000)
ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 56eb42f..c18558e 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -69,6 +69,7 @@ ath79_setup_interfaces()
ucidef_set_interface_lan "eth0" "dhcp"
;;
glinet,ar150|\
+   glinet,x750|\
glinet,ar300m)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 9365d67..4768488 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -104,6 +104,7 @@ case "$FIRMWARE" in
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth1/address) -1)
;;
+   glinet,x750|\
tplink,re450-v2)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
diff --git a/target/linux/ath79/dts/qca9533_glinet_x750.dts 
b/target/linux/ath79/dts/qca9533_glinet_x750.dts
new file mode 100644
index 000..2a4044b
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_glinet_x750.dts
@@ -0,0 +1,45 @@
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca9533_glinet_x750.dtsi"
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   compatible = "winbond,w25q128", "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@1 {
+   label = "u-boot-env";
+   reg = <0x04 0x01>;
+   };
+
+art: partition@2 {
+label = "art";
+reg = <0x05 0x01>;
+};
+
+   partition@3 {
+   label = "firmware";
+   reg = <0x06 0xfa>;
+   };
+
+   };
+   };
+};
diff --git a/target/linux/ath79/dts/qca9533_glinet_x750.dtsi 
b/target/linux/ath79/dts/qca9533_glinet_x750.dtsi
new file mode 100644
index 000..5cce0e7
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_glinet_x750.dtsi
@@ -0,0 +1,97 @@
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca9533.dtsi"
+
+/ {
+   compatible = "glinet,x750", "qca,qca9533";
+   model = "GL.iNet GL-X750";
+
+   keys {
+   compatible = "gpio-keys-polled";
+   poll-interval = <20>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   button0 {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   power {
+   label = "gl-x750:green:power";
+   

[OpenWrt-Devel] [PATCH v3] ar71xx: add support for GL.iNet GL-AR750S

2018-05-25 Thread Luochongjun
ar71xx/config-4.9
@@ -120,6 +120,7 @@ CONFIG_ATH79=y
 # CONFIG_ATH79_MACH_GL_AR300 is not set
 # CONFIG_ATH79_MACH_GL_AR300M is not set
 # CONFIG_ATH79_MACH_GL_AR750 is not set
+# CONFIG_ATH79_MACH_GL_AR750S is not set
 # CONFIG_ATH79_MACH_GL_DOMINO is not set
 # CONFIG_ATH79_MACH_GL_INET is not set
 # CONFIG_ATH79_MACH_GL_MIFI is not set
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 
b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 40d33b5..e5fb0bc 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -814,6 +814,17 @@ config ATH79_MACH_GL_AR750
select ATH79_DEV_USB
select ATH79_DEV_WMAC
 
+config ATH79_MACH_GL_AR750S
+   bool "GL.iNet GL-AR750S support"
+   select SOC_QCA956X
+   select ATH79_DEV_AP9X_PCI if PCI
+   select ATH79_DEV_ETH
+   select ATH79_DEV_GPIO_BUTTONS
+   select ATH79_DEV_LEDS_GPIO
+   select ATH79_DEV_M25P80
+   select ATH79_DEV_USB
+   select ATH79_DEV_WMAC
+
 config ATH79_MACH_GL_DOMINO
bool "DOMINO support"
select SOC_AR933X
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile 
b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 2124ab7..ae3fc67 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -130,6 +130,7 @@ obj-$(CONFIG_ATH79_MACH_GL_AR150)   += 
mach-gl-ar150.o
 obj-$(CONFIG_ATH79_MACH_GL_AR300)  += mach-gl-ar300.o
 obj-$(CONFIG_ATH79_MACH_GL_AR300M) += mach-gl-ar300m.o
 obj-$(CONFIG_ATH79_MACH_GL_AR750)  += mach-gl-ar750.o
+obj-$(CONFIG_ATH79_MACH_GL_AR750S) += mach-gl-ar750s.o
 obj-$(CONFIG_ATH79_MACH_GL_DOMINO) += mach-gl-domino.o
 obj-$(CONFIG_ATH79_MACH_GL_INET)   += mach-gl-inet.o
 obj-$(CONFIG_ATH79_MACH_GL_MIFI)   += mach-gl-mifi.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c
new file mode 100755
index 000..b556f9b
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c
@@ -0,0 +1,193 @@
+/*
+ *  GL.iNet GL-AR750S board support
+ *
+ *  Copyright (C) 2018 luochongjun <luochong...@gl-inet.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "common.h"
+#include "dev-ap9x-pci.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-spi.h"
+#include "dev-m25p80.h"
+#include "dev-wmac.h"
+#include "dev-usb.h"
+#include "machtypes.h"
+
+
+#define GL_AR750S_KEYS_POLL_INTERVAL   20
+#define GL_AR750S_KEYS_DEBOUNCE_INTERVAL   (3 * 
GL_AR750S_KEYS_POLL_INTERVAL)
+
+
+#define GL_AR750S_GPIO_LED_WLAN2G   19
+#define GL_AR750S_GPIO_LED_WLAN5G   20
+#define GL_AR750S_GPIO_LED_POWER   1
+#define GL_AR750S_GPIO_USB_POWER   7
+
+#define GL_AR750S_GPIO_BTN_RESET   2
+#define GL_AR750S_GPIO_BTN_RIGHT   8
+
+#define GL_AR750S_MAC0_OFFSET 0x
+#define GL_AR750S_WMAC_CALDATA_OFFSET 0x1000
+#define GL_AR750S_PCI_CALDATA_OFFSET  0x5000
+
+#define GL_AR750S_GPIO_I2C_SDA 5
+#define GL_AR750S_GPIO_I2C_SCL 21
+
+
+
+static struct spi_board_info gl_ar750s_spi_info[] = {
+{
+.bus_num= 0,
+.chip_select= 0,
+.max_speed_hz   = 2500,
+.modalias   = "m25p80",
+.platform_data  = NULL,
+},
+};
+
+static struct ath79_spi_platform_data gl_ar750s_spi_data = {
+.bus_num= 0,
+.num_chipselect = 2,
+};
+
+static struct gpio_led gl_ar750s_leds_gpio[] __initdata = {
+   {
+.name   = "gl-ar750s:green:power",
+.gpio   = GL_AR750S_GPIO_LED_POWER,
+   .default_state  = LEDS_GPIO_DEFSTATE_KEEP,
+   .active_low = 1,
+},{
+.name   = "gl-ar750s:green:usbpower",
+.gpio   = GL_AR750S_GPIO_USB_POWER,
+   .active_low = 1,
+},{
+   .name   = "gl-ar750s:green:wlan2g",
+   .gpio   = GL_AR750S_GPIO_LED_WLAN2G,
+   .active_low = 1,
+   },{
+   .name   = "gl-ar750s:green:wlan5g",
+   .gpio   = GL_AR750S_GPIO_LED_WLAN5G,
+   .active_low = 0,
+   }
+};
+
+static struct gpio_keys_button gl_ar750s_gpio_keys[] __initdata = {
+{
+

[OpenWrt-Devel] [PATCH v2 1/2] ar71xx: add support for GL.iNet GL-AR750S

2018-05-20 Thread Luochongjun
This patch adds supports for GL-AR750S.

Specification:
- SOC: QCA9563 (775MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 2x 1Gbps LAN + 1x 1Gbps WAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Button: 1x switch button, 1x reset button
- LED: 3x LEDS (green)

Flash instruction:
Apply factory image via web-gui.

Signed-off-by: Luo chongjun 
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   4 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.9 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c  | 195 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/generic/config-default |   1 +
 target/linux/ar71xx/image/generic.mk   |  13 ++
 12 files changed, 236 insertions(+)
 create mode 100755 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 52f1ac3..f436854 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -385,6 +385,10 @@ gl-ar750)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:white:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:white:wlan5g" "phy0tpt"
;;
+gl-ar750s)
+   ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:green:wlan2g" "phy1tpt"
+   ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
+   ;;
 gl-mifi)
ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 5898261..5f87ab1 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -432,6 +432,10 @@ ar71xx_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth1" "1:lan" "2:lan"
;;
+   gl-ar750s)
+   ucidef_add_switch "switch0" \
+   "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
+   ;;
jwap230)
ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
ucidef_add_switch "switch0" \
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 5d01701..f82026c 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -99,6 +99,7 @@ case "$FIRMWARE" in
ath10kcal_extract "caldata" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
;;
+   gl-ar750s|\
gl-ar750|\
tl-wpa8630)
ath10kcal_extract "art" 20480 2116
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 42bd80d..74aa21b 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -727,6 +727,9 @@ ar71xx_board_detect() {
*"GL-AR750")
name="gl-ar750"
;;
+   *"GL-AR750S")
+   name="gl-ar750s"
+   ;;
*"GL-CONNECT INET v1")
name="gl-inet"
 
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 284582f..d0a3f30 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -260,6 +260,7 @@ platform_check_image() {
gl-ar300m|\
gl-ar300|\
gl-ar750|\
+   gl-ar750s|\
gl-domino|\
gl-mifi|\
gl-usb150|\
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 35efd17..a453e10 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -120,6 +120,7 @@ CONFIG_ATH79=y
 # CONFIG_ATH79_MACH_GL_AR300 is not set
 # CONFIG_ATH79_MACH_GL_AR300M is not set
 # CONFIG_ATH79_MACH_GL_AR750 is not set
+# CONFIG_ATH79_MACH_GL_AR750S is not set
 # CONFIG_ATH79_MACH_GL_DOMINO is not set
 # CONFIG_ATH79_MACH_GL_INET is not set
 # CONFIG_ATH79_MACH_GL_MIFI is not set
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 

[OpenWrt-Devel] [PATCH v2 2/2] modify the header of the mach-gl-ar750s.c

2018-05-20 Thread Luochongjun
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c
index 8457a0c..b556f9b 100755
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c
@@ -1,9 +1,7 @@
 /*
- *  Ubiquiti UniFi AC (LITE) board support
+ *  GL.iNet GL-AR750S board support
  *
- *  Copyright (C) 2015-2016 P. Wassi 
- *
- *  Derived from: mach-ubnt-xm.c
+ *  Copyright (C) 2018 luochongjun <luochong...@gl-inet.com>
  *
  *  This program is free software; you can redistribute it and/or modify it
  *  under the terms of the GNU General Public License version 2 as published
-- 
2.7.4




___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: add support for GL.iNet GL-AR750S

2018-05-18 Thread Luochongjun
This patch adds supports for GL-AR750S.

Specification:
- SOC: QCA9563 (775MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 2x 1Gbps LAN + 1x 1Gbps WAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Button: 1x switch button, 1x reset button
- LED: 3x LEDS (green)

Flash instruction:
Apply factory image via web-gui.

Signed-off-by: Luo chongjun 
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   4 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.9 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c  | 195 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/generic/config-default |   1 +
 target/linux/ar71xx/image/generic.mk   |  13 ++
 12 files changed, 236 insertions(+)
 create mode 100755 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 52f1ac3..f436854 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -385,6 +385,10 @@ gl-ar750)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:white:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:white:wlan5g" "phy0tpt"
;;
+gl-ar750s)
+   ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:green:wlan2g" "phy1tpt"
+   ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
+   ;;
 gl-mifi)
ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 5898261..5f87ab1 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -432,6 +432,10 @@ ar71xx_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth1" "1:lan" "2:lan"
;;
+   gl-ar750s)
+   ucidef_add_switch "switch0" \
+   "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
+   ;;
jwap230)
ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
ucidef_add_switch "switch0" \
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 5d01701..f82026c 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -99,6 +99,7 @@ case "$FIRMWARE" in
ath10kcal_extract "caldata" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
;;
+   gl-ar750s|\
gl-ar750|\
tl-wpa8630)
ath10kcal_extract "art" 20480 2116
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 42bd80d..74aa21b 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -727,6 +727,9 @@ ar71xx_board_detect() {
*"GL-AR750")
name="gl-ar750"
;;
+   *"GL-AR750S")
+   name="gl-ar750s"
+   ;;
*"GL-CONNECT INET v1")
name="gl-inet"
 
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 284582f..d0a3f30 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -260,6 +260,7 @@ platform_check_image() {
gl-ar300m|\
gl-ar300|\
gl-ar750|\
+   gl-ar750s|\
gl-domino|\
gl-mifi|\
gl-usb150|\
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 35efd17..a453e10 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -120,6 +120,7 @@ CONFIG_ATH79=y
 # CONFIG_ATH79_MACH_GL_AR300 is not set
 # CONFIG_ATH79_MACH_GL_AR300M is not set
 # CONFIG_ATH79_MACH_GL_AR750 is not set
+# CONFIG_ATH79_MACH_GL_AR750S is not set
 # CONFIG_ATH79_MACH_GL_DOMINO is not set
 # CONFIG_ATH79_MACH_GL_INET is not set
 # CONFIG_ATH79_MACH_GL_MIFI is not set
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 

[OpenWrt-Devel] [PATCH] ar71xx: add support for GL.iNet GL-AR750S

2018-05-18 Thread Luochongjun
This patch adds supports for GL-AR750S.

Specification:
- SOC: QCA9563 (775MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 2x 1Gbps LAN + 1x 1Gbps WAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Button: 1x switch button, 1x reset button
- LED: 3x LEDS (green)

Flash instruction:
Apply factory image via web-gui.

Signed-off-by: Luo chongjun 
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   4 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.9 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c  | 195 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/generic/config-default |   1 +
 target/linux/ar71xx/image/generic.mk   |  13 ++
 12 files changed, 236 insertions(+)
 create mode 100755 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750s.c

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 52f1ac3..f436854 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -385,6 +385,10 @@ gl-ar750)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:white:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:white:wlan5g" "phy0tpt"
;;
+gl-ar750s)
+   ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:green:wlan2g" "phy1tpt"
+   ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
+   ;;
 gl-mifi)
ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 5898261..5f87ab1 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -432,6 +432,10 @@ ar71xx_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth1" "1:lan" "2:lan"
;;
+   gl-ar750s)
+   ucidef_add_switch "switch0" \
+   "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
+   ;;
jwap230)
ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
ucidef_add_switch "switch0" \
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 5d01701..f82026c 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -99,6 +99,7 @@ case "$FIRMWARE" in
ath10kcal_extract "caldata" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
;;
+   gl-ar750s|\
gl-ar750|\
tl-wpa8630)
ath10kcal_extract "art" 20480 2116
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 42bd80d..74aa21b 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -727,6 +727,9 @@ ar71xx_board_detect() {
*"GL-AR750")
name="gl-ar750"
;;
+   *"GL-AR750S")
+   name="gl-ar750s"
+   ;;
*"GL-CONNECT INET v1")
name="gl-inet"
 
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 284582f..d0a3f30 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -260,6 +260,7 @@ platform_check_image() {
gl-ar300m|\
gl-ar300|\
gl-ar750|\
+   gl-ar750s|\
gl-domino|\
gl-mifi|\
gl-usb150|\
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 35efd17..a453e10 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -120,6 +120,7 @@ CONFIG_ATH79=y
 # CONFIG_ATH79_MACH_GL_AR300 is not set
 # CONFIG_ATH79_MACH_GL_AR300M is not set
 # CONFIG_ATH79_MACH_GL_AR750 is not set
+# CONFIG_ATH79_MACH_GL_AR750S is not set
 # CONFIG_ATH79_MACH_GL_DOMINO is not set
 # CONFIG_ATH79_MACH_GL_INET is not set
 # CONFIG_ATH79_MACH_GL_MIFI is not set
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 

[OpenWrt-Devel] [PATCH] mtd: add spi nand driver

2018-05-17 Thread Luochongjun
 The source code from 
https://github.com/bbrezillon/linux-0day/tree/nand/spi-nand/drivers/mtd/nand/spi,
 I made some modification for it,added to GD5F1GQ4 and EM73C04 and FM25G01A
 support, the driver on the gl-ar300m and gl-ar750 validation to pass.

Signed-off-by: Luo chongjun 
---
 .../patches-4.9/491-mtd-spi-nand-driver.patch  | 2785 
 1 file changed, 2785 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch

diff --git a/target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch 
b/target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch
new file mode 100644
index 000..e77ecca
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch
@@ -0,0 +1,2785 @@
+--- a/drivers/mtd/nand/Kconfig
 b/drivers/mtd/nand/Kconfig
+@@ -589,4 +589,12 @@ config MTD_NAND_AR934X_HW_ECC
+   bool "Hardware ECC support for the AR934X NAND Controller 
(EXPERIMENTAL)"
+   depends on MTD_NAND_AR934X
+ 
++config MTD_NAND_SPI_NAND
++  tristate "SPI Nand flash support"
++  default n
++  depends on MTD_NAND
++  help
++Enables the driver for SPI NAND flash controller on Qualcomm-Atheros 
System on Chips
++This controller is used on families AR71xx and AR9xxx.
++
+ endif # MTD_NAND
+--- a/drivers/mtd/nand/Makefile
 b/drivers/mtd/nand/Makefile
+@@ -62,5 +62,6 @@ obj-$(CONFIG_MTD_NAND_HISI504)   +
+ obj-$(CONFIG_MTD_NAND_BRCMNAND)   += brcmnand/
+ obj-$(CONFIG_MTD_NAND_QCOM)   += qcom_nandc.o
+ obj-$(CONFIG_MTD_NAND_MTK)+= mtk_nand.o mtk_ecc.o
++obj-$(CONFIG_MTD_NAND_SPI_NAND)   += spi_nand/
+ 
+ nand-objs := nand_base.o nand_bbt.o nand_timings.o
+--- /dev/null
 b/drivers/mtd/nand/spi_nand/Makefile
+@@ -0,0 +1 @@
++obj-$(CONFIG_MTD_NAND_SPI_NAND) += generic-spinand-controller.o core.o bbt.o 
nand_core.o micron.o etron.o gigadevice.o paragon.o
+\ No newline at end of file
+--- /dev/null
 b/drivers/mtd/nand/spi_nand/bbt.c
+@@ -0,0 +1,79 @@
++/*
++ * Copyright (c) 2017 Free Electrons
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * Authors:
++ *Boris Brezillon 
++ *Peter Pan 
++ */
++
++#define pr_fmt(fmt)   "nand-bbt: " fmt
++
++#include 
++#include 
++#include 
++
++int nanddev_bbt_init(struct nand_device *nand)
++{
++  unsigned int nwords = nanddev_neraseblocks(nand);
++
++  nand->bbt.cache = kzalloc(nwords, GFP_KERNEL);
++  if (!nand->bbt.cache)
++  return -ENOMEM;
++  memset(nand->bbt.cache,0,nwords);
++  return 0;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_init);
++
++void nanddev_bbt_cleanup(struct nand_device *nand)
++{
++  kfree(nand->bbt.cache);
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_cleanup);
++
++int nanddev_bbt_update(struct nand_device *nand)
++{
++  return 0;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_update);
++
++int nanddev_bbt_get_block_status(const struct nand_device *nand,
++   unsigned int entry)
++{
++  unsigned char *pos = nand->bbt.cache + entry;
++  unsigned long status;
++
++  if (entry >= nanddev_neraseblocks(nand)){
++  return -ERANGE;
++  }
++
++  status = pos[0];
++
++
++  return status & 0xff;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_get_block_status);
++
++int nanddev_bbt_set_block_status(struct nand_device *nand, unsigned int entry,
++   enum nand_bbt_block_status status)
++{
++  unsigned char *pos = nand->bbt.cache + entry;;
++
++  if (entry >= nanddev_neraseblocks(nand)){
++  return -ERANGE;
++  }
++
++  pos[0] = status & 0xff;
++
++  return 0;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_set_block_status);
+--- /dev/null
 b/drivers/mtd/nand/spi_nand/core.c
+@@ -0,0 +1,902 @@
++/*
++ *
++ * Copyright (c) 2016-2017 Micron Technology, Inc.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#define 

[OpenWrt-Devel] [PATCH] th79: add spi nand driver, the source code from https://github.com/bbrezillon/linux-0day/tree/nand/spi-nand/drivers/mtd/nand/spi, I made some modification for it, added to GD5

2018-05-17 Thread Luochongjun
Signed-off-by: Luochongjun <luochong...@gl-inet.com>
---
 .../patches-4.9/491-mtd-spi-nand-driver.patch  | 2785 
 1 file changed, 2785 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch

diff --git a/target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch 
b/target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch
new file mode 100644
index 000..e77ecca
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch
@@ -0,0 +1,2785 @@
+--- a/drivers/mtd/nand/Kconfig
 b/drivers/mtd/nand/Kconfig
+@@ -589,4 +589,12 @@ config MTD_NAND_AR934X_HW_ECC
+   bool "Hardware ECC support for the AR934X NAND Controller 
(EXPERIMENTAL)"
+   depends on MTD_NAND_AR934X
+ 
++config MTD_NAND_SPI_NAND
++  tristate "SPI Nand flash support"
++  default n
++  depends on MTD_NAND
++  help
++Enables the driver for SPI NAND flash controller on Qualcomm-Atheros 
System on Chips
++This controller is used on families AR71xx and AR9xxx.
++
+ endif # MTD_NAND
+--- a/drivers/mtd/nand/Makefile
 b/drivers/mtd/nand/Makefile
+@@ -62,5 +62,6 @@ obj-$(CONFIG_MTD_NAND_HISI504)   +
+ obj-$(CONFIG_MTD_NAND_BRCMNAND)   += brcmnand/
+ obj-$(CONFIG_MTD_NAND_QCOM)   += qcom_nandc.o
+ obj-$(CONFIG_MTD_NAND_MTK)+= mtk_nand.o mtk_ecc.o
++obj-$(CONFIG_MTD_NAND_SPI_NAND)   += spi_nand/
+ 
+ nand-objs := nand_base.o nand_bbt.o nand_timings.o
+--- /dev/null
 b/drivers/mtd/nand/spi_nand/Makefile
+@@ -0,0 +1 @@
++obj-$(CONFIG_MTD_NAND_SPI_NAND) += generic-spinand-controller.o core.o bbt.o 
nand_core.o micron.o etron.o gigadevice.o paragon.o
+\ No newline at end of file
+--- /dev/null
 b/drivers/mtd/nand/spi_nand/bbt.c
+@@ -0,0 +1,79 @@
++/*
++ * Copyright (c) 2017 Free Electrons
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * Authors:
++ *Boris Brezillon <boris.brezil...@free-electrons.com>
++ *Peter Pan <peterpand...@micron.com>
++ */
++
++#define pr_fmt(fmt)   "nand-bbt: " fmt
++
++#include 
++#include 
++#include 
++
++int nanddev_bbt_init(struct nand_device *nand)
++{
++  unsigned int nwords = nanddev_neraseblocks(nand);
++
++  nand->bbt.cache = kzalloc(nwords, GFP_KERNEL);
++  if (!nand->bbt.cache)
++  return -ENOMEM;
++  memset(nand->bbt.cache,0,nwords);
++  return 0;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_init);
++
++void nanddev_bbt_cleanup(struct nand_device *nand)
++{
++  kfree(nand->bbt.cache);
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_cleanup);
++
++int nanddev_bbt_update(struct nand_device *nand)
++{
++  return 0;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_update);
++
++int nanddev_bbt_get_block_status(const struct nand_device *nand,
++   unsigned int entry)
++{
++  unsigned char *pos = nand->bbt.cache + entry;
++  unsigned long status;
++
++  if (entry >= nanddev_neraseblocks(nand)){
++  return -ERANGE;
++  }
++
++  status = pos[0];
++
++
++  return status & 0xff;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_get_block_status);
++
++int nanddev_bbt_set_block_status(struct nand_device *nand, unsigned int entry,
++   enum nand_bbt_block_status status)
++{
++  unsigned char *pos = nand->bbt.cache + entry;;
++
++  if (entry >= nanddev_neraseblocks(nand)){
++  return -ERANGE;
++  }
++
++  pos[0] = status & 0xff;
++
++  return 0;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_set_block_status);
+--- /dev/null
 b/drivers/mtd/nand/spi_nand/core.c
+@@ -0,0 +1,902 @@
++/*
++ *
++ * Copyright (c) 2016-2017 Micron Technology, Inc.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#define pr_fmt(fmt)   "spi-nand: " fmt
++
++#include 
++#include 
++#include 
++#include 
++#include 
++#include 
++#include 
++static inline void spinand_adjust_cache_

[OpenWrt-Devel] [PATCH] ath79: add spi nand driver, the source code from

2018-05-17 Thread Luochongjun
---
 .../patches-4.9/491-mtd-spi-nand-driver.patch  | 2785 
 1 file changed, 2785 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch

diff --git a/target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch 
b/target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch
new file mode 100644
index 000..e77ecca
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.9/491-mtd-spi-nand-driver.patch
@@ -0,0 +1,2785 @@
+--- a/drivers/mtd/nand/Kconfig
 b/drivers/mtd/nand/Kconfig
+@@ -589,4 +589,12 @@ config MTD_NAND_AR934X_HW_ECC
+   bool "Hardware ECC support for the AR934X NAND Controller 
(EXPERIMENTAL)"
+   depends on MTD_NAND_AR934X
+ 
++config MTD_NAND_SPI_NAND
++  tristate "SPI Nand flash support"
++  default n
++  depends on MTD_NAND
++  help
++Enables the driver for SPI NAND flash controller on Qualcomm-Atheros 
System on Chips
++This controller is used on families AR71xx and AR9xxx.
++
+ endif # MTD_NAND
+--- a/drivers/mtd/nand/Makefile
 b/drivers/mtd/nand/Makefile
+@@ -62,5 +62,6 @@ obj-$(CONFIG_MTD_NAND_HISI504)   +
+ obj-$(CONFIG_MTD_NAND_BRCMNAND)   += brcmnand/
+ obj-$(CONFIG_MTD_NAND_QCOM)   += qcom_nandc.o
+ obj-$(CONFIG_MTD_NAND_MTK)+= mtk_nand.o mtk_ecc.o
++obj-$(CONFIG_MTD_NAND_SPI_NAND)   += spi_nand/
+ 
+ nand-objs := nand_base.o nand_bbt.o nand_timings.o
+--- /dev/null
 b/drivers/mtd/nand/spi_nand/Makefile
+@@ -0,0 +1 @@
++obj-$(CONFIG_MTD_NAND_SPI_NAND) += generic-spinand-controller.o core.o bbt.o 
nand_core.o micron.o etron.o gigadevice.o paragon.o
+\ No newline at end of file
+--- /dev/null
 b/drivers/mtd/nand/spi_nand/bbt.c
+@@ -0,0 +1,79 @@
++/*
++ * Copyright (c) 2017 Free Electrons
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * Authors:
++ *Boris Brezillon 
++ *Peter Pan 
++ */
++
++#define pr_fmt(fmt)   "nand-bbt: " fmt
++
++#include 
++#include 
++#include 
++
++int nanddev_bbt_init(struct nand_device *nand)
++{
++  unsigned int nwords = nanddev_neraseblocks(nand);
++
++  nand->bbt.cache = kzalloc(nwords, GFP_KERNEL);
++  if (!nand->bbt.cache)
++  return -ENOMEM;
++  memset(nand->bbt.cache,0,nwords);
++  return 0;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_init);
++
++void nanddev_bbt_cleanup(struct nand_device *nand)
++{
++  kfree(nand->bbt.cache);
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_cleanup);
++
++int nanddev_bbt_update(struct nand_device *nand)
++{
++  return 0;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_update);
++
++int nanddev_bbt_get_block_status(const struct nand_device *nand,
++   unsigned int entry)
++{
++  unsigned char *pos = nand->bbt.cache + entry;
++  unsigned long status;
++
++  if (entry >= nanddev_neraseblocks(nand)){
++  return -ERANGE;
++  }
++
++  status = pos[0];
++
++
++  return status & 0xff;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_get_block_status);
++
++int nanddev_bbt_set_block_status(struct nand_device *nand, unsigned int entry,
++   enum nand_bbt_block_status status)
++{
++  unsigned char *pos = nand->bbt.cache + entry;;
++
++  if (entry >= nanddev_neraseblocks(nand)){
++  return -ERANGE;
++  }
++
++  pos[0] = status & 0xff;
++
++  return 0;
++}
++EXPORT_SYMBOL_GPL(nanddev_bbt_set_block_status);
+--- /dev/null
 b/drivers/mtd/nand/spi_nand/core.c
+@@ -0,0 +1,902 @@
++/*
++ *
++ * Copyright (c) 2016-2017 Micron Technology, Inc.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#define pr_fmt(fmt)   "spi-nand: " fmt
++
++#include 
++#include 
++#include 
++#include 
++#include 
++#include 
++#include 
++static inline void spinand_adjust_cache_op(struct spinand_device *spinand,
++ const struct nand_page_io_req *req,
++