Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 1 | How to use and build U-Boot on mx6sabresd |
| 2 | ----------------------------------------- |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 3 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 4 | The following methods can be used for booting mx6sabresd boards: |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 5 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 6 | 1. Booting from SD card |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 7 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 8 | 2. Booting from eMMC |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 9 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 10 | 3. Booting via Falcon mode (SPL launches the kernel directly) |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 11 | |
Breno Lima | 0d0dc39 | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 12 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 13 | 1. Booting from SD card via SPL |
| 14 | ------------------------------- |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 15 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 16 | mx6sabresd_defconfig target supports mx6q/mx6dl/mx6qp sabresd variants. |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 17 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 18 | In order to build it: |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 19 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 20 | $ make mx6sabresd_defconfig |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 21 | |
| 22 | $ make |
| 23 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 24 | This will generate the SPL and u-boot.img binaries. |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 25 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 26 | - Flash the SPL binary into the SD card: |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 27 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 28 | $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 29 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 30 | - Flash the u-boot.img binary into the SD card: |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 31 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 32 | $ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync |
Breno Lima | 0d0dc39 | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 33 | |
Breno Lima | 0d0dc39 | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 34 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 35 | 2. Booting from eMMC |
| 36 | -------------------- |
Breno Lima | 0d0dc39 | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 37 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 38 | $ make mx6sabresd_defconfig |
Breno Lima | 0d0dc39 | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 39 | |
| 40 | $ make |
| 41 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 42 | This will generate the SPL and u-boot.img binaries. |
Breno Lima | 0d0dc39 | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 43 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 44 | - Boot first from SD card as shown in the previous section |
Breno Lima | 0d0dc39 | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 45 | |
| 46 | In U-boot change the eMMC partition config: |
| 47 | |
| 48 | => mmc partconf 2 1 0 0 |
| 49 | |
| 50 | Mount the eMMC in the host PC: |
| 51 | |
| 52 | => ums 0 mmc 2 |
| 53 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 54 | - Flash SPL and u-boot.img binaries into the eMMC: |
Breno Lima | 0d0dc39 | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 55 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 56 | $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync |
| 57 | $ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync |
Breno Lima | 0d0dc39 | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 58 | |
| 59 | Set SW6 to eMMC 8-bit boot: 11010110 |
| 60 | |
| 61 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 62 | 3. Booting via Falcon mode |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 63 | -------------------------- |
| 64 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 65 | $ make mx6sabresd_defconfig |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 66 | $ make |
| 67 | |
| 68 | This will generate the SPL image called SPL and the u-boot.img. |
| 69 | |
| 70 | - Flash the SPL image into the SD card: |
| 71 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 72 | $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 oflag=sync status=none && sync |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 73 | |
| 74 | - Flash the u-boot.img image into the SD card: |
| 75 | |
Fabio Estevam | dcb43ac | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 76 | $ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 oflag=sync status=none && sync |
Diego Dorta | 20af96a | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 77 | |
| 78 | Create a partition for root file system and extract it there: |
| 79 | |
| 80 | $ sudo tar xvf rootfs.tar.gz -C /media/root |
| 81 | |
| 82 | The SD card must have enough space for raw "args" and "kernel". |
| 83 | To configure Falcon mode for the first time, on U-Boot do the following commands: |
| 84 | |
| 85 | - Setup the IP server: |
| 86 | |
| 87 | # setenv serverip <server_ip_address> |
| 88 | |
| 89 | - Download dtb file: |
| 90 | |
| 91 | # dhcp ${fdt_addr} imx6q-sabresd.dtb |
| 92 | |
| 93 | - Download kernel image: |
| 94 | |
| 95 | # dhcp ${loadaddr} uImage |
| 96 | |
| 97 | - Write kernel at 2MB offset: |
| 98 | |
| 99 | # mmc write ${loadaddr} 0x1000 0x4000 |
| 100 | |
| 101 | - Setup kernel bootargs: |
| 102 | |
| 103 | # setenv bootargs "console=ttymxc0,115200 root=/dev/mmcblk1p1 rootfstype=ext4 rootwait quiet rw" |
| 104 | |
| 105 | - Prepare args: |
| 106 | |
| 107 | # spl export fdt ${loadaddr} - ${fdt_addr} |
| 108 | |
| 109 | - Write args 1MB data (0x800 sectors) to 1MB offset (0x800 sectors) |
| 110 | |
| 111 | # mmc write 18000000 0x800 0x800 |
| 112 | |
| 113 | - Press KEY_VOL_UP key, power up the board and then SPL binary will |
| 114 | launch the kernel directly. |