aboutsummaryrefslogtreecommitdiff
path: root/docs/juno/user-guide.rst
blob: b079352c6dcdc3405365bcf47ca5a32cab20cb78 (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
Juno platform software user guide
=================================


.. section-numbering::
    :suffix: .

.. contents::


Notice
---------------
The Juno software stack uses the `Yocto project <https://www.yoctoproject.org/>`__
to build a Board Support Package (BSP) and the Poky Linux distribution.
The Yocto project uses `Bitbake <https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html>`__
to build the software stack.


Prerequisites
-------------

These instructions assume that:
 * Your host PC is running Ubuntu Linux 18.04 LTS.
 * You are running the provided scripts in a ``bash`` shell environment.

The following utilities must be available on your host PC:
 * chrpath
 * compression library
 * diffstat
 * gawk
 * makeinfo
 * openssl headers
 * pip
 * repo
 * yocto

To resolve these dependencies, run:

::


    sudo apt-get update
    sudo apt-get install chrpath gawk texinfo libssl-dev diffstat wget git-core unzip gcc-multilib \
    build-essential socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils \
    iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm git-lfs openssl \
    curl libncurses-dev libz-dev python-pip repo


Note that this software has been tested with
 * repo version 2.11
 * python version 2.7

Provided components
-------------------
Within the Yocto project, each component included in the Juno software stack is specified as
a `bitbake recipe <https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html#recipes>`__.
The recipes specific to Juno are located at:
``<workspace>/layers/meta-arm``.



Syncing and Building software stack
-----------------------------------
Create a new folder that will be your workspace, which will henceforth be referred to as ``<workspace>``
in these instructions

::

    mkdir <workspace>
    cd <workspace>
    repo init -u https://git.linaro.org/landing-teams/working/arm/arm-reference-platforms-manifest.git -m juno-yocto.xml -b refs/tags/JUNO-2021.04.27
    repo sync -j$(nproc)
    export DISTRO="poky"
    export MACHINE="juno"
    source setup-environment
    bitbake core-image-minimal

The initial clean build will be lengthy, given that all host utilities are to be built as well as
the target images. This includes host executables (python, cmake, etc.) and the required toolchain(s)

Once the build is successful, all images will be placed in the ``<workspace>/build-poky/tmp-poky/deploy/images/juno``
directory.

Note that the BSP includes the Poky Linux distribution, which offers BusyBox-like utilities.


Software Components
###################

Trusted Firmware-A
******************

Based on `Trusted Firmware-A <https://trustedfirmware-a.readthedocs.io/en/latest/>`__

+--------+----------------------------------------------------------------------------------------------------+
| Recipe | <workspace>/layers/meta-arm/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-juno.inc|
+--------+----------------------------------------------------------------------------------------------------+
| Files  | * <workspace>/build-poky/tmp-poky/deploy/image/juno/bl1.bin                                        |
|        | * <workspace>/build-poky/tmp-poky/deploy/image/juno/fip.bin                                        |
+--------+----------------------------------------------------------------------------------------------------+


System Control Processor (SCP)
******************************

Based on `SCP Firmware <https://github.com/ARM-software/SCP-firmware>`__

+--------+-----------------------------------------------------------------------------------------+
| Recipe | <workspace>/layers/meta-arm/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-juno.inc |
+--------+-----------------------------------------------------------------------------------------+
| Files  | * <workspace>/build-poky/tmp-poky/deploy/image/juno/scp_ramfw.bin                       |
|        | * <workspace>/build-poky/tmp-poky/deploy/image/juno/scp_romfw_bypass.bin                |
+--------+-----------------------------------------------------------------------------------------+


U-Boot
******

Based on `U-Boot gitlab <https://gitlab.denx.de/u-boot/u-boot>`__

+--------+-------------------------------------------------------------------------------------+
| Recipe | <workspace>/layers/meta-arm/meta-arm-bsp/recipes-bsp/u-boot/u-boot_2020.07.bbappend |
+--------+-------------------------------------------------------------------------------------+
| Files  | * <workspace>/build-poky/tmp-poky/deploy/image/juno/u-boot.bin                      |
+--------+-------------------------------------------------------------------------------------+


Linux
*****

The recipe responsible for building a 5.4 version of the Yocto Linux kernel

+--------+-----------------------------------------------------------------------------------+
| Recipe | <workspace>/layers/openembedded-core/meta/recipes-kernel/linux/linux-yocto_5.4.bb |
+--------+-----------------------------------------------------------------------------------+
| Files  | * <workspace>/build-poky/tmp-poky/deploy/image/juno/Image                         |
+--------+-----------------------------------------------------------------------------------+


Poky Linux distro
*****************

The layer is based on the `poky <https://www.yoctoproject.org/software-item/poky/>`__ Linux distribution.
The provided distribution is based on BusyBox and built using glibc.

+--------+----------------------------------------------------------------------------------------------+
| Recipe | <workspace>/layers/openembedded-core/meta/recipes-core/images/core-image-minimal.bb          |
+--------+----------------------------------------------------------------------------------------------+
| Files  | * <workspace>/build-poky/tmp-poky/deploy/image/juno/core-image-minimal-juno.ext4             |
+--------+----------------------------------------------------------------------------------------------+


Running the software on Juno
############################

Copy <workspace>/build-poky/tmp-poky/deploy/image/juno/firmware-image-juno.tar.gz  into Juno SDCARD

::

        Connect Juno's serial port and USB type B port (both on the back panel) to the computer
        Open a terminal emulator (e.g. minicom) on the computer
        Power on the Juno board
        On the terminal emulator:
        Cmd> usb_on

        On the host computer:
        (adjust path to JUNO mount point as necessary):
        rm -rf /media/username/JUNO/* # make a back-up first
        tar -xf <workspace>/build-poky/tmp-poky/deploy/image/juno/firmware-image-juno.tar.gz -C /media/username/JUNO/
        umount /media/username/JUNO/ # may take some time to sync

Disk boot
*********
Prepare a USB stick

Insert a USB stick (min. 8GB) to a computer running Linux, Find out which device it is using "lsblk"
if the usb stick already has non-GPT partitions, please delete all the partitions manually before issuing below command
Write the image to the USB stick and eject:


::

        sudo dd if=<workspace>/build-poky/tmp-poky/deploy/image/juno/core-image-minimal-juno.ext4 of=/dev/sdX bs=1M
        sudo eject /dev/sdX

        Insert the USB stick in Juno board (bottom-right port on the back panel)

        Refer Juno Getting Started documentation
        https://developer.arm.com/tools-and-software/development-boards/juno-development-board


NFS boot
********
Prepare NFS root file system

::

        mkdir /path/to/nfsroot
        cd /path/to/nfsroot
        sudo tar xjf <workspace>/build-poky/tmp-poky/deploy/image/juno/core-image-minimal-juno.tar.bz2 # root is required

        Set up an NFS server and export the nfsroot in /etc/exports:

        /path/to/nfsroot *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)

        Restart the NFS server or run:

        sudo exportfs -a

        configure u-boot bootcmd
        https://community.arm.com/developer/tools-software/oss-platforms/w/docs/542/nfs-remote-network-userspace-using-u-boot

        https://community.arm.com/developer/tools-software/oss-platforms/w/docs/495/tftp-remote-network-kernel-using-u-boot



AArch32 builds for Juno development board
-----------------------------------------

yocto support for juno 32-bit is not supported

--------------

*Copyright (c) 2020, Arm Limited. All rights reserved.*