Skip to contentSkip to conversation

Allow easier use of mainline-based BSP on i.MX products (Nitrogen6x support)

PATCH New Otavio Salvador 1 participant 5 messages Mar 27, 2017

lore
Share & tools
lore
#0 lore raw

v2 cover Allow easier use of mainline-based BSP on i.MX products (Nitrogen6x support)

This patchset makes use of the infrastructure added to meta-freescale to enable easier use of mainline-based BSP. To enable it, include:

MACHINEOVERRIDES .= ":use-mainline-bsp"

To the local.conf and everything is done automatically.

The bootscript still needs some love to work out of box but this will be left for Boundary Devices ;-)

Changes in v2:
- Fix device tree removal list

Otavio Salvador (4):
nitrogen6x: Use weak-default for virtual/kernel
nitrogen6x: Add wic image tool support
nitrogen6x: Add 'use-mainline-bsp' support
u-boot-script-boundary: Minor change for Linux mainline use

 conf/machine/nitrogen6x.conf                       | 22 ++++++++++++-
 ...e-Allow-out-of-box-use-with-Yocto-Project.patch | 38 ++++++++++++++++++++++
 recipes-bsp/u-boot/u-boot-script-boundary_git.bb   |  3 +-
 3 files changed, 61 insertions(+), 2 deletions(-)
 create mode 100644 recipes-bsp/u-boot/u-boot-script-boundary/mainline-Allow-out-of-box-use-with-Yocto-Project.patch
Signature · 1 line
2.12.1
#1 lore raw

PATCH v2 1/4 nitrogen6x: Use weak-default for virtual/kernel

The virtual/kernel sometimes need to be overriden, adding the weak-default allow for easier handler of different providers.

---

Changes in v2: None

 conf/machine/nitrogen6x.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
conf/machine/nitrogen6x.conf +1 -1
index f9b6cab..f35460d 100644
@@ -43,7 +43,7 @@ KERNEL_DEVICETREE = "imx6q-sabrelite.dtb \
 KERNEL_IMAGETYPE = "zImage"
 
 PREFERRED_PROVIDER_u-boot = "u-boot-boundary"
-PREFERRED_PROVIDER_virtual/kernel ?= "linux-boundary"
+PREFERRED_PROVIDER_virtual/kernel ??= "linux-boundary"
 
 # Use SPI NOR U-Boot by default
 IMAGE_BOOTLOADER ?= ""
Signature · 1 line
2.12.1
#2 lore raw

PATCH v2 2/4 nitrogen6x: Add wic image tool support

In reply to Otavio Salvador

The wic image needs to install the bootscript and it loads the respective kernel image and device-tree files from the image, thus those need to be included.

---

Changes in v2: None

 conf/machine/nitrogen6x.conf | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
conf/machine/nitrogen6x.conf +15 -0
index f35460d..8af1b1f 100644
@@ -54,10 +54,25 @@ do_rootfs[depends] += "u-boot-script-boundary:do_deploy"
 # Boot scripts to install
 BOOT_SCRIPTS = "6x_bootscript-${MACHINE}:6x_bootscript"
 
+# wic support
+WKS_FILE ?= "sdimage-bootpart.wks"
+IMAGE_BOOT_FILES = " \
+    6x_bootscript-${MACHINE};6x_bootscript \
+    ${KERNEL_IMAGETYPE} \
+    ${KERNEL_IMAGETYPE}-imx6q-sabrelite.dtb;imx6q-sabrelite.dtb \
+    ${KERNEL_IMAGETYPE}-imx6q-nitrogen6_max.dtb;imx6q-nitrogen6_max.dtb ${KERNEL_IMAGETYPE}-imx6qp-nitrogen6_max.dtb;imx6qp-nitrogen6_max.dtb \
+    ${KERNEL_IMAGETYPE}-imx6q-nitrogen6x.dtb;imx6q-nitrogen6x.dtb ${KERNEL_IMAGETYPE}-imx6dl-nitrogen6x.dtb;imx6dl-nitrogen6x.dtb \
+"
+IMAGE_DEPENDS_wic_append = " dosfstools-native mtools-native"
+
 UBOOT_MACHINE ?= "nitrogen6q_config"
 
 SERIAL_CONSOLE = "115200 ttymxc1"
 
 MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-wl12xx"
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " \
+    kernel-image \
+    kernel-devicetree \
+"
 
 MACHINE_FEATURES += " pci wifi bluetooth"
Signature · 1 line
2.12.1
#3 lore raw

PATCH v2 3/4 nitrogen6x: Add 'use-mainline-bsp' support

In reply to Otavio Salvador

The 'use-mainline-bsp' makes use of linux-fslc as kernel and removes the not yet supported device-tree files from installation set.

---

Changes in v2:
- Fix device tree removal list

 conf/machine/nitrogen6x.conf | 5 +++++
 1 file changed, 5 insertions(+)
conf/machine/nitrogen6x.conf +5 -0
index 8af1b1f..1bf5481 100644
@@ -40,10 +40,15 @@ KERNEL_DEVICETREE = "imx6q-sabrelite.dtb \
                         imx6q-nitrogen6_som2.dtb imx6qp-nitrogen6_som2.dtb \
                         imx6dl-nitrogen6_vm.dtb imx6dl-nitrogen6_vm-magstripe.dtb \
 "
+
+# Not yet supported by Linux mainline
+KERNEL_DEVICETREE_remove_use-mainline-bsp = "imx6dl-nitrogen6_vm.dtb imx6dl-nitrogen6_vm-magstripe.dtb"
+
 KERNEL_IMAGETYPE = "zImage"
 
 PREFERRED_PROVIDER_u-boot = "u-boot-boundary"
 PREFERRED_PROVIDER_virtual/kernel ??= "linux-boundary"
+PREFERRED_PROVIDER_virtual/kernel_use-mainline-bsp ??= "linux-fslc"
 
 # Use SPI NOR U-Boot by default
 IMAGE_BOOTLOADER ?= ""
Signature · 1 line
2.12.1
#4 lore raw

PATCH v2 4/4 u-boot-script-boundary: Minor change for Linux mainline use

In reply to Otavio Salvador

To allow an out of box experience, the bootscript of Linux mainline requires minor changes. Those were done as a patch so can be easily removed when Boundary Devices updates it.

---

Changes in v2: None

 ...e-Allow-out-of-box-use-with-Yocto-Project.patch | 38 ++++++++++++++++++++++
 recipes-bsp/u-boot/u-boot-script-boundary_git.bb   |  3 +-
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 recipes-bsp/u-boot/u-boot-script-boundary/mainline-Allow-out-of-box-use-with-Yocto-Project.patch
recipes-bsp/u-boot/u-boot-script-boundary/mainline-Allow-out-of-box-use-with-Yocto-Project.patch new file +38 -0
new file mode 100644
index 0000000..8c9709c
@@ -0,0 +1,38 @@
+From 248f84cbdb5b9ffd0f0f2f91f11edb458ef6948d Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <[email protected]>
+Date: Sat, 25 Mar 2017 10:25:00 -0300
+Subject: [PATCH] mainline: Allow out of box use with Yocto Project
+Organization: O.S. Systems Software LTDA.
+
+Signed-off-by: Otavio Salvador <[email protected]>
+---
+ board/boundary/nitrogen6x/6x_bootscript-mainline.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/board/boundary/nitrogen6x/6x_bootscript-mainline.txt b/board/boundary/nitrogen6x/6x_bootscript-mainline.txt
+index 35cb4cdbcd4..6ff523056a3 100644
+--- a/board/boundary/nitrogen6x/6x_bootscript-mainline.txt
++++ b/board/boundary/nitrogen6x/6x_bootscript-mainline.txt
+@@ -47,8 +47,8 @@ if load ${dtype} ${disk}:1 ${a_script} uEnv.txt ; then
+     env import -t ${a_script} ${filesize}
+ fi
+ 
+-if itest.s x == x${bootdir} ; then
+-	bootdir=/boot/
++if itest.s x == "x${bootdir}" ; then
++	bootdir=/
+ fi
+ 
+ if load ${dtype} ${disk}:${bootpart} ${a_fdt} ${bootdir}${dtbname} ; then
+@@ -108,7 +108,7 @@ if itest.s "x" == "x${root}"; then
+ 	if test "sata" = "${dtype}" || test "usb" = "${dtype}" ; then
+ 		root=/dev/sda${bootpart}
+ 	else
+-		root=/dev/mmcblk${disk}p${bootpart}
++		root=/dev/mmcblk1p2
+ 	fi
+ fi
+ 
+-- 
+2.12.1
+
recipes-bsp/u-boot/u-boot-script-boundary_git.bb +2 -1
index d3ba7a8..5de4c71 100644
@@ -6,7 +6,8 @@ PV = "v2016.03+git${SRCPV}"
 
 SRCREV = "d4aa4cce1f7fbd5df8e2cac72996826a8a096dac"
 SRCBRANCH = "boundary-v2016.03"
-SRC_URI = "git://github.com/boundarydevices/u-boot-imx6.git;branch=${SRCBRANCH}"
+SRC_URI = "git://github.com/boundarydevices/u-boot-imx6.git;branch=${SRCBRANCH} \
+           file://mainline-Allow-out-of-box-use-with-Yocto-Project.patch"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.12.1