Commit graph

97119 commits

Author SHA1 Message Date
Jerome Forissier
788b4609db trace: proftool: dump-ftrace should write funcgraph times in ns not us
When converting a U-Boot trace records file to ftrace function graph
format for use by trace-cmd ('proftool -f funcgraph dump-ftrace'), the
time associated to each function is incorrectly saved in microseconds
instead of nanoseconds. Multuply the value by 1000 to fix the issue.

With this change, the trace-cmd output looks consistent. Here is an
example with udelay(25) added to mem_malloc_init() as a test case:

 $ ./tools/proftool -m System.map -t /tmp/trace.bin -f funcgraph \
                    dump-ftrace -o /tmp/trace.dat
 $ trace-cmd report  /tmp/trace.dat >/tmp/trace.log
 $ vi /tmp/trace.log
 [...]
 u-boot-1     [000]     6.719659: funcgraph_entry:                   |    mem_malloc_init() {
 u-boot-1     [000]     6.719659: funcgraph_entry:                   |      udelay() {
 u-boot-1     [000]     6.719660: funcgraph_entry:                   |        schedule() {
 u-boot-1     [000]     6.719660: funcgraph_entry:                   |          cyclic_run() {
 u-boot-1     [000]     6.719660: funcgraph_entry:        1.000 us   |            cyclic_get_list();
 u-boot-1     [000]     6.719661: funcgraph_exit:         1.000 us   |            }
 u-boot-1     [000]     6.719661: funcgraph_exit:         1.000 us   |          }
 u-boot-1     [000]     6.719661: funcgraph_entry:                   |        __udelay() {
 u-boot-1     [000]     6.719662: funcgraph_entry:        0.000 us   |          usec_to_tick();
 u-boot-1     [000]     6.719687: funcgraph_exit:       + 26.000 us  |          }
 u-boot-1     [000]     6.719687: funcgraph_exit:       + 28.000 us  |        }
 u-boot-1     [000]     6.719687: funcgraph_entry:      # 37971.000 us |      memset();
 u-boot-1     [000]     6.757658: funcgraph_exit:       # 37999.000 us |      }
 u-boot-1     [000]     6.757658: funcgraph_exit:       # 38000.000 us |    }

In the above dump, the udelay() call is reported as taking 26 us which
is consistent with the timestamps (6.719687 - 6.719659 = 0.000026).
Without this patch we would have "0.026 us" instead of "+ 26.000 us".

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-31 19:00:37 -06:00
Tom Rini
43cae09eab Merge patch series "Fix OSPI boot for J722S"
Prasanth Babu Mantena <p-mantena@ti.com> 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/20241218131341.2073823-1-p-mantena@ti.com
2024-12-31 17:55:03 -06:00
Udit Kumar
d4749f55f2 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 <u-kumar1@ti.com>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
2024-12-31 17:55:02 -06:00
Manorit Chawdhry
998e00cfce 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 <vigneshr@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2024-12-31 17:55:02 -06:00
Bryan Brattlof
8fa355d822 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 <bb@ti.com>
2024-12-31 17:55:02 -06:00
Vaishnav Achath
1c4eeff48c 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 <vaishnav.a@ti.com>
Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
2024-12-31 15:24:26 -06:00
Vaishnav Achath
ed89c75771 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 <vaishnav.a@ti.com>
Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
2024-12-31 15:24:26 -06:00
Vaishnav Achath
e259004382 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: fc2da3a3d0 ("arm: dts: Introduce J722S U-Boot dts files")
Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
2024-12-31 15:24:26 -06:00
Vaishnav Achath
f5da5b1db7 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 <vaishnav.a@ti.com>
Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
2024-12-31 15:24:26 -06:00
Tom Rini
9df4458918 Merge patch series "Cumulative fixes and updates for MediaTek ethernet driver"
Weijie Gao <weijie.gao@mediatek.com> says:

This patch series contains fixes and updates for mtk_eth driver.

Link: https://lore.kernel.org/r/cover.1734406967.git.weijie.gao@mediatek.com
2024-12-31 10:59:06 -06:00
Weijie Gao
c949686e55 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 <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
b9dfb5636b 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 <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
5ac929fd1a 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 <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
ad0c47109e net: mediatek: add support for 10GBASE-R
This patch adds support for 10GBASE-R interface mode

Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
d8d7e56654 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 <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
82f05bc488 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 <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
7562da9454 net: mediatek: correct register name of ethsys syscfg1
The SYSCFG0 should be SYSCFG1 according to the programming guide.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
0d4d8e6f47 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 <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
ba365c3d23 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 <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
6e45549f4d 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 <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Tom Rini
f4e8711965 Merge patch series "Select CONFIG_64BIT for sandbox64 and x86_64"
Andrew Goodbody <andrew.goodbody@linaro.org> 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/20241216180736.1933807-1-andrew.goodbody@linaro.org
2024-12-31 10:58:36 -06:00
Andrew Goodbody
43ca65b305 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 <sjg@chromium.org>
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2024-12-31 10:58:30 -06:00
Andrew Goodbody
99145eec2d 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 <dan.carpenter@linaro.org>
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2024-12-31 10:58:30 -06:00
Andrew Goodbody
bcb9b3524a 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 <sjg@chromium.org>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2024-12-31 10:58:30 -06:00
Andrew Goodbody
99afa58e6d 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 <sjg@chromium.org>
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2024-12-31 10:58:30 -06:00
Tom Rini
6c76f67ac5 Merge patch series "Keep the access to dtb_dt_embedded() within fdtdec"
Evgeny Bachinin <EABachinin@salutedevices.com> 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
2024-12-31 10:57:54 -06:00
Evgeny Bachinin
e2f0e9a320 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 <EABachinin@salutedevices.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-12-31 10:57:50 -06:00
Evgeny Bachinin
623f5cf517 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 <EABachinin@salutedevices.com>
Suggested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-12-31 10:57:50 -06:00
Tom Rini
c6fd2a1c29 Prepare v2025.01-rc6
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmdzbjIACgkQFHw5/5Y0
 tyxMlQv+J4Lg70J+a+uwMi6pnx1GTfJ/9RGUWmM94HyfN19TTqSR54oGRc5CT12V
 LlxuWwI7xsIgWnTeSDIcXhAeQ/D7E7X8Hwd0fjE2Vezz/sGlFG2zPl61cbqBlABO
 +27MBu8Eq+hd9IuC068AO6JICyayOOoyKF71JtLHhFqPX2EDgNTrfatZEM6+tRsr
 sfnxNZOlPQJjdifEUYajejh+MTLqD5tbnMmlNv/CJMApYzkW5GPnIV9d5Ctndtum
 vVlRAkxHYLTCu9qyVgU3IaUWP62O2wVwuYINt1XA5pelOCZaa821y6PEPablYMo0
 7yNuQyIxqzAU5F1ZFySNSmW6IvSTksgen+0iUDsCR+0YBWI+teii39bDbwnwzlHB
 s0wgcepy4QItkAHtUQ0L5pCbLzQ0dKWFNW/NkIusfa0AKhN2jzcBgvYzPNomrglN
 yV+r9pCDUK27C7Bmmjf0Uv7tZrwkjaYnfcpE4gzYPPSEqG1AClTQ+S1WWmzXeWYX
 MTxT2ScO
 =j4Pi
 -----END PGP SIGNATURE-----

Merge tag 'v2025.01-rc6' into next

Prepare v2025.01-rc6
2024-12-31 08:08:59 -06:00
Tom Rini
4be4046075 Prepare v2025.01-rc6
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-12-30 22:07:58 -06:00
Tom Rini
08a915719f Gitlab: Remove some "rules:when: always" lines
In commit 399f739be6 ("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 <trini@konsulko.com>
2024-12-30 16:01:05 -06:00
Tom Rini
08c1e15195 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 <trini@konsulko.com>
2024-12-30 15:59:04 -06:00
Simon Glass
8428e15dc9 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 <sjg@chromium.org>
2024-12-30 15:56:29 -06:00
Tom Rini
ad09ccf7fe Merge patch series "Misc. PowerPC MPC83xx fixes/cleanups"
J. Neuschäfer <j.ne@posteo.net> says:

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

Link: https://lore.kernel.org/r/20241220-mpc83xx-misc-v2-0-ff4c17ee5fa4@posteo.net
2024-12-30 15:55:33 -06:00
J. Neuschäfer
8803745428 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 <sinan@writeme.com>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2024-12-30 15:55:27 -06:00
J. Neuschäfer
ba26b1d0fb 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 <sinan@writeme.com>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2024-12-30 15:55:27 -06:00
J. Neuschäfer
b3e8c67a91 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 <sinan@writeme.com>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2024-12-30 15:55:27 -06:00
J. Neuschäfer
deb26b6c29 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 <sinan@writeme.com>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2024-12-30 15:55:27 -06:00
Tom Rini
c379590ab7 Merge patch series "powerpc: Fix and enforce distinction between immediates and registers"
J. Neuschäfer <j.ne@posteo.net> 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/20241212-gpr-checks-v1-0-8c084c5fc0b6@posteo.net
2024-12-30 15:55:11 -06:00
J. Neuschäfer
c3e425ead4 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 <j.ne@posteo.net>
2024-12-30 15:55:07 -06:00
J. Neuschäfer
fd1c2938c0 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 <j.ne@posteo.net>
2024-12-30 15:55:07 -06:00
Jim Liu
787d389350 gpio: npcm: Add persist feature to sgpio module
Base on GPIO hog to support sgpio persist enable feature.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2024-12-30 15:55:01 -06:00
Jim Liu
3437624b2e configs: arbel_evb: enable arbel feature
Enable GPIO_HOG, net, WDT feature for Arbel EVB.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2024-12-30 15:54:53 -06:00
Tom Rini
a3d3d869b6 Merge patch series "Cleanup the LMB subsystem"
Ilias Apalodimas <ilias.apalodimas@linaro.org> 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/20241218070251.686383-1-ilias.apalodimas@linaro.org
2024-12-30 13:22:15 -06:00
Ilias Apalodimas
1a25191bc1 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 <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-30 13:21:55 -06:00
Ilias Apalodimas
3075708017 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 <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-30 13:21:55 -06:00
Ilias Apalodimas
15e0c5e390 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 <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-30 13:21:55 -06:00
Ilias Apalodimas
c207d6e3e3 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 <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-30 13:21:55 -06:00
Ilias Apalodimas
400c34db89 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 <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-30 13:21:55 -06:00
Ilias Apalodimas
900a8951c3 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 <trini@konsulko.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-30 13:21:55 -06:00