summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nor
Commit message (Collapse)AuthorAgeFilesLines
* mtd: cfi-flash: Set MTD's writebufsizeAlexander Stein2016-04-081-0/+1
| | | | | | | writebufsize is zero initialized, set actual value during init. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: Fix infoSascha Hauer2015-08-051-8/+15
| | | | | | | | | | | Since 636d384 mtd: cfi-flash: Add mtd concat support The devinfo output is broken. dev->priv no longer contains a struct flash_info * but instead a struct cfi_priv *. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: Add mtd concat supportSascha Hauer2015-06-231-14/+66
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: remove dead codeSascha Hauer2015-06-223-48/+0
| | | | | | | CFG_FLASH_PROTECTION is never defined, remove the code. Also remove code inside #if 0. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: Coding style cleanupSascha Hauer2015-06-224-248/+283
| | | | | | | | | | | - use consistent variable types (drop uchar, ushort and friends) - remove whitespace between functions and opening brace - Add some blank lines to rectify code - drop 'rc' and 'retcode' and use 'ret' consistently - Do not put variable assignment into if() - drop unncessary braces Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: use unaligned accessor functionsSascha Hauer2015-06-221-6/+7
| | | | | | | | Some members in struct cfi_qry are unaligned. Use get_unaligned_* to access them. Fixes unaligned aborts on busses which don't support unaligned accesses. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: turn some messages into vdbgSascha Hauer2015-06-222-14/+10
| | | | | | | Some messages produce a lot of log spam. Turn them into dev_vdbg to make some more important messages more visible. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: return 0 for successSascha Hauer2015-06-223-49/+33
| | | | | | | Use zero as success return code and negative standard error codes consistently in the driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: make flash_detect_width more readableSascha Hauer2015-06-221-28/+35
| | | | | | | Use variables instead of long defines to get the loops into a single line. Also use goto to move the deeply indented code more to the left. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: remove unnecessary ifdefsSascha Hauer2015-06-221-7/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: replace ifdef with IS_ENABLEDSascha Hauer2015-06-221-8/+9
| | | | | | | TO get rid of some ifdefs. While at it add the vendor code of the unsupported vendor to the error message. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: statically initialize instead of memsetSascha Hauer2015-06-221-3/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: save indention levelSascha Hauer2015-06-221-113/+114
| | | | | | Bail out early in flash_get_size() and save an indention level. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: cfi-flash: We can print longlongsSascha Hauer2015-06-221-23/+1
| | | | | | printf supports printing longlongs, so drop print_longlong. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Abolish cpu_read* and cpu_write* accessorsMasahiro Yamada2015-05-201-6/+6
| | | | | | | | | | | | | | Commit 2e6a88f2101d (add cpu native ordered io accessors) introduced these macros and then commit be57f20cdd7d (Fix big endian MMIO primitives) figured out they are equivalent to __raw_{read,write}*. They turned out unnecessary after all. Anyway, most source files use __raw_read* and __raw_write*. Let's replace a few remaining references and abolish them. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-021-0/+4
|\
| * resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-0/+4
| | | | | | | | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Subject: [PATCH] cfi: print size in human readable formatFranck Jullien2014-09-241-2/+2
|/ | | | | | | | The CFI size is now printed in a human readable format. It also adds "0x" prefix to the printed address. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: fix mtd erasesizeHerve Codina2014-06-101-1/+10
| | | | | | | Set mtd erasize using max erasesize from erase regions Signed-off-by: Herve Codina <Herve.CODINA@celad.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cfi_flash: fix NULL pointer dereferencePhilippe Rétornaz2014-02-281-1/+1
| | | | | | | | | We need to setup the info->dev pointer before flash_get_size() since it might use it for dev_dbg(). This fix a crash on boot when debug output is enabled. Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cfi_flash.c: correct calculation of region erasesize and offset for multiple ↵Cristiano De Alti2014-02-041-2/+2
| | | | | | | (size_ratio > 1) chips in parallel Signed-off-by: Cristiano De Alti <cristiano_dealti@hotmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Pass device_id to add_mtd_deviceSascha Hauer2013-10-291-1/+1
| | | | | | | | | Right now we do not support persistent names for mtd devices. The base name can be passed to add_mtd_device, but this is always appended with a dynamic number. With this patch add_mtd_device takes a device_id argument which can be used to create a mtd device with an exact name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mci'Sascha Hauer2013-06-021-1/+2
|\ | | | | | | | | Conflicts: include/driver.h
| * driver: Attach info callback to device, not to driverSascha Hauer2013-05-301-1/+2
| | | | | | | | | | | | | | | | Since the info is device specific and not driver specific, attach the callback to the device. This makes it possible to have a info callback for a device which does not have a driver attached. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cfi: make hardware device parent of mtd deviceSascha Hauer2013-05-271-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cfi: Add dev * to flash_info and switch to dev_*Sascha Hauer2013-05-272-27/+29
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cfi: remove unused field from struct flash_infoSascha Hauer2013-05-271-1/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cfi_flash: size_ratio should not be 0Oleksij Rempel2013-05-271-1/+2
| | | | | | | | | | | | | | We will get size = 0 if size_ratio = 0 Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cfi_flash: add shift option for some cfi memory chipsOleksij Rempel2013-05-272-5/+22
|/ | | | | | | | | | | | Many cfi chips support 16 and 8 bit modes. Most important difference is use of so called "Q15/A-1" pin. In 16bit mode this pin is used for data IO. In 8bit mode, it is an address input which add one more least significant bit (LSB). In this case we should shift all adresses by one: For example 0xaa << 1 = 0x154 Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mtd'Sascha Hauer2013-03-041-7/+1
| | | | | | Conflicts: arch/arm/configs/eukrea_cpuimx27_defconfig drivers/mtd/core.c
* mtd nor: remove unnecessary 'depend' in KconfigSascha Hauer2013-02-181-8/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nor flash: integrate into mtdSascha Hauer2013-02-146-0/+2230
CFI Flash is currently handled outside the mtd layer which makes it a special case. Integrate it into mtd so that we get rid of this special status. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>