summaryrefslogtreecommitdiffstats
path: root/Documentation/boards/imx/nxp-imx8mq-evk.rst
blob: 8bad9455a571828aad9db00577a9c67463c393bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
NXP i.MX8MQ EVK Evaluation Board
================================

Board comes with:

* 3GiB of LPDDR4 RAM
* 16GiB eMMC

Not including booting via serial, the device can boot from either SD or eMMC.

Downloading DDR PHY and HDMI/eDP Firmware
-----------------------------------------

As a part of DDR intialization routine NXP i.MX8MQ EVK requires and
uses several binary firmware blobs that are distributed under a
separate EULA and cannot be included in Barebox. In order to obtain
them do the following::

 wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.0.bin
 chmod +x firmware-imx-8.0.bin
 ./firmware-imx-8.0.bin

Executing that file should produce a EULA acceptance dialog as well as
result in the following files:

- lpddr4_pmu_train_1d_dmem.bin
- lpddr4_pmu_train_1d_imem.bin
- lpddr4_pmu_train_2d_dmem.bin
- lpddr4_pmu_train_2d_imem.bin

As a last step of this process those files need to be placed in
"firmware/imx/"::

  for f in lpddr4_pmu_train_1d_dmem.bin  \
           lpddr4_pmu_train_1d_imem.bin  \
	   lpddr4_pmu_train_2d_dmem.bin  \
	   lpddr4_pmu_train_2d_imem.bin; \
  do \
	   cp firmware-imx-8.0/firmware/ddr/synopsys/${f} \
	      firmware/${f}; \
  done

You will also need to copy the HDMITX controller firmware in order to
use the HDMI and/or eDP display output::

  for f in signed_dp_imx8m.bin \
	   signed_hdmi_imx8m.bin; \
  do \
	   cp firmware-imx-8.0/firmware/hdmi/cadence/${f} \
	      firmware/${f}; \
  done

DDR Configuration Code
======================

The following two files:

  - arch/arm/boards/nxp-imx8mq-evk/ddr_init.c
  - arch/arm/boards/nxp-imx8mq-evk/ddrphy_train.c

were obtained by running i.MX 8M DDR Tool that can be found here:

https://community.nxp.com/docs/DOC-340179

Only minimal amount of necessary changes were made to those files.
All of the "impedance matching" code is located in "ddr.h".

Build Barebox
=============

 make imx_v8_defconfig
 make

Boot Configuration
==================

The NXM i.MX8MQ EVK Evaluation Board has two switches responsible for
configuring bootsource/boot mode:

 * SW802 for selecting appropriate BMOD
 * SW801 for selecting appropriate boot medium

In order to select internal boot set SW802 as follows::

  +-----+
  |     |
  | O | | <--- on = high level
  | | | |
  | | O | <--- off = low level
  |     |
  | 1 2 |
  +-----+

Bootsource is the internal eMMC::

  +---------+
  |         |
  | | | O | |
  | | | | | |  <---- eMMC
  | O O O O |
  |         |
  | 1 2 3 4 |
  +---------+

Bootsource is the SD2 slot::

  +---------+
  |         |
  | O O | | |
  | | | | | |  <---- SD2
  | | | O O |
  |         |
  | 1 2 3 4 |
  +---------+


Serial boot SW802 setting needed for i.MX8 DDR Tool is as follows::

  +-----+
  |     |
  | | O | <--- on = high level
  | | | |
  | O | | <--- off = low level
  |     |
  | 1 2 |
  +-----+