Re: [PATCH v2 00/15] Various toolchain compatibility fixes/improvements

2025-03-16 Thread Sam Edwards
On Sat, Mar 15, 2025 at 10:27 PM Heinrich Schuchardt wrote: > > Am 15. März 2025 23:17:58 MEZ schrieb Sam Edwards : > >Hello again U-Boot list, > > > >This is v2 of my "misc. fixes" series, sent to prepare the codebase for more > >direct LLVM support

[PATCH v2 14/15] spl: riscv: opensbi: Error on misaligned FDT

2025-03-15 Thread Sam Edwards
: Sam Edwards --- common/spl/spl_opensbi.c | 5 + 1 file changed, 5 insertions(+) diff --git a/common/spl/spl_opensbi.c b/common/spl/spl_opensbi.c index 5a26d7c31a4..0ed6afeacc6 100644 --- a/common/spl/spl_opensbi.c +++ b/common/spl/spl_opensbi.c @@ -57,6 +57,11 @@ void __noreturn

[PATCH v2 13/15] scripts/Makefile.lib: efi: Preserve the .dynstr section as well

2025-03-15 Thread Sam Edwards
This section is required by .dynamic and llvm-objcopy will exit with a fatal error if it is not also preserved in the output. Signed-off-by: Sam Edwards --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib

[PATCH v2 15/15] spl: Align FDT load address

2025-03-15 Thread Sam Edwards
the alignment when loading the FDT. Signed-off-by: Sam Edwards --- common/spl/spl_fit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 49b4df60560..86506d6905c 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c

[PATCH v2 12/15] efi_loader: Move .dynamic out of .text in EFI

2025-03-15 Thread Sam Edwards
LLVM's lld considers this a fatal linking error. This patch moves .dynamic out to its own section, so that the output ELF has the correct types. (They're all mashed together when converting to binary anyway, so this patch causes no change in the final .efi output.) Signed-off-by: Sam E

[PATCH v2 11/15] arm: riscv: efi: Export _start symbol from crt0_*_efi stubs

2025-03-15 Thread Sam Edwards
F may appreciate having correct entry-point information, this patch instead promotes the _start labels to global symbols, silencing the linker warning and making the intermediary ELF reflect the true entry point. This patch doesn't affect the final output binaries in any way. Signed-off-by: S

[PATCH v2 10/15] makefile: Add READELF command variable

2025-03-15 Thread Sam Edwards
This allows setting READELF=llvm-readelf in order to use the LLVM version of the readelf utility. It also aligns with the practice of not using $(CROSS_COMPILE) in any build recipes directly, reducing the number of places where $(CROSS_COMPILE) is used. Signed-off-by: Sam Edwards Reviewed-by

[PATCH v2 09/15] makefile: Add `norelro` linker option

2025-03-15 Thread Sam Edwards
. Signed-off-by: Sam Edwards Reviewed-by: Ilias Apalodimas --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 9c353af17cd..05a93813afa 100644 --- a/Makefile +++ b/Makefile @@ -820,6 +820,7 @@ KBUILD_AFLAGS += $(KAFLAGS) KBUILD_CFLAGS += $(KCFLAGS

[PATCH v2 08/15] makefile: Avoid objcopy --gap-fill for .hex/.srec

2025-03-15 Thread Sam Edwards
objcopy command template in the Makefile that doesn't use --gap-fill, which is provided for EFI. So use this other version for all .hex/.srec outputs as well. Signed-off-by: Sam Edwards --- Makefile | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile

[PATCH v2 07/15] x86: Fix call64's section flags

2025-03-15 Thread Sam Edwards
ction directive for .text_call64 should really have the correct flags either way. Add `"ax"` to mark the section as ALLOC ("supposed to be loaded") and CODE ("supposed to be executed"). Fixes: 7dc82591d68e2a ("x86: Move call64 into its own section") Signed-off-by:

[PATCH v2 06/15] arm: Replace 'adrl' in EFI crt0

2025-03-15 Thread Sam Edwards
evaluate to the same result: PC's offset relative to image_base. The subtract instructions then remove one byte each (low, then high) of the total offset, thereby getting the absolute address of image_base loaded in r0. Signed-off-by: Sam Edwards --- arch/arm/lib/crt0_arm_efi.S | 3 ++- 1 file c

[PATCH v2 05/15] arm: Discard unwanted sections in linker script

2025-03-15 Thread Sam Edwards
't be included in the output. Switch to this instead, to make the intention clearer and reduce the ELF sections that have to be handled later in the build. This is also consistent with the other architectures' linker scripts. Signed-off-by: Sam Edwards --- arch/arm/cpu/

[PATCH v2 04/15] arm: Add aligned-memory aliases to eabi_compat

2025-03-15 Thread Sam Edwards
These are sometimes used by LLVM's code-generator, when it can guarantee that the memory buffer being passed is aligned on a (4- or 8-byte) boundary. They can safely be aliased to the unaligned versions. Signed-off-by: Sam Edwards Reviewed-by: Ilias Apalodimas --- arch/arm/lib/eabi_com

[PATCH v2 03/15] arm: Add __aeabi_memclr in eabi_compat

2025-03-15 Thread Sam Edwards
LLVM's code generator will sometimes emit calls to __aeabi_memclr. Add an implementation of this for LLVM compatibility. Signed-off-by: Sam Edwards Reviewed-by: Ilias Apalodimas --- arch/arm/lib/eabi_compat.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/lib/eabi_compa

[PATCH v2 02/15] arm: Exclude eabi_compat from LTO

2025-03-15 Thread Sam Edwards
These symbols need to survive the IR-level dead function elimination pass, since nothing at the IR level is referencing them (calls to these are inserted later, at codegen time). Signed-off-by: Sam Edwards Acked-by: Ilias Apalodimas --- arch/arm/lib/Makefile | 1 + 1 file changed, 1 insertion

[PATCH v2 01/15] arm: Remove stray .mmutable reference in linker script

2025-03-15 Thread Sam Edwards
rm: pxa: Remove CONFIG_CPU_PXA25X") Signed-off-by: Sam Edwards Reviewed-by: Ilias Apalodimas --- arch/arm/cpu/u-boot.lds | 9 - 1 file changed, 9 deletions(-) diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 2f50087f57a..63e82a09fad 100644 --- a/arch/arm/cpu/u-boot.lds

[PATCH v2 00/15] Various toolchain compatibility fixes/improvements

2025-03-15 Thread Sam Edwards
o patches (one was incorrect, the other can be fixed differently) - Minor phrasing changes to commit messages - Instead of removing `ENTRY(_start)`, I instead added `.globl _start` where appropriate, in the EFI apps Sam Edwards (15): arm: Remove stray .mmutable reference in linker script arm: E

Re: [PATCH 00/17] Various toolchain compatibility fixes/improvements

2025-03-07 Thread Sam Edwards
On Thu, Mar 6, 2025 at 7:47 AM Tom Rini wrote: > > On Wed, Mar 05, 2025 at 07:46:56PM -0800, Sam Edwards wrote: > > On Sun, Feb 23, 2025 at 9:55 PM Sam Edwards wrote: > > > > > > Long time no see, U-Boot folks! > > > > > > This patchset consists o

Re: [PATCH 00/17] Various toolchain compatibility fixes/improvements

2025-03-05 Thread Sam Edwards
On Sun, Feb 23, 2025 at 9:55 PM Sam Edwards wrote: > > Long time no see, U-Boot folks! > > This patchset consists of various bug fixes and correctness improvements that > I discovered while attempting to add first-class LLVM support to the build > system. These patches are N

Re: [PATCH 16/17] efi_loader: Move .dynamic out of .text in EFI

2025-03-03 Thread Sam Edwards
On Sun, Feb 23, 2025 at 11:34 PM Heinrich Schuchardt wrote: > > > > Sam Edwards schrieb am Mo., 24. Feb. 2025, 06:56: >> >> This was not proper: A .text section is SHT_PROGBITS, while the .dynamic >> section is SHT_DYNAMIC. Attempting to combine them like this crea

Re: [PATCH 10/17] spl: Align FDT load address

2025-02-24 Thread Sam Edwards
On Mon, Feb 24, 2025 at 8:03 AM Tom Rini wrote: > > On Mon, Feb 24, 2025 at 04:54:09PM +0100, Heinrich Schuchardt wrote: > > On 24.02.25 15:56, Tom Rini wrote: > > > On Mon, Feb 24, 2025 at 09:59:42AM +0100, Heinrich Schuchardt wrote: > > > > On 2/24/25 06:55, S

Re: [PATCH 09/17] spl: riscv: opensbi: Error on misaligned FDT

2025-02-24 Thread Sam Edwards
On Mon, Feb 24, 2025 at 6:54 AM Tom Rini wrote: > > On Mon, Feb 24, 2025 at 09:54:56AM +0100, Heinrich Schuchardt wrote: > > On 2/24/25 06:55, Sam Edwards wrote: > > > libfdt 1.6.1+ requires the FDT to be 8-byte aligned and returns an error > > > if not. OpenSBI

Re: [PATCH 07/17] arm: Replace 'adrl' in EFI crt0

2025-02-24 Thread Sam Edwards
On Mon, Feb 24, 2025 at 12:42 AM Heinrich Schuchardt wrote: > > On 2/24/25 06:55, Sam Edwards wrote: > > LLVM's IAS does not (and cannot easily) support the 'adrl' > > pseudoinstruction, and ARM developers generally do not consider it > > portable

Re: [PATCH 15/17] efi_loader: Remove ENTRY(_start) from linker script

2025-02-24 Thread Sam Edwards
On Mon, Feb 24, 2025 at 1:37 AM Heinrich Schuchardt wrote: > > On 2/24/25 06:55, Sam Edwards wrote: > > The EFI apps are built using ELF only as an intermediate "linker output" > > format, with the final PE header crafted within the ELF to take effect > > a

[PATCH 17/17] scripts/Makefile.lib: efi: Preserve the .dynstr section as well

2025-02-23 Thread Sam Edwards
This section is required by .dynamic and llvm-objcopy will exit with a fatal error if it is not also preserved in the output. Signed-off-by: Sam Edwards --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib

[PATCH 16/17] efi_loader: Move .dynamic out of .text in EFI

2025-02-23 Thread Sam Edwards
This was not proper: A .text section is SHT_PROGBITS, while the .dynamic section is SHT_DYNAMIC. Attempting to combine them like this creates a section type mismatch. It seems that while GNU ld does not complain, LLVM's lld considers this an error. Signed-off-by: Sam Edwards Cc: Hei

[PATCH 15/17] efi_loader: Remove ENTRY(_start) from linker script

2025-02-23 Thread Sam Edwards
thing that uses this linker script even defines a _start symbol, this directive has no effect. On GNU ld, it is silently ignored. On certain linkers (e.g. LLVM lld), a warning is logged. But in any case, no entry point is set. Therefore, remove it to silence warnings and avoid confusion. Signed-off-

[PATCH 14/17] makefile: Add READELF command variable

2025-02-23 Thread Sam Edwards
This allows setting READELF=llvm-readelf in order to use the LLVM version of the readelf utility. It also aligns with the practice of not using $(CROSS_COMPILE) in any build recipes directly, reducing the number of places where $(CROSS_COMPILE) is used. Signed-off-by: Sam Edwards --- Makefile

[PATCH 13/17] makefile: Add `norelro` linker option

2025-02-23 Thread Sam Edwards
requirement (e.g. x86_64 linker script currently puts .dynamic too far from .got) nor preserves the RELRO when converting away from ELF, therefore add `-z norelro` to global linker options. Signed-off-by: Sam Edwards --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b

[PATCH 10/17] spl: Align FDT load address

2025-02-23 Thread Sam Edwards
the alignment when loading the FDT. Signed-off-by: Sam Edwards --- common/spl/spl_fit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 49b4df60560..86506d6905c 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c

[PATCH 12/17] makefile: Avoid objcopy --gap-fill for .hex/.srec

2025-02-23 Thread Sam Edwards
objcopy command template in the Makefile that doesn't use --gap-fill, which is provided for EFI. So use this other version for all .hex/.srec outputs as well. Signed-off-by: Sam Edwards --- Makefile | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile

[PATCH 11/17] makefile: Fix symbol typo in binary_size_check

2025-02-23 Thread Sam Edwards
The start-of-image marker symbol is `__image_copy_start`; by searching for `_image_copy_start` instead, this check can accidentally match `_image_copy_start_ofs`. Signed-off-by: Sam Edwards --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile

[PATCH 09/17] spl: riscv: opensbi: Error on misaligned FDT

2025-02-23 Thread Sam Edwards
can be very difficult to diagnose without proper debugging facilities. Therefore, give the U-Boot SPL, which *can* print error messages, an additional check for proper FDT alignment. Signed-off-by: Sam Edwards --- common/spl/spl_opensbi.c | 5 + 1 file changed, 5 insertions(+) diff --git a

[PATCH 08/17] x86: Fix call64's section flags

2025-02-23 Thread Sam Edwards
ction directive for .text_call64 should really have the correct flags either way. Add `"ax"` to mark the section as ALLOC ("supposed to be loaded") and CODE ("supposed to be executed"). Fixes: 7dc82591d68e2a ("x86: Move call64 into its own section") Signed-off-by:

[PATCH 07/17] arm: Replace 'adrl' in EFI crt0

2025-02-23 Thread Sam Edwards
evaluate to the same result: PC's offset relative to image_base. The subtract instructions then remove one byte each (low, then high) of the total offset, thereby getting the absolute address of image_base loaded in r0. Signed-off-by: Sam Edwards --- arch/arm/lib/crt0_arm_efi.S | 3 ++- 1 file c

[PATCH 03/17] arm: Add __aeabi_memclr in eabi_compat

2025-02-23 Thread Sam Edwards
LLVM's code generator will sometimes emit calls to __aeabi_memclr. Add an implementation of this for LLVM compatibility. Signed-off-by: Sam Edwards --- arch/arm/lib/eabi_compat.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/lib/eabi_compat.c b/arch/arm/lib/eabi_com

[PATCH 06/17] arm: Use -mstrict-align when the MMU is off

2025-02-23 Thread Sam Edwards
MMU is disabled. Therefore, add the `-mstrict-align` compiler flag when SYS_ARM_MMU is not set. Signed-off-by: Sam Edwards --- arch/arm/config.mk | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index e0045e22271..98237b251f1 100644 --- a/arch/arm

[PATCH 05/17] arm: Discard unwanted sections in linker script

2025-02-23 Thread Sam Edwards
't be included in the output. Switch to this instead, to make the intention clearer and reduce the ELF sections that have to be handled later in the build. This is also consistent with the other architectures' linker scripts. Signed-off-by: Sam Edwards --- arch/arm/cpu/

[PATCH 04/17] arm: Add aligned-memory aliases to eabi_compat

2025-02-23 Thread Sam Edwards
These are sometimes used by LLVM's code-generator, when it can guarantee that the memory buffer being passed is aligned on a (4- or 8-byte) boundary. They can safely be aliased to the unaligned versions. Signed-off-by: Sam Edwards --- arch/arm/lib/eabi_compat.c | 12 1 file ch

[PATCH 02/17] arm: Exclude eabi_compat from LTO

2025-02-23 Thread Sam Edwards
These symbols need to survive the IR-level dead function elimination pass, since nothing at the IR level is referencing them (calls to these are inserted later, at codegen time). Signed-off-by: Sam Edwards --- arch/arm/lib/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm

[PATCH 01/17] arm: Remove stray .mmutable reference in linker script

2025-02-23 Thread Sam Edwards
rm: pxa: Remove CONFIG_CPU_PXA25X") Signed-off-by: Sam Edwards --- arch/arm/cpu/u-boot.lds | 9 - 1 file changed, 9 deletions(-) diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 2f50087f57a..63e82a09fad 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.l

[PATCH 00/17] Various toolchain compatibility fixes/improvements

2025-02-23 Thread Sam Edwards
abi_compat" ...depends on: "arm: Add __aeabi_memclr in eabi_compat" Warm regards, Sam Sam Edwards (17): arm: Remove stray .mmutable reference in linker script arm: Exclude eabi_compat from LTO arm: Add __aeabi_memclr in eabi_compat arm: Add aligned-memory aliases to eabi_compa

Re: [PATCH v2 2/2] usb: musb-new: sunxi: make compatible with UDC/DM gadget model

2024-06-27 Thread Sam Edwards
On 6/27/24 09:06, Andre Przywara wrote: On Thu, 8 Jun 2023 13:56:31 -0600 Sam Edwards wrote: Hi, John asked me have a look at this. Hi Andre, it's good to hear from you again, I'd first like to make sure you're aware that the date on this patch is June *2023,* not

[PATCH v3] configs: rk3588-turing-rk1: disable SPI flash by default

2024-05-02 Thread Sam Edwards
causes confusion among downstream users as to whether the SPI image needs to be distributed. Fixes: 153ac950a599 ("board: rockchip: Add the Turing RK1 SoM") Suggested-by: Florian Klink Signed-off-by: Sam Edwards Acked-by: Joshua Riek Reviewed-by: Jonas Karlman --- Changes v1->v2 (b

[RESEND PATCH v2] configs: rk3588-turing-rk1: disable SPI flash by default

2024-04-13 Thread Sam Edwards
causes confusion among downstream users as to whether the SPI image needs to be distributed. Fixes: 153ac950a599 ("board: rockchip: Add the Turing RK1 SoM") Suggested-by: Florian Klink Signed-off-by: Sam Edwards Acked-by: Joshua Riek Reviewed-by: Jonas Karlman --- Changes v1->v2 (b

[PATCH] configs: turing-rk1: disable SPI flash by default

2024-04-13 Thread Sam Edwards
causes confusion among downstream users as to whether the SPI image needs to be distributed. Fixes: 153ac950a599 ("board: rockchip: Add the Turing RK1 SoM") Suggested-by: Florian Klink Signed-off-by: Sam Edwards Acked-by: Joshua Riek Reviewed-by: Jonas Karlman --- Changes v1->v2 (b

[PATCH] configs: turing-rk1: disable SPI flash by default

2024-04-13 Thread Sam Edwards
causes confusion among downstream users as to whether the SPI image needs to be distributed. Fixes: 153ac950a599 ("board: rockchip: Add the Turing RK1 SoM") Suggested-by: Florian Klink Signed-off-by: Sam Edwards Acked-by: Joshua Riek --- configs/turing-rk1-rk3588_defconfig | 6

Re: [PATCH RFC 00/15] Support SPI NAND booting on the T113

2024-04-11 Thread Sam Edwards
On Wed, Apr 10, 2024 at 10:26 PM John Watts wrote: > > This series is my current working and tested setup for booting from > SPI NAND chips on the Allwinner T113. > > I have included the following patches from others. I may have modified > them to work with the latest mainline: > > https://lore.ke

Re: [PATCH v2] board: rockchip: Add the Turing RK1 SoM

2024-04-11 Thread Sam Edwards
On Thu, Apr 11, 2024 at 1:29 AM Florian Klink wrote: > > On 23-12-14 18:46:47, Joshua Riek wrote: > >The Turing RK1 is a Rockchip RK3588 based SoM from Turing Machines. > > > >Specifications: > > > >Rockchip RK3588 SoC > >4x ARM Cortex-A76, 4x ARM Cortex-A55 > >8/16/32GB memory LPDDR4x

Re: [PATCH v2 0/2] sunxi, usb: UDC/DM gadget model support

2024-04-11 Thread Sam Edwards
On Thu, Apr 11, 2024 at 1:40 AM John Watts wrote: > > On Thu, Apr 11, 2024 at 12:52:14AM -0600, Sam Edwards wrote: > > Hi John, > > > > This patch was developed against (and used very heavily on) the Turing > > Pi 2, which has an Allwinner T113-s3 SoC. Likely it s

Re: [PATCH v3 2/7] arm: clean up v7 and v8 linker scripts for bss_start/end

2024-03-13 Thread Sam Edwards
"CONFIG_SPL_BSS_START_ADDR must be 8-byte aligned"); + Git complains about this added blank line at the end of the file. (My personal preference would be a blank line before the ASSERT, if the ASSERT is truly necessary.) But beyond that: Tested-by: Sam Edwards # Binary output identical

Re: [PATCH 6/6] arm: move image_copy_start/end to linker symbols

2024-03-06 Thread Sam Edwards
On 3/6/24 06:23, Ilias Apalodimas wrote: On Wed, 6 Mar 2024 at 12:37, Ilias Apalodimas wrote: On Wed, 6 Mar 2024 at 11:35, Ilias Apalodimas wrote: Hi Sam, On Wed, 6 Mar 2024 at 10:22, Sam Edwards wrote: On 3/4/24 02:01, Ilias Apalodimas wrote: image_copy_start/end are defined as c

Re: [PATCH 5/6] arm: fix __efi_runtime_start/end definitions

2024-03-06 Thread Sam Edwards
On 3/6/24 02:13, Ilias Apalodimas wrote: Hi Sam, Again thank you for the elaborate review. This really helps a lot. On Wed, 6 Mar 2024 at 10:14, Sam Edwards wrote: On 3/4/24 02:01, Ilias Apalodimas wrote: __efi_runtime_start/end are defined as c variables for arm7 only in order to

Re: [PATCH 6/6] arm: move image_copy_start/end to linker symbols

2024-03-06 Thread Sam Edwards
, the variable definitions from sections.c and define them as a symbols within a section. Signed-off-by: Ilias Apalodimas Tested-by: Sam Edwards # Binary output identical Since the __image_copy_* symbols are marking boundaries in the whole image as opposed to a single section, I'd find it clear

Re: [PATCH 5/6] arm: fix __efi_runtime_start/end definitions

2024-03-06 Thread Sam Edwards
symbol. So let's remove the special sections from the linker scripts, the variable definitions from sections.c and define them as a symbols within the correct section. Signed-off-by: Ilias Apalodimas Tested-by: Sam Edwards # Binary output identical Thanks for the cleanup, Sam --- arc

Re: [PATCH 4/6] arm: clean up v7 and v8 linker scripts for __rel_dyn_start/end

2024-03-05 Thread Sam Edwards
since 2016 [1] [0] https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_mono/ld.html#SEC13 [1] commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object") Signed-off-by: Ilias Apalodimas Reviewed-by: Sam Edwards Tested-by: Sam Edwards # Binary output identical Th

Re: [PATCH 3/6] arm: fix __efi_runtime_rel_start/end definitions

2024-03-05 Thread Sam Edwards
a symbol. So let's remove the special sections from the linker scripts, the variable definitions from sections.c and define them as a symbols within the correct section. Signed-off-by: Ilias Apalodimas Reviewed-by: Sam Edwards Tested-by: Sam Edwards # Binary output identical Thanks fo

Re: [PATCH 2/6] arm: clean up v7 and v8 linker scripts for bss_start/end

2024-03-05 Thread Sam Edwards
On 3/4/24 02:01, Ilias Apalodimas wrote: commit 3ebd1cbc49f0 ("arm: make __bss_start and __bss_end__ compiler-generated") and commit f84a7b8f54db ("ARM: Fix __bss_start and __bss_end in linker scripts") were moving the bss_start/end on c generated variables that were injected in their own section

Re: [RFC PATCH 0/6] Clean up arm linker scripts

2024-02-29 Thread Sam Edwards
On 2/28/24 04:15, Ilias Apalodimas wrote: On Wed, 28 Feb 2024 at 13:11, Peter Robinson wrote: On Wed, 28 Feb 2024 at 10:58, Ilias Apalodimas wrote: The arm linker scripts had a mix of symbols and C defined variables in an effort to emit relative references instead of absolute ones e.g [0

Re: [PATCH v2] board: rockchip: Add the Turing RK1 SoM

2023-12-15 Thread Sam Edwards
Hi Joshua, I just updated my own modules to this version of the patch and all continues to be well. On 12/14/23 16:46, Joshua Riek wrote: Signed-off-by: Joshua Riek Cc: Sam Edwards Tested-by: Sam Edwards Thanks for the continued efforts, my friend! Happy Friday, Sam

Re: [PATCH] fs: btrfs: fix reading when length specified

2023-11-16 Thread Sam Edwards
- which in practice means it reads the whole file in one exact-filesize chunk. So, to answer your questions: "either/both depending on platform." (The bug in the U-Boot implementation doubtlessly affects more than just EFI; I only happened to discover it while trying to use EFI.) Signed

[PATCH] fs: btrfs: fix reading when length specified

2023-11-11 Thread Sam Edwards
nitrd= via 'bootefi' from a btrfs partition. The EFI stub entered an infinite loop of zero-length reads while trying to read the initrd, and the boot process stalled indefinitely. Signed-off-by: Sam Edwards --- fs/btrfs/btrfs.c | 15 ++- 1 file changed, 6 insertions(+), 9 deleti

[PATCH v4 4/4] sunxi: psci: implement PSCI on R528

2023-10-11 Thread Sam Edwards
This patch adds the necessary code to make nonsec booting and PSCI secondary core management functional on the R528/T113. Signed-off-by: Sam Edwards Tested-by: Maksim Kiselev Tested-by: Kevin Amadiva --- arch/arm/cpu/armv7/Kconfig | 3 ++- arch/arm/cpu/armv7/sunxi/psci.c | 47

[PATCH v4 2/4] sunxi: psci: refactor register access to separate functions

2023-10-11 Thread Sam Edwards
same logic. Signed-off-by: Sam Edwards Reviewed-by: Andre Przywara --- arch/arm/cpu/armv7/sunxi/psci.c | 66 +++-- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/arch/arm/cpu/armv7/sunxi/psci.c b/arch/arm/cpu/armv7/sunxi/psci.c index 69fa3f3c2e..27c

[PATCH v4 3/4] sunxi: psci: stop modeling register layout with C structs

2023-10-11 Thread Sam Edwards
its associated header file existed only to support PSCI code, so also delete them altogether. Signed-off-by: Sam Edwards --- arch/arm/cpu/armv7/sunxi/psci.c | 57 arch/arm/include/asm/arch-sunxi/cpucfg.h | 67 2 files changed, 23 insertions

[PATCH v4 1/4] sunxi: psci: clean away preprocessor macros

2023-10-11 Thread Sam Edwards
ere are no functional changes here. Signed-off-by: Sam Edwards Reviewed-by: Andre Przywara --- arch/arm/cpu/armv7/sunxi/psci.c | 103 +--- 1 file changed, 43 insertions(+), 60 deletions(-) diff --git a/arch/arm/cpu/armv7/sunxi/psci.c b/arch/arm/cpu/armv7/sunxi/ps

[PATCH v4 0/4] Allwinner R528/T113s PSCI

2023-10-11 Thread Sam Edwards
ULL" conditional into sunxi_cpu_set_power(). - Removed unnecessary H6 special-case, since H6 is actually ARM64. - Renamed SUNXI_CPUX_BASE to SUNXI_CPUCFG_BASE, to mirror expected changes in Andre's v2 of the R528 series (we decided against using a new name for this block). - Removed sunxi_cpuc

Re: [PATCH] ARM: psci: move GIC address override to Kconfig

2023-10-08 Thread Sam Edwards
e Przywara Reviewed-by: Sam Edwards Cheers, Sam

[RFC PATCH v2 4/4] HACK: enable access to `ubi 0:volname` block devices

2023-10-05 Thread Sam Edwards
--- disk/part.c | 55 + 1 file changed, 55 insertions(+) diff --git a/disk/part.c b/disk/part.c index a4b6d265da..7c995f583c 100644 --- a/disk/part.c +++ b/disk/part.c @@ -14,6 +14,9 @@ #include #include #include +#include +#include +#in

[RFC PATCH v2 3/4] disk: part: fall-through if "ubi" requested but ubifs not mounted

2023-10-05 Thread Sam Edwards
s a plain "Bad device specification" and does not suggest using ubifsmount. Signed-off-by: Sam Edwards --- disk/part.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/disk/part.c b/disk/part.c index 72241b7b23..a4b6d265da 100644 --- a/

[RFC PATCH v2 1/4] mtd: ubi: register UBI attachments as DM devices

2023-10-05 Thread Sam Edwards
nt for the BLK devices that represent the static volumes. Signed-off-by: Sam Edwards --- cmd/ubi.c| 11 ++ drivers/mtd/ubi/Makefile | 1 + drivers/mtd/ubi/ubi-uclass.c | 74 include/dm/uclass-id.h | 1 + include/ubi_uboot.h

[RFC PATCH v2 2/4] mtd: ubi: bind block device driver for static volumes

2023-10-05 Thread Sam Edwards
This makes static UBI volumes readable as block devices, however no mechanism for selecting these volume devices yet exists. Signed-off-by: Sam Edwards --- drivers/mtd/ubi/ubi-uclass.c | 111 +++ 1 file changed, 111 insertions(+) diff --git a/drivers/mtd/ubi/ubi

[RFC PATCH v2 0/4] mtd: ubi: Enable accessing RO filesystems in UBI vols

2023-10-05 Thread Sam Edwards
arse UBI index/volume numbers with `dectoul` instead of `hextoul`, to match Linux's behavior of treating these numbers as decimal. - Do not treat a valid decimal number as a volume name, even if the volume ID doesn't exist, to match Linux's behavior of always treating decimal number

[PATCH v3 4/4] sunxi: psci: implement PSCI on R528

2023-09-30 Thread Sam Edwards
This patch adds the necessary code to make nonsec booting and PSCI secondary core management functional on the R528/T113. Signed-off-by: Sam Edwards Tested-by: Maksim Kiselev Tested-by: Kevin Amadiva --- arch/arm/cpu/armv7/sunxi/psci.c | 47 - arch/arm/mach

[PATCH v3 3/4] sunxi: psci: stop modeling register layout with C structs

2023-09-30 Thread Sam Edwards
its associated header file existed only to support PSCI code, so also delete them altogether. Signed-off-by: Sam Edwards --- arch/arm/cpu/armv7/sunxi/psci.c | 57 arch/arm/include/asm/arch-sunxi/cpucfg.h | 67 2 files changed, 23 insertions

[PATCH v3 2/4] sunxi: psci: refactor register access to separate functions

2023-09-30 Thread Sam Edwards
same logic. Signed-off-by: Sam Edwards Reviewed-by: Andre Przywara --- arch/arm/cpu/armv7/sunxi/psci.c | 66 +++-- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/arch/arm/cpu/armv7/sunxi/psci.c b/arch/arm/cpu/armv7/sunxi/psci.c index 69fa3f3c2e..27c

[PATCH v3 1/4] sunxi: psci: clean away preprocessor macros

2023-09-30 Thread Sam Edwards
ere are no functional changes here. Signed-off-by: Sam Edwards Reviewed-by: Andre Przywara --- arch/arm/cpu/armv7/sunxi/psci.c | 103 +--- 1 file changed, 43 insertions(+), 60 deletions(-) diff --git a/arch/arm/cpu/armv7/sunxi/psci.c b/arch/arm/cpu/armv7/sunxi/ps

[PATCH v3 0/4] Allwinner R528/T113s PSCI

2023-09-30 Thread Sam Edwards
6 is actually ARM64. - Renamed SUNXI_CPUX_BASE to SUNXI_CPUCFG_BASE, to mirror expected changes in Andre's v2 of the R528 series (we decided against using a new name for this block). - Removed sunxi_cpucfg_reg struct, and stopped using the PRCM struct in psci.c. Happy Saturday all, Sam

Re: [PATCH v2 4/5] sunxi: psci: implement PSCI on R528

2023-09-27 Thread Sam Edwards
On 9/27/23 10:31, Andre Przywara wrote: On Wed, 16 Aug 2023 10:34:19 -0700 Sam Edwards wrote: Hi Sam, Hi Andre, @@ -103,10 +116,13 @@ static void __secure clamp_set(u32 *clamp) static void __secure sunxi_cpu_set_entry(int __always_unused cpu, void *entry) { - /* secondary

Re: [PATCH v2 1/5] sunxi: psci: clean away preprocessor macros

2023-09-27 Thread Sam Edwards
On 9/27/23 10:34, Andre Przywara wrote: In the majority of cases, there are no changes to the text section introduced by this patch. In the R40 case, there's a small change where the compiler adds a NULL check onto the result of the `(void *)cpucfg + SUN8I_R40_PWR_CLAMP(cpu)` computation, which w

Re: [PATCH v2 5/5] HACK: sunxi: psci: be compatible with v1 of R528 patchset

2023-09-27 Thread Sam Edwards
On 9/27/23 10:32, Andre Przywara wrote: On Wed, 16 Aug 2023 10:34:20 -0700 Sam Edwards wrote: Hi Sam, Hi Andre, Mmh, I didn't find a better solution than keeping this in. I'll keep it if your R528 v2 doesn't find some other way to address it. +#endif +#if defined(

Re: [RFC PATCH 0/4] mtd: ubi: Enable accessing RO filesystems in UBI vols

2023-09-07 Thread Sam Edwards
Hi Heiko and Simon, Thought I'd follow-up to keep this discussion going. The main thing I would like to decide first (as it lets me start relying on it in boot scripts) would be the UBI access syntax: => ls ubi 0:rootfs /boot => ls ubi 0:2 /boot Do those look good? Should I be trying to mimi

Re: [PATCH] sunxi: psci: remove redundant initialization from psci_arch_init

2023-08-28 Thread Sam Edwards
On 8/26/23 04:22, Marc Zyngier wrote: Hi Marc! The GIC definitely has the NS bit routed to it. Otherwise, the secure configuration would just be an utter joke. Just try it. Thank you for your response. I'd like to revisit my prior point about the distinction between the NS bit and AxPROT[1]

Re: [PATCH] sunxi: psci: remove redundant initialization from psci_arch_init

2023-08-25 Thread Sam Edwards
On 8/25/23 00:20, Chen-Yu Tsai wrote: Hi Chen-Yu, IIRC the GIC manual says that the secure bit is set or cleared to select which bank of registers is accessed. Which secure bit are we talking about here? Do we mean the *configured* secure bit (SCR.NS, what the code is attempting to clear) or

Re: [PATCH 3/3] sunxi: psci: implement PSCI on R528

2023-08-18 Thread Sam Edwards
On 8/18/23 07:27, Andre Przywara wrote: Hi Andre, So instead of trying to derive some pattern from where there is none, I'd rather do: config SUNXI_CPU_HOTPLUG_ADDRESS hex default 0x01c000bc if MACH_SUN8I_R40 But the hotplug flag register is at 0x01c000b8 for R40? ..

Re: [PATCH v2 1/5] sunxi: psci: clean away preprocessor macros

2023-08-18 Thread Sam Edwards
On 8/18/23 10:40, Sam Edwards wrote: On 8/18/23 07:11, Andre Przywara wrote: Hi Andre, The resulting object file is different (8 byte larger, even), so it's hard to prove I'm no stranger to reading object code. Since the output should be identical in principle, I'll spend

Re: [PATCH v2 1/5] sunxi: psci: clean away preprocessor macros

2023-08-18 Thread Sam Edwards
I can identify what's changing. If it's easy enough, I'd like to adjust my patch so that the optimizer does produce the same output. (Keep in mind I'm on Clang, though. If Clang already gives the same output for both, I'll just report back to use that when comparing.) S

Re: [PATCH v2 2/5] sunxi: psci: refactor register access to separate functions

2023-08-18 Thread Sam Edwards
On 8/18/23 07:57, Andre Przywara wrote: On Wed, 16 Aug 2023 10:34:17 -0700 Sam Edwards wrote: Hi Sam, Likewise Andre, -static void __secure sunxi_set_entry_address(void *entry) +static void __secure sunxi_cpu_set_entry(int __always_unused cpu, void *entry) So what is the reasoning behind

[PATCH] pci: pcie-brcmstb: do not rely on CLKREQ# signal

2023-08-16 Thread Sam Edwards
lled in slot 3 of a Turing Pi 2 cluster board. [1]: https://lore.kernel.org/all/20230428223500.23337-1-jim2101...@gmail.com/ Signed-off-by: Sam Edwards --- drivers/pci/pcie_brcmstb.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pcie_brcmstb.c b/

[PATCH v2 5/5] HACK: sunxi: psci: be compatible with v1 of R528 patchset

2023-08-16 Thread Sam Edwards
This is a hack for reviewer QoL. It is not being submitted for mainline inclusion. --- arch/arm/cpu/armv7/sunxi/psci.c | 12 1 file changed, 12 insertions(+) diff --git a/arch/arm/cpu/armv7/sunxi/psci.c b/arch/arm/cpu/armv7/sunxi/psci.c index b4ce4f6def..27bac291d5 100644 --- a/arch/

[PATCH v2 4/5] sunxi: psci: implement PSCI on R528

2023-08-16 Thread Sam Edwards
This patch adds the necessary code to make nonsec booting and PSCI secondary core management functional on the R528/T113. Signed-off-by: Sam Edwards Tested-by: Maksim Kiselev --- arch/arm/cpu/armv7/sunxi/psci.c | 48 - arch/arm/mach-sunxi/Kconfig | 2

[PATCH v2 3/5] sunxi: psci: stop modeling register layout with C structs

2023-08-16 Thread Sam Edwards
its associated header file existed only to support PSCI code, so also delete them altogether. Signed-off-by: Sam Edwards --- arch/arm/cpu/armv7/sunxi/psci.c | 57 arch/arm/include/asm/arch-sunxi/cpucfg.h | 67 2 files changed, 23 insertions

[PATCH v2 2/5] sunxi: psci: refactor register access to separate functions

2023-08-16 Thread Sam Edwards
same logic. Signed-off-by: Sam Edwards --- arch/arm/cpu/armv7/sunxi/psci.c | 66 +++-- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/arch/arm/cpu/armv7/sunxi/psci.c b/arch/arm/cpu/armv7/sunxi/psci.c index 7804e0933b..e2845f21ab 100644 --- a/arch

[PATCH v2 1/5] sunxi: psci: clean away preprocessor macros

2023-08-16 Thread Sam Edwards
ere are no functional changes here. Signed-off-by: Sam Edwards --- arch/arm/cpu/armv7/sunxi/psci.c | 102 +--- 1 file changed, 42 insertions(+), 60 deletions(-) diff --git a/arch/arm/cpu/armv7/sunxi/psci.c b/arch/arm/cpu/armv7/sunxi/psci.c index e1d3638b5c..7804e09

[PATCH v2 0/5] Allwinner R528/T113s PSCI

2023-08-16 Thread Sam Edwards
d using the PRCM struct in psci.c. Cheers, Sam Sam Edwards (5): sunxi: psci: clean away preprocessor macros sunxi: psci: refactor register access to separate functions sunxi: psci: stop modeling register layout with C structs sunxi: psci: implement PSCI on R528 HACK: sunxi: psci: be co

Re: [PATCH 3/3] sunxi: psci: implement PSCI on R528

2023-08-15 Thread Sam Edwards
On 8/15/23 15:59, Andre Przywara wrote: Hi Sam, Hi Andre, So that's a bit more nasty indeed. I don't even know if R_CPUCFG really makes sense here, as the _R_ term typically refers to the management processor, which the D1/R528 don't have. Or at least the always-on power domain, but then agai

Re: [PATCH 3/3] sunxi: psci: implement PSCI on R528

2023-08-15 Thread Sam Edwards
On 8/14/23 08:16, Andre Przywara wrote: Hi Sam, This patch adds the necessary code to make nonsec booting and PSCI secondary core management functional on the R528/T113. Unfortunately this patch breaks the build on older 32-bit SoCs, as SUNXI_CPUX_BASE is not defined there. That's a typical p

[PATCH] pci: pcie-brcmstb: bring over some robustness improvements from Linux

2023-08-14 Thread Sam Edwards
interrupt which will crash U-Boot. - Wait for the recommended 100ms after PERST# is deasserted. I sent this patch while debugging a crash involving PCIe, but these are unrelated improvements. I do not believe that this patch fixes any real-world bug. Signed-off-by: Sam Edwards --- drivers/pci

Re: [PATCH 1/3] sunxi: psci: clean away preprocessor macros

2023-08-14 Thread Sam Edwards
On 8/14/23 15:05, Andre Przywara wrote: Yes, I will add this to the header file, either defined as 0, or to its actual address. Gotcha; my v2 will also assume you've taken care of merging these guys: +#define SUNXI_CPUX_BASE0x0901 +#define SUNXI_CPUCFG_BASE

Re: [PATCH 0/3] Allwinner R528/T113s PSCI

2023-08-14 Thread Sam Edwards
On 8/14/23 08:06, Andre Przywara wrote: Hi Sam, many many thanks for sending this, I especially like your clean up around the #ifdef's! The patches looks good on the first glance (apart from some regression in patch 3/3), but I will reply to them individually. Cheers, Andre Thanks for your a

  1   2   3   >