From dcb0cc01692cd231f817c4c4b3c59901a854e63e Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Wed, 7 Dec 2022 09:16:18 -0500 Subject: [PATCH 1/9] CI: Reduce aarch64 catchall job matches The aarch64 catch-all job is getting close to the hard time limit in Azure for the free tier. Move i.MX9 boards to the i.MX8 job and move amlogic entirely to its own job. This brings us down from 85 boards to 51 boards and so should be safe for a while. Signed-off-by: Tom Rini --- .azure-pipelines.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index d02c6636ffa..21213369c6c 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -447,6 +447,8 @@ stages: matrix: arc_microblaze_xtensa: BUILDMAN: "arc microblaze xtensa" + amlogic: + BUILDMAN: "amlogic" arm11_arm7_arm920t_arm946es: BUILDMAN: "arm11 arm7 arm920t arm946es" arm926ejs: @@ -476,9 +478,9 @@ stages: imx6: BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex" imx: - BUILDMAN: "mx -x mx6,freescale,technexion,toradex" - imx8: - BUILDMAN: "imx8" + BUILDMAN: "mx -x mx6,imx8,freescale,technexion,toradex" + imx8_imx9: + BUILDMAN: "imx8 imx9" keystone2_keystone3: BUILDMAN: "k2 k3" sandbox_asan: @@ -532,7 +534,7 @@ stages: uniphier: BUILDMAN: "uniphier" aarch64_catch_all: - BUILDMAN: "aarch64 -x bcm,imx8,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,renesas,sunxi,samsung,socfpga,rk,versal,zynq" + BUILDMAN: "aarch64 -x amlogic,bcm,imx8,imx9,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,renesas,sunxi,samsung,socfpga,rk,versal,zynq" rockchip: BUILDMAN: "rk" renesas: From f36597122906391afd20fd9663939f9ce4a060f4 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Thu, 3 Nov 2022 11:49:47 +0530 Subject: [PATCH 2/9] spl: Kconfig: Fix SPL_OPTEE_IMAGE dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fdt_addr will build as part of SPL_LOAD_FIT or SPL_LOAD_FIT_FULL which is indeed required to build optee image support in SPL. common/spl/spl.c: In function ‘jump_to_image_optee’: common/spl/spl.c:220:46: error: ‘struct spl_image_info’ has no member named ‘fdt_addr’ 220 | spl_optee_entry(NULL, NULL, spl_image->fdt_addr, Fix the dependency support. Signed-off-by: Jagan Teki --- common/spl/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 6c4848f3b9d..d774c930a80 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -1481,6 +1481,7 @@ config SPL_AM33XX_ENABLE_RTC32K_OSC config SPL_OPTEE_IMAGE bool "Support OP-TEE Trusted OS image in SPL" depends on ARM + depends on SPL_LOAD_FIT || SPL_LOAD_FIT_FULL help OP-TEE is an open source Trusted OS which is loaded by SPL. More detail at: https://github.com/OP-TEE/optee_os From 0d6d5a4aa6e04bedf87793de337c05a022268041 Mon Sep 17 00:00:00 2001 From: Viacheslav Mitrofanov Date: Tue, 6 Dec 2022 10:08:16 +0300 Subject: [PATCH 3/9] net: ipv6: Add missing break into IPv6 protocol handler IPv6 protocol handler is not terminated with a break statment. It can lead to running unexpected code. Signed-off-by: Viacheslav Mitrofanov Reviewed-by: Daniel Schwierzeck --- net/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/net.c b/net/net.c index 1c39acc4936..57da9bda85a 100644 --- a/net/net.c +++ b/net/net.c @@ -1269,6 +1269,7 @@ void net_process_received_packet(uchar *in_packet, int len) #if IS_ENABLED(CONFIG_IPV6) case PROT_IP6: net_ip6_handler(et, (struct ip6_hdr *)ip, len); + break; #endif case PROT_IP: debug_cond(DEBUG_NET_PKT, "Got IP\n"); From 56e3b1470333eb9294a5ae5f58515377aa546aae Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 7 Dec 2022 11:53:29 +0100 Subject: [PATCH 4/9] net: don't memcpy to NULL In ndisc_receive() 7 bytes are copied from a buffer of size 6 to NULL. net_nd_packet_mac is a pointer. If it is NULL, we should set it to the address of the buffer with the MAC address. Addresses-Coverity-ID: 430974 ("Out-of-bounds access") Fixes: c6610e1d90ea ("net: ipv6: Add Neighbor Discovery Protocol (NDP)") Signed-off-by: Heinrich Schuchardt Reviewed-by: Bin Meng Reviewed-by: Viacheslav Mitrofanov --- net/ndisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ndisc.c b/net/ndisc.c index 3c0eeeaea39..367dae76766 100644 --- a/net/ndisc.c +++ b/net/ndisc.c @@ -265,7 +265,7 @@ int ndisc_receive(struct ethernet_hdr *et, struct ip6_hdr *ip6, int len) /* save address for later use */ if (!net_nd_packet_mac) - memcpy(net_nd_packet_mac, neigh_eth_addr, 7); + net_nd_packet_mac = neigh_eth_addr; /* modify header, and transmit it */ memcpy(((struct ethernet_hdr *)net_nd_tx_packet)->et_dest, From c0d0569cf6f7d818cb1bbf5222c5e777bfea4d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Mon, 19 Dec 2022 22:41:52 +0100 Subject: [PATCH 5/9] powerpc/mpc85xx: Pass correct cpu compiler flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When gcc's default cpu (selected by --with-cpu= during gcc's configure phase) does not match target U-Boot board cpu then U-Boot binary does not have to be compiled correctly. Lot of distributions sets gcc's default cpu to generic powerpc variant which works fine. U-Boot already pass -Wa,-me500 flag to gcc which instructs GNU AS to accept e500 specific instructions when processing assembler source files (.S). This affects also assembly files generated by gcc from C source files. And because gcc for generic powerpc cpu puts '.machine ppc' at the beginning of the generated assembly file, it basically overwrites -me500 flag by which was GNU AS invoked (from U-boot build system). It started to be an issue since binutils 2.38 which does not keep enabled extra functional units selected by previous cpu. Hence issuing directive '.machine ppc' (generated by gcc for generic powerpc) after '.machine e500' (specifying at command line) disables usage of e500 specific instructions. And compiling arch/powerpc/cpu/mpc85xx/tlb.c code throws following assembler errors: {standard input}: Assembler messages: {standard input}:127: Error: unrecognized opcode: `tlbre' {standard input}:418: Error: unrecognized opcode: `tlbre' {standard input}:821: Error: unrecognized opcode: `msync' {standard input}:821: Error: unrecognized opcode: `tlbwe' {standard input}:884: Error: unrecognized opcode: `tlbsx' This issue was already hit by Debian people and is reported in bug tracker: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003490 Calling gcc with -mcpu=8540 flag fixes this issue because -mcpu=8540 tells gcc to compile code for e500 core/cpu (overwriting gcc's default cpu) and does not put '.machine ppc' directive into assembly anymore. Also if gcc is invoked with -mcpu=8540 then it pass -me500 flag to GNU AS. So it is unnecessary to manually specify -Wa,-me500 flag because it is implicitly added. Fix this issue properly by specifying correct -mcpu compiler flag for all supported powerpc cores in U-Boot mpc85xx platform, which are: e500v1, e500v2, e500mc, e5500 and e6500. For specifying e500v1 and e500v2 cores, gcc has unintuitive -mcpu=8540 and -mcpu=8548 flag names, for other cores -mcpu matches core name. The only difference between gcc's -mcpu=8540 and -mcpu=8548 flags is support for double precision floating point SPE instructions. As U-Boot does not use floating point, it is fine to use -mcpu=8540 for both e500v1 and e500v2 cores. Moreover gcc 9 completely removed e500 floating point support, so since gcc 9 -mcpu=8548 is just alias to -mcpu=8540. Note that U-Boot's CONFIG_E500 option is set also for other cpus, not only for e500v1 and e500v2. So do not check for CONFIG_E500 and rather set e500 as last fallback value when no other mpc85xx cpu matches. Signed-off-by: Pali Rohár --- arch/powerpc/cpu/mpc85xx/config.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/cpu/mpc85xx/config.mk b/arch/powerpc/cpu/mpc85xx/config.mk index 7a1d81cf2d7..b6b5d2053ae 100644 --- a/arch/powerpc/cpu/mpc85xx/config.mk +++ b/arch/powerpc/cpu/mpc85xx/config.mk @@ -3,7 +3,7 @@ # (C) Copyright 2002,2003 Motorola Inc. # Xianghua Xiao, X.Xiao@motorola.com -PLATFORM_CPPFLAGS += -Wa,-me500 -msoft-float -mno-string +PLATFORM_CPPFLAGS += -msoft-float -mno-string PLATFORM_RELFLAGS += -msingle-pic-base -fno-jump-tables # -mspe=yes is needed to have -mno-spe accepted by a buggy GCC; @@ -11,3 +11,13 @@ PLATFORM_RELFLAGS += -msingle-pic-base -fno-jump-tables # http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00311.html PLATFORM_CPPFLAGS += $(call cc-option,-mspe=yes) \ $(call cc-option,-mno-spe) + +ifdef CONFIG_E6500 +PLATFORM_CPPFLAGS += -mcpu=e6500 +else ifdef CONFIG_E5500 +PLATFORM_CPPFLAGS += -mcpu=e5500 +else ifdef CONFIG_E500MC +PLATFORM_CPPFLAGS += -mcpu=e500mc +else +PLATFORM_CPPFLAGS += -mcpu=8540 +endif From 138b6061a100f149e9249d09ef3e6db2437ff147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Sun, 11 Dec 2022 15:14:59 +0100 Subject: [PATCH 6/9] powerpc/mpc85xx: Improve disabling of SPE instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specifying -mspe=no also disables usage of SPE instructions. It is documented in "[PATCH,rs6000] make -mno-spe work as expected" email: http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00311.html So replace -mspe=yes by -mspe=no, so make it clear that u-boot has to be compiled without SPE instructions. Linux kernel contains following Makefile code to achieve it: # No SPE instruction when building kernel # (We use all available options to help semi-broken compilers) KBUILD_CFLAGS += $(call cc-option,-mno-spe) KBUILD_CFLAGS += $(call cc-option,-mspe=no) Do same for U-Boot. Signed-off-by: Pali Rohár --- arch/powerpc/cpu/mpc85xx/config.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/config.mk b/arch/powerpc/cpu/mpc85xx/config.mk index b6b5d2053ae..482bb90cb12 100644 --- a/arch/powerpc/cpu/mpc85xx/config.mk +++ b/arch/powerpc/cpu/mpc85xx/config.mk @@ -6,11 +6,12 @@ PLATFORM_CPPFLAGS += -msoft-float -mno-string PLATFORM_RELFLAGS += -msingle-pic-base -fno-jump-tables -# -mspe=yes is needed to have -mno-spe accepted by a buggy GCC; +# No SPE instruction when building u-boot +# (We use all available options to help semi-broken compilers) # see "[PATCH,rs6000] make -mno-spe work as expected" on # http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00311.html -PLATFORM_CPPFLAGS += $(call cc-option,-mspe=yes) \ - $(call cc-option,-mno-spe) +PLATFORM_CPPFLAGS += $(call cc-option,-mno-spe) \ + $(call cc-option,-mspe=no) ifdef CONFIG_E6500 PLATFORM_CPPFLAGS += -mcpu=e6500 From 1db706edcd72724a6f18228d42b26e6b8e9e51ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Mon, 19 Dec 2022 22:46:22 +0100 Subject: [PATCH 7/9] powerpc/mpc85xx: Disable AltiVec and VSX instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All vector instructions on powerpc mpc85xx must not be used because U-Boot does not enable them. Usage cause random crashes. SPE vector instructions are already disabled by compiler flags, so disable also AltiVec and VSX vector instructions. Linux kernel disables AltiVec and VSX instructions too. Signed-off-by: Pali Rohár --- arch/powerpc/cpu/mpc85xx/config.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/cpu/mpc85xx/config.mk b/arch/powerpc/cpu/mpc85xx/config.mk index 482bb90cb12..71a98f05c90 100644 --- a/arch/powerpc/cpu/mpc85xx/config.mk +++ b/arch/powerpc/cpu/mpc85xx/config.mk @@ -13,6 +13,10 @@ PLATFORM_RELFLAGS += -msingle-pic-base -fno-jump-tables PLATFORM_CPPFLAGS += $(call cc-option,-mno-spe) \ $(call cc-option,-mspe=no) +# No AltiVec or VSX instructions when building u-boot +PLATFORM_CPPFLAGS += $(call cc-option,-mno-altivec) +PLATFORM_CPPFLAGS += $(call cc-option,-mno-vsx) + ifdef CONFIG_E6500 PLATFORM_CPPFLAGS += -mcpu=e6500 else ifdef CONFIG_E5500 From dd5f07eb6b7ee3b3a26f5d2403f53c630d6a5b02 Mon Sep 17 00:00:00 2001 From: Jim Liu Date: Tue, 13 Sep 2022 14:25:21 +0800 Subject: [PATCH 8/9] net: nuvoton: fix build broken for use phy_get_interface_by_name The original patch is use phy_get_interface_by_name to set interface. The new patch is use dev_read_phy_mode to replace it. Signed-off-by: Jim Liu Reviewed-by: Ramon Fried --- drivers/net/npcm750_eth.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/npcm750_eth.c b/drivers/net/npcm750_eth.c index 409d5cce4a7..bd29a10def8 100644 --- a/drivers/net/npcm750_eth.c +++ b/drivers/net/npcm750_eth.c @@ -710,12 +710,12 @@ static int npcm750_eth_ofdata_to_platdata(struct udevice *dev) pdata->phy_interface = -1; phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", NULL); + if (phy_mode) - pdata->phy_interface = phy_get_interface_by_name(phy_mode); - if (pdata->phy_interface == -1) { - printf("%s: Invalid PHY interface '%s'\n", __func__, phy_mode); + pdata->phy_interface = dev_read_phy_mode(dev); + + if (pdata->phy_interface == PHY_INTERFACE_MODE_NA) return -EINVAL; - } pdata->max_speed = 0; cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL); From 440098c42e7369f4b5703a82723b2ce268180a1f Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 15 Dec 2022 23:37:59 +0100 Subject: [PATCH 9/9] pylibfdt: Fix version normalization warning Fix the following version normalization warning: " /usr/lib/python3/dist-packages/setuptools/dist.py:530: UserWarning: Normalizing '2023.01' to '2023.1' " Using suggestion from Richard Jones: https://github.com/pypa/setuptools/issues/308#issuecomment-405817468 Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- scripts/dtc/pylibfdt/setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/dtc/pylibfdt/setup.py b/scripts/dtc/pylibfdt/setup.py index ec1fc5002b0..9abdb57595a 100755 --- a/scripts/dtc/pylibfdt/setup.py +++ b/scripts/dtc/pylibfdt/setup.py @@ -22,10 +22,14 @@ allows this script to be run stand-alone, e.g.: from setuptools import setup, Extension from setuptools.command.build_py import build_py as _build_py +from setuptools.extern.packaging import version import os import re import sys +# Disable version normalization +version.Version = version.LegacyVersion + srcdir = os.path.dirname(__file__) with open(os.path.join(srcdir, "../README"), "r") as fh: