This is the pc-side, /dev/sdb is my usb adapter with the target drive connected.
$this->bbcode_second_pass_code('', '
From dmesg
[32811.299971] scsi 23:0:0:0: Direct-Access SAMSUNG HD103SI 1AQ1 PQ: 0 ANSI: 5
[32811.318181] sd 23:0:0:0: [sdb] 1953525168 512-byte hardware sectors (1000205 MB)
fdisk -l
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00008000
Device Boot Start End Blocks Id System
/dev/sdb1 2048 2049 16065 83 Linux
/dev/sdb2 4096 121601 943866945 83 Linux
')
Cold boot from the nas (it's a dual-bay variant)
$this->bbcode_second_pass_code('', '
Stage-1 Bootloader Mon Nov 14 22:15:13 EST 2011
Attempting to set PLLA to 700MHz ...
plla_ctrl0 : 0x0000000A
plla_ctrl1 : 0x000E0000
plla_ctrl2 : 0x001B01A0
plla_ctrl3 : 0x00000016
PLLA Set
Setup memory, testing
Reading disk 0, Image 0
Sector : 0x0000009A
Hdr len: 0x0001FB34
Hdr CRC: 0x2229BDCD
OK
Initialising disks
SATA PHY not ready for device 1
Detecting SATA busses:
Bus 0: Found first device OK
Device 0: Model: SAMSUNG HD103SI Firm: 1AQ10001 Ser#: S2SDJ9JB600497
Type: Hard Disk
Capacity: 131071.9 MB = 127.9 GB (268435455 x 512)
Device 1: not available
Failed to read valid environment from disk, using built-in default
U-Boot 1.1.2 (Dec 31 2011 - 15:24:45)
U-Boot code: 60E00000 -> 60E1FB34 BSS: -> 60E5435C
RAM Configuration:
Bank #0: 60000000 128 MB
SRAM Configuration:
64KB at 0x50000000
NAND:256 MiB
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Setting Linux mem= boot arg value
IDE read: device 0 block # 288, count 1 ... 1 blocks read: OK
Hit any key to stop autoboot: 0
Loading from IDE device 0, partition 1: Name: hda1
Type: U-Boot
** Bad Magic Number **
Loading from IDE device 0, partition 2: Name: hda2
Type: U-Boot
** Bad Magic Number **
Unknown command 'lightled' - try 'help'
')
And, the strange output of 'ide part' which shows really wierd start sectors, even though the pc-side has them at 2048/4096..
$this->bbcode_second_pass_code('', '
$ ide part
Partition Map for IDE device 0 -- Partition Type: DOS
Partition Start Sector Num Sectors Type
1 32885055 32130 83
2 65786175 1887733890 83
')
And yes, i used linux fdisk and 'o' command to build a new dos partition type.
Also testing a bit with ide read command to get data into 60500000, seems to use hex instead of dec
$this->bbcode_second_pass_code('', '
$ ide part
Partition Map for IDE device 0 -- Partition Type: DOS
Partition Start Sector Num Sectors Type
1 32885055 32130 83
2 65786175 1887733890 83
$ ide read 60500000 800 1000
IDE read: device 0 block # 2048, count 4096 ... 4096 blocks read: OK
$ bootm 60500000
## Booting image at 60500000 ...
Bad Magic Number
$ ide read 60500000
IDE read: device 0 block # 2048, count 4096 ... 4096 blocks read: OK
$ bootm 60500000
## Booting image at 60500000 ...
Bad Magic Number
$
')
Tested with a new eSata dock, but the results are the same. It refuses to boot kernel
Edit: This is an Akitio-based dual bay nas, and i just tried to use nand with the u-boot on disk, but it won't read to ram correctly for some reason. This exact same command is used in the on-board u-boot with no problem.
(i figured to write the uImage from nand to IDE and see if i could boot from it that way..)
Is the u-boot for 'sata boot' suited to also boot a kernel from Nand?
$this->bbcode_second_pass_code('', '
$ nboot 60500000 0 440000
Loading from device 0: 256MiB 3,3V 8-bit (offset 0x440000)
** Bad Magic Number 0xb8e3cf2c **
')
Note that the device boots fine from internal u-boot, but my ubifs rootfs is damaged badly, hence the need to boot from sata..