Commit a9970507 authored by Vignesh Raghavendra's avatar Vignesh Raghavendra Committed by Mark Brown

mtd: spi-nor: cadence-quadspi: Provide a way to disable DAC mode

Currently direct access mode is used on platforms that have AHB window
(memory mapped window) larger than flash size. This feature is limited
to TI platforms as non TI platforms have < 1MB of AHB window.
Therefore introduce a driver quirk to disable DAC mode and set it for
non TI compatibles. This is in preparation to move to spi-mem framework
where flash geometry cannot be known.
Signed-off-by: default avatarVignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20200601070444.16923-3-vigneshr@ti.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 834b4e8d
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
/* Quirks */ /* Quirks */
#define CQSPI_NEEDS_WR_DELAY BIT(0) #define CQSPI_NEEDS_WR_DELAY BIT(0)
#define CQSPI_DISABLE_DAC_MODE BIT(1)
/* Capabilities mask */ /* Capabilities mask */
#define CQSPI_BASE_HWCAPS_MASK \ #define CQSPI_BASE_HWCAPS_MASK \
...@@ -1261,7 +1262,8 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np) ...@@ -1261,7 +1262,8 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np)
f_pdata->registered = true; f_pdata->registered = true;
if (mtd->size <= cqspi->ahb_size) { if (mtd->size <= cqspi->ahb_size &&
!(ddata->quirks & CQSPI_DISABLE_DAC_MODE)) {
f_pdata->use_direct_mode = true; f_pdata->use_direct_mode = true;
dev_dbg(nor->dev, "using direct mode for %s\n", dev_dbg(nor->dev, "using direct mode for %s\n",
mtd->name); mtd->name);
...@@ -1457,6 +1459,7 @@ static const struct dev_pm_ops cqspi__dev_pm_ops = { ...@@ -1457,6 +1459,7 @@ static const struct dev_pm_ops cqspi__dev_pm_ops = {
static const struct cqspi_driver_platdata cdns_qspi = { static const struct cqspi_driver_platdata cdns_qspi = {
.hwcaps_mask = CQSPI_BASE_HWCAPS_MASK, .hwcaps_mask = CQSPI_BASE_HWCAPS_MASK,
.quirks = CQSPI_DISABLE_DAC_MODE,
}; };
static const struct cqspi_driver_platdata k2g_qspi = { static const struct cqspi_driver_platdata k2g_qspi = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment