20 Apr, 2017
2 commits
-
OF core code provides helpers for counting strings and reading them so
use them instead of doing this manually. This simplifies the code a bit.Signed-off-by: Rafał Miłecki
Reviewed-by: Boris Brezillon
Signed-off-by: Brian Norris -
The current way of building the of_physmap add-ons result in just
the add-on being in the object code, and not the actual core
implementation and regress the Gemini and Versatile.Bake the physmap_of.o object by baking physmap_of_core.o and
adding the Versatile and/or Gemini add-ons to the final object.
Rename the source file physmap_of_core.c to get the desired
build components.Suggested-by: Boris Brezillon
Fixes: 4f04f68e1598 ("mtd: physmap_of: fixup gemini/versatile dependencies")
Signed-off-by: Linus Walleij
Acked-by: Boris Brezillon
Signed-off-by: Brian Norris
11 Feb, 2017
1 commit
-
physmap_of sort of depends on the gemini and versatile modules (when
they're enabled), but this isn't expressed in Kconfig. Let's just merge
the modules all together, when enabled. Then we can avoid exporting a
few symbols, and the versatile and gemini code can now be modular again
(the below commit accidentally made them built-in only).Resolves errors like this:
ERROR: "of_flash_probe_versatile" [drivers/mtd/maps/physmap_of.ko] undefined!
ERROR: "of_flash_probe_gemini" [drivers/mtd/maps/physmap_of.ko] undefined!Fixes: 56ff337ea433 ("mtd: physmap_of: add a hook for Gemini flash probing")
Cc: Linus Walleij
Signed-off-by: Brian Norris
Reviewed-by: Linus Walleij
09 Feb, 2017
4 commits
-
pci_read_config_word() might fail and not initialize its output,
as pointed out by older versions of gcc when using the -Wmaybe-unintialized
flag:drivers/mtd/maps/ichxrom.c: In function ‘ichxrom_cleanup’:
drivers/mtd/maps/ichxrom.c:63:2: error: ‘word’ is used uninitialized in this function [-Werror=uninitialized]This is apparently a correct warning, though it does not show up
with newer compilers. Changing the code to not attempt to write
back uninitialized data into PCI config space is a correct
fix for the problem and avoids the warning.Signed-off-by: Arnd Bergmann
Reviewed-by: Marek Vasut
Signed-off-by: Brian Norris -
kernelci.org reports a warning for this driver, as it copies a local
variable into a 'const char *' string:drivers/mtd/maps/pmcmsp-flash.c:149:30: warning: passing argument 1 of 'strncpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
Using kstrndup() simplifies the code and avoids the warning.
Signed-off-by: Arnd Bergmann
Acked-by: Marek Vasut
Signed-off-by: Brian Norris -
In order to support device tree probing of Gemini NOR flash
chips, a certain register in the syscon needs to be poked
to enable parallel flash mode.Such things used to happen in "necessarily different" board
file code, and this indeed was also done for the Gemini, so
the MTD driver could treat it as any memory-mapped NOR flash,
but this is not the way in the future: board files need to
go, and hardware concerns distributed down to the applicable
drivers.This adds a hook in the same way that the Versatile did: if
the Kconfig symbol is not selected the net total of supporting
Gemini should be zero bytes of added code. To live up to this
promise, also the return value error print from the Versatile
extra probe call get to be removed in this patch, all printing
need to happen in the add-ons.Cc: Janos Laube
Cc: Paulius Zaleckas
Cc: Hans Ulli Kroll
Cc: Florian Fainelli
Signed-off-by: Linus Walleij
Acked-by: Marek Vasut
Signed-off-by: Brian Norris -
This patch updates my email address as I no longer have access to the old
one.Signed-off-by: John Crispin
Acked-by: Boris Brezillon
Signed-off-by: Brian Norris
25 Dec, 2016
1 commit
-
This was entirely automated, using the script by Al:
PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*'
sed -i -e "s!$PATT!#include !" \
$(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)to do the replacement at the end of the merge window.
Requested-by: Al Viro
Signed-off-by: Linus Torvalds
01 Dec, 2016
1 commit
-
This patch was triggered by the following Coccinelle error:
./drivers/mtd/maps/sc520cdp.c:246:3-9: \
ERROR: missing iounmap; ioremap on line 242 \
and execution via conditional on line 244Since do_map_probe() is also invoked in this loop, it is also necessary to
map_destroy() any initialised struct mtd_info.Signed-off-by: Luis Henriques
Reviewed-by: Marek Vasut
Signed-off-by: Brian Norris
16 Aug, 2016
1 commit
-
This reduces the Kconfig for the RealView by assuming we are
always booting from the device tree, and removing all the uses
of CONFIG_REALVIEW_DT and replacing with CONFIG_ARCH_REALVIEW.Further:
- Drop REALVIEW_HIGH_PHYS_OFFSET: we don't use this with device
tree.- Drop the REALVIEW_EB_ARM11MP_REVB option: we now handle this
by simply using another device tree.- Drop the PB1176 secure flash option: this is defined in the
PB1176 device tree but marked as "disabled", so users who
want to use it can simply enable it in the device tree and
go hacking around.Cc: Brian Norris
Cc: Marc Zyngier
Cc: Thomas Gleixner
Signed-off-by: Linus Walleij
16 Jul, 2016
2 commits
-
There is a cut and paste issue here. The bug is that we are allocating
more memory than necessary for msp_maps. We should be allocating enough
space for a map_info struct (144 bytes) but we instead allocate enough
for an mtd_info struct (1840 bytes). It's a small waste.The other part of this is not harmful but when we allocated msp_flash
then we allocated enough space fro a map_info pointer instead of an
mtd_info pointer. But since pointers are the same size it works out
fine.Anyway, I decided to clean up all three allocations a bit to make them
a bit more consistent and clear.Fixes: 68aa0fa87f6d ('[MTD] PMC MSP71xx flash/rootfs mappings')
Signed-off-by: Dan Carpenter
Signed-off-by: Brian Norris -
We check for NULL but then dereference "info->mtd" on the next line.
Fixes: 72169755cf36 ('mtd: maps: sa1100-flash: show parent device in sysfs')
Signed-off-by: Dan Carpenter
Signed-off-by: Brian Norris
10 Jul, 2016
1 commit
-
drivers/mtd/maps/physmap_of.c: In function ‘of_flash_probe’:
drivers/mtd/maps/physmap_of.c:165:16: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]This could be a problem if the 'reg' property is not set, since that
means 'count' will be uninitialized.Signed-off-by: Brian Norris
25 May, 2016
1 commit
-
Pull MTD updates from Brian Norris:
"First cycle with Boris as NAND maintainer! Many (most) bullets stolen
from him.Generic:
- Migrated NAND LED trigger to be a generic MTD triggerNAND:
- Introduction of the "ECC algorithm" concept, to avoid overloading
the ECC mode field too much more
- Replaced the nand_ecclayout infrastructure with something a little
more flexible (finally!) and future proof
- Rework of the OMAP GPMC and NAND drivers; the TI folks pulled some
of this into their own tree as well
- Prepare the sunxi NAND driver to receive DMA support
- Handle bitflips in erased pages on GPMI revisions that do not
support this in hardware.SPI NOR:
- Start using the spi_flash_read() API for SPI drivers that support
it (i.e., SPI drivers with special memory-mapped flash modes)And other small scattered improvments"
* tag 'for-linus-20160523' of git://git.infradead.org/linux-mtd: (155 commits)
mtd: spi-nor: support GigaDevice gd25lq64c
mtd: nand_bch: fix spelling of "probably"
mtd: brcmnand: respect ECC algorithm set by NAND subsystem
gpmi-nand: Handle ECC Errors in erased pages
Documentation: devicetree: deprecate "soft_bch" nand-ecc-mode value
mtd: nand: add support for "nand-ecc-algo" DT property
mtd: mtd: drop NAND_ECC_SOFT_BCH enum value
mtd: drop support for NAND_ECC_SOFT_BCH as "soft_bch" mapping
mtd: nand: read ECC algorithm from the new field
mtd: nand: fsmc: validate ECC setup by checking algorithm directly
mtd: nand: set ECC algorithm to Hamming on fallback
staging: mt29f_spinand: set ECC algorithm explicitly
CRIS v32: nand: set ECC algorithm explicitly
mtd: nand: atmel: set ECC algorithm explicitly
mtd: nand: davinci: set ECC algorithm explicitly
mtd: nand: bf5xx: set ECC algorithm explicitly
mtd: nand: omap2: Fix high memory dma prefetch transfer
mtd: nand: omap2: Start dma request before enabling prefetch
mtd: nandsim: add __init attribute
mtd: nand: move of_get_nand_xxx() helpers into nand_base.c
...
21 May, 2016
1 commit
-
Pull ARM updates from Russell King:
"Changes included in this pull request:- revert pxa2xx-flash back to using ioremap_cached() and switch
memremap() to use arch_memremap_wb()- remove pci=firmware command line argument handling
- remove unnecessary arm_dma_set_mask() implementation, the generic
implementation will do for ARM- removal of the ARM kallsyms "hack" to work around mode switching
veneers and vectors located below PAGE_OFFSET- tidy up build system output a little
- add L2 cache power management DT bindings
- remove duplicated local_irq_disable() in reboot paths
- handle AMBA primecell devices better at registration time with PM
domains (needed for Samsung SoCs)- ARM specific preparation to support Keystone II kexec"
* 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
ARM: 8567/1: cache-uniphier: activate ways for secondary CPUs
ARM: 8570/2: Documentation: devicetree: Add PL310 PM bindings
ARM: 8569/1: pl2x0: Add OF control of cache power management
ARM: 8568/1: reboot: remove duplicated local_irq_disable()
ARM: 8566/1: drivers: amba: properly handle devices with power domains
ARM: provide arm_has_idmap_alias() helper
ARM: kexec: remove 512MB restriction on kexec crashdump
ARM: provide improved virt_to_idmap() functionality
ARM: kexec: fix crashkernel= handling
ARM: 8557/1: specify install, zinstall, and uinstall as PHONY targets
ARM: 8562/1: suppress "include/generated/mach-types.h is up to date."
ARM: 8553/1: kallsyms: remove --page-offset command line option
ARM: 8552/1: kallsyms: remove special lower address limit for CONFIG_ARM
ARM: 8555/1: kallsyms: ignore ARM mode switching veneers
ARM: 8548/1: dma-mapping: remove arm_dma_set_mask()
ARM: 8554/1: kernel: pci: remove pci=firmware command line parameter handling
ARM: memremap: implement arch_memremap_wb()
memremap: add arch specific hook for MEMREMAP_WB mappings
mtd: pxa2xx-flash: switch back from memremap to ioremap_cached
ARM: reintroduce ioremap_cached() for creating cached I/O mappings
26 Apr, 2016
3 commits
-
Add __init attribute on functions that are only called from other __init
functions and that are not inlined, at least with gcc version 4.8.4 on an
x86 machine with allyesconfig. Currently, the functions are put in the
.text.unlikely segment. Declaring them as __init will cause them to be
put in the .init.text and to disappear after initialization.The result of objdump -x on the functions before the change is as follows:
00000000000001bc l F .text.unlikely 00000000000006a2 ck804xrom_init_one.isra.1
00000000000001aa l F .text.unlikely 0000000000000764 esb2rom_init_one.isra.1
00000000000001db l F .text.unlikely 0000000000000716 ichxrom_init_one.isra.1And after the change it is as follows:
0000000000000000 l F .init.text 000000000000069d ck804xrom_init_one.isra.1
0000000000000000 l F .init.text 000000000000075f esb2rom_init_one.isra.1
0000000000000000 l F .init.text 0000000000000711 ichxrom_init_one.isra.1Done with the help of Coccinelle. The semantic patch checks for local
static non-init functions that are called from an __init function and are
not called from any other function.Note that in each case, the function is stored in the probe field of a
pci_driver structure, but this code is under an #if 0. The #if 0s have
been unchanged since 2009 at the latest.Signed-off-by: Julia Lawall
Signed-off-by: Brian Norris -
The Kconfig for this support is currently declared with:
config MTD_UCLINUX
bool "Generic uClinux RAM/ROM filesystem support"...meaning that it currently is not being built as a module by anyone.
Lets remove as much of the modular evidence that we can, so that when
reading the driver there is less doubt it is builtin-only.Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.We also replace module.h with moduleparam.h since the file does use
a module_param, and leaving it as such is currently the easiest way
to remain compatible with existing boot arg use cases.We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.Cc: David Woodhouse
Cc: Greg Ungerer
Signed-off-by: Paul Gortmaker
Signed-off-by: Brian Norris -
With the newly added physmap_of_versatile code, we get a build error
when physmap_of is in a module, because of_flash_probe_versatile
is not exported:ERROR: "of_flash_probe_versatile" [drivers/mtd/maps/physmap_of.ko] undefined!
This adds the export, and changes the Makefile so that the code is
also put into a loadable module rather than built-in when physmap_of
itself is a module.Signed-off-by: Arnd Bergmann
04 Apr, 2016
2 commits
-
In order to support device tree probing of Versatile NOR flash
chips, there must be a way to add the VPP (write protection)
enable/disable callback. The register in question is in the
system controllers of these machines. Apart from this quirk,
the ARM flash chips are standard CFI flash chips from various
vendors.Additionally, the Integrator/AP require you to set up the external
bus interface (EBI) to allow writes to the chip select where the
flash memory is connected.Solve this by looking for the arm,versatile-flash compatible
string in the flash device tree node. In the driver,
add a special hook to check for the various Versatile syscons and
register a callback for .set_vpp() if this compatible is present.Provide a special Kconfig entry for the addon hook so it will
not be compiled in if the Versatile boards are not supported.
Stubs in the header file make sure the impact will be zero on
other platforms. (Compilers optimze this out.)With this patch, a large slew of ARM board file code can be
removed.Cc: Grant Likely
Cc: Rob Herring
Cc: Arnd Bergmann
Signed-off-by: Linus Walleij -
This reverts commit 06968a54790d ("mtd: pxa2xx-flash: switch from
ioremap_cache to memremap"), since NOR with memory semantics in array mode
and RAM are not necessarily the same thing, and architectures may implement
ioremap_cached() and memremap() with different memory attributes.For this reason, ioremap_cached() has been brought back from the dead on
the ARM side, so switch this driver back to using it instead of memremap().Cc: David Woodhouse
Acked-by: Brian Norris
Acked-by: Dan Williams
Signed-off-by: Ard Biesheuvel
14 Jan, 2016
1 commit
-
Pull MTD updates from Brian Norris:
"Generic MTD:- populate the MTD device 'of_node' field (and get a proper 'of_node'
symlink in sysfs)This yielded some new helper functions, and changes across a
variety of drivers- partitioning cleanups, to prepare for better device-tree based
partitioning in the futureEliminate a lot of boilerplate for drivers that want to use
OF-based partition parsingThe DT bindings for this didn't settle yet, so most non-cleanup
portions are deferred for a future releaseNAND:
- embed a struct mtd_info inside struct nand_chip
This is really long overdue; too many drivers have to do the same
silly boilerplate to allocate and link up two "independent"
structs, when in fact, everyone is assuming there is an exact 1:1
relationship between a NAND chips struct and its underlying MTD.
This aids improved helpers and should make certain abstractions
easier in the future.Also causes a lot of churn, helped along by some automated code
transformations- add more core support for detecting (and "correcting") bitflips in
erased pages; requires opt-in by drivers, but at least we kill a
few bad implementations and hopefully stave off future ones- pxa3xx_nand: cleanups, a few fixes, and PM improvements
- new JZ4780 NAND driver
SPI NOR:
- provide default erase function, for controllers that just want to
send the SECTOR_ERASE command directly- fix some module auto-loading issues with device tree
("jedec,spi-nor")- error handling fixes
- new Mediatek QSPI flash driver
Other:
- cfi: force valid geometry Kconfig (finally!)
This one used to trip up randconfigs occasionally, since bots
aren't deterred by big scary "advanced configuration" menusMore? Probably. See the commit logs"
* tag 'for-linus-20160112' of git://git.infradead.org/linux-mtd: (168 commits)
mtd: jz4780_nand: replace if/else blocks with switch/case
mtd: nand: jz4780: Update ecc correction error codes
mtd: nandsim: use nand_get_controller_data()
mtd: jz4780_nand: remove useless mtd->priv = chip assignment
staging: mt29f_spinand: make use of nand_set/get_controller_data() helpers
mtd: nand: make use of nand_set/get_controller_data() helpers
ARM: make use of nand_set/get_controller_data() helpers
mtd: nand: add helpers to access ->priv
mtd: nand: jz4780: driver for NAND devices on JZ4780 SoCs
mtd: nand: jz4740: remove custom 'erased check' implementation
mtd: nand: diskonchip: remove custom 'erased check' implementation
mtd: nand: davinci: remove custom 'erased check' implementation
mtd: nand: use nand_check_erased_ecc_chunk in default ECC read functions
mtd: nand: return consistent error codes in ecc.correct() implementations
doc: dt: mtd: new binding for jz4780-{nand,bch}
mtd: cfi_cmdset_0001: fixing memory leak and handling failed kmalloc
mtd: spi-nor: wait until lock/unlock operations are ready
mtd: tests: consolidate kmalloc/memset 0 call to kzalloc
jffs2: use to_delayed_work
mtd: nand: assign reasonable default name for NAND drivers
...
04 Jan, 2016
1 commit
-
Signed-off-by: Al Viro
12 Nov, 2015
2 commits
-
If there is more than one map region for this device, then the
concatenated MTD will not have a parent device assigned to it -- only
the sub-devices (which are not actually registered with the framework)
will have their parents assigned. Let's assign the concatenated device
correctly.Signed-off-by: Brian Norris
Reviewed-by: Boris Brezillon -
We should assign the MTD dev.of_node instead of the parser data field.
This gets us the equivalent partition parser behavior with fewer special
fields and parameter passing.Also convert several of these to mtd_device_register(), since we don't
need the 2nd and 3rd parameters anymore.Signed-off-by: Brian Norris
Reviewed-by: Marek Vasut
Reviewed-by: Boris Brezillon
20 Oct, 2015
1 commit
-
We got the syntax wrong here. Compile tested this time!
Error:
drivers/mtd/maps/rbtx4939-flash.c: In function 'rbtx4939_flash_probe':
>> drivers/mtd/maps/rbtx4939-flash.c:99:11: error: request for member 'dev' in something not a structure or union
info->mtd.dev.parent = &dev->dev;
^Fixes: 9aa7e50276c1 ("mtd: maps: rbtx4939-flash: show parent device in sysfs")
Reported-by: kbuild test robot
Signed-off-by: Brian Norris
Cc: Frans Klaver
14 Oct, 2015
11 commits
-
Fix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
Incidentally, it seems the owner field in the concatenated mtds is not
actually used, so this shouldn't make much of a difference anyway.Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris -
Fix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris -
Fix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris -
Owner is automatically set by mtdcore. Make use of that.
Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris -
Owner is automatically set by mtdcore. Make use of that.
Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris -
Owner is automatically set by mtdcore. Make use of that.
Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris -
Fix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris -
Fix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris -
Fix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris -
Fix a bug where mtd parent device symlinks aren't shown in sysfs.
While at it, make use of the default owner value set by mtdcore.
Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris -
Fix a bug where mtd parent device symlinks aren't shown in sysfs.
Signed-off-by: Frans Klaver
Signed-off-by: Brian Norris
13 Oct, 2015
1 commit
-
In preparation for deprecating ioremap_cache() convert its usage in
pxa2xx-flash to memremap.Cc: David Woodhouse
[brian: also convert iounmap to memunmap]
Signed-off-by: Dan Williams
Signed-off-by: Brian Norris
30 Sep, 2015
1 commit
-
The module pcmciamtd doesn't generate a mtd node for PRETEC 4MB SRAM
cards without the id and hash added to pcmciamtd.cTested on 3 different 4MB pretec sram cards.
Signed-off-by: Tom Englund
Signed-off-by: Brian Norris
19 Aug, 2015
2 commits
-
static analysis by smatch caught the following error:
drivers/mtd/maps/physmap_of.c:135 of_get_probes()
error: potential null dereference 'res'. (kzalloc returns null)Check for failed kzalloc and return -ENOMEM in of_flash_probe if
this occurs.Signed-off-by: Colin Ian King
Signed-off-by: Brian Norris -
If mtd_device_register() fails in nettel_init(), iomap left mapped.
The patch adds failure handling for mtd_device_register().
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov
Signed-off-by: Brian Norris