Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#1782 - unable to boot ath79 GL-AR300M NAND #8059

Closed
openwrt-bot opened this issue Aug 15, 2018 · 7 comments
Closed

FS#1782 - unable to boot ath79 GL-AR300M NAND #8059

openwrt-bot opened this issue Aug 15, 2018 · 7 comments
Labels

Comments

@openwrt-bot
Copy link

mennozon:

Supply the following if possible:

  • Device problem occurs on
  • Software versions of OpenWrt/LEDE release, packages, etc.
  • Steps to reproduce

ar71xx NAND works fine on GL-AR300M but ath79 target does not want to boot, it seems NAND is not detected even though kernel support seems to be there.

Loading from device 0: ath-spi-nand (offset 0x0) Image Name: MIPS OpenWrt Linux-4.14.62 Created: 2018-08-15 5:42:36 UTC Image Type: MIPS Linux Kernel Image (lzma compressed) Data Size: 1568489 Bytes = 1.5 MB Load Address: 80060000 Entry Point: 80060000 ## Booting image at 81000000 ... Image Name: MIPS OpenWrt Linux-4.14.62 Created: 2018-08-15 5:42:36 UTC Image Type: MIPS Linux Kernel Image (lzma compressed) Data Size: 1568489 Bytes = 1.5 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.62 (dev@4530s) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7862-ae9c3105a3)) #0 Wed Aug 15 05:42:36 2018
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[ 0.000000] MIPS: machine is GL.iNet GL-AR300M
[ 0.000000] SoC: Qualcomm Atheros QCA9533 ver 2 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+0x8c/0x474 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: 123376K/131072K available (3660K kernel code, 136K rwdata, 856K rodata, 1228K init, 206K bss, 7696K 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: 650.000 MHz
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5880801374 ns
[ 0.000009] sched_clock: 32 bits at 325MHz, resolution 3ns, wraps every 6607641598ns
[ 0.008228] Calibrating delay loop... 432.53 BogoMIPS (lpj=2162688)
[ 0.074858] pid_max: default: 32768 minimum: 301
[ 0.079924] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.086897] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.098338] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.108751] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.115251] pinctrl core: initialized pinctrl subsystem
[ 0.121243] NET: Registered protocol family 16
[ 0.147164] clocksource: Switched to clocksource MIPS
[ 0.153476] NET: Registered protocol family 2
[ 0.158826] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.166184] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.172938] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.179786] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.185953] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.192867] NET: Registered protocol family 1
[ 0.201100] Crashlog allocated RAM at address 0x3f00000
[ 0.207850] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[ 0.219474] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.225616] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.244306] io scheduler noop registered
[ 0.248491] io scheduler deadline registered (default)
[ 0.256028] pinctrl-single 1804002c.pinmux: 576 pins at pa b804002c size 72
[ 0.264336] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 0.271753] console [ttyS0] disabled
[ 0.275559] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 8, base_baud = 1562500) is a 16550A
[ 0.284705] console [ttyS0] enabled
[ 0.284705] console [ttyS0] enabled
[ 0.292263] bootconsole [early0] disabled
[ 0.292263] bootconsole [early0] disabled
[ 0.305162] ath79-spi 1f000000.spi: cs1 >= max 1
[ 0.310002] spi_master spi0: spi_device register error /ahb/spi@1f000000/flash@1
[ 0.317655] spi_master spi0: Failed to create SPI device for /ahb/spi@1f000000/flash@1
[ 0.327827] m25p80 spi0.0: found mx25l12805d, expected w25q128
[ 0.333942] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[ 0.339242] 4 fixed-partitions partitions found on MTD device spi0.0
[ 0.345803] Creating 4 MTD partitions on "spi0.0":
[ 0.350775] 0x000000000000-0x000000040000 : "u-boot"
[ 0.356716] 0x000000040000-0x000000050000 : "u-boot-env"
[ 0.362986] 0x000000050000-0x000000ff0000 : "reserved"
[ 0.369111] 0x000000ff0000-0x000001000000 : "art"
[ 0.375186] libphy: Fixed MDIO Bus: probed
[ 0.717555] libphy: ag71xx_mdio: probed
[ 1.007627] mdio-bus.0:1f: Found an AR934X built-in switch
[ 1.013471] libphy: ar7240sw_mdio: probed
[ 1.409381] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:1f:04 [uid=004dd042, driver=Generic PHY]
[ 1.419817] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[ 1.758809] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[ 1.768733] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[ 1.776980] NET: Registered protocol family 10
[ 1.786051] Segment Routing with IPv6
[ 1.790004] NET: Registered protocol family 17
[ 1.794641] 8021q: 802.1Q VLAN Support v1.8
[ 1.801927] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 1.809717] Please append a correct "root=" boot option; here are the available partitions:
[ 1.818357] 1f00 256 mtdblock0
[ 1.818361] (driver?)
[ 1.825115] 1f01 64 mtdblock1
[ 1.825118] (driver?)
[ 1.831878] 1f02 16000 mtdblock2
[ 1.831881] (driver?)
[ 1.838635] 1f03 64 mtdblock3
[ 1.838638] (driver?)
[ 1.845390] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 1.854644] Rebooting in 1 seconds..

U-Boot 1.1.4-g36de7573-dirty (Jun 1 2017 - 09:14:12)

@openwrt-bot
Copy link
Author

mkresin:

The following from your bootlog looks related:

[ 0.305162] ath79-spi 1f000000.spi: cs1 >= max 1
[ 0.310002] spi_master spi0: spi_device register error /ahb/spi@1f000000/flash@1
[ 0.317655] spi_master spi0: Failed to create SPI device for /ahb/spi@1f000000/flash@1

Please try to set num-cs in qca9533_glinet_ar300m_nand.dts to 2.

@openwrt-bot
Copy link
Author

mennozon:

Changing num-cs to 2 did not seem to have an effect, boot log still shows cs1 >= max 1.

That gave me the idea to swap around flash0 with flash1 to try and see if it'll detect the NAND device but did not work, it still couldn't register the device, also did not detect the NOR device, see attached boot log.

@openwrt-bot
Copy link
Author

robimarko:

Well, I dont know how was this merged since NAND does not work.
It cant work since the SPI CS number is 1 and when you set it to 2, you must also then specify which pins are the CS.
If they are not specified then HW CS is only selected and you will get ath79-spi 1f000000.spi: cs1 >= max 1 error again.

You can try something like this:

num-cs = <2>;
cs-gpios = <0>, <&gpio 0 GPIO_ACTIVE_HIGH>;

Then simply increment the GPIO number until NAND gets detected(Most likely GPIO1 or GPIO2)

@openwrt-bot
Copy link
Author

mennozon:

I've tried GPIO 0 to 40 but no luck so far. I've looked into ar71xx sources to figure out what GPIO was used there but also no luck.

GL-Net's docs[1] mention a few GPIO's up til 17 so I figured I try up to 40 for now but I could not find out how many GPIO's this device has, any idea how many I should try?

I do notice a gpio enable function[2] in the ar71xx sources just before setting up spi, perhaps this could have something to do with it?

[1] https://docs.gl-inet.com/en/2/hardware/ar300m/
[2] ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); in mach-gl-ar300m.c

@openwrt-bot
Copy link
Author

mennozon:

With software driven GPIO's and a patch applied I'm able to detect the NAND device, thanks to the information in the ar300m ath79 pull request[1] on how to do this.

It does not boot yet but I think this is because of wrong bootargs.

What I forgot is that the NAND device id's are not yet in the kernel, I've applied the needed changes from hanetzer's originals pull request[2] and together with software driven gpio's (cs-gpios = <0>, <0>, <0>;) things are looking better now, too bad I completely forgot about all this.

The attached patch is based on hanetzer's work, I hope to have some time this week to figure out the last pieces to get this booting.

[1] #983
[2] #615

@openwrt-bot
Copy link
Author

mennozon:

I think this bug report should be closed, I was confused with the fact that ar71xx had working nand support for GL-AR300M but it was probably never merged, I was using a local branch that included the patches.

With the information in mentioned pull requests I was able to get it working eventually. I created a pull request[1] that hopefully can be merged.

Thanks

[1] #1428

@openwrt-bot
Copy link
Author

adrianschmutzler:

NAND support for ath79 and kernel 4.14 has never worked and has been disabled in 19.07 for that reason:
5fc63ec

With kernel 4.19 and current master, GL-AR300M and others have been updated to work properly in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant