| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds the suitable SPDX-License-Identifier to all files in drivers/
that previously lacked one.
To aid manual inspection, following heuristics can be used:
* No changes outside of comments/whitespace:
git show -U0 HEAD | rg -v '^(@@|diff|index)|[-+]([-+]|//|#|[\s/]\*)'
* -or-later come in pairs:
git show --inter-hunk-context=19 HEAD | \
perl -0777 -F'/^@/gm' -ne 'for (@F) { @m = /later/g; print if @m & 1 }'
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211030175632.2276077-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
While ioremap can fail, IOMEM() in our identity-mapped barebox can't.
Thus remove the never entered error branches.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211030175812.2276705-6-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Link: https://lore.barebox.org/20211004091550.42289-1-antonynpavlov@gmail.com
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
| |
Add the NXP IFC nand driver support. This driver
can be used with the NXP QorIQ cores.
Originally, derived from U-boot commit cce573e (2015-10)
Signed-off-by: Renaud Barbier <renaud.barbier@abaco.com>
Link: https://lore.barebox.org/1628842608-17031-3-git-send-email-renaud.barbier@abaco.com
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We know the reason to return -ENOSYS, thus let the user know.
This will give him a much better hint why his NAND is not working than
only getting the generic
| probe failed: Function not implemented
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Link: https://lore.barebox.org/20210708112629.19243-1-ejo@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There are two different NAND drivers, used for different chips in the
i.MX range. It's quite confusing as to which to use. Add some help
text to clarify.
Signed-off-by: Trent Piepho <tpiepho@gmail.com>
Link: https://lore.barebox.org/20210527083741.789109-1-tpiepho@gmail.com
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
sector >= 0 is always true for the unsigned type flash_sect_t. This
means the loop to find the sector will only behave correctly when we
actually find the sector, but not in the error case. The error case
is not expected though and will not happen when the code is correct,
so just catch it with a BUG().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210517185424.32145-7-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
| |
The entry is imported from Linux v5.12.
It can befound on new versions of the Boundary Devices i.MX6 Quad
Nitrogen6x boards.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210520154929.25131-1-m.olbrich@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Without it we will never use the faster timing modes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
| |
This reverts commit 94f2da7d81cfd83685af24967e89347e7aea2ccb.
Patch is reverted in Linux because it caused a regression on i.MX27, see
http://lists.infradead.org/pipermail/linux-mtd/2021-April/086124.html
Do the same for barebox.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The blocks containing the bad block table can become bad as well. So
make sure to skip any blocks that are marked bad when searching for the
bad block table.
Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
LGTM[1] flags a couple of places where we write a 32-bit multiplication
result into a 64-bit destination. While it might very well be that
there are more places in need of fixing to support flashes bigger than
4G, fixing these issues is easy and reduces the noise. Do so.
[1]: https://lgtm.com/projects/g/saschahauer/barebox/alerts/?mode=list
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The mtd layout must be set before calling nand_scan_tail() because it
would set a standard layout otherwise. This standard layout is always
wrong and in some cases doesn't even exist in which case the nand
support bails out with an error.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
| |
The default ooblayout ops do not work on nand_mxs devices and can lead
to an unresponsible system when doing a 'nand -i' on that device.
Thus implement the ooblayout ops for the nand_mxs driver separately.
Since writing the oob area is not supported simply return the whole oob
area as ecc.
Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Give the user information about the faulty block when an erase
operation fails with error.
Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Until this is fixed, add a comment and have the driver return with an
error instead of crashing on null pointer dereference if it's mapped to
zero.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently the nand-mxs driver uses a hook function to the
mtd->_block_markbad function to allow write access to the OOB bytes only
if it is to mark a block as bad.
This hook is not called when a Bad Block Table block is marked bad since
this routine directly calls nand_markbad_bbm.
The chip->legacy.block_markbad hook gives a driver the ability to
implement a custom block_markbad function. Since this is used by
nand_markbad_bbm, if it exists, replace the mtd->_block_markbad hook by
a chip->legacy.block_markbad function. The gpmi-nand Linux implementation
of this driver uses the same mechanism.
This fixes an issue where marking Bad Block Table blocks as bad fails
with:
NXS NAND: Writing OOB isn't supported
Tested on PHYTEC phyCORE-i.MX 6Q.
Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using a NAND memory with hardware ECC enabled on a Atmel SoC
probing fails during barebox boot with following error:
nand_base: device found, Manufacturer ID: 0x2c, Chip ID: 0xdc
nand_base: Micron MT29F4G08ABAEAWP
nand_base: 512 MiB, SLC, erase size: 256 KiB, page size: 4096, OOB size: 224
WARNING: at drivers/mtd/nand/nand_base.c:5594/nand_scan_tail()!
WARNING: No oob scheme defined for oobsize 224
atmel_nand atmel_nand0: probe failed: No such device or address
The problem arises from commit b6bcd96de5a75bdc5d06a06f2efffc2d89e346ec
which among several changes dropped CONFIG_NAND_ECC_HW symbol, however
two references remained in atmel_nand driver causing the failure of NAND
probing when hardware ECC is configured in a Atmel SoC.
Fixes: b6bcd96de5 ("mtd: nand: Update to Linux-5.9")
Signed-off-by: Edoardo Scaglia <scaglia@amelchem.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed issue of manages BBT (Bad Block Table).
It didn't mark correctly when a specific block was bad block.
This issue occurs when the bad block mark (3-bit chunk) is
crosses over 32 bit (e.g. Block10, Block21...) unit.
Signed-off-by: Yoshio Furuyama <ytc-mb-yfuruyama7@kioxia.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
print_hex_dump in barebox always prints a hex dump. Most users use
it for debugging though, so import Linux helpers to do so to cut
down on the #ifdef DEBUG.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With <linux/math64.h> included for do_div instead of
<asm-generic/div.h>, there remains only 3 references to asm-generic
headers in drivers/. Fix them up.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
| |
<asm-generic/div64.h> isn't meant for direct usage as <asm/div64.h> may
override this on a per-architecture basis. We don't do that currently,
but in the future we might. Include the <linux/math64.h> instead.
No functional change.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Check for length > 0 because otherwise len may become smaller than
0 in which case the loop never ends.
Reported-by: Alexander Shiyan <eagle.alexander923@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
6748f466a3 made NAND_ECC_HW_SYNDROME mode optional by bailing out
with -ENOSYS when the mode is not enabled in Kconfig. Unfortunately
with NAND_ECC_HW mode the code falls through to this test, so with
NAND_ECC_HW_SYNDROME support disabled NAND_ECC_HW stopped working as
well. Fix this.
fixes: 6748f466a3 ("mtd: nand: Make support for syndrome hardware ecc optional")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
Add include missing in last commit.
Fixes: 616d942c3e mtd:nand_mxs:update get/set features legacy function call
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
update get/set features legacy function call to avoid NULL pointer crash.
Signed-off-by: zhengxiaojun <jameszxj at gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Most NAND controllers use hardware ECC, so make software ECC support
optional to save some binary space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
NAND_ECC_HW_SYNDROME is currently not needed by the drivers in barebox,
so make support for it optional again. This has been optional before the
last NAND layer update, just re-add the option. This time drop the
"default y", as this option shouldn't be needed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
Write support is optional with the CONFIG_MTD_WRITE option. Bail out
early in the write functions to save some binary space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
The driver can't work when omap_gpmc_eccmode() fails, so do not ignore
the error.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
ELM config can fail when ELM support is disabled. Let the user know
about it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The Denali binding for the Kernel has evolved over time. Recent Kernels
need NAND chip subnodes in the controller node which then hold the
partition nodes. Older Kernels need the partition nodes directly under
the controller node. Cope with both kernel types.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Some drivers have special requirements for fixing up the partition
nodes for the kernel. This adds a hook to struct mtd_info that can
be used by drivers to replace the generic fixup with a special one.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
struct mtd_info member of_path is set but not used, remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
NAND write support used to be optional and the correspoding
CONFIG_MTD_WRITE option still exists. Bail out early from the write
functions when CONFIG_MTD_WRITE is disabled like we used to before the
last NAND layer update.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When reading in BCH16 mode the ECC for the first 512 byte fails. I am
pretty sure this must have worked once and I can't see why it doesn't
now. Change reading in BCH16 mode to the same way as the kernel driver
does: Instead of using wrap mode 4 to skip ECC when reading the first
OOB bytes, just use wrap mode 1 and skip reading the first OOB bytes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
When copying images to nand with plain cp it can happen that the length
of the image is not page aligned. Allow misaligned image lengths as we
used to before the last NAND layer update.
Fixes: b6bcd96de5 ("mtd: nand: Update to Linux-5.9")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
copy_spare used to take a mtd_info, but since 5f605dc6168c ("mtd: nand:
Pass struct nand_chip around") it now takes a nand_chip.
3588d40c5385 ("mtd: nand-imx: repair reading the oob area") was drafted
in parallel and still passes a mtd_info. Their merge did not adjust
this, triggering a compiler warning and undefined behavior. Fix this.
Fixes: 7b1d8b4b3561 ("Merge branch 'for-next/mtd-nand'")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
CONFIG_NAND_BBT no longer exists, so remove the remaining occurences.
Fixes: b6bcd96de5 ("mtd: nand: Update to Linux-5.9")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|