New IT forum
23 October 2014, 05:09:34 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: CubieBoard 2 and Cubietruck both now in stock.
 
   Home   SHOP Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Boot from sata drive.  (Read 6592 times)
dp
Newbie
*
Posts: 32


« on: 20 September 2011, 08:07:53 am »

Hi,

From my previous readings and after several attempts, it seems to be impossible to boot from a SATA drive without changing the U-Boot firmware.
This in mind, I tried to set up the following configuration:
- create a 100Mb FAT partition on internal microSD (/dev/sda1) with the uImage,
- create a 500Gb ext3 partition on external SATA drive (/dev/sdc1) with the distribution (Debian squeeze).

Even though I compiled uImage with "CONFIG_SATA_MV=y", this didn't work.

Is there anybody able to use this kind of configuration (uImage on internal SD and root on external SATA drive) ?

Thanks in advance.
Logged
leighbb
New IT customer
Newbie
*
Posts: 36


« Reply #1 on: 20 September 2011, 08:54:24 am »

I can make this work (somewhat, the Dreamplug seems to have a few errors with the SATA port before it gets going), using an initial ramdisk.

I can boot with the following commands in the stock uboot :-

Code:
usb start
fatload usb 0 0x6400000 uImage-3.0.3-dreamplug
fatload usb 0 0x7400000 uInitrd-3.0.3-dreamplug
setenv bootargs console=ttyS0,115200 root=LABEL=dp-debian
bootm 0x6400000 0x7400000

As you can see, I use labels to boot (which I think you need to initial ramdisk for as well) so that if storage devices get detected in a different order (e.g. if you plug something in to the usb port or whatever), things still work.

Here is a bootlog :-

U-Boot 2011.06-02334-g8f495d9-dirty (Mar 28 2011 - 05:21:06)
Marvell-DreamPlug

SoC:   Kirkwood 88F6281_A0
DRAM:  512 MiB
SF: Detected MX25L1606 with page size 256, total 1 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0, egiga1
88E1121 Initialized on egiga0
88E1121 Initialized on egiga1
Hit any key to stop autoboot:  0
Marvell>> usb start
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 4 USB Device(s) found
       scanning bus for storage devices... 2 Storage Device(s) found
Marvell>> fatload usb 0 0x6400000 uImage-3.0.3-dreamplug
reading uImage-3.0.3-dreamplug

1872056 bytes read
Marvell>> fatload usb 0 0x7400000 uInitrd-3.0.3-dreamplug
reading uInitrd-3.0.3-dreamplug

4446093 bytes read
Marvell>> setenv bootargs console=ttyS0,115200 root=LABEL=dp-esata
Marvell>> bootm 0x6400000 0x7400000
## Booting kernel from Legacy Image at 06400000 ...
   Image Name:   uImage
   Created:      2011-08-25  18:28:47 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1871992 Bytes = 1.8 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 07400000 ...
   Image Name:   uInitrd-debian
   Created:      2011-08-25  18:28:57 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    4446029 Bytes = 4.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Initializing cgroup subsys cpu
Linux version 3.0.3-dreamplug (leigh@dish) (gcc version 4.4.6 (crosstool-NG-1.11.3) ) #7 PREEMPT Thu Aug 25 19:22:47 BST 2011
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Marvell DreamPlug Reference Board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttyS0,115200 root=LABEL=dp-esata
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 510880k/510880k available, 13408k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xe0800000 - 0xfe800000   ( 480 MB)
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc002a000   ( 136 kB)
      .text : 0xc002a000 - 0xc0389770   (3454 kB)
      .data : 0xc038a000 - 0xc03b0410   ( 154 kB)
       .bss : 0xc03b0434 - 0xc046c80c   ( 753 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
   Verbose stalled-CPUs detection is disabled.
NR_IRQS:114
sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474ms
Console: colour dummy device 80x30
Calibrating delay loop... 1191.11 BogoMIPS (lpj=5955584)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
NET: Registered protocol family 16
Kirkwood: MV88F6281-A1, TCLK=200000000.
Feroceon L2: Cache support initialised.
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource orion_clocksource
Switched to NOHz mode on CPU #0
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
Unpacking initramfs...
Freeing initrd memory: 4340K
cpufreq: Init kirkwood cpufreq driver
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
msgmni has been set to 1006
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
loop: module loaded
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
mousedev: PS/2 mouse device common for all mice
rtc-mv rtc-mv: rtc core: registered rtc-mv as rtc0
cpuidle: using governor ladder
cpuidle: using governor menu
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
oprofile: hardware counters not available
oprofile: using timer interrupt.
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
Registering the dns_resolver key type
registered taskstats version 1
rtc-mv rtc-mv: setting system clock to 2011-09-20 08:49:58 UTC (1316508598)
Freeing init memory: 136K
Loading, please wait...
udev[367]: starting version 164
mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
usb 1-1: new high speed USB device number 2 using orion-ehci
mv643xx_eth smi: probed
mmc0: mvsdio driver initialized, lacking card detect (fall back to polling)
mv643xx_eth_port mv643xx_eth_port.0: eth0: port 0 with MAC address f0:ad:4e:00:7b:a7
sata_mv sata_mv.0: version 1.28
sata_mv sata_mv.0: slots 32 ports 1
mmc0: new high speed SDIO card at address 0001
scsi0 : sata_mv
hub 1-1:1.0: USB hub found
ata1: SATA max UDMA/133 irq 21
hub 1-1:1.0: 4 ports detected
mv643xx_eth_port mv643xx_eth_port.1: eth1: port 0 with MAC address f0:ad:4e:00:7b:a8
usb 1-1.1: new high speed USB device number 3 using orion-ehci
usbcore: registered new interface driver uas
usb 1-1.4: new full speed USB device number 4 using orion-ehci
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
ata1.00: ATA-8: ST3500413AS, JC4B, max UDMA/133
ata1.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 31/32)
input: C-Media USB Headphone Set   as /devices/platform/orion-ehci.0/usb1/1-1/1-1.4/1-1.4:1.3/input/input0
generic-usb 0003:0D8C:000C.0001: input: USB HID v1.00 Device [C-Media USB Headphone Set  ] on usb-orion-ehci.0-1.4/input3
ata1.00: failed to read native max address (err_mask=0x100)
ata1.00: HPA support seems broken, skipping HPA handling
ata1.00: revalidation failed (errno=-5)
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
ata1.00: revalidation failed (errno=-5)
ata1: limiting SATA link speed to 1.5 Gbps
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl F310)
ata1.00: configured for UDMA/133
scsi 0:0:0:0: Direct-Access     ATA      ST3500413AS      JC4B PQ: 0 ANSI: 5
Initializing USB Mass Storage driver...
sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
scsi1 : usb-storage 1-1.1:1.0
sd 0:0:0:0: [sda] Write Protect is off
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2
sd 0:0:0:0: [sda] Attached SCSI disk
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... Begin: Mounting devpts ... mount: mounting none on /dev/pts failed: Device or resource busy
done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
Begin: Running /scripts/local-bottom ... done.
done.
Begin: Running /scripts/init-bottom ... done.
scsi 1:0:0:0: Direct-Access     Generic  STORAGE DEVICE   9910 PQ: 0 ANSI: 0
scsi 1:0:0:1: Direct-Access     Generic  STORAGE DEVICE   9910 PQ: 0 ANSI: 0
sd 1:0:0:0: [sdb] 3842048 512-byte logical blocks: (1.96 GB/1.83 GiB)
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] No Caching mode page present
sd 1:0:0:0: [sdb] Assuming drive cache: write through
sd 1:0:0:1: [sdc] 31299584 512-byte logical blocks: (16.0 GB/14.9 GiB)
sd 1:0:0:1: [sdc] Write Protect is off
sd 1:0:0:1: [sdc] No Caching mode page present
sd 1:0:0:1: [sdc] Assuming drive cache: write through
sd 1:0:0:0: [sdb] No Caching mode page present
sd 1:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1 sdb2
sd 1:0:0:1: [sdc] No Caching mode page present
sd 1:0:0:1: [sdc] Assuming drive cache: write through
 sdc: sdc1
sd 1:0:0:0: [sdb] No Caching mode page present
sd 1:0:0:0: [sdb] Assuming drive cache: write through
sd 1:0:0:0: [sdb] Attached SCSI removable disk
sd 1:0:0:1: [sdc] No Caching mode page present
sd 1:0:0:1: [sdc] Assuming drive cache: write through
sd 1:0:0:1: [sdc] Attached SCSI removable disk
INIT: version 2.88 booting
Using makefile-style concurrent boot in runlevel S.
Starting the hotplug events dispatcher: udevdudev[511]: starting version 164
.
Synthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated...m25p80 spi0.0: mx25l1606e (2048 Kbytes)
Creating 2 MTD partitions on "spi_flash":
0x000000000000-0x000000080000 : "u-boot"
0x000000100000-0x000000110000 : "u-boot env"
done.
Setting parameters of disc: (none).
Activating swap...done.
EXT4-fs (sda2): re-mounted. Opts: (null)
Checking root file system...fsck from util-linux-ng 2.17.2
dp-esata: clean, 42435/30523392 files, 2217999/122063622 blocks
done.
EXT4-fs (sda2): re-mounted. Opts: (null)
Loading kernel modules...done.
Cleaning up ifupdown....
Setting up networking....
Activating lvm and md swap...done.
Checking file systems...fsck from util-linux-ng 2.17.2
dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN
/dev/sdb1: 16 files, 22404/51091 clusters
done.
Mounting local filesystems...done.
Activating swapfile swap...done.
Cleaning up temporary files....
Configuring network interfaces...done.
Cleaning up temporary files....
Setting kernel variables ...done.
INIT: Entering runlevel: 2
Using makefile-style concurrent boot in runlevel 2.
Orion Watchdog Timer: Initial timeout 21 sec
Starting watchdog keepalive daemon: wd_keepalive.
Starting enhanced syslogd: rsyslogd.
Starting periodic command scheduler: cron.
Starting system message bus: dbus.
Starting bluetooth: bluetoothd.
NET: Registered protocol family 10
Starting Dropbear SSH server: dropbear.
Starting NTP server: ntpd.
Starting Tomcat servlet engine: tomcat6.
Stopping watchdog keepalive daemon....
Starting watchdog daemon...watchdog (1099): /proc/1099/oom_adj is deprecated, please use /proc/1099/oom_score_adj instead.
.

Debian GNU/Linux 6.0 freezer ttyS0

freezer login: root
Password:
Last login: Tue Sep 20 08:43:57 UTC 2011 on ttyS0
Linux freezer 3.0.3-dreamplug #7 PREEMPT Thu Aug 25 19:22:47 BST 2011 armv5tel


Logged
dp
Newbie
*
Posts: 32


« Reply #2 on: 22 September 2011, 04:30:35 pm »

Hi,

Could you explain how you built the uInitrd file to get this result ?

Thanks in advance.
Logged
leighbb
New IT customer
Newbie
*
Posts: 36


« Reply #3 on: 23 September 2011, 10:29:07 am »

I'll try and find time over the weekend to write something up.
Logged
leighbb
New IT customer
Newbie
*
Posts: 36


« Reply #4 on: 05 October 2011, 06:24:40 pm »

Slightly later than I promised, but here we go.

Notes:

1. I'm using Debian Squeeze
2. I use sudo instead of getting root, omit the sudo if you are running as root
3. My /boot is in the root filesystem, and is NOT the 100MB vfat partition
4. In the examples, /uboot is the 100MB vfat partition where the uimage and uinitrd images are installed

Firstly, install uboot-mkimage, if it isn't installed already:

sudo apt-get install uboot-mkimage

Secondly, build the kernel.  I've just built 3.0.6 using the patches and .config on my site http://www.solinno.co.uk/public/dreamplug/.  I haven't included instructions on building the kernel, I'm assuming you know how.

Thirdly, from the root of the kernel tree :

sudo make modules_install
sudo cp .config /boot/config-3.0.6-dreamplug
sudo cp arch/arm/boot/zImage /boot/vmlinuz-3.0.6-dreamplug
sudo mkinitramfs -o /boot/initrd.img-3.0.6-dreamplug 3.0.6-dreamplug
sudo mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n uInitrd-3.0.6-dreamplug -d /boot/initrd.img-3.0.6-dreamplug /uboot/uInitrd-3.0.6-dreamplug
sudo mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n uImage-3.0.6-dreamplug -d /boot/vmlinuz-3.0.6-dreamplug /uboot/uImage-3.0.6-dreamplug


After that reboot, and see how you get on.  You probably want to boot manually at first.  These are the u-boot commands I use
(because I'm using a Debian initrd I can use the LABEL= syntax):

usb start
fatload usb 0 0x6400000 uImage-3.0.6-dreamplug
fatload usb 0 0x7400000 uInitrd-3.0.6-dreamplug
setenv bootargs console=ttyS0,115200 root=LABEL=dp-debian
bootm 0x6400000 0x7400000


Hope that helps.
Logged
dp
Newbie
*
Posts: 32


« Reply #5 on: 06 October 2011, 08:38:59 am »

Hi,

Thanks a lot for sharing your procedure.

By the way, where did you get the various patches ? Are they only related to the 3.0.6 kernel ? Why aren't they already integrated into the sheeva.with-linux.com kernel ?

Finally, as it is another way to do it, have you tried to compile your own Uboot to get eSata boot capability ?

Regards.
Logged
dab7
Newbie
*
Posts: 24


« Reply #6 on: 07 December 2011, 01:01:07 am »

Has anyone managed to read the u-boot environment using the SPI patch provided?
If so, how?
Logged
kjax
Newbie
*
Posts: 3


« Reply #7 on: 28 January 2012, 01:54:01 am »

kwuartboot.c

Mr. Brown: Thank ya Thank ya.
Nice being able to test out new u-boot builds, without committing to them. Thanks for your write up, as well.

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!