Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 1 | U-Boot for the Freescale i.MX6q SabreLite board |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 2 | =============================================== |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 3 | |
| 4 | This file contains information for the port of U-Boot to the Freescale |
| 5 | i.MX6q SabreLite board. |
| 6 | |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 7 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 8 | 1. Build |
| 9 | -------- |
| 10 | |
| 11 | To build U-Boot for the SabreLite board: |
| 12 | |
| 13 | make mx6qsabrelite_config |
| 14 | make |
| 15 | |
| 16 | |
| 17 | 2. Boot from SD card |
| 18 | -------------------- |
| 19 | |
| 20 | The SabreLite boards boot from the SPI NOR flash. These boards need their SPI |
| 21 | to be reflashed with a small SD card loader to support boot from SD card. The |
| 22 | board will still boot from SPI NOR, but the loader will in turn request the |
| 23 | BootROM to load the U-Boot from SD card. |
Dirk Behme | 03dc0bb | 2012-02-12 21:29:47 +0000 | [diff] [blame] | 24 | |
| 25 | The SD card loader is available from |
| 26 | |
| 27 | https://wiki.linaro.org/Boards/MX6QSabreLite |
| 28 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 29 | This is provided under a open-source 3-clause BSD license. |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 30 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 31 | To following procedure can be used to update the SPI-NOR on the SabreLite |
| 32 | board: |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 33 | |
| 34 | 1. Write this SD card loader onto a large SD card using: |
| 35 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 36 | sudo dd if=iMX6DQ_SPI_to_uSDHC3.bin of=/dev/sXx |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 37 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 38 | Note: Replace sXx with the device representing the SD card in your system. |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 39 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 40 | Note: This writes SD card loader at address 0 |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 41 | |
| 42 | 2. Put this SD card into the slot for the large SD card (SD3 on the bottom of |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 43 | the board). Make sure SW1 switch is at position "00", so that it can boot |
| 44 | from the fuses. |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 45 | |
| 46 | 3. Power-up the SabreLite, press 'space' to enter command mode in the U-Boot |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 47 | (the default one the board is shipped with, starting from the SPI NOR) and |
| 48 | enter the following commands: |
| 49 | |
| 50 | MX6Q SABRELITE U-Boot > mmc dev 0 |
| 51 | MX6Q SABRELITE U-Boot > mmc read 0x10800000 0 200 |
| 52 | MX6Q SABRELITE U-Boot > sf probe |
| 53 | MX6Q SABRELITE U-Boot > sf erase 0 0x40000 |
| 54 | MX6Q SABRELITE U-Boot > sf write 0x10800000 0 0x40000 |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 55 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 56 | 4. Write the u-boot.imx produced during the U-Boot build to the SD card: |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 57 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 58 | sudo dd if=u-boot.imx of=/dev/sXx bs=512 seek=2 && sudo sync |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 59 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 60 | Note: Replace sXx with the device representing the SD card in your system. |
| 61 | |
| 62 | 5. Re-insert the SD card back in the slot for the large SD card and power-cycle |
| 63 | the board. |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 64 | |
| 65 | Note: The board now boots from full size SD3 on the bottom of the board. NOT |
| 66 | the micro SD4/BOOT slot on the top of the board. I.e. you have to use |
| 67 | full size SD cards. |
| 68 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 69 | This information originally taken from: |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 70 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 71 | https://wiki.linaro.org/Boards/MX6QSabreLite |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 72 | |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 73 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 74 | 3. Boot from SPI NOR |
| 75 | -------------------- |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 76 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 77 | The SabreLite board can also boot U-Boot directly from the SPI NOR flash: |
| 78 | |
| 79 | 1. Power-up the SabreLite, press 'space' to enter command mode in the U-Boot |
| 80 | and enter the following commands: |
| 81 | |
| 82 | => mmc dev 0 |
| 83 | => mmc read 0x10800000 0x400 0x80000 |
| 84 | => sf probe 0 |
| 85 | => sf erase 0 0xc0000 |
| 86 | => sf write 0x10800000 0x400 0x80000 |
| 87 | |
| 88 | Note: This procedure assumes you have booted using the desired U-Boot from an |
| 89 | SD card as prepared in the previous section. Alternative mechanisms, such |
| 90 | as using tftpboot to copy an alternative U-Boot image into memory can |
| 91 | also be used. |
| 92 | |
| 93 | |
| 94 | 4. Recovering SPI-NOR |
| 95 | --------------------- |
| 96 | |
| 97 | In case you somehow do not succeed with this procedure you can upload U-Boot |
| 98 | via USB: |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 99 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 100 | 1. Download and install the imx_loader following the instructions provided: |
Jason Liu | 0238468 | 2011-12-29 06:34:19 +0000 | [diff] [blame] | 101 | |
Martyn Welch | eec42b5 | 2019-02-22 19:05:48 +0000 | [diff] [blame] | 102 | https://github.com/boundarydevices/imx_usb_loader |
| 103 | |
| 104 | 2. Connect the board to USB via the USB OTG port. |
| 105 | |
| 106 | 3. Make sure SW1 switch is at position "01", so that it can boot from USB OTG. |
| 107 | |
| 108 | 4. Power-up the SabreLite and run the imx_loader to upload the U-Boot image: |
| 109 | |
| 110 | sudo imx_usb u-boot.imx |
| 111 | |
| 112 | Note: This will upload and run the U-Boot image in memory, the SPI will not be |
| 113 | reprogrammed and this procedure will need to be repeated if the board is |
| 114 | reset. |
| 115 | |
| 116 | 5. Use one of previous descriptions to re-flash the SPI-NOR as required. |
| 117 | |
| 118 | 6. Ensure SW1 is returned to "00" to boot from the fuses once done. |