Wadim Egorov | 12722a4 | 2023-12-20 10:18:11 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | .. sectionauthor:: Wadim Egorov <w.egorov@phytec.de> |
| 3 | |
| 4 | phyCORE-AM62x |
| 5 | ============= |
| 6 | |
| 7 | The `phyCORE-AM62x <https://www.phytec.com/product/phycore-am62x>`_ is a |
| 8 | SoM (System on Module) featuring TI's AM62x SoC. It can be used in combination |
| 9 | with different carrier boards. This module can come with different sizes and |
| 10 | models for DDR, eMMC, SPI NOR Flash and various SoCs from the AM62x family. |
| 11 | |
| 12 | A development Kit, called `phyBOARD-Lyra <https://www.phytec.com/product/phyboard-am62x>`_ |
| 13 | is used as a carrier board reference design around the AM62x SoM. |
| 14 | |
| 15 | Quickstart |
| 16 | ---------- |
| 17 | |
| 18 | * Download sources and TI firmware blobs |
| 19 | * Build Trusted Firmware-A |
| 20 | * Build OP-TEE |
| 21 | * Build U-Boot for the R5 |
| 22 | * Build U-Boot for the A53 |
| 23 | * Create bootable uSD Card |
| 24 | * Boot |
| 25 | |
| 26 | Sources |
| 27 | ------- |
| 28 | |
| 29 | .. include:: ../ti/k3.rst |
| 30 | :start-after: .. k3_rst_include_start_boot_sources |
| 31 | :end-before: .. k3_rst_include_end_boot_sources |
| 32 | |
Dhruva Gole | 26e0ddf | 2024-08-05 19:59:33 +0530 | [diff] [blame] | 33 | .. include:: ../ti/k3.rst |
| 34 | :start-after: .. k3_rst_include_start_boot_firmwares |
Dhruva Gole | e236a92 | 2024-08-05 19:59:37 +0530 | [diff] [blame] | 35 | :end-before: .. k3_rst_include_end_tifsstub |
Dhruva Gole | 26e0ddf | 2024-08-05 19:59:33 +0530 | [diff] [blame] | 36 | |
Wadim Egorov | 12722a4 | 2023-12-20 10:18:11 +0100 | [diff] [blame] | 37 | Build procedure |
| 38 | --------------- |
| 39 | |
| 40 | Setup the environment variables: |
| 41 | |
| 42 | .. include:: ../ti/k3.rst |
| 43 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 44 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
| 45 | |
| 46 | .. include:: ../ti/k3.rst |
| 47 | :start-after: .. k3_rst_include_start_board_env_vars_desc |
| 48 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
| 49 | |
| 50 | Set the variables corresponding to this platform: |
| 51 | |
| 52 | .. include:: ../ti/k3.rst |
| 53 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 54 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
| 55 | .. code-block:: bash |
| 56 | |
| 57 | $ export UBOOT_CFG_CORTEXR=phycore_am62x_r5_defconfig |
| 58 | $ export UBOOT_CFG_CORTEXA=phycore_am62x_a53_defconfig |
| 59 | $ export TFA_BOARD=lite |
| 60 | $ # we don't use any extra TFA parameters |
| 61 | $ unset TFA_EXTRA_ARGS |
| 62 | $ export OPTEE_PLATFORM=k3-am62x |
| 63 | $ export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y" |
| 64 | |
| 65 | .. include:: ../ti/am62x_sk.rst |
| 66 | :start-after: .. am62x_evm_rst_include_start_build_steps |
| 67 | :end-before: .. am62x_evm_rst_include_end_build_steps |
| 68 | |
| 69 | uSD Card creation |
| 70 | ----------------- |
| 71 | |
| 72 | Use fdisk to partition the uSD card. The layout should look similar to: |
| 73 | |
| 74 | .. code-block:: bash |
| 75 | |
| 76 | $ sudo fdisk -l /dev/mmcblk0 |
| 77 | Disk /dev/mmcblk0: 7.56 GiB, 8120172544 bytes, 15859712 sectors |
| 78 | Units: sectors of 1 * 512 = 512 bytes |
| 79 | Sector size (logical/physical): 512 bytes / 512 bytes |
| 80 | I/O size (minimum/optimal): 512 bytes / 512 bytes |
| 81 | Disklabel type: dos |
| 82 | Disk identifier: 0x6583d9a3 |
| 83 | |
| 84 | Device Boot Start End Sectors Size Id Type |
| 85 | /dev/mmcblk0p1 * 2048 264191 262144 128M c W95 FAT32 (LBA) |
| 86 | /dev/mmcblk0p2 264192 1934953 1670762 815.8M 83 Linux |
| 87 | |
| 88 | |
| 89 | Once partitioned, the boot partition has to be formatted with a FAT filesystem. |
| 90 | Assuming the uSD card is `/dev/mmcblk0`: |
| 91 | |
| 92 | .. code-block:: bash |
| 93 | |
| 94 | $ mkfs.vfat /dev/mmcblk0p1 |
| 95 | |
| 96 | To boot from a micro SD card on a HSFS device simply copy the following |
| 97 | artifacts to the FAT partition: |
| 98 | |
Wadim Egorov | 93133d2 | 2024-02-28 09:58:48 +0100 | [diff] [blame] | 99 | * tiboot3.bin from R5 build |
| 100 | * tispl.bin from Cortex-A build |
| 101 | * u-boot.img from Cortex-A build |
Wadim Egorov | 12722a4 | 2023-12-20 10:18:11 +0100 | [diff] [blame] | 102 | |
| 103 | Boot |
| 104 | ---- |
| 105 | |
| 106 | Put the uSD card in the slot on the board and apply power. Check the serial |
| 107 | console for output. |
| 108 | |
| 109 | Flash to SPI NOR |
| 110 | ---------------- |
| 111 | |
| 112 | Below commands can be used to flash the SPI NOR flash; assuming |
| 113 | tiboot3.bin, tispl.bin and u-boot.img are stored on the uSD card. |
| 114 | |
| 115 | .. code-block:: bash |
| 116 | |
Wadim Egorov | ca526a9 | 2024-06-10 15:33:51 +0200 | [diff] [blame] | 117 | mtd list |
Wadim Egorov | 12722a4 | 2023-12-20 10:18:11 +0100 | [diff] [blame] | 118 | fatload mmc 1 ${loadaddr} tiboot3.bin |
Wadim Egorov | ca526a9 | 2024-06-10 15:33:51 +0200 | [diff] [blame] | 119 | mtd write ospi.tiboot3 ${loadaddr} 0 ${filesize} |
Wadim Egorov | 12722a4 | 2023-12-20 10:18:11 +0100 | [diff] [blame] | 120 | fatload mmc 1 ${loadaddr} tispl.bin |
Wadim Egorov | ca526a9 | 2024-06-10 15:33:51 +0200 | [diff] [blame] | 121 | mtd write ospi.tispl ${loadaddr} 0 ${filesize} |
Wadim Egorov | 12722a4 | 2023-12-20 10:18:11 +0100 | [diff] [blame] | 122 | fatload mmc 1 ${loadaddr} u-boot.img |
Wadim Egorov | ca526a9 | 2024-06-10 15:33:51 +0200 | [diff] [blame] | 123 | mtd write ospi.u-boot ${loadaddr} 0 ${filesize} |
Wadim Egorov | 12722a4 | 2023-12-20 10:18:11 +0100 | [diff] [blame] | 124 | |
Wadim Egorov | 151d965 | 2024-06-20 14:05:54 +0200 | [diff] [blame] | 125 | UART based boot |
| 126 | --------------- |
| 127 | |
| 128 | To boot the board via UART, set the switches to UART mode and connect to the |
| 129 | micro USB port labeled as "Debug UART". After power-on the build artifacts |
| 130 | needs to be uploaded one by one with a tool like sz. |
| 131 | |
| 132 | Example bash script sequence for running on a Linux host PC feeding all boot |
| 133 | artifacts needed to the device. Assuming the host uses /dev/ttyUSB0 as |
| 134 | the main domain serial port: |
| 135 | |
| 136 | .. prompt:: bash $ |
| 137 | |
| 138 | stty -F /dev/ttyUSB0 115200 |
| 139 | sb --xmodem tiboot3.bin > /dev/ttyUSB0 < /dev/ttyUSB0 |
| 140 | sb --ymodem tispl.bin > /dev/ttyUSB0 < /dev/ttyUSB0 |
| 141 | sb --ymodem u-boot.img > /dev/ttyUSB0 < /dev/ttyUSB0 |
Wadim Egorov | 12722a4 | 2023-12-20 10:18:11 +0100 | [diff] [blame] | 142 | |
| 143 | Boot Modes |
| 144 | ---------- |
| 145 | |
| 146 | The phyCORE-AM62x development kit supports booting from many different |
| 147 | interfaces. By default, the development kit is set to boot from the micro-SD |
| 148 | card. To change the boot device, DIP switches S5 and S6 can be used. |
| 149 | Boot switches should be changed with power off. |
| 150 | |
| 151 | .. list-table:: Boot Modes |
| 152 | :widths: 16 16 16 |
| 153 | :header-rows: 1 |
| 154 | |
| 155 | * - Switch Label |
| 156 | - SW5: 12345678 |
| 157 | - SW6: 12345678 |
| 158 | |
| 159 | * - uSD |
| 160 | - 11000010 |
| 161 | - 01000000 |
| 162 | |
| 163 | * - eMMC |
| 164 | - 11010010 |
| 165 | - 00000000 |
| 166 | |
| 167 | * - OSPI |
| 168 | - 11010000 |
| 169 | - 10000000 |
| 170 | |
| 171 | * - UART |
| 172 | - 11011100 |
| 173 | - 00000000 |
| 174 | |
Wadim Egorov | 3425335 | 2024-06-10 15:33:50 +0200 | [diff] [blame] | 175 | * - USB DFU |
| 176 | - 11001010 |
| 177 | - 00100000 |
| 178 | |
Wadim Egorov | 12722a4 | 2023-12-20 10:18:11 +0100 | [diff] [blame] | 179 | Further Information |
| 180 | ------------------- |
| 181 | |
| 182 | Please see :doc:`../ti/am62x_sk` chapter for further AM62 SoC related documentation |
Daniel Schultz | 33136d5 | 2024-06-12 09:16:37 -0700 | [diff] [blame] | 183 | and https://docs.phytec.com/projects/yocto-phycore-am62x/en/latest/ for vendor documentation. |