summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of git://git.denx.de/u-boot-imxTom Rini2016-01-251-2/+2
|\
| * imx: nand: update GPMI NAND driver to support MX7Peng Fan2016-01-241-2/+2
| | | | | | | | | | | | | | Update GPMI NAND driver and BCH head file to support i.MX7 Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
* | bug.h: move BUILD_BUG_* defines to include/linux/bug.hMasahiro Yamada2016-01-251-0/+1
|/ | | | | | | | | | | | | | | | BUILD_BUG_* macros have been defined in several headers. It would be nice to collect them in include/linux/bug.h like Linux. This commit is cherry-picking useful macros from include/linux/bug.h of Linux 4.4. I did not import BUILD_BUG_ON_MSG() because it would not work if it is used with include/common.h in U-Boot. I'd like to postpone it until the root cause (the "error()" macro in include/common.h causes the name conflict with "__attribute__((error()))") is fixed. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* spi: Correct device tree usage in spi_flash_decode_fdt()Simon Glass2016-01-211-6/+3
| | | | | | | | | | | This function currently searches the entire device tree for a node that it thinks is relevant. But the node is known and is passed in. Correct the code and enable it only with driver model, since only driver-model boards will use it. This avoids bringing in a large number of strings from fdtdec. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add more SPDX-License-Identifier tagsTom Rini2016-01-192-20/+2
| | | | | | | | | In a number of places we had wordings of the GPL (or LGPL in a few cases) license text that were split in such a way that it wasn't caught previously. Convert all of these to the correct SPDX-License-Identifier tag. Signed-off-by: Tom Rini <trini@konsulko.com>
* dm: spi_flash: Allow the uclass to work without printf()Simon Glass2016-01-151-1/+7
| | | | | | | For SPL we don't really need sprintf() and with tiny-printf this is not available. Allow this to be dropped in SPL when using tiny-printf. Signed-off-by: Simon Glass <sjg@chromium.org>
* sf: Make IO modes at last in read modesJagan Teki2016-01-132-3/+3
| | | | | | | | | | | | SLOW, FAST, DUAL, DUAL_IO, QUAD, QUAD_IO changed order to SLOW, FAST, DUAL, QUAD, DUAL_IO, QUAD_IO Cc: Simon Glass <sjg@chromium.org> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Tested-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* spi: Rename op_mode_rx to mode_rxJagan Teki2016-01-131-1/+1
| | | | | | | | | | | | | | Since spi rx mode macro's are renamed to simple and meaninfull, this patch will rename the respective structure members. Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Tested-by: Mugunthan V N <mugunthanvnm@ti.com> Tested-by: Jagan Teki <jteki@openedev.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Write quad bit along with read statusJagan Teki2016-01-131-2/+2
| | | | | | | | | | | | | | | | While setting quad bit on spansion, macronix code is writing only particular quad bit this may give wrong functionality with other register bits, So this patch fix the issue where it with write previous read reg status along particular quad bit. Cc: Vignesh R <vigneshr@ti.com> Cc: Mugunthan V N <mugunthanvnm@ti.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Read back and check once macronix quad bit setJagan Teki2016-01-131-6/+12
| | | | | | | | | | | | One macronix quad bit set using SR, it's good to read back and check the written bit and also if it's already been set check for the bit and return. Cc: Vignesh R <vigneshr@ti.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Tested-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Read back and check once spansion quad bit setJagan Teki2016-01-131-6/+12
| | | | | | | | | | | | | | One spansion quad bit set using CR, it's good to read back and check the written bit and also if it's already been set check for the bit and return. Cc: Vignesh R <vigneshr@ti.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Tested-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Fix quad bit set for micron devicesJagan Teki2016-01-132-2/+63
| | | | | | | | | | | | | | | Setting up quad bit for micron devices need to do the same way as other flash devices like spansion, winbond etc does using enhanced volatile config register so this patch adds this support instead of printing "QEB is volatile" Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Peter Pan <peterpandong@micron.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Use BIT macroJagan Teki2016-01-131-21/+21
| | | | | | | Used BIT macro like 1 << nr as BIT(nr) where nr is 0...n Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Minor cleanupJagan Teki2016-01-131-6/+6
| | | | | | | | | - Tab space - Place all read commands at one place. - Re-arrange write commands. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Remove spi_flash_removeJagan Teki2016-01-131-6/+1
| | | | | | | | Use direct call to device_remove instead of exctra spi_flash_remove defination. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Rename bank_end to bar_end in read_barJagan Teki2016-01-131-2/+2
| | | | | | | | bar_end gives more meaningfull compared to bank_end and spi_flash_write_bar uses bar_end so replaced bank_end with bar_end in spi_flash_read_bar Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Rename spi_flash_set_* functionsJagan Teki2016-01-131-6/+6
| | | | | | | Since quad_mode functions are local to spi flash core, rename them to a meaningful and readable names. Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Move spi_read_cmds_array locallyJagan Teki2016-01-131-12/+8
| | | | | | | | | | Since spi_read_cmds_array is used locally in spi_flash_scan, so move array to locally used function instead of defining global array. Tested-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* spi: Rename SPI_TX_BP|QPP to SPI_TX_BYTE|QUADJagan Teki2016-01-132-3/+3
| | | | | | | | | | | | | | Since SPI_TX_* are spi_slave{} members so use spi protocol notation instead spi flash programming, like SPI_TX_BP => SPI_TX_BYTE SPI_TX_QPP => SPI_TX_QUAD Cc: Simon Glass <sjg@chromium.org> Tested-by: Jagan Teki <jteki@openedev.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* spi: Use mode instead of op_mode_txJagan Teki2016-01-132-3/+3
| | | | | | | | | | Used mode member from spi_slave{} instead of op_mode_tx. Cc: Simon Glass <sjg@chromium.org> Tested-by: Jagan Teki <jteki@openedev.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Get spi locally from spi_flashJagan Teki2016-01-131-22/+29
| | | | | | | | | | | For better code readabilty, get the spi pointer from spi_flash{} locally and use it instead of direct dereferring spi pinter as flash->spi->* Tested-by: Jagan Teki <jteki@openedev.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2016-01-071-2/+2
|\
| * spi: spi_flash: Fix the arguments of stm_is_locked_sr()Fabio Estevam2016-01-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | stm_is_locked_sr() takes the status register (SR) value as the last parameter, not the second. Based on a patch from Brian Norris for the linux kernel: http://git.infradead.org/linux-mtd.git/commit/a32d5b726ff8cf32bf491522b0ac8ae2545a063e Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Jagan Teki <jteki@openedev.com>
* | UBI: Fix compile error when CONFIG_UBI_SILENCE_MSG definedLadislav Michl2016-01-041-1/+0
| | | | | | | | | | | | | | | | drivers/mtd/ubi/io.c:1354:3: error: 'dump_len' undeclared (first use in this function) dump_len = max_t(int, 128, len - i); Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
* | altera_qspi: allow ctrl-c to abort the erase opsThomas Chou2015-12-281-0/+9
| | | | | | | | | | | | Allow ctrl-c to abort the erase ops. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* | altera_qspi: show erase progressThomas Chou2015-12-281-0/+14
| | | | | | | | | | | | Show sector erase progress with dot and comma. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* | altera_qspi: skip erase if the sector is blankThomas Chou2015-12-281-14/+25
| | | | | | | | | | | | | | Skip erase if the sector is blank. The sector erase is slow, and may take 0.7 sec typically or up to 3 sec worst-case. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* | altera_qspi: set fail_addr for erase opsThomas Chou2015-12-281-0/+1
| | | | | | | | | | | | | | | | If the erase fails, fail_addr might indicate exactly which block failed. If fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not at the device level or was not specific to any particular block. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* | altera_qspi: call callback even if the erase failedThomas Chou2015-12-281-0/+1
|/ | | | | | | | Erase is an asynchronous operation. Device drivers are supposed to call instr->callback() whenever the operation completes, even if it completes with a failure. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* altera_qspi: initialize instr.mtd in flash_eraseThomas Chou2015-12-191-0/+1
| | | | | | | | Initialize instr.mtd in flash_erase(). This fixes the system hang issue when CONFIG_MTD_PARTITIONS is selected. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
* sf: Rename sf_ops.c to spi-flash.cJagan Teki2015-12-112-4/+5
| | | | | | | | | Since all spi-flash core operations are moved into sf_ops.c then it's better to renamed as spi-flash.c Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Use static for file-scope functionsJagan Teki2015-12-111-5/+5
| | | | | | | | Used static for file-scope functions in sf_probe.c Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: sf_probe: Remove spi_slave pointer argumentJagan Teki2015-12-113-9/+10
| | | | | | | | | | | | | | Since spi_slave is a spi pointer in spi_flash{} then assign spi_slave{} pointer to flash->spi and remove spi_slave pointer argument to - spi_flash_probe_slave - spi_flash_scan Tested-by: Jagan Teki <jteki@openedev.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: ops: Fix missing break on spansion read_barJagan Teki2015-12-111-0/+1
| | | | | | | | For assigning read_bar commands in spansion case, break is missing this patch add that break. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Remove unneeded SST_BP and SST_WPJagan Teki2015-12-111-5/+2
| | | | | | | | | | | | SST parts added on sf_params.c supports both SST_WR which consits of both BP and WP and there is a spi controller ich which supports only BP so the relevent _write hook set based on "slave->op_mode_tx" hence there is no respective change required from flash side hance removed these. Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Remove unneeded header includesJagan Teki2015-12-112-5/+0
| | | | | | | | Removed unneeded header includes in sf_ops and sf_probe Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Flash power up read-only based on idcode0Jagan Teki2015-12-112-4/+4
| | | | | | | | | | | | Using macro's for flash power up read-only access code leads wrong behaviour hence use idcode0 for runtime detection, hence the flash which require this functionality gets detected at runtime. Tested-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Use simple name for register access functionsJagan Teki2015-12-111-26/+26
| | | | | | | | | | Most of the register access function are static, so used simple name to represent each. Tested-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Fix MakefileJagan Teki2015-12-111-5/+1
| | | | | | | | This patch removes unneeded ifdef and fixed accordingly. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Use static for file-scope functionsJagan Teki2015-12-112-23/+6
| | | | | | | | | Use static for file-scope functions and removed them from header files. Tested-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: probe: Code cleanupJagan Teki2015-12-111-41/+39
| | | | | | | | | | | | - Move bar read code below the bar write hance both at once place, hence it easy for #ifdef macro only once and readable. - Move read_cmd_array at top Tested-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Move read_id code to sf_opsJagan Teki2015-12-113-19/+20
| | | | | | | | | | | read_id code is related to spi_flash stuff hence moved to sf_ops. Tested-by: Jagan Teki <jteki@openedev.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: Move spi_flash_scan code to sf_opsJagan Teki2015-12-113-342/+357
| | | | | | | | | | | | | | | Intension is that sf_ops should deals all spi_flash related stuff and sf_probe (which should renamed future) should be an interface layer for spi_flash versus spi drivers. sf_ops => spi_flash interface sf_probe => interface layer vs spi_flash(sf_probe) to spi drivers Tested-by: Jagan Teki <jteki@openedev.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* sf: spi_flash_validate_params => spi_flash_scanJagan Teki2015-12-111-71/+76
| | | | | | | | | | | | | | | Rename spi_flash_validate_params to spi_flash_scan as this code not only deals with params setup but also configure all spi_flash attributes. And also moved all flash related code into spi_flash_scan for future functionality addition. Tested-by: Jagan Teki <jteki@openedev.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
* Merge git://git.denx.de/u-boot-niosTom Rini2015-12-061-2/+97
|\
| * altera_qspi: fix erase and write error codeThomas Chou2015-12-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix erase and write error code, which should be "protected". From the "Embedded Peripherals IP User Guide" of Altera, The "Illegal write" flag indicates that a write instruction is targeting a protected sector on the flash memory. This bit is set to indicate that the IP has cancelled a write instruction. The "Illegal erase" flag indicates that an erase instruction has been set to a protected sector on the flash memory. This bit is set to indicate that the IP has cancelled the erase instruction. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Chin Liang See <clsee@altera.com> Reviewed-by: Marek Vasut <marex@denx.de>
| * altera_qspi: add lock unlock opsThomas Chou2015-12-061-0/+95
| | | | | | | | | | | | | | | | Add lock() and unlock() mtd ops to altera_qspi. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Chin Liang See <clsee@altera.com> Reviewed-by: Marek Vasut <marex@denx.de>
* | Fix typo: firstly -> first.Vagrant Cascadian2015-12-051-1/+1
|/ | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Acked-by: Marek Vasut <marex@denx.de>
* Move console definitions into a new console.h fileSimon Glass2015-11-192-0/+2
| | | | | | | | The console includes a global variable and several functions that are only used by a small subset of U-Boot files. Before adding more functions, move the definitions into their own header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2015-11-195-121/+18
|\
OpenPOWER on IntegriCloud