Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 1 | U-Boot port for Texas Instruments Keystone II EVM boards |
| 2 | ======================================================== |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 3 | |
| 4 | Author: Murali Karicheri <m-karicheri2@ti.com> |
| 5 | |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 6 | This README has information on the U-Boot port for K2HK, K2E, and K2L EVM boards. |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 7 | Documentation for this board can be found at |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 8 | http://www.advantech.com/Support/TI-EVM/EVMK2HX_sd.aspx |
| 9 | https://www.einfochips.com/index.php/partnerships/texas-instruments/k2e-evm.html |
Khoronzhuk, Ivan | 4de96c7 | 2014-10-29 13:21:22 +0200 | [diff] [blame] | 10 | https://www.einfochips.com/index.php/partnerships/texas-instruments/k2l-evm.html |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 11 | |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 12 | The K2HK board is based on Texas Instruments Keystone2 family of SoCs: K2H, K2K. |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 13 | More details on these SoCs are available at company websites |
| 14 | K2K: http://www.ti.com/product/tci6638k2k |
| 15 | K2H: http://www.ti.com/product/tci6638k2h |
| 16 | |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 17 | The K2E SoC details are available at |
Khoronzhuk, Ivan | 4de96c7 | 2014-10-29 13:21:22 +0200 | [diff] [blame] | 18 | http://www.ti.com/lit/ds/symlink/66ak2e05.pdf |
| 19 | |
| 20 | The K2L SoC details are available at |
| 21 | http://www.ti.com/lit/ds/symlink/tci6630k2l.pdf |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 22 | |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 23 | The K2G SoC details are available at |
| 24 | http://www.ti.com/lit/ds/symlink/66ak2g02.pdf |
| 25 | |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 26 | Board configuration: |
| 27 | ==================== |
| 28 | |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 29 | Some of the peripherals that are configured by U-Boot |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 30 | +------+-------+-------+-----------+-----------+-------+-------+----+ |
| 31 | | |DDR3 |NAND |MSM SRAM |ETH ports |UART |I2C |SPI | |
| 32 | +------+-------+-------+-----------+-----------+-------+-------+----+ |
| 33 | |K2HK |2 |512MB |6MB |4(2) |2 |3 |3 | |
| 34 | |K2E |4 |512MB |2MB |8(2) |2 |3 |3 | |
Khoronzhuk, Ivan | 4de96c7 | 2014-10-29 13:21:22 +0200 | [diff] [blame] | 35 | |K2L |2 |512MB |2MB |4(2) |4 |3 |3 | |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 36 | |K2G |2 |256MB |1MB |1 |1 |1 |1 | |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 37 | +------+-------+-------+-----------+-----------+-------+-------+----+ |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 38 | |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 39 | There are only 2 eth port installed on the boards. |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 40 | |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 41 | There are separate PLLs to drive clocks to Tetris ARM and Peripherals. |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 42 | To bring up SMP Linux on this board, there is a boot monitor |
| 43 | code that will be installed in MSMC SRAM. There is command available |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 44 | to install this image from U-Boot. |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 45 | |
| 46 | The port related files can be found at following folders |
| 47 | keystone2 SoC related files: arch/arm/cpu/armv7/keystone/ |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 48 | EVMs board files: board/ti/k2s_evm/ |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 49 | |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 50 | Board configuration files: |
| 51 | include/configs/k2hk_evm.h |
| 52 | include/configs/k2e_evm.h |
Khoronzhuk, Ivan | 4de96c7 | 2014-10-29 13:21:22 +0200 | [diff] [blame] | 53 | include/configs/k2l_evm.h |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 54 | include/configs/k2g_evm.h |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 55 | |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 56 | As U-Boot is migrating to Kconfig there is also board defconfig files |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 57 | configs/k2e_evm_defconfig |
| 58 | configs/k2hk_evm_defconfig |
Khoronzhuk, Ivan | 4de96c7 | 2014-10-29 13:21:22 +0200 | [diff] [blame] | 59 | configs/k2l_evm_defconfig |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 60 | configs/k2g_evm_defconfig |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 61 | |
| 62 | Supported boot modes: |
| 63 | - SPI NOR boot |
Cooper Jr., Franklin | b7695c0 | 2017-08-09 21:29:22 -0500 | [diff] [blame] | 64 | - AEMIF NAND boot (K2E, K2L and K2HK) |
Lokesh Vutla | be8ce70 | 2015-08-17 19:54:52 +0530 | [diff] [blame] | 65 | - UART boot |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 66 | - MMC boot (Only on K2G) |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 67 | |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 68 | Supported image formats: |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 69 | - u-boot.bin: for loading and running u-boot.bin through |
Lokesh Vutla | 1985abe | 2015-09-19 15:00:23 +0530 | [diff] [blame] | 70 | Texas Instruments code composure studio (CCS) and for UART boot. |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 71 | - u-boot-spi.gph: gpimage for programming SPI NOR flash for SPI NOR boot |
Cooper Jr., Franklin | b7695c0 | 2017-08-09 21:29:22 -0500 | [diff] [blame] | 72 | - MLO: gpimage for programming NAND flash for NAND boot, MMC boot. |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 73 | |
| 74 | Build instructions: |
| 75 | =================== |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 76 | Examples for k2hk, for k2e, k2l and k2g just replace k2hk prefix accordingly. |
Tom Rini | 8971358 | 2020-05-26 14:36:52 -0400 | [diff] [blame] | 77 | Don't forget to add CROSS_COMPILE. |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 78 | |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 79 | To build u-boot.bin, u-boot-spi.gph, MLO: |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 80 | >make k2hk_evm_defconfig |
Lokesh Vutla | be8ce70 | 2015-08-17 19:54:52 +0530 | [diff] [blame] | 81 | >make |
Khoronzhuk, Ivan | c6ac7e3 | 2014-07-04 15:03:27 +0300 | [diff] [blame] | 82 | |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 83 | Load and Run U-Boot on keystone EVMs using CCS |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 84 | ========================================= |
| 85 | |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 86 | Need Code Composer Studio (CCS) installed on a PC to load and run u-boot.bin |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 87 | on EVM. See instructions at below link for installing CCS on a Windows PC. |
| 88 | http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Getting_Started# |
| 89 | Installing_Code_Composer_Studio |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 90 | Use u-boot.bin from the build folder for loading and running U-Boot binary |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 91 | on EVM. Follow instructions at |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 92 | K2HK http://processors.wiki.ti.com/index.php/EVMK2H_Hardware_Setup |
| 93 | K2E http://processors.wiki.ti.com/index.php/EVMK2E_Hardware_Setup |
Khoronzhuk, Ivan | 4de96c7 | 2014-10-29 13:21:22 +0200 | [diff] [blame] | 94 | K2L http://processors.wiki.ti.com/index.php/TCIEVMK2L_Hardware_Setup |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 95 | K2G http://processors.wiki.ti.com/index.php/66AK2G02_GP_EVM_Hardware_Setup |
Khoronzhuk, Ivan | 4de96c7 | 2014-10-29 13:21:22 +0200 | [diff] [blame] | 96 | |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 97 | to configure SW1 dip switch to use "No Boot/JTAG DSP Little Endian Boot Mode" |
| 98 | and Power ON the EVM. Follow instructions to connect serial port of EVM to |
| 99 | PC and start TeraTerm or Hyper Terminal. |
| 100 | |
| 101 | Start CCS on a Windows machine and Launch Target |
| 102 | configuration as instructed at http://processors.wiki.ti.com/index.php/ |
| 103 | MCSDK_UG_Chapter_Exploring#Loading_and_Running_U-Boot_on_EVM_through_CCS. |
| 104 | The instructions provided in the above link uses a script for |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 105 | loading the U-Boot binary on the target EVM. Instead do the following:- |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 106 | |
| 107 | 1. Right click to "Texas Instruments XDS2xx USB Emulator_0/CortexA15_1 core (D |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 108 | is connected: Unknown)" at the debug window (This is created once Target |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 109 | configuration is launched) and select "Connect Target". |
| 110 | 2. Once target connect is successful, choose Tools->Load Memory option from the |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 111 | top level menu. At the Load Memory window, choose the file u-boot.bin |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 112 | through "Browse" button and click "next >" button. In the next window, enter |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 113 | Start address as 0xc000000, choose Type-size "32 bits" and click "Finish" |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 114 | button. |
| 115 | 3. Click View -> Registers from the top level menu to view registers window. |
| 116 | 4. From Registers, window expand "Core Registers" to view PC. Edit PC value |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 117 | to be 0xc000000. From the "Run" top level menu, select "Free Run" |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 118 | 5. The U-Boot prompt is shown at the Tera Term/ Hyper terminal console as |
| 119 | below and type any key to stop autoboot as instructed := |
| 120 | |
| 121 | U-Boot 2014.04-rc1-00201-gc215b5a (Mar 21 2014 - 12:47:59) |
| 122 | |
| 123 | I2C: ready |
| 124 | Detected SO-DIMM [SQR-SD3T-2G1333SED] |
| 125 | DRAM: 1.1 GiB |
| 126 | NAND: 512 MiB |
| 127 | Net: K2HK_EMAC |
| 128 | Warning: K2HK_EMAC using MAC address from net device |
| 129 | , K2HK_EMAC1, K2HK_EMAC2, K2HK_EMAC3 |
| 130 | Hit any key to stop autoboot: 0 |
| 131 | |
| 132 | SPI NOR Flash programming instructions |
| 133 | ====================================== |
| 134 | U-Boot image can be flashed to first 512KB of the NOR flash using following |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 135 | instructions: |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 136 | |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 137 | 1. Start CCS and run U-Boot as described above. |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 138 | 2. Suspend Target. Select Run -> Suspend from top level menu |
| 139 | CortexA15_1 (Free Running)" |
| 140 | 3. Load u-boot-spi.gph binary from build folder on to DDR address 0x87000000 |
Khoronzhuk, Ivan | 4de96c7 | 2014-10-29 13:21:22 +0200 | [diff] [blame] | 141 | through CCS as described in step 2 of "Load and Run U-Boot on K2HK/K2E/K2L |
| 142 | EVM using CCS", but using address 0x87000000. |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 143 | 4. Free Run the target as described earlier (step 4) to get U-Boot prompt |
| 144 | 5. At the U-Boot console type following to setup U-Boot environment variables. |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 145 | setenv addr_uboot 0x87000000 |
| 146 | setenv filesize <size in hex of u-boot-spi.gph rounded to hex 0x10000> |
Khoronzhuk, Ivan | c6ac7e3 | 2014-07-04 15:03:27 +0300 | [diff] [blame] | 147 | run burn_uboot_spi |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 148 | Once U-Boot prompt is available, Power OFF the EVM. Set the SW1 dip switch |
Vitaly Andrianov | ef509b9 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 149 | to "SPI Little Endian Boot mode" as per instruction at |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 150 | http://processors.wiki.ti.com/index.php/*_Hardware_Setup. |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 151 | 6. Power ON the EVM. The EVM now boots with U-Boot image on the NOR flash. |
Khoronzhuk, Ivan | c6ac7e3 | 2014-07-04 15:03:27 +0300 | [diff] [blame] | 152 | |
| 153 | AEMIF NAND Flash programming instructions |
| 154 | ====================================== |
| 155 | U-Boot image can be flashed to first 1024KB of the NAND flash using following |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 156 | instructions: |
Khoronzhuk, Ivan | c6ac7e3 | 2014-07-04 15:03:27 +0300 | [diff] [blame] | 157 | |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 158 | 1. Start CCS and run U-Boot as described above. |
Khoronzhuk, Ivan | c6ac7e3 | 2014-07-04 15:03:27 +0300 | [diff] [blame] | 159 | 2. Suspend Target. Select Run -> Suspend from top level menu |
| 160 | CortexA15_1 (Free Running)" |
Lokesh Vutla | 5f586e9 | 2015-08-17 19:54:50 +0530 | [diff] [blame] | 161 | 3. Load MLO binary from build folder on to DDR address 0x87000000 |
Khoronzhuk, Ivan | c6ac7e3 | 2014-07-04 15:03:27 +0300 | [diff] [blame] | 162 | through CCS as described in step 2 of "Load and Run U-Boot on K2HK EVM |
| 163 | using CCS", but using address 0x87000000. |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 164 | 4. Free Run the target as described earlier (step 4) to get U-Boot prompt |
| 165 | 5. At the U-Boot console type following to setup U-Boot environment variables. |
Lokesh Vutla | 5f586e9 | 2015-08-17 19:54:50 +0530 | [diff] [blame] | 166 | setenv filesize <size in hex of MLO rounded to hex 0x10000> |
Khoronzhuk, Ivan | c6ac7e3 | 2014-07-04 15:03:27 +0300 | [diff] [blame] | 167 | run burn_uboot_nand |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 168 | Once U-Boot prompt is available, Power OFF the EVM. Set the SW1 dip switch |
Khoronzhuk, Ivan | c6ac7e3 | 2014-07-04 15:03:27 +0300 | [diff] [blame] | 169 | to "ARM NAND Boot mode" as per instruction at |
Khoronzhuk, Ivan | a79c911 | 2014-10-09 22:21:14 +0300 | [diff] [blame] | 170 | http://processors.wiki.ti.com/index.php/*_Hardware_Setup. |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 171 | 6. Power ON the EVM. The EVM now boots with U-Boot image on the NAND flash. |
Lokesh Vutla | be8ce70 | 2015-08-17 19:54:52 +0530 | [diff] [blame] | 172 | |
| 173 | Load and Run U-Boot on keystone EVMs using UART download |
| 174 | ======================================================== |
| 175 | |
| 176 | Open BMC and regular UART terminals. |
| 177 | |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 178 | 1. On the regular UART port start xmodem transfer of the u-boot.bin |
Lokesh Vutla | be8ce70 | 2015-08-17 19:54:52 +0530 | [diff] [blame] | 179 | 2. Using BMC terminal set the ARM-UART bootmode and reboot the EVM |
| 180 | BMC> bootmode #4 |
| 181 | MBC> reboot |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 182 | 3. When xmodem is complete you should see the U-Boot starts on the UART port |
Lokesh Vutla | 01c5075 | 2016-09-06 09:10:37 +0530 | [diff] [blame] | 183 | |
| 184 | Load and Run U-Boot on K2G EVMs using MMC |
| 185 | ======================================================== |
| 186 | |
| 187 | Open BMC and regular UART terminals. |
| 188 | |
| 189 | 1. Set the SW3 dip switch to "ARM MMC Boot mode" as per instruction at |
| 190 | http://processors.wiki.ti.com/index.php/66AK2G02_GP_EVM_Hardware_Setup |
| 191 | 2. Create SD card partitions as per steps given in Hardware Setup Guide. |
| 192 | 3. Copy MLO to Boot Partition. |
| 193 | 4. Insert SD card and Power on the EVM. |
| 194 | The EVM now boots with U-Boot image from SD card. |