Skip to content

Commit 9f73988

Browse files
pefechcarlescufi
authored andcommitted
boards: phytec: update phyboard_polis docs
Updating PhyBOARD Polis docs after enabling ECSPI and CAN support on that board. Add additional information what to do if using Linux and Zephyr simultaneously. Signed-off-by: Peter Fecher <[email protected]>
1 parent 0ac7f64 commit 9f73988

File tree

1 file changed

+78
-11
lines changed
  • boards/phytec/mimx8mm_phyboard_polis/doc

1 file changed

+78
-11
lines changed

boards/phytec/mimx8mm_phyboard_polis/doc/index.rst

Lines changed: 78 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ the phyCORE-i.MX 8M Mini/Nano.
2828

2929
- 4GB - 128GB eMMC
3030
- 8MB - 128MB SPI NOR Flash
31-
- microSD Interfacce
31+
- microSD Interface
3232
- 4kB EEPROM
3333
- Wireless:
3434

35-
- WiFi: 802.11 b/g/n (ac) 2,4 GHz / 5 GHz
35+
- WiFi: 802.11 b/g/n (ac) 2.4 GHz / 5 GHz
3636
- BLE 4.2
3737
- USB:
3838

@@ -90,6 +90,10 @@ hardware features:
9090
| GPIO | on-chip | GPIO output |
9191
| | | GPIO input |
9292
+-----------+------------+-------------------------------------+
93+
| SPI | on-chip | ECSPI |
94+
+-----------+------------+-------------------------------------+
95+
| CAN | MCP2518 | MCP2518 via ECSPI |
96+
+-----------+------------+-------------------------------------+
9397

9498
The default configuration can be found in the defconfig file:
9599
:zephyr_file:`boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis_mimx8mm6_m4_defconfig`.
@@ -130,12 +134,27 @@ problems with the A53-Core because UART4 is only accessible from the M4-Core.
130134
On Boards with the version number 1532.1 UART4 isn't connected to the Debug
131135
USB. UART4 connects to pin 10(RX) and 12(TX) on the X8 pinheader.
132136

137+
SPI:
138+
----
139+
140+
ECSPI is disabled by default. On phyBOARD Polis, the SoC's ECSPI3 is not
141+
usable.
142+
ECSPI1 is connected to the MCP2518 CAN controller with a chip select.
143+
Another device can be connected via the expansion header (X8):
144+
PIN 5, 6, 7, 8 (CS, MOSI, MISO, SCLK).
145+
ECSPI2 is connected to the TPM module. Currently the TPM module is not
146+
supported by Zephyr.
147+
148+
.. note::
149+
Please note, that it is necessary to disable ECSPI1 in the Linux devicetree
150+
before you can use it on the M4-Core with Zephyr.
151+
See section "Disabling Interfaces in Linux" for more information.
133152

134153
LEDs:
135154
-----
136155

137156
Zephyr has the 3-color status LED configured. The led0 alias (the standard
138-
Zephyr led) is configured to be the blue led. The LED can also light up in red
157+
Zephyr LED) is configured to be the blue LED. The LED can also light up in red
139158
and green.
140159

141160
GPIO:
@@ -144,7 +163,18 @@ GPIO:
144163
The pinmuxing for the GPIOs is the standard pinmuxing of the mimx8mm devicetree
145164
created by NXP. You can find it here:
146165

147-
:zephyr_file:`dts/arm/nxp/nxp_imx8m_m4.dtsi`.
166+
CAN:
167+
----
168+
169+
The MCP2518 is connected via ECSPI1. The CAN interface is disabled by default
170+
to not interfere with Linux on the A53-Core.
171+
If you want to use the CAN interface you need to disable ECSPI in the Linux
172+
devicetree.
173+
174+
.. warning::
175+
There is a bug in the MCP2518 driver that causes the enable pin of the
176+
transceiver to be not set. This causes a ENETDOWN error when trying to send
177+
a CAN frame. Receiving CAN frames in `listen-only` mode is possible.
148178

149179
The Pinout of the PhyBOARD Polis can be found here:
150180

@@ -189,12 +219,7 @@ For more information about memory mapping see the
189219
At compilation time you have to choose which RAM will be used. This
190220
configuration is done in
191221
:zephyr_file:`boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis_mimx8mm6_m4.dts`
192-
with "zephyr,flash" (when CONFIG_XIP=y) and "zephyr,sram" properties.
193-
194-
You also have to set XIP=n or edit the boards defconfig file, if you don't want
195-
the TCM memory area to be used. You can find the defconf file here:
196-
197-
:zephyr_file:`boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis_mimx8mm6_m4_defconfig`.
222+
with "zephyr,flash" and "zephyr,sram" properties.
198223

199224
The following configurations are possible for the flash and sram chosen nodes
200225
to change the used memory area:
@@ -211,6 +236,9 @@ to change the used memory area:
211236
- &ocram_sys
212237
- &ocram_s_sys
213238
239+
By default Zephyr is configured to use the TCM memory area and CONFIG_XIP is
240+
disabled. If you want to use the OCRAM memory area you have to enable
241+
CONFIG_XIP.
214242

215243
Starting the M4-Core via U-Boot
216244
===============================
@@ -296,7 +324,7 @@ To debug efficiently you should use multiple terminals:
296324
(But its also possible to use ``west debug``)
297325

298326
After connecting everything and building with west use this command while in
299-
the directory of the program you build earlier to start a debug server:
327+
the directory of the program you built earlier to start a debug server:
300328

301329
.. code-block:: console
302330
@@ -321,6 +349,45 @@ target:
321349
322350
The program can be debugged using standard gdb techniques.
323351

352+
Disabling Interfaces in Linux
353+
=============================
354+
355+
If Zephyr is used on the M4-Core while Linux runs on the A53-Core, it is
356+
recommended to disable the Interfaces used by the M4-Core to avoid conflicts.
357+
More simple interfaces can be enabled on both cores at the same time, for
358+
example GPIO. If you do that, keep in mind that conflicts can still arise.
359+
360+
For more complex interfaces like SPI it is necessary to disable them in the
361+
Linux devicetree, otherwise Linux will probably crash in a panic, resetting
362+
the SoC.
363+
For example: disabling ECSPI1 in Linux to use it on the M4-Core with Zephyr:
364+
365+
1. Create a new file called ``disable_spi.dts`` with the following content:
366+
367+
.. code:: dts
368+
369+
/dts-v1/;
370+
/plugin/;
371+
372+
/ {
373+
fragment@0 {
374+
target = <&ecspi1>;
375+
__overlay__ {
376+
status = "disabled";
377+
};
378+
};
379+
};
380+
381+
2. Compile the file with the dtc compiler to a devicetree blob:
382+
383+
.. code:: console
384+
385+
$ dtc -@ -I dts -O dtb -o imx8mm-phyboard-polis-disable-spi.dtbo disable_spi.dts;
386+
387+
3. Copy the compiled file to the boot partition of the target.
388+
4. Add the filename to the ``/boot/bootenv.txt`` file at the end of the line.
389+
5. Reboot the target, the SPI interface is now disabled in Linux.
390+
324391
.. _PHYTEC website:
325392
https://www.phytec.de/produkte/single-board-computer/phyboard-polis-imx8m-mini/
326393

0 commit comments

Comments
 (0)