GL-AR300M and GL-AR750S NAND Support (ath79)

Yes, it has landed on master and should be available for download once the buildbots crunch through it.

The November 14th glinet_gl-ar300m-nand images do not include these changes and should not be flashed at this time.

If you want "release" images, you will likely need to wait for "20.01" as the SPI-NAND drivers depend on Linux 4.19 and later, as well as that 19.07 "has left the dock" at this time.

NB: The glinet_gl-ar750s-nor-nand-squashfs-factory.img cannot be flashed with U-Boot at this time.

Commits that provide a U-Boot flashable, "NOR/NAND" image for the GL-AR750S that were in the original PR or proposed have been rejected by the project.

The glinet_gl-ar750s-nor-squashfs-sysupgrade.bin "NOR" images can be flashed through U-Boot.

Upgrade Notes

General

  • Do not use "force" with sysupgrade -- If need be, use "serial-less" U-Boot to flash, see below
  • The OEM config is not directly compatible with the OpenWrt config. Preserving config is not recommended when upgrading from OEM firmware.
  • NOR boot can be selected by fw_setenv bootcount 3
    NAND boot can be selected by fw_setenv bootcount 0
    Flashing with U-Boot does not seem to "automatically" change the boot mode.
    See also https://docs.gl-inet.com/en/2/hardware/ar300m/#using-firmware

From a NOR-based image on a device with NAND flash

(See later section for the GL-AR300M16, GL-AR300M-Lite, and other GL-AR300M-series devices without NAND)

From an OEM image on GL-AR300M that has NAND flash

NB: If your GL-AR300M U-Boot does not have an option of NOR vs. NAND firmware presented
At this time please flash glinet_gl-ar300m-nor-squashfs-sysupgrade.bin and sysupgrade to the NAND version, if desired.

From an OEM image on GL-AR750S

For GL-AR300M16, GL-AR300M-Lite, and other GL-AR300M devices without NAND flash

NB: These two images do not yet include [OpenWrt-Devel] ath79: fix merge/rebase omission for GL-AR300M16 and GL-AR300M-Lite

  • There (shortly will be) ath79 images for both of these that do not include the NAND-aware kernel and UBI utilities.

WARNING – Do not upgrade pre-November 15, 2019 versions of ath79 firmware directly to GL-AR300M (NAND) images

Versions of ath79 firmware for the GL-AR300M prior to November 15, 2019 are not capable of reliably upgrading directly to the new GL-AR300M (NAND) images.

Upgrade with U-Boot in these cases is recommended. U-Boot can be accessed without a serial connection. See https://docs.gl-inet.com/en/3/troubleshooting/debrick/

Direct upgrades may result in the device unexpectedly booting into the “old” NAND-resident system and its configuration. If this is a “stock” OEM system, its default LAN IP is 192.168.8.1.

If the NAND-resident system fails to boot, use U-Boot to install a fresh image.


What is "GL-AR750S (NOR/NAND)" and glinet_gl-ar750s-nor-nand?

The GL-AR750S boots its kernel off NOR flash, even when NAND is used for the file systems. This is how the OEM firmware behaves as well. The plain "NAND" name was reserved in case someone writes a new boot loader that boots the kernel from NAND flash.


Commits of interest:

2 Likes

Many thanks, works like a charme (GL-AR300M)! I'm using the builtin switch to change between NAND and NOR image.

Great! Does that switch work for you with the case on?

Ref: https://docs.gl-inet.com/en/2/hardware/ar300m/#using-firmware

Yep, I'm using method 2:
switch in "right" position (NOR-boot):

switch in "left" position, near reset button (NAND-boot):

1 Like

I'm using the image for the AR750S, and it is working perfectly, thanks so much for all your hard work, and perseverance!

I know that you are a fan of the Slate, not sure if you would be interested in a version (hardware revision unfortunately), that supports USB gadget? The second USB port on the SoC is actually UDC-capable, obviously only if the port is directly connected to the microUSB port. Unfortunately, the current hardware revision has the second port on the SoC connected to the SD card reader chip and the internal USB header, so it is not usable as is. I'm trying to convince GLInet on Twitter (@GLInetWiFi) that there is demand for UDC functionality, and to do a rev2 spin, so the more people that tell them so, the better! :smiley: It seems like a fairly simple change, to connect the SD chip/USB hub to SoC port 1, and route SoC port 2 to the microUSB connector, and it would open up all sorts of additional neat functionality!

I did this yesterday on my AR300M, putting down some notes in case helpful to others. For me, after I was completed, I had two matching configurations from my original NOR setup that was now on both NOR and NAND.

  • Upgrading UBOOT: There is a LOT LOT LOT of risk here, thus I'm not recommending a UBOOT update, but putting it here for reference. Prior to any activity, I had updated uboot by getting into uboot (hold reset for ~6seconds during power on and manual ethernet ip config at 192.168.1.2) and going to 192.168.1.1/uboot. Then I installed the bin file from https://github.com/gl-inet/uboot-ar300m/tree/master/bin. This is the latest version that I'm aware of.

  • PreUpgrade notes: Using Kitty (for ssh) and WinSCP (to move files over ssh). Originally running openwrt18.06.2 on NOR and gl.inet3.019 on NAND. Note: sys upgrades do NOT reinstall packages, thus If you don't know what packages you have, you should back them up by running "opkg list-installed > /etc/config/installed.packages". Then back up config of both Nor and Nand using Luci.
    Also make sure you have internet access under NOR configuration as snapshot images do not contain Luci.
    One additional upfront comment: a factory reset will make the router troublesome to setup if you don't know how to setup the device without luci or internet. It will revert to no luci and no preconfig (that already has wifi setup like we currently do). Just a warning for those less familiar with openwrt snapshots (like me, but slowly learning)

  • Upgrading NOR: You can do this through wifi since we are moving file over to device prior to sysupgrade. I first booted to NOR image by using the command "fw_setenv bootcount 3" and then rebooting (for NAND use 0 as the value). I confirmed I was in NOR using this method: "df -h" will show /overlay size as under 16 for NOR and higher than 16 for NAND (mine is about 100). "cat /proc/mtd" will show an mtd labeled "ubi" in nand (FYI after updating, you will see a "nand-ubi" when in NOR for this command).
    Then I moved the NOR (nand aware) bin file into /tmp and ran "sysupgrade -v /tmp/NOR.bin". After rebooting, you will lose access to Luci, but you should have wifi and internet access. So run "opkg update" and then "opkg install luci". Then I installed the remaining packages that I utilize, "opkg install luci-app-commands luci-app-openvpn luci-app-sqm luci-app-travelmate openvpn-openssl relayd slide-switch sqm-scripts travelmate". Then I rebooted.

  • Upgrading NAND: I don't recall whether reboot put me in NAND or NOR (can use df -h to confirm which one you are in) but I got back into NOR and then moved the NAND.bin file into /tmp and ran "sysupgrade -v /tmp/NAND.bin". This copies the NOR config during the upgrade. After rebooting, get back into NAND (use df -h to confirm) and run the opkg commands again. At this point, you have your original NOR configuration on both NAND and NOR. I was predominantly using this config, thus I was done and happy with my setup. I have not tested extensively yet, but everything seems to be working.

1 Like

I have tried this tutorial and got into some sort of a limbo.
I am unable to install luci (fails to find git on repositories).
Unable to boot back to uboot (wanted to revert ar71xx image).
What can I do to revert either to ar71xx functional stable image with available packages, or somehow get luci installed?

EDIT:
OK, after having waited a bit, I attempted to install luci and succeeded this time.
I guess, it takes time for build servers to catch up on packages?

Good to hear it came up. No clue on the delay for luci install. Glad the tutorial was helpful!

Yeah, definetely useful post.
I even saved it to a pdf and put on my desktop, in case you know I lost internet while applying those changes :slightly_smiling_face:
What about Uboot though?
Is it really gone after flashing openwrt from snapshots?
When I perform the uboot procedure, I do get the proper 5 times blinking of the device and then power and wifi2.4 are lit (as they should be).
But there is no ping reply on 192.168.1.1 and there is no uboot web interface :slightly_frowning_face:

Hi guys, please correct me if I am worng, does this guid show you how to install a clean OpenWRT rv19 on the NOR partition?

I can easily install it on NAND but I cant seem to find an image for the NOR or a snapshot. Please advise.