This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Booting Linux from USB storage

Other Parts Discussed in Thread: DA8XX, TPS65217

Hi Team,

am try to booting Linux from usb device,using below commands 

1.procedure

U-Boot # usb start
U-Boot # setenv mmcroot /dev/sda2 ro
U-Boot # run mmcargs
U-Boot # run bootcmd_usb

Error ::
[    1.703447] Waiting for root device /dev/sda2...
[   60.327610] PM: request_firmware failed


2.procedure


ext4ls usb 0:2 /boot

ext4load usb 0:2 ${loadaddr} /boot/zImage

ext4load usb 0:2 ${fdtaddr} /boot/am335x-boneblack.dtb  // /${fdtfile}

setenv bootargs 'console=ttyO0 root=/dev/sda2 rw rootdelay=5'

bootz ${loadaddr} - ${fdtaddr}

Eroor :

[    6.717396] VFS: Cannot open root device "sda2" or unknown-block(0,0): error -6
[    6.725079] Please append a correct "root=" boot option; here are the available partitions:
[    6.733893] b300         3776512 mmcblk0  driver: mmcblk
[    6.739491]   b301           72261 mmcblk0p1 00000000-01
[    6.745064]   b302         3702982 mmcblk0p2 00000000-02
[    6.750649] b310            2048 mmcblk0boot1  (driver?)
[    6.756225] b308            2048 mmcblk0boot0  (driver?)
[    6.761809] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

How to solve this problems ,my task is to boot from usb device

Regards,
Naven



  • Do you have two partitions in USB and having filesystem in 2nd partition ?
    What is the format of 2nd partition ?
    ext3 or ext4 etc.,
  • Hi Naveen Kumar,

    Make sure that the partition,  "sda2" is available because in the available partitions listed, sda2 seems to be missing.

    1. Use the  below command, to see the device node partitions and check how the sda2 is pointing to?..

    >fdisk -l

    2. Print the bootcmd and check all its command expansions.

    U-Boot # pri bootcmd_usb

    For example, in the below bootcommand, it uses usb 0:1 partition with fat filesystem loaded.

    U-Boot> setenv bootcmd 'usb start; fatload usb 0:1 0xC0700000 uImage; bootm 0xc0700000'

    Check in which partition the filesystem is loaded. usb 0:1 or 0:2 and verify that the same is given in the bootcmd.

    Print and check the loadaddr and ftdaddr as well.

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------

  • 1. using fdisk -l command

    Disk /dev/sda: 8004 MB, 8004304896 bytes, 15633408 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

    Device Boot Start End Blocks Id System
    /dev/sda1 * 63 144584 72261 c W95 FAT32 (LBA)
    /dev/sda2 160650 15631244 7735297+ 83 Linux

    2.pri bootcmd_usb command expansion

    bootcmd_usb=setenv devnum 0; run usb_boot;
  • After using commands it will get error

    using commands:

    setenv bootcmd 'usb start; fatload usb 0:1 0x80200000 uImage; bootm 0x80f80000'

    run bootcmd_usb

    Error :

    U-Boot# setenv bootcmd 'usb start; fatload usb 0:1 0x80200000 uImage; bootm 0x80f80000'
    U-Boot# run bootcmd_usb
    (Re)start USB...
    USB0: scanning bus 0 for devices... 1 USB Device(s) found
    scanning usb for storage devices... 1 Storage Device(s) found

    USB device 0:
    Device 0: Vendor: SanDisk Rev: 1.26 Prod: Cruzer Blade
    Type: Removable Hard Disk
    Capacity: 7633.5 MB = 7.4 GB (15633408 x 512)
    ... is now current device
    Scanning usb 0...
    4117616 bytes read in 2757 ms (1.4 MiB/s)
    34352 bytes read in 384 ms (86.9 KiB/s)
    Kernel image @ 0x80200000 [ 0x000000 - 0x3ed470 ]
    ## Flattened Device Tree blob at 80f80000
    Booting using the fdt blob at 0x80f80000
    Loading Device Tree to 9f321000, end 9f32c62f ... OK

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 3.12.10-ti2013.12.01 (jenkins@sdit-build02) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 Sun Mar 30 20:55:31 CDT 2014
    [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] Machine: Generic AM33XX (Flattened Device Tree), model: TI AM335x BeagleBone
    [ 0.000000] cma: CMA: reserved 24 MiB at 9d800000
    [ 0.000000] Memory policy: ECC disabled, Data cache writeback
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM335X ES2.1 (sgx neon )
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129280
    [ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/sda2 rw rootfstype=ext4 rootwait
    [ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
    [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
    [ 0.000000] Memory: 483352K/521216K available (5555K kernel code, 559K rwdata, 1876K rodata, 345K init, 225K bss, 37864K reserved, 0K highmem)
    [ 0.000000] Virtual kernel memory layout:
    [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    [ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
    [ 0.000000] vmalloc : 0xe0800000 - 0xff000000 ( 488 MB)
    [ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
    [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
    [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
    [ 0.000000] .text : 0xc0008000 - 0xc074a04c (7433 kB)
    [ 0.000000] .init : 0xc074b000 - 0xc07a15f0 ( 346 kB)
    [ 0.000000] .data : 0xc07a2000 - 0xc082ddd8 ( 560 kB)
    [ 0.000000] .bss : 0xc082ddd8 - 0xc0866400 ( 226 kB)
    [ 0.000000] NR_IRQS:16 nr_irqs:16 16
    [ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [ 0.000000] Total of 128 interrupts on 1 active controller
    [ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
    [ 0.000000] OMAP clocksource: timer1 at 24000000 Hz
    [ 0.000000] Console: colour dummy device 80x30
    [ 0.000249] Calibrating delay loop... 663.55 BogoMIPS (lpj=3317760)
    [ 0.049784] pid_max: default: 32768 minimum: 301
    [ 0.049867] Security Framework initialized
    [ 0.049907] Mount-cache hash table entries: 512
    [ 0.055725] CPU: Testing write buffer coherency: ok
    [ 0.056058] Setting up static identity map for 0xc0572e68 - 0xc0572ed8
    [ 0.056752] devtmpfs: initialized
    [ 0.058186] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [ 0.117881] omap_hwmod: debugss: _wait_target_disable failed
    [ 0.118464] pinctrl core: initialized pinctrl subsystem
    [ 0.119144] regulator-dummy: no parameters
    [ 0.121147] NET: Registered protocol family 16
    [ 0.122836] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [ 0.124839] cpuidle: using governor ladder
    [ 0.124853] cpuidle: using governor menu
    [ 0.131235] platform mpu.1: FIXME: clock-name 'fck' DOES NOT exist in dt!
    [ 0.132050] platform 49000000.edma: FIXME: clock-name 'fck' DOES NOT exist in dt!
    [ 0.133004] OMAP GPIO hardware version 0.1
    [ 0.139029] platform 56000000.sgx: FIXME: clock-name 'fck' DOES NOT exist in dt!
    [ 0.140518] DSS not supported on this SoC
    [ 0.140534] No ATAGs?
    [ 0.140542] hw-breakpoint: debug architecture 0x4 unsupported.
    [ 0.158068] bio: create slab <bio-0> at 0
    [ 0.168914] edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver
    [ 0.169555] vmmcsd_fixed: 3300 mV
    [ 0.171690] vgaarb: loaded
    [ 0.172660] SCSI subsystem initialized
    [ 0.173667] usbcore: registered new interface driver usbfs
    [ 0.173806] usbcore: registered new interface driver hub
    [ 0.173952] usbcore: registered new device driver usb
    [ 0.174653] omap_i2c 44e0b000.i2c: could not find pctldev for node /pinmux@44e10800/pinmux_i2c0_pins, deferring probe
    [ 0.174674] platform 44e0b000.i2c: Driver omap_i2c requests probe deferral
    [ 0.174835] media: Linux media interface: v0.10
    [ 0.174968] Linux video capture interface: v2.00
    [ 0.175169] pps_core: LinuxPPS API ver. 1 registered
    [ 0.175178] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [ 0.175277] PTP clock support registered
    [ 0.177203] Switched to clocksource timer1
    [ 0.191109] NET: Registered protocol family 2
    [ 0.191620] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
    [ 0.191687] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
    [ 0.191724] TCP: Hash tables configured (established 4096 bind 4096)
    [ 0.191782] TCP: reno registered
    [ 0.191792] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [ 0.191808] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [ 0.191964] NET: Registered protocol family 1
    [ 0.192273] RPC: Registered named UNIX socket transport module.
    [ 0.192283] RPC: Registered udp transport module.
    [ 0.192288] RPC: Registered tcp transport module.
    [ 0.192293] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 0.193006] NetWinder Floating Point Emulator V0.97 (double precision)
    [ 0.193477] PM: Loading am335x-pm-firmware.bin
    [ 0.307572] VFS: Disk quotas dquot_6.5.2
    [ 0.307634] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [ 0.308120] NFS: Registering the id_resolver key type
    [ 0.308190] Key type id_resolver registered
    [ 0.308197] Key type id_legacy registered
    [ 0.308229] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
    [ 0.308381] msgmni has been set to 992
    [ 0.309590] NET: Registered protocol family 38
    [ 0.309625] io scheduler noop registered
    [ 0.309632] io scheduler deadline registered
    [ 0.309651] io scheduler cfq registered (default)
    [ 0.311122] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
    [ 0.314766] platform 4830e000.lcdc: Driver da8xx_lcdc requests probe deferral
    [ 0.316003] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    [ 0.318186] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 88, base_baud = 3000000) is a OMAP UART0
    [ 0.917759] console [ttyO0] enabled
    [ 0.922494] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
    [ 0.936875] brd: module loaded
    [ 0.944022] loop: module loaded
    [ 0.949788] mtdoops: mtd device (mtddev=name/number) must be supplied
    [ 0.959143] usbcore: registered new interface driver asix
    [ 0.964975] usbcore: registered new interface driver ax88179_178a
    [ 0.971500] usbcore: registered new interface driver cdc_ether
    [ 0.977757] usbcore: registered new interface driver r815x
    [ 0.983655] usbcore: registered new interface driver smsc95xx
    [ 0.989799] usbcore: registered new interface driver net1080
    [ 0.995865] usbcore: registered new interface driver cdc_subset
    [ 1.002181] usbcore: registered new interface driver zaurus
    [ 1.008218] usbcore: registered new interface driver cdc_ncm
    [ 1.014535] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [ 1.021409] ehci-pci: EHCI PCI platform driver
    [ 1.026216] ehci-omap: OMAP-EHCI Host Controller driver
    [ 1.032357] usbcore: registered new interface driver cdc_wdm
    [ 1.038464] usbcore: registered new interface driver usb-storage
    [ 1.045531] mousedev: PS/2 mouse device common for all mice
    [ 1.053495] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
    [ 1.061003] 44e3e000.rtc: already running
    [ 1.065747] i2c /dev entries driver
    [ 1.069834] Driver for 1-wire Dallas network protocol.
    [ 1.077016] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [ 1.085659] edma-dma-engine edma-dma-engine.0: allocated channel for 0:25
    [ 1.092901] edma-dma-engine edma-dma-engine.0: allocated channel for 0:24
    [ 1.137510] edma-dma-engine edma-dma-engine.0: allocated channel for 0:3
    [ 1.144552] edma-dma-engine edma-dma-engine.0: allocated channel for 0:2
    [ 1.192390] ledtrig-cpu: registered to indicate activity on CPUs
    [ 1.199049] edma-dma-engine edma-dma-engine.0: allocated channel for 0:36
    [ 1.206272] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
    [ 1.213379] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
    [ 1.219552] edma-dma-engine edma-dma-engine.0: allocated channel for 0:5
    [ 1.226649] edma-dma-engine edma-dma-engine.0: allocated channel for 0:6
    [ 1.237791] usbcore: registered new interface driver usbhid
    [ 1.243638] usbhid: USB HID core driver
    [ 1.249392] oprofile: no performance counters
    [ 1.254272] oprofile: using timer interrupt.
    [ 1.259088] TCP: cubic registered
    [ 1.262583] Initializing XFRM netlink socket
    [ 1.267085] NET: Registered protocol family 17
    [ 1.271829] NET: Registered protocol family 15
    [ 1.276554] 8021q: 802.1Q VLAN Support v1.8
    [ 1.281055] Key type dns_resolver registered
    [ 1.286115] cpu cpu0: cpu0 regulator not ready, retry
    [ 1.291523] platform cpufreq-cpu0.0: Driver cpufreq-cpu0 requests probe deferral
    [ 1.299337] mmc1: BKOPS_EN bit is not set
    [ 1.304020] ThumbEE CPU extension supported.
    [ 1.312643] DCDC1: at 1500 mV
    [ 1.315900] mmc1: new high speed MMC card at address 0001
    [ 1.322494] mmcblk0: mmc1:0001 MMC04G 3.60 GiB
    [ 1.327359] vdd_mpu: 925 <--> 1375 mV at 1325 mV
    [ 1.332388] mmcblk0boot0: mmc1:0001 MMC04G partition 1 2.00 MiB
    [ 1.338921] mmcblk0boot1: mmc1:0001 MMC04G partition 2 2.00 MiB
    [ 1.345819] vdd_core: 925 <--> 1150 mV at 1125 mV
    [ 1.351559] mmcblk0: p1 p2
    [ 1.355485] LDO1: at 1800 mV
    [ 1.359845] mmcblk0boot1: unknown partition table
    [ 1.365400] LDO2: at 3300 mV
    [ 1.369515] mmcblk0boot0: unknown partition table
    [ 1.375595] LDO3: 1800 mV
    [ 1.379307] LDO4: at 3300 mV
    [ 1.383062] tps65217 0-0024: TPS65217 ID 0xe version 1.2
    [ 1.509346] tda998x 0-0070: found TDA19988
    [ 1.514050] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [ 1.580954] Console: switching to colour frame buffer device 160x45
    [ 1.657245] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
    [ 1.663653] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
    [ 1.670809] libphy: 4a101000.mdio: probed
    [ 1.675022] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
    [ 1.685204] Detected MACID = 78:a5:04:ca:fd:ef
    [ 1.691324] omap_rtc 44e3e000.rtc: setting system clock to 2014-03-31 03:03:48 UTC (1396235028)
    [ 1.703421] Waiting for root device /dev/sda2...
    [ 60.327570] PM: request_firmware failed
    [ 1.703421] Waiting for root device /dev/sda2...
    [ 60.327570] PM: request_firmware failed
  • Hi,


    [ 1.014535] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [ 1.021409] ehci-pci: EHCI PCI platform driver
    [ 1.026216] ehci-omap: OMAP-EHCI Host Controller driver
    [ 1.032357] usbcore: registered new interface driver cdc_wdm
    [ 1.038464] usbcore: registered new interface driver usb-storage


    Here, your pendrive must be detected and printed with partition (/dev/sda1,sda2) details.
    So, some of the USB driver support needs to be enabled in linux kernel.

    Regards,
    Shankari.
    -------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------
  • It looks liike you are using AM335x which does not have an EHCI controller. It uses a Mentor USB core. I would have expected to see musb messages in your boot log. You should confgire musb in your kernel.

    Steve K.

  • Now I see what is happening. In SDK 7 most drivers are built as modules. I noticed that the musb drivers are modules. Go into your kernel source and do 'make menuconfig' select drivers then usb and build the musb drivers into the kernel.
    Steve K.
  • make menuconfig :

    drivers -----> usb support ------->
    MUSB Mode Selection
    ( ) Host only mode
    ( ) Gadget only mode
    (X) Dual Role mode
    There are three modes are available in MUSB configuration so which mode i select
  • You can keep Dual Role mode. You need to build Inventra Highspeed Dual Role Controller into the kernel so instead of <M> you should press the space bar until you see <*>. Select Platform Glue Layer and press the space bar until you see <*>. Then press enter and select TI DSPS platforms. Then select Enable support for AM335x devices and press space bar until you see <*>. Save the configuration and build your kernel with make zImage.

    I'm sure if I missed anything our USB expert will reply.

    Steve K.

  • After changing the above configuration same problem

    [ 1.723803] Waiting for root device /dev/sda2...
    [ 60.328032] PM: request_firmware failed
  • I just booted with no problem. On the SD card I boot from, I only have MLO and u-boot.img. The root file system is on a USB stick. After building the kernel, I removed the zImage from the root file system boot directory and then copied my new zImage there. I stopped the boot process in u-boot and at the command line typed in run usb_boot.

    Steve K.

  • Steve

    The MLO,u-boot.img and root file system in USB Device ,am not using sd card in my board ,usb device divided in to two partitions.task is to boot from usb device ,i have no idea it is possible ??
  • Hi Naveen,

    Refer to the following TI wiki page to enable USB mass storage support.

    processors.wiki.ti.com/.../Usbgeneralpage

    processors.wiki.ti.com/.../AM335x_USB_Driver%27s_Guide


    Regards,
    Shankari.