···11+.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
22+.. sectionauthor:: Paresh Bhagat <p-bhagat@ti.com>
33+44+AM62D Platforms
55+===============
66+77+Introduction:
88+-------------
99+The AM62D2 SoC belongs to the K3 Multicore SoC architecture with DSP core
1010+targeted for applications needing high-performance Digital Signal
1111+Processing. It is used in applications like automotive audio systems,
1212+professional sound equipment, radar and radio for aerospace, sonar in
1313+marine devices, and ultrasound in medical imaging. It also supports
1414+precise signal analysis in test and measurement tools.
1515+1616+Some highlights of AM62D2 SoC are:
1717+1818+* Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster. Dual/Single
1919+ core variants are provided in the same package to allow HW compatible
2020+ designs.
2121+* One Device manager Cortex-R5F for system power and resource management,
2222+ and one Cortex-R5F for Functional Safety or general-purpose usage.
2323+* DSP with Matrix Multiplication Accelerator(MMA) (up to 2 TOPS) based on
2424+ single core C7x.
2525+* 3x Multichannel Audio Serial Ports (McASP) Up to 4/6/16 Serial Data Pins
2626+ which can Transmit and Receive Clocks up to 50MHz, with multi-channel I2S
2727+ and TDM Audio inputs and outputs.
2828+* Integrated Giga-bit Ethernet switch supporting up to a total of two
2929+ external ports with TSN capable to enable audio networking features such
3030+ as, Ethernet Audio Video Bridging (eAVB) and Dante.
3131+* 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, OSPI memory
3232+ controller, 1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other
3333+ peripherals.
3434+* Dedicated Centralized Hardware Security Module with support for secure
3535+ boot, debug security and crypto acceleration and trusted execution
3636+ environment.
3737+* One 32 bit DDR Subsystem that supports LPDDR4, DDR4 memory types.
3838+* Low power mode support: Partial IO support for CAN/GPIO/UART wakeup.
3939+4040+This SoC is of part K3 AM62x family, which includes the AM62A and AM62P
4141+variants. While the AM62A and AM62D are largely similar, the AM62D is
4242+specifically targeted for general-purpose DSP applications, whereas the
4343+AM62A focuses on edge AI workloads. A key distinction is that the AM62D
4444+does not include multimedia components such as the video encoder/decoder,
4545+MJPEG encoder, Vision Processing Accelerator (VPAC) for image signal
4646+processing, or the display subsystem. Additionally, the AM62D has a
4747+different pin configuration compared to the AM62A, which impacts
4848+embedded software development.
4949+5050+More details can be found in the Technical Reference Manual:
5151+https://www.ti.com/lit/pdf/sprujd4
5252+5353+Platform information:
5454+5555+* https://www.ti.com/tool/AUDIO-AM62D-EVM
5656+5757+Boot Flow:
5858+----------
5959+Below is the pictorial representation of boot flow:
6060+6161+.. image:: img/boot_diagram_am62.svg
6262+ :alt: Boot flow diagram
6363+6464+- Here TIFS acts as master and provides all the critical services. R5/A53
6565+ requests TIFS to get these services done as shown in the above diagram.
6666+6767+Sources:
6868+--------
6969+7070+.. include:: ../ti/k3.rst
7171+ :start-after: .. k3_rst_include_start_boot_sources
7272+ :end-before: .. k3_rst_include_end_boot_sources
7373+7474+.. include:: ../ti/k3.rst
7575+ :start-after: .. k3_rst_include_start_boot_firmwares
7676+ :end-before: .. k3_rst_include_end_tifsstub
7777+7878+Build procedure:
7979+----------------
8080+0. Setup the environment variables:
8181+8282+.. include:: ../ti/k3.rst
8383+ :start-after: .. k3_rst_include_start_common_env_vars_desc
8484+ :end-before: .. k3_rst_include_end_common_env_vars_desc
8585+8686+.. include:: ../ti/k3.rst
8787+ :start-after: .. k3_rst_include_start_board_env_vars_desc
8888+ :end-before: .. k3_rst_include_end_board_env_vars_desc
8989+9090+Set the variables corresponding to this platform:
9191+9292+.. include:: ../ti/k3.rst
9393+ :start-after: .. k3_rst_include_start_common_env_vars_defn
9494+ :end-before: .. k3_rst_include_end_common_env_vars_defn
9595+.. prompt:: bash
9696+9797+ export UBOOT_CFG_CORTEXR=am62dx_evm_r5_defconfig
9898+ export UBOOT_CFG_CORTEXA=am62dx_evm_a53_defconfig
9999+ export TFA_BOARD=lite
100100+ # we dont use any extra TFA parameters
101101+ unset TFA_EXTRA_ARGS
102102+ export OPTEE_PLATFORM=k3-am62ax
103103+ # we dont use any extra OPTEE parameters
104104+ unset OPTEE_EXTRA_ARGS
105105+106106+1. Trusted Firmware-A:
107107+108108+.. include:: ../ti/k3.rst
109109+ :start-after: .. k3_rst_include_start_build_steps_tfa
110110+ :end-before: .. k3_rst_include_end_build_steps_tfa
111111+112112+2. OP-TEE:
113113+114114+.. include:: ../ti/k3.rst
115115+ :start-after: .. k3_rst_include_start_build_steps_optee
116116+ :end-before: .. k3_rst_include_end_build_steps_optee
117117+118118+3. U-Boot:
119119+120120+* 3.1 R5:
121121+122122+.. include:: ../ti/k3.rst
123123+ :start-after: .. k3_rst_include_start_build_steps_spl_r5
124124+ :end-before: .. k3_rst_include_end_build_steps_spl_r5
125125+126126+* 3.2 A53:
127127+128128+.. include:: ../ti/k3.rst
129129+ :start-after: .. k3_rst_include_start_build_steps_uboot
130130+ :end-before: .. k3_rst_include_end_build_steps_uboot
131131+132132+Target Images
133133+--------------
134134+In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC
135135+variant (HS-FS, HS-SE) requires a different source for these files.
136136+137137+ - HS-FS
138138+139139+ * tiboot3-am62ax-hs-fs-evm.bin from step 3.1
140140+ * tispl.bin, u-boot.img from step 3.2
141141+142142+ - HS-SE
143143+144144+ * tiboot3-am62ax-hs-evm.bin from step 3.1
145145+ * tispl.bin, u-boot.img from step 3.2
146146+147147+Image formats:
148148+--------------
149149+150150+- tiboot3.bin
151151+152152+.. image:: img/multi_cert_tiboot3.bin.svg
153153+ :alt: tiboot3.bin image format
154154+155155+- tispl.bin
156156+157157+.. image:: img/tifsstub_dm_tispl.bin.svg
158158+ :alt: tispl.bin image format
159159+160160+Switch Setting for Boot Mode
161161+----------------------------
162162+163163+Boot Mode pins provide means to select the boot mode and options before the
164164+device is powered up. After every POR, they are the main source to populate
165165+the Boot Parameter Tables.
166166+167167+The following table shows some common boot modes used on AM62D platform. More
168168+details can be found in the Technical Reference Manual:
169169+https://www.ti.com/lit/pdf/sprujd4 under the `Boot Mode Pins` section.
170170+171171+.. list-table:: Boot Modes
172172+ :widths: 16 16 16
173173+ :header-rows: 1
174174+175175+ * - Switch Label
176176+ - SW2: 12345678
177177+ - SW3: 12345678
178178+179179+ * - SD
180180+ - 01000000
181181+ - 11000010
182182+183183+ * - OSPI
184184+ - 00000000
185185+ - 11001110
186186+187187+ * - EMMC
188188+ - 00000000
189189+ - 11010010
190190+191191+ * - UART
192192+ - 00000000
193193+ - 11011100
194194+195195+ * - USB DFU
196196+ - 00000000
197197+ - 11001010
198198+199199+For SW2 and SW1, the switch state in the "ON" position = 1.
200200+201201+Falcon Mode
202202+-----------
203203+204204+Falcon Mode on AM62dx platforms bypasses the A53 SPL and U-Boot with the overall
205205+boot flow as below:
206206+207207+.. include:: am62x_sk.rst
208208+ :start-after: .. am62x_evm_falcon_start_boot_flow
209209+ :end-before: .. am62x_evm_falcon_end_boot_flow
210210+211211+Build Process
212212+^^^^^^^^^^^^^
213213+214214+.. include:: am62x_sk.rst
215215+ :start-after: .. am62x_evm_falcon_start_build_process
216216+ :end-before: .. am62x_evm_falcon_end_build_process
217217+218218+Usage
219219+^^^^^
220220+221221+.. include:: am62x_sk.rst
222222+ :start-after: .. am62x_evm_falcon_start_usage
223223+ :end-before: .. am62x_evm_falcon_end_usage
224224+225225+R5 SPL Memory Map
226226+^^^^^^^^^^^^^^^^^
227227+228228+.. include:: am62x_sk.rst
229229+ :start-after: .. am62x_evm_falcon_start_r5_memory_map
230230+ :end-before: .. am62x_evm_falcon_end_r5_memory_map
231231+232232+Debugging U-Boot
233233+----------------
234234+235235+See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
236236+detailed setup information.
237237+238238+.. warning::
239239+240240+ **AM62A**: OpenOCD support since August 2023 (git master)
241241+242242+ **AM62D**: Uses AM62A configuration (compatible due to same core architecture)
243243+244244+ Until the next stable release of OpenOCD is available in your development
245245+ environment's distribution, it might be necessary to build OpenOCD `from the
246246+ source <https://github.com/openocd-org/openocd>`_.
247247+248248+.. include:: k3.rst
249249+ :start-after: .. k3_rst_include_start_openocd_connect_XDS110
250250+ :end-before: .. k3_rst_include_end_openocd_connect_XDS110
251251+252252+To start OpenOCD and connect to the board
253253+254254+.. prompt:: bash
255255+256256+ openocd -f board/ti/am62a7evm.cfg