Compare commits

...

7 Commits

Author SHA1 Message Date
Alexandre Bard 62c0816d97 fix(coreos-installer): add missing public key in swupdate config 2023-12-07 15:24:43 +01:00
Alexandre Bard 3fbebf25db fix(coreos-image-ci.bbclass): fix undefined variables
At least KERNEL_IMAGE_BIN_EXT was not defined in somes cases.
2023-12-07 15:22:21 +01:00
Alexandre Bard 514767a790 fix(meta-netmodule-coreos-bsp): fix u-boot for am64xx
And update to 2023.04

id:397918
2023-12-07 15:22:00 +01:00
Alexandre Bard a554b745e5 fix(netmodule-am64xx-k3r5.inc): remove sanity checks for am64xx rtcore
The sanity checks only applies for linux cores.

id:397918
2023-12-07 15:21:49 +01:00
Alexandre Bard d56fed9cc1 fix(netmodule-am64xx-common.inc): fix broken u-boot after meta-ti change
K3_IMAGE_GEN_SRCREV does not exist anymore in TI layer
TI_LINUX_FW_SRCREV point to a version which is not compatible with the
recipe in TI layer.

Generally: bad idea to overwrite srcrev from a different layer because
these revision will have to be checked everytime the layer is updated to
be sure they are not incompatible or outdated.

id:397918
2023-12-07 15:21:32 +01:00
Alexandre Bard 31fca1e9a4 feat(meta-netmodule-coreos-bsp): update TI kernel to version 6.1
The patch has been merged directly to git.

id:477850
2023-12-07 15:11:51 +01:00
Sam Dolt 9492b3272f feat(meta-netmodule-coreos-bsp): create layer and add gemini support 2023-12-07 14:55:23 +01:00
22 changed files with 299 additions and 8 deletions

6
.gitmodules vendored
View File

@ -24,5 +24,9 @@
branch = kirkstone
[submodule "meta-arm"]
path = external-layers/meta-arm
url = git://git.yoctoproject.org/meta-arm
url = ssh://git@bitbucket.gad.local:7999/ico/meta-arm.git
branch = kirkstone
[submodule "meta-ti"]
path = external-layers/meta-ti
url = ssh://git@bitbucket.gad.local:7999/ico/meta-ti.git
branch = kirkstone

@ -0,0 +1 @@
Subproject commit bae3658ac0bc1c9adac7a882439cabb385cae720

View File

@ -1,10 +1,9 @@
# short-description: Create an EFI disk image for genericx86*
# long-description: Creates a partitioned EFI disk image for genericx86* machines
${WKS_PART_EFI} --ondisk sda --align 1024 --size 64M --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_A} --ondisk sda --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_B} --ondisk sda --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_A} --ondisk sda --align 1024 --size 128M --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_B} --ondisk sda --align 1024 --size 128M --extra-space 0 --overhead-factor 1
${WKS_PART_EFI} --align 1024 --size 64M --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_A} --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_B} --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_A} --align 1024 --size 128M --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_B} --align 1024 --size 128M --extra-space 0 --overhead-factor 1
part swap --ondisk sda --size 44 --label swap1 --fstype=swap
bootloader --ptable gpt

View File

@ -3,6 +3,7 @@
# > COREOS_IMAGE_EXTRACLASSES += "coreos-image-ci"
# in auto.conf (or local.conf)
inherit kernel-artifact-names
def get_coreos_ci_artifacts(d):
artifacts = []

View File

@ -48,3 +48,4 @@ umount /mnt/ebg1
umount /mnt/efi
SWUPDATE_ARGS="${SWUPDATE_ARGS} -e stable,copy0"
SWUPDATE_ARGS="${SWUPDATE_ARGS} -k /usr/lib/swupdate/swupdate.crt"

View File

@ -9,5 +9,5 @@ BBFILE_COLLECTIONS += "meta-belden-marvell-bsp"
BBFILE_PATTERN_meta-belden-marvell-bsp = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-belden-marvell-bsp = "6"
LAYERDEPENDS_meta-belden-marvell-bsp = "core meta-belden-coreos"
LAYERDEPENDS_meta-belden-marvell-bsp = "core meta-belden-coreos meta-arm"
LAYERSERIES_COMPAT_meta-belden-marvell-bsp = "kirkstone"

View File

@ -2,6 +2,14 @@
COMPATIBLE_MACHINE = "cn913x"
# On marvell SOC, trusted-firmware depends on u-boot, but usually u-boot depends
# on trusted-firmware. This make a dependancy loop when building for other arch
python() {
if d.getVar('SOC_FAMILY') != "cn913x":
raise bb.parse.SkipRecipe("Skip if machine is not a CN913x")
}
DEPENDS += "mv-ddr-marvell coreutils-native"
SRC_URI += " \

View File

@ -0,0 +1,26 @@
# meta-netmodule-coreos-bsp
BSP layer for NetModule board
This layer depends on:
- meta-ti-bsp
- meta-arm
## SoC Family
This layer contains all CoreOS supported board manufactured by NetModule
## Availables Machines
This layer contains the following machine configuration:
### Based on the Gemini platform
- netmodule-hw34 (Codename for XG900)
**remarks**: Gemini based board use a TI am64xx (k3) family has a separate
R5 core that use another architecture as the main core, so for each machine you
will find a companion machine name `${MACHINE}-k3r5`. This config should not be
used as is, but will be automatically used for some recipes under the hood when
using `${MACHINE}` using Bitbake multiconfig feature.

View File

@ -0,0 +1,46 @@
SWUPDATE_IMAGES += "tiboot3"
SWUPDATE_IMAGES += "tispl"
SWUPDATE_IMAGES += "u-boot-${MACHINE}"
SWUPDATE_IMAGES_FSTYPES[tiboot3] = ".bin"
SWUPDATE_IMAGES_FSTYPES[tispl] = ".bin"
python () {
machine = d.getVar('MACHINE')
d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", "u-boot-" + machine, ".img")
}
COREOS_SWUPDATE_EXTENDS_FOR:append = "am64xx"
def coreos_swupdate_extends_images_for_am64xx(d,s):
machine = d.getVar('MACHINE')
uboot_filename = "u-boot-" + machine + ".img"
SECTOR_SIZE = 512
OFFSET = [0x0*SECTOR_SIZE, 0x600*SECTOR_SIZE, 0x1600*SECTOR_SIZE]
return [
{
"filename" : "tiboot3.bin",
"installed-directly" : "true",
"device" : "/dev/mmcblk0boot0",
"offset": str(OFFSET[0]),
"type" : "raw",
"sha256" : swupdate_get_sha256(d, s, "tiboot3.bin"),
},
{
"filename" : "tispl.bin",
"installed-directly" : "true",
"device" : "/dev/mmcblk0boot0",
"offset": str(OFFSET[1]),
"type" : "raw",
"sha256" : swupdate_get_sha256(d, s, "tispl.bin"),
},
{
"filename" : uboot_filename,
"installed-directly" : "true",
"device" : "/dev/mmcblk0boot0",
"offset": str(OFFSET[2]),
"type" : "raw",
"sha256" : swupdate_get_sha256(d, s, uboot_filename),
}
]

View File

@ -0,0 +1,13 @@
# Add layer directory to bbpath
BBPATH .= ":${LAYERDIR}"
# Add recipe directories
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "netmodule-coreos-bsp-layer"
BBFILE_PATTERN_netmodule-coreos-bsp-layer = "^${LAYERDIR}/"
BBFILE_PRIORITY_netmodule-coreos-bsp-layer = "8"
LAYERSERIES_COMPAT_netmodule-coreos-bsp-layer = "kirkstone"
LAYERDEPENDS_netmodule-coreos-bsp-layer = "meta-arm meta-ti-bsp"

View File

@ -0,0 +1,50 @@
# This file contains the part of the configuration that is common to all
# board based on the Gemini platform and that are the Cortex-A53 core.
# k3.inc from meta-ti set a default WKS_FILE and add wic to IMAGE_FSTYPE.
# But we don't need a wic image
WKS_FILE ?= ""
require conf/machine/include/k3.inc
# Workarround to remove wic related settings added to IMAGE_FSTYPE in k3.inc
# without too much risk of breaking a distro or local config (as remove)
# are final
IMAGE_FSTYPES:remove = "${@'wic.xz wic.bmap' if not d.getVar('WKS_FILE') else ''}"
# meta-ti-bsp use the machine override in a lot of recipes, so by adding the
# name of the machine in meta-ti-bsp to SOC_FAMILY, we ensure that we the
# device override apply.
#
# We don't modify MACHINEOVERRIDES directly as this will not place the string
# in the same place
SOC_FAMILY:append = ":am64xx"
# Install u-boot script
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-devicetree"
PREFERRED_PROVIDER_virtual/kernel = "linux-netmodule"
PREFERRED_VERSION_linux-netmodule = "git-6.1-ti"
PREFERRED_VERSION_trusted-firmware-a = "2.7+gitAUTOINC+0c9c984a0d"
KERNEL_DEFCONFIG ?= "gemini_defconfig"
KERNEL_IMAGETYPE = "Image"
UBOOT_ENTRYPOINT = "0x82000000"
UBOOT_LOADADDRESS = "0x82000000"
UBOOT_DTB_LOADADDRESS = "0x88000000"
UBOOT_RD_LOADADDRESS = "0x88080000"
UBOOT_RD_ENTRYPOINT = "0x88080000"
TFA_BOARD = "lite"
OPTEEMACHINE = "k3"
# No watchdog available yet
EFIBOOTGUARD_TIMEOUT ?= "0"
COREOS_IMAGE_SWUPDATE_EXTRACLASSES += "coreos-image-swupdate-am64xx"
require conf/machine/include/coreos-generic-features/efi.inc

View File

@ -0,0 +1,13 @@
# This file contains the part of the configuration that is common to all
# board based on the Gemini platform and that are the Cortex-R5 core.
require conf/machine/include/k3r5.inc
SYSFW_SOC = "am64x"
SYSFW_CONFIG = "evm"
SYSFW_SUFFIX = "gp"
SPL_BINARY = "spl/u-boot-spl.${UBOOT_SUFFIX}"
# Sanity checks don't apply for real time cores
INHERIT:remove = "coreos-sanity"

View File

@ -0,0 +1,7 @@
#@TYPE: Machine
#@NAME: AM64xx EVM (R5F)
#@DESCRIPTION: Machine configuration for the TI AM64xx EVM (R5F core)
require conf/machine/include/netmodule-am64xx-k3r5.inc
UBOOT_MACHINE = "am64x_netmodule_hw34_r5_defconfig"

View File

@ -0,0 +1,15 @@
require conf/machine/include/netmodule-am64xx-k3.inc
KERNEL_DEVICETREE = " \
ti/k3-am642-netmodule-hw34.dtb \
"
UBOOT_MACHINE = "am64x_netmodule_hw34_a53_defconfig"
LINUX_CONSOLE ?= "ttyS2,115200n8"
APPEND += "console=ttyS2,115200"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append = " udev-gemini"
MACHINE_EXTRA_RDEPENDS:append = " prueth-fw-am65x-sr2 linux-firmware-ath10k linux-firmware-ath11k linux-firmware-qca kernel-modules"

View File

@ -0,0 +1,25 @@
require recipes-bsp/u-boot/u-boot-ti.inc
SPL_UART_BINARY = "u-boot-spl.bin"
SPL_UART_BINARY:netmodule-hw34-k3r5 = "u-boot-spl.bin"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1"
PV = "2023.04"
SRC_URI = "git://git.netmodule.intranet/nmrouter/u-boot.git;protocol=ssh;user=gitea;branch=2023.04/ti/gemini \
"
SRCREV = "58edeff88918dc412391ffd9f4dfad59a613dd61"
PACKAGECONFIG[atf] = "BL31=${STAGING_DIR_HOST}/firmware/bl31.bin,,trusted-firmware-a"
do_deploy:append:netmodule-hw34-k3r5 () {
ln -sr ${DEPLOYDIR}/tiboot3.bin ${DEPLOYDIR}/tiboot3-r5spl.bin
ln -sr ${DEPLOYDIR}/u-boot-spl.bin ${DEPLOYDIR}/u-boot-spl-r5spl.bin
}
# Only require coreos include file for the aarch64 build of u-boot
UBOOT_REQUIRE ?= ""
UBOOT_REQUIRE:netmodule-hw34 = "recipes-bsp/u-boot/u-boot-coreos.inc"
require ${UBOOT_REQUIRE}

View File

@ -0,0 +1,12 @@
DESCRIPTION = "Image used to test Gemini Performances"
inherit coreos-image
IMAGE_FEATURES += "ssh-server dev-tools cockpit networkmanager swupdate"
IMAGE_FEATURES += "${@bb.utils.contains("MACHINE_FEATURES", "efi", "swupdate", "", d)}"
IMAGE_INSTALL:append = " packagegroup-core-full-cmdline swupdate-www"
# Perfs tools
# openssl-bin need for "openssl speed"
IMAGE_INSTALL:append = " canutils can-utils iperf2 iperf3 strongswan stress-ng openssl-bin"

View File

@ -0,0 +1,5 @@
# CAN renaming
SUBSYSTEM=="net", ACTION=="add", KERNEL=="can*", ENV{ID_PATH}=="platform-20701000.can", NAME="canfd0"
SUBSYSTEM=="net", ACTION=="add", KERNEL=="can*", ENV{ID_PATH}=="platform-20711000.can", NAME="canfd1"
SUBSYSTEM=="net", ACTION=="add", KERNEL=="can*", ENV{ID_PATH}=="platform-20110000.spi-cs-0", NAME="canstd0"
SUBSYSTEM=="net", ACTION=="add", KERNEL=="can*", ENV{ID_PATH}=="platform-20110000.spi-cs-1", NAME="canstd1"

View File

@ -0,0 +1,18 @@
SUMMARY = "Extra Gemini specific configuration files"
DESCRIPTION = "Extra machine specific configuration files for udev that are Gemini related."
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
SRC_URI = " \
file://gemini-can.rules \
"
S = "${WORKDIR}"
do_install() {
install -d ${D}${sysconfdir}/udev/rules.d
install -m 0644 ${WORKDIR}/gemini-can.rules ${D}${sysconfdir}/udev/rules.d/gemini-can.rules
}
RDEPENDS:${PN} = "udev"

View File

@ -0,0 +1,12 @@
label: gpt
device: /dev/mmcblk0
unit: sectors
first-lba: 34
last-lba: 15273566
sector-size: 512
/dev/mmcblk0p1 : start= 34, size= 131072, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, name="efi"
/dev/mmcblk0p2 : start= 131106, size= 262144, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, name="ebg0"
/dev/mmcblk0p3 : start= 393250, size= 262144, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, name="ebg1"
/dev/mmcblk0p4 : start= 655394, size= 7309086, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, name="rootfs0"
/dev/mmcblk0p5 : start= 7964480, size= 7309086, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, name="rootfs1"

View File

@ -0,0 +1,7 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/coreos-installer-config:"
SRC_URI:append:netmodule-hw34 = " file://netmodule-hw34_1.0.sfdisk"
do_install:append:netmodule-hw34() {
install -m 755 ${WORKDIR}/netmodule-hw34_1.0.sfdisk ${D}${sysconfdir}/
}

View File

@ -0,0 +1,26 @@
DESCRIPTION = "Linux kernel for various NetModule hardware"
COMPATIBLE_MACHINE = "k3"
inherit kernel
SRC_URI = "git://gitlab.netmodule.intranet/oem-linux/linux-netmodule.git;protocol=ssh;user=git;branch=6.1/ti/gemini \
"
SRCREV = "67c72a62a5e7d6ca961451b1460d27904325ae23"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
S = "${WORKDIR}/git"
#If a KERNEL_DEFCONFIG is specified, the defconfig specified in SRC_URI will be overwritten!
do_configure:append(){
if [ "${KERNEL_DEFCONFIG}" != "" ]; then
oe_runmake ${KERNEL_DEFCONFIG}
fi
configs="${@" ".join(find_cfgs(d))}"
if [ ! -z "${configs}" ]; then
${S}/scripts/kconfig/merge_config.sh -m -O ${WORKDIR}/build ${WORKDIR}/build/.config ${WORKDIR}/*.cfg
fi
}
require recipes-kernel/linux/linux-yocto-coreos-efi.inc

View File

@ -11,6 +11,7 @@ BBLAYERS ?= " \
##COREOS_LAYERSDIR##/meta-belden-coreos-bsp \
##COREOS_LAYERSDIR##/meta-belden-coreos-demo \
##COREOS_LAYERSDIR##/meta-belden-marvell-bsp \
##COREOS_LAYERSDIR##/meta-netmodule-coreos-bsp \
##COREOS_EXTLAYERSDIR##/meta-openembedded/meta-oe \
##COREOS_EXTLAYERSDIR##/meta-openembedded/meta-networking \
##COREOS_EXTLAYERSDIR##/meta-openembedded/meta-filesystems \
@ -21,4 +22,5 @@ BBLAYERS ?= " \
##COREOS_EXTLAYERSDIR##/meta-swupdate \
##COREOS_EXTLAYERSDIR##/meta-arm/meta-arm \
##COREOS_EXTLAYERSDIR##/meta-arm/meta-arm-toolchain \
##COREOS_EXTLAYERSDIR##/meta-ti/meta-ti-bsp \
"