From 64bc9777e8cab65fe6990a93b24d82fa1bf16dbf Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 31 Oct 2023 11:01:54 +0100 Subject: [PATCH] legacy-bsp: Add support for u-boot for armada id:458169 --- .../conf/machine/include/armada.inc | 1 + .../conf/machine/netmodule-hw14.conf | 2 + .../conf/machine/netmodule-hw17.conf | 2 + .../conf/machine/netmodule-hw18.conf | 2 + ...1-remove-redundant-YYLOC-declaration.patch | 44 +++++++++++++++++++ .../recipes-bsp/u-boot/u-boot-armada_git.bb | 27 ++++++++++++ 6 files changed, 78 insertions(+) create mode 100644 layers/meta-netmodule-legacy-bsp/recipes-bsp/u-boot/u-boot-armada/0001-remove-redundant-YYLOC-declaration.patch create mode 100644 layers/meta-netmodule-legacy-bsp/recipes-bsp/u-boot/u-boot-armada_git.bb diff --git a/layers/meta-netmodule-legacy-bsp/conf/machine/include/armada.inc b/layers/meta-netmodule-legacy-bsp/conf/machine/include/armada.inc index 15b2fdf..a934c1c 100644 --- a/layers/meta-netmodule-legacy-bsp/conf/machine/include/armada.inc +++ b/layers/meta-netmodule-legacy-bsp/conf/machine/include/armada.inc @@ -20,6 +20,7 @@ MACHINE_FEATURES:remove = "bluetooth" PREFERRED_PROVIDER_virtual/kernel = "linux-nrsw" +PREFERRED_PROVIDER_virtual/bootloader = "u-boot-armada" UBOOT_MACHINE = "${MACHINE}_defconfig" UBOOT_ENTRYPOINT = "0x13000000" UBOOT_LOADADDRESS = "${UBOOT_ENTRYPOINT}" diff --git a/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw14.conf b/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw14.conf index 4df7f58..1b09ee2 100644 --- a/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw14.conf +++ b/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw14.conf @@ -8,6 +8,8 @@ NRHW = "14" NM_MODELS = "3701 3711 3800" MAX_FS_SIZE = "279542" +UBOOT_MACHINE = "armada-385-hw14_defconfig" + # U-Boot reads actual DTB file name from board descriptor, see: # printenv fdt_image KERNEL_DEVICETREE = "\ diff --git a/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw17.conf b/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw17.conf index cbb6a05..258ae75 100644 --- a/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw17.conf +++ b/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw17.conf @@ -8,6 +8,8 @@ NRHW = "17" NM_MODELS = "2800 2810" MAX_FS_SIZE = "279542" +UBOOT_MACHINE = "armada-385-hw17_defconfig" + # U-Boot reads actual DTB file name from board descriptor, see: # printenv fdt_image KERNEL_DEVICETREE = "openwrt-nbhw17.dtb" diff --git a/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw18.conf b/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw18.conf index 74f3641..ff5364c 100644 --- a/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw18.conf +++ b/layers/meta-netmodule-legacy-bsp/conf/machine/netmodule-hw18.conf @@ -8,6 +8,8 @@ NRHW = "18" NM_MODELS = "1800 1810" MAX_FS_SIZE = "279542" +UBOOT_MACHINE = "armada-385-hw18_defconfig" + # U-Boot reads actual DTB file name from board descriptor, see: # printenv fdt_image KERNEL_DEVICETREE = " \ diff --git a/layers/meta-netmodule-legacy-bsp/recipes-bsp/u-boot/u-boot-armada/0001-remove-redundant-YYLOC-declaration.patch b/layers/meta-netmodule-legacy-bsp/recipes-bsp/u-boot/u-boot-armada/0001-remove-redundant-YYLOC-declaration.patch new file mode 100644 index 0000000..345ad47 --- /dev/null +++ b/layers/meta-netmodule-legacy-bsp/recipes-bsp/u-boot/u-boot-armada/0001-remove-redundant-YYLOC-declaration.patch @@ -0,0 +1,44 @@ +From 52c3ac31426131c555093542d51f1e6e0623507c Mon Sep 17 00:00:00 2001 +From: Marc Mattmueller +Date: Mon, 18 Jul 2022 19:26:59 +0200 +Subject: [PATCH] u-boot-armada: Remove redundant YYLOC global declaration + +Same as the upstream fix for building dtc with gcc 10. + +After having consulted the team, this patch is only applied to +the armada bootloader as this one is used on the core os +environment build-up. + +Signed-off-by: Marc Mattmueller +--- + scripts/dtc/dtc-lexer.l | 1 - + scripts/dtc/dtc-lexer.lex.c_shipped | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l +index fd825ebba6..24af549977 100644 +--- a/scripts/dtc/dtc-lexer.l ++++ b/scripts/dtc/dtc-lexer.l +@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n + #include "srcpos.h" + #include "dtc-parser.tab.h" + +-YYLTYPE yylloc; + extern bool treesource_error; + + /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ +diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped +index 3934d8624d..22f6e0d1f8 100644 +--- a/scripts/dtc/dtc-lexer.lex.c_shipped ++++ b/scripts/dtc/dtc-lexer.lex.c_shipped +@@ -639,7 +639,6 @@ char *yytext; + #include "srcpos.h" + #include "dtc-parser.tab.h" + +-YYLTYPE yylloc; + extern bool treesource_error; + + /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ +-- +2.20.1 + diff --git a/layers/meta-netmodule-legacy-bsp/recipes-bsp/u-boot/u-boot-armada_git.bb b/layers/meta-netmodule-legacy-bsp/recipes-bsp/u-boot/u-boot-armada_git.bb new file mode 100644 index 0000000..3b76349 --- /dev/null +++ b/layers/meta-netmodule-legacy-bsp/recipes-bsp/u-boot/u-boot-armada_git.bb @@ -0,0 +1,27 @@ +require u-boot-nm.inc + +SRC_URI = "git://git.netmodule.intranet/nmrouter/u-boot.git;protocol=ssh;user=gitea;branch=nrsw-armada-2017.11 \ + file://0001-remove-redundant-YYLOC-declaration.patch;name=yylloc \ +" +SRC_URI[yylloc.md5sum] = "504cb5b73a174a32e55c58f60608925d" + +DEPENDS += "bc-native" + +SRCREV = "2fe363eb69a360c9e9b6bd53dfdab32772b2f41a" + + +UBOOT_SUFFIX = "kwb" +UBOOT_BINARY = "u-boot-spl.${UBOOT_SUFFIX}" + +do_deploy() { + # xmodem files + cp ${B}/spl/u-boot-spl.bin ${DEPLOYDIR}/spl-u-boot-${MACHINE}.xmodem.bin + cp ${B}/u-boot.bin ${DEPLOYDIR}/u-boot-${MACHINE}.xmodem.bin + + # file for wic file + cp ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/u-boot-spl.${UBOOT_SUFFIX} + + # file for user usage + cp ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/u-boot-${MACHINE}.${UBOOT_SUFFIX} +} +