blob: 01c42b9066078c3bd72456c40a2c1511adc0fe11 [file] [log] [blame]
Wadim Egorov1edb0982024-02-28 09:42:17 +01001.. SPDX-License-Identifier: GPL-2.0+
2.. sectionauthor:: Wadim Egorov <w.egorov@phytec.de>
3
4phyCORE-AM64x
5=============
6
7The `phyCORE-AM64x <https://www.phytec.com/product/phycore-am64x>`_ is a
8SoM (System on Module) featuring TI's AM64x 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 AM64x family.
11
Daniel Schultzed33d892024-06-12 09:16:39 -070012A development Kit, called `phyBOARD-Electra <https://www.phytec.com/product/phyboard-am64x>`_
Wadim Egorov1edb0982024-02-28 09:42:17 +010013is used as a carrier board reference design around the AM64x 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_sysfw
35 :end-before: .. k3_rst_include_end_boot_firmwares_sysfw
36
Wadim Egorov1edb0982024-02-28 09:42:17 +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_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
70uSD Card creation
71-----------------
72
73Use 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
90Once partitioned, the boot partition has to be formatted with a FAT filesystem.
91Assuming the uSD card is `/dev/mmcblk0`:
92
93.. code-block:: bash
94
95 $ mkfs.vfat /dev/mmcblk0p1
96
97To boot from a micro SD card on a HSFS device simply copy the following
98artifacts 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
104Boot
105----
106
107Put the uSD card in the slot on the board and apply power. Check the serial
108console for output.
109
110Flash to SPI NOR
111----------------
112
113Below commands can be used to flash the SPI NOR flash; assuming
114tiboot3.bin, tispl.bin and u-boot.img are stored on the uSD card.
115
116.. code-block:: bash
117
Wadim Egorovca526a92024-06-10 15:33:51 +0200118 mtd list
Wadim Egorov1edb0982024-02-28 09:42:17 +0100119 fatload mmc 1 ${loadaddr} tiboot3.bin
Wadim Egorovca526a92024-06-10 15:33:51 +0200120 mtd write ospi.tiboot3 ${loadaddr} 0 ${filesize}
Wadim Egorov1edb0982024-02-28 09:42:17 +0100121 fatload mmc 1 ${loadaddr} tispl.bin
Wadim Egorovca526a92024-06-10 15:33:51 +0200122 mtd write ospi.tispl ${loadaddr} 0 ${filesize}
Wadim Egorov1edb0982024-02-28 09:42:17 +0100123 fatload mmc 1 ${loadaddr} u-boot.img
Wadim Egorovca526a92024-06-10 15:33:51 +0200124 mtd write ospi.u-boot ${loadaddr} 0 ${filesize}
Wadim Egorov1edb0982024-02-28 09:42:17 +0100125
Wadim Egorov151d9652024-06-20 14:05:54 +0200126UART based boot
127---------------
128
129To boot the board via UART, set the switches to UART mode and connect to the
130micro USB port labeled as "Debug UART". After power-on the build artifacts
131needs to be uploaded one by one with a tool like sz.
132
133Example bash script sequence for running on a Linux host PC feeding all boot
134artifacts needed to the device. Assuming the host uses /dev/ttyUSB0 as
135the 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 Egorov1edb0982024-02-28 09:42:17 +0100145
146Boot Modes
147----------
148
149The phyCORE-AM64x development kit supports booting from many different
150interfaces. By default, the development kit is set to boot from the micro-SD
151card. To change the boot device, DIP switches S5 and S6 can be used.
152Boot 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
178Further Information
179-------------------
180
181Please see :doc:`../ti/am64x_evm` chapter for further AM64 SoC related documentation
Daniel Schultza2fca422024-06-12 09:16:38 -0700182and https://docs.phytec.com/projects/yocto-phycore-am64x/en/latest/ for vendor documentation.