Re: [PATCH v8 3/3] efi_loader: add PE/COFF image measurement

2021-05-24 Thread Masahisa Kojima
On Mon, 24 May 2021 at 21:53, Ilias Apalodimas wrote: > > new_efi); > > + > > bool efi_image_parse(void *efi, size_t len, struct efi_image_regions > > **regp, > >WIN_CERTIFICATE **auth, size_t *auth_len); > > > > diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h > > index

Re: [PATCH 8/8] mmc: sunxi: Use mmc_of_parse()

2021-05-24 Thread Jaehoon Chung
On 5/25/21 8:30 AM, Andre Przywara wrote: > At the moment the Allwinner MMC driver parses the bus-width and > non-removable DT properties itself, in the probe() routine. > > There is actually a generic function provided by the MMC framework doing > this job, also it parses more generic properties

Re: [PATCH 4/8] mmc: sunxi: Cleanup "new timing mode" selection

2021-05-24 Thread Jaehoon Chung
On 5/25/21 8:30 AM, Andre Przywara wrote: > Among the SoCs using the "new timing mode", only the A83T needs to > explicitly switch to that mode. > > By just defining the symbol for that one odd A83T bit to 0 for any other > SoCs, we can always OR that in, and save the confusing nested #ifdefs. >

Re: [PATCH 2/8] mmc: sunxi: Fix warnings with CONFIG_PHYS_64BIT

2021-05-24 Thread Jaehoon Chung
On 5/25/21 8:30 AM, Andre Przywara wrote: > When enabling PHYS_64BIT on 32-bit platforms, we get two warnings about > pointer casts in sunxi_mmc.c. Those are related to MMIO addresses, which > are always below 1GB on all Allwinner SoCs, so there is no problem with > anything having more than 32

Re: [PATCH 1/8] mmc: sunxi: Avoid #ifdefs in delay and width setup

2021-05-24 Thread Jaehoon Chung
On 5/25/21 8:30 AM, Andre Przywara wrote: > The delay and bus-width setup are slightly different across the > Allwinner SoC generations, and we covered this so far with some > preprocessor conditionals. > > Use the more readable IS_ENABLE() instead. > > Signed-off-by: Andre Przywara

Re: sdhci_data_transfer: Trasnfer data timeout

2021-05-24 Thread Jaehoon Chung
Hi On 5/24/21 11:43 PM, aregaard wrote: > Hi, > I have made a custom board based on ARM A53. > I use a NOR-flash, eMMC and DDR3. > > I can start the Uboot from NOR and communicate with the eMMC. > But for some reason it is timing out the first time I connect to the eMMC. > You can enable

Re: [PATCH u-boot v4 17/36] sandbox: use sections instead of symbols for getopt array boundaries

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:06PM +0200, Marek Behún wrote: > In style of linked lists, instead of declaring symbols for boundaries > of getopt options array in the linker script, declare corresponding > sections and retrieve the boundaries via static inline functions. > > Without this clang's

Re: [PATCH u-boot v4 14/36] build: support building with Link Time Optimizations

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:03PM +0200, Marek Behún wrote: > Add plumbing for building U-Boot with Link Time Optimizations. > > When building with LTO, $(PLATFORM_LIBS) has to be in --whole-archive / > --no-whole-archive group, otherwise some functions declared in assembly > may not be

Re: [PATCH u-boot v4 15/36] build: link with --build-id=none

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:04PM +0200, Marek Behún wrote: > Some toolchains are compiled so that they pass a --build-id=something > parameter to the linker implicitly. > > This causes U-Boot LTO linking to fail with something like: > ld: section .note.gnu.build-id LMA ... overlaps section

Re: [PATCH u-boot v4 16/36] sandbox: errno: avoid conflict with libc's errno

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:05PM +0200, Marek Behún wrote: > When building with LTO, the system libc's `errno` variable used in > arch/sandbox/cpu/os.c conflicts with U-Boot's `errno` (defined in > lib/errno.c) with the following error: > .../ld: errno@@GLIBC_PRIVATE: TLS definition in

Re: [PATCH u-boot v4 25/36] ARM: fix LTO for keystone

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:14PM +0200, Marek Behún wrote: > When building keystone with LTO the compiler complains: > Error: selected processor does not support `smc #0' in Thumb mode > > Fix this by removing -flto for the file implementing these SMC calls. > > Signed-off-by: Marek Behún

Re: [PATCH u-boot v4 26/36] ARM: kona: fix clk_bsc_enable() type mismatch for LTO

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:15PM +0200, Marek Behún wrote: > When building with LTO, the compiler complains about type mismatch of > function clk_bsc_enable() in file: > arch/arm/cpu/armv7/kona-common/clk-stubs.c > vs other files that define or use this function: > warning: type of

Re: [PATCH u-boot v4 24/36] ARM: fix LTO for apf27

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:13PM +0200, Marek Behún wrote: > When apf27_defconfig is built with LTO, linking complains about > undefined reference to `nand_boot`. This is because it is referenced > from inline assembly. Make it visible. > > Signed-off-by: Marek Behún Applied to

Re: [PATCH u-boot v4 22/36] ARM: fix LTO build for some thumb-interwork cases

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:11PM +0200, Marek Behún wrote: > Fix LTO build for some thumb-interwork usecases (such as for > da850evm_defconfig), where inline assmebly such as > mrc p15,0,r2,c1,c0,0 > causes the compiler to fail during LTO linking with > Error: selected processor does not

Re: [PATCH u-boot v4 20/36] ARM: global_data: make set_gd() work for armv5 and armv6

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:09PM +0200, Marek Behún wrote: > The Thumb instruction `ldr` is able to move high registers only from > armv7. For armv5 and armv6 we have to use `mov`. > > Signed-off-by: Marek Behún > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom

[ANN] U-Boot v2021.07-rc3 released

2021-05-24 Thread Tom Rini
Hey all, It's release day, and here's v2021.07-rc3. It's later in the day than I would have liked, but getting the LTO series in took a bit longer than I expected. At this point, for v2021.07 related removal series, I've posted DM_PCI and DM_USB series, and Anatolij just posted DM_VIDEO related

Re: [PATCH] pylibfdt: Rework "avoid unused variable warning" lines

2021-05-24 Thread Tom Rini
On Mon, May 24, 2021 at 11:47:27AM -0400, Tom Rini wrote: > Clang has -Wself-assign enabled by default under -Wall and so when > building with -Werror we would get an error here. Inspired by Linux > kernel git commit a21151b9d81a ("tools/build: tweak unused value > workaround") make use of the

Re: [PATCH] stackprot: Make our test a bit more complex

2021-05-24 Thread Tom Rini
On Mon, May 24, 2021 at 02:59:13PM -0400, Tom Rini wrote: > With better compiler optimizations available, a compiler may see we do > nothing with our buffer after calling memset and omit the call, thus > causing us to not smash the stack. Add a comment to explain why we now > also have a printf

Re: [PATCH v2 07/16] test: Avoid random numbers in dm_test_devm_regmap()

2021-05-24 Thread Tom Rini
On Thu, May 13, 2021 at 07:39:23PM -0600, Simon Glass wrote: > There is no good reason to use a sequence from rand() here. We may as well > invent our own sequence. > > This should molify Coverity which does not use rand() being used. > > Signed-off-by: Simon Glass > Reported-by: Coverity

Re: [PATCH u-boot v4 36/36] ARM: enable LTO for some boards

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:25PM +0200, Marek Behún wrote: > Enable LTO for some boards that were tested by people on U-Boot Mailing > List. > > Signed-off-by: Marek Behún > Tested-by: Adam Ford > Tested-by: Pali Rohár > Tested-by: Tim Harvey Applied to u-boot/master, thanks! -- Tom

Re: [PATCH u-boot v4 35/36] ARM: don't use --gc-sections with LTO when using private libgcc

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:24PM +0200, Marek Behún wrote: > When using LTO, we can throw away the --gc-sections flag, but only if > using private libgcc. > > When using system's libgcc, --gc-sections is still needed, otherwise > linking will fail due to undefined references to libc's symbols.

Re: [PATCH u-boot v4 34/36] ARM: don't use -ffunction-sections/-fdata-sections with LTO build

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:23PM +0200, Marek Behún wrote: > When building with LTO, using -ffunction-sections/-fdata-sections is not > useful anymore. > > Signed-off-by: Marek Behún > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP

Re: [PATCH u-boot v4 33/36] ARM: make LTO available

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:22PM +0200, Marek Behún wrote: > Make LTO available for ARM architecture. > > Signed-off-by: Marek Behún > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature

Re: [PATCH u-boot v4 32/36] ata: ahci: fix ahci_link_up() type mismatch for LTO

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:21PM +0200, Marek Behún wrote: > When building highbank_defconfig with LTO, the compiler complains about > type mismatch of function ahci_link_up(). > > The third parameter of this function is of type u8 in > drivers/ata/ahci.c, but of type int in

Re: [PATCH u-boot v4 31/36] armv8: SPL: discard relocation information

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:20PM +0200, Marek Behún wrote: > For some reason when building SPL for ARMv8 with LTO, the relocation > information is not discarded. > > Discard it explicitly in the linker script. > > This fixes LTO build for imx8mm_venice_defconfig. > > Signed-off-by: Marek

Re: [PATCH u-boot v4 30/36] ARM: omap3: fix LTO for DM3730 (and possibly other omap3 boards)

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:19PM +0200, Marek Behún wrote: > Adam Ford says that DM3730 needs board.c compiled without LTO flags. > > Signed-off-by: Marek Behún > Tested-by: Adam Ford Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature

Re: [PATCH u-boot v4 29/36] ARM: fix LTO for rockchip and samsung

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:18PM +0200, Marek Behún wrote: > When building with LTO, the compiler complains about type mismatch of > function usb_gadget_handle_interrupts(). This function is defined > without parameters in files > arch/arm/mach-rockchip/board.c >

Re: [PATCH u-boot v4 28/36] ARM: fix LTO for seaboard

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:17PM +0200, Marek Behún wrote: > When seaboard_defconfig is compiled with LTO, the compiler complains > about some instructions not being supported in ARM mode. > > This is caused by arch/arm/mach-tegra/tegra20/warmboot_avp.c having > different CFLAGS declared in

Re: [PATCH u-boot v4 27/36] ARM: imx8m: fix imx_eqos_txclk_set_rate() type mismatch for LTO

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:16PM +0200, Marek Behún wrote: > When building imx8mp_evk_defconfig with LTO, the compiler complains > about type mismatch of function imx_eqos_txclk_set_rate() in file > drivers/net/dwc_eth_qos.c:845:12 > which contains a weak definition of this function, vs file

Re: [PATCH u-boot v4 21/36] ARM: make gd a function call for LTO and set via set_gd()

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:10PM +0200, Marek Behún wrote: > On ARM, the gd pointer is stored in registers r9 / x18. For this the > -ffixed-r9 / -ffixed-x18 flag is used when compiling, but using global > register variables causes errors when building with LTO, and these > errors are very

Re: [PATCH u-boot v4 23/36] ARM: fix LTO for imx28_xea

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:12PM +0200, Marek Behún wrote: > When imx28_xea_defconfig is built with LTO, the compiler complains about > the two different declarations of _start: >include/asm-generic/sections.has extern void _start(void); >arch/arm/cpu/arm926ejs/mxs/mxs.c as

Re: [PATCH u-boot v4 19/36] sandbox: enable LTO by default

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:08PM +0200, Marek Behún wrote: > Build sandbox targets with LTO by default. > > Signed-off-by: Marek Behún > Reviewed-by: Bin Meng Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature

Re: [PATCH u-boot v4 18/36] sandbox: make LTO available

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:07PM +0200, Marek Behún wrote: > Make LTO available for sandbox architecture. > > Signed-off-by: Marek Behún > Reviewed-by: Bin Meng Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature

Re: [PATCH u-boot v4 13/36] build: use thin archives instead of incremental linking

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:02PM +0200, Marek Behún wrote: > Currently we use incremental linking (ld -r) to link several object > files from one directory into one built-in.o object file containing the > linked code from that directory (and its subdirectories). > > Linux has, some time ago,

Re: [PATCH u-boot v4 12/36] Makefile, Makefile.spl: cosmetic change

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:01PM +0200, Marek Behún wrote: > Indent the linking commands so that they look cosmetically better. > > Signed-off-by: Marek Behún > Reviewed-by: Bin Meng Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature

Re: [PATCH u-boot v4 12/36] Makefile, Makefile.spl: cosmetic change

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:01PM +0200, Marek Behún wrote: > Indent the linking commands so that they look cosmetically better. > > Signed-off-by: Marek Behún > Reviewed-by: Bin Meng Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature

Re: [PATCH u-boot v4 11/36] lib: crc32: put the crc_table variable into efi_runtime_rodata section

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:24:00PM +0200, Marek Behún wrote: > When compiling with LTO, the compiler fails with an error saying that > `crc_table` causes a section type conflict with `efi_var_buf`. > > This is because both are declared to be in the same section (via macro >

Re: [PATCH u-boot v4 10/36] efi_selftest: compiler flags for efi_selftest_miniapp_exception.o

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:23:59PM +0200, Marek Behún wrote: > Add $(CFLAGS_EFI) and remove $(CFLAGS_NON_EFI) for > efi_selftest_miniapp_exception.o. > > The removal is needed when compiling with LTO - this object file needs > to be compiled without -flto. > > The adding is for consistency with

Re: [PATCH u-boot v4 09/36] efi_loader: add macro for const EFI runtime data

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:23:58PM +0200, Marek Behún wrote: > Add macro __efi_runtime_rodata, for const variables with similar purpose > as those using __efi_runtime_data. > > Signed-off-by: Marek Behún > Reviewed-by: Heinrich Schuchardt Applied to u-boot/master, thanks! -- Tom

Re: [PATCH u-boot v4 08/36] efi_loader: add Sphinx doc for __efi_runtime and __efi_runtime_data

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:23:57PM +0200, Marek Behún wrote: > Document the macros __efi_runtime and __efi_runtime_data in Sphinx > style. > > Signed-off-by: Marek Behún > Reviewed-by: Heinrich Schuchardt Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature

Re: [PATCH u-boot v4 07/36] efi_loader: fix warning when linking with LTO

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:23:56PM +0200, Marek Behún wrote: > When linking with LTO, the compiler complains about type mismatch of > variables `__efi_runtime_start`, `__efi_runtime_stop`, > `__efi_runtime_rel_start` and `__efi_runtime_rel_stop`: > > include/efi_loader.h:218:21: warning: type

Re: [PATCH u-boot v4 06/36] string: make memcpy(), memset(), memcmp() and memmove() visible for LTO

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:23:55PM +0200, Marek Behún wrote: > It seems that sometimes (happening on ARM64, for example with > turris_mox_defconfig) GCC, when linking with LTO, changes the symbol > names of some functions, for example lib/string.c's memcpy() function to > memcpy.isra.0. > > This

Re: [PATCH u-boot v4 05/36] test/py: improve regular expression for ut subtest symbol matcher

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:23:54PM +0200, Marek Behún wrote: > Improve the regular expression that matches unittest symbols in > u-boot.sym. > > Currently we do not enforce no prefix in symbol string, but with the > soon to come change in linker lists declaring lists and entries with the >

Re: [PATCH u-boot v4 04/36] compiler.h: align the __ADDRESSABLE macro with Linux' version

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:23:53PM +0200, Marek Behún wrote: > Use UNIQUE_ID in the __ADDRESSABLE macro. > > Signed-off-by: Marek Behún > Reviewed-by: Bin Meng Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature

Re: [PATCH u-boot v4 02/36] checkpatch: require quotes around section name in the __section() macro

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:23:51PM +0200, Marek Behún wrote: > This is how Linux does this now, see Linux commit 339f29d91acf. > > Signed-off-by: Marek Behún > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature

Re: [PATCH u-boot v4 03/36] treewide: Convert macro and uses of __section(foo) to __section("foo")

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:23:52PM +0200, Marek Behún wrote: > This commit does the same thing as Linux commit 33def8498fdd. > > Use a more generic form for __section that requires quotes to avoid > complications with clang and gcc differences. > > Remove the quote operator # from

Re: [PATCH u-boot v4 01/36] regmap: fix a serious pointer casting bug

2021-05-24 Thread Tom Rini
On Thu, May 20, 2021 at 01:23:50PM +0200, Marek Behún wrote: > There is a serious bug in regmap_read() and regmap_write() functions > where an uint pointer is cast to (void *) which is then cast to (u8 *), > (u16 *), (u32 *) or (u64 *), depending on register width of the map. > > For example

sdhci_data_transfer: Trasnfer data timeout

2021-05-24 Thread aregaard
Hi, I have made a custom board based on ARM A53. I use a NOR-flash, eMMC and DDR3. I can start the Uboot from NOR and communicate with the eMMC. But for some reason it is timing out the first time I connect to the eMMC. *(CLK =25MHz)* => run mmc_format eMMC: INT_STATUS = 00018000 eMMC:

[PATCH 7/8] mmc: sunxi: Increase MMIO FIFO read performance

2021-05-24 Thread Andre Przywara
To avoid the complexity of DMA operations (with chained descriptors), we use repeated MMIO reads and writes to the SD_FIFO_REG, which allows us to drain or fill the MMC data buffer FIFO very easily. However those MMIO accesses are somewhat costly, so this limits our MMC performance, to between 17

[PATCH 8/8] mmc: sunxi: Use mmc_of_parse()

2021-05-24 Thread Andre Przywara
At the moment the Allwinner MMC driver parses the bus-width and non-removable DT properties itself, in the probe() routine. There is actually a generic function provided by the MMC framework doing this job, also it parses more generic properties like broken-cd and advanced transfer modes. Drop

[PATCH 6/8] mmc: sunxi: Cleanup and fix self-calibration code

2021-05-24 Thread Andre Przywara
Newer SoCs have a self calibration feature, which avoids us writing hard coded phase delay values into the controller. Consolidate the code by avoiding unnecessary #ifdefs, and also enabling the feature for all those newer SoCs. Signed-off-by: Andre Przywara --- drivers/mmc/sunxi_mmc.c | 27

[PATCH 5/8] mmc: sunxi: Enable "new timing mode" on all new SoCs

2021-05-24 Thread Andre Przywara
All SoCs since the Allwinner A64 (H5, H6, R40, H616) feature the so called "new timing mode", so enable this in Kconfig for those SoCs. Signed-off-by: Andre Przywara --- arch/arm/mach-sunxi/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-sunxi/Kconfig

[PATCH 4/8] mmc: sunxi: Cleanup "new timing mode" selection

2021-05-24 Thread Andre Przywara
Among the SoCs using the "new timing mode", only the A83T needs to explicitly switch to that mode. By just defining the symbol for that one odd A83T bit to 0 for any other SoCs, we can always OR that in, and save the confusing nested #ifdefs. Clean up the also confusing new_mode setting on the

[PATCH 3/8] mmc: sunxi: Fix MMC clock parent selection

2021-05-24 Thread Andre Przywara
Most Allwinner SoCs which use the so called "new timing mode" in their MMC controllers actually use the double-rate PLL6/PERIPH0 clock as their parent input clock. This is interestingly enough compensated by a hidden "by 2" post-divider in the mod clock, so the divider and actual output rate stay

[PATCH 2/8] mmc: sunxi: Fix warnings with CONFIG_PHYS_64BIT

2021-05-24 Thread Andre Przywara
When enabling PHYS_64BIT on 32-bit platforms, we get two warnings about pointer casts in sunxi_mmc.c. Those are related to MMIO addresses, which are always below 1GB on all Allwinner SoCs, so there is no problem with anything having more than 32 bits. Add the proper casts to make it compile

[PATCH 1/8] mmc: sunxi: Avoid #ifdefs in delay and width setup

2021-05-24 Thread Andre Przywara
The delay and bus-width setup are slightly different across the Allwinner SoC generations, and we covered this so far with some preprocessor conditionals. Use the more readable IS_ENABLE() instead. Signed-off-by: Andre Przywara --- drivers/mmc/sunxi_mmc.c | 33 +++--

[PATCH 0/8] sunxi: mmc: Fixes and speed increase

2021-05-24 Thread Andre Przywara
While debugging some eMMC problem on the H616 SoC, I stumbled upon some weird code in the Allwinner MMC driver. Some closer inspection and some help from Ondrej later this series of fixes emerged: Some patches remove part of the #ifdef hell we needlessly had in the driver. A big chunk is around

Re: [PATCH v2] tee: optee: sync cache on pre-reloc OP-TEE invocation

2021-05-24 Thread Ilias Apalodimas
On Wed, May 19, 2021 at 04:27:41PM +0200, Etienne Carriere wrote: > This change ensures both U-Boot and OP-TEE see the same content > from shared memory when OP-TEE is invoked prior U-Boot relocation. > > This change is required since U-Boot may execute with data cahce off > while OP-TEE always

[PATCH] tools: Use a single target-independent config to enable OpenSSL

2021-05-24 Thread Alexandru Gagniuc
Host tool features, such as mkimage's ability to sign FIT images were enabled or disabled based on the target configuration. However, this misses the point of a target-agnostic host tool. A target's ability to verify FIT signatures is independent of mkimage's ability to create those signatures.

[PATCH v2 18/18] image: Add support for relocating crypto_algos in linker lists

2021-05-24 Thread Alexandru Gagniuc
Function pointers from crypto_algos array are relocated, when NEEDS_MANUAL_RELOC is set. This relocation doesn't happen if the algo is placed in a linker list. Implement this relocation. Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass Acked-by: Michal Simek --- common/image-sig.c |

[PATCH v2 17/18] image: Eliminate IMAGE_ENABLE_VERIFY_ECDSA macro

2021-05-24 Thread Alexandru Gagniuc
This macro is no longer needed for code flow or #ifdefs. Remove it. Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass --- include/image.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/image.h b/include/image.h index ee930b0265..2f48a6eecf 100644 --- a/include/image.h

[PATCH v2 15/18] lib: rsa: Remove #ifdefs from rsa.h

2021-05-24 Thread Alexandru Gagniuc
It is no longer necessary to implement rsa_() functions as no-ops depending on config options. It is merely sufficient to provide the prototypes, as the rsa code is no longer linked when unused. Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass --- include/u-boot/rsa.h | 47

[PATCH v2 16/18] image: Eliminate IMAGE_ENABLE_VERIFY macro

2021-05-24 Thread Alexandru Gagniuc
This macro is no longer needed for code flow or #ifdefs. Remove it. Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass --- include/image.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/image.h b/include/image.h index f7f8f8a029..ee930b0265 100644 ---

[PATCH v2 14/18] lib: ecdsa: Remove #ifdefs from ecdsa.h

2021-05-24 Thread Alexandru Gagniuc
It is no longer necessary to implement ecdsa_() functions as no-ops depending on config options. It is merely sufficient to provide the prototypes, as the ecdsa code is no longer linked when unused. Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass --- include/u-boot/ecdsa.h | 25

[PATCH v2 13/18] image: image-sig.c: Remove crypto_algos array

2021-05-24 Thread Alexandru Gagniuc
Crytographic algorithms (currently RSA), are stored in linker lists. The crypto_algos array is unused, so remove it, and any logic associated with it. Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass --- common/image-sig.c | 21 - 1 file changed, 21 deletions(-)

[PATCH v2 12/18] image: rsa: Move verification algorithm to a linker list

2021-05-24 Thread Alexandru Gagniuc
Move the RSA verification crytpo_algo structure out of the crypto_algos array, and into a linker list. Although it appears we are adding an #ifdef to rsa-verify.c, the gains outweigh this small inconvenience. This is because rsa_verify() is defined differently based on #ifdefs. This change allows

[PATCH v2 07/18] image: Drop IMAGE_ENABLE_SHAxxx

2021-05-24 Thread Alexandru Gagniuc
From: Simon Glass We already have a host Kconfig for these SHA options. Use CONFIG_IS_ENABLED(SHAxxx) directly in the code shared with the host build, so we can drop the unnecessary indirections. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc Signed-off-by: Alexandru Gagniuc ---

[PATCH v2 10/18] common: image-sig.c: Remove host-specific logic and #ifdefs

2021-05-24 Thread Alexandru Gagniuc
Remove any ifdefs in image-sig.c that were previously used to differentiate from the host code. Note that all code dedicated to relocating ->sign() and ->add_verify_data)_ can be safely removed, as signing is not supported target-side. NOTE that although it appears we are removing ecdsa256

[PATCH v2 11/18] image: Add support for placing crypto_algo in linker lists

2021-05-24 Thread Alexandru Gagniuc
The purpose of this change is to enable crypto algorithms to be placed in linker lists, rather than be declared as a static array. The goal is to remove the crypto_algos array in a subsequent patch. Create a new linker list named "cryptos", and search it when image_get_crypto_algo() is invoked.

[PATCH v2 09/18] common: Move host-only logic in image-sig.c to separate file

2021-05-24 Thread Alexandru Gagniuc
image-sig.c is used to map a hash or crypto algorithm name to a handler of that algorithm. There is some similarity between the host and target variants, with the differences worked out by #ifdefs. The purpose of this change is to remove those ifdefs. First, copy the file to a host-only version,

[PATCH v2 06/18] image: Drop IMAGE_ENABLE_SHA1

2021-05-24 Thread Alexandru Gagniuc
From: Simon Glass We already have a host Kconfig for SHA1. Use CONFIG_IS_ENABLED(SHA1) directly in the code shared with the host build, so we can drop the unnecessary indirection. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc Signed-off-by: Alexandru Gagniuc ---

[PATCH v2 08/18] image: Drop IMAGE_ENABLE_BEST_MATCH

2021-05-24 Thread Alexandru Gagniuc
From: Simon Glass This is not needed with Kconfig, since we can use IS_ENABLED() easily enough. Drop it. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc Signed-off-by: Alexandru Gagniuc --- common/image-fit.c | 2 +- include/image.h| 5 - 2 files changed, 1 insertion(+), 6

[PATCH v2 04/18] Kconfig: Rename SPL_CRC32_SUPPORT to SPL_CRC32

2021-05-24 Thread Alexandru Gagniuc
From: Simon Glass Drop the _SUPPORT suffix so we can use CONFIG_IS_ENABLED() with this option. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc Signed-off-by: Alexandru Gagniuc --- common/spl/Kconfig| 4 ++-- configs/axm_defconfig | 2 +-

[PATCH v2 05/18] Kconfig: Rename SPL_MD5_SUPPORT to SPL_MD5

2021-05-24 Thread Alexandru Gagniuc
From: Simon Glass Drop the _SUPPORT suffix so we can use CONFIG_IS_ENABLED() with this option. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc Signed-off-by: Alexandru Gagniuc --- common/spl/Kconfig | 2 +- include/image.h| 2 +- 2 files changed, 2 insertions(+), 2

[PATCH v2 03/18] image: Rename CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORT

2021-05-24 Thread Alexandru Gagniuc
From: Simon Glass Drop the ENABLE and SUPPORT parts of this, which are redundant. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc Signed-off-by: Alexandru Gagniuc --- common/Kconfig.boot | 2 +- common/image-sig.c | 4 ++-- configs/bcm963158_ram_defconfig

[PATCH v2 02/18] image: Rename SPL_SHAxxx_SUPPORT to SPL_FIT_SHAxxx

2021-05-24 Thread Alexandru Gagniuc
From: Simon Glass These option are named inconsistently with other SPL options, thus making them incompatible with the CONFIG_IS_ENABLED() macro. Rename them. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc Signed-off-by: Alexandru Gagniuc --- common/spl/Kconfig | 8

[PATCH v2 01/18] image: Shorten FIT_ENABLE_SHAxxx_SUPPORT

2021-05-24 Thread Alexandru Gagniuc
From: Simon Glass The ENABLE part of this name is redundant, since all boolean Kconfig options serve to enable something. The SUPPORT part is also redundant since Kconfigs can be assumed to enable support for something. Together they just serve to make these options overly long and inconsistent

[PATCH v2 00/18] image: Reduce #ifdef abuse in image code

2021-05-24 Thread Alexandru Gagniuc
This is a combination of select patches from Simon's series: "image: Reduce #ifdefs and ad-hoc defines in image code" and alternative solutions I proposed in: "image: Reduce the abuse of #ifdefs in image-sig.c" After syncing with Simon, we agree that this is a reasonable base for further

Re: [PATCH 06/18] image: Drop IMAGE_ENABLE_SHA1

2021-05-24 Thread Alex G.
On 5/21/21 2:39 PM, Simon Glass wrote: Hi Alex, On Thu, 20 May 2021 at 18:07, Alex G. wrote: On 5/20/21 6:17 PM, Simon Glass wrote: Hi Alex, On Thu, 20 May 2021 at 17:13, Alex G. wrote: On 5/20/21 12:52 PM, Simon Glass wrote: Hi Alex, On Wed, 19 May 2021 at 20:41, Alex G.

Re: [PATCH u-boot v4 36/36] ARM: enable LTO for some boards

2021-05-24 Thread Tom Rini
On Mon, May 24, 2021 at 09:19:35PM +0200, Marek Behun wrote: > On Mon, 24 May 2021 13:44:38 -0400 > Tom Rini wrote: > > > On Mon, May 24, 2021 at 01:09:19PM -0400, Tom Rini wrote: > > > On Mon, May 24, 2021 at 05:58:55PM +0200, Marek Behun wrote: > > > > On Mon, 24 May 2021 11:40:53 -0400 > >

Re: [PATCH u-boot v4 36/36] ARM: enable LTO for some boards

2021-05-24 Thread Tom Rini
On Mon, May 24, 2021 at 05:58:55PM +0200, Marek Behun wrote: > On Mon, 24 May 2021 11:40:53 -0400 > Tom Rini wrote: > > > On Fri, May 21, 2021 at 12:56:41PM -0400, Tom Rini wrote: > > > On Fri, May 21, 2021 at 06:00:31PM +0200, Marek Behún wrote: > > > > On Fri, 21 May 2021 10:11:47 -0400 > >

[PATCH RFC 2/2] efi_loader: Work-around build issue due to missing hash_calculate()

2021-05-24 Thread Alexandru Gagniuc
The hash_calculate() symbol is provided by hash-checksum.c. It depends on hash_progressive_lookup_algo(), provided when CONFIG_HASH=y. The issue is that hash_calculate() is used by the efi_loader, irregardless of CONFIG_FIT_SIGNATURE. As pointed out in commit 87316da05f2f ("lib: introduce

[PATCH RFC 1/2] Revert "lib: introduce HASH_CALCULATE option"

2021-05-24 Thread Alexandru Gagniuc
When we think of Kconfig, we usually think of features that we like to enable or not. Ideally, we wouldn't use Kconfig to fix a build issue, although sometimes it might make sense. With Kconfig it's hard to guarantee that the fix is universal. We can only say that it works for the set of tested

[PATCH RFC 0/2] lib: Remove the need for a HASH_CALCULATE config

2021-05-24 Thread Alexandru Gagniuc
I had accidentally noticed commit 87316da05f2f ("lib: introduce HASH_CALCULATE option"), when rebasing an unrelated series. It immediately caught my attention because It seemed to me to increase complexity, without any actual benefit. In this series, I present an alternative approach, which

Re: [PATCH u-boot v4 36/36] ARM: enable LTO for some boards

2021-05-24 Thread Marek Behun
On Mon, 24 May 2021 13:44:38 -0400 Tom Rini wrote: > On Mon, May 24, 2021 at 01:09:19PM -0400, Tom Rini wrote: > > On Mon, May 24, 2021 at 05:58:55PM +0200, Marek Behun wrote: > > > On Mon, 24 May 2021 11:40:53 -0400 > > > Tom Rini wrote: > > > > > > > On Fri, May 21, 2021 at 12:56:41PM

Re: [PATCH] test: Fix filesystem tests always being skipped

2021-05-24 Thread Andy Shevchenko
On Thu, May 20, 2021 at 10:09:46PM +0300, Alper Nebi Yasak wrote: > Commit 1ba21bb06b08 ("test: Don't unmount not (yet) mounted system") > fixes an issue in the filesystem tests where the test setup may fail > to mount an image and still attempt to unmount it. However, the commit > unintentionally

[PATCH] stackprot: Make our test a bit more complex

2021-05-24 Thread Tom Rini
With better compiler optimizations available, a compiler may see we do nothing with our buffer after calling memset and omit the call, thus causing us to not smash the stack. Add a comment to explain why we now also have a printf call, so that the test will pass as the memset will not be omitted.

[Contributor call] Request for agenda items

2021-05-24 Thread Simon Glass
Hi, If you plan to join tomorrow and want to add a topic, please do so at [1]. For now the main topic is to talk about VPL, the Verifying Program Loader, a proposed new phase of U-Boot. Regards, Simon [1] https://bit.ly/3bFvwA1 or

[PATCH] clk: clk_versaclock: Add support for versaclock driver

2021-05-24 Thread Adam Ford
The driver is based on the Versaclock driver from the Linux code, but do differences in the clock API between them, some pieces had to change. This driver creates a mux, pfd, pll, and a series of fod ouputs. Rate Usecnt Name -- 2500

Re: [PATCH u-boot v4 36/36] ARM: enable LTO for some boards

2021-05-24 Thread Tom Rini
On Mon, May 24, 2021 at 01:09:19PM -0400, Tom Rini wrote: > On Mon, May 24, 2021 at 05:58:55PM +0200, Marek Behun wrote: > > On Mon, 24 May 2021 11:40:53 -0400 > > Tom Rini wrote: > > > > > On Fri, May 21, 2021 at 12:56:41PM -0400, Tom Rini wrote: > > > > On Fri, May 21, 2021 at 06:00:31PM

[PATCH 5/5] pico-imx6ul: disable video after DM_VIDEO conversion deadline

2021-05-24 Thread Anatolij Gustschin
These boards were not converted to DM_VIDEO before deadline, so disable video support for now. Signed-off-by: Anatolij Gustschin Cc: Richard Hu Cc: Fabio Estevam --- configs/pico-dwarf-imx6ul_defconfig | 4 ++-- configs/pico-hobbit-imx6ul_defconfig | 4 ++-- configs/pico-pi-imx6ul_defconfig

[PATCH 3/5] mx28evk: disable video after DM_VIDEO conversion deadline

2021-05-24 Thread Anatolij Gustschin
The board was not converted to DM_VIDEO before deadline, so disable video support for now. Signed-off-by: Anatolij Gustschin Cc: Fabio Estevam --- configs/mx28evk_auart_console_defconfig | 6 +++--- configs/mx28evk_defconfig | 6 +++--- configs/mx28evk_nand_defconfig | 6

[PATCH 4/5] brxre1: disable video after DM_VIDEO conversion deadline

2021-05-24 Thread Anatolij Gustschin
The board was not converted to DM_VIDEO before deadline, so disable video support for now. Signed-off-by: Anatolij Gustschin Cc: Hannes Schmelzer --- board/BuR/brxre1/board.c | 9 + configs/brxre1_defconfig | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git

[PATCH 2/5] pxm2: disable video after DM_VIDEO conversion deadline

2021-05-24 Thread Anatolij Gustschin
The board was not converted to DM_VIDEO before deadline, so disable video support for now. Signed-off-by: Anatolij Gustschin Cc: Samuel Egli --- configs/pxm2_defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/pxm2_defconfig b/configs/pxm2_defconfig index

[PATCH 1/5] rut: disable video after DM_VIDEO conversion deadline

2021-05-24 Thread Anatolij Gustschin
The board was not converted to DM_VIDEO before deadline, so disable video support for now. Signed-off-by: Anatolij Gustschin Cc: Samuel Egli --- configs/rut_defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/rut_defconfig b/configs/rut_defconfig index

Re: [PATCH u-boot v4 36/36] ARM: enable LTO for some boards

2021-05-24 Thread Tom Rini
On Mon, May 24, 2021 at 05:58:55PM +0200, Marek Behun wrote: > On Mon, 24 May 2021 11:40:53 -0400 > Tom Rini wrote: > > > On Fri, May 21, 2021 at 12:56:41PM -0400, Tom Rini wrote: > > > On Fri, May 21, 2021 at 06:00:31PM +0200, Marek Behún wrote: > > > > On Fri, 21 May 2021 10:11:47 -0400 > >

Re: [PATCH u-boot v4 36/36] ARM: enable LTO for some boards

2021-05-24 Thread Tom Rini
On Mon, May 24, 2021 at 05:58:55PM +0200, Marek Behun wrote: > On Mon, 24 May 2021 11:40:53 -0400 > Tom Rini wrote: > > > On Fri, May 21, 2021 at 12:56:41PM -0400, Tom Rini wrote: > > > On Fri, May 21, 2021 at 06:00:31PM +0200, Marek Behún wrote: > > > > On Fri, 21 May 2021 10:11:47 -0400 > >

Re: [PATCH v5,1/2] driver: watchdog: reset watchdog in designware_wdt_stop() function

2021-05-24 Thread Sean Anderson
On 5/23/21 10:22 PM, meng...@windriver.com wrote: From: MengLi In uboot command line environment, watchdog is not able to be stopped with below commands: SOCFPGA_STRATIX10 # wdt dev watchdog@ffd00200 SOCFPGA_STRATIX10 # wdt stop Refer to watchdog driver in linux kernel, it is also need to

Re: [PATCH u-boot v4 36/36] ARM: enable LTO for some boards

2021-05-24 Thread Marek Behun
On Mon, 24 May 2021 11:40:53 -0400 Tom Rini wrote: > On Fri, May 21, 2021 at 12:56:41PM -0400, Tom Rini wrote: > > On Fri, May 21, 2021 at 06:00:31PM +0200, Marek Behún wrote: > > > On Fri, 21 May 2021 10:11:47 -0400 > > > Tom Rini wrote: > > > > > > > On Thu, May 20, 2021 at 01:56:29PM

[PATCH] pylibfdt: Rework "avoid unused variable warning" lines

2021-05-24 Thread Tom Rini
Clang has -Wself-assign enabled by default under -Wall and so when building with -Werror we would get an error here. Inspired by Linux kernel git commit a21151b9d81a ("tools/build: tweak unused value workaround") make use of the fact that both Clang and GCC support casting to `void` as the method

  1   2   >