not sure how to do that.
I am able to get openwrt in memory using tftp
But if i boot from memory, i get unable to mount root fs followed by a kernel panic
Here the log:
ath> tftp 0x83000000 openwrt-19.07.3-ath79-generic-ubnt_unifiac-lr-squashfs-sysupgrade.bin
Trying eth0
dup 1 speed 1000
Using eth0 device
TFTP from server 192.168.1.254; our IP address is 192.168.1.20
Filename 'openwrt-19.07.3-ath79-generic-ubnt_unifiac-lr-squashfs-sysupgrade.bin'.
Load address: 0x83000000
Loading: T #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#############
done
Bytes transferred = 4391225 (430139 hex)
ath> bootm 0x83000000
## Booting image at 83000000 ...
Image Name: MIPS OpenWrt Linux-4.14.180
Created: 2020-05-16 18:32:20 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1596064 Bytes = 1.5 MB
Load Address: 80060000
Entry Point: 80060000
Verifying Checksum at 0x83000040 ...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.180 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11063-85e04e9f46)) #0 Sat May 16 18:32:20 2020
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[ 0.000000] MIPS: machine is Ubiquiti UniFi-AC-LR
[ 0.000000] SoC: Qualcomm Atheros QCA956X 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 0x804ff740 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: 123304K/131072K available (4030K kernel code, 162K rwdata, 532K rodata, 1220K init, 212K bss, 7768K 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: 775.000 MHz
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4932285024 ns
[ 0.000007] sched_clock: 32 bits at 387MHz, resolution 2ns, wraps every 5541893118ns
[ 0.008217] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[ 0.074761] pid_max: default: 32768 minimum: 301
[ 0.079777] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.086759] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.097627] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.108026] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.114523] pinctrl core: initialized pinctrl subsystem
[ 0.122064] NET: Registered protocol family 16
[ 0.129492] PCI host bridge /ahb/pcie-controller@18250000 ranges:
[ 0.135970] MEM 0x0000000012000000..0x0000000013ffffff
[ 0.141468] IO 0x0000000000000000..0x0000000000000000
[ 0.161045] PCI host bridge to bus 0000:00
[ 0.165371] pci_bus 0000:00: root bus resource [mem 0x12000000-0x13ffffff]
[ 0.172654] pci_bus 0000:00: root bus resource [io 0x0000]
[ 0.178518] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[ 0.185676] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 0.194444] pci 0000:00:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
[ 0.202197] pci 0000:00:00.0: BAR 6: assigned [mem 0x12200000-0x1220ffff pref]
[ 0.212397] clocksource: Switched to clocksource MIPS
[ 0.218605] NET: Registered protocol family 2
[ 0.223977] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.231333] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.238080] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.244912] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.251084] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.257940] NET: Registered protocol family 1
[ 0.265150] Crashlog allocated RAM at address 0x3f00000
[ 0.271790] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[ 0.282854] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.288996] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.307683] io scheduler noop registered
[ 0.311817] io scheduler deadline registered (default)
[ 0.318970] pinctrl-single 1804002c.pinmux: 544 pins at pa b804002c size 68
[ 0.327256] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[ 0.335993] console [ttyS0] disabled
[ 0.339790] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[ 0.348922] console [ttyS0] enabled
[ 0.348922] console [ttyS0] enabled
[ 0.356490] bootconsole [early0] disabled
[ 0.356490] bootconsole [early0] disabled
[ 0.372862] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[ 0.378129] 7 fixed-partitions partitions found on MTD device spi0.0
[ 0.384722] Creating 7 MTD partitions on "spi0.0":
[ 0.389677] 0x000000000000-0x000000060000 : "u-boot"
[ 0.395514] 0x000000060000-0x000000070000 : "u-boot-env"
[ 0.401600] 0x000000070000-0x000000800000 : "firmware"
[ 0.410024] 0x000000800000-0x000000f90000 : "ubnt-airos"
[ 0.416232] 0x000000f90000-0x000000fb0000 : "bs"
[ 0.421607] 0x000000fb0000-0x000000ff0000 : "cfg"
[ 0.427164] 0x000000ff0000-0x000001000000 : "EEPROM"
[ 0.433914] libphy: Fixed MDIO Bus: probed
[ 1.112750] libphy: ag71xx_mdio: probed
[ 1.212633] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:04 [uid=004dd074, driver=Atheros 8031 ethernet]
[ 1.223603] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[ 1.231607] NET: Registered protocol family 10
[ 1.240174] Segment Routing with IPv6
[ 1.244095] NET: Registered protocol family 17
[ 1.248725] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 1.262126] 8021q: 802.1Q VLAN Support v1.8
[ 1.267858] hctosys: unable to open rtc device (rtc0)
[ 1.273960] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 1.281689] Please append a correct "root=" boot option; here are the available partitions:
[ 1.290361] 1f00 384 mtdblock0
[ 1.290365] (driver?)
[ 1.297132] 1f01 64 mtdblock1
[ 1.297135] (driver?)
[ 1.303901] 1f02 7744 mtdblock2
[ 1.303904] (driver?)
[ 1.310651] 1f03 7744 mtdblock3
[ 1.310654] (driver?)
[ 1.317417] 1f04 128 mtdblock4
[ 1.317421] (driver?)
[ 1.324177] 1f05 256 mtdblock5
[ 1.324180] (driver?)
[ 1.330927] 1f06 64 mtdblock6
[ 1.330930] (driver?)
[ 1.337693] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 1.346842] Rebooting in 1 seconds..
U-Boot unifi-v2.0.6.306-ge8871a78 (Nov 12 2019 - 10:30:55)
DRAM:
sri
ath_ddr_initial_config(278): (ddr2 init)
ath_sys_frequency: cpu 775 ddr 650 ahb 258
Tap values = (0xf, 0xf, 0xf, 0xf)
128 MB
Base:0x80000000, Top:0x88000000, Res logbuf:0xa7ff3800, log_magic:0x75555555 kseg: 0xa0000000
Top of RAM usable for U-Boot at: 87ff3000
Reserving 252k for U-Boot at: 87fb0000
Reserving 192k for malloc() at: 87f80000
Reserving 44 Bytes for Board Info at: 87f7ffd4
Reserving 36 Bytes for Global Data at: 87f7ffb0
Reserving 128k for boot params() at: 87f5ffb0
Stack Pointer at: 87f5ff98
Now running in RAM - U-Boot at: 87fb0000
Flash: 16 MB
PCIe WLAN Module found (tries: 1).
In: serial
Out: serial
Err: serial
Net: ath_gmac_enet_initialize...
Fetching MAC Address from 0x9fff0000
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly ----> S17 PHY *
ath_gmac_enet_initialize: is_s17()=0, is_ar8033()=1, phy id1=4d phy_id2=d074
WAN AR8033 PHY init
athrs_ar8033_reg_init: Done 111
Max resets limit reached exiting...
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: e0:63:da:39:65:65
eth0 up
eth0
Setting 0x181162c0 to 0x20402100
Board: Copyright Ubiquiti Networks Inc. 2014
Hit any key to stop autoboot: 0
## Starting application at 0x80200020 ...
Board: Ubiquiti Networks AR956X board (e527-22.1150.0030.0040)
0. Name = u-boot, offset = 0, start_addr=9f000000, size=393216,start_sector=0, end_sector=5
1. Name = u-boot-env, offset = 60000, start_addr=9f060000, size=65536,start_sector=6, end_sector=6
2. Name = kernel0, offset = 70000, start_addr=9f070000, size=7929856,start_sector=7, end_sector=127
3. Name = kernel1, offset = 800000, start_addr=9f800000, size=7929856,start_sector=128, end_sector=248
4. Name = bs, offset = f90000, start_addr=9ff90000, size=131072,start_sector=249, end_sector=250
5. Name = cfg, offset = fb0000, start_addr=9ffb0000, size=262144,start_sector=251, end_sector=254
6. Name = EEPROM, offset = ff0000, start_addr=9fff0000, size=65536,start_sector=255, end_sector=255
get_mtd_params: name=bs
ubnt_flash_read: addr=8023bf20, sa=9ff90000, sz=131072
ubnt_bootsel_init: bootsel magic=a34de82b, bootsel = 1
UBNT application initialized
## Application terminated, rc = 0x0
## Starting application at 0x80200020 ...
keep cfg partition.
## Application terminated, rc = 0x0
## Starting application at 0x80200020 ...
ubnt_uwrite: Nothing to flash, exiting
## Application terminated, rc = 0x0
## Starting application at 0x80200020 ...
cfg_default_state : TRUE
## Application terminated, rc = 0x1
Trying eth0
dup 1 speed 1000
NetOurIP:a9fe6565
Using eth0 device
checksum bad
checksum bad
checksum bad
## Starting application at 0x80200020 ...
Number of boot partitions = 2
get_mtd_params: name=bs
ubnt_flash_read: addr=8023bf20, sa=9ff90000, sz=131072
ubnt_get_bootsel: Boot partition selected = 1
Loading Kernel Image @ 81000000, size = 7929856
Verifying 'kernel1' parition:Bad Magic Number
Loading Kernel Image @ 81000000, size = 7929856
Verifying 'kernel0' parition:Bad Data CRC
FATAL: No parition is good.
## Application terminated, rc = 0x0
## Booting image at 81000000 ...
Image Name: Ubiquiti Linux-4.4.153
Created: 2018-08-30 12:10:54 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 7721310 Bytes = 7.4 MB
Load Address: 80060000
Entry Point: 80060000
Verifying Checksum at 0x81000040 ...Bad Data CRC
ath> Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Unknown command 'Kernel' - try 'help'
ath>
How to save openwrt on both partition?
maybe i have to do:
tftpboot 0x80000000 openwrt-ar71xx-generic-ubnt-unifiac-squashfs-sysupgrade.bin
erase 0x9f070000 +$filesize
cp.b 0x80000000 0x9f070000 $filesize
bootm 0x9f070000
But i am not sure if the address 0x9f070000 is correct.
And i don't know the address of the kernel2 partition.
edit: i have found on the bootlog both address
2. Name = kernel0, offset = 70000, start_addr=9f070000, size=7929856,start_sector=7, end_sector=127
3. Name = kernel1, offset = 800000, start_addr=9f800000, size=7929856,start_sector=128, end_sector=248
Could you confirm if i'ts the correct way to flash openwrt ?