凌云实验室推出的ARM Linux物联网网关开发板IGKBoard(IoT Gateway Kit Board)项目源码
guowenxue
2022-10-09 c6bbc9540d9cfe010611843592f2e06fdad79bda
update honister and kirkstone to add overlays support in /boot
6 files modified
4 files added
362 ■■■■ changed files
yocto/meta-igkboard/honister/conf/machine/igkboard.conf 2 ●●●●● patch | view | raw | blame | history
yocto/meta-igkboard/honister/recipes-images/igkboard/linuxsys-image.bb 61 ●●●●● patch | view | raw | blame | history
yocto/meta-igkboard/honister/recipes-kernel/linux/files/config-lcd.txt 24 ●●●●● patch | view | raw | blame | history
yocto/meta-igkboard/honister/recipes-kernel/linux/files/config-nolcd.txt 24 ●●●●● patch | view | raw | blame | history
yocto/meta-igkboard/honister/recipes-kernel/linux/linux-imx_5.15.bbappend 72 ●●●● patch | view | raw | blame | history
yocto/meta-igkboard/kirkstone/conf/machine/igkboard.conf 2 ●●●●● patch | view | raw | blame | history
yocto/meta-igkboard/kirkstone/recipes-images/igkboard/linuxsys-image.bb 61 ●●●●● patch | view | raw | blame | history
yocto/meta-igkboard/kirkstone/recipes-kernel/linux/files/config-lcd.txt 24 ●●●●● patch | view | raw | blame | history
yocto/meta-igkboard/kirkstone/recipes-kernel/linux/files/config-nolcd.txt 24 ●●●●● patch | view | raw | blame | history
yocto/meta-igkboard/kirkstone/recipes-kernel/linux/linux-imx_5.15.bbappend 68 ●●●●● patch | view | raw | blame | history
yocto/meta-igkboard/honister/conf/machine/igkboard.conf
@@ -18,6 +18,8 @@
IMAGE_BOOT_FILES = " \
    ${KERNEL_IMAGETYPE} \
    ${KERNEL_DEVICETREE} \
    overlays/*;overlays/ \
    config-*.txt \
"
# Remove unused optee bcm4339 bcm43455
yocto/meta-igkboard/honister/recipes-images/igkboard/linuxsys-image.bb
@@ -9,50 +9,43 @@
## Select Image Features
IMAGE_FEATURES += " \
    ssh-server-openssh \
    package-management \
    ssh-server-openssh \
    package-management \
"
CORE_IMAGE_EXTRA_INSTALL += " \
    packagegroup-core-full-cmdline \
    packagegroup-tools-bluetooth \
    packagegroup-fsl-tools-audio \
    packagegroup-fsl-gstreamer1.0 \
    packagegroup-fsl-gstreamer1.0-full \
    packagegroup-qt6-imx \
    packagegroup-misc-utils \
    firmwared \
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \
    packagegroup-core-full-cmdline \
    packagegroup-tools-bluetooth \
    packagegroup-fsl-tools-audio \
    packagegroup-fsl-gstreamer1.0 \
    packagegroup-fsl-gstreamer1.0-full \
    packagegroup-qt6-imx \
    packagegroup-misc-utils \
    firmwared \
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \
"
CORE_IMAGE_EXTRA_INSTALL:append = " \
    bash \
    drivers-mods \
    hello-apps \
    gnupg \
    e2fsprogs \
    e2fsprogs-resize2fs \
    parted \
    v4l-utils \
    yavta \
    sudo \
    nano \
    hostapd \
    evtest \
    mtd-utils \
    libgpiod \
    i2c-tools \
    spitools \
    spidev-test \
    canutils \
    xz \
    udev-extraconf \
    hello-apps \
    bash bash-completion nano sudo \
    curl tree xz dnsmasq gnupg git rsync \
    e2fsprogs e2fsprogs-resize2fs parted \
    v4l-utils zbar yavta fbgrab imagemagick \
    mtd-utils evtest iperf3 iotop lsof \
    mosquitto sqlite3 stunnel \
    i2c-tools spitools spidev-test \
    libgpiod libgpiod-tools \
    libevent libconfig boost ldd \
    libmodbus libsocketcan canutils \
    wvdial ppp hostapd ntp iw \
    nodejs nodejs-npm tcpdump \
    udev-extraconf usb-modeswitch \
"
inherit extrausers
# generate by printf "%q\n" $(mkpasswd -m sha256crypt 12345)
# generate by printf "%q\n" $(mkpasswd -m sha256crypt 12345)
PASSWD= "\$5\$CZyCdtQE9Dp\$kuAmtCHtAv3X5gL1/imI.g1lf.JChVAEkdA3.8Yw8j8"
EXTRA_USERS_PARAMS = "\
    usermod -p '${PASSWD}' root; \
    usermod -p '${PASSWD}' root; \
"
yocto/meta-igkboard/honister/recipes-kernel/linux/files/config-lcd.txt
New file
@@ -0,0 +1,24 @@
# Enable LCD overlay
dtoverlay_lcd=yes
# Camera overlay
dtoverlay_cam=yes
# Enable I2C overlay
dtoverlay_i2c1=yes
# Enable SPI overlay, SPI1 conflict with UART8(NB-IoT/4G module)
dtoverlay_spi1=yes
# Enable UART overlay
dtoverlay_uart=2 3 4 7
# Enable CAN overlays
dtoverlay_can=1 2
# Enable PWM overlays, PWM8 conflict with UART8(NB-IoT/4G module)
dtoverlay_pwm=7 8
# Extra overlays
#dtoverlay_extra=nbiot-4g
yocto/meta-igkboard/honister/recipes-kernel/linux/files/config-nolcd.txt
New file
@@ -0,0 +1,24 @@
# Enable LCD overlay
#dtoverlay_lcd=no
# Enable Camera overlay
#dtoverlay_cam=no
# Enable I2C overlay
dtoverlay_i2c1=yes
# Enable SPI overlay, SPI1 conflict with UART8(NB-IoT/4G module)
#dtoverlay_spi1=no
# Enable UART overlays
dtoverlay_uart=2 3 4 7
# Enable CAN overlays
dtoverlay_can=1 2
# Enable PWM overlays, PWM8 conflict with UART8(NB-IoT/4G module)
dtoverlay_pwm=7
# Enable extra overlays
dtoverlay_extra=nbiot-4g w1
yocto/meta-igkboard/honister/recipes-kernel/linux/linux-imx_5.15.bbappend
@@ -1,5 +1,5 @@
# Copyright (C) 2022 LingYun IoT System Studio
# Released under the GPLv2 license
# Released under the GPLv2 license
#
# SPDX-License-Identifier: GPLv2
#
@@ -12,11 +12,7 @@
require recipes-kernel/linux/linux-yocto.inc
SRCBRANCH = "lf-5.15.y"
KERNEL_SRC = "git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https;branch=${SRCBRANCH}"
KBRANCH = "${SRCBRANCH}"
SRC_URI = "${KERNEL_SRC}"
# base: meta-imx/meta-bsp/recipes-kernel/linux/linux-imx_5.15.bb
# https://source.codeaurora.org/external/imx/linux-imx/tag/?h=lf-5.15.32-2.0.0
SRCREV = "fa6c3168595c02bd9d5366fcc28c9e7304947a3d"
LOCALVERSION = "-lf-5.15.32-2.0.0"
@@ -25,10 +21,70 @@
KERNEL_DANGLING_FEATURES_WARN_ONLY = "1"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += " file://linux-imx-lf-5.15.32-2.0.0.patch "
SRC_URI += " file://linux-imx-lf-5.15.32-2.0.0.patch \
             file://config-lcd.txt \
             file://config-nolcd.txt \
           "
PATCHTOOL = "patch"
do_copy_defconfig:append() {
    cp ${S}/arch/arm/configs/igkboard_defconfig ${WORKDIR}/defconfig
    cp ${S}/arch/arm/configs/igkboard_defconfig ${WORKDIR}/defconfig
    cp ${S}/arch/arm/configs/igkboard_defconfig ${B}/.config
}
KERNEL_DTC_FLAGS = "-@"
KERNEL_DEVICETREE2 ?= ""
KERNEL_DEVICETREE2:igkboard = " \
    overlays/cam.dtbo \
    overlays/can1.dtbo \
    overlays/can2.dtbo \
    overlays/i2c1.dtbo \
    overlays/lcd.dtbo \
    overlays/nbiot-4g.dtbo \
    overlays/pwm7.dtbo \
    overlays/pwm8.dtbo \
    overlays/spi1.dtbo \
    overlays/uart2.dtbo \
    overlays/uart3.dtbo \
    overlays/uart4.dtbo \
    overlays/uart7.dtbo \
    overlays/w1.dtbo \
"
# compile dtbo file, refer to: poky/meta/classes/kernel-devicetree.bbclass
do_compile:append() {
    if [ -n "${KERNEL_DTC_FLAGS}" ]; then
        export DTC_FLAGS="${KERNEL_DTC_FLAGS}"
    fi
    for dtbf in ${KERNEL_DEVICETREE2}; do
        dtb=`normalize_dtb "$dtbf"`
        oe_runmake $dtb CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
    done
}
# install to linux kernel package
FILES:${KERNEL_PACKAGE_NAME}-devicetree += "/${KERNEL_IMAGEDEST}/overlays/*.dtbo"
do_install:append() {
    for dtbf in ${KERNEL_DEVICETREE2}; do
        dtb=`normalize_dtb "$dtbf"`
        install -d ${D}/${KERNEL_IMAGEDEST}/overlays
        install -m 0644 ${B}/arch/arm/boot/dts/$dtb ${D}/${KERNEL_IMAGEDEST}/$dtb
    done
    install -m 0644 ${WORKDIR}/config-lcd.txt ${D}/${KERNEL_IMAGEDEST}/
    install -m 0644 ${WORKDIR}/config-nolcd.txt ${D}/${KERNEL_IMAGEDEST}/
}
# install to deploy images path
do_deploy:append(){
    for dtbf in ${KERNEL_DEVICETREE2}; do
        dtb=`normalize_dtb "$dtbf"`
        install -d ${deployDir}/overlays
        install -m 0644 ${B}/arch/arm/boot/dts/$dtb ${deployDir}/$dtb
    done
    install -m 0644 ${WORKDIR}/config-lcd.txt ${deployDir}/
    install -m 0644 ${WORKDIR}/config-nolcd.txt ${deployDir}/
}
yocto/meta-igkboard/kirkstone/conf/machine/igkboard.conf
@@ -18,6 +18,8 @@
IMAGE_BOOT_FILES = " \
    ${KERNEL_IMAGETYPE} \
    ${KERNEL_DEVICETREE} \
    overlays/*;overlays/ \
    config-*.txt \
"
# Remove unused optee bcm4339 bcm43455
yocto/meta-igkboard/kirkstone/recipes-images/igkboard/linuxsys-image.bb
@@ -9,50 +9,43 @@
## Select Image Features
IMAGE_FEATURES += " \
    ssh-server-openssh \
    package-management \
    ssh-server-openssh \
    package-management \
"
CORE_IMAGE_EXTRA_INSTALL += " \
    packagegroup-core-full-cmdline \
    packagegroup-tools-bluetooth \
    packagegroup-fsl-tools-audio \
    packagegroup-fsl-gstreamer1.0 \
    packagegroup-fsl-gstreamer1.0-full \
    packagegroup-qt6-imx \
    packagegroup-misc-utils \
    firmwared \
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \
    packagegroup-core-full-cmdline \
    packagegroup-tools-bluetooth \
    packagegroup-fsl-tools-audio \
    packagegroup-fsl-gstreamer1.0 \
    packagegroup-fsl-gstreamer1.0-full \
    packagegroup-qt6-imx \
    packagegroup-misc-utils \
    firmwared \
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \
"
CORE_IMAGE_EXTRA_INSTALL:append = " \
    bash \
    drivers-mods \
    hello-apps \
    gnupg \
    e2fsprogs \
    e2fsprogs-resize2fs \
    parted \
    v4l-utils \
    yavta \
    sudo \
    nano \
    hostapd \
    evtest \
    mtd-utils \
    libgpiod \
    i2c-tools \
    spitools \
    spidev-test \
    canutils \
    xz \
    udev-extraconf \
    hello-apps \
    bash bash-completion nano sudo \
    curl tree xz dnsmasq gnupg git rsync \
    e2fsprogs e2fsprogs-resize2fs parted \
    v4l-utils zbar yavta fbgrab imagemagick \
    mtd-utils evtest iperf3 iotop lsof \
    mosquitto sqlite3 stunnel \
    i2c-tools spitools spidev-test \
    libgpiod libgpiod-tools \
    libevent libconfig boost ldd \
    libmodbus libsocketcan canutils \
    wvdial ppp hostapd ntp iw \
    nodejs nodejs-npm tcpdump \
    udev-extraconf usb-modeswitch \
"
inherit extrausers
# generate by printf "%q\n" $(mkpasswd -m sha256crypt 12345)
# generate by printf "%q\n" $(mkpasswd -m sha256crypt 12345)
PASSWD= "\$5\$CZyCdtQE9Dp\$kuAmtCHtAv3X5gL1/imI.g1lf.JChVAEkdA3.8Yw8j8"
EXTRA_USERS_PARAMS = "\
    usermod -p '${PASSWD}' root; \
    usermod -p '${PASSWD}' root; \
"
yocto/meta-igkboard/kirkstone/recipes-kernel/linux/files/config-lcd.txt
New file
@@ -0,0 +1,24 @@
# Enable LCD overlay
dtoverlay_lcd=yes
# Camera overlay
dtoverlay_cam=yes
# Enable I2C overlay
dtoverlay_i2c1=yes
# Enable SPI overlay, SPI1 conflict with UART8(NB-IoT/4G module)
dtoverlay_spi1=yes
# Enable UART overlay
dtoverlay_uart=2 3 4 7
# Enable CAN overlays
dtoverlay_can=1 2
# Enable PWM overlays, PWM8 conflict with UART8(NB-IoT/4G module)
dtoverlay_pwm=7 8
# Extra overlays
#dtoverlay_extra=nbiot-4g
yocto/meta-igkboard/kirkstone/recipes-kernel/linux/files/config-nolcd.txt
New file
@@ -0,0 +1,24 @@
# Enable LCD overlay
#dtoverlay_lcd=no
# Enable Camera overlay
#dtoverlay_cam=no
# Enable I2C overlay
dtoverlay_i2c1=yes
# Enable SPI overlay, SPI1 conflict with UART8(NB-IoT/4G module)
#dtoverlay_spi1=no
# Enable UART overlays
dtoverlay_uart=2 3 4 7
# Enable CAN overlays
dtoverlay_can=1 2
# Enable PWM overlays, PWM8 conflict with UART8(NB-IoT/4G module)
dtoverlay_pwm=7
# Enable extra overlays
dtoverlay_extra=nbiot-4g w1
yocto/meta-igkboard/kirkstone/recipes-kernel/linux/linux-imx_5.15.bbappend
@@ -12,11 +12,7 @@
require recipes-kernel/linux/linux-yocto.inc
SRCBRANCH = "lf-5.15.y"
KERNEL_SRC = "git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https;branch=${SRCBRANCH}"
KBRANCH = "${SRCBRANCH}"
SRC_URI = "${KERNEL_SRC}"
# base: meta-imx/meta-bsp/recipes-kernel/linux/linux-imx_5.15.bb
# https://source.codeaurora.org/external/imx/linux-imx/tag/?h=lf-5.15.32-2.0.0
SRCREV = "fa6c3168595c02bd9d5366fcc28c9e7304947a3d"
LOCALVERSION = "-lf-5.15.32-2.0.0"
@@ -25,10 +21,70 @@
KERNEL_DANGLING_FEATURES_WARN_ONLY = "1"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += " file://linux-imx-lf-5.15.32-2.0.0.patch "
SRC_URI += " file://linux-imx-lf-5.15.32-2.0.0.patch \
             file://config-lcd.txt \
             file://config-nolcd.txt \
           "
PATCHTOOL = "patch"
do_copy_defconfig:append() {
    cp ${S}/arch/arm/configs/igkboard_defconfig ${WORKDIR}/defconfig
    cp ${S}/arch/arm/configs/igkboard_defconfig ${B}/.config
}
KERNEL_DTC_FLAGS = "-@"
KERNEL_DEVICETREE2 ?= ""
KERNEL_DEVICETREE2:igkboard = " \
    overlays/cam.dtbo \
    overlays/can1.dtbo \
    overlays/can2.dtbo \
    overlays/i2c1.dtbo \
    overlays/lcd.dtbo \
    overlays/nbiot-4g.dtbo \
    overlays/pwm7.dtbo \
    overlays/pwm8.dtbo \
    overlays/spi1.dtbo \
    overlays/uart2.dtbo \
    overlays/uart3.dtbo \
    overlays/uart4.dtbo \
    overlays/uart7.dtbo \
    overlays/w1.dtbo \
"
# compile dtbo file, refer to: poky/meta/classes/kernel-devicetree.bbclass
do_compile:append() {
    if [ -n "${KERNEL_DTC_FLAGS}" ]; then
        export DTC_FLAGS="${KERNEL_DTC_FLAGS}"
    fi
    for dtbf in ${KERNEL_DEVICETREE2}; do
        dtb=`normalize_dtb "$dtbf"`
        oe_runmake $dtb CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
    done
}
# install to linux kernel package
FILES:${KERNEL_PACKAGE_NAME}-devicetree += "/${KERNEL_IMAGEDEST}/overlays/*.dtbo"
do_install:append() {
    for dtbf in ${KERNEL_DEVICETREE2}; do
        dtb=`normalize_dtb "$dtbf"`
        install -d ${D}/${KERNEL_IMAGEDEST}/overlays
        install -m 0644 ${B}/arch/arm/boot/dts/$dtb ${D}/${KERNEL_IMAGEDEST}/$dtb
    done
    install -m 0644 ${WORKDIR}/config-lcd.txt ${D}/${KERNEL_IMAGEDEST}/
    install -m 0644 ${WORKDIR}/config-nolcd.txt ${D}/${KERNEL_IMAGEDEST}/
}
# install to deploy images path
do_deploy:append(){
    for dtbf in ${KERNEL_DEVICETREE2}; do
        dtb=`normalize_dtb "$dtbf"`
        install -d ${deployDir}/overlays
        install -m 0644 ${B}/arch/arm/boot/dts/$dtb ${deployDir}/$dtb
    done
    install -m 0644 ${WORKDIR}/config-lcd.txt ${deployDir}/
    install -m 0644 ${WORKDIR}/config-nolcd.txt ${deployDir}/
}