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

2021-03-06 Thread Marek Behún
to 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 --- arch/arm/cpu/arm926ejs/spear/spl.c| 2 +- arch/arm/cpu/armv7/ls102xa/ls102x

[PATCH u-boot 12/39] string: make memcpy() and memset() visible to fix LTO linking errors

2021-03-06 Thread Marek Behún
reference to `memcpy' .../uuid.c:206: more undefined references to `memcpy' follow Make memcpy() and memset() visible by using the __used macro to avoid this error. Signed-off-by: Marek Behún --- lib/string.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/string.c b/lib

[PATCH u-boot 11/39] binman: declare symbols externally visible

2021-03-06 Thread Marek Behún
Use the `externally_visible` attribute to declare binman symbols externally visible, so that when building with LTO the compiler does not optimize this data away. Signed-off-by: Marek Behún --- include/binman_sym.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include

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

2021-03-06 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 --- include/linker_lists.h | 8 ++-- 1 file changed, 6

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

2021-03-06 Thread Marek Behún
Indent the linking commands so that they look cosmetically better. Signed-off-by: Marek Behún --- Makefile | 12 +++- scripts/Makefile.spl | 15 +-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 68ce5195b2..7b0ba9df9a

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

2021-03-06 Thread Marek Behún
Add plumbing for building U-Boot with Link Time Optimizations. Signed-off-by: Marek Behún --- Kbuild | 2 ++ Kconfig | 19 +++ Makefile | 36 scripts/Makefile.lib | 3 +++ scripts/Makefile.spl | 14

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

2021-03-06 Thread Marek Behún
to 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 14/39] lib: crc32: make the crc_table variable non-const

2021-03-06 Thread Marek Behún
in order to fix this. Signed-off-by: Marek Behún --- lib/crc32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crc32.c b/lib/crc32.c index e9be3bf386..c033449cff 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -88,7 +88,7 @@ static void __efi_runtime make_crc_table(void

[PATCH u-boot 18/39] build: LTO: move platform libs into --start-group list

2021-03-06 Thread Marek Behún
When building with LTO, move $(PLATFORM_LIBS) into the --start-group / --end-group list. Otherwise some functions declared in assembly may not be resolved and linking may fail. Signed-off-by: Marek Behún --- Makefile | 3 ++- scripts/Makefile.spl | 3 ++- 2 files changed, 4

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

2021-03-06 Thread Marek Behún
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 --- include/errno.h | 8 +++- lib/errno.c | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include

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

2021-03-06 Thread Marek Behún
’ was 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 --- include/efi_loader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/in

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

2021-03-06 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 --- configs/da850evm_defconfig| 1 + configs/da850evm_direct_nor_defconfig | 1 + configs/da850evm_nand_defconfig | 1

[PATCH u-boot 37/39] ARM: don't use -ffunction-sections/-fdata-sections with LTO build

2021-03-06 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-marvell] ddr: marvell: axp: fix array types have different bounds warning

2021-03-06 Thread Marek Behún
here CI managed to trigger this as an error when compiling with LTO for AXP. Fix this by using values from the header files, which seem to be the correct ones. Signed-off-by: Marek Behún --- drivers/ddr/marvell/axp/ddr3_dfs.c | 4 ++-- drivers/ddr/marvell/axp

[PATCH] armv8: SPL: discard relocation information

2021-03-06 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 00/39] U-Boot LTO (Sandbox + Some ARM boards)

2021-03-06 Thread Marek Behún
therefore should not (hopefully) cause regression when applied. Marek Marek Behún (39): ddr: marvell: axp: align signature of mv_xor_mem_init() with a38x ddr: marvell: axp: fix array types have different bounds warning regmap: fix a serious pointer casting bug api: fix a potential serious

[PATCH u-boot-marvell 01/39] ddr: marvell: axp: align signature of mv_xor_mem_init() with a38x

2021-03-06 Thread Marek Behún
-by: Marek Behún Reviewed-by: Stefan Roese --- drivers/ddr/marvell/axp/xor.c | 4 ++-- drivers/ddr/marvell/axp/xor.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ddr/marvell/axp/xor.c b/drivers/ddr/marvell/axp/xor.c index 17bfe6a7bf..76aea96682 100644 --- a/drivers

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

2021-03-06 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 35/39] ata: ahci: fix ahci_link_up() type mismatch for LTO

2021-03-06 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 --- drivers/ata/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/ahci.c b

[PATCH u-boot 32/39] ARM: fix LTO for rockchip and samsung

2021-03-06 Thread Marek Behún
-off-by: Marek Behún --- 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/arch/arm/mach-rockchip

[PATCH u-boot 36/39] ARM: make LTO available

2021-03-06 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 39/39] DO NOT MERGE! ARM: enable LTO by default

2021-03-06 Thread Marek Behún
Build ARM targets with LTO by default. Signed-off-by: Marek Behún --- arch/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/Kconfig b/arch/Kconfig index bf4b8afcb4..d0f5a16b95 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -37,6 +37,7 @@ config ARM select

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

2021-03-06 Thread Marek Behún
Make LTO available for sandbox architecture. Signed-off-by: Marek Behún --- 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/arch/Kconfig @@ -101,6

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

2021-03-06 Thread Marek Behún
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 | 8

[PATCH u-boot 22/39] sandbox: enable LTO by default

2021-03-06 Thread Marek Behún
Build sandbox targets with LTO by default. Signed-off-by: Marek Behún --- 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 SANDBOX select

[PATCH u-boot 26/39] ARM: fix LTO for imx28_xea

2021-03-06 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 --- arch

[PATCH u-boot 25/39] ARM: fix LTO build for some thumb-interwork cases

2021-03-06 Thread Marek Behún
-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/arm/cpu

[PATCH u-boot 23/39] ARM: global_data: make set_gd() work for armv5 and armv6

2021-03-06 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] api: fix a potential serious bug caused by undef CONFIG_SYS_64BIT_LBA

2021-03-06 Thread Marek Behún
blk_dwrite(struct blk_desc *block_dev, lbaint_t st | ^ Signed-off-by: Marek Behún --- 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 def103ce22..5a4465ea89

[PATCH u-boot-marvell 02/39] ddr: marvell: axp: fix array types have different bounds warning

2021-03-06 Thread Marek Behún
here CI managed to trigger this as an error when compiling with LTO for AXP. Fix this by using values from the header files, which seem to be the correct ones. Signed-off-by: Marek Behún --- drivers/ddr/marvell/axp/ddr3_dfs.c | 4 ++-- drivers/ddr/marvell/axp

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

2021-03-06 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 09/39] test/py: improve regular expression for ut subtest symbol matcher

2021-03-06 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 04/39] api: fix a potential serious bug caused by undef CONFIG_SYS_64BIT_LBA

2021-03-06 Thread Marek Behún
blk_dwrite(struct blk_desc *block_dev, lbaint_t st | ^ Signed-off-by: Marek Behún --- 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 def103ce22..5a4465ea89

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

2021-03-06 Thread Marek Behún
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 --- drivers/core/regmap.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers

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

2021-03-06 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 --- include/linker_lists.h | 46

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

2021-03-06 Thread Marek Behún
Use UNIQUE_ID in the __ADDRESSABLE macro. Signed-off-by: Marek Behún --- 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/linux/compiler.h +++ b

[PATCH u-boot 34/39] armv8: SPL: discard relocation information

2021-03-06 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 24/39] ARM: make gd a function call for LTO and set via set_gd()

2021-03-06 Thread Marek Behún
?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 files

[PATCH u-boot 31/39] ARM: fix LTO for seaboard

2021-03-06 Thread Marek Behún
this by 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 27/39] ARM: fix LTO for apf27

2021-03-06 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 30/39] ARM: imx6m: fix imx_eqos_txclk_set_rate() type mismatch for LTO

2021-03-06 Thread Marek Behún
an implementation. Change the type of this function in the implementation to fix this. Signed-off-by: Marek Behún --- 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/imx8m/clock_imx8mm.c

[PATCH u-boot 29/39] ARM: kona: fix clk_bsc_enable() type mismatch for LTO

2021-03-06 Thread Marek Behún
of this function to that of the other usages. Signed-off-by: Marek Behún --- 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 2dfa3f7e73..4eddaca887

[PATCH u-boot 28/39] ARM: fix LTO for keystone

2021-03-06 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 insertion

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

2021-03-07 Thread Marek Behún
into the section .rodata.efi_runtime, instead of .data.efi_runtime. Signed-off-by: Marek Behún --- include/efi_loader.h | 2 ++ lib/crc32.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index a8281b3c95..b1e5d2e13e 100644

[PATCH] arm: fix LTO build for some thumb-interwork cases

2021-03-03 Thread Marek Behún
-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/arm/cpu

[PATCH u-boot] regmap: fix a serious pointer casting bug

2021-03-03 Thread Marek Behún
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 --- drivers/core/regmap.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/core/regmap.c b/drivers/core/regmap.c index b51ce108c1

[PATCH BUGFIX u-boot-marvell] ddr: marvell: axp: align signature of mv_xor_mem_init() with a38x

2021-03-04 Thread Marek Behún
-by: Marek Behún --- drivers/ddr/marvell/axp/xor.c | 4 ++-- drivers/ddr/marvell/axp/xor.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ddr/marvell/axp/xor.c b/drivers/ddr/marvell/axp/xor.c index 17bfe6a7bf..76aea96682 100644 --- a/drivers/ddr/marvell/axp/xor.c

[PATCH u-boot v1.1 14.1/39] efi_loader: add macro for const EFI runtime data

2021-03-07 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/efi_loader.h b/include/efi_loader.h index a8281b3c95..b1e5d2e13e 100644

[PATCH u-boot v1.1 14.2/39] lib: crc32: put the crc_table variable into efi_runtime_rodata section

2021-03-07 Thread Marek Behún
into the section .rodata.efi_runtime, instead of .data.efi_runtime, via macro __efi_runtime_rodata. Signed-off-by: Marek Behún --- 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/lib/crc32.c +++ b/lib

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

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

[PATCH u-boot v1.2 14.3/39] lib: crc32: put the crc_table variable into efi_runtime_rodata section

2021-03-08 Thread Marek Behún
into the 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

[PATCH u-boot v1.2 14.1/39] efi_loader: add Sphinx doc for __efi_runtime and __efi_runtime_data

2021-03-08 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 v1.2 14.2/39] efi_loader: add macro for const EFI runtime data

2021-03-08 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

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

2021-03-08 Thread Marek Behún
On Mon, 8 Mar 2021 19:32:10 +0800 Bin Meng wrote: > On Mon, Mar 8, 2021 at 7:18 PM Marek Behun wrote: > > > > On Mon, 8 Mar 2021 18:44:58 +0800 > > Bin Meng wrote: > > > > > Could you investigate why? > > > > I could, but I don't understand why exactly I should > > - Linux is also using

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

2021-03-08 Thread Marek Behún
On Mon, 8 Mar 2021 22:30:17 +0800 Bin Meng wrote: > Hi Marek, > > On Mon, Mar 8, 2021 at 9:24 PM Marek Behún wrote: > > > > On Mon, 8 Mar 2021 19:32:10 +0800 > > Bin Meng wrote: > > > > > On Mon, Mar 8, 2021 at 7:18 PM Marek Behun > > > w

[PATCH u-boot-marvell v2 19/18] ddr: marvell: a38x: Add more space for additional info from SPD

2021-02-24 Thread Marek Behún
t Baranwal Tested-by: sa_ip-sw-jenkins Reviewed-by: Sujeet Kumar Baranwal Reviewed-by: Nadav Haklai Signed-off-by: Marek Behún --- Stefan, last time I overlooked this commit. I am sending it as part of series 2, since it can be applied on top of it. With the first 18 patches the SPL b

[PATCH u-boot-marvell v2 16/18] ddr: marvell: a38x: enum mv_ddr_twin_die: change order

2021-02-19 Thread Marek Behún
to ensure that NOT_COMBINED has value zero. Signed-off-by: heaterC Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x/ddr_topology_def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ddr/marvell/a38x/ddr_topology_def.h b/drivers/ddr/ma

[PATCH u-boot-marvell v2 18/18] ddr: marvell: a38x: fix comment in conditional macro

2021-02-19 Thread Marek Behún
The code was processed with unifdef utility to omit portions not relevant to A38x and DDR3. This removes usage of many macros, including A70X0, A80X0 and A3900. It seems that the unifdef utility did not remove the macros from #else comment. Signed-off-by: Marek Behún Tested-by: Chris Packham

[PATCH u-boot-marvell v2 17/18] ddr: marvell: a38x: bump version to 14.0.0

2021-02-19 Thread Marek Behún
14.0.0 is newer than 18.12.0. Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x/mv_ddr_build_message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ddr/marvell/a38x/mv_ddr_build_message.c b/drivers/ddr/marvell/a38x

Re: [PATCH u-boot-marvell 00/18] Upgrade A38x DDR3 training to version 14.0.0

2021-02-19 Thread Marek Behún
On Fri, 19 Feb 2021 08:38:48 +0100 Stefan Roese wrote: > Hi Marek, > > On 18.02.21 20:56, Marek Behun wrote: > > Chris put his Tested-by on this series and noone else replyied to > > it. What do you think about this? > > How about the issue of size increase in the SPL? IIRC, then one patch >

[PATCH u-boot-marvell v2 01/18] ddr: marvell: a38x: fix write leveling suplementary algo

2021-02-19 Thread Marek Behún
will fail, since it think that there are no phase to correct Signed-off-by: Moti Buskila Reviewed-by: Kostya Porotchkin Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH u-boot-marvell v2 05/18] ddr: marvell: a38x: import header change from upstream

2021-02-19 Thread Marek Behún
commit 6c705ebc0d70f67ed7cae83ad1978c3305ef25be upstream. The commit mentioned above changes non-DDR3 stuff in upstream, but it also changes header mv_ddr_topology.h. Import this header change to remain consistent with upstream. Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers

[PATCH u-boot-marvell v2 03/18] ddr: marvell: a38x: add ddr32 support

2021-02-19 Thread Marek Behún
Porotchkin Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x/mv_ddr_topology.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/ddr/marvell/a38x/mv_ddr_topology.c b/drivers/ddr/marvell/a38x/mv_ddr_topology.c index 09840b1e70..f2cd7c0ef3

[PATCH u-boot-marvell v2 06/18] ddr: marvell: a38x: fix 32bit

2021-02-19 Thread Marek Behún
From: Moti Buskila commit 0b5adedd4ced9b8f528faad1957d4d69e95759ef upstream. Signed-off-by: Moti Buskila Reviewed-by: Alex Leibovich Reviewed-by: Kostya Porotchkin Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x/mv_ddr_topology.c | 2 +- 1 file changed, 1

[PATCH u-boot-marvell v2 04/18] ddr: marvell: a38x: add ddr 32bit ECC support

2021-02-19 Thread Marek Behún
-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x/mv_ddr_spd.c | 5 + drivers/ddr/marvell/a38x/mv_ddr_spd.h | 1 + drivers/ddr/marvell/a38x/mv_ddr_topology.c | 6 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/ddr/marvell/a38x/mv_ddr_spd.c

[PATCH u-boot-marvell v2 11/18] ddr: marvell: a38x: add support for twin-die combined memory device

2021-02-19 Thread Marek Behún
for all boards, as this was default behaviour prior this change ] Signed-off-by: Marek Behún Tested-by: Chris Packham --- board/CZ.NIC/turris_omnia/turris_omnia.c | 2 ++ board/Marvell/db-88f6820-amc/db-88f6820-amc.c | 1 + board/Marvell/db-88f6820-gp/db-88f6820-gp.c | 1 + board

[PATCH u-boot-marvell v2 13/18] ddr: marvell: a38x: import header change from upstream

2021-02-19 Thread Marek Behún
commit d653b305d0b3da9727c49124683f1a6d95d5c9a5 upstream. The commit mentioned above changes non-DDR3 stuff in upstream, but it also changes header ddr_topology_def.h. Import this header change to remain consistent with upstream. Signed-off-by: Marek Behún Tested-by: Chris Packham

[PATCH u-boot-marvell v2 07/18] ddr: marvell: a38x: fix memory size calculation using 32bit bus width

2021-02-19 Thread Marek Behún
. - memory size with 64 and 32 bit already calculated correctly at mv_ddr_mem_sz_per_cs_get() function Signed-off-by: Moti Buskila Reviewed-by: Stefan Chulski Reviewed-by: Alex Leibovich Reviewed-by: Kostya Porotchkin Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x

[PATCH u-boot-marvell v2 08/18] ddr: marvell: a38x: import header change from upstream

2021-02-19 Thread Marek Behún
commit 3908e20c6c520339e9bddb566823ae5e065d5218 upstream. The commit mentioned above changes non-DDR3 stuff in upstream, but it also changes header ddr_topology_def.h. Import this header change to remain consistent with upstream. Signed-off-by: Marek Behún Tested-by: Chris Packham

[PATCH u-boot-marvell v2 15/18] ddr: marvell: a38x: import code change from upstream

2021-02-19 Thread Marek Behún
commit 2bdd12dd68b1f8e27a03a3443ae49a09a14c18e4 upstream. The commit mentioned above changes non-DDR3 stuff in upstream, but it also changes code in ddr3_training.c. Import this change to remain consistent with upstream. Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr

Re: [PATCH u-boot-marvell 0/5] pci_mvebu changes

2021-02-19 Thread Marek Behún
And also pinging this series, since we had our answer from Thomas Petazzoni :)

[PATCH u-boot-marvell v2 02/18] ddr: marvell: a38x: import header change from upstream

2021-02-19 Thread Marek Behún
commit a165037ec26f301be75e1fabc263643683e85255 upstream. The commit mentioned above changes non-DDR3 stuff in upstream, but it also changes header ddr_topology_def.h. Import this header change to remain consistent with upstream. Signed-off-by: Marek Behún Tested-by: Chris Packham

[PATCH u-boot-marvell v2 00/18] Upgrade A38x DDR3 training to version 14.0.0

2021-02-19 Thread Marek Behún
ames are now in the From headers - added Chris' Tested-by Marek Alex Leibovich (2): ddr: marvell: a38x: add ddr32 support ddr: marvell: a38x: add ddr 32bit ECC support Baruch Siach (1): ddr: marvell: a38x: allow board specific ODT configuration Marek Behún (7): ddr: marvell: a38x: import h

Re: [PATCH u-boot-marvell 1/4] rtc: add armada38x driver

2021-02-19 Thread Marek Behún
Just pinging this series :)

[PATCH u-boot-marvell v2 09/18] ddr: marvell: a38x: allow board specific ODT configuration

2021-02-19 Thread Marek Behún
configuration register value. Signed-off-by: Baruch Siach Reviewed-by: Moti Buskila Reviewed-by: Nadav Haklai Reviewed-by: Kostya Porotchkin Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x/ddr3_init.c| 5 + drivers/ddr/marvell/a38x

[PATCH u-boot-marvell v2 14/18] ddr: marvell: a38x: fix memory cs size function

2021-02-19 Thread Marek Behún
as in MB and then multiply it by 1MB. Signed-off-by: Moti Buskila Reviewed-by: Kostya Porotchkin Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x/mv_ddr_plat.c | 9 +++-- drivers/ddr/marvell/a38x/xor.c | 6 +++--- 2 files changed, 10 insertions(+), 5

[PATCH u-boot-marvell v2 10/18] ddr: marvell: a38x: add 16Gbit memory devices support

2021-02-19 Thread Marek Behún
From: Moti Buskila commit 994509eb4fe6771d92cd06314c37895098ac48fa upstream. Signed-off-by: Moti Buskila Reviewed-by: Kostya Porotchkin Signed-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x/ddr3_training_ip_def.h | 2 ++ drivers/ddr/marvell/a38x/mv_ddr_topology.c

[PATCH u-boot-marvell v2 12/18] ddr: marvell: a38x: disable WL phase correction stage in case of bus_width=16bit

2021-02-19 Thread Marek Behún
-off-by: Marek Behún Tested-by: Chris Packham --- drivers/ddr/marvell/a38x/ddr3_training_db.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/ddr/marvell/a38x/ddr3_training_db.c b/drivers/ddr/marvell/a38x/ddr3_training_db.c index b2f11a8399..6aa7b6069e 100644 --- a/drivers/ddr

Re: [PATCH 4/9] mvebu: ddr: Rename CONFIG_DDR_FIXED_SIZE to CONFIG_SYS_SDRAM_SIZE

2021-08-22 Thread Marek Behún
M_SIZE > and adjust usage to match that CONFIG_SYS_SDRAM_SIZE expects the entire > size rather than MiB. > > Cc: Marek Behún > Cc: Stefan Roese > Signed-off-by: Tom Rini > --- > drivers/ddr/marvell/axp/ddr3_axp.h | 4 ++-- > include/configs/maxbcm.h | 4 +++-

Re: [PATCH v2] arm: mvebu: a37xx: Define CONFIG_SYS_REF_CLK and use it instead of get_ref_clk()

2021-08-17 Thread Marek Behún
> > +#elif defined(CONFIG_ARMADA_3700) > > +/* SAR values for Armada 3700 */ > > +#define MVEBU_TEST_PIN_LATCH_N MVEBU_REGISTER(0x13808) > > +#define MVEBU_XTAL_MODE_MASK BIT(9) > > +#define CONFIG_SYS_REF_CLK ((readl(MVEBU_TEST_PIN_LATCH_N) & > > MVEBU_XTAL_MODE_MASK) ? \ > > +

Re: [PATCH 4/9] mvebu: ddr: Rename CONFIG_DDR_FIXED_SIZE to CONFIG_SYS_SDRAM_SIZE

2021-08-24 Thread Marek Behún
Acked-by: Marek Behún

Re: [PATCH 3/9] mvebu: Migrate CONFIG_DDR_32BIT/64BIT to Kconfig

2021-08-24 Thread Marek Behún
Acked-by: Marek Behún

Re: [PATCH u-boot-marvell 00/29] kwboot higher baudrate

2021-08-26 Thread Marek Behún
On Fri, 27 Aug 2021 13:16:25 +1200 Chris Packham wrote: > On Thu, Aug 26, 2021 at 1:46 AM Marek Behún wrote: > > > > Hello Stefan and others, > > > > this series adds support for booting Marvell platforms via UART (those > > bootable with kwboot) at higher ba

Re: [PATCH u-boot-marvell 28/29] doc/kwboot.1: Update man page

2021-08-27 Thread Marek Behún
On Fri, 27 Aug 2021 10:36:52 +0200 Pali Rohár wrote: > Anyway, it looks like that A385 bootrom has bugs in debug console and so > -d is on this SoC unusable. When I enter into debug mode, boorom > somehow does not send output from (debug) commands over UART. But it > sends ECHO over UART...

Re: [PATCH u-boot-marvell 00/29] kwboot higher baudrate

2021-08-27 Thread Marek Behún
On Fri, 27 Aug 2021 14:45:07 +1200 Chris Packham wrote: > The higher speed settings weren't so good. I started with 3125000 and > that doesn't get onto the 2nd part of the download, same for 1152000 > and 400 (I stopped trying higher speeds at that point). Using > 230400 and 460800 it does

[PATCH u-boot-marvell 00/29] kwboot higher baudrate

2021-08-25 Thread Marek Behún
majority of the binary, though. On Turris Omnia the payload currently makes ~87%.) The series also contains various other fixes, refactors and improvements of the code, upon which the main change is done. Marek & Pali Marek Behún (13): tools: kwbimage: Fix printf format warning tools: kw

[PATCH u-boot-marvell 01/29] tools: kwbimage: Fix printf format warning

2021-08-25 Thread Marek Behún
-off-by: Marek Behún --- tools/kwbimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kwbimage.c b/tools/kwbimage.c index aa865cc443..ed11c835a5 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -544,7 +544,7 @@ static int kwb_export_pubkey(RSA *key, struct

[PATCH u-boot-marvell 03/29] tools: kwboot: Make the quit sequence buffer const

2021-08-25 Thread Marek Behún
This buffer is never written to. Make it const. Signed-off-by: Marek Behún --- tools/kwboot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kwboot.c b/tools/kwboot.c index e6e99849a7..f18f6d2134 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -460,7 +460,7

[PATCH u-boot-marvell 24/29] tools: kwboot: Round up header size to 128 B when patching

2021-08-25 Thread Marek Behún
buffer of enough size instead of mmap()ing it. (If we are going to move the data, most of the pages will be dirty anyway.) Then move the payload if header size needs to be increased. Signed-off-by: Pali Rohár [ refactored ] Signed-off-by: Marek Behún --- tools/kwboot.c | 91

[PATCH u-boot-marvell 27/29] tools: kwboot: Add Pali and Marek as authors

2021-08-25 Thread Marek Behún
From: Pali Rohár Add Pali and Marek as another authors of the kwboot utility. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún --- tools/kwboot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/kwboot.c b/tools/kwboot.c index f60cfd130e..b183e4b35b 100644 --- a/tools/kwboot.c

[PATCH u-boot-marvell 26/29] tools: kwboot: Allow any baudrate on Linux

2021-08-25 Thread Marek Behún
] Signed-off-by: Marek Behún --- tools/kwboot.c| 16 +++- tools/termios_linux.h | 170 ++ 2 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 tools/termios_linux.h diff --git a/tools/kwboot.c b/tools/kwboot.c index dbe59833eb

[PATCH u-boot-marvell 22/29] tools: kwbimage: Refactor image_version()

2021-08-25 Thread Marek Behún
Rename this function to kwbimage_version() and don't cast argument if not needed. Signed-off-by: Marek Behún --- tools/kwbimage.c | 8 tools/kwbimage.h | 4 ++-- tools/kwboot.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/kwbimage.c b/tools

[PATCH u-boot-marvell 29/29] MAINTAINERS: Add entry for kwbimage / kwboot tools

2021-08-25 Thread Marek Behún
Add entry for these tools with Marek, Pali and Stefan as maintainers. Signed-off-by: Marek Behún --- MAINTAINERS | 10 ++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 776ff703b9..d4b21dd660 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -772,6 +772,16

[PATCH u-boot-marvell 11/29] tools: kwboot: Split sending image into header and data stages

2021-08-25 Thread Marek Behún
From: Pali Rohár This change is required to implement other features in kwboot. Split sending header and data parts of the image into two stages. Signed-off-by: Pali Rohár [ refactored ] Signed-off-by: Marek Behún --- tools/kwbimage.h | 8 +++-- tools/kwboot.c | 84

[PATCH u-boot-marvell 16/29] tools: kwboot: Properly finish xmodem transfer

2021-08-25 Thread Marek Behún
From: Pali Rohár After kwboot sends EOT, BootROM sends back ACK. Add code for handling this and retry sending EOT on error. Signed-off-by: Pali Rohár [ refactored ] Signed-off-by: Marek Behún --- tools/kwboot.c | 65 +- 1 file changed, 48

[PATCH u-boot-marvell 07/29] tools: kwboot: Fix return type of kwboot_xm_makeblock() function

2021-08-25 Thread Marek Behún
-by: Marek Behún --- tools/kwboot.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/kwboot.c b/tools/kwboot.c index b9a402ca91..88353d19c0 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -347,7 +347,7 @@ kwboot_debugmsg(int tty, void *msg) return rc

[PATCH u-boot-marvell 02/29] tools: kwboot: Fix buffer overflow in kwboot_terminal()

2021-08-25 Thread Marek Behún
The `in` variable is set to -1 in kwboot_terminal() if stdin is not a tty. In this case we should not look whether -1 is set in fd_set, for it can lead to a buffer overflow, which can be reproduced with echo "xyz" | ./tools/kwboot -t /dev/ttyUSB0 Signed-off-by: Marek Behún --- tool

[PATCH u-boot-marvell 06/29] tools: kwboot: Fix kwboot_xm_sendblock() function when kwboot_tty_recv() fails

2021-08-25 Thread Marek Behún
the now unnecessary break. In other failure cases return immediately. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún --- tools/kwboot.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/kwboot.c b/tools/kwboot.c index 454339db14..b9a402ca91 100644 --- a/tools

[PATCH u-boot-marvell 19/29] tools: kwboot: Don't patch image header if signed

2021-08-25 Thread Marek Behún
From: Pali Rohár It is not possible to modify image with secure header due to cryptographic signature. Signed-off-by: Pali Rohár [ refactored ] Signed-off-by: Marek Behún --- tools/kwboot.c | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/tools

[PATCH u-boot-marvell 14/29] tools: kwboot: Print new line after SPL output

2021-08-25 Thread Marek Behún
There is no separation between output from the code from binary header (U-Boot SPL in most cases) and subsequent kwboot output. Print '\n' to make distinguishing these two easier. Signed-off-by: Marek Behún --- tools/kwboot.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tools

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