2016-02-06 11:30:11 +08:00
|
|
|
1. SATA usage in U-Boot
|
2008-03-26 22:54:44 +08:00
|
|
|
|
2008-03-27 18:49:56 +08:00
|
|
|
There are two ways to operate the hard disk
|
2008-03-26 22:54:44 +08:00
|
|
|
|
2008-03-27 18:49:56 +08:00
|
|
|
* Read/write raw blocks from/to SATA hard disk
|
|
|
|
* ext2load to read a file from ext2 file system
|
2008-03-26 22:54:44 +08:00
|
|
|
|
2008-03-27 18:49:56 +08:00
|
|
|
1.0 How to read the SATA hard disk's information?
|
2008-03-26 22:54:44 +08:00
|
|
|
|
|
|
|
=> sata info
|
|
|
|
|
2008-03-27 07:03:57 +08:00
|
|
|
SATA device 0: Model: ST3320620AS Firm: 3.AAD Ser#: 4QF01ZTN
|
|
|
|
Type: Hard Disk
|
|
|
|
Supports 48-bit addressing
|
|
|
|
Capacity: 305245.3 MB = 298.0 GB (625142448 x 512)
|
2008-03-26 22:54:44 +08:00
|
|
|
|
2008-03-27 18:49:56 +08:00
|
|
|
1.1 How to raw write the kernel, file system, dtb to a SATA hard disk?
|
2008-03-26 22:54:44 +08:00
|
|
|
|
2008-03-27 18:49:56 +08:00
|
|
|
Notes: Hard disk sectors are normally 512 bytes, so
|
|
|
|
0x1000 sectors = 2 MBytes
|
2008-03-26 22:54:44 +08:00
|
|
|
|
2008-03-27 18:49:56 +08:00
|
|
|
write kernel
|
2008-03-26 22:54:44 +08:00
|
|
|
=> tftp 40000 /tftpboot/uImage.837x
|
|
|
|
=> sata write 40000 0 2000
|
|
|
|
|
|
|
|
write ramdisk
|
|
|
|
=> tftp 40000 /tftpboot/ramdisk.837x
|
|
|
|
=> sata write 40000 2000 8000
|
|
|
|
|
|
|
|
write dtb
|
|
|
|
=> tftp 40000 /tftpboot/mpc837xemds.dtb
|
|
|
|
=> sata write 40000 a000 1000
|
|
|
|
|
2008-03-27 18:49:56 +08:00
|
|
|
1.2 How to raw read the kernel, file system, dtb from a SATA hard disk?
|
2008-03-26 22:54:44 +08:00
|
|
|
|
|
|
|
load kernel
|
|
|
|
=> sata read 200000 0 2000
|
|
|
|
|
|
|
|
load ramdisk
|
|
|
|
=> sata read 1000000 2000 8000
|
|
|
|
|
|
|
|
load dtb
|
|
|
|
=> sata read 2000000 a000 1000
|
|
|
|
|
|
|
|
boot
|
|
|
|
=> bootm 200000 1000000 2000000
|
|
|
|
|
2016-02-06 11:30:11 +08:00
|
|
|
1.3 How to load an image from an ext2 file system in U-Boot?
|
2008-03-26 22:54:44 +08:00
|
|
|
|
2016-02-06 11:30:11 +08:00
|
|
|
U-Boot doesn't support writing to an ext2 file system, so the
|
2008-03-27 18:49:56 +08:00
|
|
|
files must be written by other means (e.g. linux).
|
2008-03-26 22:54:44 +08:00
|
|
|
|
|
|
|
=> ext2ls sata 0:1 /
|
2008-03-27 07:03:57 +08:00
|
|
|
<DIR> 4096 .
|
|
|
|
<DIR> 4096 ..
|
|
|
|
<DIR> 16384 lost+found
|
|
|
|
1352023 uImage.837x
|
|
|
|
3646377 ramdisk.837x
|
|
|
|
12288 mpc837xemds.dtb
|
|
|
|
12 hello.txt
|
2008-03-26 22:54:44 +08:00
|
|
|
|
|
|
|
=> ext2load sata 0:1 200000 /uImage.837x
|
|
|
|
|
|
|
|
=> ext2load sata 0:1 1000000 /ramdisk.837x
|
|
|
|
|
|
|
|
=> ext2load sata 0:1 2000000 /mpc837xemds.dtb
|
|
|
|
|
|
|
|
=> bootm 200000 1000000 2000000
|