diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2022-02-18 19:43:56 -0300 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2022-02-21 20:06:28 -0300 |
commit | 30f5ce1d2168389295b4813e01898c2fb0f9bab9 (patch) | |
tree | f6f78dbf8e5eef40510739dc1db79d60f05189fb /classes | |
parent | a3b102a9ed12ea03e72f713ed40968da1776c6d3 (diff) | |
download | meta-freescale-30f5ce1d2168389295b4813e01898c2fb0f9bab9.tar.gz |
Generalize overrides subsystem for NXP and Mainline support
Essentially, we extend the overrides to a generic-bsp, nxp-bsp, and
mainline-bsp.
So, for example, the mx8mq override is split into:
- imx-generic-bsp: compatible with every i.MX SoC and both BSP variants
- imx-nxp-bsp: compatible with every i.MX SoC but specific to NXP BSP
- imx-mainline-bsp: compatible with every i.MX SoC but specific to Mainline BSP
- mx8-generic-bsp: compatible with every i.MX8 SoC and both BSP variants
- mx8-nxp-bsp: compatible with every i.MX8 SoC but specific to NXP BSP
- mx8-mainline-bsp: compatible with every i.MX8 SoC but specific to Mainline BSP
- mx8m-generic-bsp: compatible with every i.MX8M SoC and both BSP variants
- mx8m-nxp-bsp: compatible with every i.MX8M SoC but specific to NXP BSP
- mx8m-mainline-bsp: compatible with every i.MX8M SoC but specific to Mainline BSP
- mx8mq-generic-bsp: compatible with every i.MX8MQ SoC and both BSP variants
- mx8mq-nxp-bsp: compatible with every i.MX8MQ SoC8 but specific to NXP BSP
- mx8mq-mainline-bsp: compatible with every i.MX8MQ SoC but specific to Mainline BSP
The extender mechanism is responsible for extending the override list to
include the generic overrides. We can then use the three different
variants to handle the metadata correctly.
Generically speaking, the conversion mainly was automated (with a lot of
back and forth until getting it right).
To convert an existing layer, the following script can be used:
```sh
git ls-files classes recipes-* \
| xargs sed -i \
-e 's,:\(mx[6-8]\w*\),:\1-nxp-bsp,g' \
-e 's,(\(mx[6-8]\w*\)),(\1-nxp-bsp),g' \
-e 's,\(mx[6-8]\w*\)|,\1-nxp-bsp|,g' \
-e 's,|\(mx[6-8]\w*\)),|\1-nxp-bsp),g' \
\
-e 's,:\(mx[5s]\w*\),:\1-generic-bsp,g' \
-e 's,(\(mx[5s]\w*\)),(\1-generic-bsp),g' \
-e 's,\(mx[5s]\w*\)|,\1-generic-bsp|,g' \
-e 's,|\(mx[5s]\w*\)),|\1-generic-bsp),g' \
\
-e 's,:\(vf\w*\),:\1-generic-bsp,g' \
-e 's,:\(vf[56]0\w*\),:\1-generic-bsp,g' \
-e 's,\(vf\w*\)|,\1-generic-bsp|,g' \
-e 's,|\(vf\w*\)),|\1-generic-bsp),g' \
-e 's,\(vf[56]0\w*\)|,\1-generic-bsp|,g' \
-e 's,|\(vf[56]0\w*\)),|\1-generic-bsp),g' \
\
-e 's,:\(imx\) ,:\1-nxp-bsp ,g' \
-e 's,(\(imx\)),(\1-nxp-bsp),g' \
-e 's,\(imx\)|,\1-nxp-bsp|,g' \
-e 's,|\(imx\)),|\1-nxp-bsp),g'
for d in $(find -type d | egrep '/mx[6-8]w*'); do
git mv $d $d-nxp-bsp
done
for d in $(find -type d | egrep '/imx$'); do
git mv $d $d-nxp-bsp
done
for d in $(find -type d | egrep '/mx[5s]w*'); do
git mv $d $d-generic-bsp
done
```
Fixes: #791.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_fsl.bbclass | 2 | ||||
-rw-r--r-- | classes/mfgtool-initramfs-image.bbclass | 2 | ||||
-rw-r--r-- | classes/use-imx-headers.bbclass | 4 | ||||
-rw-r--r-- | classes/use-imx-security-controller-firmware.bbclass | 8 |
4 files changed, 8 insertions, 8 deletions
diff --git a/classes/image_types_fsl.bbclass b/classes/image_types_fsl.bbclass index cdd16a66..cdfbb97e 100644 --- a/classes/image_types_fsl.bbclass +++ b/classes/image_types_fsl.bbclass | |||
@@ -37,7 +37,7 @@ do_image_wic[depends] += " \ | |||
37 | " | 37 | " |
38 | 38 | ||
39 | # We need to apply a fixup inside of the partition table | 39 | # We need to apply a fixup inside of the partition table |
40 | IMAGE_CMD:wic:append:mxs() { | 40 | IMAGE_CMD:wic:append:mxs-generic-bsp() { |
41 | # Change partition type for mxs processor family | 41 | # Change partition type for mxs processor family |
42 | bbnote "Setting partition type to 0x53 as required for mxs' SoC family." | 42 | bbnote "Setting partition type to 0x53 as required for mxs' SoC family." |
43 | echo -n S | dd of=$out${IMAGE_NAME_SUFFIX}.wic bs=1 count=1 seek=450 conv=notrunc | 43 | echo -n S | dd of=$out${IMAGE_NAME_SUFFIX}.wic bs=1 count=1 seek=450 conv=notrunc |
diff --git a/classes/mfgtool-initramfs-image.bbclass b/classes/mfgtool-initramfs-image.bbclass index 1d4c5513..deae9c93 100644 --- a/classes/mfgtool-initramfs-image.bbclass +++ b/classes/mfgtool-initramfs-image.bbclass | |||
@@ -13,7 +13,7 @@ FEATURE_PACKAGES_extfs = "packagegroup-fsl-mfgtool-extfs" | |||
13 | FEATURE_PACKAGES_f2fs = "packagegroup-fsl-mfgtool-f2fs" | 13 | FEATURE_PACKAGES_f2fs = "packagegroup-fsl-mfgtool-f2fs" |
14 | 14 | ||
15 | IMAGE_FSTYPES = "cpio.gz.u-boot" | 15 | IMAGE_FSTYPES = "cpio.gz.u-boot" |
16 | IMAGE_FSTYPES:mxs = "cpio.gz.u-boot" | 16 | IMAGE_FSTYPES:mxs-generic-bsp = "cpio.gz.u-boot" |
17 | IMAGE_ROOTFS_SIZE ?= "8192" | 17 | IMAGE_ROOTFS_SIZE ?= "8192" |
18 | 18 | ||
19 | # Filesystems enabled by default | 19 | # Filesystems enabled by default |
diff --git a/classes/use-imx-headers.bbclass b/classes/use-imx-headers.bbclass index c6c7f043..4baf4574 100644 --- a/classes/use-imx-headers.bbclass +++ b/classes/use-imx-headers.bbclass | |||
@@ -13,14 +13,14 @@ | |||
13 | # | 13 | # |
14 | # Copyright 2018 (C) O.S. Systems Software LTDA. | 14 | # Copyright 2018 (C) O.S. Systems Software LTDA. |
15 | 15 | ||
16 | DEPENDS:append:imx = " linux-imx-headers" | 16 | DEPENDS:append:imx-nxp-bsp = " linux-imx-headers" |
17 | 17 | ||
18 | # Set runtime dependency of -dev for package inheriting this class to | 18 | # Set runtime dependency of -dev for package inheriting this class to |
19 | # linux-imx-headers-dev package. This is required in order to propagate | 19 | # linux-imx-headers-dev package. This is required in order to propagate |
20 | # headers into the SDK | 20 | # headers into the SDK |
21 | RDEPENDS:${PN}-dev += "linux-imx-headers-dev" | 21 | RDEPENDS:${PN}-dev += "linux-imx-headers-dev" |
22 | 22 | ||
23 | PACKAGE_ARCH:imx ?= "${MACHINE_SOCARCH}" | 23 | PACKAGE_ARCH:imx-nxp-bsp ?= "${MACHINE_SOCARCH}" |
24 | 24 | ||
25 | STAGING_INCDIR_IMX = "${STAGING_INCDIR}/imx" | 25 | STAGING_INCDIR_IMX = "${STAGING_INCDIR}/imx" |
26 | 26 | ||
diff --git a/classes/use-imx-security-controller-firmware.bbclass b/classes/use-imx-security-controller-firmware.bbclass index 9650059b..bdbf3684 100644 --- a/classes/use-imx-security-controller-firmware.bbclass +++ b/classes/use-imx-security-controller-firmware.bbclass | |||
@@ -18,14 +18,14 @@ | |||
18 | 18 | ||
19 | SECO_FIRMWARE_NAME ?= "" | 19 | SECO_FIRMWARE_NAME ?= "" |
20 | 20 | ||
21 | SECO_FIRMWARE_NAME:mx8qm = "mx8qmb0-ahab-container.img" | 21 | SECO_FIRMWARE_NAME:mx8qm-nxp-bsp = "mx8qmb0-ahab-container.img" |
22 | SECO_FIRMWARE_NAME:mx8qxp = \ | 22 | SECO_FIRMWARE_NAME:mx8qxp-nxp-bsp = \ |
23 | "${@bb.utils.contains('MACHINE_FEATURES', 'soc-revb0', 'mx8qxb0-ahab-container.img', \ | 23 | "${@bb.utils.contains('MACHINE_FEATURES', 'soc-revb0', 'mx8qxb0-ahab-container.img', \ |
24 | 'mx8qxc0-ahab-container.img', d)}" | 24 | 'mx8qxc0-ahab-container.img', d)}" |
25 | SECO_FIRMWARE_NAME:mx8dxl = "mx8dxla1-ahab-container.img" | 25 | SECO_FIRMWARE_NAME:mx8dxl-nxp-bsp = "mx8dxla1-ahab-container.img" |
26 | 26 | ||
27 | python () { | 27 | python () { |
28 | if "mx8m" in d.getVar('MACHINEOVERRIDES').split(":"): | 28 | if "mx8m-nxp-bsp" in d.getVar('MACHINEOVERRIDES').split(":"): |
29 | return # We need to allow the recipes to be parsed for this case | 29 | return # We need to allow the recipes to be parsed for this case |
30 | 30 | ||
31 | seco_firmware = d.getVar('SECO_FIRMWARE_NAME') | 31 | seco_firmware = d.getVar('SECO_FIRMWARE_NAME') |