| 81 | | TODO... |
|---|
| | 81 | == Formatting the SD card == |
|---|
| | 82 | The SD card must be formatted to have 2 partitions, the first is a fat partition that is bootable, the second is an ext2/3 partition that will serve as the rootfs for the initial boot. |
|---|
| | 83 | |
|---|
| | 84 | == Build the software == |
|---|
| | 85 | Follow the above guides, man pages, google, whatever you need, to build the above software. |
|---|
| | 86 | |
|---|
| | 87 | == Copy to SD == |
|---|
| | 88 | In the end you will have: x-load.bin.ift (use the signGP tool on x-load.bin), u-boot.bin, uImage, and a rootfs. Put these files onto your SD card partition 1 (the FAT parition) with the following names: mlo, u-boot.bin, uImage. Your rootfs should go onto the second (EXT) parition. Also go to the next section and grab the flashNand.scr, save this to the first parition (FAT) as boot.scr, this will flash your device when it first boots. |
|---|
| | 89 | |
|---|
| | 90 | == Boot off SD == |
|---|
| | 91 | Put your SD card in and hold the little button on the back of the CORE board (if the oswald is in its case, there is a hole on the back to press the button). The button only needs to be pressed the first time when running the nand flash script. |
|---|
| | 92 | |
|---|
| | 93 | == Flashing to NAND == |
|---|
| | 94 | To flash to nand, make sure that you have built all of the required files (x-load.bin.ift [called mlo], u-boot.bin, uImage, and the rootfs). In u-boot use the following commands to set up the NAND: |
|---|
| | 95 | |
|---|
| | 96 | Initialize mmc: |
|---|
| | 97 | |
|---|
| | 98 | {{{ |
|---|
| | 99 | mmcinit |
|---|
| | 100 | }}} |
|---|
| | 101 | |
|---|
| | 102 | write x-loader: |
|---|
| | 103 | |
|---|
| | 104 | {{{ |
|---|
| | 105 | fatload mmc 0 0x80300000 MLO |
|---|
| | 106 | nandecc hw |
|---|
| | 107 | nand erase 0 80000 |
|---|
| | 108 | nand write.i 0x80300000 0 80000 |
|---|
| | 109 | }}} |
|---|
| | 110 | |
|---|
| | 111 | Write u-boot: |
|---|
| | 112 | |
|---|
| | 113 | {{{ |
|---|
| | 114 | fatload mmc 0 0x80300000 u-boot.bin |
|---|
| | 115 | nandecc sw |
|---|
| | 116 | nand erase 80000 160000 |
|---|
| | 117 | nand write.i 0x80300000 80000 160000 |
|---|
| | 118 | }}} |
|---|
| | 119 | |
|---|
| | 120 | Write the kernel: |
|---|
| | 121 | |
|---|
| | 122 | {{{ |
|---|
| | 123 | fatload mmc 0 0x80300000 uImage |
|---|
| | 124 | nand erase 280000 400000 |
|---|
| | 125 | nand write.i 0x80300000 280000 400000 |
|---|
| | 126 | }}} |
|---|
| | 127 | |
|---|
| | 128 | Clear the rest of the NAND flash to get it ready for the file system: |
|---|
| | 129 | |
|---|
| | 130 | {{{ |
|---|
| | 131 | nand erase 680000 |
|---|
| | 132 | }}} |
|---|
| | 133 | |
|---|
| | 134 | Finally, save the environment variables to the NAND: |
|---|
| | 135 | |
|---|
| | 136 | {{{ |
|---|
| | 137 | saveenv |
|---|
| | 138 | }}} |
|---|
| | 139 | |
|---|
| | 140 | Now, boot linux from SD: |
|---|
| | 141 | |
|---|
| | 142 | {{{ |
|---|
| | 143 | run mmcargs |
|---|
| | 144 | mmcinit |
|---|
| | 145 | fatload mmc 0 0x80300000 uImage |
|---|
| | 146 | bootm 0x80300000 |
|---|
| | 147 | }}} |
|---|
| | 148 | |
|---|
| | 149 | then in Linux, flash the root file system: |
|---|
| | 150 | |
|---|
| | 151 | {{{ |
|---|
| | 152 | mkdir /media/nand |
|---|
| | 153 | mount -t jffs2 /dev/mtdblock4 /media/nand |
|---|
| | 154 | cd /media/nand |
|---|
| | 155 | tar xvjf /media/mmcblk0p2/rootfs.tar.bz2 |
|---|
| | 156 | cd / |
|---|
| | 157 | umount /media/nand /media/mmcblk0p1 /media/mmcblk0p2 |
|---|
| | 158 | reboot |
|---|
| | 159 | }}} |
|---|
| | 160 | |
|---|
| | 161 | Now you should be able to boot from nand. |
|---|