Bin Meng | 7557405 | 2016-02-05 19:30:11 -0800 | [diff] [blame^] | 1 | 1. SATA usage in U-Boot |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 2 | |
Dave Liu | d5f577f | 2008-03-27 18:49:56 +0800 | [diff] [blame] | 3 | There are two ways to operate the hard disk |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 4 | |
Dave Liu | d5f577f | 2008-03-27 18:49:56 +0800 | [diff] [blame] | 5 | * Read/write raw blocks from/to SATA hard disk |
| 6 | * ext2load to read a file from ext2 file system |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 7 | |
Dave Liu | d5f577f | 2008-03-27 18:49:56 +0800 | [diff] [blame] | 8 | 1.0 How to read the SATA hard disk's information? |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 9 | |
| 10 | => sata info |
| 11 | |
Wolfgang Denk | 9a6a7e0 | 2008-03-27 00:03:57 +0100 | [diff] [blame] | 12 | SATA device 0: Model: ST3320620AS Firm: 3.AAD Ser#: 4QF01ZTN |
| 13 | Type: Hard Disk |
| 14 | Supports 48-bit addressing |
| 15 | Capacity: 305245.3 MB = 298.0 GB (625142448 x 512) |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 16 | |
Dave Liu | d5f577f | 2008-03-27 18:49:56 +0800 | [diff] [blame] | 17 | 1.1 How to raw write the kernel, file system, dtb to a SATA hard disk? |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 18 | |
Dave Liu | d5f577f | 2008-03-27 18:49:56 +0800 | [diff] [blame] | 19 | Notes: Hard disk sectors are normally 512 bytes, so |
| 20 | 0x1000 sectors = 2 MBytes |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 21 | |
Dave Liu | d5f577f | 2008-03-27 18:49:56 +0800 | [diff] [blame] | 22 | write kernel |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 23 | => tftp 40000 /tftpboot/uImage.837x |
| 24 | => sata write 40000 0 2000 |
| 25 | |
| 26 | write ramdisk |
| 27 | => tftp 40000 /tftpboot/ramdisk.837x |
| 28 | => sata write 40000 2000 8000 |
| 29 | |
| 30 | write dtb |
| 31 | => tftp 40000 /tftpboot/mpc837xemds.dtb |
| 32 | => sata write 40000 a000 1000 |
| 33 | |
Dave Liu | d5f577f | 2008-03-27 18:49:56 +0800 | [diff] [blame] | 34 | 1.2 How to raw read the kernel, file system, dtb from a SATA hard disk? |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 35 | |
| 36 | load kernel |
| 37 | => sata read 200000 0 2000 |
| 38 | |
| 39 | load ramdisk |
| 40 | => sata read 1000000 2000 8000 |
| 41 | |
| 42 | load dtb |
| 43 | => sata read 2000000 a000 1000 |
| 44 | |
| 45 | boot |
| 46 | => bootm 200000 1000000 2000000 |
| 47 | |
Bin Meng | 7557405 | 2016-02-05 19:30:11 -0800 | [diff] [blame^] | 48 | 1.3 How to load an image from an ext2 file system in U-Boot? |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 49 | |
Bin Meng | 7557405 | 2016-02-05 19:30:11 -0800 | [diff] [blame^] | 50 | U-Boot doesn't support writing to an ext2 file system, so the |
Dave Liu | d5f577f | 2008-03-27 18:49:56 +0800 | [diff] [blame] | 51 | files must be written by other means (e.g. linux). |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 52 | |
| 53 | => ext2ls sata 0:1 / |
Wolfgang Denk | 9a6a7e0 | 2008-03-27 00:03:57 +0100 | [diff] [blame] | 54 | <DIR> 4096 . |
| 55 | <DIR> 4096 .. |
| 56 | <DIR> 16384 lost+found |
| 57 | 1352023 uImage.837x |
| 58 | 3646377 ramdisk.837x |
| 59 | 12288 mpc837xemds.dtb |
| 60 | 12 hello.txt |
Dave Liu | 2e57ae9 | 2008-03-26 22:54:44 +0800 | [diff] [blame] | 61 | |
| 62 | => ext2load sata 0:1 200000 /uImage.837x |
| 63 | |
| 64 | => ext2load sata 0:1 1000000 /ramdisk.837x |
| 65 | |
| 66 | => ext2load sata 0:1 2000000 /mpc837xemds.dtb |
| 67 | |
| 68 | => bootm 200000 1000000 2000000 |