1.. SPDX-License-Identifier: GPL-2.0+
2.. sectionauthor:: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
3
4Edison
5======
6
7Build Instructions for U-Boot as main bootloader
8------------------------------------------------
9
10Simple you can build U-Boot and obtain u-boot.bin::
11
12   $ make edison_defconfig
13   $ make all
14
15Updating U-Boot on Edison
16-------------------------
17
18By default Intel Edison boards are shipped with preinstalled heavily
19patched U-Boot v2014.04. Though it supports DFU which we may be able to
20use.
21
221. Prepare u-boot.bin as described in chapter above. You still need one
23   more step (if and only if you have original U-Boot), i.e. run the
24   following command::
25
26     $ truncate -s %4096 u-boot.bin
27
282. Run your board and interrupt booting to U-Boot console. In the console
29   call::
30
31     => run do_force_flash_os
32
333. Wait for few seconds, it will prepare environment variable and runs
34   DFU. Run DFU command from the host system::
35
36     $ dfu-util -v -d 8087:0a99 --alt u-boot0 -D u-boot.bin
37
384. Return to U-Boot console and following hint. i.e. push Ctrl+C, and
39   reset the board::
40
41     => reset
42
43Updating U-Boot using xFSTK
44---------------------------
45
46You can also update U-Boot using the xfstk-dldr-solo tool if you can build it.
47One way to do that is to follow the `xFSTK`_ instructions. In short, after you
48install all necessary dependencies and clone repository, it will look like this:
49
50.. code-block:: sh
51
52  cd xFSTK
53  export DISTRIBUTION_NAME=ubuntu20.04
54  export BUILD_VERSION=1.8.5
55  git checkout v$BUILD_VERSION
56  ...
57
58Once you have built it, you can copy xfstk-dldr-solo to /usr/local/bin and
59libboost_program_options.so.1.54.0 to /usr/lib/i386-linux-gnu/ and with luck
60it will work. You might find this `drive`_ helpful.
61
62If it does, then you can download and unpack the Edison recovery image,
63install dfu-util, reset your board and flash U-Boot like this:
64
65.. code-block:: sh
66
67  xfstk-dldr-solo --gpflags 0x80000007 \
68      --osimage u-boot-edison.img \
69      --fwdnx recover/edison_dnx_fwr.bin \
70      --fwimage recover/edison_ifwi-dbg-00.bin \
71      --osdnx recover/edison_dnx_osr.bin
72
73This should show the following
74
75.. code-block:: none
76
77  XFSTK Downloader Solo 1.8.5
78  Copyright (c) 2015 Intel Corporation
79  Build date and time: Aug 15 2020 15:07:13
80
81  .Intel SoC Device Detection Found
82  Parsing Commandline....
83  Registering Status Callback....
84  .Initiating Download Process....
85  .......(lots of dots)........XFSTK-STATUS--Reconnecting to device - Attempt #1
86  .......(even more dots)......................
87
88You have about 10 seconds after resetting the board to type the above command.
89If you want to check if the board is ready, type:
90
91.. code-block:: none
92
93  lsusb | egrep "8087|8086"
94  Bus 001 Device 004: ID 8086:e005 Intel Corp.
95
96If you see a device with the same ID as above, the board is waiting for your
97command.
98
99After about 5 seconds you should see some console output from the board:
100
101.. code-block:: none
102
103  ******************************
104  PSH KERNEL VERSION: b0182b2b
105  		WR: 20104000
106  ******************************
107
108  SCU IPC: 0x800000d0  0xfffce92c
109
110  PSH miaHOB version: TNG.B0.VVBD.0000000c
111
112  microkernel built 11:24:08 Feb  5 2015
113
114  ******* PSH loader *******
115  PCM page cache size = 192 KB
116  Cache Constraint = 0 Pages
117  Arming IPC driver ..
118  Adding page store pool ..
119  PagestoreAddr(IMR Start Address) = 0x04899000
120  pageStoreSize(IMR Size)          = 0x00080000
121
122  *** Ready to receive application ***
123
124After another 10 seconds the xFSTK tool completes and the board resets. About
12510 seconds after that should see the above message again and then within a few
126seconds U-Boot should start on your board:
127
128.. code-block:: none
129
130  U-Boot 2020.10-rc3 (Sep 03 2020 - 18:44:28 -0600)
131
132  CPU:   Genuine Intel(R) CPU   4000  @  500MHz
133  DRAM:  980.6 MiB
134  WDT:   Started with servicing (60s timeout)
135  MMC:   mmc@ff3fc000: 0, mmc@ff3fa000: 1
136  Loading Environment from MMC... OK
137  In:    serial
138  Out:   serial
139  Err:   serial
140  Saving Environment to MMC... Writing to redundant MMC(0)... OK
141  Saving Environment to MMC... Writing to MMC(0)... OK
142  Net:   No ethernet found.
143  Hit any key to stop autoboot:  0
144  Target:blank
145  Partitioning using GPT
146  Writing GPT: success!
147  Saving Environment to MMC... Writing to redundant MMC(0)... OK
148  Flashing already done...
149  5442816 bytes read in 238 ms (21.8 MiB/s)
150  Valid Boot Flag
151  Setup Size = 0x00003c00
152  Magic signature found
153  Using boot protocol version 2.0c
154  Linux kernel version 3.10.17-poky-edison+ (ferry@kalamata) #1 SMP PREEMPT Mon Jan 11 14:54:18 CET 2016
155  Building boot_params at 0x00090000
156  Loading bzImage at address 100000 (5427456 bytes)
157  Magic signature found
158  Kernel command line: "rootwait ..."
159  Magic signature found
160
161  Starting kernel ...
162
163  ...
164
165  Poky (Yocto Project Reference Distro) 1.7.2 edison ttyMFD2
166
167  edison login:
168
169.. _xFSTK: https://github.com/edison-fw/xFSTK
170.. _drive: https://drive.google.com/drive/u/0/folders/1URPHrOk9-UBsh8hjv-7WwC0W6Fy61uAJ
171