Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linux-lmp-fslc-imx 6.6 #1457

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions meta-lmp-base/classes/lmp-staging.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@ LMPSTAGING_INHERIT_KERNEL_MODSIGN = ""

LMPSTAGING_LOCK_TO_AVOID_OOM = "clang-native rust-native rust-llvm-native"

LMPSTAGING_KERN_ADD_ST_SUBDIR = ""

python __anonymous() {
pn = d.getVar('PN')

if pn == "linux-lmp" or pn == "linux-lmp-rt":
(major_ver, minor_ver, rest) = d.getVar('LINUX_VERSION').split(".")
if int(major_ver) > 6 or (int(major_ver) == 6 and int(minor_ver) >= 4):
d.setVar('LMPSTAGING_KERN_ADD_ST_SUBDIR', 'st/')

if bb.data.inherits_class('module', d):
d.appendVar('DEPENDS', ' virtual/kernel')
if 'modsign' in d.getVar('DISTRO_FEATURES'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ SUMMARY = "Produces a Manufacturing Tool compatible Linux Kernel"
DESCRIPTION = "Linux Kernel recipe that produces a Manufacturing Tool \
compatible Linux Kernel to be used in updater environment"

KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = "1"

# Use Freescale kernel by default
KERNEL_REPO ?= "git://github.com/Freescale/linux-fslc.git"
KERNEL_REPO_PROTOCOL ?= "https"
Expand Down
2 changes: 2 additions & 0 deletions meta-lmp-base/recipes-kernel/linux/linux-lmp-rt_6.1.bb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include kmeta-linux-lmp-6.1.y.inc

KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = "1"

LINUX_VERSION ?= "6.1.90"
KBRANCH = "linux-v6.1.y-rt"
SRCREV_machine = "2c3f38782b565814ef32e585ce978327ff3dd96d"
Expand Down
34 changes: 33 additions & 1 deletion meta-lmp-base/recipes-kernel/linux/linux-lmp.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
DESCRIPTION = "Common Foundries.io Linux microPlatform Kernel"

PV = "${LINUX_VERSION}+git${SRCPV}"
# Save the original PV as KSHORT_VER for further use
python __anonymous () {
d.setVar('KSHORT_VER', d.getVar("PV"))
d.setVar('PV', d.getVar("LINUX_VERSION") + d.getVar("SRCPV"))
}

KERNEL_FEATURES += "${@bb.utils.contains('MACHINE_FEATURES', 'jailhouse', ' features/jailhouse/jailhouse.scc', '', d)}"

Expand All @@ -26,3 +30,31 @@ do_deploy:append() {
cp -a ${B}/.config ${DEPLOYDIR}/${KERNEL_CONFIG_NAME}
ln -sf ${KERNEL_CONFIG_NAME} ${DEPLOYDIR}/${KERNEL_CONFIG_LINK_NAME}
}

# Backport this function from meta-freescale:
# f06c7376 ("linux: Add compatibility logic for 32-bit dtb move")
# A function to strip the new 32-bit dtb sub-folders in KERNEL_DEVICETREE
# for older kernel builds.
# Set KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = "1" to enable.
KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE ?= "0"
python kernel_devicetree_32bit_compatibility_update() {
import os.path
import re
if d.getVar('KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE') != "1" or d.getVar('TUNE_ARCH') != "arm":
return
input = d.getVar('KERNEL_DEVICETREE').split()
output = ""
stripped = ""
for original in input:
if re.match("^.*/", original):
stripped = os.path.basename(original)
output += stripped + " "
bb.debug(1, "Devicetrees are moved to sub-folder, stripping the sub-folder for older kernel: %s -> %s" % (original, stripped))
else:
output += original + " "
if stripped:
bb.warn("Updating KERNEL_DEVICETREE, removing sub-folders for older kernel. Use -D for more details. Set KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = \"0\" to disable.")
d.setVar('KERNEL_DEVICETREE', output)
}
addhandler kernel_devicetree_32bit_compatibility_update
kernel_devicetree_32bit_compatibility_update[eventmask] = "bb.event.RecipeParsed"
2 changes: 2 additions & 0 deletions meta-lmp-base/recipes-kernel/linux/linux-lmp_6.1.bb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include kmeta-linux-lmp-6.1.y.inc

KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = "1"

LINUX_VERSION ?= "6.1.90"
KBRANCH = "linux-v6.1.y"
SRCREV_machine = "c505f2906af8638a5117f640e934f5f0de121c4b"
Expand Down
10 changes: 5 additions & 5 deletions meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WKS_FILE_DEPENDS:append:beaglebone-yocto = " u-boot-default-script"
PREFERRED_PROVIDER_u-boot-default-script:beaglebone-yocto = "u-boot-ostree-scr-fit"
SOTA_CLIENT_FEATURES:append:beaglebone-yocto = " ubootenv"
OSTREE_KERNEL_ARGS:beaglebone-yocto ?= "console=ttyS0,115200n8 ${OSTREE_KERNEL_ARGS_COMMON}"
KERNEL_DEVICETREE:append:beaglebone-yocto = " am335x-boneblack-wireless.dtb"
KERNEL_DEVICETREE:append:beaglebone-yocto = " ti/omap/am335x-boneblack-wireless.dtb"
IMAGE_BOOT_FILES:beaglebone-yocto = "u-boot.img MLO boot.itb"
KERNEL_IMAGETYPE:beaglebone-yocto = "fitImage"
KERNEL_CLASSES:beaglebone-yocto = " kernel-lmp-fitimage "
Expand Down Expand Up @@ -193,7 +193,7 @@ PREFERRED_VERSION_u-boot-fio:mx6ul-nxp-bsp ?= "imx-2023.04"
# iMX6UL EVK
UBOOT_SIGN_ENABLE:sota:imx6ulevk ?= "1"
SOTA_CLIENT_FEATURES:append:imx6ulevk = " ubootenv"
KERNEL_DEVICETREE:imx6ulevk = "imx6ul-14x14-evk.dtb"
KERNEL_DEVICETREE:imx6ulevk = "nxp/imx/imx6ul-14x14-evk.dtb"
BOOTSCR_LOAD_ADDR:imx6ulevk = "0x85000000"

# iMX6ULL
Expand Down Expand Up @@ -221,7 +221,7 @@ PREFERRED_VERSION_u-boot-fio:mx6ull-nxp-bsp ?= "imx-2023.04"
# iMX6ULL EVK
UBOOT_SIGN_ENABLE:sota:imx6ullevk ?= "1"
SOTA_CLIENT_FEATURES:append:imx6ullevk = " ubootenv"
KERNEL_DEVICETREE:imx6ullevk = "imx6ull-14x14-evk.dtb"
KERNEL_DEVICETREE:imx6ullevk = "nxp/imx/imx6ull-14x14-evk.dtb"
BOOTSCR_LOAD_ADDR:imx6ullevk = "0x85000000"

# iMX8QM
Expand Down Expand Up @@ -637,7 +637,7 @@ LMP_FLASHLAYOUT_BOARD_NAME:stm32mp15-eval = "stm32mp157c-ev1"
LMP_BOOT_FIRMWARE_FILES:stm32mp15-eval = "arm-trusted-firmware/tf-a-stm32mp157c-ev1-emmc.stm32 fip/fip-stm32mp157c-ev1-optee.bin"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append:stm32mp15-eval = " kernel kernel-devicetree u-boot-default-script"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove:sota:stm32mp15-eval = "kernel kernel-devicetree u-boot-default-script"
KERNEL_DEVICETREE:stm32mp15-eval = "${LMPSTAGING_KERN_ADD_ST_SUBDIR}stm32mp157c-ev1-scmi.dtb"
KERNEL_DEVICETREE:stm32mp15-eval = "st/stm32mp157c-ev1-scmi.dtb"
## stm32mp15-disco
TF_A_SIGN_ENABLE:sota:stm32mp15-disco = "1"
UBOOT_SIGN_ENABLE:sota:stm32mp15-disco = "1"
Expand All @@ -659,7 +659,7 @@ WKS_FILE_DEPENDS:remove:stm32mp15-disco = "st-image-bootfs st-image-userfs"
WKS_FILE:stm32mp15-disco = "sdimage-stm32mp157c-dk2-optee.wks.in"
WKS_FILE:sota:stm32mp15-disco = "sdimage-stm32mp157c-dk2-optee-sota.wks.in"
LMP_BOOT_FIRMWARE_FILES:stm32mp15-disco = "arm-trusted-firmware/tf-a-stm32mp157c-dk2-sdcard.stm32 fip/fip-stm32mp157c-dk2-optee.bin"
KERNEL_DEVICETREE:stm32mp15-disco = "${LMPSTAGING_KERN_ADD_ST_SUBDIR}stm32mp157c-dk2-scmi.dtb"
KERNEL_DEVICETREE:stm32mp15-disco = "st/stm32mp157c-dk2-scmi.dtb"
## stm32mp15-eval-sec
SOTA_CLIENT_FEATURES:remove:sota:stm32mp15-eval-sec = "ubootenv"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/linux-lmp-fslc-imx:"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:${THISDIR}/linux-lmp-fslc-imx/${KSHORT_VER}:${THISDIR}/linux-lmp-fslc-imx:"

include linux-lmp-fslc-imx_6.1.bb

Expand Down
21 changes: 21 additions & 0 deletions meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,24 @@ SRC_URI = "${KERNEL_REPO};protocol=${KERNEL_REPO_PROTOCOL};branch=${KERNEL_BRANC
KMETA = "kernel-meta"

include recipes-kernel/linux/linux-lmp.inc

SRC_URI += " \
file://0004-FIO-toup-hwrng-optee-support-generic-crypto.patch \
file://0001-FIO-toimx-of-enable-using-OF_DYNAMIC-without-OF_UNIT.patch \
file://0002-FIO-toup-media-Kconfig-fix-double-VIDEO_DEV.patch \
file://0003-FIO-toup-gpu-drm-cadence-select-hdmi-helper.patch \
file://0004-FIO-toup-media-imx8-select-v4l2_-for-mxc-mipi-csi2_y.patch \
"

SRC_URI:append:imx8mp-lpddr4-evk = " \
${@bb.utils.contains('MACHINE_FEATURES', 'se05x', 'file://0001-FIO-internal-arch-arm64-dts-imx8mp-enable-I2C5-bus.patch', '', d)} \
"

# Add bluetooth support for QCA9377
SRC_URI:append:imx8mm-lpddr4-evk = " \
file://0001-FIO-toup-arm64-dts-imx8mm-evk-qca-wifi-enable-suppor.patch \
"
# Fix bluetooth reset for Murata 1MW
SRC_URI:append:mx8mn-nxp-bsp = " \
file://0001-FIO-internal-arm64-dts-imx8mn-evk.dtsi-re-add-blueto.patch \
"

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From e8bbbc4f7064c794ac28597d4c6227265f6ab47c Mon Sep 17 00:00:00 2001
From: Vanessa Maegima <[email protected]>
Date: Tue, 29 Mar 2022 15:44:59 -0300
Subject: [PATCH] [FIO internal] arch: arm64: dts: imx8mp: enable I2C5 bus

Enable I2C5 bus to connect SE050. I2C5 shares pins with flexcan1, so
disable the latter.

Upstream-Status: Inappropriate [lmp specific]

Signed-off-by: Vanessa Maegima <[email protected]>
Signed-off-by: Oleksandr Suvorov <[email protected]>
---

arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
index 966be019c433b..a14bbd2f163b3 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
@@ -416,7 +416,7 @@ &flexcan1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan1>;
xceiver-supply = <&reg_can1_stby>;
- status = "okay";
+ status = "disabled";
};

&flexcan2 {
@@ -708,7 +708,8 @@ &i2c5 {
clock-frequency = <100000>; /* Lower clock speed for external bus. */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c5>;
- status = "disabled"; /* can1 pins conflict with i2c5 */
+ pinctrl-assert-gpios = <&pca6416 2 GPIO_ACTIVE_HIGH>; /* set high to select i2c5 instead of flexcan1 */
+ status = "okay";

/* GPIO 2 of PCA6416 is used to switch between CAN1 and I2C5 functions:
* LOW: CAN1 (default, pull-down)
--
2.45.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
From 6dfae3007148e9d488c071aed289604f24675299 Mon Sep 17 00:00:00 2001
From: Michael Scott <[email protected]>
Date: Thu, 4 Aug 2022 17:46:13 -0700
Subject: [PATCH] [FIO internal] arm64: dts: imx8mn-evk.dtsi: re-add bluetooth
reset configuration

This fixes the Murata 1MW bluetooth initialization.

Upstream-Status: Inappropriate [lmp specific]

Signed-off-by: Michael Scott <[email protected]>
Signed-off-by: Ricardo Salveti <[email protected]>
Signed-off-by: Oleksandr Suvorov <[email protected]>
---

arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
index c63f8f13b73ba..5fc4705c9a50b 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
@@ -59,6 +59,14 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
enable-active-high;
};

+ modem_reset: modem-reset {
+ compatible = "gpio-reset";
+ reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
+ reset-delay-us = <2000>;
+ reset-post-delay-ms = <40>;
+ #reset-cells = <0>;
+ };
+
ir-receiver {
compatible = "gpio-ir-receiver";
gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
@@ -492,6 +500,7 @@ &uart1 { /* BT */
assigned-clocks = <&clk IMX8MN_CLK_UART1>;
assigned-clock-parents = <&clk IMX8MN_SYS_PLL1_80M>;
uart-has-rtscts;
+ resets = <&modem_reset>;
status = "okay";

bluetooth {
@@ -518,6 +527,21 @@ &usbphynop1 {
wakeup-source;
};

+&usdhc1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default", "state_100mhz", "state_200mhz";
+ pinctrl-0 = <&pinctrl_usdhc1>, <&pinctrl_wlan>;
+ pinctrl-1 = <&pinctrl_usdhc1_100mhz>, <&pinctrl_wlan>;
+ pinctrl-2 = <&pinctrl_usdhc1_200mhz>, <&pinctrl_wlan>;
+ bus-width = <4>;
+ pm-ignore-notify;
+ keep-power-in-suspend;
+ non-removable;
+ cap-power-off-card;
+ wakeup-source;
+};
+
&usbotg1 {
dr_mode = "otg";
hnp-disable;
@@ -778,6 +802,7 @@ MX8MN_IOMUXC_UART1_RXD_UART1_DCE_RX 0x140
MX8MN_IOMUXC_UART1_TXD_UART1_DCE_TX 0x140
MX8MN_IOMUXC_UART3_RXD_UART1_DCE_CTS_B 0x140
MX8MN_IOMUXC_UART3_TXD_UART1_DCE_RTS_B 0x140
+ MX8MN_IOMUXC_SD1_DATA4_GPIO2_IO6 0x19
>;
};

--
2.45.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 00bdc23848a76b2cf15cbfe382e26dd24543e0c9 Mon Sep 17 00:00:00 2001
From: Oleksandr Suvorov <[email protected]>
Date: Tue, 30 May 2023 18:04:50 +0300
Subject: [PATCH 2/4] [FIO toup] media: Kconfig: fix double VIDEO_DEV

The VIDEO_IMX_MEDIA dependency of VIDEO_DEV has 2 entries.
Remove a duplicate.

Upstream-Status: Pending

Fixes: commit 9958d30f38b96 ("media: Kconfig: cleanup VIDEO_DEV dependencies")
Signed-off-by: Oleksandr Suvorov <[email protected]>
Signed-off-by: Oleksandr Suvorov <[email protected]>
---

drivers/staging/media/imx/Kconfig | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig
index 4d67f6a017359..1d28658be8563 100644
--- a/drivers/staging/media/imx/Kconfig
+++ b/drivers/staging/media/imx/Kconfig
@@ -4,7 +4,6 @@ config VIDEO_IMX_MEDIA
depends on ARCH_MXC || COMPILE_TEST
depends on HAS_DMA
depends on VIDEO_DEV
- depends on VIDEO_DEV
depends on IMX_IPUV3_CORE
select MEDIA_CONTROLLER
select V4L2_FWNODE
--
2.45.0

Loading