]> Git Repo - u-boot.git/log
u-boot.git
4 weeks agoMerge patch series "Fix OSPI boot for J722S"
Tom Rini [Tue, 31 Dec 2024 21:24:34 +0000 (15:24 -0600)]
Merge patch series "Fix OSPI boot for J722S"

Prasanth Babu Mantena <[email protected]> says:

This series fixes OSPI boot for J722S. It contains fixes for DMSC
communication, R5 regmap for ospi and dma specific overrides for ospi.

Test log: https://gist.github.com/PrasanthBabuMantena/ad469dd09ab7263f85f87dadda46c86d

Link: https://lore.kernel.org/r/[email protected]
4 weeks agoarm: dts: k3-j721e-beagleboneai: Move to OF_UPSTREAM
Udit Kumar [Wed, 18 Dec 2024 05:55:14 +0000 (11:25 +0530)]
arm: dts: k3-j721e-beagleboneai: Move to OF_UPSTREAM

Move to using OF_UPSTREAM config and thus using the devicetree
subtree and remove unused device tree files.

Signed-off-by: Udit Kumar <[email protected]>
Acked-by: Sumit Garg <[email protected]>
4 weeks agodrivers: firmware: ti_sci: Add DM_FLAG_PRE_RELOC to driver
Manorit Chawdhry [Tue, 17 Dec 2024 08:54:37 +0000 (14:24 +0530)]
drivers: firmware: ti_sci: Add DM_FLAG_PRE_RELOC to driver

Currently the driver relies on bootph flag to probe it during PRE_RELOC
stage but with the upcoming cleanup of v6.13, we don't have the bootph
property in the parent nodes anymore and ti_sci driver being one of the
parent nodes required during SPL stage would end up hampering the probe
model [0].

Add DM_FLAG_PRE_RELOC to ti_sci driver for mitigating this issue.

[0]: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/21

Suggested-by: Vignesh Raghavendra <[email protected]>
Signed-off-by: Manorit Chawdhry <[email protected]>
4 weeks agoarm: dts: k3-am62p-sk-binman: add SE security variant builds
Bryan Brattlof [Tue, 10 Dec 2024 21:43:30 +0000 (15:43 -0600)]
arm: dts: k3-am62p-sk-binman: add SE security variant builds

The Texas Instruments Foundational Security (TIFS) firmware must match
the security level configured on the SoC. To boot Security Enforced (SE)
variants of the AM62Px, add another tiboot3 build which packages the
Security Enforced (SE) firmware variant for AM62Px SoCs.

Signed-off-by: Bryan Brattlof <[email protected]>
4 weeks agoarm: dts: k3-j722s*: Add overrides specific to OSPI
Vaishnav Achath [Wed, 18 Dec 2024 13:13:41 +0000 (18:43 +0530)]
arm: dts: k3-j722s*: Add overrides specific to OSPI

OSPI Boot requires overrides specific to R5 and also
to use DMA in R5 SPL stage the DM_TIFS needs to be used.
Add the corresponding overrides for R5 SPL stage.

Signed-off-by: Vaishnav Achath <[email protected]>
Signed-off-by: Prasanth Babu Mantena <[email protected]>
Reviewed-by: Udit Kumar <[email protected]>
4 weeks agoarm: mach-k3: j722_spl: Add FAST XSPI boot mode
Vaishnav Achath [Wed, 18 Dec 2024 13:13:40 +0000 (18:43 +0530)]
arm: mach-k3: j722_spl: Add FAST XSPI boot mode

Fast XSPI boot mode is supported by J722S ROM, add that.

Signed-off-by: Vaishnav Achath <[email protected]>
Signed-off-by: Prasanth Babu Mantena <[email protected]>
Reviewed-by: Udit Kumar <[email protected]>
4 weeks agoarm: dts: k3-j722s-r5-evm: Fix DM2TIFS secproxy thread ID
Vaishnav Achath [Wed, 18 Dec 2024 13:13:39 +0000 (18:43 +0530)]
arm: dts: k3-j722s-r5-evm: Fix DM2TIFS secproxy thread ID

Fix the DM2TIFS secureproxy thread ID as per the latest TISCI
documentation for J722S.
https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j722s/sec_proxy.html

Fixes: fc2da3a3d0d3 ("arm: dts: Introduce J722S U-Boot dts files")
Signed-off-by: Vaishnav Achath <[email protected]>
Signed-off-by: Prasanth Babu Mantena <[email protected]>
Reviewed-by: Udit Kumar <[email protected]>
4 weeks agomailbox: k3-sec-proxy: Add DM to DMSC communication thread for J722S
Vaishnav Achath [Wed, 18 Dec 2024 13:13:38 +0000 (18:43 +0530)]
mailbox: k3-sec-proxy: Add DM to DMSC communication thread for J722S

J722S R5 SPL uses sec-proxy threads 28 and 29 for communication with
TIFS. Mark these as valid threads in the driver.

https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j722s/sec_proxy.html

Signed-off-by: Vaishnav Achath <[email protected]>
Signed-off-by: Prasanth Babu Mantena <[email protected]>
Reviewed-by: Udit Kumar <[email protected]>
4 weeks agoMerge patch series "Cumulative fixes and updates for MediaTek ethernet driver"
Tom Rini [Tue, 31 Dec 2024 16:59:06 +0000 (10:59 -0600)]
Merge patch series "Cumulative fixes and updates for MediaTek ethernet driver"

Weijie Gao <[email protected]> says:

This patch series contains fixes and updates for mtk_eth driver.

Link: https://lore.kernel.org/r/[email protected]
4 weeks agonet: mediatek: fix usability with wget command
Weijie Gao [Tue, 17 Dec 2024 08:40:03 +0000 (16:40 +0800)]
net: mediatek: fix usability with wget command

The wget command currently cannot work correctly with mtk_eth driver.
This patch fixed this by increase DMA ring size and invalidate ring data
after use.

Signed-off-by: Weijie Gao <[email protected]>
4 weeks agonet: mediatek: don't enable GDMA cpu bridge unconditionally for NETSYSv3
Weijie Gao [Tue, 17 Dec 2024 08:39:59 +0000 (16:39 +0800)]
net: mediatek: don't enable GDMA cpu bridge unconditionally for NETSYSv3

Enable GDMA cpu bridge only when 10Gb interface is enabled for GMAC other
than GMAC0, or when MT7988 internal switch is used.

Signed-off-by: Weijie Gao <[email protected]>
4 weeks agonet: mediatek: make sgmii/usxgmii optional
Weijie Gao [Tue, 17 Dec 2024 08:39:55 +0000 (16:39 +0800)]
net: mediatek: make sgmii/usxgmii optional

Not all platforms supports sgmii and/or usxgmii. So we add Kconfig
options for these features and enable them only for supported
platforms.

Signed-off-by: Weijie Gao <[email protected]>
4 weeks agonet: mediatek: add support for 10GBASE-R
Weijie Gao [Tue, 17 Dec 2024 08:39:50 +0000 (16:39 +0800)]
net: mediatek: add support for 10GBASE-R

This patch adds support for 10GBASE-R interface mode

Signed-off-by: Bo-Cun Chen <[email protected]>
Signed-off-by: Weijie Gao <[email protected]>
4 weeks agonet: mediatek: fix gmac2 usability for mt7629
Weijie Gao [Tue, 17 Dec 2024 08:39:46 +0000 (16:39 +0800)]
net: mediatek: fix gmac2 usability for mt7629

MT7629 need extra setting for gmac2 to work. So additional
capability is added for mt7629 to handle this case.

Signed-off-by: Weijie Gao <[email protected]>
4 weeks agonet: mediatek: fix sgmii selection for mt7622
Weijie Gao [Tue, 17 Dec 2024 08:39:41 +0000 (16:39 +0800)]
net: mediatek: fix sgmii selection for mt7622

Unlike other platforms, mt7622 has only one SGMII and it can be
attached to either gmac1 or gmac2. So the register field of the
sgmii selection differs from other platforms as newer platforms can
control each sgmii individually.

This patch adds a new capability for mt7622 to handle this case.

Signed-off-by: Weijie Gao <[email protected]>
4 weeks agonet: mediatek: correct register name of ethsys syscfg1
Weijie Gao [Tue, 17 Dec 2024 08:39:27 +0000 (16:39 +0800)]
net: mediatek: correct register name of ethsys syscfg1

The SYSCFG0 should be SYSCFG1 according to the programming guide.

Signed-off-by: Weijie Gao <[email protected]>
4 weeks agonet: mediatek: use correct register field for SGMII speed selection
Weijie Gao [Tue, 17 Dec 2024 08:39:23 +0000 (16:39 +0800)]
net: mediatek: use correct register field for SGMII speed selection

The register field for SGMII speed selection is a 2-bit field with
value 0 for 1Gbps and 1 for 2.5Gbps (2/3 are reserved).
So it's necessary to set both bits instead of just setting/clearing
only the lower bit.

Signed-off-by: Weijie Gao <[email protected]>
4 weeks agoarm: dts: mt7629: fix sgmii clock selection for ethernet
Weijie Gao [Tue, 17 Dec 2024 08:39:20 +0000 (16:39 +0800)]
arm: dts: mt7629: fix sgmii clock selection for ethernet

Setup correct parent of clock CLK_TOP_SGMII_REF_1_SEL to allow
sgmiisys1 work correctly.

Signed-off-by: Weijie Gao <[email protected]>
4 weeks agoclk: mediatek: mt7629: fix parent clock of some top clock muxes
Weijie Gao [Tue, 17 Dec 2024 08:39:16 +0000 (16:39 +0800)]
clk: mediatek: mt7629: fix parent clock of some top clock muxes

According to the mt7629 programming guide, the CLK_TOP_F10M_REF_SEL
shares the same parent selection with CLK_TOP_IRRX_SEL, while the
present parent selection for CLK_TOP_F10M_REF_SEL is actually used
for CLK_TOP_SGMII_REF_1_SEL.

Signed-off-by: Weijie Gao <[email protected]>
4 weeks agoMerge patch series "Select CONFIG_64BIT for sandbox64 and x86_64"
Tom Rini [Tue, 31 Dec 2024 16:58:36 +0000 (10:58 -0600)]
Merge patch series "Select CONFIG_64BIT for sandbox64 and x86_64"

Andrew Goodbody <[email protected]> says:

Picking up a series from Dan Carpenter and applying requested
changes for v2.

I had previously set CONFIG_64BIT for arm64.  This patchset does the
same thing for sandbox and x86_64.  (Mips and riscv were already
doing it).  This CONFIG option is used in the Makefile to determine
if it's a 32 or 64 bit system for the CHECKER.

Makefile
  1052  # the checker needs the correct machine size
  1053  CHECKFLAGS += $(if $(CONFIG_64BIT),-m64,-m32)

Link: https://lore.kernel.org/r/[email protected]
4 weeks agotest: lib: Use CONFIG_64BIT to detect 64 bit compile
Andrew Goodbody [Mon, 16 Dec 2024 18:07:36 +0000 (18:07 +0000)]
test: lib: Use CONFIG_64BIT to detect 64 bit compile

Should use CONFIG_64BIT to detect a 64 bit compile and not
CONFIG_PHYS_64BIT. This allows more platforms to run the
full test code.

Reviewed-by: Simon Glass <[email protected]>
Signed-off-by: Andrew Goodbody <[email protected]>
4 weeks agox86: select CONFIG_64BIT for X86_64
Andrew Goodbody [Mon, 16 Dec 2024 18:07:35 +0000 (18:07 +0000)]
x86: select CONFIG_64BIT for X86_64

Select CONFIG_64BIT so that we pass the -m64 option (instead of -m32) to
static analysis tools.
Introduce CONFIG_SPL_64BIT and select it for architectures other than
x86 with 64 bit builds. Do not select it for x86 builds as x86 uses
a 32 bit SPL.
Ensure that when limits are set they use CONFIG_64BIT for U-Boot
proper and CONFIG_SPL_64BIT for SPL. This is to allow for the 32 bit
SPL build used by x86.

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Andrew Goodbody <[email protected]>
4 weeks agosandbox: select CONFIG_64BIT for sandbox
Andrew Goodbody [Mon, 16 Dec 2024 18:07:34 +0000 (18:07 +0000)]
sandbox: select CONFIG_64BIT for sandbox

Select CONFIG_64BIT so that we pass the -m64 option (instead of -m32) to
static analysis tools.

Reviewed-by: Simon Glass <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Andrew Goodbody <[email protected]>
4 weeks agosandbox: Correct guard around readq/writeq
Andrew Goodbody [Mon, 16 Dec 2024 18:07:33 +0000 (18:07 +0000)]
sandbox: Correct guard around readq/writeq

In include/linux/io.h the declarations of ioread64 and iowrite64
which make use of readq/writeq are guarded with CONFIG_64BIT so
guard the sandbox declarations of readq and writeq also with
CONFIG_64BIT.

Reviewed-by: Simon Glass <[email protected]>
Signed-off-by: Andrew Goodbody <[email protected]>
4 weeks agoMerge patch series "Keep the access to dtb_dt_embedded() within fdtdec"
Tom Rini [Tue, 31 Dec 2024 16:57:54 +0000 (10:57 -0600)]
Merge patch series "Keep the access to dtb_dt_embedded() within fdtdec"

Evgeny Bachinin <[email protected]> says:

The 1st patch addresses comments from the post-review, available by
link [1].

  The 2nd patch fixes problems of dtb_dt_embedded() with checkpatch.

Links:
[1] https://lore.kernel.org/u-boot/CAFLszTgEKamsa6FTnjzrEWQBLkqAR7EBbZqffx09AKgQ7ppuVA@mail.gmail.com/#t

Link: https://lore.kernel.org/r/20241211-dtb_dt_embedded_within_fdtdec-v1-0-7840469f0084@salutedevices.com
4 weeks agofdtdec: dtb_dt_embedded: replace ifdefs by IS_ENABLED()
Evgeny Bachinin [Tue, 10 Dec 2024 22:39:58 +0000 (01:39 +0300)]
fdtdec: dtb_dt_embedded: replace ifdefs by IS_ENABLED()

Patch fixes the checkpatch warnings like:
```
  WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef'
  #94: FILE: lib/fdtdec.c:102:
  +#ifdef CONFIG_OF_EMBED
```

Signed-off-by: Evgeny Bachinin <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agofdtdec: encapsulate dtb_dt_embedded() within
Evgeny Bachinin [Tue, 10 Dec 2024 22:39:57 +0000 (01:39 +0300)]
fdtdec: encapsulate dtb_dt_embedded() within

  Patch keeps the access to dtb_dt_embedded() within fdtdec API,
by means of new API function introduction. This new function is a
common place for updating appropriate global_data fields for
OF_EMBED case.

  Also, the consequence of the patch is movement of '___dtb_dt_*begin'
symbols' declaration from header file, because nobody used symbols
outside the lib/fdtdec.c.

Signed-off-by: Evgeny Bachinin <[email protected]>
Suggested-by: Simon Glass <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agoMerge tag 'v2025.01-rc6' into next
Tom Rini [Tue, 31 Dec 2024 14:08:59 +0000 (08:08 -0600)]
Merge tag 'v2025.01-rc6' into next

Prepare v2025.01-rc6

4 weeks agoPrepare v2025.01-rc6 v2025.01-rc6
Tom Rini [Tue, 31 Dec 2024 04:07:58 +0000 (22:07 -0600)]
Prepare v2025.01-rc6

Signed-off-by: Tom Rini <[email protected]>
4 weeks agoGitlab: Remove some "rules:when: always" lines
Tom Rini [Thu, 12 Dec 2024 22:33:36 +0000 (16:33 -0600)]
Gitlab: Remove some "rules:when: always" lines

In commit 399f739be6b2 ("CI: allow jobs to be run in merge requests") we
added "rules:when: always" to many stages of the pipeline to allow for merge
requests to trigger a run. However based on current Gitlab
documentation, we should still be triggered on merge requests without
this. Furthermore the way we have things written today we always run all
stages of the CI rather than failing out early on problems, which is not
always useful. Remove these as we should still be fine with merge
requests triggering a run.

Link: https://docs.gitlab.com/ee/ci/yaml/#rules
Signed-off-by: Tom Rini <[email protected]>
4 weeks agoGitlab: Make test.py stage only depend on binman et al testsuite
Tom Rini [Thu, 12 Dec 2024 20:14:59 +0000 (14:14 -0600)]
Gitlab: Make test.py stage only depend on binman et al testsuite

Our Gitlab pipeline is currently broken up in to several stages. This
was done with the thought process of "we should test tools and if
they're good test emulated targets and if they're good test real
hardware and if they're good test the world". However, in terms of that
first stage it only really matters that binman, et al are still
functional. And for a few years now Gitlab has had a "needs" keyword
that lets you refine pipeline dependencies. Use this to perform the
minor optimization of having test.py only require that tool testing job.
This will become more useful later when we add long running testsuites
that we do not want to block later jobs.

Signed-off-by: Tom Rini <[email protected]>
4 weeks agosandbox: Adjust configuration to hang on panic()
Simon Glass [Fri, 20 Dec 2024 03:59:27 +0000 (20:59 -0700)]
sandbox: Adjust configuration to hang on panic()

It is annoying to have sandbox enter a boot loop when an assertion
fails. Hang instead, since then the error message is only printed once
and Ctrl-C can be used to quit, as per normal.

Signed-off-by: Simon Glass <[email protected]>
4 weeks agoMerge patch series "Misc. PowerPC MPC83xx fixes/cleanups"
Tom Rini [Mon, 30 Dec 2024 21:55:33 +0000 (15:55 -0600)]
Merge patch series "Misc. PowerPC MPC83xx fixes/cleanups"

J. Neuschäfer <[email protected]> says:

This patchset contains a few small fixes/cleanups for the MPC83xx
platform.

Link: https://lore.kernel.org/r/[email protected]
4 weeks agogpio: mpc8xxx: Preserve pre-init state of outputs
J. Neuschäfer [Fri, 20 Dec 2024 10:37:54 +0000 (11:37 +0100)]
gpio: mpc8xxx: Preserve pre-init state of outputs

The mpc8xxx_gpio driver contains a workaround for certain chips
where the previously written state of outputs cannot be read back
from the GPIO data (GPDAT) register (MPC8572/MPC8536). This workaround
consists of tracking the state of GPDAT in a "shadow register" (i.e. a
software variable). The shadow register is initialized to zero.

This results in a problem w.r.t. outputs that are configured to a
high (1) state before U-Boot runs, but not touched by U-Boot itself:
Due to the zero-initialization, these GPIOs end up being set to zero,
the first time that any other output is set.

To avoid such issues initialize the GPDAT shadow register to the value
previously held by any outputs, if possible. On MPC8572/MPC8536 this
should make no difference, i.e. the shadow register should be
initialized to zero on these chips.

This patch has been tested on a MPC8314E-based board.

Reviewed-by: Sinan Akman <[email protected]>
Signed-off-by: J. Neuschäfer <[email protected]>
4 weeks agopowerpc: mpc83xx: Use defined constant for SPCR[TBEN]
J. Neuschäfer [Fri, 20 Dec 2024 10:37:53 +0000 (11:37 +0100)]
powerpc: mpc83xx: Use defined constant for SPCR[TBEN]

To increase readability, use the defined constant instead of specifying
SPCR[TBEN] as a number.

Reviewed-by: Sinan Akman <[email protected]>
Signed-off-by: J. Neuschäfer <[email protected]>
4 weeks agopowerpc: mpc83xx: Allow including initreg.h into multiple files
J. Neuschäfer [Fri, 20 Dec 2024 10:37:52 +0000 (11:37 +0100)]
powerpc: mpc83xx: Allow including initreg.h into multiple files

Globals defined in headers can result in multiple-definition errors
while linking, if they are visible beyond the current translation unit.

This hasn't been a problem for initreg.h so far, but would become a
problem in the next patch, where I use a constant from initreg.h in a
second C file.

Reviewed-by: Sinan Akman <[email protected]>
Signed-off-by: J. Neuschäfer <[email protected]>
4 weeks agopowerpc: mpc83xx: Fix timer value calculation
J. Neuschäfer [Fri, 20 Dec 2024 10:37:51 +0000 (11:37 +0100)]
powerpc: mpc83xx: Fix timer value calculation

TBU and TBL are specified as two 32-bit registers that form a 64-bit
value, but the calculation only shifted TBU by 16 bits.

Fix this by actually shifting 32 bits.

Reviewed-by: Sinan Akman <[email protected]>
Signed-off-by: J. Neuschäfer <[email protected]>
4 weeks agoMerge patch series "powerpc: Fix and enforce distinction between immediates and regis...
Tom Rini [Mon, 30 Dec 2024 21:55:11 +0000 (15:55 -0600)]
Merge patch series "powerpc: Fix and enforce distinction between immediates and registers"

J. Neuschäfer <[email protected]> says:

This patchset changes the definition r0 etc. to %r0, so that the
assembler can check that registers are only used where expected, and
fixes the fallout.

Link: https://lore.kernel.org/r/[email protected]
4 weeks agopowerpc: Introduce and enforce assembler checks on GPR usage
J. Neuschäfer [Thu, 12 Dec 2024 17:05:47 +0000 (18:05 +0100)]
powerpc: Introduce and enforce assembler checks on GPR usage

PowerPC general-purpose registers are historically specified as plain
numbers (0-31), which makes them hard to distinguish from immediates.
For this reason, include/ppc_asm.tmpl defines aliases named r0-r31.
This can still lead to uncaught mistakes if a register is used in place
of a number.

Instead of (e.g.) 5 use %r5, which will result in an assembler warning
if used as a number. Turn these warnings into errors by passing
`--fatal-warnings` to the assembler.

I verified with gazerbeam_defconfig (MPC83xx) and qemu-ppce500_defconfig
(MPC85xx) that this patch results in the same machine code.

Signed-off-by: J. Neuschäfer <[email protected]>
4 weeks agopowerpc: Fix 0 vs. r0 confusion in X/D-form instructions
J. Neuschäfer [Thu, 12 Dec 2024 17:05:46 +0000 (18:05 +0100)]
powerpc: Fix 0 vs. r0 confusion in X/D-form instructions

Instructions such as dcbi are in the X-form; they have RA and RB fields
and the effective address (EA) is computed as (RA|0)+(RB). In words,
this means that if RA is zero, the left-hand side of the addition is
zero, otherwise the corresponding GPR is used. r0 can never be used on
the left-hand side of a X-form instruction.

For D-form instructions such as addis, the Power ISA illustrates this in
the instruction pseudo-code:

if RA = 0 then RT <-        EXTS(SI || 0x0000)
else           RT <- (RA) + EXIS(SI || 0x0000)

In all of these cases, RA=0 indicates the value zero, not register r0.

I verified with gazerbeam_defconfig (MPC83xx) and qemu-ppce500_defconfig
(MPC85xx) that this patch results in the same machine code.

Signed-off-by: J. Neuschäfer <[email protected]>
4 weeks agogpio: npcm: Add persist feature to sgpio module
Jim Liu [Tue, 10 Dec 2024 06:35:05 +0000 (14:35 +0800)]
gpio: npcm: Add persist feature to sgpio module

Base on GPIO hog to support sgpio persist enable feature.

Signed-off-by: Jim Liu <[email protected]>
4 weeks agoconfigs: arbel_evb: enable arbel feature
Jim Liu [Wed, 20 Nov 2024 01:21:54 +0000 (09:21 +0800)]
configs: arbel_evb: enable arbel feature

Enable GPIO_HOG, net, WDT feature for Arbel EVB.

Signed-off-by: Jim Liu <[email protected]>
4 weeks agoMerge patch series "Cleanup the LMB subsystem"
Tom Rini [Mon, 30 Dec 2024 19:22:15 +0000 (13:22 -0600)]
Merge patch series "Cleanup the LMB subsystem"

Ilias Apalodimas <[email protected]> says:

The LMB subsystem was used opportunistically for a number of years.
A while back Sughosh merged it with the EFI subsystem in order to have a
common allocator and avoid subsystems overwriting memory they shouldn't.

This is an initial cleanup of all the crud we gathered over the years.
There's no functional change expected from the patches as they just cleanup
some abstraction functions and rename a few variables to make more
sense.

I plan to make even bigger changes -- e.g I don't see the point of
having *_alloc() and *_reserve() versions of the functions since they
do the same thing and just cause confusion. lmb_alloc_addr_flags()
returning the base address on success makes little sense since we
already *request* the address on the function arguments, etc.
Since this patchset grew enough already, I'd like to get it in
before more refactoring happens.

It's worth noting that although some patches slightly increase the code
size due to an extra flags argument being carried around, the final
result is eventually smaller.

# qemu_arm64_lwip_defconfig (version string adds another 20b)
add/remove: 0/5 grow/shrink: 15/1 up/down: 568/-628 (-60)
Function                                     old     new   delta
lmb_alloc_base                                80     324    +244
lmb_alloc_addr                                 8     144    +136
lmb_reserve                                    8      96     +88
version_string                                50      70     +20
boot_relocate_fdt                            488     508     +20
boot_ramdisk_high                            268     284     +16
lmb_add_region_flags                         696     704      +8
boot_fdt_reserve_region                      100     108      +8
load_serial                                  548     552      +4
lmb_alloc                                      8      12      +4
image_setup_libfdt                           368     372      +4
do_load                                      728     732      +4
do_bootz                                     332     336      +4
do_booti                                     520     524      +4
bootm_run_states                            2176    2180      +4
lmb_alloc_addr_flags                           4       -      -4
boot_fdt_add_mem_rsv_regions                 284     280      -4
lmb_alloc_base_flags                          76       -     -76
lmb_reserve_flags                             96       -     -96
_lmb_alloc_addr                              144       -    -144
_lmb_alloc_base                              304       -    -304
Total: Before=1020102, After=1020042, chg -0.01%

# sandbox_defconfig (version string adds another 20b)
add/remove: 0/3 grow/shrink: 24/3 up/down: 523/-501 (22)
Function                                     old     new   delta
lmb_alloc_base                                48     299    +251
lmb_alloc_addr                                 4      92     +88
lmb_reserve                                    4      58     +54
test_alloc_addr                             2933    2963     +30
version_string                                50      70     +20
lib_test_lmb_overlapping_reserve            1018    1030     +12
lmb_add_region_flags                         600     610     +10
test_multi_alloc.constprop                  3034    3042      +8
test_get_unreserved_size                    1032    1038      +6
boot_relocate_fdt                            599     605      +6
boot_fdt_reserve_region                       67      73      +6
lmb_alloc                                      4       9      +5
lmb_free_flags                               190     194      +4
wget_handler                                1530    1533      +3
tftp_handler                                1190    1192      +2
test_noreserved                             1207    1209      +2
test_bigblock                                911     913      +2
load_serial                                  946     948      +2
lib_test_lmb_flags                          2101    2103      +2
do_spi_flash                                3150    3152      +2
do_bootz                                     526     528      +2
do_bootm_linux                              2067    2069      +2
bootm_run_states                            5275    5277      +2
_fs_read.lto_priv                            331     333      +2
lmb_dump_region.lto_priv                     356     353      -3
lmb_add                                       59      52      -7
efi_allocate_pages.part                      303     249     -54
lmb_reserve_flags                             65       -     -65
_lmb_alloc_addr.lto_priv                      92       -     -92
_lmb_alloc_base.lto_priv                     280       -    -280
Total: Before=2492722, After=2492744, chg +0.00%

Link: https://lore.kernel.org/r/[email protected]
4 weeks agolmb: Rename _lmb_alloc_addr() to lmb_alloc_addr_flags()
Ilias Apalodimas [Wed, 18 Dec 2024 07:02:37 +0000 (09:02 +0200)]
lmb: Rename _lmb_alloc_addr() to lmb_alloc_addr_flags()

lmb_alloc_addr_flags() is a wrapper for _lmb_alloc_addr() and it's the
only function using it. Rename _lmb_alloc_addr() to lmb_alloc_addr_flags()
and remove the wrapper.

Reviewed-by: Sam Protsenko <[email protected]>
Tested-by: Sam Protsenko <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
4 weeks agolmb: Remove lmb_alloc_base_flags()
Ilias Apalodimas [Wed, 18 Dec 2024 07:02:36 +0000 (09:02 +0200)]
lmb: Remove lmb_alloc_base_flags()

lmb_alloc_base() is just calling lmb_alloc_base_flags() with LMB_NONE.
There's not much we gain from this abstraction, so let's remove the
former add the flags argument to lmb_alloc_base() and make the code
a bit easier to follow.

Reviewed-by: Sam Protsenko <[email protected]>
Tested-by: Sam Protsenko <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
4 weeks agolmb: Remove lmb_alloc_addr_flags()
Ilias Apalodimas [Wed, 18 Dec 2024 07:02:35 +0000 (09:02 +0200)]
lmb: Remove lmb_alloc_addr_flags()

lmb_alloc_addr() is just calling lmb_alloc_addr_flags() with LMB_NONE
There's not much we gain from this abstraction, so let's remove the
latter, add a flags argument to lmb_alloc_addr() and make the code a
bit easier to follow.

Reviewed-by: Sam Protsenko <[email protected]>
Tested-by: Sam Protsenko <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
4 weeks agolmb: Remove lmb_add_region()
Ilias Apalodimas [Wed, 18 Dec 2024 07:02:34 +0000 (09:02 +0200)]
lmb: Remove lmb_add_region()

There's no point defining a function that's called only once just to
avoid passing the flags. Remove the wrapper and just call
lmb_add_region_flags().

Acked-by: Sughosh Ganu <[email protected]>
Reviewed-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Sam Protsenko <[email protected]>
Tested-by: Sam Protsenko <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
4 weeks agolmb: Rename free_mem to available_mem
Ilias Apalodimas [Wed, 18 Dec 2024 07:02:33 +0000 (09:02 +0200)]
lmb: Rename free_mem to available_mem

free_mem is a misnomer. We never update it with the free memory for
LMB. Instead, it describes all available memory and is checked against
used_mem to decide whether an area is free or not.

So let's rename this field to better match its usage.

Reviewed-by: Sam Protsenko <[email protected]>
Tested-by: Sam Protsenko <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
4 weeks agolmb: Remove lmb_reserve_flags()
Ilias Apalodimas [Wed, 18 Dec 2024 07:02:32 +0000 (09:02 +0200)]
lmb: Remove lmb_reserve_flags()

lmb_reserve() is just calling lmb_reserve_flags() with LMB_NONE.
There's not much we gain from this abstraction.
So let's remove the latter, add the flags argument to lmb_reserve()
and make the code a bit easier to follow.

Reviewed-by: Tom Rini <[email protected]>
Reviewed-by: Sam Protsenko <[email protected]>
Tested-by: Sam Protsenko <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
4 weeks agolmb: Move enum lmb_flags to a u32
Ilias Apalodimas [Wed, 18 Dec 2024 07:02:31 +0000 (09:02 +0200)]
lmb: Move enum lmb_flags to a u32

LMB flags is not an enum anymore. It's currently used as a bitmask
in various places of our code. So make it a u32 which is more
appropriate when dealing with masks.

Reviewed-by: Sam Protsenko <[email protected]>
Tested-by: Sam Protsenko <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
4 weeks agolmb: Remove lmb_align_down()
Ilias Apalodimas [Wed, 18 Dec 2024 07:02:30 +0000 (09:02 +0200)]
lmb: Remove lmb_align_down()

We already have a macro for this. Use it instead of adding yet another
variant for alignment.

Reviewed-by: Sam Protsenko <[email protected]>
Tested-by: Sam Protsenko <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
4 weeks agoMerge patch series "lmb: Improve style"
Tom Rini [Mon, 30 Dec 2024 19:20:33 +0000 (13:20 -0600)]
Merge patch series "lmb: Improve style"

Sam Protsenko <[email protected]> says:

Cleanup the LMB code a bit, after fixing the false positive error
messages. No functional change. This series depends on [1] (which is
"lmb: Fix reserving the same region multiple times").

Link: https://lore.kernel.org/r/[email protected]
4 weeks agolmb: Improve kernel-doc comments
Sam Protsenko [Wed, 11 Dec 2024 02:25:50 +0000 (20:25 -0600)]
lmb: Improve kernel-doc comments

Fix warnings from kernel-doc script. Improve and unify overall style of
kernel-doc comments in lmb source files. Move all kernel-doc comments
for public functions into the header, as recommended in U-Boot
documentation [1]:

    Non-trivial functions should have a comment which describes what
    they do. If it is an exported function, put the comment in the
    header file so the API is in one place. If it is a static function,
    put it in the C file.

This also takes care of existing duplication. While at it, do a bit of
cosmetic cleanups as well.

No functional change.

[1] doc/develop/codingstyle.rst

Signed-off-by: Sam Protsenko <[email protected]>
Acked-by: Ilias Apalodimas <[email protected]>
4 weeks agolmb: Improve coding style
Sam Protsenko [Wed, 11 Dec 2024 02:25:49 +0000 (20:25 -0600)]
lmb: Improve coding style

Fix checkpatch warnings. No functional change.

Signed-off-by: Sam Protsenko <[email protected]>
Acked-by: Ilias Apalodimas <[email protected]>
4 weeks agolmb: Make const flag_str[] in lmb_print_region_flags() more const
Sam Protsenko [Wed, 11 Dec 2024 02:25:48 +0000 (20:25 -0600)]
lmb: Make const flag_str[] in lmb_print_region_flags() more const

flag_str[] is a pointer to const. Make it also a const pointer. Improve
a style a bit while a it, to make this line fit 80 characters limit.

No functional change.

Signed-off-by: Sam Protsenko <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
4 weeks agolmb: Fix flags data type in lmb_add_region_flags()
Sam Protsenko [Wed, 11 Dec 2024 02:25:47 +0000 (20:25 -0600)]
lmb: Fix flags data type in lmb_add_region_flags()

rgnflags variable in lmb_add_region_flags() has incorrect type: it's
declared as phys_size_t when it should be enum lmb_flags. That
copy-paste mistake was firstly introduced in commit 59c0ea5df33f ("lmb:
Add support of flags for no-map properties"), and then copied further
into commit ed17a33fed29 ("lmb: make LMB memory map persistent and
global"). Fix it by using the correct type to match struct lmb_region
field.

No functional change.

Signed-off-by: Sam Protsenko <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
Acked-by: Sughosh Ganu <[email protected]>
4 weeks agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next
Tom Rini [Mon, 30 Dec 2024 18:55:39 +0000 (12:55 -0600)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

4 weeks agomtd: spi-nor: Fix the spi_nor_read() when config SPI_STACKED_PARALLEL is enabled
Venkatesh Yadav Abbarapu [Mon, 30 Dec 2024 07:02:06 +0000 (12:32 +0530)]
mtd: spi-nor: Fix the spi_nor_read() when config SPI_STACKED_PARALLEL is enabled

Update the spi_nor_read() function based on the config SPI_FLASH_BAR
and update the length and bank calculation by spliting the memory of
16MB size banks only when the address width is 3byte.
Fix the read issue for 4byte address width by passing the entire
length to the read function.

Fixes: 5d40b3d384 ("mtd: spi-nor: Add parallel and stacked memories support")
Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]>
4 weeks agonet: rswitch: Implement C22 to C45 access
Marek Vasut [Fri, 20 Dec 2024 00:48:42 +0000 (01:48 +0100)]
net: rswitch: Implement C22 to C45 access

Add support for mapping C22 register access to C45-only PHYs.
This is mainly useful for 'mii info' command, which performs
C22 only access to determine PHY ID and link state and does
not work well with this driver so far.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agonet: rswitch: Add PHY C22 access support
Marek Vasut [Fri, 20 Dec 2024 00:48:41 +0000 (01:48 +0100)]
net: rswitch: Add PHY C22 access support

Implement C22 PHY access support in addition to C45 PHY access
support which is already present. This is used for PHYs which
do not support C45 access or which are C22 only.

The C22 access can be recognized when devad is set to -1 or
0xffffffff hex, which also matches MDIO_DEVAD_NONE macro. Test
for this special devad value and if it is set this way, perform
C22 access, otherwise perform C45 access.

Based on work by LUU HOAI <[email protected]>

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agonet: rswitch: Fold MPSM C45 setting into rswitch_mii_access_c45()
Marek Vasut [Fri, 20 Dec 2024 00:48:40 +0000 (01:48 +0100)]
net: rswitch: Fold MPSM C45 setting into rswitch_mii_access_c45()

The Set Station Management Mode : Clause 45 setting of MFF bit in MPSM
register can be done in rswitch_mii_access_c45() once, instead of this
being done before each rswitch_mii_access_c45() call. Deduplicate the
bit setting into rswitch_mii_access_c45(). No functional change.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agonet: rswitch: Simplify code using clrsetbits_le32()
Marek Vasut [Thu, 19 Dec 2024 21:21:42 +0000 (22:21 +0100)]
net: rswitch: Simplify code using clrsetbits_le32()

Use clrsetbits_le32() to make this complicated construct simpler.
No functional change.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agonet: rswitch: Fix up macro indent
Marek Vasut [Sun, 15 Dec 2024 23:57:50 +0000 (00:57 +0100)]
net: rswitch: Fix up macro indent

Update the macro indent, replace multiple spaces with tabs proper.
No functional change.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agonet: rswitch: Replace enum rswitch_reg with plain macros
Marek Vasut [Sun, 15 Dec 2024 23:57:49 +0000 (00:57 +0100)]
net: rswitch: Replace enum rswitch_reg with plain macros

Replace enum rswitch_reg with plain #define REGISTER OFFSET macros.
The enum rswitch_reg was not referenced anywhere, so there was no
benefit of keeping it around. Include register block labels. Turn
all register offsets into lowercase hex values. No functional change.

Rename EATDQDC to EATDQDCR, GWTRC to GWTRCR, GWDCC to GWDCCR, FWPC0
to FWPC, FWPBFC to FWPBFCR, FWPBFCSDC to FWPBFCSDCR because there
are both register names which used to be part of this enum and also
macros with the same name, each used for slightly different purpose.
Make sure there is no collission.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoarm64: renesas: Enable CR52 remoteproc on R-Car R8A779G0 V4H
Marek Vasut [Fri, 20 Dec 2024 00:02:16 +0000 (01:02 +0100)]
arm64: renesas: Enable CR52 remoteproc on R-Car R8A779G0 V4H

Enable remoteproc command and APMU remoteproc driver to start Cortex-R52
cores from U-Boot command line. Code on the Cortex-R52 #0 can be started
as follows, code on other cores can be started by passing the correct ID
to 'rproc load' and 'rproc start' to select the core:

"
=> rproc init
=> rproc list
0 - Name:'rcar-apmu-cr52.0-apmu@e6170000' type:'internal memory mapped' supports: load start stop reset is_running
1 - Name:'rcar-apmu-cr52.1-apmu@e6170000' type:'internal memory mapped' supports: load start stop reset is_running
2 - Name:'rcar-apmu-cr52.2-apmu@e6170000' type:'internal memory mapped' supports: load start stop reset is_running
=> rproc load 0 0xeb200000 0x10000
Load Remote Processor 0 with data@addr=0xeb200000 65536 bytes: Success!
=> rproc start 0
"

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoarm64: dts: renesas: Add R8A779G0 V4H remoteproc DT node
Marek Vasut [Fri, 20 Dec 2024 00:02:15 +0000 (01:02 +0100)]
arm64: dts: renesas: Add R8A779G0 V4H remoteproc DT node

Describe APMU controller as a remoteproc device capable of starting
the Cortex-R52 cores in Renesas R8A779G0 V4H SoC DT. The APMU IP is
in fact a power management unit capable of additional operations, but
those are not used by U-Boot so far.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoremoteproc: renesas: Add Renesas R-Car Gen4 remote processor driver
Marek Vasut [Fri, 20 Dec 2024 00:02:14 +0000 (01:02 +0100)]
remoteproc: renesas: Add Renesas R-Car Gen4 remote processor driver

Add R-Car Gen4 APMU controller remoteproc driver capable of starting
the Cortex-R52 cores in Renesas R8A779G0 V4H/V4M SoC. The APMU IP is
in fact a power management unit capable of additional operations, but
those are not used by U-Boot so far.

This requires slight adjustment to the SPL entry point code, as that
is being executed on the Cortex-R52 #0 and the Cortex-R52 #0 enters an
endless loop once it starts the rest of the SPL on Cortex-A76 core.
The endless loop now checks for content of APMU CRBARP registers and
tests whether valid VLD_BARP and BAREN_VALID bits are set, if so, the
Cortex-R52 core exits the endless loop and jumps to address started
in CRBARP[31:18] register in ARM mode, which is a trampoline code to
jump to the final entry point.

The trampoline code is in place to avoid limitation of CRBARP[31:18]
address field, which limits the core start address to memory addresses
aligned to 0x40000 or 256 kiB . The trampoline is placed at 0x40000
aligned address and jumps to the final entry point, which can be at
an address with arbitrary alignment at instruction granularity.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoarm64: dts: renesas: Drop OF_UPSTREAM conversion remnant
Marek Vasut [Sat, 14 Dec 2024 22:45:52 +0000 (23:45 +0100)]
arm64: dts: renesas: Drop OF_UPSTREAM conversion remnant

This DTC_FLAGS assignment is no longer necessary as all R-Car Gen2/Gen3/Gen4
platforms have been converted to OF_UPSTREAM and matching DTC_FLAGS assignment
is present in dts/upstream/src/arm64/Makefile . Drop the remnant.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoarm64: renesas: Align configuration headers
Marek Vasut [Sat, 14 Dec 2024 22:45:11 +0000 (23:45 +0100)]
arm64: renesas: Align configuration headers

Align R-Car Gen2/Gen3/Gen4 configuration header file to look
basically the same way across these three SoC generations.
There are subtle difference between the remaining bits in
those files across SoC generations, but the common bits are
now aligned. There is not much left in those headers either,
most of the configuration is now converted to Kconfig.

Specifically for R-Car Gen3, GIC registers have been moved
to architecture specific header file rcar-gen3-base.h , the
rest of the changes here are comment changes and indentation
changes.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoarm64: renesas: Add Renesas R-Car V4H SPL implementation
Marek Vasut [Thu, 12 Dec 2024 13:38:29 +0000 (14:38 +0100)]
arm64: renesas: Add Renesas R-Car V4H SPL implementation

Add support for building U-Boot SPL for Renesas R-Car Gen4 R8A779G0 V4H SoC.
The SPL initializes the DBSC5 DRAM controller, RT-VRAM and loads and starts
U-Boot proper on the Cortex-A76 core.

The SoC BootROM can not boot the CA76 core directly, instead the SPL starts
on the CR52 core which immediately brings up the CA76 core, which in turn
starts executing the actual SPL. This is achieved by placing a tiny bit of
precompiled Aarch32 code at the very beginning of the SPL. The code consists
of some 32 instructions, uses APMU to configure CA76 start address to offset
0x80 Bytes from start of the SPL, and uses APMU to start the CA76 core. The
code parts the CR52 core in an endless loop once the CA76 core got started.

The 32 instructions are completely arbitrary number, so is the offset 0x80
Bytes from start of SPL, because 0x80 = 128 decimal and 128 / 4 bytes per
instruction is 32 instructions. The 32 instructions turned out to be enough
to started the CA76 and 0x80 is nicely aligned.

Once the SPL completes hardware initialization, the SPL loads U-Boot proper.
The u-boot.itb proper fitImage contains 64bit build on u-boot-nodtb.bin and
a DT for R8A779G0 V4H White Hawk board and is generated by binman. The
u-boot.itb is loaded from SPI NOR offset 0x80000.

In order to install this setup on an existing R8A779G0 V4H White Hawk board,
build using r8a779g0_whitehawk_defconfig, generate SPI NOR image flash.bin
and write flash.bin to SPI NOR offset 0x0 . Finally, configure board MD pin
switches according to the R8A779G0 V4H White Hawk board documentation for
40 MHz SPI NOR boot using DMA and restart the board.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoarm64: renesas: Make bottom 128 MiB of DRAM available in EL3
Marek Vasut [Sat, 21 Dec 2024 21:46:36 +0000 (22:46 +0100)]
arm64: renesas: Make bottom 128 MiB of DRAM available in EL3

In case U-Boot runs in EL3, which is the highest privilege level on ARM64,
there can be no firmware running that would restrict access to the bottom
128 MiB of DRAM. In fact, it is likely that U-Boot would have to load that
firmware into those bottom 128 MiB of DRAM and start that firmware.

Make those bottom 128 MiB of DRAM available in case U-Boot runs in EL3 to
allow loading the firmware to that area.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoarm64: renesas: Split R-Car Gen3 and Gen4 common board code
Marek Vasut [Thu, 12 Dec 2024 13:38:27 +0000 (14:38 +0100)]
arm64: renesas: Split R-Car Gen3 and Gen4 common board code

Split common board code for R-Car Gen3 and Gen4 into separate files.
The R-Car Gen3 board code contains fixups specific to TFA which are
no longer required on R-Car Gen4, keep those fixups in its own file
so they would not interfere with Gen4.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoarm64: renesas: Deduplicate R-Car Gen4 board files
Marek Vasut [Thu, 12 Dec 2024 13:37:34 +0000 (14:37 +0100)]
arm64: renesas: Deduplicate R-Car Gen4 board files

All R-Car Gen4 board files are copies of one another at this point.
Deduplicate them into single board/renesas/rcar-common/gen4-common.c
and remove all the duplicates. The one exception is R-Car V3U Falcon
board, which enables RWDT reset in board_init(), conditionally build
RWDT enablement in board_init() in the new common code for V3U.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoarm64: renesas: Make stub PSCI implementation available on 64bit R-Car SoCs
Marek Vasut [Thu, 12 Dec 2024 13:36:09 +0000 (14:36 +0100)]
arm64: renesas: Make stub PSCI implementation available on 64bit R-Car SoCs

Make the R-Car V3U stub PSCI implementation available on 64bit R-Car SoCs.
This implementation is useful during early board bring up, where it can
supplant missing fully-featured PSCI implementation. Note that this PSCI
implementation is very basic and offers only SoC reset functionality. It
is unable to enable or disable secondary CPU cores nor does it offer any
suspend/resume functionality.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoarm64: dts: renesas: Add R8A779G0 V4H DBSC5 and RT-VRAM DT nodes
Marek Vasut [Thu, 12 Dec 2024 13:34:31 +0000 (14:34 +0100)]
arm64: dts: renesas: Add R8A779G0 V4H DBSC5 and RT-VRAM DT nodes

Describe DBSC5 DRAM controller and RT-VRAM configuration interface
as two new DT nodes in R-Car Gen4 R8A779G0 U-Boot DT extras file.
This node is used by the U-Boot SPL for R8A779G0 SoC, where the
DBSC5 and RT-VRAM drivers bind to these nodes and bring up the
DRAM controller and RT-VRAM settings respectively, so U-Boot
proper can be loaded into DRAM and started on Cortex A76 core.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoram: renesas: Add Renesas R-Car Gen4 DBSC5 driver
Marek Vasut [Thu, 12 Dec 2024 13:34:30 +0000 (14:34 +0100)]
ram: renesas: Add Renesas R-Car Gen4 DBSC5 driver

Add Renesas R-Car Gen4 DBSC5 DRAM controller driver. This driver is currently
capable of bringing LPDDR5 DRAM on Renesas R-Car V4H Whitehawk board. Further
boards can be supported by supplying board specific DRAM configuration data
via dbsc5_get_board_data(). Support for R-Car V4M is not implemented, however
the driver is already mostly prepared to support this SoC.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agopinctrl: renesas: Convert to IS_ENABLED() macro
Marek Vasut [Sat, 14 Dec 2024 22:47:43 +0000 (23:47 +0100)]
pinctrl: renesas: Convert to IS_ENABLED() macro

Use the IS_ENABLED() macro to reduce amount of #ifdef use in the driver
and improve code coverage. With IS_ENABLED() macro, the code is compiled
and then optimized out, which prevents bitrot.

In case no PFC table matches the SoC in use, do not probe the driver
and instead exit with -ENODEV. This should never happen under normal
conditions, because this would mean the driver DT compatible string
match happened, but the list in probe() cannot match the model listed
in match data associated with the compatible string on which the match
did happen.

Signed-off-by: Marek Vasut <[email protected]>
4 weeks agoMerge patch series "net: tcp: improve tcp support in legacy stack"
Tom Rini [Sat, 28 Dec 2024 18:00:00 +0000 (12:00 -0600)]
Merge patch series "net: tcp: improve tcp support in legacy stack"

Mikhail Kshevetskiy <[email protected]> says:

Legacy TCP stack is bad. Here are some of the known issues:
 * tcp packet from other connection can break a current one
 * tcp send sequence always starts from zero
 * bad tcp options processing
 * strange assumptions on packet size for selective acknowledge
 * tcp interface assumes one of the two scenarios:
     - data downloading from remote host to a board
     - request-response exchange with a small packets
   so it's not possible to upload large amount of data from the
   board to remote host.
 * wget test generate bad tcp stream, test should fail but it passes instead

This series of patches fixes all of the above issues.

The benefits:
 * A lot of bug was fixed
 * Better and more reliable TCP state machine
 * Tcp clients becomes smaller/simpler
 * Data uploading was fixed (now it's possible to transmit a huge amount of
   data from the board to remote host)

Modification was verified with
 * firmware downloading via u-boot wget command
 * fastboot over tcp
 * netcat linux client using test netcat implementation (not included
   to this patch series)
 * Firefox/Chrome/Edge using test web-server implementation (not included
   to this patch series)

[trini: snip]
WARNING: The v16 patch series does NOT fix lib/efi_selftest/efi_selftest_http.c
issue. It looks like the efi_selftest_http test is wrong by itself. The
following issues were detected during efi_selftest_http test study:
 * The test should fail with HTTP status code 404 because:
     * nowday most web-servers requires the presence of "HOST:" request header
     * wget does not support sending "HOST:" request header
     * web-server of "http://example.com/" site does NOT provide "default server"
       configuration, so it answer 404 on any request without "HOST:" header.
 * The test states that:
     * test send HTTP HEAD request to a server,
     * then test send HTTP GET request to a server,
     * reads the actual bytes sent by the server and compare it with
       the value from "Contents-Length:" responce header of the HEAD request
   But actually it
     * does not send HTTP HEAD request, only a single HTTP GET request
       is performed
     * the test reads the responce twice from the same request. It looks
       very suspictiuos

Link: https://lore.kernel.org/r/[email protected]
4 weeks agonet/net: fix include ordering
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:37 +0000 (13:46 +0300)]
net/net: fix include ordering

fix include ordering to follow
  https://docs.u-boot.org/en/latest/develop/codingstyle.html#include-files

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agonet/tcp: define a fallback value for rcv_wnd size
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:36 +0000 (13:46 +0300)]
net/tcp: define a fallback value for rcv_wnd size

Some driver implements it's own network packet pool, so PKTBUFSRX is zero.
This results in zero-size TCP receive window, so data transfer doesn't
work. Avoid it by setting a reasonable fallback value.

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agonet/tcp: simplify tcp header filling code
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:35 +0000 (13:46 +0300)]
net/tcp: simplify tcp header filling code

This patch:
 * remove useless code,
 * use a special function for pretty printing of tcp flags,
 * simplify the code

The behavior should not be changed.

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agotest/cmd/wget: replace bogus response with an actual response from the HTTP server
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:34 +0000 (13:46 +0300)]
test/cmd/wget: replace bogus response with an actual response from the HTTP server

According to HTTP/1.0 standard the HTTP reply consist of
 * Status Line + CRLF
 * Zero or more Response Header Fields (each ended with CRLF)
 * CRLF on new line (Response Header Fields end marker)
 * Optional Entity Body.

Thus in response headers we state:
  Content-Length = 30
but actual transferred file data is:
  "\r\n<html><body>Hi</body></html>\r\n".
This is 32 bytes of data.

So we get and check for correctness 32 bytes of data, but
 * The response we are used is incorrect, real server will
   set Content-Length to 32.
 * default_wget_info->hdr_cont_len will be set to wrong
   value 30 (used for efi http booting).

Fix an issue by:
 * replace bogus response with an actual response from the HTTP server
 * format response to show HTTP response structure
 * recalculate md5sum as transferred file data has been changed.

The server response was captured with the commands

  echo -ne "<html><body>Hi</body></html>\n" > ~/public_html/test.html
  echo -ne "GET /~${USER}/test.html HTTP/1.0\r\n\r\n" | netcat localhost 80 >reply.txt

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
4 weeks agotest/cmd/wget: fix the test
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:33 +0000 (13:46 +0300)]
test/cmd/wget: fix the test

Changes:
 * update to new tcp stack
 * fix zero values for ISS and IRS issue (see RFC 9293)

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agonet/tcp: improve tcp framework, use better state machine
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:32 +0000 (13:46 +0300)]
net/tcp: improve tcp framework, use better state machine

Changes:
 * Fix initial send sequence always zero issue
 * Use state machine close to RFC 9293. This should make TCP
   transfers more reliable (now we can upload a huge array
   of data from the board to external server)
 * Improve TCP framework a lot. This should make tcp client
   code much more simple.
 * rewrite wget with new tcp stack
 * rewrite fastboot_tcp with new tcp stack

It's quite hard to fix the initial send sequence (ISS) issue
with the separate patch. A naive attempt to fix an issue
inside the tcp_set_tcp_header() function will break tcp packet
retransmit logic in wget and other clients.

Example:
  Wget stores tcp_seq_num value before tcp_set_tcp_header() will
  be called and (on failure) retransmit the packet with the stored
  tcp_seq_num value. Thus:
    * the same ISS must allways be used (current case)
    * or tcp clients needs to generate a proper ISS when
      required.

A proper ISS fix will require a big redesing comparable with
a this one.

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agonet/tcp: rename ack_edge and seq_init to more common rcv_nxt and irs
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:31 +0000 (13:46 +0300)]
net/tcp: rename ack_edge and seq_init to more common rcv_nxt and irs

Use the names from RFC 9293

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agonet/tcp: add connection info to tcp_stream structure
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:30 +0000 (13:46 +0300)]
net/tcp: add connection info to tcp_stream structure

Changes:
 * Avoid use net_server_ip in tcp code, use tcp_stream data instead
 * Ignore packets from other connections if connection already created.
   This prevents us from connection break caused by other tcp stream.

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agonet/tcp: put connection specific data into a tcp_stream structure
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:29 +0000 (13:46 +0300)]
net/tcp: put connection specific data into a tcp_stream structure

no functional changes

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agonet/tcp: fix selective acknowledge
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:28 +0000 (13:46 +0300)]
net/tcp: fix selective acknowledge

Current code assume that all (except last) packets are of the same size.
This is definitely wrong. Replace SACK code with a new one, that does
not rely on this assumption. Also this code uses less memory.

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agonet/tcp: fix TCP options processing
Mikhail Kshevetskiy [Sat, 28 Dec 2024 10:46:27 +0000 (13:46 +0300)]
net/tcp: fix TCP options processing

Current TCP code may miss an option if TCP_O_NOP option was used before
it for proper aligning.

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
4 weeks agoMerge patch series "vbe: Series part E"
Tom Rini [Fri, 27 Dec 2024 21:16:39 +0000 (15:16 -0600)]
Merge patch series "vbe: Series part E"

Simon Glass <[email protected]> says:

This includes various patches towards implementing the VBE abrec
bootmeth in U-Boot. It mostly focuses on SPL tweaks and adjusting what
fatures are available in VPL.

Link: https://lore.kernel.org/r/[email protected]
4 weeks agohash: Plumb crc8 into the hash functions
Simon Glass [Thu, 19 Dec 2024 18:29:07 +0000 (11:29 -0700)]
hash: Plumb crc8 into the hash functions

Add an entry for crc8, with watchdog handling.

Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Jaehoon Chung <[email protected]>
4 weeks agoboot: Imply CRC8 with VBE
Simon Glass [Thu, 19 Dec 2024 18:29:06 +0000 (11:29 -0700)]
boot: Imply CRC8 with VBE

VBE uses a crc8 checksum to verify that the nvdata is valid, so make
sure it is available if VBE is enabled.

Signed-off-by: Simon Glass <[email protected]>
4 weeks agolib: Allow crc8 in TPL and VPL
Simon Glass [Thu, 19 Dec 2024 18:29:05 +0000 (11:29 -0700)]
lib: Allow crc8 in TPL and VPL

Provide options to enable the CRC8 feature in TPL and VPL builds.

Signed-off-by: Simon Glass <[email protected]>
4 weeks agoboot: Allow use of FIT in TPL and VPL
Simon Glass [Thu, 19 Dec 2024 18:29:04 +0000 (11:29 -0700)]
boot: Allow use of FIT in TPL and VPL

With VBE we want to use FIT in all phases of the boot. Add Kconfig
options to support this.

Disable the options for sandbox_vpl for now.

Signed-off-by: Simon Glass <[email protected]>
4 weeks agospl: lib: Allow for decompression in any SPL build
Simon Glass [Thu, 19 Dec 2024 18:29:03 +0000 (11:29 -0700)]
spl: lib: Allow for decompression in any SPL build

Add Kconfig symbols and update the Makefile rules so that decompression
can be used in TPL and VPL

Signed-off-by: Simon Glass <[email protected]>
4 weeks agospl: Add some more debugging to load_simple_fit()
Simon Glass [Thu, 19 Dec 2024 18:29:02 +0000 (11:29 -0700)]
spl: Add some more debugging to load_simple_fit()

Add debugging of image-loading progress. Fix a stale comment in the
function comment while we are here.

Signed-off-by: Simon Glass <[email protected]>
4 weeks agospl: Drop a duplicate variable in boot_from_devices()
Simon Glass [Thu, 19 Dec 2024 18:29:01 +0000 (11:29 -0700)]
spl: Drop a duplicate variable in boot_from_devices()

The variable 'ret' is defined twice, which is not intended. This may
have been a local merge error.

Signed-off-by: Simon Glass <[email protected]>
Fixes: 2eefeb6d893 ("spl: Report a loader failure")
4 weeks agospl: Drop use of uintptr_t
Simon Glass [Thu, 19 Dec 2024 18:29:00 +0000 (11:29 -0700)]
spl: Drop use of uintptr_t

U-Boot uses ulong for addresses. It is confusing to use uintptr_t in a
few places, since it makes people wonder if the types are compatible.
Change the few occurences in SPL to use ulong

Signed-off-by: Simon Glass <[email protected]>
4 weeks agospl: Support a relocated stack in any XPL phase
Simon Glass [Thu, 19 Dec 2024 18:28:59 +0000 (11:28 -0700)]
spl: Support a relocated stack in any XPL phase

The current check looks only at SPL, but TPL or VPL might have a
different setting. Update the condition.

Signed-off-by: Simon Glass <[email protected]>
4 weeks agospl: Allow serial to be disabled in any XPL phase
Simon Glass [Thu, 19 Dec 2024 18:28:58 +0000 (11:28 -0700)]
spl: Allow serial to be disabled in any XPL phase

The current check looks only at SPL, but TPL or VPL might have a
different setting. Update the condition.

Signed-off-by: Simon Glass <[email protected]>
This page took 0.133969 seconds and 4 git commands to generate.