diff --git a/patches-21.x/0010-Kernel-support-SPI-nand-GD5F1GQ5UE.patch b/patches-21.x/0010-Kernel-support-SPI-nand-GD5F1GQ5UE.patch new file mode 100644 index 0000000..8e5aba0 --- /dev/null +++ b/patches-21.x/0010-Kernel-support-SPI-nand-GD5F1GQ5UE.patch @@ -0,0 +1,40 @@ +From e535cd5fe4ed6b3cec70afe185b6d2ba9e8a98c1 Mon Sep 17 00:00:00 2001 +From: Luochongjun +Date: Wed, 2 Jun 2021 17:43:03 +0800 +Subject: [PATCH] Kernel: support SPI nand GD5F1GQ5UE + +Signed-off-by: Luochongjun +--- + ...inand-gigadevice-Add-support-for-GD5F1GQ5UE.patch | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + create mode 100644 target/linux/generic/pending-5.4/499-mtd-spinand-gigadevice-Add-support-for-GD5F1GQ5UE.patch + +diff --git a/target/linux/generic/pending-5.4/499-mtd-spinand-gigadevice-Add-support-for-GD5F1GQ5UE.patch b/target/linux/generic/pending-5.4/499-mtd-spinand-gigadevice-Add-support-for-GD5F1GQ5UE.patch +new file mode 100644 +index 0000000..f264cd6 +--- /dev/null ++++ b/target/linux/generic/pending-5.4/499-mtd-spinand-gigadevice-Add-support-for-GD5F1GQ5UE.patch +@@ -0,0 +1,20 @@ ++Index: linux-5.4.111/drivers/mtd/nand/spi/gigadevice.c ++=================================================================== ++--- linux-5.4.111.orig/drivers/mtd/nand/spi/gigadevice.c +++++ linux-5.4.111/drivers/mtd/nand/spi/gigadevice.c ++@@ -278,6 +278,15 @@ static const struct spinand_info gigadev ++ SPINAND_HAS_QE_BIT, ++ SPINAND_ECCINFO(&gd5fxgq4_variant2_ooblayout, ++ gd5fxgq4uexxg_ecc_get_status)), +++ SPINAND_INFO("GD5F1GQ4UExxG", 0x51, +++ NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1), +++ NAND_ECCREQ(8, 512), +++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants, +++ &write_cache_variants, +++ &update_cache_variants), +++ SPINAND_HAS_QE_BIT, +++ SPINAND_ECCINFO(&gd5fxgq4_variant2_ooblayout, +++ gd5fxgq4uexxg_ecc_get_status)), ++ SPINAND_INFO("GD5F1GQ4UFxxG", 0xb148, ++ NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1), ++ NAND_ECCREQ(8, 512), +-- +2.7.4 + diff --git a/patches-21.x/0011-Kernel-add-quectel-modes-support.patch b/patches-21.x/0011-Kernel-add-quectel-modes-support.patch new file mode 100644 index 0000000..fad3ad4 --- /dev/null +++ b/patches-21.x/0011-Kernel-add-quectel-modes-support.patch @@ -0,0 +1,300 @@ +From c77a24f1d2e9c1592daf9afa1669c1d393713ab7 Mon Sep 17 00:00:00 2001 +From: Luochongjun +Date: Wed, 2 Jun 2021 19:26:57 +0800 +Subject: [PATCH] Kernel: add quectel modes support + +Signed-off-by: Luochongjun +--- + .../pending-5.4/771-add-modem-support.patch | 280 +++++++++++++++++++++ + 1 file changed, 280 insertions(+) + create mode 100644 target/linux/generic/pending-5.4/771-add-modem-support.patch + +diff --git a/target/linux/generic/pending-5.4/771-add-modem-support.patch b/target/linux/generic/pending-5.4/771-add-modem-support.patch +new file mode 100644 +index 0000000..0743d35 +--- /dev/null ++++ b/target/linux/generic/pending-5.4/771-add-modem-support.patch +@@ -0,0 +1,280 @@ ++Index: linux-5.4.111/drivers/net/usb/qmi_wwan.c ++=================================================================== ++--- linux-5.4.111.orig/drivers/net/usb/qmi_wwan.c +++++ linux-5.4.111/drivers/net/usb/qmi_wwan.c ++@@ -507,6 +507,24 @@ static const u8 default_modem_addr[ETH_A ++ ++ static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00}; ++ +++#if 1 //Added by Quectel +++#include +++struct sk_buff *qmi_wwan_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) +++{ +++ if (dev->udev->descriptor.idVendor != cpu_to_le16(0x2C7C)) +++ return skb; +++ // Skip Ethernet header from message +++ if (skb_pull(skb, ETH_HLEN)) { +++ return skb; +++ } else { +++ dev_err(&dev->intf->dev, "Packet Dropped "); +++ } +++ // Filter the packet out, release it +++ dev_kfree_skb_any(skb); +++ return NULL; +++} +++#endif +++ ++ /* Make up an ethernet header if the packet doesn't have one. ++ * ++ * A firmware bug common among several devices cause them to send raw ++@@ -801,6 +819,20 @@ static int qmi_wwan_bind(struct usbnet * ++ } ++ dev->net->netdev_ops = &qmi_wwan_netdev_ops; ++ dev->net->sysfs_groups[0] = &qmi_wwan_sysfs_attr_group; +++#if 1 //Added by Quectel +++ if (dev->udev->descriptor.idVendor == cpu_to_le16(0x2C7C)) { +++ dev_info(&intf->dev, "QuectelEC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96&AG35 work on RawIP mode\n"); +++ dev->net->flags |= IFF_NOARP; +++ usb_control_msg( +++ interface_to_usbdev(intf), +++ usb_sndctrlpipe(interface_to_usbdev(intf), 0), +++ 0x22, //USB_CDC_REQ_SET_CONTROL_LINE_STATE +++ 0x21, //USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE +++ 1, //active CDC DTR +++ intf->cur_altsetting->desc.bInterfaceNumber, +++ NULL, 0, 100); +++ } +++#endif ++ err: ++ return status; ++ } ++@@ -891,7 +923,10 @@ static const struct driver_info qmi_wwan ++ .bind = qmi_wwan_bind, ++ .unbind = qmi_wwan_unbind, ++ .manage_power = qmi_wwan_manage_power, ++- .rx_fixup = qmi_wwan_rx_fixup, +++ #if 1 //Added by Quectel +++ .tx_fixup = qmi_wwan_tx_fixup, +++ .rx_fixup = qmi_wwan_rx_fixup, +++ #endif ++ }; ++ ++ static const struct driver_info qmi_wwan_info_quirk_dtr = { ++@@ -938,6 +973,17 @@ static const struct driver_info qmi_wwan ++ .driver_info = (unsigned long)&qmi_wwan_info_quirk_dtr ++ ++ static const struct usb_device_id products[] = { +++#if 1 //Added by Quectel +++ { QMI_FIXED_INTF(0x05C6, 0x9003, 4) }, /* Quectel UC20 */ +++ { QMI_FIXED_INTF(0x2C7C, 0x0125, 4) }, /* Quectel EC25 */ +++ { QMI_FIXED_INTF(0x2C7C, 0x0121, 4) }, /* Quectel EC21 */ +++ { QMI_FIXED_INTF(0x05C6, 0x9215, 4) }, /* Quectel EC20 */ +++ { QMI_FIXED_INTF(0x2C7C, 0x0191, 4) }, /* Quectel EG91 */ +++ { QMI_FIXED_INTF(0x2C7C, 0x0195, 4) }, /* Quectel EG95 */ +++ { QMI_FIXED_INTF(0x2C7C, 0x0306, 4) }, /* Quectel EG06/EP06/EM06 */ +++ { QMI_FIXED_INTF(0x2C7C, 0x0296, 4) }, /* Quectel BG96 */ +++ { QMI_FIXED_INTF(0x2C7C, 0x0435, 4) }, /* Quectel AG35 */ +++#endif ++ /* 1. CDC ECM like devices match on the control interface */ ++ { /* Huawei E392, E398 and possibly others sharing both device id and more... */ ++ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 9), ++@@ -1396,7 +1442,6 @@ static const struct usb_device_id produc ++ {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ ++ {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ ++ {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ ++- {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */ ++ {QMI_FIXED_INTF(0x05c6, 0x9215, 4)}, /* Quectel EC20 Mini PCIe */ ++ {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ ++ {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */ ++Index: linux-5.4.111/drivers/usb/serial/option.c ++=================================================================== ++--- linux-5.4.111.orig/drivers/usb/serial/option.c +++++ linux-5.4.111/drivers/usb/serial/option.c ++@@ -562,6 +562,23 @@ static void option_instat_callback(struc ++ #define WETELECOM_PRODUCT_6802 0x6802 ++ #define WETELECOM_PRODUCT_WMD300 0x6803 ++ +++#define LONGSUNG_PRODUCT_U9300C 0x9b3c +++ +++/* FORGE PRODUCT */ +++#define FORGE_VENDOR_ID 0x05c6 +++ +++#define FORGE_PRODUCT_SLM750 0xf601 +++ +++/* NODECOM PRODUCT */ +++#define NODECOM_VENDOR_ID 0x1508 +++ +++#define NODECOM_PRODUCT_NL660 0x1001 +++ +++/* NEOWAY PRODUCT */ +++#define NEOWAY_VENDOR_ID 0x2949 +++ +++#define NEOWAY_PRODUCT_N720 0x8243 +++ ++ ++ /* Device flags */ ++ ++@@ -582,6 +599,29 @@ static void option_instat_callback(struc ++ ++ ++ static const struct usb_device_id option_ids[] = { +++#if 1 //Added by Quectel +++ { USB_DEVICE(0x05C6, 0x9090) }, /* Quectel UC15 */ +++ { USB_DEVICE(0x05C6, 0x9003) }, /* Quectel UC20 */ +++ { USB_DEVICE(0x2C7C, 0x0125) }, /* Quectel EC25 */ +++ { USB_DEVICE(0x2C7C, 0x0121) }, /* Quectel EC21 */ +++ { USB_DEVICE(0x05C6, 0x9215) }, /* Quectel EC20 */ +++ { USB_DEVICE(0x2C7C, 0x0191) }, /* Quectel EG91 */ +++ { USB_DEVICE(0x2C7C, 0x0195) }, /* Quectel EG95 */ +++ { USB_DEVICE(0x2C7C, 0x0306) }, /* Quectel EG06/EP06/EM06 */ +++ { USB_DEVICE(0x2C7C, 0x0700) }, /* Quectel BG95 */ +++ { USB_DEVICE(0x2C7C, 0x0296) }, /* Quectel BG96 */ +++ { USB_DEVICE(0x2C7C, 0x0435) }, /* Quectel AG35 */ +++ { USB_DEVICE(0x2C7C, 0x6026) }, /* Quectel EC200t */ +++#endif +++ { USB_DEVICE(0x19d2, 0x0536) },/* MZ386 */ +++ { USB_DEVICE(0x19d2, 0x0117) }, +++ { USB_DEVICE(0x19d2, 0x0199) }, +++ { USB_DEVICE(0x19d2, 0x1476) }, +++ { USB_DEVICE(LONGCHEER_VENDOR_ID, LONGSUNG_PRODUCT_U9300C) }, +++ { USB_DEVICE(FORGE_VENDOR_ID, FORGE_PRODUCT_SLM750) }, +++ { USB_DEVICE(NODECOM_VENDOR_ID, NODECOM_PRODUCT_NL660) }, +++ { USB_DEVICE(NEOWAY_VENDOR_ID, NEOWAY_PRODUCT_N720) }, +++ ++ { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, ++ { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, ++ { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, ++@@ -2105,6 +2145,9 @@ static struct usb_serial_driver option_1 ++ #ifdef CONFIG_PM ++ .suspend = usb_wwan_suspend, ++ .resume = usb_wwan_resume, +++#if 1 //Added by Quectel +++ .reset_resume = usb_wwan_resume, +++#endif ++ #endif ++ }; ++ ++@@ -2148,9 +2191,84 @@ static int option_probe(struct usb_seria ++ if (device_flags & NUMEP2 && iface_desc->bNumEndpoints != 2) ++ return -ENODEV; ++ ++- /* Store the device flags so we can use them during attach. */ ++- usb_set_serial_data(serial, (void *)device_flags); ++- +++#if 1 //Added by Quectel +++ //Quectel UC20's interface 4 can be used as USB network device +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && \ +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003) \ +++ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) +++ return -ENODEV; +++ //Quectel EC20's interface 4 can be used as USB network device +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && \ +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215) \ +++ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) +++ return -ENODEV; +++ //Quectel EC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96/AG35's interface 4 can be used as USB network device +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C) && \ +++ serial->dev->descriptor.idProduct != cpu_to_le16(0x6026) \ +++ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) +++ return -ENODEV; +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C) && \ +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x6026) \ +++ && serial->interface->cur_altsetting->desc.bInterfaceNumber<= 1) +++ return -ENODEV; +++#endif +++#if 1 //Added by Quectel +++ //For USB Auto Suspend +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9090)) { +++ pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); +++ usb_enable_autosuspend(serial->dev); +++ } +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)) { +++ pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); +++ usb_enable_autosuspend(serial->dev); +++ } +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)) { +++ pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); +++ usb_set_serial_data(serial, (void *)device_flags); +++ usb_enable_autosuspend(serial->dev); +++ } +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) { +++ pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); +++ usb_enable_autosuspend(serial->dev); +++ } +++#endif +++#if 1 //Added by Quectel +++ //For USB Remote Wakeup +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9090)) { +++ device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup +++ } +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)) { +++ device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup +++ } +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)) { +++ device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup +++ } +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) { +++ device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup +++ } +++#endif +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x19d2) && +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x1476) && +++ serial->interface->cur_altsetting->desc. bInterfaceNumber == 3) +++ return -ENODEV; +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x19d2) && +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x1476) && +++ serial->interface->cur_altsetting->desc. bInterfaceNumber == 4) +++ return -ENODEV; +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x19d2) && +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x1509) && +++ serial->interface->cur_altsetting->desc. bInterfaceNumber == 4) +++ return -ENODEV; +++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x19d2) && +++ serial->dev->descriptor.idProduct == cpu_to_le16(0x1509) && +++ serial->interface->cur_altsetting->desc. bInterfaceNumber == 5) +++ return -ENODEV; ++ return 0; ++ } ++ ++Index: linux-5.4.111/drivers/usb/serial/qcserial.c ++=================================================================== ++--- linux-5.4.111.orig/drivers/usb/serial/qcserial.c +++++ linux-5.4.111/drivers/usb/serial/qcserial.c ++@@ -88,7 +88,6 @@ static const struct usb_device_id id_tab ++ {USB_DEVICE(0x03f0, 0x241d)}, /* HP Gobi 2000 QDL device (VP412) */ ++ {USB_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ ++ {USB_DEVICE(0x05c6, 0x9214)}, /* Acer Gobi 2000 QDL device (VP413) */ ++- {USB_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */ ++ {USB_DEVICE(0x05c6, 0x9264)}, /* Asus Gobi 2000 QDL device (VR305) */ ++ {USB_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ ++ {USB_DEVICE(0x05c6, 0x9234)}, /* Top Global Gobi 2000 QDL device (VR306) */ ++Index: linux-5.4.111/drivers/usb/serial/usb_wwan.c ++=================================================================== ++--- linux-5.4.111.orig/drivers/usb/serial/usb_wwan.c +++++ linux-5.4.111/drivers/usb/serial/usb_wwan.c ++@@ -475,6 +475,19 @@ static struct urb *usb_wwan_setup_urb(st ++ usb_fill_bulk_urb(urb, serial->dev, ++ usb_sndbulkpipe(serial->dev, endpoint) | dir, ++ buf, len, callback, ctx); +++#if 1 //Added by Quectel for zero packet +++ if (dir == USB_DIR_OUT) { +++ struct usb_device_descriptor *desc = &serial->dev->descriptor; +++ if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9090)) +++ urb->transfer_flags |= URB_ZERO_PACKET; +++ if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9003)) +++ urb->transfer_flags |= URB_ZERO_PACKET; +++ if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9215)) +++ urb->transfer_flags |= URB_ZERO_PACKET; +++ if (desc->idVendor == cpu_to_le16(0x2C7C)) +++ urb->transfer_flags |= URB_ZERO_PACKET; +++ } +++#endif ++ ++ if (intfdata->use_zlp && dir == USB_DIR_OUT) ++ urb->transfer_flags |= URB_ZERO_PACKET; +-- +2.7.4 + diff --git a/patches-21.x/0100-ATH79-support-glinet-xe300.patch b/patches-21.x/0100-ATH79-support-glinet-xe300.patch new file mode 100644 index 0000000..0d94251 --- /dev/null +++ b/patches-21.x/0100-ATH79-support-glinet-xe300.patch @@ -0,0 +1,386 @@ +From 2ee38824815e2f7e8310705845eb00d5af9cd9cc Mon Sep 17 00:00:00 2001 +From: Luochongjun +Date: Wed, 2 Jun 2021 14:48:14 +0800 +Subject: [PATCH] ATH79: support glinet xe300 + +Signed-off-by: Luochongjun +--- + .../ath79/dts/qca9531_glinet_gl-xe300-iot.dts | 29 ++++ + .../ath79/dts/qca9531_glinet_gl-xe300-nor-nand.dts | 25 +++ + .../ath79/dts/qca9531_glinet_gl-xe300-nor.dts | 18 +++ + .../linux/ath79/dts/qca9531_glinet_gl-xe300.dtsi | 178 +++++++++++++++++++++ + target/linux/ath79/dts/qca953x.dtsi | 2 +- + target/linux/ath79/image/nand.mk | 46 ++++++ + .../ath79/nand/base-files/etc/board.d/01_leds | 8 + + 7 files changed, 305 insertions(+), 1 deletion(-) + create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-xe300-iot.dts + create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor-nand.dts + create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor.dts + create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-xe300.dtsi + +diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300-iot.dts b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-iot.dts +new file mode 100644 +index 0000000..3d830fb +--- /dev/null ++++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-iot.dts +@@ -0,0 +1,29 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++/dts-v1/; ++ ++#include "qca9531_glinet_gl-xe300.dtsi" ++ ++/ { ++ compatible = "glinet,gl-xe300-iot", "qca,qca9531"; ++ model = "GL.iNet GL-XE300 (NOR/NAND IOT)"; ++}; ++ ++&nor_partitions { ++ partition@60000 { ++ label = "kernel"; ++ reg = <0x060000 0x400000>; ++ }; ++ parition@260000 { ++ label = "nor_reserved"; ++ reg = <0x460000 0xba0000>; ++ }; ++}; ++ ++&nand_ubi { ++ label = "ubi"; ++}; ++ ++&bootargs { ++ bootargs=""; ++}; +diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor-nand.dts b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor-nand.dts +new file mode 100644 +index 0000000..4e92f30 +--- /dev/null ++++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor-nand.dts +@@ -0,0 +1,25 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++/dts-v1/; ++ ++#include "qca9531_glinet_gl-xe300.dtsi" ++ ++/ { ++ compatible = "glinet,gl-xe300-nor-nand", "qca,qca9531"; ++ model = "GL.iNet GL-XE300 (NOR/NAND)"; ++}; ++ ++&nor_partitions { ++ partition@60000 { ++ label = "kernel"; ++ reg = <0x060000 0x400000>; ++ }; ++ parition@260000 { ++ label = "nor_reserved"; ++ reg = <0x460000 0xba0000>; ++ }; ++}; ++ ++&nand_ubi { ++ label = "ubi"; ++}; +diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor.dts b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor.dts +new file mode 100644 +index 0000000..9b67f49 +--- /dev/null ++++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor.dts +@@ -0,0 +1,18 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++/dts-v1/; ++ ++#include "qca9531_glinet_gl-xe300.dtsi" ++ ++/ { ++ compatible = "glinet,gl-xe300-nor", "qca,qca9531"; ++ model = "GL.iNet GL-XE300 (NOR)"; ++}; ++ ++&nor_partitions { ++ partition@60000 { ++ compatible = "denx,uimage"; ++ label = "firmware"; ++ reg = <0x060000 0xfa0000>; ++ }; ++}; +diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dtsi +new file mode 100644 +index 0000000..95d5e3e +--- /dev/null ++++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dtsi +@@ -0,0 +1,178 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/dts-v1/; ++ ++#include ++#include ++ ++#include "qca953x.dtsi" ++ ++/ { ++ compatible = "glinet,gl-xe300", "qca,qca9531"; ++ model = "GL.iNet GL-XE300"; ++ ++ keys { ++ compatible = "gpio-keys-polled"; ++ ++ poll-interval = <20>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&jtag_disable_pins>; ++ ++ button0 { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ wan { ++ label = "green:wan"; ++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ lan { ++ label = "green:lan"; ++ gpios = <&gpio 10 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wlan { ++ label = "green:wlan"; ++ gpios = <&gpio 12 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ ++ lte { ++ label = "green:lte"; ++ gpios = <&gpio 13 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-export { ++ compatible = "gpio-export"; ++ ++ gpio_lte_power { ++ gpio-export,name = "lte_power"; ++ gpio-export,output = <1>; ++ gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ gpio_sd_detect { ++ gpio-export,name = "sd_detect"; ++ gpio-export,output = <0>; ++ gpios = <&gpio 17 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ i2c: i2c { ++ compatible = "i2c-gpio"; ++ ++ sda-gpios = <&gpio 14 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; ++ scl-gpios = <&gpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ rtc@32 { ++ compatible = "rtc-sd2068"; ++ reg = <0x32>; ++ }; ++ ++ }; ++}; ++ ++&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>; ++ cs-gpios = <0>, <0>; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <25000000>; ++ ++ nor_partitions: partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x000000 0x040000>; ++ read-only; ++ }; ++ ++ partition@40000 { ++ label = "u-boot-env"; ++ reg = <0x040000 0x010000>; ++ }; ++ ++ art: partition@50000 { ++ label = "art"; ++ reg = <0x050000 0x010000>; ++ read-only; ++ }; ++ }; ++ }; ++ ++ flash_nand: flash@1 { ++ compatible = "spi-nand"; ++ reg = <1>; ++ spi-max-frequency = <25000000>; ++ ++ nand_partitions: partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ nand_ubi: partition@0 { ++ label = "nand_ubi"; ++ reg = <0x000000 0x8000000>; ++ }; ++ }; ++ }; ++ ++}; ++ ++ð0 { ++ status = "okay"; ++ mtd-mac-address = <&art 0x0>; ++ phy-handle = <&swphy4>; ++ ifname = "eth1"; ++}; ++ ++ð1 { ++ mtd-mac-address = <&art 0x0>; ++ mtd-mac-address-increment = <1>; ++ ifname = "eth0"; ++}; ++ ++&wmac { ++ status = "okay"; ++ mtd-cal-data = <&art 0x1000>; ++ mtd-mac-address = <&art 0x1002>; ++}; +diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi +index 801438b..00237b2 100644 +--- a/target/linux/ath79/dts/qca953x.dtsi ++++ b/target/linux/ath79/dts/qca953x.dtsi +@@ -8,7 +8,7 @@ + #address-cells = <1>; + #size-cells = <1>; + +- chosen { ++ bootargs: chosen { + bootargs = "console=ttyS0,115200n8"; + }; + +diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk +index abf269a..d024cac 100644 +--- a/target/linux/ath79/image/nand.mk ++++ b/target/linux/ath79/image/nand.mk +@@ -150,6 +150,52 @@ define Device/glinet_gl-e750 + endef + TARGET_DEVICES += glinet_gl-e750 + ++define Device/glinet_gl-xe300-nor ++ SOC := qca9531 ++ DEVICE_VENDOR := GL.iNet ++ DEVICE_MODEL := GL-XE300-NOR ++ DEVICE_TITLE := GL.iNet GL-XE300 (NOR) ++ DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341 ++ IMAGE_SIZE := 16000k ++ SUPPORTED_DEVICES += gl-xe300 glinet,gl-xe300 ++endef ++TARGET_DEVICES += glinet_gl-xe300-nor ++ ++define Device/glinet_gl-xe300-nor-nand ++ SOC := qca9531 ++ DEVICE_VENDOR := GL.iNet ++ DEVICE_MODEL := GL-XE300-NOR-NAND ++ DEVICE_TITLE := GL.iNet GL-XE300 (NOR/NAND) ++ DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341 ++ KERNEL_SIZE := 4096k ++ BLOCKSIZE := 128k ++ PAGESIZE := 2048 ++ VID_HDR_OFFSET := 2048 ++ IMAGES := factory.img sysupgrade.tar ++ IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata ++ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | append-metadata ++ SUPPORTED_DEVICES += gl-xe300 glinet,gl-xe300 ++endef ++TARGET_DEVICES += glinet_gl-xe300-nor-nand ++ ++define Device/glinet_gl-xe300-iot ++ SOC := qca9531 ++ DEVICE_VENDOR := GL.iNet ++ DEVICE_MODEL := GL-XE300-IOT ++ DEVICE_TITLE := GL.iNet GL-XE300 (NOR/NAND IOT) ++ DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341 ++ KERNEL_SIZE := 4096k ++ BLOCKSIZE := 128k ++ PAGESIZE := 2048 ++ VID_HDR_OFFSET := 2048 ++ IMAGES := factory.img sysupgrade.tar ++ IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata ++ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | append-metadata ++ SUPPORTED_DEVICES += gl-xe300 glinet,gl-xe300 ++endef ++TARGET_DEVICES += glinet_gl-xe300-iot ++ ++ + # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff) + define Device/netgear_ath79_nand + DEVICE_VENDOR := NETGEAR +diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds +index 8eda666..2c049c1 100755 +--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds ++++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds +@@ -11,6 +11,14 @@ glinet,gl-ar300m-nand|\ + glinet,gl-ar300m-nor) + ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" + ;; ++glinet,gl-xe300|\ ++glinet,gl-xe300-nor|\ ++glinet,gl-xe300-iot|\ ++glinet,gl-xe300-nor-nand) ++ ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10" ++ ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" ++ ucidef_set_led_netdev "3gnet" "LTE" "green:lte" "wwan0" ++ ;; + netgear,wndr3700-v4|\ + netgear,wndr4300|\ + netgear,wndr4300sw|\ +-- +2.7.4 +