From 4ff9a8c33c5f2514ee6e66788259399b6626f6b5 Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Thu, 10 Feb 2022 23:13:36 +0100 Subject: [PATCH 1/8] configs: ti: use standard configuration nodes naming Currently, any u-boot bootloader for ti armv7 platforms using DEFAULT_FIT_TI_ARGS to boot with a fitimage (boot_fit = 1) doesn't boot when built with Yocto Poky (openembedded-core). ## Loading kernel from FIT Image at 90000000 ... Could not find configuration node ERROR: can't get kernel image! Arago forked the kernel-fitimage class [1] and altered the configuration nodes naming while adding the OPTEE support by using FITIMAGE_CONF_BY_NAME by default [2]. The "upstream" kernel-fitimage class from openembedded-core still add the "conf-" prefix for each configuration nodes [3]. The ITS file format (from doc/uImage.FIT/source_file_format.txt) is not really accurate with the expected naming of these nodes. But in practice the "conf-" prefix is widely used. When the FIT image support has been added for ti armv7 platforms the naming from Arago has been used [3]. Fix this issue by adding the prefix expected by the ITS file generated by kernel-fitimage class from openembedded-core. [1] http://arago-project.org/git/meta-arago.git?p=meta-arago.git;a=commitdiff;h=719ab1b2098bcdc59c249e3529fa82cb1b9130e6 [2] http://arago-project.org/git/meta-arago.git?p=meta-arago.git;a=commitdiff;h=f23f2876a0cda89241d031bb7ba0b4256ed90035 [3] https://git.openembedded.org/openembedded-core/tree/meta/classes/kernel-fitimage.bbclass?h=yocto-3.1.13#n290 [3] 1e93cc8473e4fe018aececc8ed3bf8fc2b3ff561 Signed-off-by: Romain Naour Cc: Tom Rini Reviewed-by: Denys Dmytriyenko --- include/configs/ti_armv7_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h index 97337070092..7483bc821d3 100644 --- a/include/configs/ti_armv7_common.h +++ b/include/configs/ti_armv7_common.h @@ -55,7 +55,7 @@ "do;" \ "setenv overlaystring ${overlaystring}'#'${overlay};" \ "done;\0" \ - "run_fit=bootm ${addr_fit}#${fdtfile}${overlaystring}\0" \ + "run_fit=bootm ${addr_fit}#conf-${fdtfile}${overlaystring}\0" \ /* * DDR information. If the CONFIG_NR_DRAM_BANKS is not defined, From f7fbe547d99729cfa36238ba1629c26589834867 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Tue, 15 Feb 2022 07:47:55 +0100 Subject: [PATCH 2/8] arm: mach-k3: am6_init: Use CONFIG_TI_I2C_BOARD_DETECT We only want to call do_board_detect() if CONFIG_TI_I2C_BOARD_DETECT is set. Same as done for am64. This makes it possible to add a custom am65 based board design to U-Boot that does not use this board detection mechanism. Signed-off-by: Christian Gmeiner --- arch/arm/mach-k3/am6_init.c | 3 ++- board/ti/am65x/evm.c | 26 +++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c index ffb7aaded2e..8a6b1de7641 100644 --- a/arch/arm/mach-k3/am6_init.c +++ b/arch/arm/mach-k3/am6_init.c @@ -251,7 +251,8 @@ void board_init_f(ulong dummy) k3_sysfw_print_ver(); /* Perform EEPROM-based board detection */ - do_board_detect(); + if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) + do_board_detect(); #if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0) ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(k3_avs), diff --git a/board/ti/am65x/evm.c b/board/ti/am65x/evm.c index fbe33cbea55..7182a8cad1a 100644 --- a/board/ti/am65x/evm.c +++ b/board/ti/am65x/evm.c @@ -129,6 +129,7 @@ int ft_board_setup(void *blob, struct bd_info *bd) } #endif +#ifdef CONFIG_TI_I2C_BOARD_DETECT int do_board_detect(void) { int ret; @@ -353,23 +354,26 @@ static int probe_daughtercards(void) return 0; } +#endif int board_late_init(void) { - struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA; + if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) { + struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA; - setup_board_eeprom_env(); + setup_board_eeprom_env(); - /* - * The first MAC address for ethernet a.k.a. ethernet0 comes from - * efuse populated via the am654 gigabit eth switch subsystem driver. - * All the other ones are populated via EEPROM, hence continue with - * an index of 1. - */ - board_ti_am6_set_ethaddr(1, ep->mac_addr_cnt); + /* + * The first MAC address for ethernet a.k.a. ethernet0 comes from + * efuse populated via the am654 gigabit eth switch subsystem driver. + * All the other ones are populated via EEPROM, hence continue with + * an index of 1. + */ + board_ti_am6_set_ethaddr(1, ep->mac_addr_cnt); - /* Check for and probe any plugged-in daughtercards */ - probe_daughtercards(); + /* Check for and probe any plugged-in daughtercards */ + probe_daughtercards(); + } return 0; } From 4403e1a31cca73d516c2302e2950ddc8ea7d0c37 Mon Sep 17 00:00:00 2001 From: Aswath Govindraju Date: Wed, 16 Feb 2022 11:27:24 +0530 Subject: [PATCH 3/8] configs: j721e_*_evm_a72_defconfig: Enable config for setting mmc speed mode Enable config for setting mmc speed mode from U-Boot command line. Signed-off-by: Aswath Govindraju --- configs/j721e_evm_a72_defconfig | 1 + configs/j721e_hs_evm_a72_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig index b843a84415b..60c96f89613 100644 --- a/configs/j721e_evm_a72_defconfig +++ b/configs/j721e_evm_a72_defconfig @@ -193,3 +193,4 @@ CONFIG_UFS=y CONFIG_CADENCE_UFS=y CONFIG_TI_J721E_UFS=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_MMC_SPEED_MODE_SET=y diff --git a/configs/j721e_hs_evm_a72_defconfig b/configs/j721e_hs_evm_a72_defconfig index ae184b03587..6479f9baff0 100644 --- a/configs/j721e_hs_evm_a72_defconfig +++ b/configs/j721e_hs_evm_a72_defconfig @@ -162,3 +162,4 @@ CONFIG_UFS=y CONFIG_CADENCE_UFS=y CONFIG_TI_J721E_UFS=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_MMC_SPEED_MODE_SET=y From 39834ccdd43f492c61c0d8b4db55988b1f47a4dc Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 16 Feb 2022 09:06:49 +0100 Subject: [PATCH 4/8] arm: dts: iot2050: Add cfg register space for ringacc and udmap Recent unrelated fixes (9876ae7db6da) revealed that we were missing bits from 2af181b53e28 in the IOT2050 dt. Add them, but only for main U-Boot. SPL loads from QSPI only, thus cannot use DMA. Signed-off-by: Jan Kiszka --- .../dts/k3-am65-iot2050-common-u-boot.dtsi | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/k3-am65-iot2050-common-u-boot.dtsi b/arch/arm/dts/k3-am65-iot2050-common-u-boot.dtsi index 286e25f3794..d80c5501d2f 100644 --- a/arch/arm/dts/k3-am65-iot2050-common-u-boot.dtsi +++ b/arch/arm/dts/k3-am65-iot2050-common-u-boot.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright (c) Siemens AG, 2018-2021 + * Copyright (c) Siemens AG, 2018-2022 * * Authors: * Le Jin @@ -27,6 +27,29 @@ &cbass_mcu { u-boot,dm-spl; + + mcu_navss: bus@28380000 { + ringacc@2b800000 { + reg = <0x0 0x2b800000 0x0 0x400000>, + <0x0 0x2b000000 0x0 0x400000>, + <0x0 0x28590000 0x0 0x100>, + <0x0 0x2a500000 0x0 0x40000>, + <0x0 0x28440000 0x0 0x40000>; + reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target", "cfg"; + ti,dma-ring-reset-quirk; + }; + + dma-controller@285c0000 { + reg = <0x0 0x285c0000 0x0 0x100>, + <0x0 0x284c0000 0x0 0x4000>, + <0x0 0x2a800000 0x0 0x40000>, + <0x0 0x284a0000 0x0 0x4000>, + <0x0 0x2aa00000 0x0 0x40000>, + <0x0 0x28400000 0x0 0x2000>; + reg-names = "gcfg", "rchan", "rchanrt", "tchan", + "tchanrt", "rflow"; + }; + }; }; &cbass_wakeup { From 55fd1c442e747338604ef0075a4a888a40399ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Szymanski?= Date: Fri, 25 Feb 2022 14:48:54 +0100 Subject: [PATCH 5/8] cmd: pwm: fix typo 'eisable' -> 'disable' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed misspelled 'disable' in help text. Signed-off-by: Sébastien Szymanski --- cmd/pwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/pwm.c b/cmd/pwm.c index 7947e61aeed..7e82955239f 100644 --- a/cmd/pwm.c +++ b/cmd/pwm.c @@ -111,5 +111,5 @@ U_BOOT_CMD(pwm, 6, 0, do_pwm, "invert - invert polarity\n" "pwm config - config PWM\n" "pwm enable - enable PWM output\n" - "pwm disable - eisable PWM output\n" + "pwm disable - disable PWM output\n" "Note: All input values are in decimal"); From 5017f9b595da6e5c8f064a43fc6cd42cb62c082a Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 1 Mar 2022 08:53:56 +0100 Subject: [PATCH 6/8] mkimage: error handling for FIT image If parameter -F is given but FIT support is missing, a NULL pointer might dereferenced (Coverity CID 350249). If incorrect parameters are given, provide a message and show usage. Signed-off-by: Heinrich Schuchardt --- tools/mkimage.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/mkimage.c b/tools/mkimage.c index 760145119dc..74bd072832c 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -381,6 +381,11 @@ int main(int argc, char **argv) } if (params.fflag){ + if (!tparams) { + fprintf(stderr, "%s: Missing FIT support\n", + params.cmdname); + exit (EXIT_FAILURE); + } if (tparams->fflag_handle) /* * in some cases, some additional processing needs @@ -391,7 +396,7 @@ int main(int argc, char **argv) retval = tparams->fflag_handle(¶ms); if (retval != EXIT_SUCCESS) - exit (retval); + usage("Bad parameters for FIT image type"); } if (params.lflag || params.fflag) { From 4fa4227cdd14020bb6d588293f3cb8591aeebfa0 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 1 Mar 2022 12:43:32 +0100 Subject: [PATCH 7/8] .mailmap: Record all address for main U-Boot contributor Based on looking at top contributors it was seen that top statistics from top contributors don't include all contributions from different email addresses. That's why I checked all top contributors are checked it. git shortlog -n $START..$END -e -s The patch is adding mapping for Bin Meng, Marek Vasut, Masahiro Yamada, Michal Simek, Tom Rini, Wolfgang Denk. And also use mapping for Stefan Roese and Wolfgang Denk to be properly counted. Signed-off-by: Michal Simek Acked-by: Bin Meng Reviewed-by: Stefan Roese --- .mailmap | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index b36ae66719e..36fc1164a2b 100644 --- a/.mailmap +++ b/.mailmap @@ -22,6 +22,7 @@ Andreas Bießmann Aneesh V Anup Patel Atish Patra +Bin Meng Boris Brezillon Boris Brezillon Dirk Behme @@ -35,7 +36,15 @@ Jagan Teki Jernej Skrabec Igor Opaniuk Igor Opaniuk +Marek Vasut +Marek Vasut +Marek Vasut Markus Klotzbuecher +Masahiro Yamada +Masahiro Yamada +Michal Simek +Michal Simek +Michal Simek Nicolas Saenz Julienne Patrice Chotard Patrick Delaunay @@ -47,10 +56,19 @@ Ricardo Ribalda Ruchika Gupta Sandeep Paulraj Shaohui Xie -Stefan Roese +Stefan Roese Stefano Babic +Tom Rini TsiChung Liew -Wolfgang Denk +Wolfgang Denk +Wolfgang Denk +Wolfgang Denk +Wolfgang Denk +Wolfgang Denk +Wolfgang Denk +Wolfgang Denk +Wolfgang Denk +Wolfgang Denk York Sun York Sun Łukasz Majewski From 9b5ad4f5da756939eac4123fc347af533eeb339e Mon Sep 17 00:00:00 2001 From: Yann Droneaud Date: Tue, 1 Mar 2022 16:12:34 +0100 Subject: [PATCH 8/8] lib: rsa: use actual OpenSSL 1.1.0 EVP MD API Since OpenSSL 1.1.0, EVP_MD_CTX_create() is EVP_MD_CTX_new() EVP_MD_CTX_destroy() is EVP_MD_CTX_free() EVP_MD_CTX_init() is EVP_MD_CTX_reset() As there's no need to reset a newly created EVP_MD_CTX, moreover EVP_DigestSignInit() does the reset, thus call to EVP_MD_CTX_init() can be dropped. As there's no need to reset an EVP_MD_CTX before it's destroyed, as it will be reset by EVP_MD_CTX_free(), call to EVP_MD_CTX_reset() is not needed and can be dropped. Signed-off-by: Yann Droneaud --- lib/rsa/rsa-sign.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c index 3e7b7982890..b2a21199e48 100644 --- a/lib/rsa/rsa-sign.c +++ b/lib/rsa/rsa-sign.c @@ -383,12 +383,11 @@ static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo, goto err_alloc; } - context = EVP_MD_CTX_create(); + context = EVP_MD_CTX_new(); if (!context) { ret = rsa_err("EVP context creation failed"); goto err_create; } - EVP_MD_CTX_init(context); ckey = EVP_PKEY_CTX_new(pkey, NULL); if (!ckey) { @@ -425,8 +424,7 @@ static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo, goto err_sign; } - EVP_MD_CTX_reset(context); - EVP_MD_CTX_destroy(context); + EVP_MD_CTX_free(context); debug("Got signature: %zu bytes, expected %d\n", size, EVP_PKEY_size(pkey)); *sigp = sig; @@ -435,7 +433,7 @@ static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo, return 0; err_sign: - EVP_MD_CTX_destroy(context); + EVP_MD_CTX_free(context); err_create: free(sig); err_alloc: