Welcome! Log In Create A New Profile

Advanced

OpenWRT 15.05.1 on Dockstar NAND

Posted by megal0maniac 
OpenWRT 15.05.1 on Dockstar NAND
April 26, 2016 10:18AM
Hi all. I'm trying desperately to get OpenWRT 15.05.1 running on my Dockstar's NAND for a university project.
No matter what I do, OpenWRT breaks the partitioning on boot and consequently cannot find my rootfs.
I'm following the guide (loosely): http://blog.qnology.com/2015/04/openwrt-on-pogoplug-v3oxnas-proclassic.html

My partitioning is as follows:
mtdparts=mtdparts=orion_nand:1M(u-boot),-(rootfs)
And my bootargs includes $mtdparts
bootargs console=ttyS0,115200n8 ubi.mtd=1 root=ubi0:rootfs rw rootfstype=ubifs rootdelay=10 $mtdparts

I've even modified the dtb as it contains the partition definitions with no luck. Surely I shouldn't have to recompile the kernel for this to work?

And this is the output. I can't get it to just leave the paritioning as is:
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 3.18.23 (buildbot@builder1) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r47269) ) #1 Sun Jan 31 11:40:01 CET 2016
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine model: Seagate FreeAgent Dockstar
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200n8 earlyprintk root=/dev/sda1 rootdelay=10
[    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] Memory: 124920K/131072K available (3466K kernel code, 151K rwdata, 964K rodata, 136K init, 191K bss, 6152K reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc045bd4c   (4432 kB)
[    0.000000]       .init : 0xc045c000 - 0xc047e000   ( 136 kB)
[    0.000000]       .data : 0xc047e000 - 0xc04a3e04   ( 152 kB)
[    0.000000]        .bss : 0xc04a3e04 - 0xc04d3b44   ( 192 kB)
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000015] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474836475ns
[    0.000154] Calibrating delay loop... 1191.11 BogoMIPS (lpj=5955584)
[    0.090096] pid_max: default: 32768 minimum: 301
[    0.090239] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090259] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090737] CPU: Testing write buffer coherency: ok
[    0.091071] Setting up static identity map for 0x108d8 - 0x10914
[    0.091356] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x2
[    0.093103] pinctrl core: initialized pinctrl subsystem
[    0.093505] regulator-dummy: no parameters
[    0.096970] NET: Registered protocol family 16
[    0.097363] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.098217] cpuidle: using governor ladder
[    0.098557] Feroceon L2: Enabling L2
[    0.098600] Feroceon L2: Cache support initialised.
[    0.098885] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet                                                                                                                0-port@0: local-mac-address is not set
[    0.106354] platform regulators:regulator@1: Driver reg-fixed-voltage requests probe deferral
[    0.106735] SCSI subsystem initialized
[    0.107078] usbcore: registered new interface driver usbfs
[    0.107157] usbcore: registered new interface driver hub
[    0.107228] usbcore: registered new device driver usb
[    0.108159] Switched to clocksource orion_clocksource
[    0.109206] NET: Registered protocol family 2
[    0.109907] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.109934] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.109953] TCP: Hash tables configured (established 1024 bind 1024)
[    0.110009] TCP: reno registered
[    0.110021] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.110042] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.110262] NET: Registered protocol family 1
[    0.111091] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.112134] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.112154] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.112403] msgmni has been set to 243
[    0.113238] io scheduler noop registered
[    0.113257] io scheduler deadline registered (default)
[    0.114383] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.114931] irq: Cannot allocate irq_descs @ IRQ32, assuming pre-allocated
[    0.115251] irq: Cannot allocate irq_descs @ IRQ64, assuming pre-allocated
[    0.147705] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.150753] console [ttyS0] disabled
[    0.150822] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 12500000) is a 16550A
[    0.542379] console [ttyS0] enabled
[    0.547164] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
[    0.553570] nand: Micron MT29F2G08AAD
[    0.557244] nand: 256MiB, SLC, page size: 2048, OOB size: 64
[    0.562956] Scanning device for bad blocks
[    0.722676] 4 ofpart partitions found on MTD device orion_nand
[    0.728543] Creating 4 MTD partitions on "orion_nand":
[    0.733706] 0x000000000000-0x0000000e0000 : "u-boot"
[    0.739455] 0x0000000e0000-0x0000001e0000 : "u-boot environment"
[    0.746168] 0x000000100000-0x000000300000 : "second stage u-boot"
[    0.752992] 0x000000200000-0x000010000000 : "root"
[    0.759415] libphy: orion_mdio_bus: probed
[    0.813112] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    0.821304] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:10:75:1a:22:b6
[    0.830122] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.836680] ehci-pci: EHCI PCI platform driver
[    0.841227] ehci-platform: EHCI generic platform driver
[    0.846603] ehci-orion: EHCI orion driver
[    0.850798] orion-ehci f1050000.ehci: EHCI Host Controller
[    0.856330] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    0.864166] orion-ehci f1050000.ehci: irq 29, io mem 0xf1050000
[    0.888179] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    0.894831] hub 1-0:1.0: USB hub found
[    0.898653] hub 1-0:1.0: 1 port detected
[    0.903162] usbcore: registered new interface driver usb-storage
[    0.910325] TCP: cubic registered
[    0.913663] NET: Registered protocol family 17
[    0.918220] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    0.930922] Bridge firewalling registered
[    0.935069] 8021q: 802.1Q VLAN Support v1.8
[    0.940725] USB Power: 5000 mV
[    0.944310] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[    0.952055] Waiting 10 sec before mounting root device...
[    1.218178] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    1.370449] hub 1-1:1.0: USB hub found
[    1.374555] hub 1-1:1.0: 4 ports detected
[   10.958255] UBIFS error (pid 1): ubifs_mount: cannot open "ubi0:rootfs", error -19
[   10.965936] VFS: Cannot open root device "sda1" or unknown-block(0,0): error -6
[   10.973298] Please append a correct "root=" boot option; here are the available partitions:
[   10.981700] 1f00             896 mtdblock0  (driver?)
[   10.986785] 1f01            1024 mtdblock1  (driver?)
[   10.991879] 1f02            2048 mtdblock2  (driver?)
[   10.996961] 1f03          260096 mtdblock3  (driver?)
[   11.002054] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   11.010353] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)



Edited 3 time(s). Last edit at 04/26/2016 10:22AM by megal0maniac.
Re: OpenWRT 15.05.1 on Dockstar NAND
April 26, 2016 01:21PM
Your bootargs looks wrong. Does it have an "=" sign after the bootargs like below?

fw_printenv bootargs
or
printenv bootargs
bootargs=console=ttyS0,115200n8 ubi.mtd=1 root=ubi0:rootfs rw rootfstype=ubifs rootdelay=10 $mtdparts

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: OpenWRT 15.05.1 on Dockstar NAND
April 26, 2016 05:29PM
did you try looking at the (crappy, partial) guide I put down on openwrt forums?

https://forum.openwrt.org/viewtopic.php?pid=316900#p316900

Note that the bootcmd was suggested by the kernel itself.
Re: OpenWRT 15.05.1 on Dockstar NAND
April 27, 2016 07:00AM
bodhi Wrote:
-------------------------------------------------------
> Your bootargs looks wrong. Does it have an "="
> sign after the bootargs like below?

Sorry, it is right but it came from fw_printenv. These are my current (relevant) env vars:
mtdparts=mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(rootfs)
console=ttyS0,115200
bootargs_root=ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs rw
bootcmd=setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi part rootfs; ubifsmount ubi:rootfs; ubifsload 0x800000 /boot/zImage; ubifsload 0x1c00000 /boot/dockstar.dtb; ubifsumount; fdt addr 0x1c00000; fdt resize; fdt chosen; bootz 0x800000 - 0x1c00000

I downloaded the rootfs from here in Debian, flashed it (ubiformat /dev/mtd1 -f openwrt-15.05.1-kirkwood-dockstar-rootfs.ubi), mounted it, created the /boot folder, downloaded the zImage and the .dtb into /boot
Then I modified the .dtb to match my partition layout (verified by dtc -I dtb -O dts /tmp/ubi/boot/dockstar.dtb -o -)
Files are all read successfully but it keeps defaulting to the wrong partition layout!!!
This is driving me a bit mad. I'm sure I can change the defaults and recompile the kernel (I've already done this, just haven't tried booting it yet) but there MUST be a way to override the defaults. No idea why this isn't working...
Re: OpenWRT 15.05.1 on Dockstar NAND
April 27, 2016 07:03AM
bobafetthotmail Wrote:
-------------------------------------------------------
> did you try looking at the (crappy, partial) guide
> I put down on openwrt forums?

I had a look at that, thanks. It shed a bit of light but thankfully the Dockstar is already a "supported" target.
One question, though. In step 5, why do you keep 1 eraseblock between u-boot environment and root?

> Note that the bootcmd was suggested by the kernel
> itself.

I know :/
I've recompiled the kernel with MY settings included but this shouldn't be necessary. As I said in the previous post, I don't know whether this works yet...
Re: OpenWRT 15.05.1 on Dockstar NAND
April 27, 2016 03:18PM
megal0maniac,

> Files are all read successfully but it keeps
> defaulting to the wrong partition layout!!!
> This is driving me a bit mad. I'm sure I can
> change the defaults and recompile the kernel (I've
> already done this, just haven't tried booting it
> yet) but there MUST be a way to override the
> defaults. No idea why this isn't working...

No need to recompile kernel. Check to make sure your zImage does not have the DTB embedded in it. It sounds to me the zImage is the problem.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: OpenWRT 15.05.1 on Dockstar NAND
April 27, 2016 04:27PM
> In step 5, why do you keep 1 eraseblock between u-boot environment and root?

That's for stock uboot, if you use bodhi's your mtdparts is fine.
Re: OpenWRT 15.05.1 on Dockstar NAND
April 27, 2016 06:34PM
Seems your bootargs comes from kirkwood-dockstar.dts -- change it there.

-syong
Re: OpenWRT 15.05.1 on Dockstar NAND
April 27, 2016 07:19PM
syong Wrote:
-------------------------------------------------------
> Seems your bootargs comes from
> kirkwood-dockstar.dts -- change it there.

Yes, that's why zImage is suspected.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: OpenWRT 15.05.1 on Dockstar NAND
April 28, 2016 07:05AM
So it turns out that there are 2 zImages

openwrt-15.05.1-kirkwood-dockstar-zImage
This one is specific for the Dockstar. It is the generic zImage with the dockstar dts appended to the end
  • It doesn't care about bootargs u-boot env var
  • It doesn't care about the .dtb you load with bootz
  • It will ONLY use the arguments which it was compiled with. Changing the .dts in the OpenWRT source and recompiling solves this, but it's more of a proof than a solution
  • There appears to be no way to override these built-in args
openwrt-15.05.1-kirkwood-zImage
  • This is the generic one for all kirkwood targets. It is ONLY the zImage, with no device tree info
  • This one respects the bootargs u-boot env var
  • I imagine it will default to the bootargs specified in the .dtb if "bootargs" is not set

The generic zImage works. I left out "console=" in my bootargs but once I fixed that, it works 100%
Thanks for helping me find the problem :)
The Dockstar specific one is stupid and should not be used, in my personal opinion.
Re: OpenWRT 15.05.1 on Dockstar NAND
April 28, 2016 12:39PM
megal0maniac,

> The generic zImage works. I left out "console=" in
> my bootargs but once I fixed that, it works 100%
> Thanks for helping me find the problem :)
> The Dockstar specific one is stupid and should not
> be used, in my personal opinion.

It is needed if you're booting with stock u-boot. DTB-embedded zImage/uImage is the only way it would boot the new kernel.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: