summaryrefslogtreecommitdiff
path: root/drivers/mtd
AgeCommit message (Collapse)Author
2018-09-26MT25QU512A flash driver flags update for GrapeboardJoris van Vossen
2018-08-28MT25QU512 Flash support for GrapeboardJoris van Vossen
2018-05-17Grapeboard rescue flash compatibility updateJoris van Vossen
2018-04-18UBIFS and distroboot support and rescue target build merged with default targetJoris van Vossen
2018-04-09LSDK-18.03 Grapeboard initial supportJoris van Vossen
2018-01-12sf: add ADDR_4B for 4byte address supportSuresh Gupta
Some new flash don't support bar register but use 4bytes address to support exceed 16MB flash size. So add flash flag: ADDR_4B for some flash which support 4bytes address. Signed-off-by: Yuan Yao <yao.yuan@nxp.com> Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>
2018-01-12sf: Fix s25fs512s erase size and remove SECT_4K flagSuresh Gupta
As per data sheet, S25FS512S support Uniform sector option or erase size of 256 kbytes and Page Programming buffer of 256 or 512 Bytes. So, flag SECT_4K have no significance for this flash. Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>
2017-12-26mtd: cfi: Fix checking status register featureYork Sun
Commit 72443c7f7d21 ("mtd: cfi: Add support for status register polling") added a feature check to determine if status register is available for certain flash chips. The "lower software bits" register used to determine this feature is not backward compati- ble. Older flash chips without this feature has reserved value 0xff. Instead of checking "lower software bits" register, use CFI primary vendor-specific extended query. Since CFI version 1.4, software features can be read from offset 0x53 according to document AN201168 from Cypress. Signed-off-by: York Sun <york.sun@nxp.com> CC: Marek Vasut <marek.vasut@gmail.com> Tested-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2017-11-14mtd: nand: fsl-ifc: fix support of multiple NAND devicesKurt Kanzenbach
Currently the chipselect used to identify the corresponding NAND chip is stored at the controller and only set during fsl_ifc_chip_init(). This way, only the last NAND chip is working, as the previous value of cs_nand gets overwritten. In order to solve this issue the chipselect is computed on demand by evaluating the bank variable. Thus, the correct chipselect for each NAND chip operation is used. Tested on hardware with two NAND chips connected to the IFC controller. Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de> Acked-by: Scott Wood <oss@buserror.net> [YS: reformatted commit message] Reviewed-by: York Sun <york.sun@nxp.com>
2017-10-25SPL: SPI: select SPL_SPI_FLASH_SUPPORT on SPL_SPI_SUNXIAndre Przywara
The Allwinner SPI flash SPL boot support is guarded by the SPL_SPI_SUNXI symbol. But despite its generic name, the actual only use case for this is to provide SPI flash support to the SPL, which requires CONFIG_SPL_SPI_FLASH_SUPPORT to be defined. Select this symbol from the SPL_SPI_SUNXI Kconfig definition. This avoids doing this explicitly in the defconfig, and fixes SPI booting on the Pine64 SoPine (and -LTS version) and the OrangePi Win board (both with SPI flash). Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-23mtd: replace MTDDEBUG() with pr_debug()Masahiro Yamada
In old days, the MTD subsystem in Linux had debug facility like DEBUG(MTD_DEBUG_LEVEL1, ...). They were all replaced with pr_debug() until Linux 3.2. See Linux commit 289c05222172 ("mtd: replace DEBUG() with pr_debug()"). U-Boot still uses similar macros. Covert all of them for easier sync. Done with the help of Coccinelle. The semantic patch I used is as follows: // <smpl> @@ expression e1, e2; @@ -MTDDEBUG(e1, e2) +pr_debug(e2) @@ expression e1, e2; @@ -MTDDEBUG(e1, e2, +pr_debug(e2, ...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-20Convert CONFIG_NAND_OMAP_GPMC et al and CONFIG_NAND_MXC to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_NAND_MXC CONFIG_NAND_OMAP_GPMC CONFIG_NAND_OMAP_GPMC_PREFETCH CONFIG_NAND_OMAP_ELM CONFIG_SPL_NAND_AM33XX_BCH CONFIG_SPL_NAND_SIMPLE CONFIG_SYS_NAND_BUSWIDTH_16BIT Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> [trini: Finish migration of CONFIG_SPL_NAND_SIMPLE, fix some build issues, add CONFIG_NAND_MXC so we can do CONFIG_SYS_NAND_BUSWIDTH_16BIT] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-18Merge git://git.denx.de/u-boot-spiTom Rini
2017-10-16Drop CONFIG_HAS_DATAFLASHTuomas Tynkkynen
Last user of this option went away in commit: fdc7718999 ("board: usb_a9263: Update to support DT and DM") Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-10-15mtd: nand: denali_dt: add clock supportMasahiro Yamada
Enable clock in the probe hook. The clock rate will be necessary when setup_data_interface hook is supported. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-15mtd: nand: do not check R/B# for CMD_SET_FEATURES in nand_command(_lp)Masahiro Yamada
Set Features (0xEF) command toggles the R/B# pin after 4 sub feature parameters are written. Currently, nand_command(_lp) calls chip->dev_ready immediately after the address cycle because NAND_CMD_SET_FEATURES falls into default: label. No wait is needed at this point. If you see nand_onfi_set_features(), R/B# is already cared by the chip->waitfunc call. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> [ Linux commit: c5d664aa5a4c4b257a54eb35045031630d105f49 ]
2017-10-15mtd: nand: do not check R/B# for CMD_READID in nand_command(_lp)Masahiro Yamada
Read ID (0x90) command does not toggle the R/B# pin. Without this patch, NAND_CMD_READID falls into the default: label, then R/B# is checked by chip->dev_ready(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> [ Linux commit: 3158fa0e739615769cc047d2428f30f4c3b6640e ]
2017-10-04treewide: replace with error() with pr_err()Masahiro Yamada
U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // <smpl> @@@@ -error +pr_err (...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Re-run Coccinelle] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-27sf: bar: Clean BA24 Bank Address Register bit after read/write/erase operationLukasz Majewski
The content of Bank Address Register (BAR) is volatile. It is cleared after power cycle or reset command (RESET F0h). Some memories (like e.g. s25fl256s) use it to access memory larger than 0x1000000 (16 MiB). The problem shows up when one: 1. Reads/writes/erases memory > 16 MiB 2. Calls "reset" u-boot command (which is not causing BAR to be cleared) In the above scenario, the SoC ROM sends 0x000000 address to read SPL. Unfortunately, the BA24 bit is still set and hence it receives content from 0x1000000 (16 MiB) memory address. As a result the SoC aborts and we hang. Only power cycle can take the SoC out of this state. How to reproduce/test: sf probe; sf erase 0x1200000 0x800000; reset sf probe; sf erase 0x1200000 0x800000; sf write 0x11000000 0x1200000 0x800000; reset sf probe; sf read 0x11000000 0x1200000 0x800000; reset Signed-off-by: Lukasz Majewski <lukma@denx.de> [Fixed comment text on clean_bar function] Signed-off-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-09-27SPL: SPI: sunxi: add SPL FIT image supportAndre Przywara
The sunxi-specific SPI load routine only knows how to load a legacy U-Boot image. Teach it how to handle FIT images as well, simply by providing the existing SPL FIT loader with the right loader routine to access the SPI NOR flash. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reported-by: Peter Kosa <kope@madnet.sk> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-09-26Merge git://www.denx.de/git/u-boot-cfi-flashTom Rini
2017-09-26mtd: cfi: Add support for status register pollingMarek Vasut
The status register is optional in the AMD command sets, but it's presence can be checked by reading out CFI table entry 0xc bit 0. If the register is present, prefer using it's bit 7 to determine if the flash is busy over reading the flash ; this is needed ie. on Hyperflash memories. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2017-09-26mtd: cfi: Zap cfi_flash_base in DM caseMarek Vasut
Embed the flash base into struct flash_info instead of having ad-hoc static array in the code. This does not only remove static variable, but also allows CFI-like controllers, ie. HyperFlash ones, to use most of the CFI flash code by populating the flash_info with matching base address. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2017-09-25Fix s25fl256s position in spi_flash_ids listVsevolod Gribov
Spansion S25FS256S and S25FL256S flashes have equal JEDEC ID and ext ID. As far as S25FL256S occures in spi_flash_ids before S25FS256S, U-Boot incorrectly detects FS flash as FL. Thus its better to compare with S25FS256S first. Signed-off-by: Vsevolod Gribov <vgribov@larch-networks.com> [Added S-o-b] Signed-off-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-09-25sf: Fix S25FL116K entryMarek Vasut
The flash chip is 2 MiB , organized as 32 x 64 kiB sectors . Rectify the entry to match the datasheet, reality and Linux SNOR IDs. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-09-25mtd/spi: Add MT35XU512ABA1G12 NOR flash supportYogesh Gaur
Add MT35XU512ABA1G12 parameters to NOR flash parameters array. The MT35XU512ABA1G12 only supports 1 bit mode and 8 bits. It can't support dual and quad. Supports subsector erase with 4KB granularity, have support of FSR(flag status register) and flash size is 64MB. Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-09-21nds32: mtd: add spi flash id MX25U16335E.rick
To support MACRONIX MX25U1635E 16M-BIT flash. Signed-off-by: rick <rick@andestech.com>
2017-09-18mtd: nand: denali: allow to override corrupted revision registerMasahiro Yamada
The Denali IP does not update the revision register properly. Allow to override it with SoC data associated with compatible. Linux had already finished big surgery of this driver, but I need to prepare the NAND core before the full sync of the driver. For now, I am fixing the most fatal problem on UniPhier platform. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-08-30mtd: nand: denali_dt: add a DT driverMasahiro Yamada
A patch for NAND uclass support was proposed about half a year ago: https://patchwork.ozlabs.org/patch/722282/ It was not merged and I do not see on-going work for this. Without DM-based probing, we need to set up pinctrl etc. in an ad-hoc way and give lots of crappy CONFIG options for base addresses and properties, which are supposed to be specified by DT. This is painful. This commit just provides a probe hook to retrieve "reg" from DT and allocate private data in a DM manner. This DT driver is not essentially a NAND driver, in fact it is (ab)using UCLASS_MISC. Once UCLASS_NAND is supported, it would be possible to migrate to it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-08-22mtd: cfi: staticize functionsMarek Vasut
Staticize a few functions and variables which are no longer exposed. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2017-08-16Merge git://git.denx.de/u-boot-spiTom Rini
2017-08-16sf: Preserve QE bit when clearing BP# bits for Macronix flashBin Meng
On some flash (like Macronix), QE (quad enable) bit is in the same status register as BP# bits, and we need preserve its original value during a reboot cycle as this is required by some platforms (like Intel ICH SPI controller working under descriptor mode). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev.com> [Refined code for readability] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename setenv() to env_set()Simon Glass
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-12Convert CONFIG_NAND to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_NAND Signed-off-by: Adam Ford <aford173@gmail.com> [trini: Sync up a few more, add imply's] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-08-08mtd: spi: sf_dataflash: Add print message while erase errorWenyou.Yang@microchip.com
Add the print message to tell us why the erase operation doesn't work. Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-08-08sf: Add Macronix MX25U6435F device parametersBin Meng
This adds support for Macronix flash MX25U6435F (device ID 0xc22537). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-07-31configs: Migrate CMD_NAND*Tom Rini
Migrate all remaining instances of CMD_NAND, CMD_NAND_TRIMFFS CMD_NAND_LOCK_UNLOCK and CMD_NAND_TORTURE from the headers into the defconfig files. Tested-by: Adam Ford <aford173@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-24ubi: Kconfig: Make MTD_UBI select MTD_PARTITIONSKarl Beldan
This missing dependency has probably remained under the radar because MTD_PARTITIONS is still whitelisted. Signed-off-by: Karl Beldan <karl.beldan-ext@sagemcom.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-07-24ubi: Kconfig: Fix MTD_UBI selection dependencyKarl Beldan
Remove the ARCH_SUNXI dependency on selection of RBTREE. Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Jagan Teki <jagan@openedev.com> Signed-off-by: Karl Beldan <karl.beldan-ext@sagemcom.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-07-18Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini
2017-07-12imx: reorganize IMX code as other SOCsStefano Babic
Change is consistent with other SOCs and it is in preparation for adding SOMs. SOC's related files are moved from cpu/ to mach-imx/<SOC>. This change is also coherent with the structure in kernel. Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Fabio Estevam <fabio.estevam@nxp.com> CC: Akshay Bhat <akshaybhat@timesys.com> CC: Ken Lin <Ken.Lin@advantech.com.tw> CC: Marek Vasut <marek.vasut@gmail.com> CC: Heiko Schocher <hs@denx.de> CC: "Sébastien Szymanski" <sebastien.szymanski@armadeus.com> CC: Christian Gmeiner <christian.gmeiner@gmail.com> CC: Stefan Roese <sr@denx.de> CC: Patrick Bruenn <p.bruenn@beckhoff.com> CC: Troy Kisky <troy.kisky@boundarydevices.com> CC: Nikita Kiryanov <nikita@compulab.co.il> CC: Otavio Salvador <otavio@ossystems.com.br> CC: "Eric Bénard" <eric@eukrea.com> CC: Jagan Teki <jagan@amarulasolutions.com> CC: Ye Li <ye.li@nxp.com> CC: Peng Fan <peng.fan@nxp.com> CC: Adrian Alonso <adrian.alonso@nxp.com> CC: Alison Wang <b18965@freescale.com> CC: Tim Harvey <tharvey@gateworks.com> CC: Martin Donnelly <martin.donnelly@ge.com> CC: Marcin Niestroj <m.niestroj@grinn-global.com> CC: Lukasz Majewski <lukma@denx.de> CC: Adam Ford <aford173@gmail.com> CC: "Albert ARIBAUD (3ADEV)" <albert.aribaud@3adev.fr> CC: Boris Brezillon <boris.brezillon@free-electrons.com> CC: Soeren Moch <smoch@web.de> CC: Richard Hu <richard.hu@technexion.com> CC: Wig Cheng <wig.cheng@technexion.com> CC: Vanessa Maegima <vanessa.maegima@nxp.com> CC: Max Krummenacher <max.krummenacher@toradex.com> CC: Stefan Agner <stefan.agner@toradex.com> CC: Markus Niebel <Markus.Niebel@tq-group.com> CC: Breno Lima <breno.lima@nxp.com> CC: Francesco Montefoschi <francesco.montefoschi@udoo.org> CC: Jaehoon Chung <jh80.chung@samsung.com> CC: Scott Wood <oss@buserror.net> CC: Joe Hershberger <joe.hershberger@ni.com> CC: Anatolij Gustschin <agust@denx.de> CC: Simon Glass <sjg@chromium.org> CC: "Andrew F. Davis" <afd@ti.com> CC: "Łukasz Majewski" <l.majewski@samsung.com> CC: Patrice Chotard <patrice.chotard@st.com> CC: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> CC: Hans de Goede <hdegoede@redhat.com> CC: Masahiro Yamada <yamada.masahiro@socionext.com> CC: Stephen Warren <swarren@nvidia.com> CC: Andre Przywara <andre.przywara@arm.com> CC: "Álvaro Fernández Rojas" <noltari@gmail.com> CC: York Sun <york.sun@nxp.com> CC: Xiaoliang Yang <xiaoliang.yang@nxp.com> CC: Chen-Yu Tsai <wens@csie.org> CC: George McCollister <george.mccollister@gmail.com> CC: Sven Ebenfeld <sven.ebenfeld@gmail.com> CC: Filip Brozovic <fbrozovic@gmail.com> CC: Petr Kulhavy <brain@jikos.cz> CC: Eric Nelson <eric@nelint.com> CC: Bai Ping <ping.bai@nxp.com> CC: Anson Huang <Anson.Huang@nxp.com> CC: Sanchayan Maity <maitysanchayan@gmail.com> CC: Lokesh Vutla <lokeshvutla@ti.com> CC: Patrick Delaunay <patrick.delaunay@st.com> CC: Gary Bisson <gary.bisson@boundarydevices.com> CC: Alexander Graf <agraf@suse.de> CC: u-boot@lists.denx.de Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-07-12mx6: soc: Move mxs_dma_init() into the mxs nand driverFabio Estevam
Currently the following build error is seen when a board using MMC SPL is built and the MXS nand driver is also selected: arch/arm/cpu/armv7/built-in.o: In function `arch_cpu_init': arch/arm/cpu/armv7/mx6/soc.c:432: undefined reference to 'mxs_dma_init' On mx6 the only user of mxs_dma_init() is the mxs nand driver, so move it there. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
2017-07-12mtd: nand: make nand_info array staticGrygorii Strashko
Make make nand_info array static, since all direct users of nand_info array have been converted to use get_nand_dev_by_index() API. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
2017-07-12mtd: nand: drv: use get_nand_dev_by_index()Grygorii Strashko
As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
2017-07-12cmd: nand: abstract global variable usage for dm conversionMugunthan V N
nand_info is used all over the file so abstract it with get_nand_dev_by_index() which will help for DM conversion. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
2017-07-10mtd: stm32: use parameter instead of default valuePatrice Chotard
To set wait state, a hard coded value is used instead of using latency parameter. stm32_flash_latency_cfg() is currently used in arch/arm/mach-stm32/stm32f4/clock.c and in drivers/clk/clk_stm32f7.c with, in both case, "5" as parameter. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-06-23mtd: OneNAND: Fix onenand_block_markbadLadislav Michl
commit dfe64e2c89731a3f9950d7acd8681b68df2bae03 Author: Sergey Lapin <slapin@ossfans.org> Date: Mon Jan 14 03:46:50 2013 +0000 mtd: resync with Linux-3.7.1 modified onenand_block_markbad to call mtd_block_markbad, but as _block_markbad function pointer used by mtd_block_markbad to do actual job is by default pointing back to onenand_block_markbad there is no way this function ever finishes its job. Fix it by changing function body according current (4.12-rc6) linux implementation. Tested on IGEPv2 board with Muxed OneNAND(DDP) 512MB containing several unerasable blocks this function marked bad. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2017-06-23onenand_spl_simple: Add DDP OneNAND supportLadislav Michl
Current implementation is unable to access second half of DDP OneNAND flash (reads first half mirrored). Use block and bufferram address calculations from onenand_base to fix this. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2017-06-23onenand_spl_simple: Call onenand_spl_get_geometry() only onceLadislav Michl
Do not call onenand_spl_get_geometry() for each block read. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>