blob: 68d78ad7c25a5ca3b250f11ec62b5a79273aeab1 [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
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_am64x_r5_defconfig
54 $ export UBOOT_CFG_CORTEXA=phycore_am64x_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-am64x
59 # we don't use any extra OPTEE parameters
60 unset OPTEE_EXTRA_ARGS
61
62.. include:: ../ti/am62x_sk.rst
63 :start-after: .. am62x_evm_rst_include_start_build_steps
64 :end-before: .. am62x_evm_rst_include_end_build_steps
65
66uSD Card creation
67-----------------
68
69Use fdisk to partition the uSD card. The layout should look similar to:
70
71.. code-block:: bash
72
73 $ sudo fdisk -l /dev/mmcblk0
74 Disk /dev/mmcblk0: 7.56 GiB, 8120172544 bytes, 15859712 sectors
75 Units: sectors of 1 * 512 = 512 bytes
76 Sector size (logical/physical): 512 bytes / 512 bytes
77 I/O size (minimum/optimal): 512 bytes / 512 bytes
78 Disklabel type: dos
79 Disk identifier: 0x6583d9a3
80
81 Device Boot Start End Sectors Size Id Type
82 /dev/mmcblk0p1 * 2048 264191 262144 128M c W95 FAT32 (LBA)
83 /dev/mmcblk0p2 264192 1934953 1670762 815.8M 83 Linux
84
85
86Once partitioned, the boot partition has to be formatted with a FAT filesystem.
87Assuming the uSD card is `/dev/mmcblk0`:
88
89.. code-block:: bash
90
91 $ mkfs.vfat /dev/mmcblk0p1
92
93To boot from a micro SD card on a HSFS device simply copy the following
94artifacts to the FAT partition:
95
96* tiboot3.bin from R5 build
97* tispl.bin from Cortex-A build
98* u-boot.img from Cortex-A build
99
100Boot
101----
102
103Put the uSD card in the slot on the board and apply power. Check the serial
104console for output.
105
106Flash to SPI NOR
107----------------
108
109Below commands can be used to flash the SPI NOR flash; assuming
110tiboot3.bin, tispl.bin and u-boot.img are stored on the uSD card.
111
112.. code-block:: bash
113
Wadim Egorovca526a92024-06-10 15:33:51 +0200114 mtd list
Wadim Egorov1edb0982024-02-28 09:42:17 +0100115 fatload mmc 1 ${loadaddr} tiboot3.bin
Wadim Egorovca526a92024-06-10 15:33:51 +0200116 mtd write ospi.tiboot3 ${loadaddr} 0 ${filesize}
Wadim Egorov1edb0982024-02-28 09:42:17 +0100117 fatload mmc 1 ${loadaddr} tispl.bin
Wadim Egorovca526a92024-06-10 15:33:51 +0200118 mtd write ospi.tispl ${loadaddr} 0 ${filesize}
Wadim Egorov1edb0982024-02-28 09:42:17 +0100119 fatload mmc 1 ${loadaddr} u-boot.img
Wadim Egorovca526a92024-06-10 15:33:51 +0200120 mtd write ospi.u-boot ${loadaddr} 0 ${filesize}
Wadim Egorov1edb0982024-02-28 09:42:17 +0100121
Wadim Egorov151d9652024-06-20 14:05:54 +0200122UART based boot
123---------------
124
125To boot the board via UART, set the switches to UART mode and connect to the
126micro USB port labeled as "Debug UART". After power-on the build artifacts
127needs to be uploaded one by one with a tool like sz.
128
129Example bash script sequence for running on a Linux host PC feeding all boot
130artifacts needed to the device. Assuming the host uses /dev/ttyUSB0 as
131the main domain serial port:
132
133.. prompt:: bash $
134
135 stty -F /dev/ttyUSB0 115200
136 sb --xmodem tiboot3.bin > /dev/ttyUSB0 < /dev/ttyUSB0
137 # Resend tiboot3.bin a 2nd time due to ErrataID:i2331
138 sb --xmodem tiboot3.bin > /dev/ttyUSB0 < /dev/ttyUSB0
139 sb --ymodem tispl.bin > /dev/ttyUSB0 < /dev/ttyUSB0
140 sb --ymodem u-boot.img > /dev/ttyUSB0 < /dev/ttyUSB0
Wadim Egorov1edb0982024-02-28 09:42:17 +0100141
142Boot Modes
143----------
144
145The phyCORE-AM64x development kit supports booting from many different
146interfaces. By default, the development kit is set to boot from the micro-SD
147card. To change the boot device, DIP switches S5 and S6 can be used.
148Boot switches should be changed with power off.
149
150.. list-table:: Boot Modes
151 :widths: 16 16 16
152 :header-rows: 1
153
154 * - Switch Label
155 - SW3: 12345678
156 - SW4: 12345678
157
158 * - uSD
159 - 11000010
160 - 01000000
161
162 * - eMMC
163 - 11010010
164 - 00000000
165
166 * - OSPI
167 - 11010000
168 - 10000000
169
170 * - UART
171 - 11011100
172 - 00000000
173
174Further Information
175-------------------
176
177Please see :doc:`../ti/am64x_evm` chapter for further AM64 SoC related documentation
Daniel Schultza2fca422024-06-12 09:16:38 -0700178and https://docs.phytec.com/projects/yocto-phycore-am64x/en/latest/ for vendor documentation.