History log of /linux-master/drivers/memory/omap-gpmc.c
Revision Date Author Comments
# 6a4edb1a 17-Dec-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

memory: omap-gpmc: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/019d9dc31af9b30a6b675fec219e64b667475efd.1702822744.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


# 827e0920 08-Dec-2022 Benedikt Niedermayr <benedikt.niedermayr@siemens.com>

memory: omap-gpmc: fix wait pin validation

This bug has been introduced after switching from -1 to UINT_MAX
for GPMC_WAITPIN_INVALID.

The bug leads to an error when the optional gpmc,wait-pin
dt-property is not used:

...
gpmc_cs_program_settings: invalid wait-pin (-1)
...

Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
Fixes: 8dd7e4af5853 ("memory: omap-gpmc: fix coverity issue "Control flow issues"")
Acked-by: Roger Quadros <rogerq@kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20221209112828.581491-1-benedikt.niedermayr@siemens.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


# 8dd7e4af 09-Nov-2022 Benedikt Niedermayr <benedikt.niedermayr@siemens.com>

memory: omap-gpmc: fix coverity issue "Control flow issues"

Assign a big positive integer instead of an negative integer to an
u32 variable. Also remove the check for ">= 0" which doesn't make sense
for unsigned integers.

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527139 ("Control flow issues")
Fixes: 89aed3cd5cb9 ("memory: omap-gpmc: wait pin additions")
Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20221109102454.174320-1-benedikt.niedermayr@siemens.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


# 89aed3cd 02-Nov-2022 Benedikt Niedermayr <benedikt.niedermayr@siemens.com>

memory: omap-gpmc: wait pin additions

This patch introduces support for setting the wait-pin polarity as well
as using the same wait-pin for different CS regions.

The waitpin polarity can be configured via the WAITPIN<X>POLARITY bits
in the GPMC_CONFIG register. This is currently not supported by the
driver. This patch adds support for setting the required register bits
with the "ti,wait-pin-polarity" dt-property.

The wait-pin can also be shared between different CS regions for special
usecases. Therefore GPMC must keep track of wait-pin allocations, so it
knows that either GPMC itself or another driver has the ownership.

Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
Link: https://lore.kernel.org/r/20221102133047.1654449-2-benedikt.niedermayr@siemens.com
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


# 854fd920 26-Apr-2022 Roger Quadros <rogerq@kernel.org>

memory: omap-gpmc: Allow building as a module

Allow OMAP_GPMC to be built as a module.

When building this driver as a module, the symbol
'of_default_bus_match_table' will not be found as it is not being
exported.

The of_match_node() call is redundant anyways as
of_platform_default_populate() already takes care of matching with
'of_default_bus_match_table'. So get rid of that call. This will also
resolve the module build failure.

Move compatible match table to the end where it is usually expected.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20220426082611.24427-3-rogerq@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


# f2f8115f 21-Dec-2021 Roger Quadros <rogerq@kernel.org>

memory: omap-gpmc: Use a compatible match table when checking for NAND controller

As more compatibles can be added to the GPMC NAND controller driver
use a compatible match table.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20211221131757.2030-4-rogerq@kernel.org
[krzysztof: remove "is_nand" variable]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>


# 7e58accf 21-Dec-2021 Roger Quadros <rogerq@kernel.org>

memory: omap-gpmc: Add support for GPMC on AM64 SoC

The TI's AM64 SoC has the GPMC module. Add compatible for it.

Traditionally GPMC external addresses have always been mapped to first
1GB physical address. However newer platforms, can have it mapped
at different locations. Support this address provision via device tree.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20211221131757.2030-3-rogerq@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>


# 19d398dc 21-Dec-2021 Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

memory: omap-gpmc: Use platform_get_irq() to get the interrupt

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Link: https://lore.kernel.org/r/20211221203916.18588-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>


# 77ed5e9d 27-Jul-2021 Tony Lindgren <tony@atomide.com>

memory: omap-gpmc: Drop custom PM calls with cpu_pm notifier

We can now switch over to using cpu_pm instead of custom calls and make
the context save and restore functions static.

Let's also move the save and restore functions to avoid adding forward
declarations for them. And get rid of the static data pointer while at it.

Cc: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210727101034.32148-2-tony@atomide.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>


# 0f78964b 27-Jul-2021 Tony Lindgren <tony@atomide.com>

memory: omap-gpmc: Clear GPMC_CS_CONFIG7 register on restore if unused

We want to clear any unused GPMC_CS_CONFIG7 register on restore to
ensure unused chip selects are not enabled.

Cc: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210727101034.32148-1-tony@atomide.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>


# e004c3e6 23-Feb-2021 Colin Ian King <colin.king@canonical.com>

memory: gpmc: fix out of bounds read and dereference on gpmc_cs[]

Currently the array gpmc_cs is indexed by cs before it cs is range checked
and the pointer read from this out-of-index read is dereferenced. Fix this
by performing the range check on cs before the read and the following
pointer dereference.

Addresses-Coverity: ("Negative array index read")
Fixes: 9ed7a776eb50 ("ARM: OMAP2+: Fix support for multiple devices on a GPMC chip select")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210223193821.17232-1-colin.king@canonical.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# 6cf238d4 01-Sep-2020 YueHaibing <yuehaibing@huawei.com>

memory: omap-gpmc: Fix -Wunused-function warnings

If CONFIG_OF is not set, make W=1 warns:

drivers/memory/omap-gpmc.c:987:12: warning: ‘gpmc_cs_remap’ defined but not used [-Wunused-function]
drivers/memory/omap-gpmc.c:926:20: warning: ‘gpmc_cs_get_name’ defined but not used [-Wunused-function]
drivers/memory/omap-gpmc.c:919:13: warning: ‘gpmc_cs_set_name’ defined but not used [-Wunused-function]

Move them to #ifdef CONFIG_OF block to fix this.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Link: https://lore.kernel.org/r/20200901112832.3084-1-yuehaibing%40huawei.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# 13d029ee 27-Aug-2020 YueHaibing <yuehaibing@huawei.com>

memory: omap-gpmc: Fix build error without CONFIG_OF

If CONFIG_OF is n, gcc fails:

drivers/memory/omap-gpmc.o: In function `gpmc_omap_onenand_set_timings':
omap-gpmc.c:(.text+0x2a88): undefined reference to `gpmc_read_settings_dt'

Add gpmc_read_settings_dt() helper function, which zero the gpmc_settings
so the caller doesn't proceed with random/invalid settings.

Fixes: a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Link: https://lore.kernel.org/r/20200827125316.20780-1-yuehaibing@huawei.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# 4c54228a 25-Aug-2020 Dan Carpenter <dan.carpenter@oracle.com>

memory: omap-gpmc: Fix a couple off by ones

These comparisons should be >= instead of > to prevent reading one
element beyond the end of the gpmc_cs[] array.

Fixes: cdd6928c589a ("ARM: OMAP2+: Add device-tree support for NOR flash")
Fixes: f37e4580c409 ("ARM: OMAP2: Dynamic allocator for GPMC memory space")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Link: https://lore.kernel.org/r/20200825104707.GB278587@mwanda
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# df561f66 23-Aug-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

treewide: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# dc1a9283 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: consistently use !res for NULL checks

The driver already uses 'if (!res)' pattern in the probe function so be
consistent.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200724182328.3348-11-krzk@kernel.org


# 07b6cc45 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: use WARN() instead of BUG() on wrong free

Since driver tracks reserved memory, freeing a non-reserved GPMC should
not be fatal and crash the system. Printing a warning is friendlier.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200724182328.3348-9-krzk@kernel.org


# 1724f1b6 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: remove GPMC_SET_ONE_CD_MAX macro for safety

The GPMC_SET_ONE_CD_MAX macro uses return statement and variable 'cs'
coming from called scope. This is not a good practice. Also
checkpatch complained:

WARNING: Macros with flow control statements should be avoided
ERROR: Macros starting with if should be enclosed by a do - while
loop to avoid possible if/else logic defects

Since GPMC_SET_ONE_CD_MAX macro just calls one function, it can be open
coded. The difference with original code is that function will exit on
error not after every register set, but after a group of sets.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200724074038.5597-22-krzk@kernel.org


# d25112aa 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: return meaningful error codes in gpmc_cs_set_timings()

The callers of gpmc_cs_set_timings() expect to receive -ERRNO on errors
and they pass further what they have received.

However gpmc_cs_set_timings() was returning -1 (equal to -EPERM) which
does not make sense in this context.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200724074038.5597-21-krzk@kernel.org


# ddbfbcba 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: remove unused file-scope phys_base and mem_size

The file-scope variables phys_base and mem_size are assigned in
gpmc_probe() but never read.

This fixes build error when compile testing on x86_64 architecture:

drivers/memory/omap-gpmc.c:246:24: error: conflicting types for ‘phys_base’
static resource_size_t phys_base, mem_size;
In file included from arch/x86/include/asm/page.h:12:0,
from arch/x86/include/asm/thread_info.h:12,
from include/linux/thread_info.h:38,
from arch/x86/include/asm/preempt.h:7,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/irq.h:14,
from drivers/memory/omap-gpmc.c:12:
arch/x86/include/asm/page_64.h:12:22: note: previous declaration of ‘phys_base’ was here
extern unsigned long phys_base;

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200724074038.5597-3-krzk@kernel.org


# 8e9ffd5e 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: remove unneeded asm/mach-types.h inclusion

The driver does not use macros from asm/mach-types.h (neither MACH_TYPE
nor machine_is_xxx()). Removal of this include allows compile testing
on non-ARM architectures which lack this header.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200724074038.5597-2-krzk@kernel.org


# 858432c7 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: Fix language typo

Fix arbitary -> arbitrary.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# cdd1aeae 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: Correct white space issues

Remove some unneeded blank lines, align indentation with open
parenthesis (or fix existing alignment).

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# 1cd53458 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: Use 'unsigned int' for consistency

Driver uses 'unsigned int' in other places instead of 'unsigned'.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# 98397f1c 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: Enclose macro argument usage in parenthesis

Macros arguments should be enclosed by parenthesis for safety.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# 80c4f5a8 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: Correct kerneldoc

Use proper kerneldoc to fix GCC warnings like:

drivers/memory/omap-gpmc.c:299: warning: Function parameter or member 'cs' not described in 'gpmc_get_clk_period'
drivers/memory/omap-gpmc.c:432: warning: Excess function parameter 'ma' description in 'get_gpmc_timing_reg'

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# 1a1e7580 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: Fix whitespace issue

Fix minor whitespace and comment issues. No functional changes.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# 07852c3f 24-Jul-2020 Krzysztof Kozlowski <krzk@kernel.org>

memory: omap-gpmc: Include <linux/sizes.h> for SZ_16M

The driver uses SZ_16M which is defined in include/linux/sizes.h. On
ARM it was pulled by other headers but its inclusion is necessary for
compile testing on other architectures.

This fixes build error when compile testing on i386 architecture:

drivers/memory/omap-gpmc.c: In function ‘gpmc_cs_remap’:
drivers/memory/omap-gpmc.c:961:12: error: ‘SZ_16M’ undeclared (first use in this function)

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5923ea6c 26-Apr-2019 Linus Walleij <linus.walleij@linaro.org>

gpio: pass lookup and descriptor flags to request_own

When a gpio_chip wants to request a descriptor from itself
using gpiochip_request_own_desc() it needs to be able to specify
fully how to use the descriptor, notably line inversion
semantics. The workaround in the gpiolib.c can be removed
and cases (such as SPI CS) where we need at times to request
a GPIO with line inversion semantics directly on a chip for
workarounds, can be fully supported with this call.

Fix up some users of the API that weren't really using the
last flag to set up the line as input or output properly
but instead just calling direction setting explicitly
after requesting the line.

Cc: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# a0752e9c 17-Dec-2018 Linus Walleij <linus.walleij@linaro.org>

memory: omap-gpmc: Get the header of the enum

Commit 21abf103818a
("gpio: Pass a flag to gpiochip_request_own_desc()")
started to pass an enum gpiod_flags but this file is
not including the header file that defines that enum
and the compiler spits:

drivers/memory/omap-gpmc.c: In function
'gpmc_probe_generic_child':
drivers/memory/omap-gpmc.c:2174:9: error: type of formal
parameter 4 is incomplete
0);
^

Cc: Ladislav Michl <ladis@linux-mips.org>
Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 21abf103818a ("gpio: Pass a flag to gpiochip_request_own_desc()")
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# 21abf103 04-Sep-2018 Linus Walleij <linus.walleij@linaro.org>

gpio: Pass a flag to gpiochip_request_own_desc()

Before things go out of hand, make it possible to pass
flags when requesting "own" descriptors from a gpio_chip.
This is necessary if the chip wants to request a GPIO with
active low semantics, for example.

Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Roger Quadros <rogerq@ti.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# c2ade654 05-Dec-2018 Rob Herring <robh@kernel.org>

memory: omap-gpmc: Use of_node_name_eq for node name comparisons

Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.

For instances using of_node_cmp, this has the side effect of now using
case sensitive comparisons. This should not matter for any FDT based
system which this is.

Cc: Roger Quadros <rogerq@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# c86f9854 27-Aug-2018 Rob Herring <robh@kernel.org>

memory: Convert to using %pOFn instead of device_node.name

In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Cc: Roger Quadros <rogerq@ti.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>


# d507178f 20-Apr-2018 Roger Quadros <rogerq@ti.com>

memory: omap-gpmc: Avoid redundant NULL check

child->name cannot be NULL as we're already checking for it
in gpmc_probe_dt_children()

Signed-off-by: Roger Quadros <rogerq@ti.com>


# a758f50f 12-Jan-2018 Ladislav Michl <ladis@linux-mips.org>

mtd: onenand: omap2: Configure driver from DT

Move away from platform data configuration and use pure DT approach.

Use generic probe function to deal with OneNAND node and remove now useless
gpmc_probe_onenand_child function. Import sync mode timing calculation
function from mach-omap2/gpmc-onenand.c

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>


# c18a7ac3 06-Nov-2017 Ladislav Michl <ladis@linux-mips.org>

memory: omap-gpmc: Make 'bank-width' property optional

Error out only if both 'bank-width' and 'gpmc,device-width' are missing.
As 'bank-width' is mostly used for NOR devices and all other devices must
use 'gpmc,device-width' update the error message accordingly.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# a622c641 25-Oct-2017 Ladislav Michl <ladis@linux-mips.org>

memory: omap-gpmc: Remove deprecated gpmc_update_nand_reg()

Deprecated gpmc_update_nand_reg() is no longer used, remove.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 0d96a4f6 06-Oct-2017 Ladislav Michl <ladis@linux-mips.org>

memory: omap-gpmc: Drop gpmc_status

This field is no longer used, drop it.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# db749d17 18-Jul-2017 Rob Herring <robh@kernel.org>

memory: Convert to using %pOF instead of full_name

Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>


# c9eabf40 25-May-2017 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

memory: omap-gpmc: add error message if bank-width property is absent

Instead of failing silently log a hint for the dt author about the
reason of the failure.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 95c278b2 17-May-2017 Uwe Kleine-König <uwe@kleine-koenig.org>

memory: omap-gpmc: make dts snippet include semicolon

In the device tree each property must be terminated with a semicolon, so
include them in the output for easier cut-n-paste.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# aff523fb 05-May-2017 Tony Lindgren <tony@atomide.com>

memory: omap-gpmc: Fix debug output for access width

The width needs to be configured in bytes with 1 meaning 8-bit
access and 2 meaning 16-bit access.

Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 7807e086 11-Feb-2017 Ladislav Michl <ladis@linux-mips.org>

ARM: OMAP2+: gpmc-onenand: propagate error on initialization failure

gpmc_probe_onenand_child returns success even on gpmc_onenand_init
failure. Fix that.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 3950fffd 27-Aug-2016 Baoyou Xie <baoyou.xie@linaro.org>

memory: omap-gpmc: make gpmc_clk_ticks_to_ns() static

We get 1 warning when build kernel with W=1:
drivers/memory/omap-gpmc.c:354:14: warning: no previous prototype for 'gpmc_clk_ticks_to_ns' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is declared
and don't need a declaration, but can be made static.
so this patch marks it 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 525fe43f 08-Aug-2016 Linus Walleij <linus.walleij@linaro.org>

memory: omap-gpmc: use devm_gpiochip_add_data()

This saves a few codelines in the driver.

Cc: Roger Quadros <rogerq@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 3f41a3c4 23-Jul-2016 Markus Elfring <elfring@users.sourceforge.net>

memory: omap-gpmc: Delete an unnecessary check before the function call "gpiochip_free_own_desc"

The gpiochip_free_own_desc() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 23540d6e 24-Jul-2016 Johan Hovold <johan@kernel.org>

memory: omap-gpmc: allow probe of child nodes to fail

A recent commit (inadvertently?) changed how failed probe of a gpmc
child node was handled. Instead of proceeding with setting up any other
children as before, a single error now aborts the whole process.

This change broke networking on some Overo boards due to probe failing
for an unrelated nand node. This second issue should obviously be
fixed, but let's restore the old behaviour of allowing child-node
probe to fail to avoid further similar breakage on other systems.

Fixes: d2d00862dfbb ("memory: omap-gpmc: Support general purpose input
for WAITPINs")

Cc: stable@vger.kernel.org # v4.7+
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 9f2c519c 01-Jun-2016 Kefeng Wang <wangkefeng.wang@huawei.com>

memory: omap-gpmc: use of_platform_default_populate() to populate default bus

Use helper of_platform_default_populate() in linux/of_platform
when possible, instead of calling of_platform_populate() with
the default match table.

Acked-by: Roger Quadros <rogerq@ti.com>
Cc: Roger Quadros <rogerq@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Rob Herring <robh@kernel.org>


# 32dd625a 17-Jun-2016 Roger Quadros <rogerq@ti.com>

memory: omap-gpmc: Move gpio functions out of #ifdef CONFIG_OF

The gpio related functions were mistakenly built only if CONFIG_OF
is defined. They are needed even otherwise and will cause build
failures if CONFIG_OF is not defined. Move the gpio functions
outside #ifdef CONFIG_OF.

Fixes: d2d00862dfbb ("memory: omap-gpmc: Support general purpose input for WAITPINs")

Signed-off-by: Roger Quadros <rogerq@ti.com>


# caf21c61 16-Jun-2016 Paul Gortmaker <paul.gortmaker@windriver.com>

memory: omap-gpmc: make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/memory/Kconfig:config OMAP_GPMC
drivers/memory/Kconfig: bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We don't replace module.h with init.h since the file already has that.

Cc: Roger Quadros <rogerq@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# 8f50b8e5 15-Jun-2016 Ocquidant, Sebastien <sebastienocquidant@eaton.com>

memory: omap-gpmc: Fix omap gpmc EXTRADELAY timing

In the omap gpmc driver it can be noticed that GPMC_CONFIG4_OEEXTRADELAY
is overwritten by the WEEXTRADELAY value from the device tree and
GPMC_CONFIG4_WEEXTRADELAY is not updated by the value from the device
tree.

As a consequence, the memory accesses cannot be configured properly when
the extra delay are needed for OE and WE.

Fix the update of GPMC_CONFIG4_WEEXTRADELAY with the value from the
device tree file and prevents GPMC_CONFIG4_OEXTRADELAY
being overwritten by the WEXTRADELAY value from the device tree.

Cc: stable@vger.kernel.org
Signed-off-by: Ocquidant, Sebastien <sebastienocquidant@eaton.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# f679888f 19-Apr-2016 Boris Brezillon <bbrezillon@kernel.org>

mtd: nand: omap2: rely on generic DT parsing done in nand_scan_ident()

The core now takes care of parsing generic DT properties in
nand_scan_ident() when nand_set_flash_node() has been called.
Rely on this initialization instead of calling of_get_nand_xxx()
manually.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Tested-by: Franklin S Cooper Jr. <fcooper@ti.com>


# 9e694621 07-Aug-2015 Roger Quadros <rogerq@ti.com>

memory: omap-gpmc: Prevent GPMC_STATUS from being accessed via gpmc_regs

GPMC_STATUS register is private to the GPMC module and must not be
accessed directly by NAND driver through the gpmc_regs.

They must use gpmc_omap_get_nand_ops() instead.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>


# b2bac25a 19-Feb-2016 Roger Quadros <rogerq@ti.com>

memory: omap-gpmc: Support WAIT pin edge interrupts

OMAPs can have 2 to 4 WAITPINs that can be used as edge triggered
interrupts if not used for memory wait state insertion.

Support these interrupts via the gpmc IRQ domain.

The gpmc IRQ domain interrupt map is:

0 - NAND_fifoevent
1 - NAND_termcount
2 - GPMC_WAIT0 edge
3 - GPMC_WAIT1 edge, and so on

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Tony Lindgren <tony@atomide.com>


# 210325f0 06-Aug-2015 Roger Quadros <rogerq@ti.com>

memory: omap-gpmc: Reserve WAITPIN if needed for WAIT monitoring

If the device attached to GPMC wants to use the WAIT pin
for WAIT monitoring then we reserve it internally for
exclusive use.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>


# d2d00862 06-Mar-2016 Roger Quadros <rogerq@ti.com>

memory: omap-gpmc: Support general purpose input for WAITPINs

OMAPs can have 2 to 4 WAITPINs that can be used as general purpose
input if not used for memory wait state insertion.

The first user will be the OMAP NAND chip to get the NAND
read/busy status using gpiolib.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Tony Lindgren <tony@atomide.com>


# bdd7e033 09-Jul-2015 Roger Quadros <rogerq@ti.com>

memory: omap-gpmc: Prevent mapping into 1st 16MB

We have been preventing mapping GPMC children in the
first 1MB but really it has to be the first 16MB as
the minimum GPMC partition size is 16MB.

Also print an error message if CS mapping fails
due to DT requesting address outside the GPMC
map.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>


# c9711ec5 20-May-2014 Roger Quadros <rogerq@ti.com>

mtd: nand: omap: Clean up device tree support

Move NAND specific device tree parsing to NAND driver.

The NAND controller node must have a compatible id, register space
resource and interrupt resource.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>


# 384258f2 30-Jul-2015 Roger Quadros <rogerq@ti.com>

memory: omap-gpmc: Implement IRQ domain for NAND IRQs

GPMC provides 2 interrupts for NAND use. i.e. fifoevent and termcount.
Use IRQ domain for this. NAND device tree node can then
get the necessary interrupts by using gpmc as the interrupt parent.

Legacy boot uses gpmc_get_client_irq to get the
NAND interrupts from the GPMC IRQ domain.
Get rid of custom bitmasks and use IRQ domain for that
as well.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Tony Lindgren <tony@atomide.com>


# 512d73d1 05-Aug-2015 Roger Quadros <rogerq@ti.com>

memory: omap-gpmc: Add GPMC-NAND ops to get writebufferempty status

This is needed by OMAP NAND driver to poll the empty status
of the writebuffer.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>


# f47fcad6 05-Aug-2015 Roger Quadros <rogerq@ti.com>

memory: omap-gpmc: Introduce GPMC to NAND interface

The OMAP GPMC module has certain registers dedicated for NAND
access and some NAND bits mixed with other GPMC functionality.

For the NAND dedicated registers we have the struct gpmc_nand_regs.

The NAND driver needs to access NAND specific bits from the
following non-dedicated registers
- EMPTYWRITEBUFFERSTATUS from GPMC_STATUS

For accessing these bits we introduce the struct gpmc_nand_ops.

Add gpmc_omap_get_nand_ops() that returns the gpmc_nand_ops along
with updating the gpmc_nand_regs. This API will be called by the
OMAP NAND driver to access the necessary bits in GPMC register space.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>


# 2c92c04b 28-Dec-2015 Neil Armstrong <narmstrong@baylibre.com>

memory: omap-gpmc: Add support for AAD timings

In order to support extended timings parameters on hardware supporting the
"AAD" mode like the AM335x or DM816x, add these entries into the GPMC driver
if the hardware is capable.

Tested on DM816x and AM335x.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# fd820a1e 06-Oct-2015 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

memory: omap-gpmc: dump "before" state before first modification

When gpmc_cs_show_timings is called in gpmc_cs_set_timings()
gpmc_cs_program_settings() was already run which modifies the CONFIG1
register. So to be more useful do the "before" dump earlier.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# ed293d1a 12-Jul-2015 Rob Herring <robh@kernel.org>

memory: kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Roger Quadros <rogerq@ti.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Tony Lindgren <tony@atomide.com>


# e984a179 05-Aug-2015 Tomeu Vizoso <tomeu.vizoso@collabora.com>

memory: omap-gpmc: Don't try to save uninitialized GPMC context

If for some reason the GPMC device hasn't been probed yet, gpmc_base is
going to be NULL. Because there's no context yet to be saved, just turn
these functions into no-ops until that device gets probed.

Unable to handle kernel NULL pointer dereference at virtual address 00000010
pgd = c0204000
[00000010] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.2.0-rc5-next-20150804-05947-g23f38fe8eda9 #1
Hardware name: Generic OMAP3-GP (Flattened Device Tree)
task: c0e623e8 ti: c0e5c000 task.ti: c0e5c000
PC is at omap3_gpmc_save_context+0x8/0xc4
LR is at omap_sram_idle+0x154/0x23c
pc : [<c087c7ac>] lr : [<c023262c>] psr: 60000193
sp : c0e5df40 ip : c0f92a80 fp : c0999eb0
r10: c0e57364 r9 : c0e66f14 r8 : 00000003
r7 : 00000000 r6 : 00000003 r5 : 00000000 r4 : c0f5f174
r3 : c0fa4fe8 r2 : 00000000 r1 : 00000000 r0 : fa200280
Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 10c5387d Table: 80204019 DAC: 00000015
Process swapper/0 (pid: 0, stack limit = 0xc0e5c220)
Stack: (0xc0e5df40 to 0xc0e5e000)
df40: 00000000 c0e66ef8 c0f5f1a4 00000000 00000003 c02333a4 c3813822 00000000
df60: 00000000 c0e5a5c8 cfb8a5d0 c07f0c44 0e4f1d7e 00000000 00000000 00000000
df80: c3813822 00000000 cfb8a5d0 c0e5e4e4 cfb8a5d0 c0e66f14 c0e5a5c8 c0e5e54c
dfa0: c0e5e544 c0e57364 c0999eb0 c0277758 000000fa c0f5d000 00000000 c0d61c18
dfc0: ffffffff ffffffff 00000000 c0d61674 00000000 c0df7a48 00000000 c0f5d5d4
dfe0: c0e5e4c0 c0df7a44 c0e634f8 80204059 00000000 8020807c 00000000 00000000
[<c087c7ac>] (omap3_gpmc_save_context) from [<c023262c>] (omap_sram_idle+0x154/0x23c)
[<c023262c>] (omap_sram_idle) from [<c02333a4>] (omap3_enter_idle_bm+0xec/0x1a8)
[<c02333a4>] (omap3_enter_idle_bm) from [<c07f0c44>] (cpuidle_enter_state+0xbc/0x284)
[<c07f0c44>] (cpuidle_enter_state) from [<c0277758>] (cpu_startup_entry+0x174/0x24c)
[<c0277758>] (cpu_startup_entry) from [<c0d61c18>] (start_kernel+0x358/0x3c0)
[<c0d61c18>] (start_kernel) from [<8020807c>] (0x8020807c)
Code: c0ccace8 c0ccacc0 e59f30b4 e5932000 (e5921010)

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Suggested-by: Javier Martinez Canillas <javier@dowhile0.org>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Roger Quadros <rogerq@ti.com>
[tony@atomide.com: updated description as suggested by Javier]
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 63aa945b 01-Jun-2015 Tony Lindgren <tony@atomide.com>

memory: omap-gpmc: Add Kconfig option for debug

We support decoding the bootloader values if DEBUG is defined.
But we also need to change the struct omap_hwmod flags to have
HWMOD_INIT_NO_RESET to avoid the GPMC being reset during the
boot. Otherwise just the default timings will be displayed
instead of the bootloader configured timings.

This also allows us to clean up the various GPMC related
hwmod flags. For debugging, we only need HWMOD_INIT_NO_RESET,
and HWMOD_INIT_NO_IDLE is not needed.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>


# 28a7eedd 01-Jun-2015 Tony Lindgren <tony@atomide.com>

memory: omap-gpmc: Fix parsing of devices

We currently artificially limit the parsing of GPMC connected
devices based on the device name. Let's stop doing that, it's
confusing as adding devices to .dts files with using normal
names like fpga and usb will currently cause them to not probe.

Cc: Roger Quadros <rogerq@ti.com>
Reported-by: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 4b613e9b 27-Feb-2015 Robert ABEL <rabel@cit-ec.uni-bielefeld.de>

ARM OMAP2+ GPMC: fix programming/showing reserved timing parameters

GPMC_CONFIG1_i parameters CLKACTIVATIONTIME and WAITMONITORINGTIME
have reserved values.
Raise an error if calculated timings try to program reserved values.

GPMC_CONFIG1_i ATTACHEDDEVICEPAGELENGTH and DEVICESIZE were already checked
when parsing the DT.

Explicitly comment invalid values on gpmc_cs_show_timings for
-CLKACTIVATIONTIME
-WAITMONITORINGTIME
-DEVICESIZE
-ATTACHEDDEVICEPAGELENGTH

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 7f2e8c58 27-Feb-2015 Robert ABEL <rabel@cit-ec.uni-bielefeld.de>

ARM OMAP2+ GPMC: fix WAITMONITORINGTIME divider bug

The WAITMONITORINGTIME is expressed as a number of GPMC_CLK clock cycles,
even though the access is defined as asynchronous, and no GPMC_CLK clock
is provided to the external device. Still, GPMCFCLKDIVIDER is used as a divider
for the GPMC clock, so it must be programmed to define the
correct WAITMONITORINGTIME delay.

This patch correctly computes WAITMONITORINGTIME in GPMC_CLK cycles instead of GPMC_FCLK cycles,
both during programming (gpmc_cs_set_timings) and during retrieval (gpmc_cs_show_timings).

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 2e676901 27-Feb-2015 Robert ABEL <rabel@cit-ec.uni-bielefeld.de>

ARM OMAP2+ GPMC: calculate GPMCFCLKDIVIDER based on WAITMONITORINGTIME

The WAITMONITORINGTIME is expressed as a number of GPMC_CLK clock cycles,
even though the access is defined as asynchronous, and no GPMC_CLK clock
is provided to the external device. Still, GPMCFCLKDIVIDER is used as a divider
for the GPMC clock, so it must be programmed to define the
correct WAITMONITORINGTIME delay.

Calculate GPMCFCLKDIVIDER independent of gpmc,sync-clk-ps in DT for
pure asynchronous accesses, i.e. both read and write asynchronous.

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# f585070b 27-Feb-2015 Robert ABEL <rabel@cit-ec.uni-bielefeld.de>

ARM OMAP2+ GPMC: always program GPMCFCLKDIVIDER

The WAITMONITORINGTIME is expressed as a number of GPMC_CLK clock cycles,
even though the access is defined as asynchronous, and no GPMC_CLK clock
is provided to the external device. Still, GPMCFCLKDIVIDER is used as a divider
for the GPMC clock, so it must be programmed to define the
correct WAITMONITORINGTIME delay.

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 563dbb26 27-Feb-2015 Robert ABEL <rabel@cit-ec.uni-bielefeld.de>

ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS

DTS output was formatted to require additional work when copy-pasting into DTS.
Nano-second timings were replaced with interval of values that produce the same
number of clock ticks.

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 2affc816 27-Feb-2015 Robert ABEL <rabel@cit-ec.uni-bielefeld.de>

ARM OMAP2+ GPMC: fix debug output alignment

GPMC debug output is aligned to 10 characters for field names.
However, some fields have bigger names, screwing up the alignment.
Consequently, alignment was changed to longest field name (17 chars) for now.

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# b1dc1ca9 27-Feb-2015 Robert ABEL <rabel@cit-ec.uni-bielefeld.de>

ARM OMAP2+ GPMC: add bus children

This patch adds support for spawning buses as children of the GPMC.

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 5e9444d9 27-Feb-2015 Robert ABEL <rabel@cit-ec.uni-bielefeld.de>

ARM OMAP2+ GPMC: don't undef DEBUG

OMAP2+ GPMC driver undefines DEBUG, which makes it unnecessarily
hard to turn DEBUG on. Remove the offending lines.

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 2e25b0ec 24-Jan-2015 Semen Protsenko <semen.protsenko@globallogic.com>

ARM: OMAP2+: gpmc: make gpmc_cs_get_name() static

Fix sparse warning:
warning: symbol 'gpmc_cs_get_name' was not declared. Should it be static?

Signed-off-by: Semen Protsenko <semen.protsenko@globallogic.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 9c4f757e 24-Jan-2015 Semen Protsenko <semen.protsenko@globallogic.com>

ARM: OMAP2+: gpmc: Fix writing in gpmc_cs_set_memconf

Some GPMC_CONFIG7 register bits marked as "RESERVED", means they
shouldn't be overwritten. A typical approach to handle such bits called
"Read-Modify-Write". Writing procedure used in gpmc_cs_set_memconf()
utilizes RMW technique, but implemented incorrectly. Due to obvious typo
in code read register value is being rewritten by another value, which
leads to loss of read RESERVED bits. This patch fixes this.

While at it, replace magic numbers with named constants to improve code
readability.

Signed-off-by: Semen Protsenko <semen.protsenko@globallogic.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>


# 18640193 20-Nov-2014 Tony Lindgren <tony@atomide.com>

memory: gpmc: Move omap gpmc code to live under drivers

Just move to drivers as further clean-up can now happen there
finally.

Let's also add Roger and me to the MAINTAINERS so we get
notified for any patches related to GPMC.

Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>