blob: 56c1fd8354b4fa60eb030dc3c131fe993c1f8cee [file] [log] [blame]
Wadim Egorov12722a42023-12-20 10:18:11 +01001.. SPDX-License-Identifier: GPL-2.0+
2.. sectionauthor:: Wadim Egorov <w.egorov@phytec.de>
3
4phyCORE-AM62x
5=============
6
7The `phyCORE-AM62x <https://www.phytec.com/product/phycore-am62x>`_ is a
8SoM (System on Module) featuring TI's AM62x SoC. It can be used in combination
9with different carrier boards. This module can come with different sizes and
10models for DDR, eMMC, SPI NOR Flash and various SoCs from the AM62x family.
11
12A development Kit, called `phyBOARD-Lyra <https://www.phytec.com/product/phyboard-am62x>`_
13is used as a carrier board reference design around the AM62x SoM.
14
15Quickstart
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
26Sources
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 Gole26e0ddf2024-08-05 19:59:33 +053033.. include:: ../ti/k3.rst
34 :start-after: .. k3_rst_include_start_boot_firmwares
Dhruva Golee236a922024-08-05 19:59:37 +053035 :end-before: .. k3_rst_include_end_tifsstub
Dhruva Gole26e0ddf2024-08-05 19:59:33 +053036
Wadim Egorov12722a42023-12-20 10:18:11 +010037Build procedure
38---------------
39
40Setup 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
50Set 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
69uSD Card creation
70-----------------
71
72Use 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
89Once partitioned, the boot partition has to be formatted with a FAT filesystem.
90Assuming the uSD card is `/dev/mmcblk0`:
91
92.. code-block:: bash
93
94 $ mkfs.vfat /dev/mmcblk0p1
95
96To boot from a micro SD card on a HSFS device simply copy the following
97artifacts to the FAT partition:
98
Wadim Egorov93133d22024-02-28 09:58:48 +010099* tiboot3.bin from R5 build
100* tispl.bin from Cortex-A build
101* u-boot.img from Cortex-A build
Wadim Egorov12722a42023-12-20 10:18:11 +0100102
103Boot
104----
105
106Put the uSD card in the slot on the board and apply power. Check the serial
107console for output.
108
109Flash to SPI NOR
110----------------
111
112Below commands can be used to flash the SPI NOR flash; assuming
113tiboot3.bin, tispl.bin and u-boot.img are stored on the uSD card.
114
115.. code-block:: bash
116
Wadim Egorovca526a92024-06-10 15:33:51 +0200117 mtd list
Wadim Egorov12722a42023-12-20 10:18:11 +0100118 fatload mmc 1 ${loadaddr} tiboot3.bin
Wadim Egorovca526a92024-06-10 15:33:51 +0200119 mtd write ospi.tiboot3 ${loadaddr} 0 ${filesize}
Wadim Egorov12722a42023-12-20 10:18:11 +0100120 fatload mmc 1 ${loadaddr} tispl.bin
Wadim Egorovca526a92024-06-10 15:33:51 +0200121 mtd write ospi.tispl ${loadaddr} 0 ${filesize}
Wadim Egorov12722a42023-12-20 10:18:11 +0100122 fatload mmc 1 ${loadaddr} u-boot.img
Wadim Egorovca526a92024-06-10 15:33:51 +0200123 mtd write ospi.u-boot ${loadaddr} 0 ${filesize}
Wadim Egorov12722a42023-12-20 10:18:11 +0100124
Wadim Egorov151d9652024-06-20 14:05:54 +0200125UART based boot
126---------------
127
128To boot the board via UART, set the switches to UART mode and connect to the
129micro USB port labeled as "Debug UART". After power-on the build artifacts
130needs to be uploaded one by one with a tool like sz.
131
132Example bash script sequence for running on a Linux host PC feeding all boot
133artifacts needed to the device. Assuming the host uses /dev/ttyUSB0 as
134the 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 Egorov12722a42023-12-20 10:18:11 +0100142
143Boot Modes
144----------
145
146The phyCORE-AM62x development kit supports booting from many different
147interfaces. By default, the development kit is set to boot from the micro-SD
148card. To change the boot device, DIP switches S5 and S6 can be used.
149Boot 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 Egorov34253352024-06-10 15:33:50 +0200175 * - USB DFU
176 - 11001010
177 - 00100000
178
Wadim Egorov12722a42023-12-20 10:18:11 +0100179Further Information
180-------------------
181
182Please see :doc:`../ti/am62x_sk` chapter for further AM62 SoC related documentation
Daniel Schultz33136d52024-06-12 09:16:37 -0700183and https://docs.phytec.com/projects/yocto-phycore-am62x/en/latest/ for vendor documentation.