[PATCH u-boot-mvebu v4 14/18] gpio: turris_omnia_mcu: Add support for system power off via sysreset

2024-04-04 Thread Marek Behún
device are bound as child devices of the MCU device. Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- configs/turris_omnia_defconfig| 1 + drivers/gpio/Kconfig | 7 - drivers/gpio/Makefile | 1 - drivers/misc/Kconfig

[PATCH u-boot-mvebu v4 15/18] arm: mvebu: turris_omnia: Enable poweroff command via sysreset in defconfig

2024-04-04 Thread Marek Behún
Enable support for the poweroff command via sysreset for Turris Omnia. Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- configs/turris_omnia_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index 9d5171c6a8

[PATCH u-boot-mvebu v4 16/18] cmd: rng: Print "Abort" on -EINTR

2024-04-04 Thread Marek Behún
In the rng command, print Abort instead of Reading RNG failed if the error number is -EINTR, which can happen if the user pressed CTRL-C. Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- cmd/rng.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/rng.c

[PATCH u-boot-mvebu v4 17/18] misc: turris_omnia_mcu: Add support for rng provided by MCU

2024-04-04 Thread Marek Behún
Add support for true random number generator provided by the MCU on Turris Omnia. The MCU firmware supports TRNG if the FEAT_TRNG bit is set in features. In that case we bind the rng driver. Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- configs/turris_omnia_defconfig | 1

[PATCH u-boot-mvebu v4 18/18] arm: mvebu: turris_omnia: Enable rng command in defconfig

2024-04-04 Thread Marek Behún
Now that Turris Omnia has a rng driver provided in the MCU driver, enable the rng command in defconfig. Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- configs/turris_omnia_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/turris_omnia_defconfig b/configs

[PATCH u-boot-mvebu 00/10] Turris Omnia DDR training changes

2024-04-15 Thread Marek Behún
explained in patch 6 - patch 9 glues the old DDR3 training code to current U-Boot - patch 10 allows for dynamic selection of old DDR3 training code on Turris Omnia, via an U-Boot environment variable Marek Marek Behún (10): ddr: marvell: a38x: debug: return from ddr3_tip_print_log() early if we

[PATCH u-boot-mvebu 02/10] ddr: marvell: a38x: debug: Remove unused variables

2024-04-15 Thread Marek Behún
The variables is_default_centralization, is_tune_result and is_bist_reset_bit are never used. Signed-off-by: Marek Behún --- drivers/ddr/marvell/a38x/ddr3_debug.c | 3 --- drivers/ddr/marvell/a38x/ddr3_init.h | 1 - 2 files changed, 4 deletions(-) diff --git a/drivers/ddr/marvell/a38x

[PATCH u-boot-mvebu 01/10] ddr: marvell: a38x: debug: return from ddr3_tip_print_log() early if we won't print anything

2024-04-15 Thread Marek Behún
Return from ddr3_tip_print_log() early if we won't print anything anyway. This way the compiler can optimize away the VALIDATE_IF_ACTIVE() calls in the for-loop, so if the SILENT_LIB macro is defined, no code is generated for the rest of the function, which saves some space. Signed-off-by:

[PATCH u-boot-mvebu 03/10] ddr: marvell: a38x: debug: Define DDR_VIEWER_TOOL variables only if needed, and make them static

2024-04-15 Thread Marek Behún
The variables is_validate_window_per_if, is_validate_window_per_pup, sweep_cnt and is_run_leveling_sweep_tests are only used if DDR_VIEWER_TOOL macro is defined, so define them only in that case. Make them static since they are only used in ddr3_debug.c. Signed-off-by: Marek Behún --- drivers

[PATCH u-boot-mvebu 04/10] ddr: marvell: a38x: debug: Allow compiling with immutable debug settings to reduce binary size

2024-04-15 Thread Marek Behún
Allow compiling with immutable debug settings: - DEBUG_LEVEL is always set to DEBUG_LEVEL_ERROR - register dumps are disabled This can save around 10 KiB of space in the resulting binary, which is a lot in U-Boot SPL. Signed-off-by: Marek Behún --- arch/arm/mach-mvebu/Kconfig | 10

[PATCH u-boot-mvebu 05/10] arm: mvebu: turris_omnia: Enable immutable debug settings in DDR3 training by default

2024-04-15 Thread Marek Behún
Save 10 KiB in Turris Omnia's SPL binary by enabling immutable debug settings for DDR3 training code. Signed-off-by: Marek Behún --- configs/turris_omnia_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig

[PATCH u-boot-mvebu 07/10] ddr: marvell: a38x: old: Fix some compiler warning of the old code

2024-04-15 Thread Marek Behún
Fix some compilation warning in the old DDR training code. Signed-off-by: Marek Behún --- drivers/ddr/marvell/a38x/old/ddr3_a38x.c | 1 + drivers/ddr/marvell/a38x/old/ddr3_init.h | 2 ++ drivers/ddr/marvell/a38x/old/ddr3_training.c | 1 + drivers/ddr

[PATCH u-boot-mvebu 08/10] ddr: marvell: a38x: old: Backport immutable debug settings

2024-04-15 Thread Marek Behún
Backport the option to compile with immutable debug settings also to the old implementation of the DDR3 training code. The original PR for mv-ddr-marvell can be seen at https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/pull/45/ Signed-off-by: Marek Behún --- drivers/ddr/marvell

[PATCH u-boot-mvebu 09/10] arm: mvebu: a38x: Add optional support for using old DDR3 training code

2024-04-15 Thread Marek Behún
to support this need to select the ARMADA_38X_SUPPORT_OLD_DDR3_TRAINING config option and implement the old version of DDR topology provider, ddr3_get_topology_map(). Signed-off-by: Marek Behún --- arch/arm/mach-mvebu/Kconfig | 4 + arch/arm/mach-mvebu/include/mach/cpu.h

[PATCH u-boot-mvebu 10/10] arm: mvebu: turris_omnia: Support old DDR3 training, selectable via env var

2024-04-15 Thread Marek Behún
the environment variable env set omnia_ddr3_training old env save Signed-off-by: Marek Behún --- arch/arm/mach-mvebu/Kconfig | 1 + board/CZ.NIC/turris_omnia/Makefile| 1 + board/CZ.NIC/turris_omnia/old_ddr3_training.c | 79 +++ board/CZ.NIC

Re: [PATCH u-boot-mvebu 00/10] Turris Omnia DDR training changes

2024-04-16 Thread Marek Behún
on such as > 14.0.1. > > All the best, > Tony > > On Mon, Apr 15, 2024 at 9:39 AM Marek Behún wrote: > > > > Hi Stefan, > > > > this series adds some changes to DDR3 training for Armada 38x and > > Turris Omnia. > > > > - patches 1-4 are

Re: [PATCH v2 5/5] common: Convert *.c/h from UTF-8 to ASCII enconfing

2024-04-16 Thread Marek Behún
Acked-by: Marek Behún

[PATCH u-boot-mvebu] arm: mvebu: turris_omnia: Fix ethernet PHY reset gpio FDT fixup

2024-04-30 Thread Marek Behún
use reset-gpios so that we can get rid of these drivers parsing this property. Fixes: 1da53ae26afc ("arm: mvebu: turris_omnia: Add support for design with SW reset signals") Signed-off-by: Marek Behún --- board/CZ.NIC/turris_omnia/turris_omnia.c | 44 ++-

Re: [PATCH v2] rng: Add Turris Mox rWTM RNG driver

2024-02-05 Thread Marek Behún
Hello Max, Out of curiousity, what is your use case for having these random numbers on this platform in U-Boot? Below are a few more things to change and then you I'll give my Reviewed-by tag. On Sun, 21 Jan 2024 21:17:16 +0100 Max Resch wrote: > A RNG driver for Armada 3720 boards running the

Re: [PATCH v2] rng: Add Turris Mox rWTM RNG driver

2024-02-05 Thread Marek Behún
So you're using A3720 with OpenBSD? Can I ask which A3720 boards do you use? Marek On Mon, 05 Feb 2024 14:46:24 +0100 Mark Kettenis wrote: > > Date: Mon, 5 Feb 2024 12:40:14 +0100 > > From: Marek Behún > > > > Hello Max, > > > > Out of curiousit

Re: [PATCH v4] rng: Add Turris Mox rTWM RNG driver

2024-02-13 Thread Marek Behún
On Tue, 13 Feb 2024 10:49:43 +0100 Heinrich Schuchardt wrote: > On 2/13/24 10:16, Stefan Roese wrote: > > Hi Max, > > > > mostly some nitpicking comments below. > > > > On 2/11/24 14:04, Max Resch wrote: > >> A RNG driver for Armada 3720 boards running the Turris Mox rWTM firmware > >> from CZ.

Re: [PATCH v2] net: mv88e6xxx: fix missing SMI address initialization

2024-03-04 Thread Marek Behún
Hi Stefan, On Wed, 14 Feb 2024 08:50:16 +0100 Stefan Roese wrote: > Hi Ramon, > > On 1/9/24 10:37, Stefan Roese wrote: > > On 12/18/23 17:09, Marek Behún wrote: > >> On Wed, 6 Dec 2023 15:35:56 +0100 > >> Marek Mojík wrote: > >> > >>>

[PATCH u-boot-mvebu 0/4] Turris Omnia - New board revision support

2024-03-04 Thread Marek Behún
Marek Behún (4): arm: mvebu: turris_omnia: Refactor MCU status and features reading arm: mvebu: turris_omnia: Implement getting board information from MCU arm: mvebu: turris_omnia: Print board ECDSA public key if available arm: mvebu: turris_omnia: Disable Atmel SHA node if not present board

[PATCH u-boot-mvebu 2/4] arm: mvebu: turris_omnia: Implement getting board information from MCU

2024-03-04 Thread Marek Behún
Implement reading board serial number, first MAC address and board version from MCU. MCU supports board information if the FEAT_BOARD_INFO feature bit is set in MCU features. Prefer getting board information from MCU if supported, fallback to Atmel SHA chip. Signed-off-by: Marek Behún

[PATCH u-boot-mvebu 1/4] arm: mvebu: turris_omnia: Refactor MCU status and features reading

2024-03-04 Thread Marek Behún
Refactor MCU status word and MCU firmware features reading to make it simpler to use. Signed-off-by: Marek Behún --- board/CZ.NIC/turris_omnia/turris_omnia.c | 81 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c

[PATCH u-boot-mvebu 3/4] arm: mvebu: turris_omnia: Print board ECDSA public key if available

2024-03-04 Thread Marek Behún
If MCU supports the FEAT_CRYPTO feature, read board ECDSA public key from MCU and print it. Signed-off-by: Marek Behún --- board/CZ.NIC/turris_omnia/turris_omnia.c | 29 +++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/board/CZ.NIC/turris_omnia

[PATCH u-boot-mvebu 4/4] arm: mvebu: turris_omnia: Disable Atmel SHA node if not present

2024-03-04 Thread Marek Behún
If the FEAT_CRYPTO feature bit is present in MCU features, the board crypto is implemented by MCU and the Atmel SHA chip is not present. Disable Atmel SHA device-tree node in that case. Signed-off-by: Marek Behún --- board/CZ.NIC/turris_omnia/turris_omnia.c | 23 +++ 1 file

[PATCH u-boot-marvell] arm: mvebu: turris_mox: enable wdt command in defconfig

2021-01-13 Thread Marek Behún
Enable wdt command in defconfig for Turris MOX. This is useful when doing debugging. Signed-off-by: Marek Behún --- configs/turris_mox_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index 66dc2473d6..4543acf073 100644

[PATCH u-boot-marvell v2 1/2] arm: mvebu: turris_mox: enable wdt command in defconfig

2021-01-19 Thread Marek Behún
Enable wdt command in defconfig for Turris MOX. This is useful when doing debugging. Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- configs/turris_mox_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index

[PATCH u-boot-marvell v2 2/2] arm: mvebu: turris_mox: enable setexpr command in defconfig

2021-01-19 Thread Marek Behún
Enable setexpr command in defconfig for Turris MOX. We have found that this is sometimes useful in U-Boot scripts and there is enough space in NOR memory on MOX. Signed-off-by: Marek Behún --- configs/turris_mox_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH u-boot-marvell] arm64: dts: armada-3720-espressobin: fix COMPHY nodes

2020-08-19 Thread Marek Behún
ill this is done, we need this patch. Signed-off-by: Marek Behún Tested-by: Pali Rohár Cc: Stefan Roese --- arch/arm/dts/armada-3720-espressobin.dts | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-es

Re: [PATCH 2/2] pcie: pcie_advk: move setting of reference clock to the pcie driver

2020-09-02 Thread Marek Behún
On Wed, 2 Sep 2020 09:11:52 +0200 Andre Heider wrote: > On 31/08/2020 09:52, Pali Rohár wrote: > > On Monday 31 August 2020 05:25:38 Andre Heider wrote: > >> From: Grzegorz Jaszczyk > >> > >> The settings of reference clock is done via pcie address space and > >> not comphy address space - mov

Re: [PATCH] defconfig: espressobin: enable NET_RANDOM_ETHADDR

2020-09-11 Thread Marek Behún
On Wed, 9 Sep 2020 00:38:31 +0200 Pali Rohár wrote: > On Tuesday 08 September 2020 08:52:56 Tom Rini wrote: > > On Tue, Sep 08, 2020 at 10:14:15AM +0200, Andre Heider wrote: > > > On 08/09/2020 09:42, Pali Rohár wrote: > > > > On Tuesday 08 September 2020 08:35:00 Andre Heider wrote: > > >

Re: [PATCH] mmc: xenon_sdhci: Add missing common host capabilities

2020-09-11 Thread Marek Behún
On Fri, 11 Sep 2020 10:37:42 +0200 Andre Heider wrote: > On 11/09/2020 08:43, Stefan Roese wrote: > > Hi Pali, Andre and others, > > > > On 10.09.20 21:04, Pali Rohár wrote: > >> On Thursday 10 September 2020 19:53:40 Andre Heider wrote: > >>> Use mmc_of_parse() to set the common host proper

Re: [PATCH] mmc: xenon_sdhci: Add missing common host capabilities

2020-09-11 Thread Marek Behún
On Fri, 11 Sep 2020 14:21:46 +0200 Stefan Roese wrote: > Thanks. Unfortunately this is taking a bit too long for me, as I > have to leave in about an hour. I will take care of these patches > in a bit over a week. > > Thanks, > Stefan Happy vacation, Stefan :)

Re: [PATCH] mmc: xenon_sdhci: Add missing common host capabilities

2020-09-11 Thread Marek Behún
; - case 4: > - host->host_caps |= MMC_MODE_4BIT; > - break; > - case 1: > - break; > - default: > - printf("Invalid \"bus-width\" value\n"); > - return -EINVAL; > - } > + > + ret = mmc_of_parse(dev, &plat->cfg); > + if (ret) > + return ret; > > host->ops = &xenon_sdhci_ops; > Tested-by: Marek Behún

Re: [PATCH] defconfig: espressobin: enable NET_RANDOM_ETHADDR

2020-09-11 Thread Marek Behún
On Fri, 11 Sep 2020 17:52:26 +0200 Andre Heider wrote: > Hi Marek, > > On 11/09/2020 13:55, Marek Behún wrote: > > On Wed, 9 Sep 2020 00:38:31 +0200 Pali Rohár > > wrote: > >> On Tuesday 08 September 2020 08:52:56 Tom Rini wrote: > >>> Note that

[PATCH u-boot-marvell RESEND] ddr: marvell: a38x: Add more space for additional info from SPD

2021-03-11 Thread Marek Behún
-by: sa_ip-sw-jenkins Reviewed-by: Sujeet Kumar Baranwal Reviewed-by: Nadav Haklai Signed-off-by: Marek Behún Tested-by: Chris Packham --- Stefan, last time I overlooked this commit. This is also part of upstream mv-ddr-marvell. --- drivers/ddr/marvell/a38x/mv_ddr_spd.h | 8 +++- 1 file

[PATCH u-boot v2 03/38] checkpatch: require quotes around section name in the __section() macro

2021-03-12 Thread Marek Behún
This is how Linux does this now, see Linux commit 339f29d91acf. Signed-off-by: Marek Behún --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 755f4802a4..fd1e9c4d24 100755 --- a/scripts/checkpatch.pl

[PATCH u-boot v2 01/38] regmap: fix a serious pointer casting bug

2021-03-12 Thread Marek Behún
ad() also zero out the space so that we don't get invalid result if regmap_raw_read() does not fill the whole object. Signed-off-by: Marek Behún Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Reviewed-by: Bin Meng --- drivers/core/regmap.c | 13 - 1 file changed,

[PATCH u-boot v2 02/38] api: fix a potential serious bug caused by undef CONFIG_SYS_64BIT_LBA

2021-03-12 Thread Marek Behún
blk_dwrite(struct blk_desc *block_dev, lbaint_t st | ^ Signed-off-by: Marek Behún Reviewed-by: Simon Glass --- include/api_public.h | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/include/api_public.h b/include/api_public.h index

[PATCH u-boot v2 10/38] efi_loader: fix warning when linking with LTO

2021-03-12 Thread Marek Behún
previously declared here 7 | char __efi_runtime_start[0] __attribute__((section(".__efi_run | ^ Change the type to char[] in include/efi_loader.h. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- include/efi_loader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 dele

[PATCH u-boot v2 08/38] linker_lists: declare lists and entries as __ADDRESSABLE for LTO

2021-03-12 Thread Marek Behún
Use the __ADDRESSABLE() macro to make entries and lists declared by ll_entry_declare() and ll_entry_declare_list() addressable so that when building with LTO the compiler does not optimize this data away. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- include/linker_lists.h | 8

[PATCH u-boot v2 06/38] linker_lists: prepare macros to avoid code repetition

2021-03-12 Thread Marek Behún
Prepare private macros expanding to linker list entry symbol name and declaration to avoid nasty code repetition in the next patch. We also avoid some code repetition in current code with these macros. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- include/linker_lists.h | 46

[PATCH u-boot v2 05/38] compiler.h: align the __ADDRESSABLE macro with Linux' version

2021-03-12 Thread Marek Behún
Use UNIQUE_ID in the __ADDRESSABLE macro. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- include/linux/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 82a8a4ede9..98dd3fc4cc 100644 --- a/include

[PATCH u-boot v2 07/38] test/py: improve regular expression for ut subtest symbol matcher

2021-03-12 Thread Marek Behún
symbol of the form _u_boot_list_2_X_2_Y also symbol __UNIQUE_ID___addressable__u_boot_list_2_X_2_YN, (where N at the end is some number). In order to avoid matching these additional symbols, ensure that the character before "_u_boot_list_2" is not a symbol name character. Signed-off

[PATCH u-boot v2 00/38] U-Boot LTO (Sandbox + Some ARM boards)

2021-03-12 Thread Marek Behún
, (these are mentioned in GCC man page for option -nodefaultlibs that the compiler may generate; this seems to be a bug in GCC that linking fails with LTO even if these functions are present, because the symbols can be renamed on some targets by optimization) Marek Marek Behún (38): regmap

[PATCH u-boot v2 04/38] treewide: Convert macro and uses of __section(foo) to __section("foo")

2021-03-12 Thread Marek Behún
quoted __section("foo"). Also convert __attribute__((section("foo"))) uses to __section("foo") even if the __attribute__ has multiple list entry forms. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- arch/arm/cpu/arm926ejs/spear/spl.c| 2 +- arch/arm/cp

[PATCH u-boot v2 15/38] Makefile, Makefile.spl: cosmetic change

2021-03-12 Thread Marek Behún
Indent the linking commands so that they look cosmetically better. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- Makefile | 12 +++- scripts/Makefile.spl | 17 +++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile

[PATCH u-boot v2 16/38] build: use thin archives instead of incremental linking

2021-03-12 Thread Marek Behún
use the P flag for ar, otherwise final linking may fail. Signed-off-by: Marek Behún --- Makefile | 4 ++-- arch/sandbox/config.mk | 10 +++--- scripts/Makefile.build | 16 scripts/Makefile.spl | 4 ++-- 4 files changed, 19 insertions(+), 15 deletions

[PATCH u-boot v2 11/38] efi_loader: add Sphinx doc for __efi_runtime and __efi_runtime_data

2021-03-12 Thread Marek Behún
Document the macros __efi_runtime and __efi_runtime_data in Sphinx style. Signed-off-by: Marek Behún --- include/efi_loader.h | 29 ++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index a8281b3c95

[PATCH u-boot v2 12/38] efi_loader: add macro for const EFI runtime data

2021-03-12 Thread Marek Behún
Add macro __efi_runtime_rodata, for const variables with similar purpose as those using __efi_runtime_data. Signed-off-by: Marek Behún --- include/efi_loader.h | 17 + 1 file changed, 17 insertions(+) diff --git a/include/efi_loader.h b/include/efi_loader.h index 696f80e9f3

[PATCH u-boot v2 14/38] lib: crc32: put the crc_table variable into efi_runtime_rodata section

2021-03-12 Thread Marek Behún
section .rodata.efi_runtime, instead of .data.efi_runtime, via macro __efi_runtime_rodata. Signed-off-by: Marek Behún Reviewed-by: Marek Vasut --- lib/crc32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/crc32.c b/lib/crc32.c index e9be3bf386..f2acc107fe 100644 --- a

[PATCH u-boot v2 13/38] efi_selftest: compiler flags for efi_selftest_miniapp_exception.o

2021-03-12 Thread Marek Behún
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 other miniapps. Signed-off-by: Marek Behún Cc: Heinrich Schuchardt

[PATCH u-boot v2 09/38] string: make memcpy(), memset(), memcmp() and memmove() visible for LTO

2021-03-12 Thread Marek Behún
entry points should be supplied through some other mechanism when this option is specified. Make these functions visible by using the __used macro to avoid this error. Signed-off-by: Marek Behún --- lib/string.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib

[PATCH u-boot v2 20/38] sandbox: make LTO available

2021-03-12 Thread Marek Behún
Make LTO available for sandbox architecture. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- arch/Kconfig | 1 + arch/sandbox/config.mk | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index 27843cd79c..a6dab3e56d 100644 --- a/arch/Kconfig +++ b

[PATCH u-boot v2 19/38] sandbox: use sections instead of symbols for getopt array boundaries

2021-03-12 Thread Marek Behún
eason it thinks that array is empty (start and end symbols are at the same address). Signed-off-by: Marek Behún --- arch/sandbox/cpu/os.c | 3 ++- arch/sandbox/cpu/start.c| 3 ++- arch/sandbox/cpu/u-boot-spl.lds | 8 +--- arch/sandbox/cpu/u-boot.lds

[PATCH u-boot v2 22/38] ARM: global_data: make set_gd() work for armv5 and armv6

2021-03-12 Thread Marek Behún
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 --- arch/arm/include/asm/global_data.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/global_data.h b

[PATCH u-boot v2 26/38] ARM: fix LTO for apf27

2021-03-12 Thread Marek Behún
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 --- drivers/mtd/nand/raw/mxc_nand_spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH u-boot v2 24/38] ARM: fix LTO build for some thumb-interwork cases

2021-03-12 Thread Marek Behún
ff-by: Marek Behún --- arch/arm/cpu/arm926ejs/Makefile | 2 ++ arch/arm/lib/Makefile | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/arm/cpu/arm926ejs/Makefile b/arch/arm/cpu/arm926ejs/Makefile index af63d5cc5e..98aafe805a 100644 --- a/arch/arm/cpu/arm926ejs/Makefile +++ b/arch/ar

[PATCH u-boot v2 25/38] ARM: fix LTO for imx28_xea

2021-03-12 Thread Marek Behún
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 extern uint32_t _start; Fix this. Signed-off-by: Marek Behún Reviewed-by

[PATCH u-boot v2 27/38] ARM: fix LTO for keystone

2021-03-12 Thread Marek Behún
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 --- arch/arm/mach-keystone/Makefile | 1 + 1 file changed, 1 inse

[PATCH u-boot v2 23/38] ARM: make gd a function call for LTO and set via set_gd()

2021-03-12 Thread Marek Behún
g.cgi?id=68384 Signed-off-by: Marek Behún --- arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 2 +- arch/arm/include/asm/global_data.h| 2 +- arch/arm/mach-exynos/spl_boot.c | 2 +- arch/arm/mach-imx/imx8m/soc.c | 2 +- arch/arm/mach-imx/spl_imx_romapi.c| 16 5

[PATCH u-boot v2 29/38] ARM: imx8m: fix imx_eqos_txclk_set_rate() type mismatch for LTO

2021-03-12 Thread Marek Behún
implementation. Change the type of this function in the implementation to fix this. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- arch/arm/mach-imx/imx8m/clock_imx8mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c b/arch/arm/mach-imx

[PATCH u-boot v2 30/38] ARM: fix LTO for seaboard

2021-03-12 Thread Marek Behún
removing -flto for this file. Signed-off-by: Marek Behún --- arch/arm/mach-tegra/tegra20/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-tegra/tegra20/Makefile b/arch/arm/mach-tegra/tegra20/Makefile index faaf30d068..bb17c90cca 100644 --- a/arch/arm/mach-tegra/tegra20

[PATCH u-boot v2 17/38] build: support building with Link Time Optimizations

2021-03-12 Thread Marek Behún
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 resolved and linking may fail. Signed-off-by: Marek Behún --- Kbuild

[PATCH u-boot v2 31/38] ARM: fix LTO for rockchip and samsung

2021-03-12 Thread Marek Behún
-off-by: Marek Behún Reviewed-by: Bin Meng --- arch/arm/mach-rockchip/board.c| 2 +- board/samsung/common/exynos5-dt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index c386b52987..5304eb055c 100644 --- a

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

2021-03-12 Thread Marek Behún
When building with LTO, using -ffunction-sections/-fdata-sections is not useful anymore. Signed-off-by: Marek Behún --- arch/arm/config.mk | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 4153f7e371..2b2c6ad2e5 100644

[PATCH u-boot v2 34/38] ata: ahci: fix ahci_link_up() type mismatch for LTO

2021-03-12 Thread Marek Behún
actually passes an int variable into the function (so it is implicitly converted to u8). Change the type of this parameter to int in drivers/ata/ahci.c. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- drivers/ata/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH u-boot v2 37/38] ARM: don't use --gc-sections with LTO when using private libgcc

2021-03-12 Thread Marek Behún
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. Signed-off-by: Marek Behún --- arch/arm/config.mk | 2

[PATCH u-boot v2 35/38] ARM: make LTO available

2021-03-12 Thread Marek Behún
Make LTO available for ARM architecture. Signed-off-by: Marek Behún --- arch/Kconfig | 1 + arch/arm/lib/Makefile | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index b884b7b248..bf4b8afcb4 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -33,6 +33,7

[PATCH u-boot v2 38/38] ARM: enable LTO for some boards

2021-03-12 Thread Marek Behún
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 --- configs/am3517_evm_defconfig | 1 + configs/da850evm_defconfig| 1 + configs

[PATCH u-boot v2 21/38] sandbox: enable LTO by default

2021-03-12 Thread Marek Behún
Build sandbox targets with LTO by default. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- arch/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/Kconfig b/arch/Kconfig index a6dab3e56d..b884b7b248 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -123,6 +123,7 @@ config

[PATCH u-boot v2 18/38] sandbox: errno: avoid conflict with libc's errno

2021-03-12 Thread Marek Behún
ference in /tmp/u-boot.EQlEXz.ltrans0.ltrans.o To avoid this conflict use different asm label for this variable when CONFIG_SANDBOX is enabled. Signed-off-by: Marek Behún Reviewed-by: Bin Meng Reviewed-by: Simon Glass --- include/errno.h | 8 +++- lib/errno.c | 4 +++- 2 files c

[PATCH u-boot v2 32/38] ARM: omap3: fix LTO for DM3730 (and possibly other omap3 boards)

2021-03-12 Thread Marek Behún
Adam Ford says that DM3730 needs board.c compiled without LTO flags. Also add clock.c, since it says in Makefile that it need different flags. Signed-off-by: Marek Behún Suggested-by: Adam Ford --- arch/arm/mach-omap2/omap3/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch

[PATCH u-boot v2 28/38] ARM: kona: fix clk_bsc_enable() type mismatch for LTO

2021-03-12 Thread Marek Behún
function to that of the other usages. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- arch/arm/cpu/armv7/kona-common/clk-stubs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7/kona-common/clk-stubs.c b/arch/arm/cpu/armv7/kona-common/clk-stubs.c index

[PATCH u-boot v2 33/38] armv8: SPL: discard relocation information

2021-03-12 Thread Marek Behún
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 Behún --- arch/arm/cpu/armv8/u-boot-spl.lds | 1 + 1 file changed, 1 insertion

[PATCH u-boot v2.1 38/38] ARM: enable LTO for some boards

2021-03-12 Thread Marek Behún
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 --- configs/am3517_evm_defconfig | 1 + configs/da850evm_defconfig| 1 + configs

[PATCH u-boot v3 01/39] regmap: fix a serious pointer casting bug

2021-03-16 Thread Marek Behún
ad() also zero out the space so that we don't get invalid result if regmap_raw_read() does not fill the whole object. Signed-off-by: Marek Behún Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher Reviewed-by: Bin Meng --- drivers/core/regmap.c | 13 - 1 file changed,

[PATCH u-boot v3 00/39] U-Boot LTO (Sandbox + Some ARM boards)

2021-03-16 Thread Marek Behún
with LTO even if these functions are present, because the symbols can be renamed on some targets by optimization) Marek Marek Behún (39): regmap: fix a serious pointer casting bug api: fix a potential serious bug caused by undef CONFIG_SYS_64BIT_LBA checkpatch: require quotes around section

[PATCH u-boot v3 03/39] checkpatch: require quotes around section name in the __section() macro

2021-03-16 Thread Marek Behún
This is how Linux does this now, see Linux commit 339f29d91acf. Signed-off-by: Marek Behún --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 755f4802a4..fd1e9c4d24 100755 --- a/scripts/checkpatch.pl

[PATCH u-boot v3 06/39] linker_lists: prepare macros to avoid code repetition

2021-03-16 Thread Marek Behún
Prepare private macros expanding to linker list entry symbol name and declaration to avoid nasty code repetition in the next patch. We also avoid some code repetition in current code with these macros. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- include/linker_lists.h | 46

[PATCH u-boot v3 05/39] compiler.h: align the __ADDRESSABLE macro with Linux' version

2021-03-16 Thread Marek Behún
Use UNIQUE_ID in the __ADDRESSABLE macro. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- include/linux/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 82a8a4ede9..98dd3fc4cc 100644 --- a/include

[PATCH u-boot v3 02/39] api: fix a potential serious bug caused by undef CONFIG_SYS_64BIT_LBA

2021-03-16 Thread Marek Behún
blk_dwrite(struct blk_desc *block_dev, lbaint_t st | ^ Signed-off-by: Marek Behún Reviewed-by: Simon Glass --- include/api_public.h | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/include/api_public.h b/include/api_public.h index

[PATCH u-boot v3 07/39] test/py: improve regular expression for ut subtest symbol matcher

2021-03-16 Thread Marek Behún
symbol of the form _u_boot_list_2_X_2_Y also symbol __UNIQUE_ID___addressable__u_boot_list_2_X_2_YN, (where N at the end is some number). In order to avoid matching these additional symbols, ensure that the character before "_u_boot_list_2" is not a symbol name character. Signed-off

[PATCH u-boot v3 04/39] treewide: Convert macro and uses of __section(foo) to __section("foo")

2021-03-16 Thread Marek Behún
quoted __section("foo"). Also convert __attribute__((section("foo"))) uses to __section("foo") even if the __attribute__ has multiple list entry forms. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- arch/arm/cpu/arm926ejs/spear/spl.c| 2 +- arch/arm/cp

[PATCH u-boot v3 09/39] string: make memcpy(), memset(), memcmp() and memmove() visible for LTO

2021-03-16 Thread Marek Behún
entry points should be supplied through some other mechanism when this option is specified. Make these functions visible by using the __used macro to avoid this error. Signed-off-by: Marek Behún --- lib/string.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib

[PATCH u-boot v3 08/39] linker_lists: declare lists and entries as __ADDRESSABLE for LTO

2021-03-16 Thread Marek Behún
Use the __ADDRESSABLE() macro to make entries and lists declared by ll_entry_declare() and ll_entry_declare_list() addressable so that when building with LTO the compiler does not optimize this data away. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- include/linker_lists.h | 8

[PATCH u-boot v3 10/39] efi_loader: fix warning when linking with LTO

2021-03-16 Thread Marek Behún
previously declared here 7 | char __efi_runtime_start[0] __attribute__((section(".__efi_run | ^ Change the type to char[] in include/efi_loader.h. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- include/efi_loader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 dele

[PATCH u-boot v3 11/39] efi_loader: add Sphinx doc for __efi_runtime and __efi_runtime_data

2021-03-16 Thread Marek Behún
Document the macros __efi_runtime and __efi_runtime_data in Sphinx style. Signed-off-by: Marek Behún Reviewed-by: Heinrich Schuchardt --- include/efi_loader.h | 29 ++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/include/efi_loader.h b/include

[PATCH u-boot v3 15/39] Makefile, Makefile.spl: cosmetic change

2021-03-16 Thread Marek Behún
Indent the linking commands so that they look cosmetically better. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- Makefile | 12 +++- scripts/Makefile.spl | 17 +++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile

[PATCH u-boot v3 14/39] lib: crc32: put the crc_table variable into efi_runtime_rodata section

2021-03-16 Thread Marek Behún
section .rodata.efi_runtime, instead of .data.efi_runtime, via macro __efi_runtime_rodata. Signed-off-by: Marek Behún Reviewed-by: Marek Vasut Reviewed-by: Heinrich Schuchardt --- lib/crc32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/crc32.c b/lib/crc32.c index

[PATCH u-boot v3 12/39] efi_loader: add macro for const EFI runtime data

2021-03-16 Thread Marek Behún
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 --- include/efi_loader.h | 17 + 1 file changed, 17 insertions(+) diff --git a/include/efi_loader.h b/include

[PATCH u-boot v3 13/39] efi_selftest: compiler flags for efi_selftest_miniapp_exception.o

2021-03-16 Thread Marek Behún
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 other miniapps. Signed-off-by: Marek Behún Reviewed-by: Heinrich

[PATCH u-boot v3 19/39] sandbox: errno: avoid conflict with libc's errno

2021-03-16 Thread Marek Behún
ference in /tmp/u-boot.EQlEXz.ltrans0.ltrans.o To avoid this conflict use different asm label for this variable when CONFIG_SANDBOX is enabled. Signed-off-by: Marek Behún Reviewed-by: Bin Meng Reviewed-by: Simon Glass --- include/errno.h | 8 +++- lib/errno.c | 4 +++- 2 files c

[PATCH u-boot v3 18/39] build: link with --build-id=none

2021-03-16 Thread Marek Behún
andle .note.gnu.build-id section. Fix this by explicitly disabling build-id. Signed-off-by: Marek Behún --- Makefile | 2 ++ scripts/Makefile.spl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 952c165d8f..d806155ede 100644 --- a/Makefile +++ b/Mak

[PATCH u-boot v3 16/39] build: use thin archives instead of incremental linking

2021-03-16 Thread Marek Behún
use the P flag for ar, otherwise final linking may fail. Signed-off-by: Marek Behún --- Makefile | 4 ++-- arch/sandbox/config.mk | 10 +++--- scripts/Makefile.build | 16 scripts/Makefile.spl | 4 ++-- 4 files changed, 19 insertions(+), 15 deletions

[PATCH u-boot v3 21/39] sandbox: make LTO available

2021-03-16 Thread Marek Behún
Make LTO available for sandbox architecture. Signed-off-by: Marek Behún Reviewed-by: Bin Meng --- arch/Kconfig | 1 + arch/sandbox/config.mk | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index 27843cd79c..a6dab3e56d 100644 --- a/arch/Kconfig +++ b

[PATCH u-boot v3 20/39] sandbox: use sections instead of symbols for getopt array boundaries

2021-03-16 Thread Marek Behún
eason it thinks that array is empty (start and end symbols are at the same address). Signed-off-by: Marek Behún --- arch/sandbox/cpu/os.c | 3 ++- arch/sandbox/cpu/start.c| 3 ++- arch/sandbox/cpu/u-boot-spl.lds | 8 +--- arch/sandbox/cpu/u-boot.lds

[PATCH u-boot v3 17/39] build: support building with Link Time Optimizations

2021-03-16 Thread Marek Behún
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 resolved and linking may fail. Signed-off-by: Marek Behún --- Kbuild

<    1   2   3   4   5   6   7   8   9   10   >