[Upstream] - OpenWRT master, kernel 4.14 and gl-inet firmware

Thanks, will look into the different NAND chip – would you post or PM me the part number?

On the AR300M-Lite that I have, it looks like what I would guess is a SMD MOSFET has not been populated and bridged with a 0Ω jumper, so I can’t confirm that the USB power will come on for a non-Lite device. Having found several errors already in the DTS (note, for example, that the GPIO for the status LED is incorrect), I don’t completely trust that the DTS has gotten the sense of that line correct. It’s probably a non-issue as you don’t want to be PWM-ing the power to your USB port as defining it as an “LED” would permit and have already removed that designation from my DTS versions.

Thanks for the warning on working on development branches. I’ve been working with “bleeding edge” since it was Backfire.

GD5F1GQ4UCYIG - it’s very similar when looking at the data sheet for the Micron and comparing things…

It’s standard stuff - 3.0v, 120MHz clock, QIO, 2048-byte read, 128K erase, WSON8 package…

The more I dig into this board, the more I appreciate the developers, there’s a lot of smart thinking that went into it.

1 Like

Just keep a copy of your art partition backed up - that’s the factory data including RF Cal… for the AR300M-NAND it’s on /dev/mtd3

cat /dev/mtd3 > art.img # this backs it up to an image file
cat art.img > /dev/mtd3 # this restores

@jeffsf - the NAND box boots out of NOR still, that’s where uboot lives…

on the testing build - 3.012 - noticed that kernel was expecting the NOR to be a Micron 8K, but found the Winbond 16K

[    0.833518] m25p80 spi0.0: found w25q128, expected m25p80
[    0.848358] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.853261] 4 cmdlinepart partitions found on MTD device spi0.0
[    0.859369] Creating 4 MTD partitions on "spi0.0":
[    0.891689] spi-nand: Giga SPI NAND was found.
[    0.864336] 0x000000000000-0x000000040000 : "u-boot"
[    0.870837] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.877866] 0x000000050000-0x000000ff0000 : "reserved"
[    0.884717] 0x000000ff0000-0x000001000000 : "art"
[    0.896339] spi-nand: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
[    0.904469] 2 cmdlinepart partitions found on MTD device spi0.1
[    0.910586] Creating 2 MTD partitions on "spi0.1":
[    0.915573] 0x000000000000-0x000000200000 : "kernel"
[    0.925630] 0x000000200000-0x000008000000 : "ubi"
[    1.381634] found bad block 7fe0000

The bad block is nothing to worry about…

Only reason why I’m on openwrt master at the moment is that I’m helping out a small group that is bringing up a rockchip board, and I need to close out my stuff there before I get deeper into this board…

Yes, completely agree – hitting a US$18 price point (GL-AR300M-Lite), delivered, for such a capable device with clean, professional packaging, top-notch firmware, support, and a warranty isn’t easy. They’ve made it easy for me to recommend their products to all the people that are whining that their ancient or cheap devices with insufficient flash and/or RAM, as well as often outdated wireless chips, can’t be supported by modern, secure firmware.

From my AR300M-Lite (likely 2018 production), ath79 target, build based my changes after on

commit 7541d30c9c2946fe112d7966f9d1e7456725c324 (master)
Author: Kevin Darbyshire-Bryant <redacted>
Date:   Mon Dec 17 16:36:44 2018 +0000

I see similar

[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] MIPS: machine is GL.iNet GL-AR300M-Lite
[    0.000000] SoC: Qualcomm Atheros QCA9533 ver 2 rev 0
[...]
[    0.384810] m25p80 spi0.0: w25q128 (16384 Kbytes)

as well as on another vendor’s product using a QCA9558

[    0.399682] m25p80 spi0.0: w25q128 (16384 Kbytes)

(I also see the same “bad block” message on my AR750S at 7fe0000)

I might be on an older uboot…

root@GL-AR300M:~# strings /dev/mtd0 | grep -nr "U-Boot" | head -n 1
384:U-Boot 1.1.4-g36de7573 (May 26 2017 - 14:42:18)

Anyways - the bad block thing, like I mention, is just a warning, not a problem… The spi-nor - again, probably just a warning based on upstream code… would be good to have confirmation from the gl-intet folks…

The Lite has challenges - but I do think upfront that the AR-300M board with NAND has some serious traction with the maker community… and worthy of an LTS version of the board

@alzhao- nice to see pepe2k for Uboot - netconsole might be handy, but like the WebUI, could be a security risk - but no more than the WebGUI there.

No GL-AR750 Ath79 target?

Not yet – I’ve “paused” work there until Kernel 4.19 for ath79 is available with the “approved” NAND framework. (Upstream rejected the approach presently used.) I’ve got a NOR version running, but that doesn’t really provide a lot over the ar71xx target.

Edit: This looks promising

I noticed a patch in the mailing list. Looks like official support for ath79:

http://lists.infradead.org/pipermail/openwrt-devel/2019-June/017775.html

I’m currently building the firmware to test ath79. I’m really curious if the performance will be better!

OpenWrt ath79 has been on 4.14 with 4.19 as “testing” as noted above. After 19.07 was branched, master moved to 4.19. There is no announced LTS kernel past 4.19 at this time.

I would not expect any performance improvements with just the kernel change. There may be some minor changes in performance (in both directions) due to moving from the unsupported ar71xx platform to the ath79 platform and possibly different drivers. The main change is structural in how the kernel and drivers are managed.

The GL-AR150, GL-AR300M, GL-AR300M-Lite, GL-AR750S, and GL-X750 have all been on ath79 for some time now, though with only NOR support. On master they are on 4.19 at this time.

SPI-NAND support for the GL-AR300M and GL-AR750S is under review.

I suggest there would b little change in performance - stabilit, yes, shifting to a new target introduces unknowns…

Saw the recent checkin’s on Master for AR300M/AR300Lite for the ath79 target.

Something I’ve noticed on ath79 for ar150 is that they flipped the interface mapping - eth1 is now WAN, and eth0 is LAN - not sure why… but it can cause problems that one didn’t see on the ar7xxx, where the ar150 machine file shows eth0 as WAN

I might have to dig into this further, but my attention lays elsewhere at the moment… just curious if you see the same thing on the ar300m targets you’re working on.

For the community here - as @jeffsf mentions - no change in performance, so no big hurry to jump

Something about driver initialization, as I recall.

The flip, I believe, was undone with

commit 8dde11d521
Author:     Chuanhong Guo <redacted>
AuthorDate: Fri May 10 23:28:47 2019 +0800
Commit:     Petr Štetiar <redacted>
CommitDate: Wed Jun 5 10:12:31 2019 +0200

    ath79: dts: drop "simple-mfd" for gmacs in SoC dtsi
    
    With a proper probe deferring for ag71xx we don't need to explicitly
    probe mdio1 before gmac0.
    Drop all "simple-mfd" in SoC dtsi so that gmac orders can be the same
    as ar71xx.
    This makes eth0/eth1 order the same as those in ar71xx, which means
    we don't need a migration script for this anymore and we can merge
    incorrectly split gmac/mdio driver back together.
    
    Signed-off-by: Chuanhong Guo <redacted>

I resolved the first-boot issues that then arose with the GL-AR300M-Lite in commit eba0db95b5

actually, that does look what did the flip on AR150 compared to ar71xx - there, WAN port is mapped to ETH0, and LAN is ETH1

On first boot, the WAN port shows as a LAN port with an address of 192.168.1.1 - which if one is doing development work, and the local LAN is also 192.168.1.0/24, this causes an ARP conflict with the gateway…

From the GW log… GW is running pfSense on the 192.168.1.0/24 segment…

Oct 18 21:30:46 kernel arp: e4:95:6e:44:f7:ac is using my IP address 192.168.1.1 on igb1!

Which causes every host on that LAN segment to get very confused about who really is 192.168.1.1

Wonder how this impacts the failsafe recovery options with the pepe2k uboot page.

don’t have time to fix it right now - very busy with day job stuff…

Log info…

[    0.444524] libphy: Fixed MDIO Bus: probed
[    0.808376] ag71xx 19000000.eth: Could not connect to PHY device. Deferring p
robe.
[    1.487758] libphy: ag71xx_mdio: probed
[    1.491098] libphy: ar8xxx-mdio: probed
[    1.497091] switch0: Atheros AR724X/AR933X built-in rev. 2 switch registered 
on mdio-bus.0
[    1.543352] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000
, driver=Generic PHY]
[    1.551954] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    1.560582] NET: Registered protocol family 10
[    1.571933] Segment Routing with IPv6
[    1.574311] NET: Registered protocol family 17
[    1.578800] 8021q: 802.1Q VLAN Support v1.8
[    1.918985] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:1f:04 [uid=00
4dd041, driver=Generic PHY]
[    1.928510] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode: mii

and a bit further down the log where br-lan sorts itself out… (for those who might not know, first boot takes a bit as we have to build the jffs2 file system, subsequent boots take much less time.)

[   80.340793] br-lan: port 1(eth0) entered blocking state
[   80.344568] br-lan: port 1(eth0) entered disabled state
[   80.350400] device eth0 entered promiscuous mode
[   80.411887] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   80.504625] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   81.078304] eth0: link up (1000Mbps/Full duplex)
[   81.088168] br-lan: port 1(eth0) entered blocking state
[   81.091953] br-lan: port 1(eth0) entered forwarding state
[   81.137380] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   83.960736] eth1: link up (100Mbps/Full duplex)
[   84.011938] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   95.071990] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   95.148973] br-lan: port 2(wlan0) entered blocking state
[   95.152841] br-lan: port 2(wlan0) entered disabled state
[   95.158764] device wlan0 entered promiscuous mode
[   95.162956] br-lan: port 2(wlan0) entered blocking state
[   95.168200] br-lan: port 2(wlan0) entered forwarding state
[   95.658824] br-lan: port 2(wlan0) entered disabled state
[  100.358656] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  100.363866] br-lan: port 2(wlan0) entered blocking state
[  100.368960] br-lan: port 2(wlan0) entered forwarding state

some backup info, this is from the ar9331 data sheet, and if I recall, ar9531 is the same here…

One would want the GE0 mapped out to WAN, and GE1-MDIO and MAC to be mapped out to the LAN side to ensure enough bandwidth across the LAN ports

ar9331_ethernet_switch_block

1 Like

I agree that using the GMII interface for the “LAN” ports and the MII interface for the “WAN” port on a device with a 100-Mbps “WAN” phy makes sense. I don’t have a GL-AR150 in hand, so I can’t resolve it here.

I don’t know if this needs to be resolved here, this item is probably better sorted out over on OpenWRT’s forums.

Outcome would be positive for the gl-inet dev team if they choose to go towards the ath79 target, but there are both benefits and risks to get there with their internal development.

Anyways - the port mapping might be more relevant for GL-AR750, as it’s based on the same chip family, and there, we have multiple LAN ports.

1 Like

@jeffsf - feel free to chime in there.

Hmm… after doing some digging, maybe the port mapping is actually a production line problem.

Checked a number of my AR150’s, and they’re consistent here… including one fresh out of the box.

eth0, eth1, and wlan0 all share the same MAC address.

Reviewing the Atheros Radio Test Guide - MAC addresses are written in via bdChange during cal…

@alzhao - FYI… might want to get in front of this.

I’ll have to check my other non-AR150 devices to see what’s happening there.

From the fresh out of box device… 3.017

br-lan    Link encap:Ethernet  HWaddr E4:95:6E:4C:BC:E1  
          inet addr:192.168.8.1  Bcast:192.168.8.255  Mask:255.255.255.0
          inet6 addr: fdb1:c905:29a3:10::1/60 Scope:Global
          inet6 addr: fe80::e695:6eff:fe4c:bce1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10551 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15431 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1325704 (1.2 MiB)  TX bytes:15878539 (15.1 MiB)

eth0      Link encap:Ethernet  HWaddr **E4:95:6E:4C:BC:E0**  
          inet addr:192.168.1.152  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::e695:6eff:fe4c:bce0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12075 errors:0 dropped:67 overruns:0 frame:0
          TX packets:6868 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12093180 (11.5 MiB)  TX bytes:871173 (850.7 KiB)
          Interrupt:4 

eth1      Link encap:Ethernet  HWaddr **E4:95:6E:4C:BC:E0**  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:5 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:961 errors:0 dropped:0 overruns:0 frame:0
          TX packets:961 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:86902 (84.8 KiB)  TX bytes:86902 (84.8 KiB)

wlan0     Link encap:Ethernet  HWaddr **E4:95:6E:4C:BC:E0**  
          inet6 addr: fe80::e695:6eff:fe4c:bce0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10549 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15652 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1473378 (1.4 MiB)  TX bytes:16348455 (15.5 MiB)

ARM300M (NAND) is the same…