stynx
September 22, 2019, 2:49pm
1
GL-AR750S has an SD card slot - can I use that for extra storage space for software/packages, etc.?
jeff
September 22, 2019, 3:55pm
2
Possible using “extroot”, but using the 128 MB NAND is more robust and easier.
NAND is supported by the GL.iNet firmware as well as a long-pending PR for OpenWrt.
stynx
September 22, 2019, 7:53pm
3
Understood.
Will be waiting for the PR then.
Thanks!
Sorry for hijacking this thread, but I am unable to see the SD card reader on my installation, and I'm wondering which kmod's are required?
lsusb takes several seconds to complete, and shows only the root hub, if there is nothing plugged in to the external port, while I can see any connected device if I plug something in and activate the GPIO to power the device. It is my understanding that the SD card reader hangs off a combined USB hub/SD reader chip, but I don't even see that when I lsusb.
Does that need to be powered on separately?
jeff
October 24, 2019, 2:44pm
5
I don't know what version you're running. I fixed the GPIO for the USB early this year, but the PR has been sitting there, without meaningful review. In the mean time, commit 0f6b944c92 added a fixed regulator to power the USB. It is present on openwrt-19.07
and master
, but not openwrt-18.06
Until either the project reviews this months-old PR or I give up, building from
openwrt:master
← jeffsf:ath79-nand-pr
opened 07:29PM - 30 Jun 19 UTC
# Overview
This series of commits prepares for use of SPI-NAND from the upstr… eam Linux MTD framework for the ath79 target. It addresses upgrade issues associated with tar-style files and metadata, allowing "force-less" upgrade paths from ar71xx to ath79 builds, including from previous NOR builds to ath79 builds that support NAND.
Addresses comments in previous PRs around SPI-NAND support, including
https://github.com/openwrt/openwrt/pull/615
https://github.com/openwrt/openwrt/pull/1428#issuecomment-441594401
in the manner requested by @mkresin
> Please re-spin [PR 1428] as soon as we have kernel 4.19 support.
SPI-NAND support in this PR utilizes the upstream Linux framework, as requested.
The GL.iNet GL-AR300M and GL-AR750S devices are then supported using NAND with this framework.
The commits have been resequenced here from the order in which they were developed to provide clearer patches, rather than the original "find a problem and fix it" order. As a result, the reasoning behind some of the preliminary set of commits may not be completely clear until the devices are added in subsequent commits.
Original development done on `master` prior to the 19.07 branch and the change to Linux 4.19 for the ath79 target. This series should be able to be backported to v19 by adding `KERNEL_PATCHVER:=4.19` to `target/linux/ath79/nand/target.mk`
Boot logs and/or upgrade logs of any configuration or transition available on request.
# Roadmap of Commits
These logical "chunks" of commits are denoted in [my GitHub repo](https://github.com/jeffsf/openwrt) as tags. The links within each chunk's description below will show the commits and changes associated with each chunk.
The tags will be updated should this PR be rebased or changed prior to merge, keeping the tag-based links usable.
In addition to the supplied links, the tags are available in clones of my repo for local examination and exploration of the commits in this PR, without the need to apply remote patches to a local repo.
```
pr2184-00-merge_base
pr2184-04-Prepare_ath79-nand_target
pr2184-05-Enable_robust_upgrades
pr2184-06-GL-AR300M_NAND_support
pr2184-07-Add_GL-AR300M16
pr2184-08-GL-AR750S_NAND_support
```
Accepted from Patchwork:
* <strike>pr2184-01-Add_I2C_support</strike>
* <strike>pr2184-02-uboot-envtools_support_for_GL-AR300M-Lite</strike>
Superseded by commit 5b6a809092 and related:
* <strike>pr2184-03-Refactor_of_common_functions</strike>
## Prepare ath79-nand Target
<strike>* ath79: Remove legacy GL.iNet GL-AR300M NAND target
Removal for reimplementation [confirmed with original author](http://lists.infradead.org/pipermail/openwrt-devel/2019-May/017190.html).</strike>
Retained and _replaced_ on suggestion of @adrianschmutzler
* ath79: Prepare NAND subtarget for upstream support of SPI NAND
Use of subtarget-specific `nand/base-files/` makes this a lot cleaner and doesn't impact the generic or tiny targets.
Examination of the tiny target (and the one-board nature of `base-files/lib/functions/k2t.sh`) suggest that a few kB might be saved for the tiny target by similarly splitting out its own files from those for the generic target. This refactoring of the generic and tiny sub-targets was not performed. _(See further https://patchwork.ozlabs.org/patch/1181653/ by @adrianschmutzler for the ath79 target and https://github.com/openwrt/openwrt/pull/2513 for the ramips target.)_
https://github.com/jeffsf/openwrt/compare/jeffsf:pr2184-00-merge_base...jeffsf:pr2184-04-Prepare_ath79-nand_target
_Also available as https://patchwork.ozlabs.org/patch/1186259/_
## Enable Robust Upgrades
* build: sysupgrade-tar alt-board= for legacy upgrades
Existing sysupgrade tooling on the ar71xx platform isn't able to upgrade to ath79 NAND images, even with the use of SUPPORTED_DEVICES.
* sysupgrade: NAND: Prefer CONTROL for board, improve robustness
Rather than taking the first directory found in the tar as that from which the assets are obtained, trust the contents of the CONTROL file found. Though the CONTROL file could be fed to sh, parse it somewhat robustly to allow for a transition to JSON or other formats in the future.
grep -m 1 -o -E "\bBOARD=[^[:space:]'\"]+"
Exploration of legacy flashing revealed some "interesting" behavior of the NAND upgrade process off the "happy path". The most egregious were addressed.
Unmodified, `nand_do_upgrade_success()` continues to perform a reboot rather than returning. This continues to prevent boards from checking that the flash was successful prior to changing the next-boot partition. Do to the invasiveness of changing this, it was not refactored at this time. Future refactor of this should also consider using the existing `$CONF_TAR` rather than the hard-coded `local conf_tar="/tmp/sysupgrade.tgz"`
Error-checking was examined, but between the above concerns and the challenges on getting return codes from pipelined commands under `sh` (neither `pipefail` nor `PIPESTATUS` are available) it was not further pursued. Initial thoughts were that non-zero error codes might be split into those that were still bootable ("warnings") and those that were not bootable ("errors"), perhaps as positive and negative for ease of consistent implementation.
https://github.com/jeffsf/openwrt/compare/jeffsf:pr2184-04-Prepare_ath79-nand_target...jeffsf:pr2184-05-Enable_robust_upgrades
_Also available as https://patchwork.ozlabs.org/project/openwrt/list/?series=138554_
## GL-AR300M NAND Support
With the previous support in place, the boards can be added. Features such as access to NAND storage while booted under NOR (intentionally, or as a result of boot-count based fail over) and flashing either NOR-based or NAND-based firmware are provided.
Legacy NOR boards may be transitioned to full support of NAND without serial, U-Boot access, or use of "force" in sysupgrade. For example
Legacy NOR ==> glinet,gl-ar300m-nor ==> glinet,gl-ar300m-nand
Direct transition to glinet,gl-ar300m-nand from a NOR kernel is not possible and is prevented by checks already in place within sysupgrade. For example:
```
LEDE_RELEASE="OpenWrt 18.06.2 r7676-cddd7b4c77"
"model": {
"id": "gl-ar300m",
"name": "GL.iNet GL-AR300M"
},
root@OpenWrt:/# sysupgrade /tmp/OpenWrt-2019-06-29_0807-0700-ath79-nand-glinet_g
l-ar300m-nand-squashfs-sysupgrade.bin
Invalid image type.
Image check 'platform_check_image' failed.
```
https://github.com/jeffsf/openwrt/compare/jeffsf:pr2184-05-Enable_robust_upgrades...jeffsf:pr2184-06-GL-AR300M_NAND_support
## Add GL-AR300M16
As the glinet,gl-ar300m-nor board was moved to the NAND target in the previous commits, there is not a "generic" build suitable for the dual-port, NAND-less GL-AR300M16, or for users of the GL-AR300M that do not need access to the NAND (which adds ~320 kB at this time).
This commit clearly disambiguates the "generic" (NOR-only) build and its primary, intended device from the NAND-aware build.
[https://github.com/jeffsf/openwrt/compare/jeffsf:pr2184-06-GL-AR300M\_NAND\_support...jeffsf:pr2184-07-Add\_GL-AR300M16](https://github.com/jeffsf/openwrt/compare/jeffsf:pr2184-06-GL-AR300M_NAND_support...jeffsf:pr2184-07-Add_GL-AR300M16)
## GL-AR750S NAND Support
Two variants are provided, one with root file system on NOR flash, the other with it on NAND flash. Consistent with the OEM firmware at this time, the kernel always resides on NOR flash.
As noted in the commit message, the "glinet,gl-ar750s-nand" board name is reserved for a potential, future build that boots its kernel from NAND flash. It is likely that change to the U-Boot would be required to boot off NAND, either from the manufacturer or a third party. The current U-Boot provides for updating itself through an HTTP interface, without serial connectivity being required.
[https://github.com/jeffsf/openwrt/compare/jeffsf:pr2184-07-Add\_GL-AR300M16...pr2184-08-GL-AR750S\_NAND\_support](https://github.com/jeffsf/openwrt/compare/jeffsf:pr2184-07-Add_GL-AR300M16...pr2184-08-GL-AR750S_NAND_support)
will give you the best functionality from the device.
Fantastic, thanks for responding so quickly, and for doing all that work!
In the meantime, I have dug into the OpenWRT sources, and saw a fairly recent commit to the ar750s device tree bindings that enables that USB hub. It seems that my snapshot is older than that, though! Looks like time for me to rebuild and update my router!
The other thing I am trying to do with it is see if I can get it working as a USB gadget. Unfortunately, the data sheet shows that the second usb port is indeed device-capable, but that port is connected via the USB hub to the SD card reader, and the internal USB header pins. The external USB host port is however directly connected to the first USB port on the SoC, so I'm hoping that while the data sheet doesn't explicitly say it works, it might just work anyway!
Still trying to figure out what incantation to change in the dts file to test it out, though! Looks like a 'dr_mode ="peripheral"' might do the trick! And if that works, I am going to try to convince GL.Inet to spin a second revision with the USB hub connected to the first port on the SoC, and the second port connected directly to the microUSB connector.
tmomas
Closed
November 3, 2019, 3:25pm
7
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.