Nishanth Menon | e19fde5 | 2025-04-25 12:31:19 -0500 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
| 2 | .. sectionauthor:: Nishanth Menon <nm@ti.com> |
| 3 | |
| 4 | AM67A Beagleboard.org BeagleY-AI |
| 5 | ================================ |
| 6 | |
| 7 | Introduction: |
| 8 | ------------- |
| 9 | |
| 10 | BeagleBoard.org BeagleY-AI is an easy to use, affordable open source |
| 11 | hardware single board computer based on the Texas Instruments AM67A, |
| 12 | which features a quad-core 64-bit Arm CPU subsystem, 2 general-purpose |
| 13 | digital-signal-processors (DSP) and matrix-multiply-accelerators (MMA), |
| 14 | GPU, vision and deep learning accelerators, and multiple Arm Cortex-R5 |
| 15 | cores for low-power, low-latency GPIO control. |
| 16 | |
| 17 | Further information can be found at: |
| 18 | |
| 19 | * Product Page: https://beagley-ai.org/ |
| 20 | * Hardware documentation: https://openbeagle.org/beagley-ai/beagley-ai |
| 21 | |
| 22 | Boot Flow: |
| 23 | ---------- |
| 24 | Below is the pictorial representation of boot flow: |
| 25 | |
| 26 | .. image:: ../ti/img/boot_diagram_k3_current.svg |
| 27 | :alt: Boot flow diagram |
| 28 | |
| 29 | - On this platform, 'TI Foundational Security' (TIFS) functions as the |
| 30 | security enclave master while 'Device Manager' (DM), also known as the |
| 31 | 'TISCI server' in "TI terminology", offers all the essential services. |
| 32 | The A53 or R5F (Aux core) sends requests to TIFS/DM to accomplish these |
| 33 | services, as illustrated in the diagram above. |
| 34 | |
| 35 | Sources: |
| 36 | -------- |
| 37 | .. include:: ../ti/k3.rst |
| 38 | :start-after: .. k3_rst_include_start_boot_sources |
| 39 | :end-before: .. k3_rst_include_end_boot_sources |
| 40 | |
| 41 | .. include:: ../ti/k3.rst |
| 42 | :start-after: .. k3_rst_include_start_boot_firmwares |
| 43 | :end-before: .. k3_rst_include_end_tifsstub |
| 44 | |
| 45 | Build procedure: |
| 46 | ---------------- |
| 47 | 0. Setup the environment variables: |
| 48 | |
| 49 | .. include:: ../ti/k3.rst |
| 50 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 51 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
| 52 | |
| 53 | .. include:: ../ti/k3.rst |
| 54 | :start-after: .. k3_rst_include_start_board_env_vars_desc |
| 55 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
| 56 | |
| 57 | Set the variables corresponding to this platform: |
| 58 | |
| 59 | .. include:: ../ti/k3.rst |
| 60 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 61 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
| 62 | .. prompt:: bash $ |
| 63 | |
| 64 | export UBOOT_CFG_CORTEXR=am67a_beagley_ai_r5_defconfig |
| 65 | export UBOOT_CFG_CORTEXA=am67a_beagley_ai_a53_defconfig |
| 66 | export TFA_BOARD=lite |
| 67 | # we dont use any extra TFA parameters |
| 68 | unset TFA_EXTRA_ARGS |
| 69 | export OPTEE_PLATFORM=k3-am62x |
| 70 | |
| 71 | .. include:: ../ti/j722s_evm.rst |
| 72 | :start-after: .. j722s_evm_rst_include_start_build_steps |
| 73 | :end-before: .. j722s_evm_rst_include_end_build_steps |
| 74 | |
| 75 | Target Images |
| 76 | ------------- |
| 77 | Copy these images to an SD card and boot: |
| 78 | |
| 79 | * tiboot3-j722s-hs-fs-evm.bin from Cortex-R5 build as tiboot3.bin. |
| 80 | * tispl.bin and u-boot.img from Cortex-A build. |
| 81 | |
| 82 | Image formats |
| 83 | ------------- |
| 84 | |
| 85 | - tiboot3.bin |
| 86 | |
| 87 | .. image:: ../ti/img/multi_cert_tiboot3.bin.svg |
| 88 | :alt: tiboot3.bin image format |
| 89 | |
| 90 | - tispl.bin |
| 91 | |
| 92 | .. image:: ../ti/img/tifsstub_dm_tispl.bin.svg |
| 93 | :alt: tispl.bin image format |
| 94 | |
| 95 | Additional hardware for U-Boot development |
| 96 | ------------------------------------------ |
| 97 | |
| 98 | * Serial Console is critical for U-Boot development on BeagleY-AI. See |
| 99 | `BeagleY-AI serial console documentation |
| 100 | <https://docs.beagleboard.org/boards/beagley/ai/02-quick-start.html#beagley-ai-headless>`_. |
| 101 | * The only onboard storage option is uSD. |
| 102 | * (optionally) JTAG is useful when working with very early stages of boot. |
| 103 | |
| 104 | Flash to uSD card or how to deal with "bricked" Board |
| 105 | ----------------------------------------------------- |
| 106 | |
| 107 | The only storage option on the platform is uSD card. However, if you |
| 108 | choose to hand format your own bootable uSD card, be aware that it can |
| 109 | be difficult. The following information may be helpful, but remember |
| 110 | that it is only sometimes reliable, and partition options can cause |
| 111 | issues. These can potentially help: |
| 112 | |
| 113 | * https://git.ti.com/cgit/arago-project/tisdk-setup-scripts/tree/create-sdcard.sh |
| 114 | * https://elinux.org/Beagleboard:Expanding_File_System_Partition_On_A_microSD |
| 115 | * Or manually as follows (may not take into distro needs such as EFI or swap): |
| 116 | |
| 117 | .. prompt:: bash # |
| 118 | |
| 119 | # Create image with partition table |
| 120 | parted --script <SD CARD DEVICE> \ |
| 121 | mklabel msdos \ |
| 122 | mkpart primary fat16 4MiB 20MiB \ |
| 123 | mkpart primary ext4 20MiB 100% \ |
| 124 | set 1 boot on \ |
| 125 | set 1 bls_boot off \ |
| 126 | set 1 lba on |
| 127 | # Create boot partition |
| 128 | mkfs.vfat <SD CARD DEVICE>1 |
| 129 | # Create root partition |
| 130 | mkfs.ext4 <SD CARD DEVICE>2 |
| 131 | |
| 132 | The simplest option is to start with a standard distribution |
| 133 | image like those in `BeagleBoard.org Distros Page |
| 134 | <https://www.beagleboard.org/distros>`_ and download a disk image for |
| 135 | BeagleY-AI. Pick a 16GB+ uSD card to be on the safer side. |
| 136 | |
| 137 | With an SD/MMC Card reader and `Balena Etcher |
| 138 | <https://etcher.balena.io/>`_, having a functional setup in minutes is |
| 139 | a trivial matter, and it works on almost all Host Operating Systems. |
| 140 | Yes Windows users, Windows Subsystem for Linux(WSL) based development |
| 141 | with U-Boot and update uSD card is practical. |
| 142 | |
| 143 | Updating U-Boot is a matter of copying the tiboot3.bin, tispl.bin and |
| 144 | u-boot.img to the "BOOT" partition of the uSD card. Remember to sync |
| 145 | and unmount (or Eject - depending on the Operating System) the uSD |
| 146 | card prior to physically removing from SD card reader. |
| 147 | |
| 148 | .. note:: |
| 149 | Great news! If the board has not been damaged physically, there's no |
| 150 | need to worry about it being "bricked" on this platform. You only have |
| 151 | to flash an uSD card, plug it in. This means that even if you make a |
| 152 | mistake, you can quickly fix it and rest easy. |
| 153 | |
| 154 | If you are frequently working with uSD cards, you might find the |
| 155 | following useful: |
| 156 | |
| 157 | * `USB-SD-Mux <https://www.linux-automation.com/en/products/usb-sd-mux.html>`_ |
| 158 | * `SD-Wire <https://wiki.tizen.org/SDWire>`_ |
| 159 | |
| 160 | LED patterns during boot |
| 161 | ------------------------ |
| 162 | |
| 163 | .. list-table:: LED status indication as system boots up |
| 164 | :widths: 16 16 |
| 165 | :header-rows: 1 |
| 166 | |
| 167 | * - LED Color |
| 168 | - Indicates |
| 169 | |
| 170 | * - Only RED at startup |
| 171 | - Boot failure or R5 image not started up |
| 172 | |
| 173 | * - Steady Green |
| 174 | - A53 U-boot has started up |
| 175 | |
| 176 | * - Red/Orange |
| 177 | - OS boot process has been initiated |
| 178 | |
| 179 | * - Steady Green |
| 180 | - OS boot process failed and drops to U-Boot shell |
| 181 | |
| 182 | .. warning :: |
| 183 | |
| 184 | If the "red" power LED is not glowing, the system power supply is not |
| 185 | functional. Please refer to `BeagleY-AI documentation |
| 186 | <https://beagley-ai.org/>`_ for further information. |
| 187 | |
| 188 | A53 SPL DDR Memory Layout |
| 189 | ------------------------- |
| 190 | |
| 191 | .. include:: ../ti/j722s_evm.rst |
| 192 | :start-after: .. j722s_evm_rst_include_start_ddr_mem_layout |
| 193 | :end-before: .. j722s_evm_rst_include_end_ddr_mem_layout |
| 194 | |
| 195 | Debugging U-Boot |
| 196 | ---------------- |
| 197 | |
| 198 | See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for |
| 199 | detailed setup and debugging information. |
| 200 | |
| 201 | .. warning:: |
| 202 | |
| 203 | **OpenOCD support since**: commit 33749a7fbeb5 |
| 204 | |
| 205 | If the default package version of OpenOCD in your development |
| 206 | environment's distribution needs to be updated, it might be necessary to |
| 207 | build OpenOCD from the source. |
| 208 | |
| 209 | .. include:: ../ti/k3.rst |
| 210 | :start-after: .. k3_rst_include_start_openocd_connect_tag_connect |
| 211 | :end-before: .. k3_rst_include_end_openocd_connect_tag_connect |
| 212 | |
| 213 | .. include:: ../ti/k3.rst |
| 214 | :start-after: .. k3_rst_include_start_openocd_cfg_external_intro |
| 215 | :end-before: .. k3_rst_include_end_openocd_cfg_external_intro |
| 216 | |
| 217 | For example, with BeagleY-AI (J722S/AM67A platform), the openocd_connect.cfg: |
| 218 | |
| 219 | .. code-block:: tcl |
| 220 | |
| 221 | # TUMPA example: |
| 222 | # http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User's_Manual |
| 223 | source [find interface/ftdi/tumpa.cfg] |
| 224 | |
| 225 | transport select jtag |
| 226 | |
| 227 | # default JTAG configuration has only SRST and no TRST |
| 228 | reset_config srst_only srst_push_pull |
| 229 | |
| 230 | # delay after SRST goes inactive |
| 231 | adapter srst delay 20 |
| 232 | |
| 233 | if { ![info exists SOC] } { |
| 234 | # Set the SoC of interest |
| 235 | set SOC j722s |
| 236 | } |
| 237 | |
| 238 | source [find target/ti_k3.cfg] |
| 239 | |
| 240 | ftdi tdo_sample_edge falling |
| 241 | |
| 242 | # Speeds for FT2232H are in multiples of 2, and 32MHz is tops |
| 243 | # max speed we seem to achieve is ~20MHz.. so we pick 16MHz |
| 244 | adapter speed 16000 |