Adding support for Mojo Networks C-65

Tried that... it returns an error :frowning:

So far got both ath9 and ath10 loaded and both wifi chips are working, 5G LED connected directly as you mentioned.
Got some errors on the in the boot log from ath10k...

U-Boot 1.1.4--LSDK-10.2.85 (Sep  3 2014 - 16:45:27)

EAP1018A1-FLF-FW - Scorpion 1.0

DRAM:  128 MB

cpu_pll_cfg: 0x21480  cpu_pll_dither: 0x3c103f
CFG_PLL_FREQ: 0x2  CFG_HZ: 360000000
CPU Clock: 720MHz    DDR Clock: 680MHz

Flash Manuf Id 0xc2, DeviceId0 0x20, DeviceId1 0x18
flash size 16MB, sector count = 256
flash-2 size 16MB, sector count = 256
Flash: 16 *2 MB
In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
athrs_sgmii_res_cal: cal value = 0x1
Fetching MAC Address from 0x87fedb6c
ath_gmac_enet_initialize: reset mask:c02200
Scorpion  ----> 8035 PHY *
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:11:74:ed:20:3f
ATHR_AUTONEG_ADVERT:1DE1
ATHR_1000BASET_CONTROL:200
ATHR_PHY_CONTROL:3100
ATHRSF1_PHY: Port 5, Neg Success
ATHRSF1_PHY: unit 0 phy addr 5 eth0 up
eth0
Setting 0x18116290 to 0x1020214f
Hit any key to stop autoboot:  0
multiboot=1
Trying eth0
dup 1 speed 1000
Using eth0 device
TFTP from server 192.168.1.100; our IP address is 192.168.1.1
Filename 'c65_atnboot.bin'.
Load address: 0x81000000
Loading: T #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###########################
done
Bytes transferred = 4464123 (441dfb hex)

## Checking Image at 81000000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.121
   Created:      2019-05-31  19:01:33 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4464059 Bytes =  4.3 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
## Booting image at 81000000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.121
   Created:      2019-05-31  19:01:33 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4464059 Bytes =  4.3 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x81000040 ...OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728

Starting kernel ...

[    0.000000] Linux version 4.14.121 (osboxes@osboxes) (gcc version 7.4.0 (OpenWrt GCC 7.4.0 r10114-a1210f8888)) #0 Fri May 31 19:01:33 2019
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[    0.000000] MIPS: machine is AirTight C-65
[    0.000000] SoC: Qualcomm Atheros QCA9558 ver 1 rev 0
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 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-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x90/0x478 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 114220K/131072K available (3792K kernel code, 151K rwdata, 912K rodata, 10176K init, 204K bss, 16852K 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: 720.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5309056796 ns
[    0.000007] sched_clock: 32 bits at 360MHz, resolution 2ns, wraps every 5965232126ns
[    0.008287] Calibrating delay loop... 358.80 BogoMIPS (lpj=1794048)
[    0.074976] pid_max: default: 32768 minimum: 301
[    0.080050] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.087086] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.097895] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.108388] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.114926] pinctrl core: initialized pinctrl subsystem
[    0.121190] NET: Registered protocol family 16
[    0.131448] PCI host bridge /ahb/apb/pcie-controller@180c0000 ranges:
[    0.138309]  MEM 0x0000000010000000..0x0000000011ffffff
[    0.143891]   IO 0x0000000000000000..0x0000000000000000
[    0.149744] PCI host bridge /ahb/apb/pcie-controller@18250000 ranges:
[    0.156630]  MEM 0x0000000012000000..0x0000000013ffffff
[    0.162181]   IO 0x0000000000000001..0x0000000000000001
[    0.167742] ar724x-pci 18250000.pcie-controller: PCIe link is down
[    0.186721] PCI host bridge to bus 0000:00
[    0.191117] pci_bus 0000:00: root bus resource [mem 0x10000000-0x11ffffff]
[    0.198426] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.204357] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.211573] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.220403] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x101fffff 64bit]
[    0.228197] pci 0000:00:00.0: BAR 6: assigned [mem 0x10200000-0x1020ffff pref]
[    0.236027] PCI host bridge to bus 0000:01
[    0.240387] pci_bus 0000:01: root bus resource [mem 0x12000000-0x13ffffff]
[    0.247712] pci_bus 0000:01: root bus resource [io  0x0001]
[    0.253631] pci_bus 0000:01: root bus resource [??? 0x00000000 flags 0x0]
[    0.260855] pci_bus 0000:01: No busn resource found for root bus, will use [bus 01-ff]
[    0.271262] clocksource: Switched to clocksource MIPS
[    0.277427] NET: Registered protocol family 2
[    0.282676] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.290092] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.296893] TCP: Hash tables configured (established 1024 bind 1024)
[    0.303759] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.309980] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.316861] NET: Registered protocol family 1
[    0.479955] Crashlog allocated RAM at address 0x3f00000
[    0.486570] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.497238] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.503467] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.594899] io scheduler noop registered
[    0.599070] io scheduler deadline registered (default)
[    0.606301] pinctrl-single 1804002c.pinmux: 544 pins at pa b804002c size 68
[    0.614563] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.621912] console [ttyS0] disabled
[    0.625745] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 2500000) is a 16550A
[    0.634946] console [ttyS0] enabled
[    0.634946] console [ttyS0] enabled
[    0.642367] bootconsole [early0] disabled
[    0.642367] bootconsole [early0] disabled
[    0.654468] ath79-spi 1f000000.spi: cs64 >= max 2
[    0.659250] spi_master spi0: spi_device register error /ahb/spi@1f000000/flash@1000000
[    0.667323] spi_master spi0: Failed to create SPI device for /ahb/spi@1f000000/flash@1000000
[    0.677395] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[    0.682592] 5 fixed-partitions partitions found on MTD device spi0.0
[    0.689031] Creating 5 MTD partitions on "spi0.0":
[    0.693910] 0x000000000000-0x000000040000 : "u-boot"
[    0.699578] 0x000000040000-0x000000060000 : "uboot-env"
[    0.705507] 0x000000060000-0x000000260000 : "kernel"
[    0.711132] 0x000000260000-0x000000ff0000 : "rootfs"
[    0.716772] mtd: device 3 (rootfs) set to be root filesystem
[    0.722594] mtdsplit: no squashfs found in "rootfs"
[    0.727563] 0x000000ff0000-0x000001000000 : "art"
[    0.733788] libphy: Fixed MDIO Bus: probed
[    0.739821] ag71xx 19000000.eth: invalid MAC address, using random address
[    1.082939] libphy: ag71xx_mdio: probed
[    1.211993] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:05 [uid=004dd072, driver=Atheros 8035 ethernet]
[    1.222745] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii-id
[    1.230885] NET: Registered protocol family 10
[    1.238473] Segment Routing with IPv6
[    1.242310] NET: Registered protocol family 17
[    1.246853] 8021q: 802.1Q VLAN Support v1.8
[    1.283288] Freeing unused kernel memory: 10176K
[    1.287977] This architecture does not have kernel memory protection.
[    1.304930] init: Console is alive
[    1.308533] init: - watchdog -
[    1.336687] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    1.345445] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    1.353961] init: - preinit -
[    1.517182] random: jshn: uninitialized urandom read (4 bytes read)
[    1.565807] random: jshn: uninitialized urandom read (4 bytes read)
[    1.587445] random: jshn: uninitialized urandom read (4 bytes read)
[    1.700860] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    3.631260] random: fast init done
[    4.820798] procd: - early -
[    4.824325] procd: - watchdog -
[    5.362965] procd: - watchdog -
[    5.366348] procd: - ubus -
[    5.374402] urandom_read: 4 callbacks suppressed
[    5.374408] random: ubusd: uninitialized urandom read (4 bytes read)
[    5.419407] random: ubusd: uninitialized urandom read (4 bytes read)
[    5.426241] random: ubusd: uninitialized urandom read (4 bytes read)
[    5.433503] procd: - init -
Please press Enter to activate this console.
[    5.593662] kmodloader: loading kernel modules from /etc/modules.d/*
[    5.603491] l2tp_core: L2TP core driver, V2.0
[    5.609276] l2tp_netlink: L2TP netlink interface
[    5.619027] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    5.629969] Netfilter messages via NETLINK v0.30.
[    5.636878] ip_set: protocol 6
[    5.666671] Loading modules backported from Linux version v4.19.32-0-g3a2156c839c7
[    5.674382] Backport generated by backports.git v4.19.32-1-0-g1c4f7569
[    5.685175] ip_tables: (C) 2000-2006 Netfilter Core Team
[    5.699974] nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
[    5.779128] xt_time: kernel timezone is -0000
[    5.831603] PPP generic driver version 2.4.2
[    5.838016] NET: Registered protocol family 24
[    5.865081] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[    5.870980] ath10k_pci 0000:00:00.0: pci irq legacy oper_irq_mode 1 irq_mode 0 reset_mode 0
[    6.144416] ath10k_pci 0000:00:00.0: Direct firmware load for ath10k/pre-cal-pci-0000:00:00.0.bin failed with error -2
[    6.155291] ath10k_pci 0000:00:00.0: Falling back to user helper
[    6.249935] firmware ath10k!pre-cal-pci-0000:00:00.0.bin: firmware_loading_store: map pages failed
[    6.259262] ath10k_pci 0000:00:00.0: Direct firmware load for ath10k/cal-pci-0000:00:00.0.bin failed with error -2
[    6.269782] ath10k_pci 0000:00:00.0: Falling back to user helper
[    6.487314] ath10k_pci 0000:00:00.0: Direct firmware load for ath10k/QCA988X/hw2.0/firmware-6.bin failed with error -2
[    6.498197] ath10k_pci 0000:00:00.0: Falling back to user helper
[    6.634055] firmware ath10k!QCA988X!hw2.0!firmware-6.bin: firmware_loading_store: map pages failed
[    6.645146] ath10k_pci 0000:00:00.0: qca988x hw2.0 target 0x4100016c chip_id 0x043222ff sub 0000:0000
[    6.654540] ath10k_pci 0000:00:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 1
[    6.667543] ath10k_pci 0000:00:00.0: firmware ver 10.2.4-1.0-00043 api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 ed0aafd8
[    6.761431] ath10k_pci 0000:00:00.0: Direct firmware load for ath10k/QCA988X/hw2.0/board-2.bin failed with error -2
[    6.772042] ath10k_pci 0000:00:00.0: Falling back to user helper
[    6.892307] firmware ath10k!QCA988X!hw2.0!board-2.bin: firmware_loading_store: map pages failed
[    6.901484] ath10k_pci 0000:00:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
[    8.015587] ath10k_pci 0000:00:00.0: htt-ver 2.1 wmi-op 5 htt-op 2 cal file max-sta 128 raw 0 hwcrypto 1
[    8.191895] l2tp_ppp: PPPoL2TP kernel driver, V2.0
[    8.250337] ieee80211 phy1: Atheros AR9550 Rev:0 mem=0xb8100000, irq=14
[    8.298108] kmodloader: done loading kernel modules from /etc/modules.d/*
[   27.944093] eth0: link up (1000Mbps/Full duplex)
[   27.951643] br-lan: port 1(eth0) entered blocking state
[   27.956951] br-lan: port 1(eth0) entered disabled state
[   27.962518] device eth0 entered promiscuous mode
[   27.996135] br-lan: port 1(eth0) entered blocking state
[   28.001477] br-lan: port 1(eth0) entered forwarding state
[   28.007076] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   29.001333] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  115.666585] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[  115.722293] br-lan: port 2(wlan1) entered blocking state
[  115.727690] br-lan: port 2(wlan1) entered disabled state
[  115.733357] device wlan1 entered promiscuous mode
[  120.701329] random: crng init done
[  123.942276] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[  123.948919] br-lan: port 2(wlan1) entered blocking state
[  123.954360] br-lan: port 2(wlan1) entered forwarding state
[  153.144153] device wlan1 left promiscuous mode
[  153.148736] br-lan: port 2(wlan1) entered disabled state
[  153.993883] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[  154.047648] br-lan: port 2(wlan1) entered blocking state
[  154.053154] br-lan: port 2(wlan1) entered disabled state
[  154.058774] device wlan1 entered promiscuous mode
[  154.063710] br-lan: port 2(wlan1) entered blocking state
[  154.069104] br-lan: port 2(wlan1) entered forwarding state
[  154.461294] br-lan: port 2(wlan1) entered disabled state
[  162.282354] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[  162.288932] br-lan: port 2(wlan1) entered blocking state
[  162.294364] br-lan: port 2(wlan1) entered forwarding state
[  209.167381] ath10k_pci 0000:00:00.0: pdev param 0 not supported by firmware
[  209.190052] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  209.200188] br-lan: port 3(wlan0) entered blocking state
[  209.205627] br-lan: port 3(wlan0) entered disabled state
[  209.211295] device wlan0 entered promiscuous mode
[  289.803897] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  289.810531] br-lan: port 3(wlan0) entered blocking state
[  289.815957] br-lan: port 3(wlan0) entered forwarding state
[  571.618531] device wlan1 left promiscuous mode
[  571.623184] br-lan: port 2(wlan1) entered disabled state
[  572.708454] IPv6: ADDRCONF(NETDEV_UP): wlan1-1: link is not ready
[  572.766365] br-lan: port 2(wlan1-1) entered blocking state
[  572.772032] br-lan: port 2(wlan1-1) entered disabled state
[  572.777949] device wlan1-1 entered promiscuous mode
[  572.879578] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[  574.266826] wlan1: authenticate with bc:ae:c5:eb:0b:af
[  574.297272] wlan1: send auth to bc:ae:c5:eb:0b:af (try 1/3)
[  574.305182] wlan1: authenticated
[  574.311398] wlan1: associate with bc:ae:c5:eb:0b:af (try 1/3)
[  574.319643] wlan1: RX AssocResp from bc:ae:c5:eb:0b:af (capab=0xc11 status=0 aid=5)
[  574.327592] wlan1: associated
[  574.679364] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[  574.689075] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1-1: link becomes ready
[  574.695869] br-lan: port 2(wlan1-1) entered blocking state
[  574.701453] br-lan: port 2(wlan1-1) entered forwarding state


Headed to rest.
After cleanup I will also need to figure out how to make a flashable image and flash it :slight_smile:

The ath10k “error -2” lines are normal. It has a list of places to look for each of several files it needs and -2 is file not found for that option as it checks all the possible places. Unfortunately it doesn’t report success!!

Stuck on creating a firmware that will be able to flash itself onto the router... or, better, will set uboot variables and also flash itself (aka oem to openwrt) :slight_smile:
My progress so far:

  • Backed up all partitions using luci while running from ramdisk.
  • The uboot was trying to move around some files if booting from flash (it was part of the scripts in u-boot configuration) so I removed that part from uboot env
  • I changed the partition layout in the image to unite “kernel” and “rootfs” in one called “firmware”
  • I flashed the openwrt image with uboot directly to flash memory at the firmware partition start address
  • Tried to boot - kernel panic :-/
[    1.012838] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.020433] Please append a correct "root=" boot option; here are the available partitions:
[    1.028942] 1f00             256 mtdblock0
[    1.028946]  (driver?)
[    1.035582] 1f01             128 mtdblock1
[    1.035586]  (driver?)
[    1.042227] 1f02           13952 mtdblock2
[    1.042230]  (driver?)
[    1.048861] 1f03              64 mtdblock3
[    1.048864]  (driver?)
[    1.055494] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.064615] Rebooting in 1 seconds..

post the kernel cmdline dmesg output from the above boot sequence .... usually this error is due to an incorrect cmdline ...

1 Like

All I have:

U-Boot 1.1.4--LSDK-10.2.85 (Sep  3 2014 - 16:45:27)

EAP1018A1-FLF-FW - Scorpion 1.0

DRAM:  128 MB

cpu_pll_cfg: 0x21480  cpu_pll_dither: 0x3c103f
CFG_PLL_FREQ: 0x2  CFG_HZ: 360000000
CPU Clock: 720MHz    DDR Clock: 680MHz

Flash Manuf Id 0xc2, DeviceId0 0x20, DeviceId1 0x18
flash size 16MB, sector count = 256
flash-2 size 16MB, sector count = 256
Flash: 16 *2 MB
In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
athrs_sgmii_res_cal: cal value = 0x1
Fetching MAC Address from 0x87fedb6c
ath_gmac_enet_initialize: reset mask:c02200
Scorpion  ----> 8035 PHY *
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:11:74:ed:20:3f
ATHR_AUTONEG_ADVERT:1DE1
ATHR_1000BASET_CONTROL:200
ATHR_PHY_CONTROL:3100
ATHRSF1_PHY: Port 5, Neg Success
ATHRSF1_PHY: unit 0 phy addr 5 eth0 up
eth0
Setting 0x18116290 to 0x1020214f
Hit any key to stop autoboot:  0
multiboot=1
Trying eth0
eth0 link down
FAIL
Using eth0 device
TFTP from server 192.168.1.100; our IP address is 192.168.1.1
Filename 'c65_atnboot.bin'.
Load address: 0x81000000
Loading: Tx Timed out
T Tx Timed out

Retry count exceeded; starting again
## Booting image at 9f060000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.121
   Created:      2019-05-31  19:01:33 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1618878 Bytes =  1.5 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x9f060040 ...OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728

Starting kernel ...

[    0.000000] Linux version 4.14.121 (osboxes@osboxes) (gcc version 7.4.0 (OpenWrt GCC 7.4.0 r10114-a1210f8888)) #0 Fri May 31 19:01:33 2019
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[    0.000000] MIPS: machine is AirTight C-65
[    0.000000] SoC: Qualcomm Atheros QCA9558 ver 1 rev 0
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 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-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x90/0x478 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 123180K/131072K available (3792K kernel code, 151K rwdata, 912K rodata, 1216K init, 204K bss, 7892K 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: 720.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5309056796 ns
[    0.000007] sched_clock: 32 bits at 360MHz, resolution 2ns, wraps every 5965232126ns
[    0.008287] Calibrating delay loop... 358.80 BogoMIPS (lpj=1794048)
[    0.074976] pid_max: default: 32768 minimum: 301
[    0.080050] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.087086] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.097868] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.108363] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.114901] pinctrl core: initialized pinctrl subsystem
[    0.121159] NET: Registered protocol family 16
[    0.131415] PCI host bridge /ahb/apb/pcie-controller@180c0000 ranges:
[    0.138276]  MEM 0x0000000010000000..0x0000000011ffffff
[    0.143858]   IO 0x0000000000000000..0x0000000000000000
[    0.149713] PCI host bridge /ahb/apb/pcie-controller@18250000 ranges:
[    0.156596]  MEM 0x0000000012000000..0x0000000013ffffff
[    0.162147]   IO 0x0000000000000001..0x0000000000000001
[    0.167708] ar724x-pci 18250000.pcie-controller: PCIe link is down
[    0.186656] PCI host bridge to bus 0000:00
[    0.191057] pci_bus 0000:00: root bus resource [mem 0x10000000-0x11ffffff]
[    0.198367] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.204297] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.211514] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.220346] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x101fffff 64bit]
[    0.228138] pci 0000:00:00.0: BAR 6: assigned [mem 0x10200000-0x1020ffff pref]
[    0.235958] PCI host bridge to bus 0000:01
[    0.240319] pci_bus 0000:01: root bus resource [mem 0x12000000-0x13ffffff]
[    0.247645] pci_bus 0000:01: root bus resource [io  0x0001]
[    0.253572] pci_bus 0000:01: root bus resource [??? 0x00000000 flags 0x0]
[    0.260796] pci_bus 0000:01: No busn resource found for root bus, will use [bus 01-ff]
[    0.271212] clocksource: Switched to clocksource MIPS
[    0.277371] NET: Registered protocol family 2
[    0.282626] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.290041] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.296842] TCP: Hash tables configured (established 1024 bind 1024)
[    0.303703] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.309918] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.316812] NET: Registered protocol family 1
[    0.323580] Crashlog allocated RAM at address 0x3f00000
[    0.330030] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.340702] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.346934] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.363618] io scheduler noop registered
[    0.367792] io scheduler deadline registered (default)
[    0.375017] pinctrl-single 1804002c.pinmux: 544 pins at pa b804002c size 68
[    0.383285] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.390586] console [ttyS0] disabled
[    0.394452] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 2500000) is a 16550A
[    0.403640] console [ttyS0] enabled
[    0.403640] console [ttyS0] enabled
[    0.411044] bootconsole [early0] disabled
[    0.411044] bootconsole [early0] disabled
[    0.424410] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[    0.429566] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.436039] Creating 4 MTD partitions on "spi0.0":
[    0.440904] 0x000000000000-0x000000040000 : "u-boot"
[    0.446595] 0x000000040000-0x000000060000 : "uboot-env"
[    0.452527] 0x000000260000-0x0000011f0000 : "firmware"
[    0.457740] mtd: partition "firmware" extends beyond the end of device "spi0.0" -- size truncated to 0xda0000
[    0.506059] 0x000000ff0000-0x000001000000 : "art"
[    0.511932] m25p80 spi0.1: unrecognized JEDEC id bytes: 00, 00, 00
[    0.518222] m25p80: probe of spi0.1 failed with error -2
[    0.524487] libphy: Fixed MDIO Bus: probed
[    0.530496] ag71xx 19000000.eth: invalid MAC address, using random address
[    0.872888] libphy: ag71xx_mdio: probed
[    0.971943] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:05 [uid=004dd072, driver=Atheros 8035 ethernet]
[    0.982696] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii-id
[    0.990855] NET: Registered protocol family 10
[    0.998414] Segment Routing with IPv6
[    1.002249] NET: Registered protocol family 17
[    1.006794] 8021q: 802.1Q VLAN Support v1.8
[    1.012939] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.020524] Please append a correct "root=" boot option; here are the available partitions:
[    1.029034] 1f00             256 mtdblock0
[    1.029038]  (driver?)
[    1.035674] 1f01             128 mtdblock1
[    1.035677]  (driver?)
[    1.042318] 1f02           13952 mtdblock2
[    1.042321]  (driver?)
[    1.048952] 1f03              64 mtdblock3
[    1.048954]  (driver?)
[    1.055586] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.064706] Rebooting in 1 seconds..


one way to go might be to enable cmdline bootargs ( if needed in make kernel_menuconfig )

then muck about with manually feeding the partlayout while your in the testing phase.....

( example from one of jeffs posts ... not sure how relevant to what you have now but a starting point )

console=ttyS0,115200 root=31:03 rootfstype=jffs2 init=/sbin/init mtdparts=ath-nor0:256k(u-boot),128k(uboot-env),2048k(kernel),13888k(rootfs),64k(ART);ath-nor1:16M(opt) mem=128M

Don't save your ubootvars... just setenv over serial each boot while your testing.....

That's what i'd try anyway...... otherwise you have to go the long way ( i.e. non relevant sample CF-E110NV2 flashing issue ) or similar..... my uboot will take a dts option.... so that can speed things that way a tad ( load from tftp ) .... setenv is the fastest....

Last step, in my book. Sometimes the most annoying. I spent days of nights looking through the assembly and low-level C code for the early init process trying to figure out how to get the EA8300 to boot an OpenWrt image without any serial access as its boot loader was sending the "wrong" command line. That's a nicety, but not a requirement.

There's some major "black magic" in the way that OpenWrt patches early init for various platforms. Some completely ignore the passed command-line args, others "munge" it in subtle or brutal ways. Unfortunately for someone working with a single board, the same kernel is used for all boards on a given target/subtarget, so you can't really tweak it on a board-by-board basis.

At least fgrep -ri cmd target/linux/ath79/patches-4.14/ didn't raise any red flags.

For development/test purposes, poking at what U-Boot is sending through setenv as wulfy23 suggests to (a) see if you can change at all, and (b) change to something "useful"

[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2

Now, put all that knowledge aside for a minute and look at

[    0.452527] 0x000000260000-0x0000011f0000 : "firmware"
[    0.457740] mtd: partition "firmware" extends beyond the end of device "spi0.0" -- size truncated to 0xda0000

Thanks wulfy23
I did play with it for a bit until jeff posted his comment...

Fixed a typo in .dts, building... I can change environment variables in uboot, don't know if it is passed over to kernel though...

1 Like

Well, bricked it until I get a flasher... it self-destructed due to incorrect addressing from the typo in dts. Cant access the second chip at all for some reason but it is a mirror of the first one and I can read it, besides I do have partition images saved from luci.

.....
[   12.041530] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[   12.081250] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x004d0000: 0x1357 instead
[   12.090867] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x004d0004: 0x481a instead
[   12.100485] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x004d0008: 0xbc1e instead
[   12.110102] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x004d000c: 0xee95 instead
[   12.119721] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x004d0010: 0xcdd7 instead
[   12.129339] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x004d0014: 0x780e instead
[   12.138958] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x004d0018: 0xeb78 instead
[   12.148576] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x004d001c: 0xe5ec instead
[   12.158194] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x004d0020: 0xca1f instead
[   12.167812] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x004d0024: 0xa11b instead
[   12.177429] jffs2: Further such events for this erase block will not be printed
[   12.225445] jffs2_scan_eraseblock(): End of filesystem marker found at 0x4e0000
[   12.232900] jffs2_build_filesystem(): unlocking the mtd device...
[   12.232905] done.
[   12.241115] jffs2_build_filesystem(): erasing all blocks after the end marker...
[  117.083656] done.
[  117.093243] jffs2: notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  117.109272] VFS: Mounted root (jffs2 filesystem) readonly on device 31:2.
[  117.119778] Freeing unused kernel memory: 1216K
[  117.124390] This architecture does not have kernel memory protection.
[  117.131125] Kernel panic - not syncing: Requested init /sbin/init failed (error -2).
[  117.143649] Rebooting in 1 seconds..

Do you still have U-Boot running?

If so, it should all be recoverable, either with an initramfs image, or using U-Boot TFTP and U-Boot commands to write to flash.

Nope, it erased some part of uboot env (judging by the address space) and now CLI is silent on power-on.
I will de-solder the flash IC and flash it with SPI writer, or maybe with a clip in order to not even mess with the soldering... there are still many finishing to do even if it boots - need to get a ram image with capability to flash enclosed sysupgrade image and redefine stock U-Boot arguments otherwise it tries to manipulate files within the image prior to boot:

Setting 0x18116290 to 0x1020214f
Hit any key to stop autoboot:  0
airtight_C-65> printenv
bootdelay=2
baudrate=115200
ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee
dir=
lu=tftp 0x80060000 ${dir}u-boot.bin&&erase 0x9f000000 +$filesize&&cp.b $fileaddr 0x9f000000 $filesize
lf=tftp 0x80060000 ${dir}ap135_11ac_offload_f1e-jffs2&&erase 0x9f050000 +0xd00000&&cp.b $fileaddr 0x9f050000 $filesize
lk=tftp 0x80060000 ${dir}vmlinux_11ac_offload_f1e.lzma.uImage&&erase 0x9fd50000 +$filesize&&cp.b $fileaddr 0x9fd50000 $filesize
Board_SN=7072CF12341F
AP_model_number=C-65
filesize=1000000
fileaddr=80060000
bootargs=console=ttyS0,115200 root=31:03 rootfstype=jffs2 init=/sbin/init mtdparts=ath-nor0:256k(u-boot),128k(uboot-env),2048k(kernel),13888k(rootfs),64k(ART);ath-nor1:16M(opt)
ethact=eth0
ipaddr=192.168.9.240
serverip=192.168.9.23
multiboot=1
bootcfg=set ipaddr 192.168.1.1;set serverip 192.168.1.100;set netretry no
atnboot=set bootargs "console=ttyS0,115200 init=/sbin/init root=/dev/ram0 rw rd_start=0x81200000 rd_size=13M mtdparts=ath-nor0:256k(u-boot),128k(uboot-env),2048k(kernel),13312k(rootfs),576k(dummy),64k(ART);ath-nor1:16M(opt)";mw.l 1804002c 0;mw.l 1804000c 5;mw.l 18040010 8000;bootm 81000000
artboot=mw.l 1804002c 0;mw.l 1804000c 8000;mw.l 18040010 5;mw.l 1804000c 1;bootm 9f060000
bootsel=if tftp 81000000 c65_atnboot.bin;then if imi 81000000;then run atnboot;else run artboot;fi;else run artboot;fi
bootcmd=if print multiboot&&test $multiboot = 1;then run bootcfg;run bootsel;else run artboot;fi
stdin=serial
stdout=seriallf
stderr=serial

Environment size: 1454/65532 bytes

In addition, submit all the work to OpenWrt and add a page to devwiki (can't even register).

It’s a slow, often frustrating process the first time. OK, the second and third time too. Take your time and work on something else when things look dim. Often they’re brighter on return a couple days later.

It may be possible to keep the OEM boot args, depending on if the upgrade scripts can handle them. For me, I’ve been getting it running, then worrying about upgrade and OEM install.

$ diff -urN qca9558_airtight_c-65.orig.dts qca9558_airtight_c-65.dts
--- qca9558_airtight_c-65.orig.dts      2019-06-06 19:24:33.586999800 +0900
+++ qca9558_airtight_c-65.dts   2019-06-06 19:25:13.873155000 +0900
@@ -97,15 +97,9 @@
                        };

                        partition@60000 {
-                               label = "kernel";
-                               reg = <0x060000 0x200000>;
-                               read-only;
-                       };
-
-                       firmware: partition@260000 {
-                               label = "rootfs";
-                               reg = <0x260000 0xd90000>;
-
+                               label = "firmware";
+                               reg = <0x060000 0xf90000>;
+                               compatible = "denx,uimage";
                        };

                        art: partition@ff0000 {

From a "firmware" partition with compatible string, kernel and rootfs are automatically detected.

1 Like

Thanks, added this line to the layout and updated file in the repo to reflect what it looks like now...

Is there a way to flash image from ram and luci? I only managed to write to flash through u-boot and it requires the use of CLI, while u-boot (on this device in stock configuration auto-downloads a ramdisk image and runs it from ram without the need to use cli.
My device is bricked now due to a typo I made in the flash layout, I'm waiting for a flasher from ebay.

Take a look at how sysupgrade works. It's a script that uses sh functions from /lib/upgrade/ You should be able to very carefully use the OpenWrt mtd utility to flash from the command line.

  1. boot your device with OpenWrt initramfs image by using follows when booting:
Using eth0 device
TFTP from server 192.168.1.100; our IP address is 192.168.1.1
Filename 'c65_atnboot.bin'.
Load address: 0x81000000
  1. send sysupgrade image via scp or upload on LuCI
    scp (image name) root@192.168.1.1:/tmp/
    or
    (if LuCI is included in your initramfs image) access to 192.168.1.1 via web browser and move to firmware upgrade page, select sysupgrade image

  2. perform sysupgrade
    sysupgrade /tmp/(image name) on ssh
    or
    Proceed on LuCI

EDIT: Of course, this requires the wired network works properly on OpenWrt...

I did try sysupgrade while booted from OpenWrt initramfs but it did not work, after restart the old kernel was still there. Hope it did not overwrite anything else in the background. This might be due to incorrect image map I guess. Will give it another try after reviving the unit. I also have some movement with Arista support on getting the sources but slow. Maybe will get their "SDK".

If default_do_upgrade is specified and special partition name is not specified for the device in ath79/base-files/lib/platform.sh, sysupgrade command writes the firmware passed by argument to the partition labeled "firmware". (common.sh#L229 and platform.sh#L5)

If there is no "firmware" partition, execution of the sysupgrade command should fail and the contents of the flash are not changed.

1 Like

Thanks for referencing the ath79/base-files/lib/platform.sh, when I started there was nothing defined in there and firmware partition was mapped after kernel. Now it makes more sense.

There should be a "default" value in platform.sh -- from master

platform_do_upgrade() {
	local board=$(board_name)

	case "$board" in
	jjplus,ja76pf2)
		redboot_fis_do_upgrade "$ARGV" linux
		;;
	ubnt,routerstation|\
	ubnt,routerstation-pro)
		redboot_fis_do_upgrade "$ARGV" kernel
		;;
	*)
		default_do_upgrade "$ARGV"
		;;
	esac
}