| Age | Commit message (Collapse) | Author |
|
Enable a bunch of useful features such as:
* Linux devicetree fixups
* devicetree overlay support
* secure boot dependencies
* commands (filesystems, disks, etc.)
* fastboot support
* USB storage/ethernet
Signed-off-by: Frieder Schrempf <[email protected]>
|
|
This allows userspace tools like libubootenv to determine the
location of the currently used environment and select a
matching config.
Signed-off-by: Frieder Schrempf <[email protected]>
|
|
Depending on the MMC boot device, select the proper location for the
environment.
* SD card and eMMC main partition: use offsets from CONFIG_ENV_OFFSET
and CONFIG_ENV_OFFSET_REDUND.
* eMMC boot partition: use offset -2*ENV_SIZE and -ENV_SIZE from the
end of the partition.
Signed-off-by: Frieder Schrempf <[email protected]>
|
|
Enable config options to access the EEPROM on the OSM-S i.MX8MM
SoM module.
Signed-off-by: Frieder Schrempf <[email protected]>
|
|
Enable support for using fixed regulators from the devicetree and
auto enable them if requested.
This way U-Boot will enable the CARRIER_PWR_EN signal of the OSM
module automatically while initializing the board.
Signed-off-by: Frieder Schrempf <[email protected]>
|
|
The module version this warning is referring to never really existed
except for in-house development and there is a conflict with the
I2C address used for detecting it and the I2C EEPROM of the latest
OSM-S module. Remove the check.
Signed-off-by: Frieder Schrempf <[email protected]>
|
|
Enable everything that is required to load via USB. The SPL needs
SDP support so it can load the U-Boot proper image via USB after
it has been loaded via serial loader mode of the i.MX.
This way we can use the uuu tool for loading SPL and U-Boot
proper like this:
uuu -brun flash.bin
Signed-off-by: Frieder Schrempf <[email protected]>
|
|
The limit of 0x27000 (156 KiB) was valid at times the DDR firmware
required a fixed amount of 96 KiB of space. Now that we use binman
to include the DDR firmware it only needs around 57 KiB of space and
there is more room for the SPL.
Increase the max SPL size to 196 KiB so there is still 60 KiB for DDR
firmware. This allows us to enable USB and SDP support in SPL.
Signed-off-by: Frieder Schrempf <[email protected]>
|
|
Add rauc to bootmeths variable if BOOTMETH_RAUC is enabled. This is
setting a proper default for RAUC enabled systems.
Signed-off-by: Martin Schwan <[email protected]>
|
|
Merge the outstanding changes from the 'next' branch to master.
|
|
Signed-off-by: Tom Rini <[email protected]>
|
|
The patch adds benchmark option to the help of mtd command. For the
'mtd write' case the help line exceed 80 characters. Ignore this issue
as modern terminals are capable to handle more characters.
The patch also formats other command to make sure all device names
starts on the same collumn.
Fixes: d246e70cf81d0 ("cmd: mtd: Enable speed benchmarking")
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
The shown speed is inversely proportional to the data size.
See the output:
spi-nand: spi_nand nand@0: Micron SPI NAND was found.
spi-nand: spi_nand nand@0: 256 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
...
=> mtd read.benchmark spi-nand0 $loadaddr 0 0x40000
Reading 262144 byte(s) (128 page(s)) at offset 0x00000000
Read speed: 63kiB/s
=> mtd read.benchmark spi-nand0 $loadaddr 0 0x20000
Reading 131072 byte(s) (64 page(s)) at offset 0x00000000
Read speed: 127kiB/s
=> mtd read.benchmark spi-nand0 $loadaddr 0 0x10000
Reading 65536 byte(s) (32 page(s)) at offset 0x00000000
Read speed: 254kiB/s
In the spi-nand case 'io_op.len' is not always the same as 'len', thus
we are using the wrong amount of data to derive the speed.
Also make sure we are using 64-bit calculation to get a more precise
results.
Fixes: d246e70cf81d0 ("cmd: mtd: Enable speed benchmarking")
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
This patch implements read-only test of nand flash devices.
Test reads blocks of NAND flash in normal and raw modes and compares
results. The following statuses can be returned for a block:
* non-ecc reading failed,
* ecc reading failed,
* block is bad,
* bitflips is above maximum,
* actual number of biflips above reported one,
* bitflips reached it maximum value,
* bitflips above threshold,
* block is ok.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Some nand flashes (like spi-nand one) are registered with mtd
subsystem only, thus nand command can't be used to work with
such flashes. As result some functionality is missing.
This patch implements 'nand torture' functionality for mtd command.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Some nand flashes (like spi-nand one) are registered with mtd
subsystem only, thus nand command can't be used to work with
such flashes. As result some functionality is missing.
This patch implements 'nand markbad' functionality for mtd command.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Continuous reading may result in multiple flash pages reading in one
operation. Unfortunately, not all spinand controllers support such
large reading. They will read less data. Unfortunately, the operation
can't be continued.
In this case:
* disable continuous reading on this (not good enough) spi controller
* repeat reading in regular mode.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
reading fails
Continuous reading may result in multiple flash pages reading in one
operation. Typically only one flash page has read/written (a little bit
more than 2-4 Kb), but continuous reading requires the spi controller
to read up to 512 Kb in one operation without toggling CS in beetween.
Roughly speaking spi controllers can be divided on 2 categories:
* spi controllers without dirmap acceleration support
* spi controllers with dirmap acceleration support
Firt of them will have issues with continuous reading if restriction on
the transfer length is implemented in the adjust_op_size() handler.
Second group often supports acceleration of single page only reading.
Thus enabling of continuous reading can break flash reading.
This patch tries to create dirmap for continuous reading first and
fallback to regular reading if spi controller refuses to create it.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Continuous mode is only supported for data reads, thus writing
requires only single flash page mapping.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
This makes the U-Boot SPI NAND driver almost the same as in Linux
6.17-rc1. The only major differences are:
* support of ECC engines. The Linux driver supports different ECC
engines while U-Boot uses on-die ECC only.
* per operation maximum SPI bus frequency
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
There is already a manufacturer hook, which is manufacturer specific but
not chip specific. We no longer have access to the actual NAND identity
at this stage so let's add a per-chip configuration hook to align the
chip configuration (if any) with the core's setting.
This is a port of linux commit
da55809ebb45 ("mtd: spinand: Add a ->configure_chip() hook")
Signed-off-by: Miquel Raynal <[email protected]>
Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Since commit 3d1f08b032dc ("mtd: spinand: Use the external ECC engine
logic") the spinand_write_page() function ignores the errors returned
by spinand_wait(). Change the code to propagate those up to the stack
as it was done before the offending change.
This is a port of linux commit
091d9e35b85b ("mtd: spinand: propagate spinand_wait() errors from spinand_write_page()")
Signed-off-by: Gabor Juhos <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Currently the best variant picked in the first one in the list provided
in the manufacturer driver. This worked well while all operations where
performed at the same speed, but with the introduction of DTR transfers
this no longer works correctly.
Let's continue iterating over all the alternatives, even if we find a
match, keeping a reference over the theoretically fastest
operation. Only at the end we can tell which variant is the best.
This logic happening only once at boot.
The patch is based on linux commit
666c299be696 (mtd: spinand: Enhance the logic when picking a variant)
created by Miquel Raynal <[email protected]>
The code was a bit restricted in the functionality since not all
required functionality is supported in the u-boot.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
The code was ported from linux-6.15
based on a linux commit c06b1f753bea (mtd: spinand: add OTP support)
created by Martin Kurbanov <[email protected]>
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
When the host ECC fails to correct the data error of NAND device,
there's a special read for data recovery method which can be setup
by the host for the next read. There are several retry levels that
can be attempted until the lost data is recovered or definitely
assumed lost.
This is the port of linux commit
f2cb43c98010 (mtd: spinand: Add read retry support)
Signed-off-by: Cheng Ming Lin <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
The code was ported from linux-6.12. The original continuous reading
support was implemented by Miquel Raynal <[email protected]>
in linux commit 631cfdd0520d (mtd: spi-nand: Add continuous read support).
Here is an original patch description:
--------------------------------------
A regular page read consist in:
- Asking one page of content from the NAND array to be loaded in the
chip's SRAM,
- Waiting for the operation to be done,
- Retrieving the data (I/O phase) from the chip's SRAM.
When reading several sequential pages, the above operation is repeated
over and over. There is however a way to optimize these accesses, by
enabling continuous reads. The feature requires the NAND chip to have a
second internal SRAM area plus a bit of additional internal logic to
trigger another internal transfer between the NAND array and the second
SRAM area while the I/O phase is ongoing. Once the first I/O phase is
done, the host can continue reading more data, continuously, as the chip
will automatically switch to the second SRAM content (which has already
been loaded) and in turns trigger the next load into the first SRAM area
again.
From an instruction perspective, the command op-codes are different, but
the same cycles are required. The only difference is that after a
continuous read (which is stopped by a CS deassert), the host must
observe a delay of tRST. However, because there is no guarantee in Linux
regarding the actual state of the CS pin after a transfer (in order to
speed-up the next transfer if targeting the same device), it was
necessary to manually end the continuous read with a configuration
register write operation.
Continuous reads have two main drawbacks:
* They only work on full pages (column address ignored)
* Only the main data area is pulled, out-of-band bytes are not
accessible. Said otherwise, the feature can only be useful with on-die
ECC engines.
Performance wise, measures have been performed on a Zynq platform using
Macronix SPI-NAND controller with a Macronix chip (based on the
flash_speed tool modified for testing sequential reads):
- 1-1-1 mode: performances improved from +3% (2-pages) up to +10% after
a dozen pages.
- 1-1-4 mode: performances improved from +15% (2-pages) up to +40% after
a dozen pages.
This series is based on a previous work from Macronix engineer Jaime
Liao.
--------------------------------------
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
SkyHigh spinand device has ECC enable bit in configuration register but
it must be always enabled. If ECC is disabled, read and write ops
results in undetermined state. For such devices, a way to avoid raw
access is needed.
Introduce SPINAND_NO_RAW_ACCESS flag to advertise the device does not
support raw access. In such devices, the on-die ECC engine ops returns
error to I/O request in raw mode.
Checking and marking BBM need to be cared as special case, by adding
fallback mechanism that tries read/write OOB with ECC enabled.
This is a port of linux commit
6d9d6ab3a82a (mtd: spinand: Introduce a way to avoid raw access)
Signed-off-by: Takahiro Kuwano <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
We don't have to call spinand_write_enable_op() in spinand_markbad() as
it is called in spinand_write_page().
This is the port of linux commit
c6858779f1f5 (mtd: spinand: Remove write_enable_op() in markbad())
Signed-off-by: Takahiro Kuwano <[email protected]>
Reviewed-by: Tudor Ambarus <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Add two flags for inserting the Plane Select bit into the column
address during the write_to_cache and the read_from_cache operation.
Add the SPINAND_HAS_PROG_PLANE_SELECT_BIT flag for serial NAND flash
that require inserting the Plane Select bit into the column address
during the write_to_cache operation.
Add the SPINAND_HAS_READ_PLANE_SELECT_BIT flag for serial NAND flash
that require inserting the Plane Select bit into the column address
during the read_from_cache operation.
This is a port of linux commit
ca229bdbef29 (mtd: spinand: Add support for setting plane select bits)
Signed-off-by: Cheng Ming Lin <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Reporting an unclean read from SPI-NAND only when the maximum number
of correctable bitflip errors has been hit seems a bit late.
UBI LEB scrubbing, which depends on the lower MTD device reporting
correctable bitflips, then only kicks in when it's almost too late.
Set bitflip_threshold to 75% of the ECC strength, which is also the
default for raw NAND.
This is a port of linux commit
1824520e7477 (mtd: spinand: set bitflip_threshold to 75% of ECC strength)
Signed-off-by: Daniel Golle <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/2117e387260b0a96f95b8e1652ff79e0e2d71d53.1723427450.git.daniel@makrotopia.org
Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
This makes the U-Boot SPI NAND driver almost the same as in Linux 6.10.
The only major difference is support of ECC engines. The Linux driver
supports different ECC engines while U-Boot uses on-die ECC only.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
changes:
* Move spinand_check_ecc_status(), spinand_noecc_ooblayout_ecc(),
spinand_noecc_ooblayout_free() and spinand_noecc_ooblayout close
to each other.
* some code formatting
* remove comments not present in linux driver
This aligns the code with Linux 6.10.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
No functional changes, just some refactoring to better match linux
kernel driver.
changes:
* move spinand configuration reading out from spinand_init_cfg_cache()
to separate function spinand_read_cfg()
* move spinand flash initialization to separate function
spinand_init_flash()
* move direct mapping initialization to the end of spinand_init()
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
This aligns the logic to match the Linux kernel implementation.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Use spinand_to_nand() and spinand_to_mtd() helpers instead of
nanddev_to_mtd() and direct access to spinand structure fields.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
This aligns spinand_wait() with the linux kernel. Instead of calling into
spi_mem_poll_status() which is not implemented in U-Boot, we code the
polling logic and make sure that schedule() is called periodically.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
The module misses MODULE_DEVICE_TABLE() for both SPI and OF ID tables
and thus never autoloads on ID matches.
Add the missing declarations.
Present since day-0 of spinand framework introduction.
This is a port of linux commit
25fefc88c71f ("mtd: spinand: core: add missing MODULE_DEVICE_TABLE()")
Signed-off-by: Alexander Lobakin <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Use an enum to differentiate the type of I/O (reading or writing a
page). Also update the request iterator.
This is a port of linux commit
701981cab016 ("mtd: nand: Add a NAND page I/O request type")
Signed-off-by: Miquel Raynal <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
Make use of the spi-mem direct mapping API to let advanced controllers
optimize read/write operations when they support direct mapping.
Based on a linux commit 981d1aa0697c ("mtd: spinand: Use the spi-mem dirmap API")
created by Boris Brezillon <[email protected]> with additional
fixes taken from Linux 6.10.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
This pulls in multiple changes from the Linux kernel in order to keep
the code in sync. This also fixes octal mode support.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
|
|
- Make the i2c-bus property for an onboard USB hub optional
|
|
DT binding doesn't mandate i2c-bus as required property because hub itself
doesn't need to have i2c connected.
It can be in standalone mode that only power regulator and reset should be
handled.
Or hub should be configured via spi interface.
Signed-off-by: Michal Simek <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
These files had '#include<file.h>' rather than '#include <file.h>' which
while functional is not the correct style.
Signed-off-by: Tom Rini <[email protected]>
|
|
Add "in SPL" to the SPL related driver help texts.
Signed-off-by: Yegor Yefremov <[email protected]>
Reviewed-by: Quentin Schulz <[email protected]>
|
|
%s/environemt/environment
Signed-off-by: Thomas Bonnefille <[email protected]>
|
|
Wolfgang Wallner <[email protected]> says:
There was recently a discussion on which boards need ATAGS support.
The B&R boards which have this support enabled actualyl don't need it.
This patch series drops the settings from the relevant defconfigs.
Link: https://lore.kernel.org/r/[email protected]
|
|
While we continue to have some systems which support extremely legacy
OS booting methods, we do not have use cases for supporting this in
Falcon mode anymore. Remove this support and references from the
documentation.
Co-developed-by: Anshul Dalal <[email protected]>
Signed-off-by: Tom Rini <[email protected]>
|
|
Synchronize upper_NN_bits() and lower_NN_bits() macros with Linux 6.16
commit 118d777c4cb4 ("wordpart.h: Add REPEAT_BYTE_U32()"). This fixes the
lower_32_bits() macros and assures it works with 64bit systems correctly.
This also adds 16bit variants of these macros, which will be used by the
Airoha PHY driver.
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
|
|
CONFIG_SUPPORT_PASSING_ATAGS is not needed for this board.
Signed-off-by: Wolfgang Wallner <[email protected]>
|
|
CONFIG_SUPPORT_PASSING_ATAGS is not needed for this board.
Signed-off-by: Wolfgang Wallner <[email protected]>
|