2008-11-23 23:11:05 Mount Root File System to USB
David Waterhouse (UNITED STATES)
Message: 65734
I have a BF537 Stamp and a USB add on card (ADDS-USB-EZEXT).
Is it possible to load and mount the uClinux root file system on a USB hard drive connected to the USB card?
Has anyone done this before?
QuoteReplyEditDelete
2008-11-24 02:51:36 Re: Mount Root File System to USB
Mike Frysinger (UNITED STATES)
Message: 65738
first make sure you can detect the USB device and read/write files. if you can do that, using it as a root filesystem is trivial.
QuoteReplyEditDelete
2008-11-27 19:43:43 Re: Mount Root File System to USB
David Waterhouse (UNITED STATES)
Message: 65927
Mike,
Right now I'm loading vmlinux from the parallel flash and then mounting the root file system using NFS.
I copied the root file system to a flash drive (Lexar Jumpdrive) under directory /romfs and I can read and write to it.
I wanted to try to auto-mount it when uclinux boots, so I added the uboot variables usbboot and usbargs (shown below), with root device of /dev/usb. When I tried to boot by running the usbboot variable (bootcmd=run usbboot) it failed saying <<Cannot open root device "usb">>.
Is there a correct setting for the root device that would allow auto-mounting of the file system on the flash drive when uclinux boots?
See attached outputs:
A. UBOOT variables
B. uclinux Reset Output (attempt to do USB mounting)
C. uclinux Reset Output (with NFS mounting)
===================================================
A. UBOOT variables:
baudrate=57600
loads_echo=1
autoload=no
hostname=BF537
loadaddr=0x1000000
ramargs=setenv bootargs root=/dev/mtdblock0 rw
addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):eth0:off
ramboot=tftpboot $(loadaddr) linux;run ramargs;run addip;bootelf
update=tftpboot $(loadaddr) u-boot.bin;protect off 0x20000000 0x2007FFFF;erase 0x20000000 0x2007FFFF;cp.b 0x1000000 0x20000000 $(filesize)
ethact=BF537 ETHERNET
ethaddr=00:e0:22:fe:bc:5b
flashboot=bootm 0x20020000
rootpath=/share/romfs
nfsargs=set bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath),$(nfsoptions)
nfsoptions=tcp,nfsvers=2
nfsboot=run nfsargs;run addip;bootelf 0x20020000
gatewayip=192.168.1.1
netmask=255.255.255.0
ipaddr=192.168.1.252
serverip=192.168.1.106
usbargs=set bootargs root=/dev/usb rw
usbboot=run usbargs;run addip;bootelf 0x20020000
bootdelay=4
bootcmd=run usbboot
stdin=serial
stdout=serial
stderr=serial
Environment size: 932/8188 bytes
========================================================================
B. uclinux Reset Output (attempt to do USB mounting)
icache_enable
U-Boot 1.1.6-svn (ADI-2007R1) (Oct 4 2007 - 12:42:05)
CPU: ADSP BF537 Rev.: 0.2
Board: ADI BF537 stamp board
Support: http://blackfin.uclinux.org/
Clock: VCO: 500 MHz, Core: 500 MHz, System: 100 MHz
SDRAM: 64 MB
FLASH: 4 MB
In: serial
Out: serial
Err: serial
Net: BF537 ETHERNET
I2C: ready
autoboot in 4 seconds: press space to stop
Loading .text @ 0x00001000 (1378800 bytes)
Loading .rodata @ 0x00152000 (336560 bytes)
Loading __ksymtab @ 0x001a42b0 (16920 bytes)
Loading __ksymtab_gpl @ 0x001a84c8 (4520 bytes)
Loading __ksymtab_gpl_future @ 0x001a9670 (24 bytes)
Loading __ksymtab_strings @ 0x001a9688 (51812 bytes)
Loading __param @ 0x001b60ec (760 bytes)
Loading .data @ 0x001b7000 (102400 bytes)
Loading .init.text @ 0x001d0000 (99096 bytes)
Loading .init.data @ 0x001e8318 (9336 bytes)
Loading .init.setup @ 0x001ea790 (600 bytes)
Loading .initcall.init @ 0x001ea9e8 (512 bytes)
Loading .con_initcall.init @ 0x001eabe8 (4 bytes)
Loading .init.ramfs @ 0x001eabec (134 bytes)
Loading .text_l1 @ 0xffa00000 (8248 bytes)
sh_addr: FFA00000, p_paddr: 001EAC72
Loading from: 2020B000 to 001EAC72, size: 8248
Loading .data_l1 @ 0xff800000 (192 bytes)
sh_addr: FF800000, p_paddr: 001ECCAA
Loading from: 2020E000 to 001ECCAA, size: 192
Clearing .bss @ 0x001ed000 (78660 bytes)
## Starting application at 0x001d0000 ...
Linux version 2.6.22.18-ADI-2008R1-svn (david@hp1) (gcc version 4.1.2 (ADI svn)) #171 Mon Nov 24 20:25:26 EST 2008
Hardware Trace Active and Enabled
Warning: limiting memory to 56MB due to hardware anomaly 05000263
Blackfin support (C) 2004-2007 Analog Devices, Inc.
Compiled for ADSP-BF537 Rev 0.2
Blackfin Linux support by http://blackfin.uclinux.org/
Processor Speed: 500 MHz core clock and 100 MHz System Clock
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
text = 0x00001000-0x001519f0
rodata = 0x00152000-0x001b63e4
data = 0x001b7000-0x001d0000
stack = 0x001b8000-0x001ba000
init = 0x001d0000-0x001ed000
bss = 0x001ed000-0x00200344
available = 0x00200344-0x037ff000
DMA Zone = 0x03f00000-0x04000000
Instruction Cache Enabled
Data Cache Enabled (write-through)
Built 1 zonelists. Total pages: 14224
Kernel command line: root=/dev/usb rw ip=192.168.1.252:192.168.1.106:192.168.1.1:255.255.255.0:BF537:eth0:off
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 256 (order: 8, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 54712k/65536k RAM, (116k init code, 1346k kernel code, 582k data, 1024k dma, 7756k reserved)
Blackfin Scratchpad data SRAM: 4 KB
Blackfin Data A SRAM: 16 KB (15 KB free)
Blackfin Data B SRAM: 16 KB (16 KB free)
Blackfin Instruction SRAM: 48 KB (39 KB free)
Security Framework v1.0.0 initialized
Mount-cache hash table entries: 512
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
stamp_init(): registering device resources
Generic PHY: Registered new driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
PPI: PPI-EKC Driver INIT IRQ:23
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
SoftDog: cannot register miscdev on minor=130 (err=-16)
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
SMSC LAN83C185: Registered new driver
bfin_mac_mdio: probed
bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=19)@sclk=100MHz)
bfin_mac: Version 1.1, Blackfin BF53[67] BF527 on-chip Ethernet MAC driver
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
driver isp1362-hcd, 2005-04-04
isp1362-hcd isp1362-hcd.0: ISP1362 Host Controller
isp1362-hcd isp1362-hcd.0: new USB bus registered, assigned bus number 1
isp1362_hc_reset:
isp1362-hcd isp1362-hcd.0: irq 53, io mem 0x20360000
isp1362_hc_start:
isp1362-hcd isp1362-hcd.0: ISP1362 Memory usage:
isp1362-hcd isp1362-hcd.0: ISTL: 2 * 256: 512 @ $0000:$0100
isp1362-hcd isp1362-hcd.0: INTL: 16 * ( 64+8): 1152 @ $0200
isp1362-hcd isp1362-hcd.0: ATL : 32 * ( 64+8): 2304 @ $0680
isp1362-hcd isp1362-hcd.0: USED/FREE: 3968 128
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ISP1362 Host Controller, irq 53
sl811: driver sl811-hcd, 19 May 2005
sl811-hcd sl811-hcd.0: SL811HS v1.5
sl811-hcd sl811-hcd.0: new USB bus registered, assigned bus number 2
sl811-hcd sl811-hcd.0: irq 54, io mem 0x20340000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usb 2-1: new full speed USB device using sl811-hcd and address 2
usb 2-1: device descriptor read/64, error -62
usb 2-1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
rtc-bfin rtc-bfin: setting the system clock to 1970-01-01 14:11:20 (51080)
IP-Config: Complete:
device=eth0, addr=192.168.1.252, mask=255.255.255.0, gw=192.168.1.1,
host=BF537, domain=, nis-domain=(none),
bootserver=192.168.1.106, rootserver=192.168.1.106, rootpath=
Looking up port of RPC 100003/2 on 192.168.1.106
PHY: 0:01 - Link is Up - 100/Full
Looking up port of RPC 100005/1 on 192.168.1.106
Root-NFS: Server returned error -13 while mounting /tftpboot/BF537
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "usb" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
========================================================================
C. uclinux Reset Output (with NFS mounting)
icache_enable
U-Boot 1.1.6-svn (ADI-2007R1) (Oct 4 2007 - 12:42:05)
CPU: ADSP BF537 Rev.: 0.2
Board: ADI BF537 stamp board
Support: http://blackfin.uclinux.org/
Clock: VCO: 500 MHz, Core: 500 MHz, System: 100 MHz
SDRAM: 64 MB
FLASH: 4 MB
In: serial
Out: serial
Err: serial
Net: BF537 ETHERNET
I2C: ready
autoboot in 4 seconds: press space to stop
Loading .text @ 0x00001000 (1378800 bytes)
Loading .rodata @ 0x00152000 (336560 bytes)
Loading __ksymtab @ 0x001a42b0 (16920 bytes)
Loading __ksymtab_gpl @ 0x001a84c8 (4520 bytes)
Loading __ksymtab_gpl_future @ 0x001a9670 (24 bytes)
Loading __ksymtab_strings @ 0x001a9688 (51812 bytes)
Loading __param @ 0x001b60ec (760 bytes)
Loading .data @ 0x001b7000 (102400 bytes)
Loading .init.text @ 0x001d0000 (99096 bytes)
Loading .init.data @ 0x001e8318 (9336 bytes)
Loading .init.setup @ 0x001ea790 (600 bytes)
Loading .initcall.init @ 0x001ea9e8 (512 bytes)
Loading .con_initcall.init @ 0x001eabe8 (4 bytes)
Loading .init.ramfs @ 0x001eabec (134 bytes)
Loading .text_l1 @ 0xffa00000 (8248 bytes)
sh_addr: FFA00000, p_paddr: 001EAC72
Loading from: 2020B000 to 001EAC72, size: 8248
Loading .data_l1 @ 0xff800000 (192 bytes)
sh_addr: FF800000, p_paddr: 001ECCAA
Loading from: 2020E000 to 001ECCAA, size: 192
Clearing .bss @ 0x001ed000 (78660 bytes)
## Starting application at 0x001d0000 ...
Linux version 2.6.22.18-ADI-2008R1-svn (david@hp1) (gcc version 4.1.2 (ADI svn)) #171 Mon Nov 24 20:25:26 EST 2008
Hardware Trace Active and Enabled
Warning: limiting memory to 56MB due to hardware anomaly 05000263
Blackfin support (C) 2004-2007 Analog Devices, Inc.
Compiled for ADSP-BF537 Rev 0.2
Blackfin Linux support by http://blackfin.uclinux.org/
Processor Speed: 500 MHz core clock and 100 MHz System Clock
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
text = 0x00001000-0x001519f0
rodata = 0x00152000-0x001b63e4
data = 0x001b7000-0x001d0000
stack = 0x001b8000-0x001ba000
init = 0x001d0000-0x001ed000
bss = 0x001ed000-0x00200344
available = 0x00200344-0x037ff000
DMA Zone = 0x03f00000-0x04000000
Instruction Cache Enabled
Data Cache Enabled (write-through)
Built 1 zonelists. Total pages: 14224
Kernel command line: root=/dev/nfs rw nfsroot=192.168.1.106:/share/romfs,tcp,nfsvers=2 ip=192.168.1.252:192.168.1.106:192.168.1.1:255.255.255.0:BF537:eth0:off
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 256 (order: 8, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 54712k/65536k RAM, (116k init code, 1346k kernel code, 582k data, 1024k dma, 7756k reserved)
Blackfin Scratchpad data SRAM: 4 KB
Blackfin Data A SRAM: 16 KB (15 KB free)
Blackfin Data B SRAM: 16 KB (16 KB free)
Blackfin Instruction SRAM: 48 KB (39 KB free)
Security Framework v1.0.0 initialized
Mount-cache hash table entries: 512
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
stamp_init(): registering device resources
Generic PHY: Registered new driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
PPI: PPI-EKC Driver INIT IRQ:23
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
SoftDog: cannot register miscdev on minor=130 (err=-16)
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
SMSC LAN83C185: Registered new driver
bfin_mac_mdio: probed
bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=19)@sclk=100MHz)
bfin_mac: Version 1.1, Blackfin BF53[67] BF527 on-chip Ethernet MAC driver
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
driver isp1362-hcd, 2005-04-04
isp1362-hcd isp1362-hcd.0: ISP1362 Host Controller
isp1362-hcd isp1362-hcd.0: new USB bus registered, assigned bus number 1
isp1362_hc_reset:
isp1362-hcd isp1362-hcd.0: irq 53, io mem 0x20360000
isp1362_hc_start:
isp1362-hcd isp1362-hcd.0: ISP1362 Memory usage:
isp1362-hcd isp1362-hcd.0: ISTL: 2 * 256: 512 @ $0000:$0100
isp1362-hcd isp1362-hcd.0: INTL: 16 * ( 64+8): 1152 @ $0200
isp1362-hcd isp1362-hcd.0: ATL : 32 * ( 64+8): 2304 @ $0680
isp1362-hcd isp1362-hcd.0: USED/FREE: 3968 128
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ISP1362 Host Controller, irq 53
sl811: driver sl811-hcd, 19 May 2005
sl811-hcd sl811-hcd.0: SL811HS v1.5
sl811-hcd sl811-hcd.0: new USB bus registered, assigned bus number 2
sl811-hcd sl811-hcd.0: irq 54, io mem 0x20340000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usb 2-1: new full speed USB device using sl811-hcd and address 2
usb 2-1: device descriptor read/64, error -62
usb 2-1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
rtc-bfin rtc-bfin: setting the system clock to 1970-01-01 13:30:11 (48611)
IP-Config: Complete:
device=eth0, addr=192.168.1.252, mask=255.255.255.0, gw=192.168.1.1,
host=BF537, domain=, nis-domain=(none),
bootserver=192.168.1.106, rootserver=192.168.1.106, rootpath=
Looking up port of RPC 100003/2 on 192.168.1.106
PHY: 0:01 - Link is Up - 100/Full
Looking up port of RPC 100005/1 on 192.168.1.106
scsi 0:0:0:0: Direct-Access LEXAR JUMPDRIVE 1000 PQ: 0 ANSI: 0 CCS
sd 0:0:0:0: [sda] 502880 512-byte hardware sectors (257 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] 502880 512-byte hardware sectors (257 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sd 0:0:0:0: [sda] Attached SCSI removable disk
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 116k freed
dma_alloc_init: dma_page @ 0x001ea000 - 256 pages at 0x03f00000
_____________________________________
a8888b. / Welcome to the uClinux distribution \
d888888b. / _ _ \
8P"YP"Y88 / | | |_| __ __ (TM) |
8|o||o|88 _____/ | | _ ____ _ _ \ \/ / |
8' .88 \ | | | | _ \| | | | \ / |
8`._.' Y8. \ | |__ | | | | | |_| | / \ |
d/ `8b. \ \____||_|_| |_|\____|/_/\_\ |
dP . Y8b. \ For embedded processors including |
d8:' " `::88b \ the Analog Devices Blackfin /
d8" 'Y88b \___________________________________/
:8P ' :888
8a. : _a88P For further information, check out:
._/"Yaa_: .| 88P| - http://blackfin.uclinux.org/
\ YP" `| 8P `. - http://docs.blackfin.uclinux.org/
/ \.___.d| .' - http://www.uclinux.org/
`--..__)8888P`._.' jgs/a:f - http://www.analog.com/blackfin
Have a lot of fun...
BusyBox v1.4.1 (2008-09-20 21:38:12 EDT) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:/> [01/Jan/1970:13:30:19 +0000] boa: server version Boa/0.94.14rc21
[01/Jan/1970:13:30:19 +0000] boa: server built Sep 20 2008 at 21:38:07.
[01/Jan/1970:13:30:19 +0000] boa: starting server pid=144, port 9990
root:/>
QuoteReplyEditDelete
2008-11-27 21:19:37 Re: Mount Root File System to USB
Mike Frysinger (UNITED STATES)
Message: 65935
why do you think /dev/usb is the correct path ? you have to give it the real root device and /dev/usb is not a real device.
you probably also want to make sure to use the rootwait option since you're attempting to use a usb device. read linux-2.6.x/Documentation/kernel-parameters.txt for more information.