blob: a7ce2c58825b120296d07c5a501f97af206f47f0 [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
33Build procedure
34---------------
35
36Setup the environment variables:
37
38.. include:: ../ti/k3.rst
39 :start-after: .. k3_rst_include_start_common_env_vars_desc
40 :end-before: .. k3_rst_include_end_common_env_vars_desc
41
42.. include:: ../ti/k3.rst
43 :start-after: .. k3_rst_include_start_board_env_vars_desc
44 :end-before: .. k3_rst_include_end_board_env_vars_desc
45
46Set the variables corresponding to this platform:
47
48.. include:: ../ti/k3.rst
49 :start-after: .. k3_rst_include_start_common_env_vars_defn
50 :end-before: .. k3_rst_include_end_common_env_vars_defn
51.. code-block:: bash
52
53 $ export UBOOT_CFG_CORTEXR=phycore_am62x_r5_defconfig
54 $ export UBOOT_CFG_CORTEXA=phycore_am62x_a53_defconfig
55 $ export TFA_BOARD=lite
56 $ # we don't use any extra TFA parameters
57 $ unset TFA_EXTRA_ARGS
58 $ export OPTEE_PLATFORM=k3-am62x
59 $ export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
60
61.. include:: ../ti/am62x_sk.rst
62 :start-after: .. am62x_evm_rst_include_start_build_steps
63 :end-before: .. am62x_evm_rst_include_end_build_steps
64
65uSD Card creation
66-----------------
67
68Use fdisk to partition the uSD card. The layout should look similar to:
69
70.. code-block:: bash
71
72 $ sudo fdisk -l /dev/mmcblk0
73 Disk /dev/mmcblk0: 7.56 GiB, 8120172544 bytes, 15859712 sectors
74 Units: sectors of 1 * 512 = 512 bytes
75 Sector size (logical/physical): 512 bytes / 512 bytes
76 I/O size (minimum/optimal): 512 bytes / 512 bytes
77 Disklabel type: dos
78 Disk identifier: 0x6583d9a3
79
80 Device Boot Start End Sectors Size Id Type
81 /dev/mmcblk0p1 * 2048 264191 262144 128M c W95 FAT32 (LBA)
82 /dev/mmcblk0p2 264192 1934953 1670762 815.8M 83 Linux
83
84
85Once partitioned, the boot partition has to be formatted with a FAT filesystem.
86Assuming the uSD card is `/dev/mmcblk0`:
87
88.. code-block:: bash
89
90 $ mkfs.vfat /dev/mmcblk0p1
91
92To boot from a micro SD card on a HSFS device simply copy the following
93artifacts to the FAT partition:
94
Wadim Egorov93133d22024-02-28 09:58:48 +010095* tiboot3.bin from R5 build
96* tispl.bin from Cortex-A build
97* u-boot.img from Cortex-A build
Wadim Egorov12722a42023-12-20 10:18:11 +010098
99Boot
100----
101
102Put the uSD card in the slot on the board and apply power. Check the serial
103console for output.
104
105Flash to SPI NOR
106----------------
107
108Below commands can be used to flash the SPI NOR flash; assuming
109tiboot3.bin, tispl.bin and u-boot.img are stored on the uSD card.
110
111.. code-block:: bash
112
Wadim Egorovca526a92024-06-10 15:33:51 +0200113 mtd list
Wadim Egorov12722a42023-12-20 10:18:11 +0100114 fatload mmc 1 ${loadaddr} tiboot3.bin
Wadim Egorovca526a92024-06-10 15:33:51 +0200115 mtd write ospi.tiboot3 ${loadaddr} 0 ${filesize}
Wadim Egorov12722a42023-12-20 10:18:11 +0100116 fatload mmc 1 ${loadaddr} tispl.bin
Wadim Egorovca526a92024-06-10 15:33:51 +0200117 mtd write ospi.tispl ${loadaddr} 0 ${filesize}
Wadim Egorov12722a42023-12-20 10:18:11 +0100118 fatload mmc 1 ${loadaddr} u-boot.img
Wadim Egorovca526a92024-06-10 15:33:51 +0200119 mtd write ospi.u-boot ${loadaddr} 0 ${filesize}
Wadim Egorov12722a42023-12-20 10:18:11 +0100120
Wadim Egorov151d9652024-06-20 14:05:54 +0200121UART based boot
122---------------
123
124To boot the board via UART, set the switches to UART mode and connect to the
125micro USB port labeled as "Debug UART". After power-on the build artifacts
126needs to be uploaded one by one with a tool like sz.
127
128Example bash script sequence for running on a Linux host PC feeding all boot
129artifacts needed to the device. Assuming the host uses /dev/ttyUSB0 as
130the main domain serial port:
131
132.. prompt:: bash $
133
134 stty -F /dev/ttyUSB0 115200
135 sb --xmodem tiboot3.bin > /dev/ttyUSB0 < /dev/ttyUSB0
136 sb --ymodem tispl.bin > /dev/ttyUSB0 < /dev/ttyUSB0
137 sb --ymodem u-boot.img > /dev/ttyUSB0 < /dev/ttyUSB0
Wadim Egorov12722a42023-12-20 10:18:11 +0100138
139Boot Modes
140----------
141
142The phyCORE-AM62x development kit supports booting from many different
143interfaces. By default, the development kit is set to boot from the micro-SD
144card. To change the boot device, DIP switches S5 and S6 can be used.
145Boot switches should be changed with power off.
146
147.. list-table:: Boot Modes
148 :widths: 16 16 16
149 :header-rows: 1
150
151 * - Switch Label
152 - SW5: 12345678
153 - SW6: 12345678
154
155 * - uSD
156 - 11000010
157 - 01000000
158
159 * - eMMC
160 - 11010010
161 - 00000000
162
163 * - OSPI
164 - 11010000
165 - 10000000
166
167 * - UART
168 - 11011100
169 - 00000000
170
Wadim Egorov34253352024-06-10 15:33:50 +0200171 * - USB DFU
172 - 11001010
173 - 00100000
174
Wadim Egorov12722a42023-12-20 10:18:11 +0100175Further Information
176-------------------
177
178Please see :doc:`../ti/am62x_sk` chapter for further AM62 SoC related documentation
Daniel Schultz33136d52024-06-12 09:16:37 -0700179and https://docs.phytec.com/projects/yocto-phycore-am62x/en/latest/ for vendor documentation.