From 34bdf31db078a95ee6b18265c606e4e5886160c8 Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Thu, 4 Aug 2022 10:53:40 +0200 Subject: [PATCH 1/7] ssf: sysstate module: Remove SSC_KBUILD_EXTRA_SYMBOLS variable It is suspected that having this variable containing a local path is the reason why when building from sstate, the kernel sometimes need to be rebuild. BugzID: 80858 --- .../system-state-framework/ssc-sysstate-driver_git.bb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes-kernel/system-state-framework/ssc-sysstate-driver_git.bb b/recipes-kernel/system-state-framework/ssc-sysstate-driver_git.bb index e10f177..018b93d 100644 --- a/recipes-kernel/system-state-framework/ssc-sysstate-driver_git.bb +++ b/recipes-kernel/system-state-framework/ssc-sysstate-driver_git.bb @@ -25,7 +25,6 @@ SRC_URI = "\ " S = "${WORKDIR}/git" -SSC_KBUILD_EXTRA_SYMBOLS = "${STAGING_INCDIR}/ssc-broker-driver/Module.symvers" python __anonymous () { depends = d.getVar('DEPENDS') @@ -33,6 +32,6 @@ python __anonymous () { for dep in depends.split(): if dep.startswith("kernel-module-"): extra_symbols.append("${STAGING_INCDIR}/" + dep + "/Module.symvers") - extra_symbols.append(d.getVar("SSC_KBUILD_EXTRA_SYMBOLS")) + extra_symbols.append("${STAGING_INCDIR}/ssc-broker-driver/Module.symvers") d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols)) } From f4fcefbc19fa19e741000a4d5b68c4cf279fce97 Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 16 Aug 2022 11:34:23 +0200 Subject: [PATCH 2/7] Patch lmsensors to support da9063-hwmon driver lmsensors is not able to handle driver names with dashes inside by default. BugzID: 80542 --- ...support-for-driver-names-with-dashes.patch | 138 ++++++++++++++++++ .../lm_sensors/lmsensors_3.6.0.bbappend | 6 + 2 files changed, 144 insertions(+) create mode 100644 recipes-bsp/lm_sensors/lmsensors/0001-libsensors-Fix-support-for-driver-names-with-dashes.patch create mode 100644 recipes-bsp/lm_sensors/lmsensors_3.6.0.bbappend diff --git a/recipes-bsp/lm_sensors/lmsensors/0001-libsensors-Fix-support-for-driver-names-with-dashes.patch b/recipes-bsp/lm_sensors/lmsensors/0001-libsensors-Fix-support-for-driver-names-with-dashes.patch new file mode 100644 index 0000000..e67b543 --- /dev/null +++ b/recipes-bsp/lm_sensors/lmsensors/0001-libsensors-Fix-support-for-driver-names-with-dashes.patch @@ -0,0 +1,138 @@ +From 0992bce0612852dd10006a8e182b4e69361c99dc Mon Sep 17 00:00:00 2001 +From: Alexandre Bard +Date: Fri, 12 Aug 2022 14:32:09 +0200 +Subject: [PATCH] libsensors: Fix support for driver names with dashes + +The dash is used as delimiter in the conversion rules. This works fine +with kernel drivers with simple names like lm75, but some drivers have a +compound name like da9063-hwmon which were not handled properly by these +rules. + +Signed-off-by: Alexandre Bard +--- + lib/data.c | 102 +++++++++++++++++++++++++++++++++-------------------- + 1 file changed, 64 insertions(+), 38 deletions(-) + +diff --git a/lib/data.c b/lib/data.c +index c5aea429..318a35f8 100644 +--- a/lib/data.c ++++ b/lib/data.c +@@ -83,54 +83,80 @@ void sensors_free_chip_name(sensors_chip_name *chip) + int sensors_parse_chip_name(const char *name, sensors_chip_name *res) + { + char *dash; ++ const char * prefix = name; ++ const char * bus_type; + + /* First, the prefix. It's either "*" or a real chip name. */ +- if (!strncmp(name, "*-", 2)) { +- res->prefix = SENSORS_CHIP_NAME_PREFIX_ANY; +- name += 2; ++ if (!strncmp(prefix, "*-", 2)) { ++ bus_type = prefix + 2; + } else { +- if (!(dash = strchr(name, '-'))) ++ if (!(dash = strchr(prefix, '-'))) + return -SENSORS_ERR_CHIP_NAME; +- res->prefix = strndup(name, dash - name); +- if (!res->prefix) +- sensors_fatal_error(__func__, +- "Allocating name prefix"); +- name = dash + 1; ++ bus_type = dash + 1; + } + +- /* Then we have either a sole "*" (all chips with this name) or a bus +- type and an address. */ +- if (!strcmp(name, "*")) { +- res->bus.type = SENSORS_BUS_TYPE_ANY; +- res->bus.nr = SENSORS_BUS_NR_ANY; +- res->addr = SENSORS_CHIP_NAME_ADDR_ANY; +- return 0; ++ /* We go through the name until we find a valid bus type or "*" ++ (all chips with this name). Dashes on the way are considered ++ part of the prefix. */ ++ while (1) { ++ if (!strcmp(bus_type, "*")) { ++ res->bus.type = SENSORS_BUS_TYPE_ANY; ++ break; ++ } ++ ++ if (!(dash = strchr(bus_type, '-'))) ++ return -SENSORS_ERR_CHIP_NAME; ++ ++ if (!strncmp(bus_type, "i2c", dash - bus_type)) { ++ res->bus.type = SENSORS_BUS_TYPE_I2C; ++ break; ++ } ++ else if (!strncmp(bus_type, "isa", dash - bus_type)) { ++ res->bus.type = SENSORS_BUS_TYPE_ISA; ++ break; ++ } ++ else if (!strncmp(bus_type, "pci", dash - bus_type)) { ++ res->bus.type = SENSORS_BUS_TYPE_PCI; ++ break; ++ } ++ else if (!strncmp(bus_type, "spi", dash - bus_type)) { ++ res->bus.type = SENSORS_BUS_TYPE_SPI; ++ break; ++ } ++ else if (!strncmp(bus_type, "virtual", dash - bus_type)) { ++ res->bus.type = SENSORS_BUS_TYPE_VIRTUAL; ++ break; ++ } ++ else if (!strncmp(bus_type, "acpi", dash - bus_type)) { ++ res->bus.type = SENSORS_BUS_TYPE_ACPI; ++ break; ++ } ++ else if (!strncmp(bus_type, "hid", dash - bus_type)) { ++ res->bus.type = SENSORS_BUS_TYPE_HID; ++ break; ++ } ++ else if (!strncmp(bus_type, "mdio", dash - bus_type)) { ++ res->bus.type = SENSORS_BUS_TYPE_MDIO; ++ break; ++ } ++ else if (!strncmp(bus_type, "scsi", dash - bus_type)) { ++ res->bus.type = SENSORS_BUS_TYPE_SCSI; ++ break; ++ } ++ else { ++ /* Assume the prefix contains a dash */ ++ bus_type = dash + 1; ++ } + } + +- if (!(dash = strchr(name, '-'))) +- goto ERROR; +- if (!strncmp(name, "i2c", dash - name)) +- res->bus.type = SENSORS_BUS_TYPE_I2C; +- else if (!strncmp(name, "isa", dash - name)) +- res->bus.type = SENSORS_BUS_TYPE_ISA; +- else if (!strncmp(name, "pci", dash - name)) +- res->bus.type = SENSORS_BUS_TYPE_PCI; +- else if (!strncmp(name, "spi", dash - name)) +- res->bus.type = SENSORS_BUS_TYPE_SPI; +- else if (!strncmp(name, "virtual", dash - name)) +- res->bus.type = SENSORS_BUS_TYPE_VIRTUAL; +- else if (!strncmp(name, "acpi", dash - name)) +- res->bus.type = SENSORS_BUS_TYPE_ACPI; +- else if (!strncmp(name, "hid", dash - name)) +- res->bus.type = SENSORS_BUS_TYPE_HID; +- else if (!strncmp(name, "mdio", dash - name)) +- res->bus.type = SENSORS_BUS_TYPE_MDIO; +- else if (!strncmp(name, "scsi", dash - name)) +- res->bus.type = SENSORS_BUS_TYPE_SCSI; +- else +- goto ERROR; + name = dash + 1; + ++ /* We can now properly set the prefix */ ++ res->prefix = strndup(prefix, bus_type - prefix - 1); ++ if (!res->prefix) ++ sensors_fatal_error(__func__, ++ "Allocating name prefix"); ++ + /* Some bus types (i2c, spi) have an additional bus number. + For these, the next part is either a "*" (any bus of that type) + or a decimal number. */ diff --git a/recipes-bsp/lm_sensors/lmsensors_3.6.0.bbappend b/recipes-bsp/lm_sensors/lmsensors_3.6.0.bbappend new file mode 100644 index 0000000..08ddb17 --- /dev/null +++ b/recipes-bsp/lm_sensors/lmsensors_3.6.0.bbappend @@ -0,0 +1,6 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://0001-libsensors-Fix-support-for-driver-names-with-dashes.patch" + +PACKAGECONFIG = "" + From a8254343f4266e642c7086cd468839e940b8ffa6 Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 16 Aug 2022 14:09:25 +0200 Subject: [PATCH 3/7] Add lmsensors rules for HW24 and HW25 These two hardware have the ability to read out the wwan modem supply to know when it is completely turned off. This is abstracted to wwan-config through lmsensors rules. BugzID: 80542 --- recipes-bsp/lm_sensors/lmsensors-config/am335x-hw25 | 1 + .../lm_sensors/lmsensors-config/am335x-nmhw24/sensors.conf | 3 +++ recipes-bsp/lm_sensors/lmsensors-config_1.0.bbappend | 4 ++++ 3 files changed, 8 insertions(+) create mode 120000 recipes-bsp/lm_sensors/lmsensors-config/am335x-hw25 create mode 100644 recipes-bsp/lm_sensors/lmsensors-config/am335x-nmhw24/sensors.conf create mode 100644 recipes-bsp/lm_sensors/lmsensors-config_1.0.bbappend diff --git a/recipes-bsp/lm_sensors/lmsensors-config/am335x-hw25 b/recipes-bsp/lm_sensors/lmsensors-config/am335x-hw25 new file mode 120000 index 0000000..fcf3c2a --- /dev/null +++ b/recipes-bsp/lm_sensors/lmsensors-config/am335x-hw25 @@ -0,0 +1 @@ +am335x-nmhw24 \ No newline at end of file diff --git a/recipes-bsp/lm_sensors/lmsensors-config/am335x-nmhw24/sensors.conf b/recipes-bsp/lm_sensors/lmsensors-config/am335x-nmhw24/sensors.conf new file mode 100644 index 0000000..6864c15 --- /dev/null +++ b/recipes-bsp/lm_sensors/lmsensors-config/am335x-nmhw24/sensors.conf @@ -0,0 +1,3 @@ +chip "da9063-hwmon-*" + label in3 "wwan0-supply" + diff --git a/recipes-bsp/lm_sensors/lmsensors-config_1.0.bbappend b/recipes-bsp/lm_sensors/lmsensors-config_1.0.bbappend new file mode 100644 index 0000000..3cd14e3 --- /dev/null +++ b/recipes-bsp/lm_sensors/lmsensors-config_1.0.bbappend @@ -0,0 +1,4 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +PACKAGECONFIG = "" + From 376186bb85c898ded926c435a967e13f131f7839 Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 16 Aug 2022 11:45:34 +0200 Subject: [PATCH 4/7] wwan-config: Get rid of platform specific files These platform specific files are replaced by definitions in devicetree or abstraction through lmsensors. --- recipes-connectivity/wwan-config/wwan-config.bb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/recipes-connectivity/wwan-config/wwan-config.bb b/recipes-connectivity/wwan-config/wwan-config.bb index 4134004..3e0b04f 100644 --- a/recipes-connectivity/wwan-config/wwan-config.bb +++ b/recipes-connectivity/wwan-config/wwan-config.bb @@ -8,10 +8,12 @@ RDEPENDS_${PN} += " \ python3-setuptools \ python3-configparser \ python3-systemd \ + lmsensors-sensors \ + lmsensors-config-libsensors \ " DEPENDS = "python3-setuptools-git-version-native" -inherit gitpkgv systemd +inherit gitpkgv systemd allarch # Package Version (built from tags) @@ -30,11 +32,6 @@ S = "${WORKDIR}/git" inherit setuptools3 -PACKAGE_ARCH = "${MACHINE_ARCH}" -do_configure_prepend() { - cp ${S}/platforms/${MACHINE}/* ${S}/wwan_config -} - do_install_append() { install -d ${D}/${systemd_unitdir}/system/ install -m 0644 ${WORKDIR}/wwan-config@.service ${D}/${systemd_unitdir}/system/ From 8f2fca9c5fbd26be724675d9dc24719969e5df91 Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 14 Jun 2022 09:41:43 +0200 Subject: [PATCH 5/7] lpa: Add NRSW base recipe This is a tool to manage eUICC sim cards profiles. BugzID: 80707 --- recipes-connectivity/lpa/lpa_git.bb | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 recipes-connectivity/lpa/lpa_git.bb diff --git a/recipes-connectivity/lpa/lpa_git.bb b/recipes-connectivity/lpa/lpa_git.bb new file mode 100644 index 0000000..a0f366e --- /dev/null +++ b/recipes-connectivity/lpa/lpa_git.bb @@ -0,0 +1,34 @@ +LICENSE = "CLOSED" +LIC_FILES_CHKSUM = "" + +SRC_URI = "git://gitea@git.netmodule.intranet/NRSW/lpa.git;branch=sdk_1.6;protocol=ssh \ + " + +PV = "1.0+git${SRCPV}" +SRCREV = "3ed22fa779382f2e407d6bce621a2cfb5cf26044" + +S = "${WORKDIR}/git" + +DEPENDS = "curl openssl nmutils" + +EXTRA_OEMAKE_append = "-j 1 SEMEDIA_TYPE=wwanmd NRSW_LICENSING=1" + +TARGET_CC_ARCH += "${LDFLAGS}" + +inherit autotools-brokensep pkgconfig-nmutils + +do_install () { + install -d ${D}${libdir} + install -d ${D}${datadir}/lpa + install -m 755 ${B}/sdk/liblpa.so.1.0.0 ${D}${libdir} + ln -sf liblpa.so.1.0.0 ${D}${libdir}/liblpa.so.1 + ln -sf liblpa.so.1.0.0 ${D}${libdir}/liblpa.so + install -d ${D}${bindir} + install -m 755 ${B}/lpa/lpa ${D}${bindir}/ + install -m 644 ${B}/certs/CI-cert_NIST.crt ${D}${datadir}/lpa/ + install -m 644 ${B}/certs/GSMA_CE_TEST_CI.crt ${D}${datadir}/lpa/ + install -m 644 ${B}/certs/GSMA_CE_LIVE_CI.crt ${D}${datadir}/lpa/ + ln -sf GSMA_CE_LIVE_CI.crt ${D}${datadir}/lpa/default.crt +} + +FILES_${PN} += "${bindir}/* ${libdir}/*.so*" From c1187b555392df714fa68497361a0e53477a7c45 Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 14 Jun 2022 12:53:30 +0200 Subject: [PATCH 6/7] lpa: Remove dependencies to NRSW BugzID: 80707 --- recipes-connectivity/lpa/lpa_git.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes-connectivity/lpa/lpa_git.bb b/recipes-connectivity/lpa/lpa_git.bb index a0f366e..7025852 100644 --- a/recipes-connectivity/lpa/lpa_git.bb +++ b/recipes-connectivity/lpa/lpa_git.bb @@ -9,13 +9,13 @@ SRCREV = "3ed22fa779382f2e407d6bce621a2cfb5cf26044" S = "${WORKDIR}/git" -DEPENDS = "curl openssl nmutils" +DEPENDS = "curl openssl" -EXTRA_OEMAKE_append = "-j 1 SEMEDIA_TYPE=wwanmd NRSW_LICENSING=1" +EXTRA_OEMAKE_append = "-j 1 SEMEDIA_TYPE=toby" TARGET_CC_ARCH += "${LDFLAGS}" -inherit autotools-brokensep pkgconfig-nmutils +inherit autotools-brokensep do_install () { install -d ${D}${libdir} From c18ced1d01e31f298bb2e24f8250ebdec48f755a Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 14 Jun 2022 12:53:51 +0200 Subject: [PATCH 7/7] lpa: Use latest version with patched toby driver BugzID: 80707 --- recipes-connectivity/lpa/lpa_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-connectivity/lpa/lpa_git.bb b/recipes-connectivity/lpa/lpa_git.bb index 7025852..a212665 100644 --- a/recipes-connectivity/lpa/lpa_git.bb +++ b/recipes-connectivity/lpa/lpa_git.bb @@ -5,7 +5,7 @@ SRC_URI = "git://gitea@git.netmodule.intranet/NRSW/lpa.git;branch=sdk_1.6;protoc " PV = "1.0+git${SRCPV}" -SRCREV = "3ed22fa779382f2e407d6bce621a2cfb5cf26044" +SRCREV = "454007f13a713943ae1caff6704d889fde06c1c2" S = "${WORKDIR}/git"