Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 1 | How to use and build U-Boot on mx6sabresd |
Breno Lima | ce2f9de | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 2 | ----------------------------------------- |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 3 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 4 | The following methods can be used for booting mx6sabresd boards: |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 5 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 6 | 1. Booting from SD card |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 7 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 8 | 2. Booting from eMMC |
| 9 | |
| 10 | 3. Booting via Falcon mode (SPL launches the kernel directly) |
| 11 | |
| 12 | |
| 13 | 1. Booting from SD card via SPL |
| 14 | ------------------------------- |
| 15 | |
| 16 | mx6sabresd_defconfig target supports mx6q/mx6dl/mx6qp sabresd variants. |
| 17 | |
| 18 | In order to build it: |
| 19 | |
| 20 | $ make mx6sabresd_defconfig |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 21 | |
| 22 | $ make |
| 23 | |
Fabio Estevam | 6e2025b | 2019-02-26 09:36:06 -0300 | [diff] [blame] | 24 | This will generate the SPL and u-boot-dtb.img binaries. |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 25 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 26 | - Flash the SPL binary into the SD card: |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 27 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 28 | $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync |
| 29 | |
Fabio Estevam | 6e2025b | 2019-02-26 09:36:06 -0300 | [diff] [blame] | 30 | - Flash the u-boot-dtb.img binary into the SD card: |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 31 | |
Fabio Estevam | 6e2025b | 2019-02-26 09:36:06 -0300 | [diff] [blame] | 32 | $ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 && sync |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 33 | |
| 34 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 35 | 2. Booting from eMMC |
| 36 | -------------------- |
Breno Lima | ce2f9de | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 37 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 38 | $ make mx6sabresd_defconfig |
Breno Lima | ce2f9de | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 39 | |
| 40 | $ make |
| 41 | |
Fabio Estevam | 6e2025b | 2019-02-26 09:36:06 -0300 | [diff] [blame] | 42 | This will generate the SPL and u-boot-dtb.img binaries. |
Breno Lima | ce2f9de | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 43 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 44 | - Boot first from SD card as shown in the previous section |
Breno Lima | ce2f9de | 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 | 6e2025b | 2019-02-26 09:36:06 -0300 | [diff] [blame] | 54 | - Flash SPL and u-boot-dtb.img binaries into the eMMC: |
Breno Lima | ce2f9de | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 55 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 56 | $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync |
Fabio Estevam | 6e2025b | 2019-02-26 09:36:06 -0300 | [diff] [blame] | 57 | $ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 && sync |
Breno Lima | ce2f9de | 2017-04-10 09:45:29 -0300 | [diff] [blame] | 58 | |
| 59 | Set SW6 to eMMC 8-bit boot: 11010110 |
| 60 | |
| 61 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 62 | 3. Booting via Falcon mode |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 63 | -------------------------- |
| 64 | |
Fabio Estevam | 54d63bb | 2017-05-18 08:15:04 -0300 | [diff] [blame] | 65 | $ make mx6sabresd_defconfig |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 66 | $ make |
| 67 | |
Fabio Estevam | 6e2025b | 2019-02-26 09:36:06 -0300 | [diff] [blame] | 68 | This will generate the SPL image called SPL and the u-boot-dtb.img. |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 69 | |
| 70 | - Flash the SPL image into the SD card: |
| 71 | |
Fabio Estevam | 54d63bb | 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 | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 73 | |
Fabio Estevam | 6e2025b | 2019-02-26 09:36:06 -0300 | [diff] [blame] | 74 | - Flash the u-boot-dtb.img image into the SD card: |
Diego Dorta | 9cc3ad6 | 2016-10-11 11:09:28 -0300 | [diff] [blame] | 75 | |
Fabio Estevam | 6e2025b | 2019-02-26 09:36:06 -0300 | [diff] [blame] | 76 | $ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 oflag=sync status=none && sync |
Diego Dorta | 9cc3ad6 | 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. |