summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* mtd: nand: Make write support optionalSascha Hauer2020-12-112-4/+51
| | | | | | | | | 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>
* nand: omap: Fix BCH16 readSascha Hauer2020-12-111-4/+11
| | | | | | | | | | 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>
* mtd: nand: Allow non page aligned length writesSascha Hauer2020-12-111-1/+1
| | | | | | | | | 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>
* sandbox: retire CONFIG_LINUX symbol in favor of CONFIG_SANDBOXAhmad Fatoum2020-11-272-2/+2
| | | | | | | | | | | | | 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>
* usb: gadget: fastboot: fix no longer accurate help textAhmad Fatoum2020-11-231-1/+1
| | | | | | | | 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>
* mtd: nand-imx: fix passing pointer of wrong type on NAND_CMD_READOOBAhmad Fatoum2020-11-131-1/+1
| | | | | | | | | | | | 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>
* nvmem: ocotp: fix fusing on fsl,imx6q-ocotp compatible boardsRobin van der Gracht2020-11-121-0/+2
| | | | | | | | | | 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>
* mtd: nand: Fix dependeny on CONFIG_NAND_BBTSascha Hauer2020-11-112-2/+1
| | | | | | | 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>
* Merge branch 'for-next/mtd-nand'Sascha Hauer2020-11-1051-5275/+11740
|\
| * nand command: Print OOB informationSascha Hauer2020-11-101-0/+81
| | | | | | | | | | | | | | | | 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>
| * mtd: nand: atmel: Fix pmecc ecc settingsSascha Hauer2020-11-101-42/+16
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mtd: nand: atmel: drop dead codeSascha Hauer2020-11-101-22/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: atmel: Return number of bitflipsSascha Hauer2020-11-101-5/+5
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: denali: Update to Linux-5.9Sascha Hauer2020-11-103-1572/+1338
| | | | | | | | | | | | | | 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>
| * mtd: nand: Update to Linux-5.9Sascha Hauer2020-11-1038-2906/+9715
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mtd: nand: orion: Use nand_to_mtd()Sascha Hauer2020-11-091-1/+1
| | | | | | | | | | | | | | 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>
| * mtd: nand: gpmi: Use nand_to_mtd()Sascha Hauer2020-11-091-1/+1
| | | | | | | | | | | | | | 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>
| * mtd: nand: marvell: Use nand_to_mtd()Sascha Hauer2020-11-091-8/+18
| | | | | | | | | | | | | | 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>
| * mtd: nand: denali: Drop multichip supportSascha Hauer2020-11-091-16/+8
| | | | | | | | | | | | | | | | 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>
| * mtd: nand: omap_gpmc: Add missing bch16 stringSascha Hauer2020-11-091-0/+1
| | | | | | | | | | | | | | 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>
| * mtd: nand: omap_gpmc: Fix wrong length checkSascha Hauer2020-11-091-1/+1
| | | | | | | | | | | | | | 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>
| * mtd: nand: omap_gpmc: Drop unused variableSascha Hauer2020-11-091-4/+0
| | | | | | | | | | | | nand->controller is set but never used. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: Add ecc_step_sizeSascha Hauer2020-11-091-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: move function hooks to struct nand_legacySascha Hauer2020-11-0911-325/+326
| | | | | | | | | | | | | | 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>
| * mtd: rename master to parentSascha Hauer2020-11-095-27/+27
| | | | | | | | | | | | | | 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>
| * mtd: rename class_dev to devSascha Hauer2020-11-0922-70/+70
| | | | | | | | | | | | | | | | 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>
| * mtd: Use classdev->parentSascha Hauer2020-11-0917-25/+23
| | | | | | | | | | | | | | | | | | | | 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>
| * mtd: Add underscore prefix to mtd hooksSascha Hauer2020-11-0610-101/+101
| | | | | | | | | | | | | | 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>
| * mtd: nand: Pass struct nand_chip aroundSascha Hauer2020-11-0613-844/+786
| | | | | | | | | | | | | | | | | | 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>
| * mtd: nand: drop unused errstat hookSascha Hauer2020-11-061-15/+0
| | | | | | | | | | | | chip->errstat is never set by any driver, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: drop unused erase_cmd hookSascha Hauer2020-11-061-2/+1
| | | | | | | | | | | | chip->erase_cmd is never used, so remove this hook. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: remove unused header fileSascha Hauer2020-11-061-32/+0
| | | | | | | | | | | | nand.h is unused, remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: Drop asynchronous erase supportSascha Hauer2020-11-069-45/+9
| | | | | | | | | | | | | | 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>
* | Merge branch 'for-next/misc'Sascha Hauer2020-11-105-25/+59
|\ \
| * | of: base: ignore disabled memory nodesRouven Czerwinski2020-11-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | mtd: nand-imx: repair reading the oob areaUwe Kleine-König2020-10-231-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | mci: stm32_sdmmc2: add support for SDMMC v2.0 as wellAhmad Fatoum2020-10-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | mfd: mc34704: fix register readingUwe Kleine-König2020-10-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | net: macb: fix compiler warning for 64 bit systemsMichael Tretter2020-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | net: macb: adjust clk_tx rate for link speed changesMichael Tretter2020-10-191-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | net: macb: reduce DEBUG output to make it more usefulMichael Tretter2020-10-191-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'for-next/imx'Sascha Hauer2020-11-103-46/+215
|\ \ \
| * | | ddr: imx8m: add workaround for DDRPHY rank to rank issueLucas Stach2020-11-093-0/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | ddr: imx8m: clean up entry pointsLucas Stach2020-11-091-45/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | ddr: imx8m: correct the pwrctl setting of selfref_enLucas Stach2020-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | dts: update to v5.10-rc1Sascha Hauer2020-11-091-2/+2
|/ / / | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / / usb: Fix initial max packet sizeSascha Hauer2020-10-271-3/+5
|/ / | | | | | | | | | | | | | | | | 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>
* | Merge branch 'for-next/sandbox' into masterSascha Hauer2020-10-141-0/+65
|\ \
| * | of: implement of_property_read_u64_arrayAhmad Fatoum2020-10-131-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | of: Add common device tree register functionSascha Hauer2020-10-121-0/+28
| |/ | | | | | | | | | | | | | | 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>