[OpenWrt-Devel] [PATCH] ath79: Add support for Ubiquity

Joe Ayers joe at ayerscasa.com
Sat Nov 17 21:40:56 EST 2018


> > I have a NanoStation M5 XW (and can get access to a NS M2 XW).    I
> > can test. What's the reference to build and test?
>
> thanks for the help with testing, something like this could work:
>
>  cd openwrt.git
>  git remote add github-ynezz https://github.com/ynezz/openwrt.git
>  git fetch github-ynezz
>  git checkout -b nanostation-m-xw github-ynezz/wip/nanostation-m-xw
>  echo -e "CONFIG_TARGET_ath79=y\nCONFIG_TARGET_ath79_generic=y\nCONFIG_TARGET_ath79_generic_DEVICE_ubnt_nano-m-xw=y" > .config
>  make defconfig world -j$(nproc)
>
> > The signature restriction for Ubiquiti is enforced in the AirOS UI.
> > The bootloader does not check for signatures.   We routinely tftp
> > images to all the newer UBNT devices based on 3.18.06.1, including
> > latest models for NanoStation M2 XW. http://www.arednmesh.org
>
> BTW, nice project! FYI, my Bullet M2HP running airOS v6.1.7 doesn't switch to
> TFTP server mode even after pressing reset for 1 minute. What airOS version do
> you've on you Nanostation units that it works for you?
>
> This is my U-Boot 1.1.4-s1039 (May 24 2017 - 15:58:18)
>
> > The AirOS 5 firmware won't install, at least we never found a way for it to
> > work, but didn't need to as we directly tftp to the latest AirOS versions.
>
> Hm, I'm really wondering what version of airOS do you've on your devices, that
> the TFTP recovery method works for you.
>

root at AE6XE-NSM5XW-QTH:~# cat /etc/openwrt_version
r7258-5eb055306f
root at AE6XE-NSM5XW-QTH:~# cat /dev/mtd0 | grep U-Boot
U-Boot 1.1.4-s1039 (May 24 2017 - 15:58:18)
root at AE6XE-NSM5XW-QTH:~# cat /tmp/sysinfo/model
Ubiquiti Nanostation M XW

I also use a dumb switch between ubnt device and laptop.  If the ubnt
doesn't have the port link up at the proper timing, then it doesn't
respond.
If you have a device with various tftp firmware uploads and bootloader
versions, you may need to do serial console recovery to force the
uboot version to be updated.   Then once there is a version of AirOS
loaded, load another version of AirOS from the UI, this is the only
way I've found to get a device back to 'normal'.  Following the
various serial recovery procedures to force update of bootloader and
set partition map to default, don't always work.

I applied the equivalent change to your build:
https://github.com/aredn/aredn_ar71xx/blob/develop/patches/002-firmware-check-fix.patch
super-set of detail if interested, devices we have people in our
community we're supporting:
https://github.com/aredn/aredn_ar71xx/blob/develop/README.md

Happy to help out to make sure these devices are migrated to ath97,
otherwise we might end up implementing our self at some point.   We're
focused mostly on tower or roof mount type devices.  Here in Southern
CA, we have a network now passing over 400 nodes over 250 miles end to
end outside unlicensed channels in ham radio only space, e.g. up to
channel 184 in 5GHz.

I applied this 002-firmware-check-fix.patch to your build referenced
above and tftp'd it to a NS M5 XW with "U-Boot 1.1.4-s1039 (May 24
2017 - 15:58:18)" bootloader.  Looks like nano-m-xw is missing from
.../base-files/etc/board.d/02_network.   Consequently, the network
physical ports are non-functional and the wireless is not showing up.

What other data would be helpful?

Joe

root at OpenWrt:/# dmesg
[    0.000000] Linux version 4.14.81 (aredn at 7039ee8a4bea) (gcc version 7.3.0 (Op
enWrt GCC 7.3.0 r8470-bc95553)) #0 Sat Nov 17 23:55:20 2018
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] MIPS: machine is Ubiquiti Nano-M (XW)
[    0.000000] SoC: Atheros AR9342 rev 2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32
bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 805094a0, node_mem_map 8100752
0
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] random: get_random_bytes called from start_kernel+0x8c/0x474 with
 crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jff
s2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 58276K/65536K available (3728K kernel code, 148K rwdata,
900K rodata, 1232K init, 204K bss, 7260K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] CPU clock: 535.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_i
dle_ns: 7144898866 ns
[    0.000011] sched_clock: 32 bits at 267MHz, resolution 3ns, wraps every 80279
76190ns
[    0.008324] Calibrating delay loop... 266.64 BogoMIPS (lpj=1333248)
[    0.094953] pid_max: default: 32768 minimum: 301
[    0.100094] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.107154] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.119396] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, ma
x_idle_ns: 19112604462750000 ns
[    0.129911] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.136503] pinctrl core: initialized pinctrl subsystem
[    0.143227] NET: Registered protocol family 16
[    0.176353] clocksource: Switched to clocksource MIPS
[    0.182999] NET: Registered protocol family 2
[    0.188554] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.195989] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.202825] TCP: Hash tables configured (established 1024 bind 1024)
[    0.209770] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.216001] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.223019] NET: Registered protocol family 1
[    0.227734] PCI: CLS 0 bytes, default 32
[    0.232726] Crashlog allocated RAM at address 0x3f00000
[    0.240295] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.252903] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.259162] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORIT
Y) (c) 2001-2006 Red Hat, Inc.
[    0.280291] io scheduler noop registered
[    0.284476] io scheduler deadline registered (default)
[    0.292552] pinctrl-single 1804002c.pinmux: 544 pins at pa b804002c size 68
[    0.301190] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.308855] console [ttyS0] disabled
[    0.312712] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 8, base_baud = 250
0000) is a 16550A
[    0.321958] console [ttyS0] enabled
[    0.329386] bootconsole [early0] disabled
[    0.349188] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    0.354204] 5 fixed-partitions partitions found on MTD device spi0.0
[    0.360704] Creating 5 MTD partitions on "spi0.0":
[    0.365573] 0x000000000000-0x000000040000 : "u-boot"
[    0.371607] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.378000] 0x000000050000-0x0000007b0000 : "firmware"
[    0.395789] 2 uimage-fw partitions found on MTD device firmware
[    0.401869] 0x000000050000-0x0000001e0000 : "kernel"
[    0.407815] 0x0000001e0000-0x0000007b0000 : "rootfs"
[    0.413689] mtd: device 4 (rootfs) set to be root filesystem
[    0.419530] 1 squashfs-split partitions found on MTD device rootfs
[    0.425810] 0x0000003e0000-0x0000007b0000 : "rootfs_data"
[    0.432209] 0x0000007b0000-0x0000007f0000 : "cfg"
[    0.437940] 0x0000007f0000-0x000000800000 : "EEPROM"
[    0.445162] libphy: Fixed MDIO Bus: probed
[    0.786811] libphy: ag71xx_mdio: probed
[    0.793576] switch0: Atheros AR8236 rev. 1 switch registered on mdio-bus.0
[    1.136789] libphy: ag71xx_mdio: probed
[    1.426697] mdio-bus.1:1f: Found an AR934X built-in switch
[    1.432465] libphy: ar7240sw_mdio: probed
[    1.827489] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:04 [uid=004dd
043, driver=Atheros AR8216/AR8236/AR8316]
[    1.839127] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[    2.178216] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000
, driver=Generic PHY]
[    2.188098] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[    2.196926] NET: Registered protocol family 10
[    2.206998] Segment Routing with IPv6
[    2.210840] NET: Registered protocol family 17
[    2.215400] 8021q: 802.1Q VLAN Support v1.8
[    2.226505] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    2.241713] Freeing unused kernel memory: 1232K
[    2.246313] This architecture does not have kernel memory protection.
[    2.526365] random: fast init done
[    2.930995] init: Console is alive
[    2.934717] init: - watchdog -
[    3.893405] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.032500] usbcore: registered new interface driver usbfs
[    4.038224] usbcore: registered new interface driver hub
[    4.043726] usbcore: registered new device driver usb
[    4.056587] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.065257] ehci-platform: EHCI generic platform driver
[    4.071632] kmodloader: done loading kernel modules from /etc/modules-boot.d/
*
[    4.089530] init: - preinit -
[    5.119352] random: jshn: uninitialized urandom read (4 bytes read)
[    5.305077] random: jshn: uninitialized urandom read (4 bytes read)
[    5.422158] random: jshn: uninitialized urandom read (4 bytes read)
[    5.928488] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    8.017738] eth0: link up (100Mbps/Full duplex)
[    8.022374] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    9.210767] jffs2: notice: (432) jffs2_build_xattr_subsystem: complete buildi
ng xattr subsystem, 4 of xdatum (0 unchecked, 2 orphan) and 4 of xref (2 dead, 0
 orphan) found.
[    9.227921] mount_root: switching to jffs2 overlay
[    9.261400] overlayfs: upper fs does not support tmpfile.
[    9.272788] urandom-seed: Seed file not found (/etc/urandom.seed)
[    9.491442] procd: - early -
[    9.494491] procd: - watchdog -
[   10.096363] eth0: link down
[   10.138689] procd: - watchdog -
[   10.142215] procd: - ubus -
[   10.175769] urandom_read: 4 callbacks suppressed
[   10.175779] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.195559] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.202662] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.210461] procd: - init -
[   10.689901] kmodloader: loading kernel modules from /etc/modules.d/*
[   10.702352] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   10.721329] Loading modules backported from Linux version v4.19-rc5-0-g6bf4ca
7fbc85
[   10.729173] Backport generated by backports.git v4.19-rc5-1-0-g05571dcd
[   10.739602] ip_tables: (C) 2000-2006 Netfilter Core Team
[   10.755590] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   10.835243] xt_time: kernel timezone is -0000
[   10.912953] PPP generic driver version 2.4.2
[   10.920370] NET: Registered protocol family 24
[   10.976253] ath: EEPROM regdomain: 0x2a
[   10.976264] ath: EEPROM indicates we should expect a direct regpair map
[   10.976285] ath: Country alpha2 being used: US
[   10.976289] ath: Regpair used: 0x2a
[   10.992093] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   10.994240] ieee80211 phy0: Atheros AR9340 Rev:2 mem=0xb8100000, irq=11
[   11.035649] kmodloader: done loading kernel modules from /etc/modules.d/*
[   20.949972] eth0: link up (100Mbps/Full duplex)
[   20.956187] br-lan: port 1(eth0) entered blocking state
[   20.961589] br-lan: port 1(eth0) entered disabled state
[   20.967245] device eth0 entered promiscuous mode
[   20.989471] br-lan: port 1(eth0) entered blocking state
[   20.994791] br-lan: port 1(eth0) entered forwarding state
[   21.000529] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   21.100613] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   22.016495] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   22.177628] eth1: link up (1000Mbps/Full duplex)
[   22.182357] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   99.646411] random: crng init done
root at OpenWrt:/#root at OpenWrt:/# cat /etc/board.json
{
        "model": {
                "id": "ubnt,nano-m-xw",
                "name": "Ubiquiti Nano-M (XW)"
        },
        "rssimon": {
                "wlan0": {
                        "refresh": 200000,
                        "threshold": 1
                }
        },
        "led": {
                "rssilow": {
                        "name": "",
                        "sysfs": "ubnt:red:link1",
                        "type": "rssi",
                        "iface": "wlan0",
                        "minq": "1",
                        "maxq": "100",
                        "offset": "0",
                        "factor": "1"
                },
                "rssimediumlow": {
                        "name": "",
                        "sysfs": "ubnt:orange:link2",
                        "type": "rssi",
                        "iface": "wlan0",
                        "minq": "26",
                        "maxq": "100",
                        "offset": "0",
                        "factor": "1"
                },
                "rssimediumhigh": {
                        "name": "",
                        "sysfs": "ubnt:green:link3",
                        "type": "rssi",
                        "iface": "wlan0",
                        "minq": "51",
                        "maxq": "100",
                        "offset": "0",
                        "factor": "1"
                },
                "rssihigh": {
                        "name": "",
                        "sysfs": "ubnt:green:link4",
                        "type": "rssi",
                        "iface": "wlan0",
                        "minq": "76",
                        "maxq": "100",
                        "offset": "0",
                        "factor": "1"
                }
        },
        "network": {
                "lan": {
                        "ifname": "eth0",
                        "protocol": "static"
                },
                "wan": {
                        "ifname": "eth1",
                        "protocol": "dhcp"
                }
        }
}
root at OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 04:18:D6:A7:70:B5
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::618:d6ff:fea7:70b5/64 Scope:Link
          inet6 addr: fdfb:45ac:c279::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:1958 (1.9 KiB)

eth0      Link encap:Ethernet  HWaddr 04:18:D6:A7:70:B5
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:2224 (2.1 KiB)
          Interrupt:4

eth1      Link encap:Ethernet  HWaddr 06:18:D6:A7:70:B5
          inet6 addr: fe80::418:d6ff:fea7:70b5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:235 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:75784 (74.0 KiB)
          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:224 errors:0 dropped:0 overruns:0 frame:0
          TX packets:224 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15232 (14.8 KiB)  TX bytes:15232 (14.8 KiB)


Joe

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list