summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* gpio: mxc_gpio: add support for i.MX8Peng Fan2018-10-221-9/+21
| | | | | | | | Add i.MX8 support, there are 8 GPIO banks. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Anatolij Gustschin <agust@denx.de> Cc: Stefano Babic <sbabic@denx.de>
* misc: imx8: add scfw api impementationPeng Fan2018-10-222-1/+368
| | | | | | | | | | Add clk/misc/pad/pm/rm scfw api implementaion for different drivers to invoke. The low level code is using misc_call to invoke imx8_scu driver. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Anatolij Gustschin <agust@denx.de> Cc: Stefano Babic <sbabic@denx.de>
* misc: add i.MX8 misc driverPeng Fan2018-10-223-0/+270
| | | | | | | | | Add i.MX8 MISC driver to handle the communication between A35 Core and SCU. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Anatolij Gustschin <agust@denx.de> Cc: Stefano Babic <sbabic@denx.de>
* Kconfig: sandbox: enable cmd_avb and dependenciesJens Wiklander2018-10-071-0/+2
| | | | | | | | | Enables cmd_avb and its dependencies need to run the AVB tests. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> [trini: Disable for sandbox_noblk] Signed-off-by: Tom Rini <trini@konsulko.com>
* tee: add sandbox driverJens Wiklander2018-10-074-3/+326
| | | | | | | | | | | Adds a sandbox tee driver which emulates a generic TEE with the OP-TEE AVB TA. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Fix printf warnings in ta_avb_invoke_func, slots is uint] Signed-off-by: Tom Rini <trini@konsulko.com>
* tee: optee: support AVB trusted applicationJens Wiklander2018-10-072-0/+40
| | | | | | | | | | | Adds configuration option OPTEE_TA_AVB and a header file describing the interface to the Android Verified Boot 2.0 (AVB) trusted application provided by OP-TEE. Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* optee: support routing of rpmb data frames to mmcJens Wiklander2018-10-075-1/+247
| | | | | | | | | | Adds support in optee supplicant to route signed (MACed) RPMB frames from OP-TEE Secure OS to MMC and vice versa to manipulate the RPMB partition. Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* tee: add OP-TEE driverJens Wiklander2018-10-0710-0/+1900
| | | | | | | | | | | | | Adds a OP-TEE driver. * Targets ARM and ARM64 * Supports using any U-Boot memory as shared memory * Probes OP-TEE version using SMCs * Uses OPTEE message protocol version 2 to communicate with secure world Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
* Add UCLASS_TEE for Trusted Execution EnvironmentJens Wiklander2018-10-075-0/+226
| | | | | | | | | | | | | | | | | | Adds a uclass to interface with a TEE (Trusted Execution Environment). A TEE driver is a driver that interfaces with a trusted OS running in some secure environment, for example, TrustZone on ARM cpus, or a separate secure co-processor etc. The TEE subsystem can serve a TEE driver for a Global Platform compliant TEE, but it's not limited to only Global Platform TEEs. The over all design is based on the TEE subsystem in the Linux kernel, tailored for U-Boot. Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
* mmc: rpmb: add mmc_rpmb_route_frames()Jens Wiklander2018-10-071-0/+160
| | | | | | | | | Adds mmc_rpmb_route_frames() to route RPMB data frames from/to an external entity. Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: fdt: scan for devices under /firmware tooJens Wiklander2018-10-071-5/+10
| | | | | | | | Just as /chosen may contain devices /firmware may contain devices, scan for devices under /firmware too. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
* misc: Add support for the Arm Versatile Express config busLiviu Dudau2018-10-063-0/+137
| | | | | | | | | | | | Add support for the Arm Versatile Express config bus that is being used for exposing various subsystems via a generic configuration bus. This driver adds support for generating transactions on this configuration bus and can be used by other drivers to abstract the communication with the actual function providers. Signed-off-by: Liviu Dudau <liviu.dudau@foss.arm.com> Reviewed-by: Heiko Schocher <hs@denx.de>
* Merge branch 'master' of git://git.denx.de/u-boot-shTom Rini2018-10-053-0/+170
|\
| * phy: rcar: Add R-Car Gen3 PHY driverMarek Vasut2018-10-033-0/+170
| | | | | | | | | | | | | | | | | | Add a PHY driver for the R-Car Gen3 which allows configuring USB OTG PHY on Gen3 into host mode and toggles VBUS in case a dedicated regulator is present. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* | Merge branch 'master' of git://git.denx.de/u-boot-socfpgaTom Rini2018-10-051-9/+2
|\ \
| * | gpio: dwapb_gpio: Change to use devm_kcalloc()Ley Foon Tan2018-10-031-9/+2
| |/ | | | | | | | | | | | | Change to use managed resource function devm_kcalloc(), so it will auto free memory when driver is removed. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
* | Merge tag 'rockchip-for-v2018.11-rc2' of git://git.denx.de/u-boot-rockchipTom Rini2018-10-051-17/+63
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rockchip-focused changes for v2018.11-rc2: - fixes to rkimage for SPL boot via USB - fixes to make_fit_atf.py, incl. entry-point calculation and python3 compatibility - OP-TEE support for ARMv7-based SoCs - fixes to RGMII/GMII selection on the RK3328 Signed-off-by: Tom Rini <trini@konsulko.com>
| * | net: gmac_rockchip: Add handling for RGMII_ID/RXID/TXIDJanine Hagemann2018-10-041-17/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using PHY internal delays in combination with the phy-mode rgmii-id/rxid/txid was not possible. Only rgmii was supported. Now we can disable rockchip's gmac delay lines and also use rgmii-id/rxid/txid. Based on commit eaf70ad14cbb ("net: stmmac: dwmac-rk: Add handling for RGMII_ID/RXID/TXID") for mainline linux kernel. Signed-off-by: Janine Hagemann <j.hagemann@phytec.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: David Wu <david.wu@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * | net: gmac_rockchip: Fix a register write in rk3328_gmac_set_to_rgmiiJanine Hagemann2018-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to use RK3328_RXCLK_DLY_ENA_GMAC_ENABLE instead of RK3328_RXCLK_DLY_ENA_GMAC_MASK in rk3328_gmac_set_to_rgmii() to enable the RX delay. The MASK was used in a wrong way. Signed-off-by: Janine Hagemann <j.hagemann@phytec.de> Reviewed-by: Philipp Tomisch <philipp.tomisch@theobroma-systems.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* | | Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2018-10-048-1/+468
|\ \ \ | |/ / |/| |
| * | spi: Add SPI driver for MT76xx SoCsStefan Roese2018-10-043-0/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the SPI driver for the MediaTek MT7688 SoC (and derivates). Its been tested on the LinkIt Smart 7688 and the Gardena Smart Gateway with and SPI NOR on CS0 and on the Gardena Smart Gateway additionally with an SPI NAND on CS1. Note that the SPI controller only supports a max transfer size of 32 bytes. This driver implementes a workaround to enable bigger xfer sizes to speed up the transfer especially for the SPI NAND support. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Jagan Teki <jagan@openedev.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Piotr Dymacz <pepe2k@gmail.com> Reviewed-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
| * | mtd: nand: spi: Add Gigadevice SPI NAND supportStefan Roese2018-10-043-1/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Gigadevices SPI NAND device to the new SPI NAND infrastructure in U-Boot. Currently only the 128MiB GD5F1GQ4UC device is supported. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Boris Brezillon <boris.brezillon@bootlin.com> Cc: Jagan Teki <jagan@openedev.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com>
| * | sf: Add XMC xm25qh64a and xm25qh128a entriesStefan Roese2018-10-042-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for 2 new XMC (Wuhan Xinxin Semiconductor Manufacturing Corp) SPI NOR chips. This support can be enabled by selecting the SPI_FLASH_XMC Kconfig option. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
* | | Merge tag 'rockchip-for-v2018.11' of git://git.denx.de/u-boot-rockchipTom Rini2018-10-032-2/+31
|\ \ \ | |/ / |/| | | | | Rockchip changes for 2018.11
| * | rockchip: dwmmc: add rk2928-dw-mshc compatibleHeiko Stuebner2018-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The rk3188 works nicely with the rockchip mmc driver, so we just need to add the different compatible for it - as used in the Linux kernel. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * | mmc: dw_mmc: check fifo status with a timeout in fifo modeHeiko Stuebner2018-10-021-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While trying to enable the dw_mmc on rk3188 I managed to confuse and hang the dw_mmc controller into not delivering further data. The fifo state never became ready and the driver was iterating in the while loop reading 0-byte packets forever. So inspired by how other implementations handle this, check the fifo- state beforhand and add a timeout to catch any glaring fifo issues without hanging uboot altogether. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* | | i2c: Add support for the Arm's Versatile Express I2C controller.Liviu Dudau2018-10-031-0/+280
| |/ |/| | | | | | | | | | | | | | | The Arm Versatile Express I2C controller is a simple register-based controller that uses a register to control the state of the SCL and SDA lines. Add support for it. Signed-off-by: Liviu Dudau <liviu.dudau@foss.arm.com> Reviewed-by: Heiko Schocher <hs@denx.de>
* | Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2018-10-0276-888/+3892
|\ \ | |/ |/| | | | | | | | | This is the PR for SPI-NAND changes along with few spi changes. [trini: Re-sync changes for ls1012afrwy_qspi*_defconfig] Signed-off-by: Tom Rini <trini@konsulko.com>
| * spi: sh_qspi: Add DM support to SH QSPI driverMarek Vasut2018-10-021-65/+150
| | | | | | | | | | | | | | | | | | | | | | Add DM support to the SH QSPI driver while retaining non-DM support. The later is required as this driver is used in SPL which has a size limitation of 16 kiB. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> [jagan: use proper commit head] Reviewed-by: Jagan Teki <jagan@openedev.com>
| * driver/spi: fsl_qspi: Remove non-DM stuffAshish Kumar2018-10-021-138/+0
| | | | | | | | | | | | | | | | | | Convert fsl_qspi.c to complete DM mode. Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com> Tested-by: Rajat Srivastava <rajat.srivastava@nxp.com> Tested-by: Ye Li <ye.li@nxp.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * spi: designware_spi: Add reset ctrl to driverLey Foon Tan2018-10-021-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code to reset all reset signals as in SPI DT node. A reset property is an optional feature, so only print out a warning and do not fail if a reset property is not present. If a reset property is discovered, then use it to deassert, thus bringing the IP out of reset. Release reset when _remove(). Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * cmd: mtd: add 'mtd' commandMiquel Raynal2018-10-022-2/+161
| | | | | | | | | | | | | | | | | | | | | | | | There should not be a 'nand' command, a 'sf' command and certainly not a new 'spi-nand' command. Write a 'mtd' command instead to manage all MTD devices/partitions at once. This should be the preferred way to access any MTD device. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
| * mtd: mtdpart: implement proper partition handlingMiquel Raynal2018-10-022-238/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of collecting partitions in a flat list, create a hierarchy within the mtd_info structure: use a partitions list to keep track of the partitions of an MTD device (which might be itself a partition of another MTD device), a pointer to the parent device (NULL when the MTD device is the root one, not a partition). By also saving directly in mtd_info the offset of the partition, we can get rid of the mtd_part structure. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
| * mtd: uboot: search for an equivalent MTD name with the mtdidsMiquel Raynal2018-10-021-1/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using an MTD device (resp. partition) name in mtdparts is simple and straightforward. However, for a long time already, another name was given in mtdparts to indicate a device (resp. partition) so the "mtdids" environment variable was created to do the match. Let's create a function that, from an MTD device (resp. partition) name, search for the equivalent name in the "mtdparts" environment variable thanks to the "mtdids" string. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
| * mtd: mtdpart: add a generic mtdparts-like parserMiquel Raynal2018-10-021-0/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current parser is very specific to U-Boot mtdparts implementation. It does not use MTD structures like mtd_info and mtd_partition. Copy and adapt the current parser in drivers/mtd/mtd-uclass.c (to not break the current use of mtdparts.c itself) and write some kind of a wrapper around the current implementation to allow other commands to benefit from this parsing in a user-friendly way. This new function will allocate an mtd_partition array for each successful call. This array must be freed after use by the caller. The given 'mtdparts' buffer pointer will be moved forward to the next MTD device (if any, it will point towards a '\0' character otherwise). Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
| * mtd: uclass: add probe functionMiquel Raynal2018-10-021-0/+16
| | | | | | | | | | | | | | | | | | | | The user might want to trigger the probe of any MTD device, export these functions so they can be called from a command source file. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
| * mtd: mtdpart: balance debug messagesMiquel Raynal2018-09-201-0/+2
| | | | | | | | | | | | | | Balance debug message in the partition allocation/removal process in order to keep track of them more easily. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
| * mtd: declare MTD_PARTITIONS symbol in KconfigMiquel Raynal2018-09-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | UBI selects MTD_PARTITIONS which is the symbol to compile drivers/mtd/mtdpart.c. Unfortunately, the symbol was not defined in Kconfig and this worked only with board files defining it. Fix this by adding a boolean in Kconfig so boards defined by defconfig files only will work as expected. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
| * mtd: spinand: Add initial support for the MX35LF2GE4AB chipMiquel Raynal2018-09-201-6/+14
| | | | | | | | | | | | | | | | Add support for the MX35LF2GE4AB chip, which is similar to its cousin MX35LF1GE4AB, with two planes instead of one. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com>
| * mtd: spinand: Add initial support for the MX35LF1GE4AB chipBoris Brezillon2018-09-203-1/+140
| | | | | | | | | | | | | | Add minimal support for the MX35LF1GE4AB SPI NAND chip. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com>
| * mtd: spinand: Add initial support for Winbond W25M02GVFrieder Schrempf2018-09-203-1/+145
| | | | | | | | | | | | | | | | | | Add support for the W25M02GV chip. Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com>
| * mtd: spinand: Add initial support for Micron MT29F2G01ABAGDPeter Pan2018-09-203-1/+153
| | | | | | | | | | | | | | | | | | | | | | Add a basic driver for Micron SPI NANDs. Only one device is supported right now, but the driver will be extended to support more devices afterwards. Signed-off-by: Peter Pan <peterpandong@micron.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com>
| * mtd: nand: Add core infrastructure to support SPI NANDsPeter Pan2018-09-205-0/+1249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a SPI NAND framework based on the generic NAND framework and the spi-mem infrastructure. In its current state, this framework supports the following features: - single/dual/quad IO modes - on-die ECC Signed-off-by: Peter Pan <peterpandong@micron.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com>
| * spi: Extend the core to ease integration of SPI memory controllersBoris Brezillon2018-09-203-0/+509
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some controllers are exposing high-level interfaces to access various kind of SPI memories. Unfortunately they do not fit in the current spi_controller model and usually have drivers placed in drivers/mtd/spi-nor which are only supporting SPI NORs and not SPI memories in general. This is an attempt at defining a SPI memory interface which works for all kinds of SPI memories (NORs, NANDs, SRAMs). Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com>
| * mtd: nand: Add core infrastructure to deal with NAND devicesBoris Brezillon2018-09-204-0/+380
| | | | | | | | | | | | | | | | | | | | Add an intermediate layer to abstract NAND device interface so that some logic can be shared between SPI NANDs, parallel/raw NANDs, OneNANDs, ... Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com>
| * mtd: rename nand into rawnand in Kconfig promptMiquel Raynal2018-09-201-1/+1
| | | | | | | | | | | | Sync the Kconfig raw NAND entry title with the code architecture. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
| * mtd: move NAND files into a raw/ subdirectoryMiquel Raynal2018-09-2055-377/+382
| | | | | | | | | | | | | | | | | | NAND flavors, like serial and parallel, have a lot in common and would benefit to share code. Let's move raw (parallel) NAND specific code in a raw/ subdirectory, to ease the addition of a core file in nand/ and the introduction of a spi/ subdirectory specific to SPI NANDs. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
| * mtd: move all flash categories inside MTD submenuMiquel Raynal2018-09-201-2/+2
| | | | | | | | | | | | | | | | There is no reason to have NAND, SPI flashes and UBI sections outside of the MTD submenu in Kconfig. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * mtd: move definitions to enlarge their rangeMiquel Raynal2018-09-201-6/+0
| | | | | | | | | | | | | | Some helpers might be useful in a future 'mtd' U-Boot command to parse MTD device list. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
| * mtd: Fallback to ->_read/write() when ->_read/write_oob() is missingMiquel Raynal2018-09-201-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some MTD sublayers/drivers are implementing ->_read/write() and not ->_read/write_oob(). While for NAND devices both are usually valid, for NOR devices, using the _oob variant has no real meaning. But, as the MTD layer is supposed to hide as much as possible the flash complexity to the user, there is no reason to error out while it is just a matter of rewritting things internally. Add a fallback on mtd->_read() (resp. mtd->_write()) when the user calls mtd_read_oob() (resp. mtd_write_oob()) while mtd->_read_oob() (resp. mtd->_write_oob) is not implemented. There is already a fallback on the _oob variant if the former is used. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>