From cfd63890a7d2051031a8c1aab465122e1be8ec58 Mon Sep 17 00:00:00 2001 From: Sam Dolt Date: Wed, 25 Oct 2023 14:34:35 +0200 Subject: [PATCH] feat(meta-netmodule-coreos-bsp): create layer and add gemini support --- .gitmodules | 6 +- external-layers/meta-ti | 1 + .../wic/generic-uefi.wks.in | 9 +- .../meta-belden-marvell-bsp/conf/layer.conf | 2 +- layers/meta-netmodule-coreos-bsp/README.md | 26 +++++ .../coreos-image-swupdate-am64xx.bbclass | 46 ++++++++ .../meta-netmodule-coreos-bsp/conf/layer.conf | 13 +++ .../include/netmodule-am64xx-common.inc | 5 + .../machine/include/netmodule-am64xx-k3.inc | 51 +++++++++ .../machine/include/netmodule-am64xx-k3r5.inc | 9 ++ .../conf/machine/netmodule-hw34-k3r5.conf | 7 ++ .../conf/machine/netmodule-hw34.conf | 15 +++ .../0001-rename-genimi-to-hw34.patch | 102 ++++++++++++++++++ .../u-boot/u-boot-ti-staging_git.bb | 26 +++++ .../udev/udev-gemini/gemini-can.rules | 5 + .../recipes-core/udev/udev-gemini_1.0.bb | 18 ++++ .../netmodule-hw34_1.0.sfdisk | 12 +++ .../coreos-installer-config_%.bbappend | 7 ++ ...gemini-v1.dts-to-k3-am642-netmodule-.patch | 26 +++++ .../linux/linux-netmodule_git-5.10-ti.bb | 27 +++++ templates/bblayers.conf.sample | 2 + 21 files changed, 412 insertions(+), 3 deletions(-) create mode 160000 external-layers/meta-ti create mode 100644 layers/meta-netmodule-coreos-bsp/README.md create mode 100644 layers/meta-netmodule-coreos-bsp/classes/coreos-image-swupdate-am64xx.bbclass create mode 100644 layers/meta-netmodule-coreos-bsp/conf/layer.conf create mode 100644 layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-common.inc create mode 100644 layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-k3.inc create mode 100644 layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-k3r5.inc create mode 100644 layers/meta-netmodule-coreos-bsp/conf/machine/netmodule-hw34-k3r5.conf create mode 100644 layers/meta-netmodule-coreos-bsp/conf/machine/netmodule-hw34.conf create mode 100644 layers/meta-netmodule-coreos-bsp/recipes-bsp/u-boot/u-boot-ti-staging/0001-rename-genimi-to-hw34.patch create mode 100644 layers/meta-netmodule-coreos-bsp/recipes-bsp/u-boot/u-boot-ti-staging_git.bb create mode 100644 layers/meta-netmodule-coreos-bsp/recipes-core/udev/udev-gemini/gemini-can.rules create mode 100644 layers/meta-netmodule-coreos-bsp/recipes-core/udev/udev-gemini_1.0.bb create mode 100644 layers/meta-netmodule-coreos-bsp/recipes-coreos/coreos-installer/coreos-installer-config/netmodule-hw34_1.0.sfdisk create mode 100644 layers/meta-netmodule-coreos-bsp/recipes-coreos/coreos-installer/coreos-installer-config_%.bbappend create mode 100644 layers/meta-netmodule-coreos-bsp/recipes-kernel/linux/linux-netmodule/0001-rename-k3-am642-gemini-v1.dts-to-k3-am642-netmodule-.patch create mode 100644 layers/meta-netmodule-coreos-bsp/recipes-kernel/linux/linux-netmodule_git-5.10-ti.bb diff --git a/.gitmodules b/.gitmodules index 93c6b86..dcf68ce 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/external-layers/meta-ti b/external-layers/meta-ti new file mode 160000 index 0000000..0f9035a --- /dev/null +++ b/external-layers/meta-ti @@ -0,0 +1 @@ +Subproject commit 0f9035a628c10ec0e0656387989e99b1365f184f diff --git a/layers/meta-belden-coreos-bsp/wic/generic-uefi.wks.in b/layers/meta-belden-coreos-bsp/wic/generic-uefi.wks.in index 1716221..1ce0b7b 100644 --- a/layers/meta-belden-coreos-bsp/wic/generic-uefi.wks.in +++ b/layers/meta-belden-coreos-bsp/wic/generic-uefi.wks.in @@ -1,11 +1,18 @@ # short-description: Create an EFI disk image for genericx86* # long-description: Creates a partitioned EFI disk image for genericx86* machines +<<<<<<< HEAD ${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_USERDATA} --ondisk sda --size ${WKS_PART_USERDATA_SIZE} --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 +>>>>>>> 907e72e (feat(meta-netmodule-coreos-bsp): create layer and add gemini support) -part swap --ondisk sda --size 44 --label swap1 --fstype=swap bootloader --ptable gpt diff --git a/layers/meta-belden-marvell-bsp/conf/layer.conf b/layers/meta-belden-marvell-bsp/conf/layer.conf index fe15c64..22c11f1 100644 --- a/layers/meta-belden-marvell-bsp/conf/layer.conf +++ b/layers/meta-belden-marvell-bsp/conf/layer.conf @@ -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" diff --git a/layers/meta-netmodule-coreos-bsp/README.md b/layers/meta-netmodule-coreos-bsp/README.md new file mode 100644 index 0000000..2d7aadf --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/README.md @@ -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. diff --git a/layers/meta-netmodule-coreos-bsp/classes/coreos-image-swupdate-am64xx.bbclass b/layers/meta-netmodule-coreos-bsp/classes/coreos-image-swupdate-am64xx.bbclass new file mode 100644 index 0000000..cb7ae92 --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/classes/coreos-image-swupdate-am64xx.bbclass @@ -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), + } + ] diff --git a/layers/meta-netmodule-coreos-bsp/conf/layer.conf b/layers/meta-netmodule-coreos-bsp/conf/layer.conf new file mode 100644 index 0000000..ba8fc78 --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/conf/layer.conf @@ -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" diff --git a/layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-common.inc b/layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-common.inc new file mode 100644 index 0000000..7336de7 --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-common.inc @@ -0,0 +1,5 @@ +# This file contains the part of the configuration that is common to all +# board based on the Gemini platform and that are the same for both +# the Cortex-A53 and Cortex-R5 core (Gemini use a multi-arch SOC) +TI_LINUX_FW_SRCREV = "0f4905088d24e474063f33777559149e11538be5" +K3_IMAGE_GEN_SRCREV ?= "2308bfb01e7bd3e03514cb33f06180dd9bb79121" diff --git a/layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-k3.inc b/layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-k3.inc new file mode 100644 index 0000000..ea9f265 --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-k3.inc @@ -0,0 +1,51 @@ +# 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 +require conf/machine/include/netmodule-am64xx-common.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-5.10-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 diff --git a/layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-k3r5.inc b/layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-k3r5.inc new file mode 100644 index 0000000..5b4d69c --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/conf/machine/include/netmodule-am64xx-k3r5.inc @@ -0,0 +1,9 @@ +# 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. + +require conf/machine/include/k3r5.inc +require conf/machine/include/netmodule-am64xx-common.inc + +SYSFW_SOC = "am64x" +SYSFW_CONFIG = "evm" +SYSFW_SUFFIX = "gp" diff --git a/layers/meta-netmodule-coreos-bsp/conf/machine/netmodule-hw34-k3r5.conf b/layers/meta-netmodule-coreos-bsp/conf/machine/netmodule-hw34-k3r5.conf new file mode 100644 index 0000000..ca5678d --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/conf/machine/netmodule-hw34-k3r5.conf @@ -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" diff --git a/layers/meta-netmodule-coreos-bsp/conf/machine/netmodule-hw34.conf b/layers/meta-netmodule-coreos-bsp/conf/machine/netmodule-hw34.conf new file mode 100644 index 0000000..e44ddd8 --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/conf/machine/netmodule-hw34.conf @@ -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" + diff --git a/layers/meta-netmodule-coreos-bsp/recipes-bsp/u-boot/u-boot-ti-staging/0001-rename-genimi-to-hw34.patch b/layers/meta-netmodule-coreos-bsp/recipes-bsp/u-boot/u-boot-ti-staging/0001-rename-genimi-to-hw34.patch new file mode 100644 index 0000000..7a9fa37 --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/recipes-bsp/u-boot/u-boot-ti-staging/0001-rename-genimi-to-hw34.patch @@ -0,0 +1,102 @@ +From 8bd97ab74792c211ea6550c1696bf5f902016c1e Mon Sep 17 00:00:00 2001 +From: Samuel Dolt +Date: Wed, 31 May 2023 10:45:10 +0200 +Subject: [PATCH] rename genimi to hw34 + +--- + arch/arm/dts/Makefile | 4 ++-- + arch/arm/dts/k3-am642-gemini-binman.dtsi | 4 ++-- + .../{k3-am642-gemini-v1.dts => k3-am642-netmodule-hw34.dts} | 2 +- + ...-am642-r5-gemini-v1.dts => k3-am642-r5-netmodule-hw34.dts} | 0 + ...emini_a53_defconfig => am64x_netmodule_hw34_a53_defconfig} | 2 +- + ..._gemini_r5_defconfig => am64x_netmodule_hw34_r5_defconfig} | 2 +- + 6 files changed, 7 insertions(+), 7 deletions(-) + rename arch/arm/dts/{k3-am642-gemini-v1.dts => k3-am642-netmodule-hw34.dts} (99%) + rename arch/arm/dts/{k3-am642-r5-gemini-v1.dts => k3-am642-r5-netmodule-hw34.dts} (100%) + rename configs/{am64x_gemini_a53_defconfig => am64x_netmodule_hw34_a53_defconfig} (98%) + rename configs/{am64x_gemini_r5_defconfig => am64x_netmodule_hw34_r5_defconfig} (98%) + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index b4a4b0982d..2f6f09a4f4 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -1255,8 +1255,8 @@ dtb-$(CONFIG_SOC_K3_AM642) += k3-am642-evm.dtb \ + k3-am642-r5-evm.dtb \ + k3-am642-sk.dtb \ + k3-am642-r5-sk.dtb \ +- k3-am642-gemini-v1.dtb \ +- k3-am642-r5-gemini-v1.dtb ++ k3-am642-netmodule-hw34.dtb \ ++ k3-am642-r5-netmodule-hw34.dtb + + dtb-$(CONFIG_SOC_K3_AM625) += k3-am625-sk.dtb \ + k3-am625-r5-sk.dtb +diff --git a/arch/arm/dts/k3-am642-gemini-binman.dtsi b/arch/arm/dts/k3-am642-gemini-binman.dtsi +index 38627882ea..a06dc706b3 100644 +--- a/arch/arm/dts/k3-am642-gemini-binman.dtsi ++++ b/arch/arm/dts/k3-am642-gemini-binman.dtsi +@@ -13,10 +13,10 @@ + #define UBOOT_IMG "u-boot.img" + + #define SPL_NODTB "spl/u-boot-spl-nodtb.bin" +-#define SPL_AM642_GEMINI_DTB "spl/dts/k3-am642-gemini-v1.dtb" ++#define SPL_AM642_GEMINI_DTB "spl/dts/k3-am642-netmodule-hw34.dtb" + + #define UBOOT_NODTB "u-boot-nodtb.bin" +-#define AM642_GEMINI_DTB "arch/arm/dts/k3-am642-gemini-v1.dtb" ++#define AM642_GEMINI_DTB "arch/arm/dts/k3-am642-netmodule-hw34.dtb" + + &binman { + ti-spl { +diff --git a/arch/arm/dts/k3-am642-gemini-v1.dts b/arch/arm/dts/k3-am642-netmodule-hw34.dts +similarity index 99% +rename from arch/arm/dts/k3-am642-gemini-v1.dts +rename to arch/arm/dts/k3-am642-netmodule-hw34.dts +index d134e3a712..1608c3bf9d 100644 +--- a/arch/arm/dts/k3-am642-gemini-v1.dts ++++ b/arch/arm/dts/k3-am642-netmodule-hw34.dts +@@ -12,7 +12,7 @@ + #include "k3-am642.dtsi" + + / { +- compatible = "ti,am642-gemini", "ti,am642"; ++ compatible = "netmodule,hw34", "ti,am642"; + model = "NetModule AM642 based Gemini"; + + aliases { +diff --git a/arch/arm/dts/k3-am642-r5-gemini-v1.dts b/arch/arm/dts/k3-am642-r5-netmodule-hw34.dts +similarity index 100% +rename from arch/arm/dts/k3-am642-r5-gemini-v1.dts +rename to arch/arm/dts/k3-am642-r5-netmodule-hw34.dts +diff --git a/configs/am64x_gemini_a53_defconfig b/configs/am64x_netmodule_hw34_a53_defconfig +similarity index 98% +rename from configs/am64x_gemini_a53_defconfig +rename to configs/am64x_netmodule_hw34_a53_defconfig +index 900f29d7c1..acf5a340dc 100644 +--- a/configs/am64x_gemini_a53_defconfig ++++ b/configs/am64x_netmodule_hw34_a53_defconfig +@@ -14,7 +14,7 @@ CONFIG_ENV_SIZE=0x20000 + CONFIG_ENV_OFFSET=0x3e0000 + CONFIG_DM_GPIO=y + CONFIG_SPL_DM_SPI=y +-CONFIG_DEFAULT_DEVICE_TREE="k3-am642-gemini-v1" ++CONFIG_DEFAULT_DEVICE_TREE="k3-am642-netmodule-hw34" + CONFIG_SPL_TEXT_BASE=0x80080000 + CONFIG_SPL_MMC=y + CONFIG_SPL_SERIAL=y +diff --git a/configs/am64x_gemini_r5_defconfig b/configs/am64x_netmodule_hw34_r5_defconfig +similarity index 98% +rename from configs/am64x_gemini_r5_defconfig +rename to configs/am64x_netmodule_hw34_r5_defconfig +index 44c0364eef..c7e66a18e8 100644 +--- a/configs/am64x_gemini_r5_defconfig ++++ b/configs/am64x_netmodule_hw34_r5_defconfig +@@ -11,7 +11,7 @@ CONFIG_TARGET_AM642_R5_GEMINI=y + CONFIG_DM_GPIO=y + CONFIG_SPL_DM_SPI=y + CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000 +-CONFIG_DEFAULT_DEVICE_TREE="k3-am642-r5-gemini-v1" ++CONFIG_DEFAULT_DEVICE_TREE="k3-am642-r5-netmodule-hw34" + CONFIG_SPL_TEXT_BASE=0x70000000 + CONFIG_SPL_MMC=y + CONFIG_SPL_SERIAL=y diff --git a/layers/meta-netmodule-coreos-bsp/recipes-bsp/u-boot/u-boot-ti-staging_git.bb b/layers/meta-netmodule-coreos-bsp/recipes-bsp/u-boot/u-boot-ti-staging_git.bb new file mode 100644 index 0000000..678d5a7 --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/recipes-bsp/u-boot/u-boot-ti-staging_git.bb @@ -0,0 +1,26 @@ +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.01" + +SRC_URI = "git://git.netmodule.intranet/nmrouter/u-boot.git;protocol=ssh;user=gitea;branch=2023.01/ti/base \ + file://0001-rename-genimi-to-hw34.patch \ + " +SRCREV = "72a21cd71968af4e043510b9ae1ce331a6cca289" + +PACKAGECONFIG[atf] = "BL31=${STAGING_DIR_HOST}/firmware/bl31.bin,,trusted-firmware-a" + +do_deploy:append:netmodule-hw34-k3r5 () { + mv ${DEPLOYDIR}/tiboot3.bin ${DEPLOYDIR}/tiboot3-r5spl.bin || true + mv ${DEPLOYDIR}/u-boot-spl.bin ${DEPLOYDIR}/u-boot-spl-r5spl.bin || true +} + +# 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} + diff --git a/layers/meta-netmodule-coreos-bsp/recipes-core/udev/udev-gemini/gemini-can.rules b/layers/meta-netmodule-coreos-bsp/recipes-core/udev/udev-gemini/gemini-can.rules new file mode 100644 index 0000000..ec5b491 --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/recipes-core/udev/udev-gemini/gemini-can.rules @@ -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" diff --git a/layers/meta-netmodule-coreos-bsp/recipes-core/udev/udev-gemini_1.0.bb b/layers/meta-netmodule-coreos-bsp/recipes-core/udev/udev-gemini_1.0.bb new file mode 100644 index 0000000..2d3509d --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/recipes-core/udev/udev-gemini_1.0.bb @@ -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" diff --git a/layers/meta-netmodule-coreos-bsp/recipes-coreos/coreos-installer/coreos-installer-config/netmodule-hw34_1.0.sfdisk b/layers/meta-netmodule-coreos-bsp/recipes-coreos/coreos-installer/coreos-installer-config/netmodule-hw34_1.0.sfdisk new file mode 100644 index 0000000..241c48f --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/recipes-coreos/coreos-installer/coreos-installer-config/netmodule-hw34_1.0.sfdisk @@ -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" diff --git a/layers/meta-netmodule-coreos-bsp/recipes-coreos/coreos-installer/coreos-installer-config_%.bbappend b/layers/meta-netmodule-coreos-bsp/recipes-coreos/coreos-installer/coreos-installer-config_%.bbappend new file mode 100644 index 0000000..d612470 --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/recipes-coreos/coreos-installer/coreos-installer-config_%.bbappend @@ -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}/ +} diff --git a/layers/meta-netmodule-coreos-bsp/recipes-kernel/linux/linux-netmodule/0001-rename-k3-am642-gemini-v1.dts-to-k3-am642-netmodule-.patch b/layers/meta-netmodule-coreos-bsp/recipes-kernel/linux/linux-netmodule/0001-rename-k3-am642-gemini-v1.dts-to-k3-am642-netmodule-.patch new file mode 100644 index 0000000..9112386 --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/recipes-kernel/linux/linux-netmodule/0001-rename-k3-am642-gemini-v1.dts-to-k3-am642-netmodule-.patch @@ -0,0 +1,26 @@ +From 04d19014f019b6e5b3236b0f0d31d1df18ffeeca Mon Sep 17 00:00:00 2001 +From: Samuel Dolt +Date: Wed, 24 May 2023 15:59:34 +0200 +Subject: [PATCH] rename k3-am642-gemini-v1.dts to k3-am642-netmodule-hw34.dts + +--- + .../ti/{k3-am642-gemini-v1.dts => k3-am642-netmodule-hw34.dts} | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + rename arch/arm64/boot/dts/ti/{k3-am642-gemini-v1.dts => k3-am642-netmodule-hw34.dts} (99%) + +diff --git a/arch/arm64/boot/dts/ti/k3-am642-gemini-v1.dts b/arch/arm64/boot/dts/ti/k3-am642-netmodule-hw34.dts +similarity index 99% +rename from arch/arm64/boot/dts/ti/k3-am642-gemini-v1.dts +rename to arch/arm64/boot/dts/ti/k3-am642-netmodule-hw34.dts +index bc34523f7006..bca213661615 100644 +--- a/arch/arm64/boot/dts/ti/k3-am642-gemini-v1.dts ++++ b/arch/arm64/boot/dts/ti/k3-am642-netmodule-hw34.dts +@@ -13,7 +13,7 @@ + #include "k3-am642.dtsi" + + / { +- compatible = "ti,am642-gemini-v1", "ti,am642"; ++ compatible = "netmodule,hw34", "ti,am642"; + model = "NetModule AM642 based GEMINI V1"; + + chosen { diff --git a/layers/meta-netmodule-coreos-bsp/recipes-kernel/linux/linux-netmodule_git-5.10-ti.bb b/layers/meta-netmodule-coreos-bsp/recipes-kernel/linux/linux-netmodule_git-5.10-ti.bb new file mode 100644 index 0000000..c74bfae --- /dev/null +++ b/layers/meta-netmodule-coreos-bsp/recipes-kernel/linux/linux-netmodule_git-5.10-ti.bb @@ -0,0 +1,27 @@ +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=5.10/ti/base \ + file://0001-rename-k3-am642-gemini-v1.dts-to-k3-am642-netmodule-.patch \ + " +SRCREV = "0417c6736055dcd90c7fc33b7bec5b77b647ab05" + +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 diff --git a/templates/bblayers.conf.sample b/templates/bblayers.conf.sample index bd4dd2d..3b07568 100644 --- a/templates/bblayers.conf.sample +++ b/templates/bblayers.conf.sample @@ -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 \ "