Skip to content

Commit 60df55f

Browse files
committed
synchronise with lx2160a_build and restructure - tested on one board
1 parent 9c36e3e commit 60df55f

31 files changed

Lines changed: 1446 additions & 158 deletions

README.md

Lines changed: 75 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,11 @@ Start in a **new empty directory** with plenty of free disk space - at least 30G
1414

1515
2. apply downstream patches to dependent layers:
1616

17-
- `poky`: add support for wic images without partition table (for xspi image)
18-
19-
```
20-
pushd sources/poky
21-
git am ../meta-solidrun-arm-lx2xxx/patches/poky/0001-wic-add-supppport-for-generating-images-without-part.patch
22-
popd
23-
```
17+
TBD.
2418

2519
3. Initialise a build directory with example configuration files based on lx2160ardb, and appropriate shell environment variables:
2620

27-
source ./setup-env -m lx2160ardb-rev2 -b build_lx2160a-rev2-honeycomb
21+
source ./setup-env -m lx2160ardb-rev2 -b build
2822

2923
4. Adapt example configuration files for SolidRun LX2160A Honeycomb:
3024

@@ -43,47 +37,30 @@ Start in a **new empty directory** with plenty of free disk space - at least 30G
4337
+MACHINE ??= 'lx2160a-rev2-honeycomb'
4438
```
4539

40+
Enable generating sd bootable image (wic). append:
41+
42+
```
43+
IMAGE_FSTYPES:append = " wic.gz wic.bmap "
44+
# break dependency cycle with core-image-minimal used as initramfs
45+
IMAGE_FSTYPES:remove:pn-core-image-minimal = "wic.gz wic.bmap"
46+
```
47+
4648
- See below for additional configuration options.
4749

4850
5. Build nxp image `fsl-image-networking`:
4951

5052
bitbake fsl-image-networking
5153

52-
6. Generate bootable disk image:
53-
54-
NXP QorIQ Layers by default do not assemble full bootable disk images,
55-
users are expected to install all components to various offsets manually.
56-
57-
SolidRun provides [wic](https://docs.yoctoproject.org/dev/dev-manual/wic.html) configuration files for generating bootable disk images from the build artifacts.
58-
This process can be launched after a successful build:
59-
60-
- SD-Card / eMMC (includes rootfs):
61-
62-
wic create lx2160a-bootimg-mmc -e fsl-image-networking
54+
6. Find resulting image ready for programming:
6355

64-
This generates a bootable disk image named `lx2160a-bootimg-mmc.wks-<timestamp>-mmcblk.direct` that is suitable
65-
for writing to SD-Card or eMMC data partition, from the previously built `fsl-image-networking` target.
66-
67-
- SPI Flash (without rootfs):
68-
69-
wic create lx2160a-bootimg-xspi -e fsl-image-networking
70-
71-
This generates a bootable spi flash image named `lx2160a-bootimg-xspi.wks-<timestamp>-mmcblk.direct` that is suitable
72-
for writing to SPI flash, from the previously built `fsl-image-networking` target's bootloader parts.
73-
74-
- SD-Card / eMMC / USB / SATA / NVMe (rootfs only):
75-
76-
wic create lx2160a-rootimg -e fsl-image-networking
77-
78-
This generates a bootable disk image named `lx2160a-rootimg.wks-<timestamp>-mmcblk.direct` that is suitable
79-
for writing to any block storage, from the previously built `fsl-image-networking`.
80-
It comes with kernel + rootfs only, use on separate media, together with an SD or SPI boot image.
56+
ls -lh tmp/deploy/images/
57+
ls -lh tmp/deploy/images/lx2160a-clearfog-cx/
8158

8259
Note: The build environment and ability to run `bitbake` is lost when closing the terminal or rebooting.
8360
It can be restored at any time by entering the build directory and sourcing the aut-generated `SOURCE_THIS` file:
8461

8562
```
86-
cd <insert-your-workdir>/build_lx2160acex7-rev2
63+
cd <insert-your-workdir>/build
8764
source SOURCE_THIS
8865
```
8966
@@ -100,7 +77,9 @@ This Layer supports the following machines:
10077
| lx2160a-rev2-cex6-evb | SolidRun-internal Evaluation Board, LX2160A Silicon 2.0 (production version) |
10178
| lx2160a-rev2-clearfog-cx | LX2160A COM-Express 7 on Clearfog-CX, LX2160A Silicon 2.0 (production version) |
10279
| lx2160a-rev2-honeycomb | LX2160A COM-Express 7 on Honeycomb, LX2160A Silicon 2.0 (production version) |
80+
| lx2160a-rev2-half-twins | LX2160A COM-Express 7 on Twins, LX2160A Silicon 2.0 (production version) |
10381
| lx2162a-rev2-clearfog | LX2162A SoM on Clearfog |
82+
| lx216xa-solidrun | Generic LX2160A & LX2162A without Bootloader |
10483
10584
### Supported Images
10685
@@ -111,6 +90,14 @@ This Layer supports the following images:
11190
| fsl-image-networking | Typical networking features and basic cli utilities |
11291
| fsl-image-networking-full | Demo of all packages tested by NXP including dpdk, dpdk examples and vpp |
11392
93+
### Image Types (wic)
94+
95+
This layer can generate a range of image types by `WKS_FILE` in local.conf:
96+
97+
- `lx2160a-bootimg-mmc.wks.in` (default): Bootloader & Kernel & RootFS, for SD or eMMC.
98+
- `lx2160a-bootimg-xspi.wks.in`: Bootloader only, for SPI Flash.
99+
- `lx2160a-rootimg.wks.in`: Kernel & RootFS only, for any block storage.
100+
114101
### DDR Clock
115102
116103
DDR Clock can be configured in local.conf using `LX2160A_DDR_SPEED`, supported values are:
@@ -152,6 +139,57 @@ Additional configurations are added by patching `mc-utils` package and adding fi
152139
153140
## Known Issues
154141
142+
### `setup-env` script requires bash
143+
144+
On shells other than bash the nxp `setup-env` script fails unintuitively, e.g. below with zsh:
145+
146+
```
147+
source ./setup-env -m lx2160ardb-rev2 -b build
148+
./setup-env:159: no matches found: /opt/workspace/YOCTO/lx2k-scarthgap/sources/meta-fsl*/*/*/conf/machine
149+
lx2160ardb-rev2 is not supported by this build setup.
150+
Usage: . setup-env -m <machine>
151+
usage:3: no matches found: /opt/workspace/YOCTO/lx2k-scarthgap/sources/meta-fsl*/*/*/conf/machine
152+
153+
Supported machines:
154+
155+
156+
Optional parameters:
157+
* [-m machine]: the target machine to be built.
158+
* [-j jobs]: number of jobs for make to spawn during the compilation stage.
159+
* [-t tasks]: number of BitBake tasks that can be issued in parallel.
160+
* [-b path]: non-default path of project build folder.
161+
* [-d path]: non-default path of DL_DIR (downloaded source)
162+
* [-c path]: non-default path of SSTATE_DIR (shared state Cache)
163+
* [-h]: help
164+
```
165+
166+
Ensure using a `bash` shell.
167+
168+
### permission error in disable_network
169+
170+
Bitbake can fail with a confusing permission error while trying to disable it's child processes network access:
171+
172+
```
173+
ERROR: PermissionError: [Errno 1] Operation not permitted
174+
175+
During handling of the above exception, another exception occurred:
176+
177+
Traceback (most recent call last):
178+
File "/opt/workspace/YOCTO/imx8-scarthgap/sources/poky/bitbake/bin/bitbake-worker", line 278, in child
179+
bb.utils.disable_network(uid, gid)
180+
File "/opt/workspace/YOCTO/imx8-scarthgap/sources/poky/bitbake/lib/bb/utils.py", line 1696, in disable_network
181+
with open("/proc/self/uid_map", "w") as f:
182+
PermissionError: [Errno 1] Operation not permitted
183+
184+
ERROR: Task (virtual:native:/opt/workspace/YOCTO/imx8-scarthgap/sources/poky/meta/recipes-devtools/autoconf/autoconf_2.72e.bb:do_unpack) failed with exit code '1'
185+
```
186+
187+
See [Ubuntu Bug 2056555](https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2056555) for more details.
188+
189+
As a workaround apparmor "unprivileged_userns" profile can be temporarily disabled:
190+
191+
sudo apparmor_parser -R /etc/apparmor.d/unprivileged_userns
192+
155193
## Maintainer Notes
156194
157195
### Patching Linux / U-Boot / ATF / RCW / DPL / DPC / etc.:

conf/machine/include/lx2160a-clearfog-cx.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ KERNEL_DEVICETREE ?= " \
33
freescale/fsl-lx2160a-clearfog-cx.dtb \
44
freescale/fsl-lx2160a-honeycomb.dtb \
55
"
6-
# HACK: place copy of kernel dtb in vendor subfolder as expected by u-boot
6+
7+
# install DTBs with freescale/ prefix
78
IMAGE_BOOT_FILES:append = " \
89
fsl-lx2160a-clearfog-cx.dtb;freescale/fsl-lx2160a-clearfog-cx.dtb \
910
fsl-lx2160a-honeycomb.dtb;freescale/fsl-lx2160a-honeycomb.dtb \
1011
"
11-
IMAGE_BOOT_FILES:remove = "${KERNEL_DEVICETREE}"
12+
# HACK: place one sentinel dtb without freescale/ prefix to fix wic image generated extlinux.conf fdtdir path
13+
IMAGE_BOOT_FILES:prepend = " fsl-lx2160a-clearfog-cx.dtb;sentinel.dtb "
1214

1315
# select DPL/DPC (config/lx2160a/LX2160A-<MC_FLAVOUR>/<DPL/DPC>)
1416
# variable consumed in wks files

conf/machine/include/lx2160acex6-rev2.inc

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,31 @@
33
#@SOC: LSCH3
44
#@DESCRIPTION: Machine configuration for SolidRun Internal LX2160A Rev 2.0 COM-Express Type 6 Module
55

6-
require conf/machine/include/qoriq-arm64.inc
7-
DEFAULTTUNE ?= "cortexa72-crypto"
8-
require conf/machine/include/arm/armv8a/tune-cortexa72.inc
9-
10-
MACHINEOVERRIDES =. "lx2160a-cex6:fsl-lsch3:lx2160a:"
11-
12-
MACHINE_FEATURES:append = " optee "
13-
14-
KERNEL_CLASSES = " kernel-fitimage "
15-
KERNEL_IMAGETYPES = "fitImage"
6+
MACHINEOVERRIDES =. "lx2160a-cex6:"
167

178
DTB_LOAD = "0x90000000"
189
UBOOT_ENTRYPOINT = "0x80080000"
1910

20-
UBOOT_CONFIG ?= "tfa-secure-boot tfa"
11+
UBOOT_CONFIG ??= "tfa-secure-boot tfa"
2112
UBOOT_CONFIG[tfa] = "lx2160acex7_tfa_defconfig,,u-boot-dtb.bin"
2213
UBOOT_CONFIG[tfa-secure-boot] = "lx2160ardb_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
2314

24-
KERNEL_DEFCONFIG ?= "defconfig"
25-
26-
SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
27-
SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
15+
ATF_PLATFORM ?= "lx2160acex6"
2816

2917
LX2160A_BUS_SPEED ?= "700"
3018
LX2160A_CPU_SPEED ?= "2000"
3119
LX2160A_DDR_SPEED ?= "2900"
3220

3321
UEFI_XSPIBOOT ?= "LX2160ARDB_EFI_NORBOOT.fd"
3422

35-
EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy uefi qoriq-atf inphi"
36-
USE_VT = "0"
37-
38-
# install the vendor-prefixed dtbs
39-
# Note: must keep the non-prefixed versions in place,
40-
# to ensure bootimg-partition.py does not mess with extlinux.conf fdtdir
41-
IMAGE_BOOT_FILES:append = "${KERNEL_DEVICETREE}"
23+
EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy qoriq-atf"
4224

4325
# select DPL/DPC source (config/lx2160a/LX2160A-<MC_FLAVOUR>)
4426
MC_FLAVOUR ?= "CEX6"
4527

4628
# select rev2 rcw
4729
RCW_FOLDER ?= "lx2160acex6_rev2"
30+
RCW_BOARDS ?= "lx2160acex6_rev2"
31+
32+
# generate sd-bootable wic image
33+
WKS_FILE ?= "lx2160a-bootimg-mmc.wks.in"

conf/machine/include/lx2160acex7.inc

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,30 @@
33
#@SOC: LSCH3
44
#@DESCRIPTION: Machine configuration for SolidRun LX2160A Rev 1.0 COM-Express Type 7 Module
55

6-
require conf/machine/include/qoriq-arm64.inc
7-
DEFAULTTUNE ?= "cortexa72-crypto"
8-
require conf/machine/include/arm/armv8a/tune-cortexa72.inc
9-
10-
MACHINEOVERRIDES =. "lx2160a-cex7:fsl-lsch3:lx2160a:"
11-
12-
MACHINE_FEATURES:append = " optee "
13-
14-
KERNEL_CLASSES = " kernel-fitimage "
15-
KERNEL_IMAGETYPES = "fitImage"
6+
MACHINEOVERRIDES =. "lx2160a-cex7:"
167

178
DTB_LOAD = "0x90000000"
189
UBOOT_ENTRYPOINT = "0x80080000"
1910

20-
UBOOT_CONFIG ?= "tfa-secure-boot tfa"
11+
UBOOT_CONFIG ??= "tfa-secure-boot tfa"
2112
UBOOT_CONFIG[tfa] = "lx2160acex7_tfa_defconfig,,u-boot-dtb.bin"
2213
UBOOT_CONFIG[tfa-secure-boot] = "lx2160ardb_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
2314

24-
KERNEL_DEFCONFIG ?= "defconfig"
25-
26-
SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
27-
SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
15+
ATF_PLATFORM ?= "lx2160acex7"
2816

2917
LX2160A_BUS_SPEED ?= "700"
3018
LX2160A_CPU_SPEED ?= "2000"
3119
LX2160A_DDR_SPEED ?= "2900"
3220

3321
UEFI_XSPIBOOT ?= "LX2160ARDB_EFI_NORBOOT.fd"
3422

35-
EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy uefi qoriq-atf inphi"
36-
USE_VT = "0"
37-
38-
# install the vendor-prefixed dtbs
39-
# Note: must keep the non-prefixed versions in place,
40-
# to ensure bootimg-partition.py does not mess with extlinux.conf fdtdir
41-
IMAGE_BOOT_FILES:append = "${KERNEL_DEVICETREE}"
23+
EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy qoriq-atf"
4224

4325
# select DPL/DPC source (config/lx2160a/LX2160A-<MC_FLAVOUR>)
4426
MC_FLAVOUR ?= "CEX7"
4527

4628
RCW_FOLDER ?= "lx2160acex7"
29+
RCW_BOARDS ?= "lx2160acex7 lx2160acex7_rev2"
30+
31+
# generate sd-bootable wic image
32+
WKS_FILE ?= "lx2160a-bootimg-mmc.wks.in"

conf/machine/include/lx2162asom-rev2.inc

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,31 @@
33
#@SOC: LSCH3
44
#@DESCRIPTION: Machine configuration for SolidRun LX2162A Rev 2.0 System on Module
55

6-
require conf/machine/include/qoriq-arm64.inc
7-
DEFAULTTUNE ?= "cortexa72-crypto"
8-
require conf/machine/include/arm/armv8a/tune-cortexa72.inc
9-
10-
MACHINEOVERRIDES =. "lx2162a-som:fsl-lsch3:lx2162a:"
11-
12-
MACHINE_FEATURES:append = " optee "
13-
14-
KERNEL_CLASSES = " kernel-fitimage "
15-
KERNEL_IMAGETYPES = "fitImage"
6+
MACHINEOVERRIDES =. "lx2162a-som:"
167

178
DTB_LOAD = "0x90000000"
189
UBOOT_ENTRYPOINT = "0x80080000"
1910

20-
UBOOT_CONFIG ?= "tfa-secure-boot tfa"
11+
UBOOT_CONFIG ??= "tfa-secure-boot tfa"
2112
UBOOT_CONFIG[tfa] = "lx2160acex7_tfa_defconfig,,u-boot-dtb.bin"
2213
UBOOT_CONFIG[tfa-secure-boot] = "lx2160ardb_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
2314

24-
KERNEL_DEFCONFIG ?= "defconfig"
25-
26-
SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
27-
SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
15+
ATF_PLATFORM ?= "lx2162asom"
2816

2917
LX2160A_BUS_SPEED ?= "650"
3018
LX2160A_CPU_SPEED ?= "2000"
3119
LX2160A_DDR_SPEED ?= "2900"
3220

3321
UEFI_XSPIBOOT ?= "LX2160ARDB_EFI_NORBOOT.fd"
3422

35-
EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy uefi qoriq-atf inphi"
36-
USE_VT = "0"
37-
38-
# install the vendor-prefixed dtbs
39-
# Note: must keep the non-prefixed versions in place,
40-
# to ensure bootimg-partition.py does not mess with extlinux.conf fdtdir
41-
IMAGE_BOOT_FILES:append = "${KERNEL_DEVICETREE}"
23+
EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy qoriq-atf"
4224

4325
# select DPL/DPC source (config/lx2162a/LX2162A-<MC_FLAVOUR>)
4426
MC_FLAVOUR ?= "SOM"
4527

4628
# select rev2 rcw
4729
RCW_FOLDER ?= "lx2162asom_rev2"
30+
RCW_BOARDS ?= "lx2162asom_rev2"
31+
32+
# generate sd-bootable wic image
33+
WKS_FILE ?= "lx2160a-bootimg-mmc.wks.in"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require conf/machine/include/qoriq-arm64.inc
2+
DEFAULTTUNE ?= "cortexa72-crypto"
3+
require conf/machine/include/arm/armv8a/tune-cortexa72.inc
4+
5+
MACHINEOVERRIDES =. "fsl-lsch3:lx2160a:"
6+
7+
MACHINE_FEATURES:append = " optee "
8+
9+
KERNEL_CLASSES = " kernel-fitimage "
10+
KERNEL_IMAGETYPES = "fitImage"
11+
12+
KERNEL_DEFCONFIG ?= "defconfig"
13+
14+
SERIAL_CONSOLES ?= "115200;ttyAMA0"
15+
SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
16+
17+
USE_VT = "0"

conf/machine/lx2160a-clearfog-cx.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
#@SOC: LSCH3
44
#@DESCRIPTION: Machine configuration for SolidRun LX2160A 1.0 Clearfog CX Board
55

6+
require conf/machine/include/lx216xa-solidrun.inc
67
require conf/machine/include/lx2160acex7.inc
78
require conf/machine/include/lx2160a-clearfog-cx.inc
9+
10+
UBOOT_FDT ?= "fsl-lx2160a-clearfog-cx"
11+
UBOOT_FDT_FILE ?= "freescale/fsl-lx2160a-clearfog-cx.dtb"

conf/machine/lx2160a-honeycomb.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
#@SOC: LSCH3
44
#@DESCRIPTION: Machine configuration for SolidRun LX2160A 1.0 Honeycomb Board
55

6+
require conf/machine/include/lx216xa-solidrun.inc
67
require conf/machine/include/lx2160acex7.inc
78
require conf/machine/include/lx2160a-clearfog-cx.inc
9+
10+
UBOOT_FDT ?= "fsl-lx2160a-honeycomb"
11+
UBOOT_FDT_FILE ?= "freescale/fsl-lx2160a-honeycomb.dtb"

0 commit comments

Comments
 (0)