| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
5211e428cbab ("image: Convert the IH_... values to enums") removed the
IH_ARCH_LINUX enumeration value leading to breakage of sandbox
configurations that enable bootm. Instead of reinstating IH_ARCH_LINUX,
just use IH_ARCH_SANDBOX and remove mention of CONFIG_LINUX altogether,
it's always true anyway when CONFIG_SANDBOX is true.
Fixes: 5211e428cbab ("image: Convert the IH_... values to enums")
Cc: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Since 38d7ba55da26 ("fastboot: rename usbgadget.fastboot_* variables to
fastboot.*"), the variables are named differently. Amend the help text.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
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>
|
|
|
|
|
|
|
|
|
|
| |
The imx6q_ocotp_data struct is incomplete resulting in a crash when trying
to read/blow fuses.
Fixes: 17cba91885d9 ("nvmem: ocotp: read/write i.MX7 support")
Signed-off-by: Robin van der Gracht <robin@protonic.nl>
Reviewed-by: Rouven Czerwinski <r.czerwinski@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>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
NAND mtd devices carry information how the OOB area is used. So far
there is no way to visualize it, so print it along with other NAND
informations.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
pmecc has hardcoded steps of 1 and ecc size of the nand chips page size.
This is wrong, the ECC engine does 512 or 1024 bytes per step. Adjust
ecc size and step size accordingly. Also, fix ecc strength which was
hardcoded to 1.
With this the correct number of bitflips is reported, which should be
the number of bitflips per ecc step, not the one for the whole page.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| | |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| | |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
The denali NAND driver is in an hopeless outdated state, it can't even
check the ECC data. Throw in the denali driver from Linux-5.9.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This updates the barebox NAND layer and parts of the mtd layer to
Linux-5.9.
This patch is huge, but the barebox NAND layer is so far away from the
Linux NAND layer that a step by step update would have taken ages.
Unlike Linux barebox has functions to mark a block as good. This feature
has been preserved. Also barebox used to make NAND write support
optional, this feature is lost during the update for the sake of better
compatibility to the Linux NAND layer.
This patch has been tested:
- GPMI aka nand_mxs on i.MX6
- nand_imx on i.MX25
- nand_omap_gpmc on AM335x
- atmel_nand on Atmel sama5d3
- nand_denali on SoCFPGA
Currently untested:
- nand_orion
- nand_mrvl_nfc
- nand_s3c24xx
The nand_denali driver is tested with the update of that driver to
Linux-5.9 following in the next patch.
I could only test the drivers with the NAND chips found on my boards, so
there's still enough room for regressions, especially given that the
NAND drivers themselves are mostly not updated. With the NAND layer
being up-to-date with Linux it should hopefully be easy to update
drivers to their Linux counterpart as well if necessary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
We have a function for getting from the struct nand_chip * to the struct
mtd_info *, so use it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
We have a function for getting from the struct nand_chip * to the struct
mtd_info *, so use it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
We have a function for getting from the struct nand_chip * to the struct
mtd_info *, so use it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Current multichip support doesn't fir well into the coming update to the
NAND layer. Remove it for now, it will be added back when the denali
NAND driver is updated to current Linux.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
We support bch16_hw in the OMAP NAND driver, but we cannot show it in
the eccmode parameter. Add the missing string.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
We may only write more characters when there's actually something left
to write. Fix the wrong check.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
nand->controller is set but never used. Remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| | |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
Linux had moved the traditional nand function hooks to an
extra struct nand_legacy. Do the same in barebox for compatibility.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
In Linux mtd->parent is what in barebox is mtd->master. Rename this
to get closer to the Linux mtd layer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The mtds own device is named 'dev' in the Kernel whereas it's named
'class_dev' in barebox. Rename it to 'dev' for better compatilibility
to the Kernel.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of mtd->parent we can use mtd->classdev.parent which points to
the same device. With this we can remove the 'parent' member of struct
mtd_info. This member exists in the Linux kernel as well, but is of type
struct mtd_info, so this is done as preparation to re-add mtd->parent
with the same type as in Linux.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
In the Kernel the mtd function hooks begin with an underscore. Do the
same in barebox to be better comparable to the Kernel.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Traditionally Linux passed a struct mtd_info * around as context
between the different functions. This has been changed to a struct
nand_chip *. Do the same for barebox as well as another step towards
updating the NAND layer to current Linux.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
chip->errstat is never set by any driver, so remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
chip->erase_cmd is never used, so remove this hook.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
nand.h is unused, remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
asynchronous erase support is unused and also dropped from the Kernel,
so remove it from barebox.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Qemu with the secure extension enabled will insert a secram node into
the device tree:
secram@e000000 {
secure-status = "okay";
status = "disabled";
reg = <0x0 0xe000000 0x0 0x1000000>;
device_type = "memory";
};
Barebox would previously parse this node, add it as a memory bank and
than reinsert an enabled node into the fixed up device tree.
Fix this by skipping disabled memory nodes.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
After sending the READOOB command the core (in nand_read_oob_std()) uses
the read_buf callback to fetch the result. So in the imx driver it is
necessary to emit the NFC_OUTPUT command to make the controller actually
read the requested data into the internal buffer and then copy the data
to the location where read_buf expects it.
This fixes reading from /dev/nand0.oob and also (somewhat) reading bad
block markers in the absence of a bad block table.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
According to kernel commit 7a2a98be672b ("mmc: mmci: Add support for
sdmmc variant revision 2.0")[0], v2.0 is completely backwards compatible
with v1.1. Add the v2.0's periphid to have the driver work with both.
[0]: https://lore.kernel.org/linux-arm-kernel/20200128090636.13689-10-ludovic.barre@st.com/T/#u
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
According to the data sheet (MC34704 Rev. 8.0, 12/2014) must always have
the MSB set in the "Sub-address" byte for reads.
This fixes reading out registers on a MC34704AEP chip.
Fixes: 514387711f2d ("i2c: add driver for the MC34704 PMIC")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
On arm64 the compiler prints the following warning, when the macb driver
is enabled:
warning: cast from pointer to integer of different size
Add the same explicit cast as implemented for all other dma addresses in
the macb driver.
Fixes: befd110b5922 ("net: macb: init multiple dummy TX queues")
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Changes of the link speed might require an adjustment of the clk_tx.
Read the clk_tx from the device tree and change the rate if the link
speed changes.
If the clk_tx rate is already correct, changing the clock is not
required and, thus, not being able to get the clock rate is not fatal.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The macb debugging output printed the function entry for various
functions. Especially for *_recv() this debugging flooded the serial
output while conveying very little information.
Remove printing of the function calls to make enabling debugging for the
macb driver more useful.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is a port of upstream U-Boot commit b335966958a9. Sadly there is no
more information to be found about the issue. The currently available
errata documents don't mention this issue at all and the U-Boot commit
doesn't tell much either, however this commit has been pointed out by
NXP engineers as a solution to reports of board instabilities.
| drivers: ddr: imx Workaround for i.MX8M DDRPHY rank to rank issue
|
| Add logic to automatically update umctl2's setting based
| on phy training CDD value for rank to rank space issue
|
| Acked-by: Ye Li <ye.li@nxp.com>
| Signed-off-by: Oliver Chen <Oliver.Chen@nxp.com>
| Signed-off-by: Jacky Bai <ping.bai@nxp.com>
| Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de> (on i.MX8MP)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The DDRC address in the memory map and the TF-A parameter store address
is the same for all i.MX8M* SoCs. The only difference (for now) is in the
power up sequence. Add a enum for the DDRC type, so we can take different
code paths in imx8m_ddr_init() depending on the SoC.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Port of upstream U-Boot commit: 1eb325af16e2
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/ / /
| | |
| | |
| | | |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
In case the USB device is a full speed device we have to set
dev->epmaxpacketin[0] and dev->epmaxpacketout[0] before doing a
get_descriptor_len() because otherwise it's unset during that call.
Fixes: 6d1d95a386 ("usb: factor out a usb_setup_descriptor() function")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For reading reg with #address-cells and #size-cells of 2,
an of_property_read_u64_array can be quite convenient.
Add one.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| | |
The different architectures duplicate some code around unflattening and
registering the device tree. Add common functions to reduce this
duplication.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|