summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* net: macb: fix wrong return values on some errorsAhmad Fatoum2020-10-021-1/+1
| | | | | | | | Coccinelle detected that the IS_ERR and ERR_PTR are mismatched. Fix it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: fix unterminated of_device_id[] reported by CoccinelleAhmad Fatoum2020-10-023-0/+3
| | | | | | | | driver_d::of_compatible outght to point at a NULL-terminated array. Fix instances where this is not the case. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/protonic' into masterSascha Hauer2020-09-253-0/+60
|\
| * of: of_device_get_match_compatible() helperOleksij Rempel2020-08-241-0/+12
| | | | | | | | | | | | | | | | | | Some times we need to know, against which compatible did the driver was registered. So, instead of coding it in the driver, add generic helper for all drivers. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpiolib: add gpio_array_to_id helper to get ID out of GPIO arrayOleksij Rempel2020-08-241-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | Some boards provide a board version and/or ID coded by pull-up/down resistors connected to the gpio pins (or pins which can be multiplexed at some point as gpio). In this case every one implements own gpio id reader function. To avoid it, provide the common helper function to extract a value out of provided gpio array. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: base: register DT root as deviceOleksij Rempel2020-08-241-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A usual board file contains at least one of_machine_is_compatible(). Some of the have a rather long list with complicated version logic. To avoid own implementation for driver management, register the root node of device tree as platform device. So, the main platform bus can attach proper board driver. After this patch a typical board.c file can reuse existing driver infrastructure. After this patch, you will be able to see all registered board drivers with drvinfo as fallow: ... board-embest-riot board-protonic-imx6 machine ... With devinfo, you'll be able to get some board specific information, if this is implemented: barebox@Protonic PRTI6Q board:/ devinfo machine Driver: board-protonic-imx6 Bus: platform Parameters: boardid: 0 (type: uint32) boardrev: 1 (type: uint32) Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/powerpc' into masterSascha Hauer2020-09-251-1/+1
|\ \
| * | powerpc: Make locally used functions staticSascha Hauer2020-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | Make only locally used functions static to avoid -Wmissing-prototypes warnings. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/net' into masterSascha Hauer2020-09-254-15/+99
|\ \ \
| * | | usb: fastboot: execute commands in command contextSascha Hauer2020-08-191-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Long lived commands which also use other resources shouldn't be executed in a poller. Use a workqeue to delay the work to command context. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fastboot: init list head in commonSascha Hauer2020-08-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The list of variables can be initialized in common code, no need to do the in the different implementations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usbnet: shorten timeout when polling for receive packetsSascha Hauer2020-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When no packets are coming in we have to wait for usb_bulk_message() to timeout. Since we call net_poll() from a poller we have to wait for this timeout every 10ms when no packets are coming in. Decrease this timeout to not unnecessarily slow down barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usbnet: Add sliceSascha Hauer2020-08-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Both the ethernet device and the mdio bus of a USB network controller need the USB bus. Add dependencies to it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: Add a slice to usb host controllersSascha Hauer2020-08-191-5/+7
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: mdiobus: Add sliceSascha Hauer2020-08-191-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By adding a slice to the mdio bus we make the mdio code safe for being called in a poller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/mmc' into masterSascha Hauer2020-09-252-10/+106
|\ \ \ \
| * | | | mci: mci-core: fix long lasting FIXMEsJuergen Borleis2020-09-151-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: mci-core: add GPP supportJuergen Borleis2020-09-142-2/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | General Purpose Partitions (GPP) are hardware partitions like the boot partitions. And like the boot partitions they are limited to MMCs only. Most applications running an eMMC do not use GPPs, so this feature can be disabled. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: kconfig: explain what boot partitions areJuergen Borleis2020-09-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | Merge branch 'for-next/misc' into masterSascha Hauer2020-09-2512-74/+168
|\ \ \ \ \
| * | | | | usb: dwc3-of-simple: Use clk_bulk APISascha Hauer2020-09-241-48/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use clk_bulk_get_all() to retrieve all clocks rather than open code this. Also actually enable the clocks, previously they had been disabled in the error path, but never enabled before. Also this fixes a memory corruption: The driver populated an array of clks, but only allocated space for a single entry. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | clk: Add clk_bulk_[get|put]_all()Sascha Hauer2020-09-241-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | usb: dwc3: Whitespace cleanupSascha Hauer2020-09-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace spaces with tabs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | clk_dump command: Allow printing a single clockSascha Hauer2020-09-231-5/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far the clk_dump command can only print all clocks. With this patch we can limit the output to ancestors and children of a given clock. This makes it easier to find the desired information in big clock trees. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | mci: bcm2835: depend on sdhciRoland Hieber2020-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver uses functions defined in sdhci.o, and will fail to build otherwise: drivers/mci/mci-bcm2835.o: in function `bcm2835_mci_request': drivers/mci/mci-bcm2835.c:134: undefined reference to `sdhci_set_cmd_xfer_mode' arm-v5te-linux-gnueabi-ld: drivers/mci/mci-bcm2835.c:169: undefined reference to `sdhci_read_response' arm-v5te-linux-gnueabi-ld: drivers/mci/mci-bcm2835.c:175: undefined reference to `sdhci_transfer_data' Fixes: f8dffc9338dc2c7ae830 (2019-11-19, "mci: bcm2835: Use sdhci_set_cmd_xfer_mode()") Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | mfd: stpmic1: warn if reset reason detection failsAhmad Fatoum2020-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stpmic1_set_reset_reason returns an error code, but so far we didn't check it. Fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>