Stefano Babic | 17b6037 | 2016-06-08 10:50:20 +0200 | [diff] [blame] | 1 | Board information |
| 2 | ----------------- |
| 3 | |
| 4 | The SBC produced by Phytec has a SOM based on a i.MX6Q. |
| 5 | The SOM is sold in two versions, with eMMC or with NAND. Support |
| 6 | here is for the SOM with NAND. |
| 7 | The evaluation board "phyBoard-Mira" is thought to be used |
| 8 | together with the SOM. |
| 9 | |
| 10 | More information on the board can be found on manufacturer's |
| 11 | website: |
| 12 | |
| 13 | http://www.phytec.de/produkt/single-board-computer/phyboard-mira/ |
| 14 | http://www.phytec.de/fileadmin/user_upload/images/content/1.Products/SOMs/phyCORE-i.MX6/L-808e_1.pdf |
| 15 | |
| 16 | Building U-Boot |
| 17 | ------------------------------- |
| 18 | |
| 19 | $ make pcm058_defconfig |
| 20 | $ make |
| 21 | |
| 22 | This generates the artifacts SPL and u-boot.img. |
| 23 | The SOM can boot from NAND or from SD-Card, having the SPI-NOR |
| 24 | as second option. |
| 25 | The dip switch "DIP-1" on the board let choose between |
| 26 | NAND and SD. |
| 27 | |
| 28 | DIP-1 set to off: Boot first from NAND, then try SPI |
| 29 | DIP-1 set to on: Boot first from SD, then try SPI |
| 30 | |
| 31 | The bootloader was tested with DIP-1 set to on. If a SD-card |
| 32 | is present, then the RBL tries to load SPL from the SD Card, if not, |
| 33 | RBL loads from SPI-NOR. The SPL tries then to load from the same |
| 34 | device where SPL was loaded (SD or SPI). Booting from NAND is |
| 35 | not supported. |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 36 | |
| 37 | Flashing U-Boot onto an SD card |
| 38 | ------------------------------- |
| 39 | |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame^] | 40 | After a successful build, the generated SPL and U-Boot binaries can be copied |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 41 | to an SD card. Adjust the SD card device as necessary: |
| 42 | |
| 43 | $ sudo dd if=u-boot-with-spl.imx of=/dev/mmcblk0 bs=1k seek=1 |
| 44 | |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame^] | 45 | This is equivalent to separately copying the SPL and U-Boot using: |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 46 | |
| 47 | $ sudo dd if=SPL of=/dev/mmcblk0 bs=1k seek=1 |
| 48 | $ sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 bs=1k seek=197 |
| 49 | |
| 50 | The default bootscripts expect a kernel fit-image file named "fitImage" in the |
| 51 | first partition and Linux ext4 rootfs in the second partition. |
| 52 | |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame^] | 53 | Flashing U-Boot to the SPI Flash, for booting Linux from NAND |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 54 | ------------------------------------------------------------- |
| 55 | |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame^] | 56 | The SD card created above can also be used to install the SPL and U-Boot into |
| 57 | the SPI flash. Boot U-Boot from the SD card as above, and stop at the autoboot. |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 58 | |
| 59 | Then, clear the SPI flash: |
| 60 | |
| 61 | => sf probe |
| 62 | => sf erase 0x0 0x1000000 |
| 63 | |
Niel Fourie | ff15f97 | 2020-07-24 16:33:27 +0200 | [diff] [blame] | 64 | Load the equivalent of u-boot-with-spl.imx from the raw MMC into memory and |
| 65 | copy to the SPI. The SPL is expected at an offset of 0x400, and its size is |
| 66 | maximum 392*512-byte blocks in size, therefore 0x188 blocks, totaling 0x31000 |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame^] | 67 | bytes. Assume U-Boot should fit into 640KiB, therefore 0x500 512-byte blocks, |
Niel Fourie | ff15f97 | 2020-07-24 16:33:27 +0200 | [diff] [blame] | 68 | totalling 0xA0000 bytes. Adding these together: |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 69 | |
Niel Fourie | ff15f97 | 2020-07-24 16:33:27 +0200 | [diff] [blame] | 70 | => mmc read ${loadaddr} 0x2 0x688 |
| 71 | => sf write ${loadaddr} 0x400 0xD1000 |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 72 | |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame^] | 73 | The SPL is located at offset 0x400, and U-Boot at 0x31400 in SPI flash, as to |
Niel Fourie | ff15f97 | 2020-07-24 16:33:27 +0200 | [diff] [blame] | 74 | match the SD Card layout. This would allow, instead of reading from the SD Card |
| 75 | above, with networking and TFTP correctly configured, the equivalent of: |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 76 | |
Niel Fourie | ff15f97 | 2020-07-24 16:33:27 +0200 | [diff] [blame] | 77 | => tftp u-boot-with-spl.imx |
| 78 | => sf write ${fileaddr} 0x400 ${filesize} |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 79 | |
| 80 | The default NAND bootscripts expect a single MTD partition named "rootfs", |
| 81 | which in turn contains the UBI volumes "fit" (which contains the kernel fit- |
| 82 | image) and "root" (which contains a ubifs root filesystem). |
| 83 | |
| 84 | The "bootm_size" variable in the environment |
| 85 | -------------------------------------------- |
| 86 | |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame^] | 87 | By default, U-Boot relocates the device tree towards the upper end of the RAM, |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 88 | which kernels using CONFIG_HIGHMEM=y may not be able to access during early |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame^] | 89 | boot. With the bootm_size variable set to 0x30000000, U-Boot relocates the |
Niel Fourie | 8ee1907 | 2020-05-19 14:01:43 +0200 | [diff] [blame] | 90 | device tree to below this address instead. |