summaryrefslogtreecommitdiffstats
path: root/Documentation/boards/imx/nxp-imx8mn-evk.rst
blob: 597db57eafa14c26fa0a88018d15c286ab20e9cc (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
NXP i.MX8MN EVK Evaluation Board
================================

Board comes with either:

* 2GiB of LPDDR4 RAM
* 2GiB of DDR4 RAM

barebox supports both variants with the same image.

Downloading DDR PHY Firmware
----------------------------

As a part of DDR intialization routine NXP i.MX8MN 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.12.bin
 chmod +x firmware-imx-8.12.bin
 ./firmware-imx-8.12.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
- ddr4_dmem_1d_201810.bin
- ddr4_imem_1d_201810.bin
- ddr4_dmem_2d_201810.bin
- ddr4_imem_2d_201810.bin

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

  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.12/firmware/ddr/synopsys/${f} \
	      firmware/${f}; \
  done

  for f in ddr4_dmem_1d_201810.bin  \
           ddr4_imem_1d_201810.bin  \
           ddr4_dmem_2d_201810.bin  \
           ddr4_imem_2d_201810.bin; \
  do \
	   cp firmware-imx-8.12/firmware/ddr/synopsys/${f} \
	      firmware/${f%_201810.bin}.bin; \
  done

Build barebox
=============

 make imx_v8_defconfig
 make

Installing barebox
==================

When the EVK is strapped to boot from eMMC, the i.MX8M bootrom will
consult the eMMC ext_csd register to determine whether to boot
from the active eMMC boot partition or from the user area.

The same barebox image written to the start of the SD-Card can
be written to the start of the eMMC user area. Power-fail-safe
installation to the eMMC boot partition requires special handling:

  - The barebox image must be written to the inactive boot partition,
    then afterwards, the newly written boot partition is activated
    (This is controlled by the barebox ``mmcX.boot`` variable).

  - The barebox image includes a 32KiB preamble that allows the image
    to be directly writable to the start of the SD-Card or eMMC user area.
    Unlike older i.MX8M, the i.MX8MN BootROM expects the bootloader to not
    start at an offset when booting from eMMC boot partitions, thus the first
    32KiB must be stripped.

The following steps are required to write the image to the QSPI NOR flash:

  - Strip the 32KiB preamble, like it is done for the eMMC boot partition case
    (see above).

  - The QSPI NOR partition ``barebox`` must be erased before the stripped
    image is written. The erase size depends on the stripped image size but
    always start at offset 0.

  - Write the stripped barebox image to the QSPI NOR partition ``barebox``
    at offset 0.

The ``barebox_update`` command takes care of this and need just be
supplied a barebox image as argument.