summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
AgeCommit message (Collapse)AuthorFilesLines
2015-09-09Merge tag 'for-linus-20150909' of git://git.infradead.org/linux-mtdLinus Torvalds1-1/+2
Pull more MTD updates from Brian Norris: "There was one significant bug in my first pull request, fixed here. I also threw in a few trivial ID additions and a small module rename. Details: - SPI NOR: bug fix for a "end of table" check that resulted in a NULL dereference in some cases - SPI NOR: a few new IDs / feature flags - OMAP2 NAND: rename module so it doesn't conflict with onenand omap2.ko" * tag 'for-linus-20150909' of git://git.infradead.org/linux-mtd: mtd: spi-nor: fix NULL dereference when no match found in spi_nor_ids[] mtd: spi-nor: s25sl064p supports both dual and quad I/O mtd: spi-nor: allow dual/quad reads on S25FL129P mtd: nand: omap2: Rename shippable module to omap2_nand mtd: spi-nor: Add support for sst25wf020a mtd: spi-nor: Add support for Micron n25q064a serial flash
2015-09-09Merge tag 'libnvdimm-for-4.3' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dan Williams: "This update has successfully completed a 0day-kbuild run and has appeared in a linux-next release. The changes outside of the typical drivers/nvdimm/ and drivers/acpi/nfit.[ch] paths are related to the removal of IORESOURCE_CACHEABLE, the introduction of memremap(), and the introduction of ZONE_DEVICE + devm_memremap_pages(). Summary: - Introduce ZONE_DEVICE and devm_memremap_pages() as a generic mechanism for adding device-driver-discovered memory regions to the kernel's direct map. This facility is used by the pmem driver to enable pfn_to_page() operations on the page frames returned by DAX ('direct_access' in 'struct block_device_operations'). For now, the 'memmap' allocation for these "device" pages comes from "System RAM". Support for allocating the memmap from device memory will arrive in a later kernel. - Introduce memremap() to replace usages of ioremap_cache() and ioremap_wt(). memremap() drops the __iomem annotation for these mappings to memory that do not have i/o side effects. The replacement of ioremap_cache() with memremap() is limited to the pmem driver to ease merging the api change in v4.3. Completion of the conversion is targeted for v4.4. - Similar to the usage of memcpy_to_pmem() + wmb_pmem() in the pmem driver, update the VFS DAX implementation and PMEM api to provide persistence guarantees for kernel operations on a DAX mapping. - Convert the ACPI NFIT 'BLK' driver to map the block apertures as cacheable to improve performance. - Miscellaneous updates and fixes to libnvdimm including support for issuing "address range scrub" commands, clarifying the optimal 'sector size' of pmem devices, a clarification of the usage of the ACPI '_STA' (status) property for DIMM devices, and other minor fixes" * tag 'libnvdimm-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: (34 commits) libnvdimm, pmem: direct map legacy pmem by default libnvdimm, pmem: 'struct page' for pmem libnvdimm, pfn: 'struct page' provider infrastructure x86, pmem: clarify that ARCH_HAS_PMEM_API implies PMEM mapped WB add devm_memremap_pages mm: ZONE_DEVICE for "device memory" mm: move __phys_to_pfn and __pfn_to_phys to asm/generic/memory_model.h dax: drop size parameter to ->direct_access() nd_blk: change aperture mapping from WC to WB nvdimm: change to use generic kvfree() pmem, dax: have direct_access use __pmem annotation dax: update I/O path to do proper PMEM flushing pmem: add copy_from_iter_pmem() and clear_pmem() pmem, x86: clean up conditional pmem includes pmem: remove layer when calling arch_has_wmb_pmem() pmem, x86: move x86 PMEM API to new pmem.h header libnvdimm, e820: make CONFIG_X86_PMEM_LEGACY a tristate option pmem: switch to devm_ allocations devres: add devm_memremap libnvdimm, btt: write and validate parent_uuid ...
2015-09-04Merge tag 'powerpc-4.3-1' of ↵Linus Torvalds1-128/+130
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: - support "hybrid" iommu/direct DMA ops for coherent_mask < dma_mask from Benjamin Herrenschmidt - EEH fixes for SRIOV from Gavin - introduce rtas_get_sensor_fast() for IRQ handlers from Thomas Huth - use hardware RNG for arch_get_random_seed_* not arch_get_random_* from Paul Mackerras - seccomp filter support from Michael Ellerman - opal_cec_reboot2() handling for HMIs & machine checks from Mahesh Salgaonkar - add powerpc timebase as a trace clock source from Naveen N. Rao - misc cleanups in the xmon, signal & SLB code from Anshuman Khandual - add an inline function to update POWER8 HID0 from Gautham R. Shenoy - fix pte_pagesize_index() crash on 4K w/64K hash from Michael Ellerman - drop support for 64K local store on 4K kernels from Michael Ellerman - move dma_get_required_mask() from pnv_phb to pci_controller_ops from Andrew Donnellan - initialize distance lookup table from drconf path from Nikunj A Dadhania - enable RTC class support from Vaibhav Jain - disable automatically blocked PCI config from Gavin Shan - add LEDs driver for PowerNV platform from Vasant Hegde - fix endianness issues in the HVSI driver from Laurent Dufour - kexec endian fixes from Samuel Mendoza-Jonas - fix corrupted pdn list from Gavin Shan - fix fenced PHB caused by eeh_slot_error_detail() from Gavin Shan - Freescale updates from Scott: Highlights include 32-bit memcpy/memset optimizations, checksum optimizations, 85xx config fragments and updates, device tree updates, e6500 fixes for non-SMP, and misc cleanup and minor fixes. - a ton of cxl updates & fixes: - add explicit precision specifiers from Rasmus Villemoes - use more common format specifier from Rasmus Villemoes - destroy cxl_adapter_idr on module_exit from Johannes Thumshirn - destroy afu->contexts_idr on release of an afu from Johannes Thumshirn - compile with -Werror from Daniel Axtens - EEH support from Daniel Axtens - plug irq_bitmap getting leaked in cxl_context from Vaibhav Jain - add alternate MMIO error handling from Ian Munsie - allow release of contexts which have been OPENED but not STARTED from Andrew Donnellan - remove use of macro DEFINE_PCI_DEVICE_TABLE from Vaishali Thakkar - release irqs if memory allocation fails from Vaibhav Jain - remove racy attempt to force EEH invocation in reset from Daniel Axtens - fix + cleanup error paths in cxl_dev_context_init from Ian Munsie - fix force unmapping mmaps of contexts allocated through the kernel api from Ian Munsie - set up and enable PSL Timebase from Philippe Bergheaud * tag 'powerpc-4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (140 commits) cxl: Set up and enable PSL Timebase cxl: Fix force unmapping mmaps of contexts allocated through the kernel api cxl: Fix + cleanup error paths in cxl_dev_context_init powerpc/eeh: Fix fenced PHB caused by eeh_slot_error_detail() powerpc/pseries: Cleanup on pci_dn_reconfig_notifier() powerpc/pseries: Fix corrupted pdn list powerpc/powernv: Enable LEDS support powerpc/iommu: Set default DMA offset in dma_dev_setup cxl: Remove racy attempt to force EEH invocation in reset cxl: Release irqs if memory allocation fails cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE powerpc/powernv: Fix mis-merge of OPAL support for LEDS driver powerpc/powernv: Reset HILE before kexec_sequence() powerpc/kexec: Reset secondary cpu endianness before kexec powerpc/hvsi: Fix endianness issues in the HVSI driver leds/powernv: Add driver for PowerNV platform powerpc/powernv: Create LED platform device powerpc/powernv: Add OPAL interfaces for accessing and modifying system LED states powerpc/powernv: Fix the log message when disabling VF cxl: Allow release of contexts which have been OPENED but not STARTED ...
2015-09-03mtd: nand: omap2: Rename shippable module to omap2_nandRoger Quadros1-1/+2
As both omap2 onenand and omap2 nand driver modules are named the same i.e. "omap2.ko", only one of them gets shipped during MODPOST if both are configured as loadable modules. To avoid this ambiguity let's ship the omap2 nand driver as "omap2_nand.ko" Reported by Pierre Neyron via github https://github.com/beagleboard/linux/issues/40 Cc: Robert Nelson <robertcnelson@gmail.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-25mtd: nand: add Toshiba TC58NVG0S3E to nand_ids tableOleksij Rempel1-0/+4
Add the full description of the Toshiba TC58NVG0S3E NAND chip in the nand_ids table so that we can later use the NAND ECC info and ONFI timing mode in controller drivers. Tested with asm9260_nand driver. [Brian: driver still under review] Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-20nand: pxa3xx: Increase READ_ID buffer and make the size staticEzequiel García1-21/+10
The read ID count should be made as large as the maximum READ_ID size, so there's no need to have dynamic size. This commit sets the hardware maximum read ID count, which should be more than enough on all cases. Also, we get rid of the read_id_bytes, and use a macro instead. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-20mtd: nand: pxa3xx-nand: fix random command timeoutsRobert Jarzmik1-3/+7
When 2 commands are submitted in a row, and the second is very quick, the completion of the second command might never come. This happens especially if the second command is quick, such as a status read after an erase. The issue is that in the interrupt handler, the status bits are cleared after the new command is issued. There is a small temporal window where this happens : - the previous command has set the command done bit - the ready for a command bit is set - the handler submits the next command - just then, the command completes, and the command done bit is still set - the handler clears the "previous" command done bit - the handler exits In this flow, the "command done" of the next command will never trigger a new interrupt to finish the status command, as it was cleared for both commands. Fix this by clearing the status bit before submitting a new command. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-20mtd: nand: pxa3xx_nand: fix early spurious interruptRobert Jarzmik1-1/+1
When the nand is first probe, and upon the first command start, the status bits should be cleared before the interrupts are unmasked. The bug is tricky : if the bootloader left a status bit set, the unmasking of interrupts does trigger the interrupt handler before the first command is issued, blocking the good behavior of the nand. The same would happen if in pxa3xx_nand code flow a status bit is left, and then a command is started. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-19mtd: pxa3xx_nand: add a default chunk sizeAntoine Ténart1-0/+3
When keeping the configuration set by the bootloader (by using the marvell,nand-keep-config property), the pxa3xx_nand_detect_config() function is called and set the chunk size to 512 as a default value if NDCR_PAGE_SZ is not set. In the other case, when not keeping the bootloader configuration, no chunk size is set. Fix this by adding a default chunk size of 512. Fixes: 70ed85232a93 ("mtd: nand: pxa3xx: Introduce multiple page I/O support") Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Acked-by: Robert Jarzmik <robert.jarzmik@free> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-19mtd: omap_elm: Fix module aliasAxel Lin1-1/+1
Remove extra space after the "platform:" prefix and make the alias matches driver name. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-19mtd: denali_pci: switch to dev_err()Andy Shevchenko1-4/+4
It is better to have device name prefixed the actual error message. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-19mtd: denali_pci: refactor driver using devres APIAndy Shevchenko1-17/+6
In recent kernels we have a lot of helper functions, including devres API, to make life of device driver developer easy. Convert the driver using devm_kzalloc() and pcim_enable_device(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-19mtd: denali_pci: use module_pci_driver() macroAndy Shevchenko1-11/+1
Let's use module_pci_driver() macro to reduce code base of the driver. There is no functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-19mtd: denali: hide core part from user in KconfigAndy Shevchenko1-8/+5
There is no need to user to see the core part of the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-14nand: pxa3xx: Increase initial buffer sizeEzequiel Garcia1-6/+9
The initial buffer is used for the initial commands used to detect a flash device (STATUS, READID and PARAM). ONFI param page is 256 bytes, and there are three redundant copies to be read. JEDEC param page is 512 bytes, and there are also three redundant copies to be read. Hence this buffer should be at least 512 x 3. This commits rounds the buffer size to 2048. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-08-11arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> insteadDan Williams1-1/+1
Preparation for uniform definition of ioremap, ioremap_wc, ioremap_wt, and ioremap_cache, tree-wide. Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2015-08-08fsl_ifc: Change IO accessor based on endiannessJaiprakash Singh1-128/+130
IFC IO accressor are set at run time based on IFC IP registers endianness.IFC node in DTS file contains information about endianness. Signed-off-by: Jaiprakash Singh <b44839@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Brian Norris <computersforpeace@gmail.com>
2015-08-08mtd: brcmnand: Fix misuse of IS_ENABLEDAxel Lin1-2/+2
While IS_ENABLED() is perfectly fine for CONFIG_* symbols, it is not for other symbols such as __BIG_ENDIAN that is provided directly by the compiler. Switch to use CONFIG_CPU_BIG_ENDIAN instead of __BIG_ENDIAN. Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller") Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-07-20mtd: nand: sunxi: Set serial access mode correctlyRoy Spliet1-5/+12
Replaces the hard coded "always use EDO" policy with that prescribed by the ONFI 3.1 specification that EDO mode should always be used if tRC is below 30ns. Signed-off-by: Roy Spliet <r.spliet@ultimaker.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-07-20mtd: nand: sunxi: Replace failsafe timing cfg with calculated valueRoy Spliet1-5/+68
The TIMING_CFG register was previously statically set to a magic value (extracted from Allwinner's BSP) when initializing the NAND controller. Now that we have more details about the TIMING_CFG register layout (extracted from the A83 user manual) we can dynamically calculate the appropriate value for each NAND chip and set it when selecting the chip. Signed-off-by: Roy Spliet <r.spliet@ultimaker.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-07-20mtd: r852: make ecc_reg 32-bit in r852_ecc_correctNicolas Iooss1-1/+1
r852_ecc_correct() reads a 32-bit register into a 16-bit variable, ecc_reg, but this variable is later used as if it was larger. This is reported by clang when building the kernel with many warnings: drivers/mtd/nand/r852.c:512:11: error: shift count >= width of type [-Werror,-Wshift-count-overflow] ecc_reg >>= 16; ^ ~~ Fix this by making ecc_reg 32-bit, like the return type of r852_read_reg_dword(). Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-07-20nand: davinci: add support for 4K page size nand devicesSandeep Paulraj1-11/+31
It is needed for k2l keystone2 EVM which uses NAND flash with 4K page size, hence add support for 4K page size nand devices. [Brian: similar work submitted by Murali Karicheri <m-karicheri2@ti.com> and Hao Zhang <hzhang@ti.com>] Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-07-07mtd: nandsim: fix double freeshengyong1-18/+7
Do not call free_device() in init_nandsim, the caller - ns_init_module - will take care of that if something goes wrong. Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-07-07mtd: nandsim: fix free of NULL pointershengyong1-1/+2
If allocating ns->nand_pages_slab fails, do not try to destroy it when cleaning up nandsim resources. Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-06-17mtd: nandsim: Fix kasprintf() usageRichard Weinberger1-0/+10
kasprintf() used in get_partition_name() does a dynamic memory allocation and can fail. We have to handle that case. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-06-17mtd: cs553x_nand: Fix kasprintf() usageRichard Weinberger1-3/+9
kasprintf() does a dynamic memory allocation and can fail. We have to handle that case. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-06-17mtd: r852: Fix device_create_file() usageRichard Weinberger1-1/+5
device_create_file() can fail, therefore we have to handle this case and abort. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-06-17mtd: brcmnand: drop unnecessary initializationBrian Norris1-1/+1
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-06-17mtd: diskonchip: remove two-phase partitioning / registrationBrian Norris1-8/+2
It is a Bad Idea (TM) to call mtd_device_register() or mtd_device_parse_register() twice on the same master MTD. Among other things, it makes partition overrides (e.g., cmdlinepart) much more difficult. Since commit 727dc612c46b ("mtd: part: Create the master device node when partitioned"), we now have a config option that accomplishes the same purpose as the double-registration done in diskonchip.c -- it forces the master MTD to *always* be registered, while partitions may optionally show up in addition. Eventually, we might like to make CONFIG_MTD_PARTITIONED_MASTER into the default, but this could be disruptive to user-space expectations of MTD numbering, so we'll take that slowly. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Richard Weinberger <richard@nod.at> Cc: Alexander Shiyan <shc_work@mail.ru>
2015-05-27mtd: plat_nand: use default partition probeBrian Norris2-7/+1
It's harmless to add 'ofpart' (the only different parser supported in default mtdpart.c) to plat_nand. That let's us kill off one more custom partition prober listing. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-22mtd: nand: correct indentation within conditionalBrian Norris1-1/+1
We had an extra tab. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-22mtd: remove incorrect file nameBrian Norris4-8/+0
This is an example of why it doesn't make much sense to put this information here in the first place. I don't really know what purpose it serves. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-21mtd: mxc_nand: generate nand_ecclayout for 8 bit ECCBaruch Siach1-1/+21
Hardware 8 bit ECC requires a different nand_ecclayout. Instead of adding yet another static struct nand_ecclayout, generate it in code. Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-21mtd: Allow compile test of GPIO consumers if !GPIOLIBGeert Uytterhoeven1-1/+1
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: linux-mtd@lists.infradead.org Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-21mtd: mxc_nand: fix truncate of unaligned oob copyingBaruch Siach1-4/+36
Copy to/from oob io area might not be aligned to 4 bytes. When 8 bit ECC is used, the buffer size is 26. Add memcpy16_{to,from}io, and use them to avoid truncating the buffer. Prefer memcpy32_{to,from}io when the buffer is properly aligned for better performance. Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-21mtd: mxc_nand: limit the size of used oobBaruch Siach1-3/+13
For 4k pages the i.MX NFC hardware uses no more than 218 bytes for 8bit ECC data. Larger oobsize confuses the logic of copy_spare(). Limit the size of used oob size to avoid that. Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-21mtd: mxc_nand: cleanup copy_spare functionUwe Kleine-König1-15/+31
To give people without the reference manual at hand a chance to understand how spare area is handled in the i.MX nand controller, improve commenting, naming of variables and coding style. No functional change intended. Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [baruch: declare oob_chunk_size; update comments; reword commit log] Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-18mtd: brcmnand: do not make local variable staticHauke Mehrtens1-1/+1
Remove static in front of ctrl. This variable should not be shared between different instances of brcmnand_probe(), it should be local to this function and stored on the stack. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-18mtd: brcmnand: remove double new line from printHauke Mehrtens1-1/+1
The caller already adds a new line and in the other cases there is no new line added. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-15mtd: brcmnand: add BCM63138 supportBrian Norris2-0/+112
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Florian Fainelli <f.fainelli@gmail.com>
2015-05-15mtd: brcmnand: add support for Broadcom's IPROC familyBrian Norris2-0/+153
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-15mtd: brcmnand: add extra SoC support to libraryBrian Norris2-5/+71
There are a few small hooks required for chips like BCM63138 and the iProc family. Let's introduce those now. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Florian Fainelli <f.fainelli@gmail.com>
2015-05-15mtd: brcmnand: add support for STB chipsBrian Norris2-0/+45
BCM7xxx chips are supported entirely by the library code, since they use generic irqchip interfaces and don't need any extra SoC-specific configuration. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-15mtd: nand: add NAND driver "library" for Broadcom STB NAND controllerBrian Norris5-0/+2263
This core originated in Set-Top Box chips (BCM7xxx) but is used in a variety of other Broadcom chips, including some BCM63xxx, BCM33xx, and iProc/Cygnus. It's been used only on ARM and MIPS SoCs, so restrict it to those architectures. There are multiple revisions of this core throughout the years, and almost every version broke register compatibility in some small way, but with some effort, this driver is able to support v4.0, v5.0, v6.x, v7.0, and v7.1. It's been tested on v5.0, v6.0, v6.1, v7.0, and v7.1 recently, so there hopefully are no more lurking inconsistencies. This patch adds just some library support, on which platform drivers can be built. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Florian Fainelli <f.fainelli@gmail.com>
2015-05-12mtd: nand: add common DT init codeBrian Norris1-0/+41
These are already-documented common bindings for NAND chips. Let's handle them in nand_base. If NAND controller drivers need to act on this data before bringing up the NAND chip (e.g., fill out ECC callback functions, change HW modes, etc.), then they can do so between calling nand_scan_ident() and nand_scan_tail(). Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-07mtd: s3c2410: Constify platform_device_idKrzysztof Kozlowski1-1/+1
The platform_device_id is not modified by the driver and core uses it as const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-07mtd: mxc-nand: Constify platform_device_idKrzysztof Kozlowski1-1/+1
The platform_device_id is not modified by the driver and core uses it as const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-07mtd: nand: pxa3xx: fix build on ARM64Rob Herring1-11/+10
In preparation to enable ARCH_MMP on ARM64, a couple of fixes are needed to build the pxa3xx_nand driver: Legacy DMA will only used on ARM, so also make it condtional on CONFIG_ARM. __raw_{read,write}sl are not available on ARM64 or generically, so use the readsl/writesl variants instead. Somewhat inconsistently, {read,write}sl are inherently non-swapping with the generic version using __raw_{read,write}l. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: linux-mtd@lists.infradead.org [Brian: added one more __raw_readsl -> readsl] Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-07mtd: nand: pxa3xx: Switch FIFO draining to jiffies-based timeoutMaxime Ripard1-11/+9
Now that the driver handles the FIFO draining in a threaded interrupt, we can base our timeout on jiffies and sleeping, instead of using mdelay. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-05-07mtd: fsmc_nand: match wait_for_completion_timeout return typeNicholas Mc Guire1-2/+3
return type of wait_for_completion_timeout is unsigned long not int. An appropriately named unsigned long is added and the assignment fixed up. This not only should help readability but also handles corner cases properly. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>