aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-09-19ARM: omap: move platform_data definitionsArnd Bergmann2-2/+2
Platform data for device drivers should be defined in include/linux/platform_data/*.h, not in the architecture and platform specific directories. This moves such data out of the omap include directories Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Tony Lindgren <tony@atomide.com> Cc: Kevin Hilman <khilman@ti.com> Cc: "Benoît Cousson" <b-cousson@ti.com> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Ohad Ben-Cohen <ohad@wizery.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Omar Ramirez Luna <omar.ramirez@ti.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Jarkko Nikula <jarkko.nikula@bitmer.com> Cc: Liam Girdwood <lrg@ti.com> Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: Jean Pihet <j-pihet@ti.com> Cc: J Keerthy <j-keerthy@ti.com> Cc: linux-omap@vger.kernel.org
2012-09-16Merge tag 'omap-cleanup-sparseirq-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanupOlof Johansson2-2/+7
From Tony Lindgren: This branch contains changes needed to make omap2+ work properly with sparse IRQ. It also removes dependencies to mach/hardware.h. These help moving things towards ARM single zImage support. This branch is based on a commit in tty-next branch with omap-devel-gpmc-fixed-for-v3.7 and cleanup-omap-tags-for-v3.7 merged in to keep things compiling and sort out some merge conflicts. * tag 'omap-cleanup-sparseirq-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP1: Move SoC specific headers from plat to mach for omap1 ARM: OMAP2+ Move SoC specific headers to be local to mach-omap2 ARM: OMAP: Split plat/hardware.h, use local soc.h for omap2+ ARM: OMAP: Remove unused old gpio-switch.h ARM: OMAP1: Move plat/irqs.h to mach/irqs.h ARM: OMAP2+: Remove hardcoded IRQs and enable SPARSE_IRQ ARM: OMAP2+: Prepare for irqs.h removal W1: OMAP HDQ1W: Remove dependencies to mach/hardware.h Input: omap-keypad: Remove dependencies to mach includes ARM: OMAP: Move gpio.h to include/linux/platform_data ARM: OMAP2+: Remove hardcoded twl4030 gpio_base, irq_base and irq_end ARM: OMAP2+: Remove unused nand_irq for GPMC ARM: OMAP2+: Make INTCPS_NR_IRQS local for mach-omap2/irq.c ARM: OMAP1: Define OMAP1_INT_I2C locally ARM: OMAP1: Move define of OMAP_LCD_DMA to dma.h
2012-09-16Merge tag 'cleanup-omap-tags-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanupOlof Johansson2-4/+2
From Tony Lindgren: Remove the ancient omap specific atags that are no longer needed. At some point we were planning to pass the bootloader information with custom atags that did not work out too well. There's no need for these any longer as the kernel has been booting fine without them for quite some time. And Now we have device tree support that can be used instead. * tag 'cleanup-omap-tags-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP: remove plat/board.h file ARM: OMAP: move debug_card_init() function ARM: OMAP1: move lcd pdata out of arch/arm/* ARM: OMAP1: move omap1_bl pdata out of arch/arm/* ARM: OMAP: remove the omap custom tags ARM: OMAP1: remove the crystal type tag parsing ARM: OMAP: remove the sti console workaround ARM: OMAP: omap3evm: cleanup revision bits ARM: OMAP: cleanup struct omap_board_config_kernel + sync to 3.6-rc5
2012-09-16Merge tag 'omap-devel-gpmc-fixed-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanupOlof Johansson2-89/+241
From Tony Lindgren: Changes for GPMC (General Purpose Memory Controller) that take it closer for being just a regular device driver. * tag 'omap-devel-gpmc-fixed-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: mtd: nand: omap2: use gpmc provided irqs ARM: OMAP2+: gpmc-nand: Modify Interrupt handling ARM: OMAP2+: gpmc: Modify interrupt handling mtd: onenand: omap2: obtain memory from resource mtd: nand: omap2: obtain memory from resource ARM: OMAP2+: gpmc-onenand: provide memory as resource ARM: OMAP2+: gpmc-nand: update resource with memory mtd: nand: omap2: handle nand on gpmc ARM: OMAP2+: gpmc-nand: update gpmc-nand regs ARM: OMAP2+: gpmc: update nand register helper
2012-09-12ARM: OMAP2+: Prepare for irqs.h removalTony Lindgren1-0/+1
As the interrupts should only be defined in the platform_data, and eventually coming from device tree, there's no need to define them in header files. Let's remove the hardcoded references to irqs.h and fix up the includes so we don't rely on headers included in irqs.h. Note that we're defining OMAP_INTC_START as 0 to the interrupts. This will be needed when we enable SPARSE_IRQ. For some drivers we need to add #include <plat/cpu.h> for now until these drivers are fixed to remove cpu_is_omapxxxx() usage. While at it, sort som of the includes the standard way, and add the trailing commas where they are missing in the related data structures. Note that for drivers/staging/tidspbridge we just define things locally. Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-09-12ARM: OMAP: Move gpio.h to include/linux/platform_dataTony Lindgren1-2/+6
This way we can remove includes of plat/gpio.h which won't work with the single zImage support. Note that we also remove the cpu_class_is_omap2() check in gpio-omap.c as the drivers should not call it as we need to make it local to arch/arm/mach-omap2 for single zImage support. While at it, arrange the related includes in the standard way. Cc: Grant Likely <grant.likely@secretlab.ca> Cc: linux-mtd@lists.infradead.org Cc: alsa-devel@alsa-project.org Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-09-12Merge tags 'omap-devel-gpmc-fixed-for-v3.7' and 'cleanup-omap-tags-for-v3.7' into cleanup-sparseirqTony Lindgren3-93/+243
Changes for GPMC (General Purpose Memory Controller) that take it closer for being just a regular device driver. Remove the ancient omap specific atags that are no longer needed. At some point we were planning to pass the bootloader information with custom atags that did not work out too well. There's no need for these any longer as the kernel has been booting fine without them for quite some time. And Now we have device tree support that can be used instead.
2012-09-10ARM: OMAP: remove plat/board.h fileIgor Grinberg1-2/+0
plat/board.h file is now empty - remove it. Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: Chris Ball <cjb@laptop.org> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: linux-mmc@vger.kernel.org Cc: linux-mtd@lists.infradead.org Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Acked-by: Chris Ball <cjb@laptop.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-09-04Merge branch 'cleanup/io-pci' into next/cleanupArnd Bergmann3-8/+6
The io-pci series has gained a merge to resolve a nontrivial conflict. * cleanup/io-pci: ARM: Fix ioremap() of address zero Also includes an update to Linux 3.6-rc3 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-09-04UBI: fix a horrible memory deallocation bugArtem Bityutskiy1-2/+2
UBI was mistakingly using 'kfree()' instead of 'kmem_cache_free()' when freeing "attach eraseblock" structures in vtbl.c. Thankfully, this happened only when we were doing auto-format, so many systems were unaffected. However, there are still many users affected. It is strange, but the system did not crash and nothing bad happened when the SLUB memory allocator was used. However, in case of SLOB we observed an crash right away. This problem was introduced in 2.6.39 by commit "6c1e875 UBI: add slab cache for ubi_scan_leb objects" A note for stable trees: Because variable were renamed, this won't cleanly apply to older kernels. Changing names like this should help: 1. ai -> si 2. aeb_slab_cache -> seb_slab_cache 3. new_aeb -> new_seb Reported-by: Richard Genoud <richard.genoud@gmail.com> Tested-by: Richard Genoud <richard.genoud@gmail.com> Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: stable@vger.kernel.org [v2.6.39+] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-08-30mtd: nand: omap2: use gpmc provided irqsAfzal Mohammed1-28/+50
GPMC platform initialization provides it's clients with interrupts that can be used through struct resource. Make use of it for irq mode functionality. Also now write protect disable is done by GPMC, hence remove it. Signed-off-by: Afzal Mohammed <afzal@ti.com> Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> [tony@atomide.com: updated to fix new warnings introduced] Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-08-30mtd: onenand: omap2: obtain memory from resourceAfzal Mohammed1-13/+16
gpmc initialization for onenand done by platform code now provides onenand address space as memory resource. Hence remove usage of gpmc_cs_request in onenand driver and obtain memory details from resource structure. Signed-off-by: Afzal Mohammed <afzal@ti.com> Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-08-30mtd: nand: omap2: obtain memory from resourceAfzal Mohammed1-4/+15
gpmc initialization done by platform code now updates struct resource with the address space alloted for nand. Use this interface to obtain memory rather than relying on platform data field - phys_base. Signed-off-by: Afzal Mohammed <afzal@ti.com> Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-08-30mtd: nand: omap2: handle nand on gpmcAfzal Mohammed1-45/+161
GPMC platform initialization has been modified to fill NAND platform data with GPMC NAND register details. As these registers are accessible in NAND driver itself, configure NAND in GPMC by itself. Modified prefetch and ecc functions are logically same as the corresponding exported symbols from GPMC code. Note: Verfying that other CS have not yet enabled for prefetch & ecc has to be incorporated. Currently this causes no issues as there are no boards that use NAND on multiple CS. With ongoing GPMC driver migration, perhaps it would be better to consider NAND connected on multiple CS as a single peripheral using multiple CS. This would make handling multiple CS issues easier. Signed-off-by: Afzal Mohammed <afzal@ti.com> Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-08-13Merge branch 'testing/bcmring' into next/cleanupsArnd Bergmann2-43/+42
This attempts to get the bcmring platform better in line with the other platforms. Moving the header files below mach/ helps with the future reorganization for multiplatform kernels, and using MMIO accessors is generally the right thing. * testing/bcmring: ARM: bcmring: use proper MMIO accessors ARM: bcmring: remove include/csp/ subdir ARM: bcmring: move cfg_global header to mach/ Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-08-12Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds2-5/+4
Pull arm-soc bug fixes from Arnd Bergmann: "These are a bunch of bug fixes that came in after the merge window and one update for the MAINTAINERS file. The largest part of the fixes are patches that address bugs found by building all the ARM defconfig files. There are a lot more warnings that we have patches for, but the others are either still under discussion or are harmless and do not cause actual problems besides making the build slightly noisy." * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (30 commits) ARM: davinci: remove broken ntosd2_init_i2c ARM: s3c24xx: enable CONFIG_BUG for tct_hammer omap-rng: fix use of SIMPLE_DEV_PM_OPS spi/s3c64xx: improve error handling mtd/omap2: fix dmaengine_slave_config error handling gpio: em: do not discard em_gio_irq_domain_cleanup ARM: exynos: exynos_pm_add_dev_to_genpd may be unused ARM: imx: gpmi-nand depends on mxs-dma ARM: integrator: include <linux/export.h> ARM: s3c24xx: use new PWM driver ARM: sa1100: include linux/io.h in hackkit leds code Input: eeti_ts: pass gpio value instead of IRQ ARM: pxa: remove irq_to_gpio from ezx-pcap driver ARM: tegra: more regulator fixes for Harmony usb/ohci-omap: remove unused variable mfd/asic3: fix asic3_mfd_probe return value ARM: kirkwood: fix typo in Makefile.boot i.MX27: Fix emma-prp and csi clocks. ARM: integrator: use clk_prepare_enable() for timer MAINTAINERS: update entry for Linus Walleij ...
2012-08-10Merge branch 'testing/new-warnings' into fixesArnd Bergmann1-4/+3
These patches all fix bugs that were newly introduced in v3.6-rc1 and found because they cause a gcc warning with one of the ARM defconfigs. Most of them are harmless, but since we're trying to get rid of all warnings eventually, we can start with the ones that were not there before. * testing/new-warnings: omap-rng: fix use of SIMPLE_DEV_PM_OPS spi/s3c64xx: improve error handling mtd/omap2: fix dmaengine_slave_config error handling gpio: em: do not discard em_gio_irq_domain_cleanup ARM: exynos: exynos_pm_add_dev_to_genpd may be unused usb/ohci-omap: remove unused variable mfd/asic3: fix asic3_mfd_probe return value Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-08-10mtd/omap2: fix dmaengine_slave_config error handlingArnd Bergmann1-4/+3
The newly added dmaengine support in the omap2 nand driver potentially causes an undefined return value from the omap_nand_probe function when dmaengine_slave_config reports an error. Let's handle this by returning the same error back to the caller. Without this patch, building omap2plus_defconfig results in: drivers/mtd/nand/omap2.c: In function 'omap_nand_probe': drivers/mtd/nand/omap2.c:1154:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Grazvydas Ignotas <notasas@gmail.com>
2012-08-09ARM: imx: gpmi-nand depends on mxs-dmaArnd Bergmann1-1/+1
It is not currently possible to build the gpmi-nand driver without also building the mxs-dma driver. Clarify this Kconfig and enable both in the defconfig file so we can build it again with both enabled. drivers/built-in.o: In function `gpmi_dma_filter': clk-fixed-factor.c:(.text+0xafc18): undefined reference to `mxs_dma_is_apbh' make[1]: *** [vmlinux] Error 1 make: *** [sub-make] Error 2 Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Dirk Behme <dirk.behme@de.bosch.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Sascha Hauer <kernel@pengutronix.de>
2012-08-03Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68kLinus Torvalds1-3/+2
Pull m68k updates from Geert Uytterhoeven. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: Make sys_atomic_cmpxchg_32 work on classic m68k m68k/apollo: Rename "timer" to "apollo_timer" zorro: Remove unused zorro_bus.devices m68k: Remove never used asm/shm.h m68k/sun3: Remove unselectable code in prom_init() m68k: Use asm-generic version of <asm/sections.h> m68k: Replace m68k-specific _[se]bss by generic __bss_{start,stop} mtd/uclinux: Use generic __bss_stop instead of _ebss m68knommu: Allow ColdFire CPUs to use unaligned accesses m68k: Remove five unused headers m68k: CPU32 does not support unaligned accesses m68k: Introduce config option CPU_HAS_NO_UNALIGNED m68k: delay, muldi3 - Use CONFIG_CPU_HAS_NO_MULDIV64 m68k: Move CPU_HAS_* config options m68k: Remove duplicate FPU config option m68knommu: Clean up printing of sections m68k: Use asm-generic version of <asm/types.h> m68k: Use Kbuild logic to import asm-generic headers
2012-08-01Merge branch 'dmaengine' of git://git.linaro.org/people/rmk/linux-armLinus Torvalds1-50/+56
Pull ARM DMA engine updates from Russell King: "This looks scary at first glance, but what it is is: - a rework of the sa11x0 DMA engine driver merged during the previous cycle, to extract a common set of helper functions for DMA engine implementations. - conversion of amba-pl08x.c to use these helper functions. - addition of OMAP DMA engine driver (using these helper functions), and conversion of some of the OMAP DMA users to use DMA engine. Nothing in the helper functions is ARM specific, so I hope that other implementations can consolidate some of their code by making use of these helpers. This has been sitting in linux-next most of the merge cycle, and has been tested by several OMAP folk. I've tested it on sa11x0 platforms, and given it my best shot on my broken platforms which have the amba-pl08x controller. The last point is the addition to feature-removal-schedule.txt, which will have a merge conflict. Between myself and TI, we're planning to remove the old TI DMA implementation next year." Fix up trivial add/add conflicts in Documentation/feature-removal-schedule.txt and drivers/dma/{Kconfig,Makefile} * 'dmaengine' of git://git.linaro.org/people/rmk/linux-arm: (53 commits) ARM: 7481/1: OMAP2+: omap2plus_defconfig: enable OMAP DMA engine ARM: 7464/1: mmc: omap_hsmmc: ensure probe returns error if DMA channel request fails Add feature removal of old OMAP private DMA implementation mtd: omap2: remove private DMA API implementation mtd: omap2: add DMA engine support spi: omap2-mcspi: remove private DMA API implementation spi: omap2-mcspi: add DMA engine support ARM: omap: remove mmc platform data dma_mask and initialization mmc: omap: remove private DMA API implementation mmc: omap: add DMA engine support mmc: omap_hsmmc: remove private DMA API implementation mmc: omap_hsmmc: add DMA engine support dmaengine: omap: add support for cyclic DMA dmaengine: omap: add support for setting fi dmaengine: omap: add support for returning residue in tx_state method dmaengine: add OMAP DMA engine driver dmaengine: sa11x0-dma: add cyclic DMA support dmaengine: sa11x0-dma: fix DMA residue support dmaengine: PL08x: ensure all descriptors are freed when channel is released dmaengine: PL08x: get rid of write only pool_ctr and free_txd locking ...
2012-07-31mtd: omap2: remove private DMA API implementationRussell King1-110/+26
Remove the private DMA API implementation from nand/omap2.c making it use entirely the DMA engine API. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-07-31mtd: omap2: add DMA engine supportRussell King1-1/+91
Add DMA engine support to the OMAP2 NAND driver. This supplements the private DMA API implementation contained within this driver, and the driver can be independently switched at build time between using DMA engine and the private DMA API. Tested-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-07-30Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linusLinus Torvalds1-36/+192
Pull MIPS updates from Ralf Baechle: "More hardware support across the field including a bunch of device drivers. The highlight however really are further steps towards device tree. This has been sitting in -next for ages. All MIPS _defconfigs have been tested to boot or where I don't have hardware available, to at least build fine." * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (77 commits) MIPS: Loongson 1B: Add defconfig MIPS: Loongson 1B: Add board support MIPS: Netlogic: early console fix MIPS: Netlogic: Fix indentation of smpboot.S MIPS: Netlogic: remove cpu_has_dc_aliases define for XLP MIPS: Netlogic: Remove unused pcibios_fixups MIPS: Netlogic: Add XLP SoC devices in FDT MIPS: Netlogic: Add IRQ mappings for more devices MIPS: Netlogic: USB support for XLP MIPS: Netlogic: XLP PCIe controller support. MIPS: Netlogic: Platform changes for XLR/XLS I2C MIPS: Netlogic: Platform NAND/NOR flash support MIPS: Netlogic: Platform changes for XLS USB MIPS: Netlogic: Remove NETLOGIC_ prefix MIPS: Netlogic: SMP wakeup code update MIPS: Netlogic: Update comments in smpboot.S MIPS: BCM63XX: Add 96328avng reference board MIPS: Expose PCIe drivers for MIPS MIPS: BCM63XX: Add PCIe Support for BCM6328 MIPS: BCM63XX: Move the PCI initialization into its own function ...
2012-07-25Merge branch 'v3.5-rc7-fixes' of git://github.com/lunn/linux into fixesArnd Bergmann1-1/+5
From Andrew Lunn <andrew@lunn.ch>: * 'v3.5-rc7-fixes' of git://github.com/lunn/linux: ARM: Kirkwood: Replace mrvl with marvell ARM: Orion: fix driver probe error handling with respect to clk ARM: Dove: Fixup ge00 initialisation ARM: Kirkwood: Fix PHY disable clk problems ARM: Kirkwood: Ensure runit clock always ticks. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-07-25ARM: Kirkwood: Replace mrvl with marvellAndrew Lunn1-1/+1
It has been decided to use marvell, not mrvl, in the compatibility property. Search & replace. Signed-off-by: Andrew Lunn <andrew@lunn.ch>
2012-07-25ARM: Orion: fix driver probe error handling with respect to clkSimon Baatz1-0/+4
The clk patches added code to get and enable clocks in the respective driver probe functions. If the probe function failed for some reason after enabling the clock, the clock was not disabled again in many cases. Signed-off-by: Simon Baatz <gmbnomis@gmail.com> Signed-off-by: Andrew Lumm <andrew@lunn.ch>
2012-07-23Merge tag 'upstream-3.6-rc1' of git://git.infradead.org/linux-ubiLinus Torvalds5-21/+29
Pull UBI changes from Artem Bityutskiy: "Change the default amount of eraseblocks which UBI reserves for bad block handling from 1% to 2%, because 1% does not meet most modern flash requirements. 1% was good enough in the past for old high-quality SLCs, but nowadays 2% is much more appropriate.: Other changes are clean-ups. * tag 'upstream-3.6-rc1' of git://git.infradead.org/linux-ubi: UBI: harmonize the update of ubi->beb_rsvd_pebs UBI: trivial: fix comment of ubi_calculate_reserved function UBI: fix spelling of detach in debug output UBI: Change the default percentage of reserved PEB
2012-07-23MTD: NAND: JZ4740: Multi-bank support with autodetectionMaarten ter Huurne1-36/+192
The platform data can now specify which external memory banks to probe for NAND chips, and in which order. Banks that contain a NAND are used and the other banks are freed. Squashed version of development done in jz-2.6.38 branch. Original patch by Lars-Peter Clausen with some bug fixes from me. Thanks to Paul Cercueil for the initial autodetection patch. Signed-off-by: Maarten ter Huurne <maarten@treewalker.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3560/ Acked-By: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2012-07-18UBI: harmonize the update of ubi->beb_rsvd_pebsShmulik Ladkani3-18/+26
Currently, there are several locations where an attempt to reserve more PEBs for bad PEB handling is made, with the same code being duplicated. Harmonize it by introducing 'ubi_update_reserved()'. Also, improve the debug message issued, making it more descriptive. Artem: amended the patch a little. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-07-18UBI: trivial: fix comment of ubi_calculate_reserved functionShmulik Ladkani1-1/+1
The function name within the comment was not aligned with the actual function name. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-07-18UBI: fix spelling of detach in debug outputPeter Meerwald1-1/+1
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-07-18UBI: Change the default percentage of reserved PEBRichard Genoud1-1/+1
The actual value (1%) is too low for actual NAND devices, a huge majority of device has 2% maximum bad blocks (SLC or MLC). (Actually it's 20 blocks on a 1024 blocks device, 40/2048...) Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
2012-07-14VFS: Pass mount flags to sget()David Howells1-3/+1
Pass mount flags to sget() so that it can use them in initialising a new superblock before the set function is called. They could also be passed to the compare function. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-07-13Merge tag 'for-linus-20120712' of git://git.infradead.org/linux-mtdLinus Torvalds3-22/+37
Pull late MTD fixes from David Woodhouse: - fix 'sparse warning fix' regression which totally breaks MXC NAND - fix GPMI NAND regression when used with UBI - update/correct sysfs documentation for new 'bitflip_threshold' field - fix nandsim build failure * tag 'for-linus-20120712' of git://git.infradead.org/linux-mtd: mtd: nandsim: don't open code a do_div helper mtd: ABI documentation: clarification of bitflip_threshold mtd: gpmi-nand: fix read page when reading to vmalloced area mtd: mxc_nand: use 32bit copy functions
2012-07-06Merge tag 'for-linus-20120706' of git://git.infradead.org/linux-mtdLinus Torvalds2-1/+8
Pull two MTD fixes from David Woodhouse: - Fix a logic error in OLPC CAFÉ NAND ready() function. - Fix regression due to bitflip handling changes. * tag 'for-linus-20120706' of git://git.infradead.org/linux-mtd: mtd: cafe_nand: fix an & vs | mistake mtd: nand: initialize bitflip_threshold prior to BBT scanning
2012-07-06mtd: nandsim: don't open code a do_div helperHerton Ronaldo Krzesinski1-9/+3
We don't need to open code the divide function, just use div_u64 that already exists and do the same job. While this is a straightforward clean up, there is more to that, the real motivation for this. While building on a cross compiling environment in armel, using gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5), I was getting the following build error: ERROR: "__aeabi_uldivmod" [drivers/mtd/nand/nandsim.ko] undefined! After investigating with objdump and hand built assembly version generated with the compiler, I narrowed __aeabi_uldivmod as being generated from the divide function. When nandsim.c is built with -fno-inline-functions-called-once, that happens when CONFIG_DEBUG_SECTION_MISMATCH is enabled, the do_div optimization in arch/arm/include/asm/div64.h doesn't work as expected with the open coded divide function: even if the do_div we are using doesn't have a constant divisor, the compiler still includes the else parts of the optimized do_div macro, and translates the divisions there to use __aeabi_uldivmod, instead of only calling __do_div_asm -> __do_div64 and optimizing/removing everything else out. So to reproduce, gcc 4.6 plus CONFIG_DEBUG_SECTION_MISMATCH=y and CONFIG_MTD_NAND_NANDSIM=m should do it, building on armel. After this change, the compiler does the intended thing even with -fno-inline-functions-called-once, and optimizes out as expected the constant handling in the optimized do_div on arm. As this also avoids a build issue, I'm marking for Stable, as I think is applicable for this case. Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> Cc: stable@vger.kernel.org Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-07-06mtd: gpmi-nand: fix read page when reading to vmalloced areaSascha Hauer1-5/+5
The gpmi-nand driver uses virt_addr_valid() to check whether a buffer is suitable for dma. If it's not, a driver allocated buffer is used instead. Then after a page read the driver allocated buffer must be copied to the user supplied buffer. This does not happen since commit 7725cc85932bd02dd12c23108e0ef748c551ccba. This patch fixes the issue. The bug is encountered with UBI which uses a vmalloced buffer for the volume table. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: snijsure@grid-net.com Acked-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-07-06mtd: mxc_nand: use 32bit copy functionsSascha Hauer1-8/+29
The following commit changes the function used to copy from/to the hardware buffer to memcpy_[from|to]io. This does not work since the hardware cannot handle the byte accesses used by these functions. Instead of reverting this patch introduce 32bit correspondents of these functions. | commit 5775ba36ea9c760c2d7e697dac04f2f7fc95aa62 | Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | Date: Tue Apr 24 10:05:22 2012 +0200 | | mtd: mxc_nand: fix several sparse warnings about incorrect address space | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-07-06mtd: cafe_nand: fix an & vs | mistakeDan Carpenter1-1/+1
The intent here was clearly to set result to true if the 0x40000000 flag was set. But instead there was a | vs & typo and we always set result to true. Artem: check the spec at wiki.laptop.org/images/5/5c/88ALP01_Datasheet_July_2007.pdf and this fix looks correct. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@vger.kernel.org Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-06-28Merge tag 'upstream-3.5-rc5' of git://git.infradead.org/linux-ubifsLinus Torvalds1-4/+4
Pull ubi/ubifs fixes from Artem Bityutskiy: "Fix the debugfs regression - we never enable it because incorrect 'IS_ENABLED()' macro usage: should be 'IS_ENABLED(CONFIG_DEBUG_FS)', but we had 'IS_ENABLED(DEBUG_FS)'. Also fix incorrect assertion." * tag 'upstream-3.5-rc5' of git://git.infradead.org/linux-ubifs: UBI: correct usage of IS_ENABLED() UBIFS: correct usage of IS_ENABLED() UBIFS: fix assertion
2012-06-27UBI: correct usage of IS_ENABLED()Brian Norris1-4/+4
Commit "e9b4cf2 UBI: fix debugfs-less systems support" fixed one regression but introduced a different regression - the debugfs is now always compiled out. Root cause: IS_ENABLED() arguments should be used with the CONFIG_* prefix. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-06-27mtd/uclinux: Use generic __bss_stop instead of _ebssGeert Uytterhoeven1-3/+2
The standard (see BSS_SECTION() in <asm-generic/vmlinux.lds.h> and <asm-generic/sections.h>) symbol for the end of BSS is __bss_stop. This allows to remove all local declarations that have been added to several architectures just to please CONFIG_MTD_UCLINUX. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Michal Simek <monstr@monstr.eu> Acked-by: Greg Ungerer <gerg@uclinux.org>
2012-06-15kmsg - kmsg_dump() use iterator to receive log buffer contentKay Sievers1-18/+4
Provide an iterator to receive the log buffer content, and convert all kmsg_dump() users to it. The structured data in the kmsg buffer now contains binary data, which should no longer be copied verbatim to the kmsg_dump() users. The iterator should provide reliable access to the buffer data, and also supports proper log line-aware chunking of data while iterating. Signed-off-by: Kay Sievers <kay@vrfy.org> Tested-by: Tony Luck <tony.luck@intel.com> Reported-by: Anton Vorontsov <anton.vorontsov@linaro.org> Tested-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09mtd: nand: initialize bitflip_threshold prior to BBT scanningShmulik Ladkani1-0/+7
As of edbc454 [mtd: driver _read() returns max_bitflips; mtd_read() returns -EUCLEAN], 'mtd->bitflip_threshold' must be set for mtd devices having ECC, prior any 'mtd_read()' call. Otherwise, 'mtd_read()' will falsely return -EUCLEAN. Normally, 'mtd->bitflip_threshold' is initialized when the MTD is added. However, this is too late for NAND MTDs, as 'scan_bbt()' is invoked prior the existing initialization of 'mtd->bitflip_threshold'. This is a problem since 'scan_bbt()' calls 'mtd_read()', in the case of a flash-based bad block table. It resulted in a falsely reported bitflips indication during BBT read, which lead to constant scrubbing of the flash BBT blocks. Initialize 'mtd->bitflip_threshold' to its default value (if not already set by the driver), prior to invocation of 'scan_bbt()'. Reported-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-06-07UBI: correct ubi_wl_flush lockingArtem Bityutskiy1-4/+13
Commit "62f38455 UBI: modify ubi_wl_flush function to clear work queue for a lnum" takes the 'work_sem' semaphore in write mode for the entire loop, which is not very good because it will block other workers for potentially long time. We do not need to have it in write mode - read mode is enough, and we do not need to hole it over the entire loop. So this patch turns changes the locking: takes 'work_sem' in read mode and pushes it down to the loop. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-06-07UBI: fix debugfs-less systems supportArtem Bityutskiy1-2/+10
Commit "aa44d1d UBI: remove Kconfig debugging option" broke UBI and it refuses to initialize if debugfs (CONFIG_DEBUG_FS) is disabled. I incorrectly assumed that debugfs files creation function will return success if debugfs is disabled, but they actually return -ENODEV. This patch fixes the issue. Reported-by: Paul Parsons <lost.distance@yahoo.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Tested-by: Paul Parsons <lost.distance@yahoo.com>
2012-06-01Merge tag 'for-linus-3.5-20120601' of git://git.infradead.org/linux-mtdLinus Torvalds50-704/+1342
Pull mtd update from David Woodhouse: - More robust parsing especially of xattr data in JFFS2 - Updates to mxc_nand and gpmi drivers to support new boards and device tree - Improve consistency of information about ECC strength in NAND devices - Clean up partition handling of plat_nand - Support NAND drivers without dedicated access to OOB area - BCH hardware ECC support for OMAP - Other fixes and cleanups, and a few new device IDs Fixed trivial conflict in drivers/mtd/nand/gpmi-nand/gpmi-nand.c due to added include files next to each other. * tag 'for-linus-3.5-20120601' of git://git.infradead.org/linux-mtd: (75 commits) mtd: mxc_nand: move ecc strengh setup before nand_scan_tail mtd: block2mtd: fix recursive call of mtd_writev mtd: gpmi-nand: define ecc.strength mtd: of_parts: fix breakage in Kconfig mtd: nand: fix scan_read_raw_oob mtd: docg3 fix in-middle of blocks reads mtd: cfi_cmdset_0002: Slight cleanup of fixup messages mtd: add fixup for S29NS512P NOR flash. jffs2: allow to complete xattr integrity check on first GC scan jffs2: allow to discriminate between recoverable and non-recoverable errors mtd: nand: omap: add support for hardware BCH ecc ARM: OMAP3: gpmc: add BCH ecc api and modes mtd: nand: check the return code of 'read_oob/read_oob_raw' mtd: nand: remove 'sndcmd' parameter of 'read_oob/read_oob_raw' mtd: m25p80: Add support for Winbond W25Q80BW jffs2: get rid of jffs2_sync_super jffs2: remove unnecessary GC pass on sync jffs2: remove unnecessary GC pass on umount jffs2: remove lock_super mtd: gpmi: add gpmi support for mx6q ...
2012-06-01mtd: mxc_nand: move ecc strengh setup before nand_scan_tailSascha Hauer1-6/+6
Since commit 6a918bade9dab40aaef80559bd1169c69e8d69cb, the mxc_nand driver fails with: Driver must set ecc.strength when using hardware ECC This is because nand_scan_tail checks for correct ecc strength settings, so we must set them up before nand_scan_tail. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: stable@vger.kernel.org [3.4+] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-06-01mtd: block2mtd: fix recursive call of mtd_writevGabor Juhos1-1/+0
The 'mtd_writev' interface calls the function assigned to the '_write' field of a given mtd device if that is not NULL. The block2mtd driver sets the '_writev' field to the 'mtd_writev' function itself and thus causes a endless loop. This is caused by 1dbebd32562b3c2caeca35960e5cb00bfcc12900 (mtd: harmonize mtd_writev usage). Remove the assignment from the block2mtd driver to fix the issue. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: stable@kernel.org [3.3+] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>