From 8720ce4386905e8b0abd7a885ca089b8de796f52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Steffen=20F=C3=B6rster?= <nemesis@chemnitz.freifunk.net>
Date: Sat, 26 Apr 2025 16:42:44 +0200
Subject: [PATCH] ath79-nand:  add support for GL.iNet E750 (#3476)

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/
---
 package/gluon-core/luasrc/lib/gluon/upgrade/250-cellular | 1 +
 package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua | 1 +
 targets/ath79-nand                                       | 6 ++++++
 3 files changed, 8 insertions(+)

diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/250-cellular b/package/gluon-core/luasrc/lib/gluon/upgrade/250-cellular
index 300347e35..50eabdc6b 100755
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/250-cellular
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/250-cellular
@@ -46,6 +46,7 @@ local function setup_ncm_qmi(devpath, control_type, delay)
 end
 
 if platform.match('ath79', 'nand', {
+	'glinet,gl-e750',
 	'glinet,gl-xe300',
 }) then
 	setup_ncm_qmi('/dev/cdc-wdm0', 'qmi', 15)
diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
index 2241ac9ac..68413614b 100644
--- a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
+++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
@@ -82,6 +82,7 @@ end
 function M.is_cellular_device()
 	if M.match('ath79', 'nand', {
 		'zte,mf281',
+		'glinet,gl-e750',
 		'glinet,gl-xe300',
 	}) then
 		return true
diff --git a/targets/ath79-nand b/targets/ath79-nand
index ba7e71f51..6e845a629 100644
--- a/targets/ath79-nand
+++ b/targets/ath79-nand
@@ -33,6 +33,12 @@ device('gl.inet-gl-ar750s-nor', 'glinet_gl-ar750s-nor', {
 	packages = ATH10K_PACKAGES_QCA9887,
 })
 
+device('gl.inet-gl-e750', 'glinet_gl-e750', {
+	broken = true, -- the display is not showing status and there are no LEDs
+	factory = false,
+	packages = ATH10K_PACKAGES_QCA9887,
+})
+
 device('gl.inet-gl-xe300', 'glinet_gl-xe300', {
 	factory = false,
 })
-- 
GitLab