]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
2 months agoclk: imx8mp: Add i.MX8MP Dummy clk
Peng Fan [Sat, 12 Oct 2024 09:34:10 +0000 (17:34 +0800)]
clk: imx8mp: Add i.MX8MP Dummy clk

i.MX8MP SDHC use CLK_IMX8MP_DUMMY clk entry. Without the clk, the bulk
api will return failure.

The correct entry should be replaced with IMX8MP_IPG_ROOT clk in device
tree. This will be done in Kernel device tree and sync to U-Boot in
future:
https://lore.kernel.org/all/20241012025221.1728438-1-peng.fan@oss.nxp.com/

Fixes: 76332fae769 ("mmc: fsl_esdhc_imx: Enable AHB/IPG clk with clk bulk API")
Reported-by: Gilles Talis <gilles.talis@nxp.com>
Tested-by: Gilles TALIS <gilles.talis@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agoarm64: imx: imx8mp-debix-model-a: Migrate to OF_UPSTREAM
Gilles Talis [Thu, 10 Oct 2024 00:42:42 +0000 (20:42 -0400)]
arm64: imx: imx8mp-debix-model-a: Migrate to OF_UPSTREAM

Device tree for this board can be deleted. Device tree location
now points to the freescale/ directory.

Use absolute path to PMIC node entry and its regulators as
device tree in kernel does not provide corresponding labels

Signed-off-by: Gilles Talis <gilles.talis@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 months agoimx8: Correct the SCU API return value check
Peng Fan [Wed, 9 Oct 2024 08:29:36 +0000 (16:29 +0800)]
imx8: Correct the SCU API return value check

The SCU API alreay has been converted to return Linux error code,
using SCU error code is not correct here, although SC_ERR_NONE is value
as 0.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agobinman: add fast authentication method for i.MX8M signing
Brian Ruley [Tue, 1 Oct 2024 13:58:09 +0000 (16:58 +0300)]
binman: add fast authentication method for i.MX8M signing

Using the PKI tree with SRKs as intermediate CA isn't necessary or even
desirable in some situations (boot time, for example). Add the possibility
to use the "fast authentication" method where the image and CSF are both
signed using the SRK [1, p.63].

[1] https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imx-processors/202591/1/CST_UG.pdf

Signed-off-by: Brian Ruley <brian.ruley@gehealthcare.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agobinman: cosmetic: refactor `nxp_imx8mcst' etype code
Brian Ruley [Tue, 1 Oct 2024 13:58:08 +0000 (16:58 +0300)]
binman: cosmetic: refactor `nxp_imx8mcst' etype code

Simplify code and conform to the style guide used in the project by
making the following changes:
* Capitalize global constants
* Use single quotes for multiline strings (except docstrings)
* Fix line width to 79 cols
* Use f-string instead of formatting a regular string or using a
  complicated concatenation
* Move common suffix used in keys to a global variable "KEY_NAME"
  to reduce the likelihood of typos and making future changes
  easier

Signed-off-by: Brian Ruley <brian.ruley@gehealthcare.com>
Cc: Marek Vasut <marex@denx.de>
2 months agoARM: imx: Update MAINTAINERS file globs for i.MX8MP DHSOM
Marek Vasut [Sun, 6 Oct 2024 23:11:10 +0000 (01:11 +0200)]
ARM: imx: Update MAINTAINERS file globs for i.MX8MP DHSOM

Update the MAINTAINERS file glob to cover all of i.MX8MP DHSOM related files.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoARM: imx: Update MAINTAINERS file globs for i.MX6 DHSOM
Marek Vasut [Sun, 6 Oct 2024 23:11:09 +0000 (01:11 +0200)]
ARM: imx: Update MAINTAINERS file globs for i.MX6 DHSOM

Update the MAINTAINERS file glob to cover all of i.MX6 DHSOM related files.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agomisc: fuse: Update fuse driver
Ye Li [Sun, 6 Oct 2024 00:30:05 +0000 (08:30 +0800)]
misc: fuse: Update fuse driver

When OSCCA is enabled, FSB fuse shadow (offset 0x8000)
access is disabled for SOC. So update the driver to read fuse
from ELE API. The ELE has supported to read all shadow fuses like
FSB, reuse the table of FSB for the word index used by ELE API.

Add ELE shadow fuse read and write to current ELE fuse driver.
But when LC is OEM closed, the ELE read/write shadow fuse APIs are
forbidden. Reading from any fuse will return error. This causes
problem to u-boot which must read out some fuse no matter whatever LC.
So we have to change back to read from FSB and ELE common fuse read API.
For using ELE shadow read API for development purpose like checking
the ELE shadow fuse write result, user can set env variable
"enable_ele_shd" to y to switch it.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agomisc: fuse: Fix FSB redundancy fuse word check and clear res
Ye Li [Sun, 6 Oct 2024 00:30:04 +0000 (08:30 +0800)]
misc: fuse: Fix FSB redundancy fuse word check and clear res

There is a bug when checking fuse word with redundancy fuse in FSB
table. The redundancy fuses are combined into 4 words, so we can't
directly use word index to do the check, otherwise the high 4 words
will fail to match.

And When calling ELE API, res parameter will pass to ELE API to get ELE
response value for failure. So most of usage does not initialize
this variable and print it after calling ELE API.
However, when ELE API returns failure, we can't ensure this res is
always set because there may be other failure like MU failure.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agomisc: ele_api: Add read/write shadow fuse APIs
Ye Li [Sun, 6 Oct 2024 00:30:03 +0000 (08:30 +0800)]
misc: ele_api: Add read/write shadow fuse APIs

Add ELE APIs to support read and write shadow fuses

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agomisc: ele_api: Update ELE read common fuse API
Peng Fan [Sun, 6 Oct 2024 00:30:02 +0000 (08:30 +0800)]
misc: ele_api: Update ELE read common fuse API

On iMX8ULP, the word index 1 is used to read OTP_UNIQ_ID with 4 words
data responsed. However this special index does not apply others.
So restrict the check to i.MX8ULP to avoid problem when reading from
fuse word 1 for others, such as i.MX93.

Also update header order

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agomisc: ele_mu: Clear RR when initialize MU
Peng Fan [Sun, 6 Oct 2024 00:22:51 +0000 (08:22 +0800)]
misc: ele_mu: Clear RR when initialize MU

When OS is doing ELE API call, before OS get the response, OS is force
reseted, then it is possible that MU RR has data during initialization
in SPL stage. So clear the RR registers, otherwise SPL ELE API call will
work abnormal.

Cc: Alice Guo <alice.guo@nxp.com>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agomisc: ele_mu: Update ELE MU to get TR/RR number from HW
Ye Li [Sun, 6 Oct 2024 00:22:50 +0000 (08:22 +0800)]
misc: ele_mu: Update ELE MU to get TR/RR number from HW

The MU parameter register can provide the TR and RR number.
For i.MX95 which has 8 RR is different with i.MX93 and i.MX8ULP,
so update the driver to read the PAR for exact TR and RR number.

Also update compatible string for i.MX95 ELE MU.

Cc: Alice Guo <alice.guo@nxp.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2 months agoMerge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"
Tom Rini [Fri, 11 Oct 2024 18:23:25 +0000 (12:23 -0600)]
Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"

Simon Glass <sjg@chromium.org> says:

When the SPL build-phase was first created it was designed to solve a
particular problem (the need to init SDRAM so that U-Boot proper could
be loaded). It has since expanded to become an important part of U-Boot,
with three phases now present: TPL, VPL and SPL

Due to this history, the term 'SPL' is used to mean both a particular
phase (the one before U-Boot proper) and all the non-proper phases.
This has become confusing.

For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL'
phases, not just SPL. So code which can only be compiled for actual SPL,
for example, must use something like this:

   #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)

In Makefiles we have similar issues. SPL_ has been used as a variable
which expands to either SPL_ or nothing, to chose between options like
CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable
was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was
updated to support 'VPL_' as well.

This series starts a change in terminology and usage to resolve the
above issues:

- The word 'xPL' is used instead of 'SPL' to mean a non-proper build
- A new CONFIG_XPL_BUILD define indicates that the current build is an
  'xPL' build
- The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now
  defined for TPL and VPL phases
- The existing SPL_ Makefile variable is renamed to SPL_
- The existing SPL_TPL Makefile variable is renamed to PHASE_

It should be noted that xpl_phase() can generally be used instead of
the above CONFIGs without a code-space or run-time penalty.

This series does not attempt to convert all of U-Boot to use this new
terminology but it makes a start. In particular, renaming spl.h and
common/spl seems like a bridge too far at this point.

The series is fully bisectable. It has also been checked to ensure there
are no code-size changes on any commit.

2 months agoqconfig: Update tool for new Makefile variables
Simon Glass [Mon, 30 Sep 2024 01:49:56 +0000 (19:49 -0600)]
qconfig: Update tool for new Makefile variables

Take account of the new XPL_ and PHASE_ instead of the old SPL_ and
SPL_TPL_

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agospl: Rename SPL_TPL_NAME and SPL_TPL_PROMPT
Simon Glass [Mon, 30 Sep 2024 01:49:55 +0000 (19:49 -0600)]
spl: Rename SPL_TPL_NAME and SPL_TPL_PROMPT

Rename these to use the word PHASE instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoglobal: Rename SPL_TPL_ to PHASE_
Simon Glass [Mon, 30 Sep 2024 01:49:54 +0000 (19:49 -0600)]
global: Rename SPL_TPL_ to PHASE_

Use PHASE_ as the symbol to select a particular XPL build. This means
that SPL_TPL_ is no-longer set.

Update the comment in bootstage to refer to this symbol, instead of
SPL_

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoglobal: Rename SPL_ to XPL_
Simon Glass [Mon, 30 Sep 2024 01:49:53 +0000 (19:49 -0600)]
global: Rename SPL_ to XPL_

Use XPL_ as the symbol to indicate an SPL build. This means that SPL_ is
no-longer set.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agokconfig: binman: Check for SPL instead of XPL
Simon Glass [Mon, 30 Sep 2024 01:49:52 +0000 (19:49 -0600)]
kconfig: binman: Check for SPL instead of XPL

Now that SPL means SPL (only) and is not defined for other phases,
update kconfig rules.

This is done in one patch since otherwise many Binman tests fail.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Define CONFIG_SPL_BUILD only for the SPL build
Simon Glass [Mon, 30 Sep 2024 01:49:51 +0000 (19:49 -0600)]
xpl: Define CONFIG_SPL_BUILD only for the SPL build

Make this define mean SPL only, not TPL, VPL, etc.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoglobal: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:50 +0000 (19:49 -0600)]
global: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD

Complete this rename for all directories outside arch/ board/ drivers/
and include/

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoinclude: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:49 +0000 (19:49 -0600)]
include: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agodrivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:48 +0000 (19:49 -0600)]
drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoboard: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:47 +0000 (19:49 -0600)]
board: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoarch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:46 +0000 (19:49 -0600)]
arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agodoc: Update init docs for the xPL changes
Simon Glass [Mon, 30 Sep 2024 01:49:45 +0000 (19:49 -0600)]
doc: Update init docs for the xPL changes

Update the documentation here to cover the meaning of xPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agodoc: Move init-related things out of README
Simon Glass [Mon, 30 Sep 2024 01:49:44 +0000 (19:49 -0600)]
doc: Move init-related things out of README

Move this section to rst, changing it just enough so that it builds.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoREADME: Drop SoC-specific comment about SPL
Simon Glass [Mon, 30 Sep 2024 01:49:43 +0000 (19:49 -0600)]
README: Drop SoC-specific comment about SPL

This should not be in the generic README file, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agodoc: Update SPL docs for the xPL changes
Simon Glass [Mon, 30 Sep 2024 01:49:42 +0000 (19:49 -0600)]
doc: Update SPL docs for the xPL changes

Update the various references to SPL in this document. Make sure to
refer to 'phases' instead of 'stages', which is not a U-Boot term.

Fix a few U-boot typos and try to improve grammar a little while we are
here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agolog: global: Rename warn_non_spl()
Simon Glass [Mon, 30 Sep 2024 01:49:41 +0000 (19:49 -0600)]
log: global: Rename warn_non_spl()

This should now refer to xPL rather than SPL, so update it throughout
the tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Rename spl_phase_prefix() and spl_phase_name()
Simon Glass [Mon, 30 Sep 2024 01:49:40 +0000 (19:49 -0600)]
xpl: Rename spl_phase_prefix() and spl_phase_name()

Use simpler names for these functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Rename spl_next_phase() and spl_prev_phase()
Simon Glass [Mon, 30 Sep 2024 01:49:39 +0000 (19:49 -0600)]
xpl: Rename spl_next_phase() and spl_prev_phase()

Rename this to use the xpl prefix.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Add a function to indicate when in xPL
Simon Glass [Mon, 30 Sep 2024 01:49:38 +0000 (19:49 -0600)]
xpl: Add a function to indicate when in xPL

Add the opposite function to not_xpl() for completeness.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Rename spl_in_proper() to not_xpl()
Simon Glass [Mon, 30 Sep 2024 01:49:37 +0000 (19:49 -0600)]
xpl: Rename spl_in_proper() to not_xpl()

Give this function a slightly easier name.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Rename spl_phase() to xpl_phase()
Simon Glass [Mon, 30 Sep 2024 01:49:36 +0000 (19:49 -0600)]
xpl: Rename spl_phase() to xpl_phase()

Rename this function to indicate that it refers to any xPL phase.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Rename spl_phase to xpl_phase_t
Simon Glass [Mon, 30 Sep 2024 01:49:35 +0000 (19:49 -0600)]
xpl: Rename spl_phase to xpl_phase_t

This name fits better with the new naming scheme, so update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Rename u_boot_first_phase to xpl_is_first_phase()
Simon Glass [Mon, 30 Sep 2024 01:49:34 +0000 (19:49 -0600)]
xpl: Rename u_boot_first_phase to xpl_is_first_phase()

This is a better name for this function, so update it.

Tidy up the function comment to mention VPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoqconfig: Add XPL_BUILD to ignored symbols
Simon Glass [Mon, 30 Sep 2024 01:49:33 +0000 (19:49 -0600)]
qconfig: Add XPL_BUILD to ignored symbols

This now appears in the code base, so add it to the list of ignored
symbols in qconfig

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoscripts: Define CONFIG_XPL_BUILD for all xPL builds
Simon Glass [Mon, 30 Sep 2024 01:49:32 +0000 (19:49 -0600)]
scripts: Define CONFIG_XPL_BUILD for all xPL builds

The new name 'xPL' is intended to indicate a build of any phase which is
not U-Boot proper. Define it for all such phases.

Note that we also define CONFIG_SPL_BUILD for all xPL builds. This
preserves existing behaviour, but future patches will adjust that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoscripts: Add some comments about autoconf.mk
Simon Glass [Mon, 30 Sep 2024 01:49:31 +0000 (19:49 -0600)]
scripts: Add some comments about autoconf.mk

Now that the conversion of all CONFIG options to Kconfig is complete,
these files only contain the xPL_BUILD defines. Add a comment to make
this clear.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoscripts: Rename Makefile.spl to Makefile.xpl
Simon Glass [Mon, 30 Sep 2024 01:49:30 +0000 (19:49 -0600)]
scripts: Rename Makefile.spl to Makefile.xpl

Rename this file to indicate that it refers to any non-U-Boot-proper
phase, not just SPL, which is the phase immediately before U-Boot
proper.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agostdio: Make use of the SERIAL define
Simon Glass [Mon, 30 Sep 2024 01:49:29 +0000 (19:49 -0600)]
stdio: Make use of the SERIAL define

This is always enabled for U-Boot proper, so simplify the condition
in the common Makefile.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agoserial: Make use of the SERIAL define
Simon Glass [Mon, 30 Sep 2024 01:49:28 +0000 (19:49 -0600)]
serial: Make use of the SERIAL define

This is always enabled for U-Boot proper, so simplify the condition
in the common Makefile.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agonet: freescale: Drop use of SPL_BUILD dependency
Simon Glass [Mon, 30 Sep 2024 01:49:27 +0000 (19:49 -0600)]
net: freescale: Drop use of SPL_BUILD dependency

SPL_BUILD is not a Kconfig symbol. Perhaps the intent here is to use
SPL instead. However, this causes build errors, e.g. with T1024RDB_NAND

So drop the dependency on !SPL_BUILD since it does nothing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agotegra: Drop dependency on SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:26 +0000 (19:49 -0600)]
tegra: Drop dependency on SPL_BUILD

SPL_BUILD is not a Kconfig symbol so perhaps the intent here is to
use SPL instead. But that changes the output size.

So drop the dependency on !SPL_BUILD since it does nothing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoboot: Drop unnecessary ifdef for LOAD_FIT
Simon Glass [Mon, 30 Sep 2024 01:49:25 +0000 (19:49 -0600)]
boot: Drop unnecessary ifdef for LOAD_FIT

Use the normal SPL_TPL_ approach for this option.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agoMakefile: Add a u-boot.cfg file for VPL
Simon Glass [Mon, 30 Sep 2024 01:49:24 +0000 (19:49 -0600)]
Makefile: Add a u-boot.cfg file for VPL

Create this file for VPL as well, for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Fri, 11 Oct 2024 15:35:49 +0000 (09:35 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb

2 months agousb: dwc3-generic: fix CONFIG_DM_REGULATOR-off case
Jan Kiszka [Thu, 8 Aug 2024 08:51:33 +0000 (10:51 +0200)]
usb: dwc3-generic: fix CONFIG_DM_REGULATOR-off case

When DM_REGULATOR is disabled, all calls will return -ENOSYS. Account
for that so that targets like the IOT2050 will work again.

Fixes: de451d5d5b6f ("usb: dwc3-generic: support external vbus regulator")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoMerge patch series "led: introduce LED boot and activity function"
Tom Rini [Thu, 10 Oct 2024 22:02:37 +0000 (16:02 -0600)]
Merge patch series "led: introduce LED boot and activity function"

Christian Marangi <ansuelsmth@gmail.com> says:

This series is a reworked version of the previous seried:
misc: introduce STATUS LED activity function

This series port and expand the legacy concept of LED boot from
the legacy Status LED API to new LED API.

One thing that many device need is a way to communicate to the
user that the device is actually doing something.

This is especially useful for recovery steps where an
user (for example) insert an USB drive, keep a button pressed
and the device autorecover.

There is currently no way to signal the user externally that
the bootloader is processing/recoverying aside from setting
a LED on.

A solid LED on is not enough and won't actually signal any
kind of progress.
Solution is the good old blinking LED but uboot doesn't
suggest (and support) interrupts and almost all the LED
are usually GPIO LED that doesn't support HW blink.

Additional Kconfg are also introduced to set the LED boot and
activity. Those are referenced by label.

A documentation for old and these new LED API is created.

2 months agotest: dm: Expand ofnode options test with new helper
Christian Marangi [Tue, 1 Oct 2024 12:24:44 +0000 (14:24 +0200)]
test: dm: Expand ofnode options test with new helper

Expand ofnode options test with new generic helper for bool, int and
string.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agotest: dm: Add tests for LED boot and activity
Christian Marangi [Tue, 1 Oct 2024 12:24:43 +0000 (14:24 +0200)]
test: dm: Add tests for LED boot and activity

Add tests for LED boot and activity feature and add required property in
sandbox test DTS.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agodoc: introduce led.rst documentation
Christian Marangi [Tue, 1 Oct 2024 12:24:42 +0000 (14:24 +0200)]
doc: introduce led.rst documentation

Introduce simple led.rst documentation to document all the additional
Kconfig and the current limitation of LED_BLINK and GPIO software blink.

Also add missing definition for sw_blink in led_uc_plat struct.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agoubi: implement support for LED activity
Christian Marangi [Tue, 1 Oct 2024 12:24:41 +0000 (14:24 +0200)]
ubi: implement support for LED activity

Implement support for LED activity. If the feature is enabled,
make the defined ACTIVITY LED to signal ubi write operation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agomtd: implement support for LED activity
Christian Marangi [Tue, 1 Oct 2024 12:24:40 +0000 (14:24 +0200)]
mtd: implement support for LED activity

Implement support for LED activity. If the feature is enabled,
make the defined ACTIVITY LED to signal mtd operations.

LED activity is implemented HERE and not in the subsystem side to limit
any performance degradation in case multiple call to MTD subsystem read/write
are done.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agotftp: implement support for LED activity
Christian Marangi [Tue, 1 Oct 2024 12:24:39 +0000 (14:24 +0200)]
tftp: implement support for LED activity

Implement support for LED activity. If the feature is enabled,
make the defined ACTIVITY LED to signal traffic.

Also turn the ACTIVITY LED OFF if a CTRL-C is detected in the main
net loop function.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agoled: implement LED activity API
Christian Marangi [Tue, 1 Oct 2024 12:24:38 +0000 (14:24 +0200)]
led: implement LED activity API

Implement LED activity API similar to BOOT LED API.

Usual activity might be a file transfer with TFTP, a flash write...

User of this API will call led_activity_on/off/blink() to signal these
kind of activity.

New Kconfig is implemented similar to BOOT LED, LED_ACTIVITY to
enable support for it.

It's introduced a new /options/u-boot property "activity-led" and
"activity-led-period" to define the activity LED label and the
default period when the activity LED is set to blink mode.

If "activity-led-period" is not defined, the value of 250 (ms) is
used by default.

If CONFIG_LED_BLINK or CONFIG_LED_SW_BLINK is not enabled,
led_boot_blink call will fallback to simple LED ON.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agocommon: board_r: rework BOOT LED handling
Christian Marangi [Tue, 1 Oct 2024 12:24:37 +0000 (14:24 +0200)]
common: board_r: rework BOOT LED handling

Rework BOOT LED handling. There is currently one legacy implementation
for BOOT LED from Status Led API.

This work on ancient implementation used by BOOTP by setting the LED
to Blink on boot and to turn it OFF when the firmware was correctly
received by network.

Now that we new LED implementation have support for LED boot, rework
this by also set the new BOOT LED to blink and also set it to ON before
entering main loop to confirm successful boot.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agoled: implement LED boot API
Christian Marangi [Tue, 1 Oct 2024 12:24:36 +0000 (14:24 +0200)]
led: implement LED boot API

Implement LED boot API to signal correct boot of the system.

led_boot_on/off/blink() are introduced to turn ON, OFF and BLINK the
designated boot LED.

New Kconfig is introduced, CONFIG_LED_BOOT to enable the feature.
This makes use of the /options/u-boot property "boot-led" to the
define the boot LED.
It's also introduced a new /options/u-boot property "boot-led-period"
to define the default period when the LED is set to blink mode.

If "boot-led-period" is not defined, the value of 250 (ms) is
used by default.

If CONFIG_LED_BLINK or CONFIG_LED_SW_BLINK is not enabled,
led_boot_blink call will fallback to simple LED ON.

To cache the data we repurpose the now unused led_uc_priv for storage of
global LED uclass info.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agodm: core: implement ofnode_options helpers
Christian Marangi [Tue, 1 Oct 2024 12:24:35 +0000 (14:24 +0200)]
dm: core: implement ofnode_options helpers

Implement ofnode_options helpers to read options in /options/u-boot to
adapt to the new way to declare options as described in [1].

[1] dtschema/schemas/options/u-boot.yaml

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agoled: toggle LED on initial SW blink
Christian Marangi [Tue, 1 Oct 2024 12:24:34 +0000 (14:24 +0200)]
led: toggle LED on initial SW blink

We currently init the LED OFF when SW blink is triggered when
on_state_change() is called. This can be problematic for very short
period as the ON/OFF blink might never trigger.

Toggle the LED (ON if OFF, OFF if ON) on initial SW blink to handle this
corner case and better display a LED blink from the user.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
2 months agopower: pmic: pca9450: Add missing newline
Joy Zou [Mon, 23 Sep 2024 13:11:33 +0000 (21:11 +0800)]
power: pmic: pca9450: Add missing newline

Add newline character in log info end.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agopower: pmic/regulator: Support pca9452
Joy Zou [Mon, 23 Sep 2024 13:11:32 +0000 (21:11 +0800)]
power: pmic/regulator: Support pca9452

Add PCA9452 PMIC/Regulator support.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agopower: regulator: pca9450: Update the BUCK1 voltage range
Joy Zou [Mon, 23 Sep 2024 13:11:31 +0000 (21:11 +0800)]
power: regulator: pca9450: Update the BUCK1 voltage range

The pmic could be trimed with updated BUCK1 range, so update the range
for trimed pmic. The default value of Toff_Deb is used to distinguish
the non-trimed and trimed pmic.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agopower: mp5416: Fix LDO SVAL for MP5416 PMIC
Sidharth Prabukumar [Sun, 24 Sep 2023 22:30:22 +0000 (18:30 -0400)]
power: mp5416: Fix LDO SVAL for MP5416 PMIC

The MP5416 PMIC's LDO set-value formula is incorrect. This patch fixes
it by using the correct formula.

Signed-off-by: Sidharth Prabukumar <sidharth.prabukumar@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 months agomtd: spi-nor-ids: Add support for S28HS256T
Takahiro Kuwano [Fri, 27 Sep 2024 01:27:08 +0000 (10:27 +0900)]
mtd: spi-nor-ids: Add support for S28HS256T

Infineon S28HS256T is 256Mb Octal SPI device which has same
functionalities with 512Mb and 1Gb parts.

Link:https://www.infineon.com/dgdl/Infineon-S28HS256T_S28HL256T_256Mb_SEMPER_Flash_Octal_interface_1_8V_3-DataSheet-v02_00-EN.pdf?fileId=8ac78c8c8fc2dd9c018fc66787aa0657

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
2 months agoMerge patch series "mtd: spi-nor-ids: Add NO_CHIP_ERASE flag to Infineon 2Gb parts"
Tom Rini [Thu, 10 Oct 2024 14:13:02 +0000 (08:13 -0600)]
Merge patch series "mtd: spi-nor-ids: Add NO_CHIP_ERASE flag to Infineon 2Gb parts"

Takahiro Kuwano <Takahiro.Kuwano@infineon.com> says:

S25HS02GT, S25HL02GT, and S28HS02GT are dual-die package parts and do
not support chip erase.

In v2, split the patch and add fixes tag.

Takahiro Kuwano (2):
  mtd: spi-nor-ids: Add NO_CHIP_ERASE flag to Infineon s25hl02Gt and
    s25hs02gt
  mtd: spi-nor-ids: Add NO_CHIP_ERASE flag to Infineon s28hs02gt

2 months agomtd: spi-nor-ids: Add NO_CHIP_ERASE flag to Infineon s28hs02gt
Takahiro Kuwano [Fri, 27 Sep 2024 01:24:16 +0000 (10:24 +0900)]
mtd: spi-nor-ids: Add NO_CHIP_ERASE flag to Infineon s28hs02gt

S28HS02GT is dual-die package parts and do not support chip erase.

Fixes: 16dd1095101 ("mtd: spi-nor-ids: Add Infineon(Cypress) s28hs02gt ID")
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
2 months agomtd: spi-nor-ids: Add NO_CHIP_ERASE flag to Infineon s25hl02Gt and s25hs02gt
Takahiro Kuwano [Fri, 27 Sep 2024 01:24:15 +0000 (10:24 +0900)]
mtd: spi-nor-ids: Add NO_CHIP_ERASE flag to Infineon s25hl02Gt and s25hs02gt

S25HL02GT and S25HS02GT are dual-die package parts and do not support
chip erase.

Fixes: c95a914aed7 ("mtd: spi-nor-ids: Add Cypress s25hl-t/s25hs-t")
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
2 months agoMerge patch series "mtd: spi-nor: Add support for S25FS-S family"
Tom Rini [Thu, 10 Oct 2024 14:12:18 +0000 (08:12 -0600)]
Merge patch series "mtd: spi-nor: Add support for S25FS-S family"

tkuw584924@gmail.com <tkuw584924@gmail.com> says:

From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>

The S25FS064S, S25FS128S, and S25FS256S are the same family of SPI NOR
Flash devices with S25FS512S.

Datasheets:
https://www.infineon.com/dgdl/Infineon-S25FS064S_64_Mb_8_MB_FS-S_Flash_SPI_Multi-I_O_1-DataSheet-v10_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed526b25412
https://www.infineon.com/dgdl/Infineon-S25FS128S_S25FS256S_1.8_V_Serial_Peripheral_Interface_with_Multi-I_O_MirrorBit(R)_Non-Volatile_Flash-DataSheet-v15_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed6b5ab5758

2 months agomtd: spi-nor-id: Add S25FS064S, S25FS128S, S25FS256S IDs
Takahiro Kuwano [Fri, 27 Sep 2024 01:11:19 +0000 (10:11 +0900)]
mtd: spi-nor-id: Add S25FS064S, S25FS128S, S25FS256S IDs

The S25FS064S, S25FS128S, and S25FS256S are the same family of SPI NOR
Flash devices with S25FS512S. Some difference depending on the device
densities are taken care in post SFDP fixup.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
2 months agomtd: spi-nor-id: Use INFO6 macro for S25FL-S
Takahiro Kuwano [Fri, 27 Sep 2024 01:11:18 +0000 (10:11 +0900)]
mtd: spi-nor-id: Use INFO6 macro for S25FL-S

The 6th ID byte is needed to distiguish S25FL-S and S25FS-S families.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
2 months agomtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s
Takahiro Kuwano [Fri, 27 Sep 2024 01:11:17 +0000 (10:11 +0900)]
mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s

The correct 4KB erase opcode should be selected based on the address width
currently used.

Fixes: 562d166a13 ("mtd: spi-nor-core: Add fixups for s25fs512s")
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
2 months agomtd: spi-nor-ids: Extend w25q16cl entry with locking support
Marek Vasut [Fri, 6 Sep 2024 21:10:42 +0000 (23:10 +0200)]
mtd: spi-nor-ids: Extend w25q16cl entry with locking support

The w25q16cl does support locking the same way w25q16dw does,
fill in the missing flags.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agomtd: spi-nor-ids: Deduplicate mx25u25635f entry
Marek Vasut [Fri, 6 Sep 2024 21:10:10 +0000 (23:10 +0200)]
mtd: spi-nor-ids: Deduplicate mx25u25635f entry

The mx25u25635f entry exists twice in spi_nor_ids, remove the less
complete variant of the entry and keep only one copy of it.

Fixes: f0084f1dfdbc ("drivers/mtd/spi/spi-nor-ids.c: add mx25u25635f support")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
2 months agomtd: spi-nor-ids: Deduplicate w25q16dw entry
Marek Vasut [Fri, 6 Sep 2024 21:09:16 +0000 (23:09 +0200)]
mtd: spi-nor-ids: Deduplicate w25q16dw entry

The w25q16dw entry exists twice in spi_nor_ids, remove the less
complete variant of the entry and keep only one copy of it.

Fixes: baef13ec9d59 ("mtd: spi-nor-ids: Add support for flashes tested by xilinx")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
2 months agomtd: spi-nor: Clear Winbond SR3 WPS bit on boot
Marek Vasut [Mon, 4 Mar 2024 16:16:05 +0000 (17:16 +0100)]
mtd: spi-nor: Clear Winbond SR3 WPS bit on boot

Some Winbond SPI NORs have special SR3 register which is
used among other things to control whether non-standard
"Individual Block/Sector Write Protection" (WPS bit)
locking scheme is activated. This non-standard locking
scheme is not supported by either U-Boot or Linux SPI
NOR stack so make sure it is disabled, otherwise the
SPI NOR may appear locked for no obvious reason.

This SR3 WPS appears e.g. on W25Q16FW which has the same ID as
W25Q16DW, but the W25Q16DW does not implement the SR3 WPS bit.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoMerge tag 'efi-2025-01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Wed, 9 Oct 2024 22:58:42 +0000 (16:58 -0600)]
Merge tag 'efi-2025-01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2025-01-rc1

Documentation:

* Move the generic memory-documentation to doc/
* Fix typo boormethod

UEFI:

* Delete rng-seed if having EFI RNG protocol
* Don't call restart_uboot in EFI watchdog test
* Simplify building EFI binaries in Makefile
* Show FirmwareVendor and FirmwareRevision in helloworld
* Add debug output for efi bootmeth

Other:

* CONFIG_CMD_CLK should depend on CONFIG_CLK
* simplify clk command
* enable clk command on the sandbox

2 months agosandbox: enable clk command on the sandbox
Heinrich Schuchardt [Mon, 9 Sep 2024 23:45:30 +0000 (01:45 +0200)]
sandbox: enable clk command on the sandbox

Enabling the clk command on the sandbox will allow us to write tests
for it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agocmd: clk: simplify clk command
Heinrich Schuchardt [Mon, 9 Sep 2024 23:45:29 +0000 (01:45 +0200)]
cmd: clk: simplify clk command

CONFIG_DM is always true.
The clk command is only built if CONFIG_CLK=y.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agocmd/Kconfig: CONFIG_CMD_CLK should depend on CONFIG_CLK
Heinrich Schuchardt [Mon, 9 Sep 2024 23:45:28 +0000 (01:45 +0200)]
cmd/Kconfig: CONFIG_CMD_CLK should depend on CONFIG_CLK

The clk command cannot provide useful output without a clock driver.
So let it depend on CONFIG_CLK.

Since commit 258c1002383e ("cmd: clk: Use dump function from clk_ops")
the remark about deprecation is obsolete. Remove it.

Since commit 7ab418fbe612 ("clk: add support for setting clk rate from
cmdline") the clk command can be used to set clock frequencies. Mention
it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoboot: typo boormethod
Heinrich Schuchardt [Tue, 8 Oct 2024 20:46:14 +0000 (22:46 +0200)]
boot: typo boormethod

%s/boormethod/bootmethod/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
2 months agotest: don't call restart_uboot in EFI watchdog test
Heinrich Schuchardt [Tue, 1 Oct 2024 22:53:35 +0000 (00:53 +0200)]
test: don't call restart_uboot in EFI watchdog test

Calling u_boot_console.restart_uboot() in
test_efi_selftest_watchdog_reboot() may lead to incorrect results.

While the watchdog triggered reboot is running thee test environment may
need some time before triggering a reboot itself. This may lead to
duplicate output of the U-Boot greeter which is recorded as an error.

Reported-by: Tom Rini <trini@konsulko.com>
Fixes: df172e117d1d ("test/py: test reboot by EFI watchdog")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agobootstd: Add debugging for efi bootmeth
Simon Glass [Thu, 26 Sep 2024 21:59:37 +0000 (23:59 +0200)]
bootstd: Add debugging for efi bootmeth

Add a little debugging so we can see what is happening.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoefi_loader: Show FirmwareVendor and FirmwareRevision in helloworld
Simon Glass [Thu, 26 Sep 2024 21:59:35 +0000 (23:59 +0200)]
efi_loader: Show FirmwareVendor and FirmwareRevision in helloworld

Show the firmware vendor and revision to make it clear which firmware is
used, e.g. whether U-Boot is providing the boot services.

The output will look like

    Firmware vendor: Das U-Boot
    Firmware revision: 20241000

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoefi_loader: Shorten the app rules further
Simon Glass [Thu, 26 Sep 2024 21:59:34 +0000 (23:59 +0200)]
efi_loader: Shorten the app rules further

Add a way to factor out the CFLAGS changes for each app, since they are
all the same.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoefi_loader: Shorten the app rules
Simon Glass [Thu, 26 Sep 2024 21:59:33 +0000 (23:59 +0200)]
efi_loader: Shorten the app rules

We have quite a few apps now, so create a way to specify them as a list
rather than repeating the same rules again and again.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoefi: arm: x86: riscv: Drop crt0/relocal extra- rules
Simon Glass [Thu, 26 Sep 2024 21:59:32 +0000 (23:59 +0200)]
efi: arm: x86: riscv: Drop crt0/relocal extra- rules

The link rule (for $(obj)/%_efi.so) in scripts/Makefile.lib handles
pulling in efi_crt0.o and efi_reloc.o so drop the 'extra' rules.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 months agoefi_loader: Rename and move CMD_BOOTEFI_HELLO_COMPILE
Simon Glass [Thu, 26 Sep 2024 21:59:31 +0000 (23:59 +0200)]
efi_loader: Rename and move CMD_BOOTEFI_HELLO_COMPILE

This is not actually a command so the name is confusing. Use
BOOTEFI_HELLO_COMPILE instead. Put it in the efi_loader directory
with the other such config options.

The link rule (for $(obj)/%_efi.so) in scripts/Makefile.lib handles
pulling in efi_crt0.o and efi_reloc.o so drop the 'extra' rules.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agodoc: Move the generic memory-documentation to doc/
Simon Glass [Thu, 26 Sep 2024 12:28:51 +0000 (14:28 +0200)]
doc: Move the generic memory-documentation to doc/

Move this section of the README into doc/ with some minor updates to
mention SPL and user lower-case hex.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoefi_leader: delete rng-seed if having EFI RNG protocol
Heinrich Schuchardt [Tue, 17 Sep 2024 08:49:29 +0000 (10:49 +0200)]
efi_leader: delete rng-seed if having EFI RNG protocol

For measured be boot we must avoid any volatile values in the device-tree.
We already delete /chosen/kaslr-seed if we provide and EFI RNG protocol.

Additionally remove /chosen/rng-seed provided by QEMU or U-Boot.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agomtd: simplify CONFIG_DM_SPI_FLASH dependencies
Heinrich Schuchardt [Tue, 4 Jun 2024 04:40:39 +0000 (06:40 +0200)]
mtd: simplify CONFIG_DM_SPI_FLASH dependencies

CONFIG_DM_SPI depends on CONFIG_DM. There is no need to list CONFIG_DM
explicitly as dependency for CONFIG_DM_SPI_FLASH

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Link: https://lore.kernel.org/r/20240604044039.27795-1-heinrich.schuchardt@canonical.com
2 months agoMerge patch series "spi: Various Kconfig fixes"
Tom Rini [Wed, 9 Oct 2024 18:25:39 +0000 (12:25 -0600)]
Merge patch series "spi: Various Kconfig fixes"

John Watts <contact@jookia.org> says:

I'm doing some SPI work so I tried to compile all the drivers on my
sunxi board to try and avoid some regressions. This failed, so here are
some fixes for this.

Link: https://lore.kernel.org/r/20240427-spikconfig-v1-0-8a54772522f4@jookia.org
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agospi: rockchip_sfc: Select BOUNCE_BUFFER
John Watts [Sat, 27 Apr 2024 05:40:43 +0000 (15:40 +1000)]
spi: rockchip_sfc: Select BOUNCE_BUFFER

This is required for compiling.

Signed-off-by: John Watts <contact@jookia.org>
2 months agospi: ca_sflash: Add missing dm include
John Watts [Sat, 27 Apr 2024 05:40:42 +0000 (15:40 +1000)]
spi: ca_sflash: Add missing dm include

This code uses dev_err which is defined in dm/device_compat.h

Signed-off-by: John Watts <contact@jookia.org>
2 months agospi: mtk_spim: Remove completion.h include
John Watts [Sat, 27 Apr 2024 05:40:41 +0000 (15:40 +1000)]
spi: mtk_spim: Remove completion.h include

This created a conflict when linking.

Signed-off-by: John Watts <contact@jookia.org>
2 months agospi: Kconfig: Add some required arch depends for drivers
John Watts [Sat, 27 Apr 2024 05:40:40 +0000 (15:40 +1000)]
spi: Kconfig: Add some required arch depends for drivers

These dependencies are required for building the drivers and create
compile errors if not enabled.

Signed-off-by: John Watts <contact@jookia.org>
[trini: Add ARCH_MVEBU to KIRKWOOD_SPI]
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoMerge patch series "spi-nor: Add parallel and stacked memories support"
Tom Rini [Wed, 9 Oct 2024 15:02:22 +0000 (09:02 -0600)]
Merge patch series "spi-nor: Add parallel and stacked memories support"

Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> says:

This series adds support for Xilinx qspi parallel and
stacked memeories.

In parallel mode, the current implementation assumes that a maximum
of two flashes are connected. The QSPI controller splits the data
evenly between both the flashes so, both the flashes that are connected
in parallel mode should be identical.
During each operation SPI-NOR sets 0th bit for CS0 & 1st bit for CS1 in
nor->flags.

In stacked mode the current implementation assumes that a maximum of two
flashes are connected and both the flashes are of same make but can differ
in sizes. So, except the sizes all other flash parameters of both the flashes
are identical.

Spi-nor will pass on the appropriate flash select flag to low level driver,
and it will select pass all the data to that particular flash.

Write operation in parallel mode are performed in page size * 2 chunks as
each write operation results in writing both the flashes. For doubling the
address space each operation is performed at addr/2 flash offset, where addr
is the address specified by the user.

Similarly for read and erase operations it will read from both flashes, so
size and offset are divided by 2 and send to flash.

2 months agoconfig: xilinx: Enable the SPI_ADVANCE config option
Venkatesh Yadav Abbarapu [Thu, 26 Sep 2024 04:55:08 +0000 (10:25 +0530)]
config: xilinx: Enable the SPI_ADVANCE config option

Enable the SPI_ADVANCE config option for all xilinx platforms, as
this is required for parallel-memories.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2 months agospi: zynq_qspi: Add parallel memories support in QSPI driver
Venkatesh Yadav Abbarapu [Thu, 26 Sep 2024 04:55:07 +0000 (10:25 +0530)]
spi: zynq_qspi: Add parallel memories support in QSPI driver

Add support for parallel memories in zynq_qspi.c driver. In case of
parallel memories STRIPE bit is set and sent to the qspi ip, which will
send data bits to both the flashes in parallel. However for few commands
we should not use stripe, instead send same data to both the flashes.
Those commands are exclueded by using zynqmp_qspi_update_stripe().

Also update copyright info for this file.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>