Wadim Egorov | 1edb098 | 2024-02-28 09:42:17 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | .. sectionauthor:: Wadim Egorov <w.egorov@phytec.de> |
| 3 | |
| 4 | phyCORE-AM64x |
| 5 | ============= |
| 6 | |
| 7 | The `phyCORE-AM64x <https://www.phytec.com/product/phycore-am64x>`_ is a |
| 8 | SoM (System on Module) featuring TI's AM64x 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 AM64x family. |
| 11 | |
Daniel Schultz | ed33d89 | 2024-06-12 09:16:39 -0700 | [diff] [blame] | 12 | A development Kit, called `phyBOARD-Electra <https://www.phytec.com/product/phyboard-am64x>`_ |
Wadim Egorov | 1edb098 | 2024-02-28 09:42:17 +0100 | [diff] [blame] | 13 | is used as a carrier board reference design around the AM64x 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_sysfw |
| 35 | :end-before: .. k3_rst_include_end_boot_firmwares_sysfw |
| 36 | |
Wadim Egorov | 1edb098 | 2024-02-28 09:42:17 +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_am64x_r5_defconfig |
| 58 | $ export UBOOT_CFG_CORTEXA=phycore_am64x_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-am64x |
| 63 | # we don't use any extra OPTEE parameters |
| 64 | unset OPTEE_EXTRA_ARGS |
| 65 | |
| 66 | .. include:: ../ti/am62x_sk.rst |
| 67 | :start-after: .. am62x_evm_rst_include_start_build_steps |
| 68 | :end-before: .. am62x_evm_rst_include_end_build_steps |
| 69 | |
| 70 | uSD Card creation |
| 71 | ----------------- |
| 72 | |
| 73 | Use fdisk to partition the uSD card. The layout should look similar to: |
| 74 | |
| 75 | .. code-block:: bash |
| 76 | |
| 77 | $ sudo fdisk -l /dev/mmcblk0 |
| 78 | Disk /dev/mmcblk0: 7.56 GiB, 8120172544 bytes, 15859712 sectors |
| 79 | Units: sectors of 1 * 512 = 512 bytes |
| 80 | Sector size (logical/physical): 512 bytes / 512 bytes |
| 81 | I/O size (minimum/optimal): 512 bytes / 512 bytes |
| 82 | Disklabel type: dos |
| 83 | Disk identifier: 0x6583d9a3 |
| 84 | |
| 85 | Device Boot Start End Sectors Size Id Type |
| 86 | /dev/mmcblk0p1 * 2048 264191 262144 128M c W95 FAT32 (LBA) |
| 87 | /dev/mmcblk0p2 264192 1934953 1670762 815.8M 83 Linux |
| 88 | |
| 89 | |
| 90 | Once partitioned, the boot partition has to be formatted with a FAT filesystem. |
| 91 | Assuming the uSD card is `/dev/mmcblk0`: |
| 92 | |
| 93 | .. code-block:: bash |
| 94 | |
| 95 | $ mkfs.vfat /dev/mmcblk0p1 |
| 96 | |
| 97 | To boot from a micro SD card on a HSFS device simply copy the following |
| 98 | artifacts to the FAT partition: |
| 99 | |
| 100 | * tiboot3.bin from R5 build |
| 101 | * tispl.bin from Cortex-A build |
| 102 | * u-boot.img from Cortex-A build |
| 103 | |
| 104 | Boot |
| 105 | ---- |
| 106 | |
| 107 | Put the uSD card in the slot on the board and apply power. Check the serial |
| 108 | console for output. |
| 109 | |
| 110 | Flash to SPI NOR |
| 111 | ---------------- |
| 112 | |
| 113 | Below commands can be used to flash the SPI NOR flash; assuming |
| 114 | tiboot3.bin, tispl.bin and u-boot.img are stored on the uSD card. |
| 115 | |
| 116 | .. code-block:: bash |
| 117 | |
Wadim Egorov | ca526a9 | 2024-06-10 15:33:51 +0200 | [diff] [blame] | 118 | mtd list |
Wadim Egorov | 1edb098 | 2024-02-28 09:42:17 +0100 | [diff] [blame] | 119 | fatload mmc 1 ${loadaddr} tiboot3.bin |
Wadim Egorov | ca526a9 | 2024-06-10 15:33:51 +0200 | [diff] [blame] | 120 | mtd write ospi.tiboot3 ${loadaddr} 0 ${filesize} |
Wadim Egorov | 1edb098 | 2024-02-28 09:42:17 +0100 | [diff] [blame] | 121 | fatload mmc 1 ${loadaddr} tispl.bin |
Wadim Egorov | ca526a9 | 2024-06-10 15:33:51 +0200 | [diff] [blame] | 122 | mtd write ospi.tispl ${loadaddr} 0 ${filesize} |
Wadim Egorov | 1edb098 | 2024-02-28 09:42:17 +0100 | [diff] [blame] | 123 | fatload mmc 1 ${loadaddr} u-boot.img |
Wadim Egorov | ca526a9 | 2024-06-10 15:33:51 +0200 | [diff] [blame] | 124 | mtd write ospi.u-boot ${loadaddr} 0 ${filesize} |
Wadim Egorov | 1edb098 | 2024-02-28 09:42:17 +0100 | [diff] [blame] | 125 | |
Wadim Egorov | 151d965 | 2024-06-20 14:05:54 +0200 | [diff] [blame] | 126 | UART based boot |
| 127 | --------------- |
| 128 | |
| 129 | To boot the board via UART, set the switches to UART mode and connect to the |
| 130 | micro USB port labeled as "Debug UART". After power-on the build artifacts |
| 131 | needs to be uploaded one by one with a tool like sz. |
| 132 | |
| 133 | Example bash script sequence for running on a Linux host PC feeding all boot |
| 134 | artifacts needed to the device. Assuming the host uses /dev/ttyUSB0 as |
| 135 | the main domain serial port: |
| 136 | |
| 137 | .. prompt:: bash $ |
| 138 | |
| 139 | stty -F /dev/ttyUSB0 115200 |
| 140 | sb --xmodem tiboot3.bin > /dev/ttyUSB0 < /dev/ttyUSB0 |
| 141 | # Resend tiboot3.bin a 2nd time due to ErrataID:i2331 |
| 142 | sb --xmodem tiboot3.bin > /dev/ttyUSB0 < /dev/ttyUSB0 |
| 143 | sb --ymodem tispl.bin > /dev/ttyUSB0 < /dev/ttyUSB0 |
| 144 | sb --ymodem u-boot.img > /dev/ttyUSB0 < /dev/ttyUSB0 |
Wadim Egorov | 1edb098 | 2024-02-28 09:42:17 +0100 | [diff] [blame] | 145 | |
| 146 | Boot Modes |
| 147 | ---------- |
| 148 | |
| 149 | The phyCORE-AM64x development kit supports booting from many different |
| 150 | interfaces. By default, the development kit is set to boot from the micro-SD |
| 151 | card. To change the boot device, DIP switches S5 and S6 can be used. |
| 152 | Boot switches should be changed with power off. |
| 153 | |
| 154 | .. list-table:: Boot Modes |
| 155 | :widths: 16 16 16 |
| 156 | :header-rows: 1 |
| 157 | |
| 158 | * - Switch Label |
| 159 | - SW3: 12345678 |
| 160 | - SW4: 12345678 |
| 161 | |
| 162 | * - uSD |
| 163 | - 11000010 |
| 164 | - 01000000 |
| 165 | |
| 166 | * - eMMC |
| 167 | - 11010010 |
| 168 | - 00000000 |
| 169 | |
| 170 | * - OSPI |
| 171 | - 11010000 |
| 172 | - 10000000 |
| 173 | |
| 174 | * - UART |
| 175 | - 11011100 |
| 176 | - 00000000 |
| 177 | |
| 178 | Further Information |
| 179 | ------------------- |
| 180 | |
| 181 | Please see :doc:`../ti/am64x_evm` chapter for further AM64 SoC related documentation |
Daniel Schultz | a2fca42 | 2024-06-12 09:16:38 -0700 | [diff] [blame] | 182 | and https://docs.phytec.com/projects/yocto-phycore-am64x/en/latest/ for vendor documentation. |