mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
Memory controller drivers for v5.15
Few minor fixes: maintainer pattern, unused-function warning in Tegra186 and suspend/resume in OMAP GPMC. -----BEGIN PGP SIGNATURE----- iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmERSK8QHGtyemtAa2Vy bmVsLm9yZwAKCRDBN2bmhouD14iXD/0ZezLNssI+oRQL0kQPxS8npV6Q5Ka1kYmX YvuHolFO730K8jVhiLmfSoS5VBGVgAdpUonHFLlsmuL+CG6sOkdbxK+bAsS3IhVm /X28JRIECJNUs4z+b0fdMDjIHMjLVBmdfvqOrR/pEW52SEPU8CkrwG+tGzepg+If 8AMp6DuhEuJhEOqYG33URM/u9w+sI4KwUxPMs13PnbTmHKkzcAVAwYLifxPfdDCd YFaZWs8rR2cVSZGwAWeUwzbOMhjj+oXmpIbpoGvYQd5Yy0tZDp/cruDhtY5ahYxT 2bIK07BKOQa/D35i7ndU97V9R3Kcra7/Pjcl5l29kxu9lSQeYDapTQrcuS022Z52 f3os3VGdoac3FmEm057wTa0T3NVy4FSvXcaf/STiE9SMnbHqXUztY/CT6d7xIlbj i6d0QakQEjzWZ7LHheqgoEV8qd0NxdgUn1jcdM4A+iEwl5C3gkGB2rJUxaReZ/cF yNNM5pw5ozBjfHEsjJJPCAcNjTKbOLf51o06Qr1WLJjlDGkH0YoPVMn/hHDpicVs dwyPIPvmP3UxzgTjkGWFeNnriq1YqFqdn2oXux6ggPXFvMNtvhxuwrOnF+LfZDmj MSH3S69LuCq3phJLmLJIAQHf2qsod1ObyDvagyAyBK19lcshFEeDt8sadLvFEAMo L9mpZuVWPQ== =/XIr -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmEVhmgACgkQmmx57+YA GNlE4hAAgLNVHCkk4C3jivy+/m2acNfV1WJ1oXUSNhMQa1lhfDt7iaE2g0KF3tCG YkBDVFKLWbapA51WZzQVQtrLI4nBqvDe0bchtE5ZFFoZvFPa9H2YaX8umqG9C8oK V81NZfQTAPJhFXgOBQ84Lki7fjD7I6VPhBm9/6UbbiNmzQ8LJQioRGtaEXvj0Jw2 eDrBaGRHoY6U5yPtaT/7N2dq6CKvxEMz+ArppSlYnjtPGn2WMXSB1DPQibZHIDZ7 YpJDhlagFJ7vxx1SV3Ae5H1jL7qZvz+RS+Z+h8fVOI1EFPcI0oOn6VoU8o3/uzBO /NBbrMKVSOoQfGxkqTmZQglluGM4siGL9DHKqzB3J7pXaEhIkgZMjDDyzXCehJZa 7D/m2akP3EPwLU0o5X+QnSW0tZCaRdkZ+cfqI/OlDLUt5RDDqjVKukfBetFEj+1n uGL3Gbt/iwFUfLI0SYrWtHIJ7AH3O9Rkg9DMBCmnQnFNh2xnxyWXYuh7QdHWqXC9 TDnHqnBpwoZhYDYLAYhmy2eeq3mS6h+3wxSPLsjrHHFE2PvnIhVTnYmlHrpefIRr 4wEEok/qk/4vYp7O0OCZmUnCBb2pl+yI7WD6uh3EgrKYgaENvTSaMBwe0EOFdBSE qjgLgp8zdFr/ZQqTd+rmcSJh9hNNaouUvAq5wQZAdYpjVnYY3Fw= =FK0Y -----END PGP SIGNATURE----- Merge tag 'memory-controller-drv-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v5.15 Few minor fixes: maintainer pattern, unused-function warning in Tegra186 and suspend/resume in OMAP GPMC. * tag 'memory-controller-drv-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: omap-gpmc: Drop custom PM calls with cpu_pm notifier memory: omap-gpmc: Clear GPMC_CS_CONFIG7 register on restore if unused MAINTAINERS: update arm,pl353-smc.yaml reference memory: tegra: fix unused-function warning Link: https://lore.kernel.org/r/20210809152639.110576-1-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
0dc76ecbbf
@ -1488,7 +1488,7 @@ M: Miquel Raynal <miquel.raynal@bootlin.com@bootlin.com>
|
||||
M: Naga Sureshkumar Relli <nagasure@xilinx.com>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/mtd/arm,pl353-smc.yaml
|
||||
F: Documentation/devicetree/bindings/memory-controllers/arm,pl353-smc.yaml
|
||||
F: drivers/memory/pl353-smc.c
|
||||
|
||||
ARM PRIMECELL CLCD PL110 DRIVER
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/omap-gpmc.h>
|
||||
|
||||
#include <trace/events/power.h>
|
||||
|
||||
@ -81,8 +80,6 @@ static void omap3_core_save_context(void)
|
||||
|
||||
/* Save the Interrupt controller context */
|
||||
omap_intc_save_context();
|
||||
/* Save the GPMC context */
|
||||
omap3_gpmc_save_context();
|
||||
/* Save the system control module context, padconf already save above*/
|
||||
omap3_control_save_context();
|
||||
}
|
||||
@ -91,8 +88,6 @@ static void omap3_core_restore_context(void)
|
||||
{
|
||||
/* Restore the control module context, padconf restored by h/w */
|
||||
omap3_control_restore_context();
|
||||
/* Restore the GPMC context */
|
||||
omap3_gpmc_restore_context();
|
||||
/* Restore the interrupt controller context */
|
||||
omap_intc_restore_context();
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
* Copyright (C) 2009 Texas Instruments
|
||||
* Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
|
||||
*/
|
||||
#include <linux/cpu_pm.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
@ -232,7 +233,10 @@ struct gpmc_device {
|
||||
int irq;
|
||||
struct irq_chip irq_chip;
|
||||
struct gpio_chip gpio_chip;
|
||||
struct notifier_block nb;
|
||||
struct omap3_gpmc_regs context;
|
||||
int nirqs;
|
||||
unsigned int is_suspended:1;
|
||||
};
|
||||
|
||||
static struct irq_domain *gpmc_irq_domain;
|
||||
@ -2384,6 +2388,106 @@ static int gpmc_gpio_init(struct gpmc_device *gpmc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void omap3_gpmc_save_context(struct gpmc_device *gpmc)
|
||||
{
|
||||
struct omap3_gpmc_regs *gpmc_context;
|
||||
int i;
|
||||
|
||||
if (!gpmc || !gpmc_base)
|
||||
return;
|
||||
|
||||
gpmc_context = &gpmc->context;
|
||||
|
||||
gpmc_context->sysconfig = gpmc_read_reg(GPMC_SYSCONFIG);
|
||||
gpmc_context->irqenable = gpmc_read_reg(GPMC_IRQENABLE);
|
||||
gpmc_context->timeout_ctrl = gpmc_read_reg(GPMC_TIMEOUT_CONTROL);
|
||||
gpmc_context->config = gpmc_read_reg(GPMC_CONFIG);
|
||||
gpmc_context->prefetch_config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1);
|
||||
gpmc_context->prefetch_config2 = gpmc_read_reg(GPMC_PREFETCH_CONFIG2);
|
||||
gpmc_context->prefetch_control = gpmc_read_reg(GPMC_PREFETCH_CONTROL);
|
||||
for (i = 0; i < gpmc_cs_num; i++) {
|
||||
gpmc_context->cs_context[i].is_valid = gpmc_cs_mem_enabled(i);
|
||||
if (gpmc_context->cs_context[i].is_valid) {
|
||||
gpmc_context->cs_context[i].config1 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG1);
|
||||
gpmc_context->cs_context[i].config2 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG2);
|
||||
gpmc_context->cs_context[i].config3 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG3);
|
||||
gpmc_context->cs_context[i].config4 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG4);
|
||||
gpmc_context->cs_context[i].config5 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG5);
|
||||
gpmc_context->cs_context[i].config6 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG6);
|
||||
gpmc_context->cs_context[i].config7 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void omap3_gpmc_restore_context(struct gpmc_device *gpmc)
|
||||
{
|
||||
struct omap3_gpmc_regs *gpmc_context;
|
||||
int i;
|
||||
|
||||
if (!gpmc || !gpmc_base)
|
||||
return;
|
||||
|
||||
gpmc_context = &gpmc->context;
|
||||
|
||||
gpmc_write_reg(GPMC_SYSCONFIG, gpmc_context->sysconfig);
|
||||
gpmc_write_reg(GPMC_IRQENABLE, gpmc_context->irqenable);
|
||||
gpmc_write_reg(GPMC_TIMEOUT_CONTROL, gpmc_context->timeout_ctrl);
|
||||
gpmc_write_reg(GPMC_CONFIG, gpmc_context->config);
|
||||
gpmc_write_reg(GPMC_PREFETCH_CONFIG1, gpmc_context->prefetch_config1);
|
||||
gpmc_write_reg(GPMC_PREFETCH_CONFIG2, gpmc_context->prefetch_config2);
|
||||
gpmc_write_reg(GPMC_PREFETCH_CONTROL, gpmc_context->prefetch_control);
|
||||
for (i = 0; i < gpmc_cs_num; i++) {
|
||||
if (gpmc_context->cs_context[i].is_valid) {
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG1,
|
||||
gpmc_context->cs_context[i].config1);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG2,
|
||||
gpmc_context->cs_context[i].config2);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG3,
|
||||
gpmc_context->cs_context[i].config3);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG4,
|
||||
gpmc_context->cs_context[i].config4);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG5,
|
||||
gpmc_context->cs_context[i].config5);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG6,
|
||||
gpmc_context->cs_context[i].config6);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG7,
|
||||
gpmc_context->cs_context[i].config7);
|
||||
} else {
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG7, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int omap_gpmc_context_notifier(struct notifier_block *nb,
|
||||
unsigned long cmd, void *v)
|
||||
{
|
||||
struct gpmc_device *gpmc;
|
||||
|
||||
gpmc = container_of(nb, struct gpmc_device, nb);
|
||||
if (gpmc->is_suspended || pm_runtime_suspended(gpmc->dev))
|
||||
return NOTIFY_OK;
|
||||
|
||||
switch (cmd) {
|
||||
case CPU_CLUSTER_PM_ENTER:
|
||||
omap3_gpmc_save_context(gpmc);
|
||||
break;
|
||||
case CPU_CLUSTER_PM_ENTER_FAILED: /* No need to restore context */
|
||||
break;
|
||||
case CPU_CLUSTER_PM_EXIT:
|
||||
omap3_gpmc_restore_context(gpmc);
|
||||
break;
|
||||
}
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static int gpmc_probe(struct platform_device *pdev)
|
||||
{
|
||||
int rc;
|
||||
@ -2472,6 +2576,9 @@ static int gpmc_probe(struct platform_device *pdev)
|
||||
|
||||
gpmc_probe_dt_children(pdev);
|
||||
|
||||
gpmc->nb.notifier_call = omap_gpmc_context_notifier;
|
||||
cpu_pm_register_notifier(&gpmc->nb);
|
||||
|
||||
return 0;
|
||||
|
||||
gpio_init_failed:
|
||||
@ -2486,6 +2593,7 @@ static int gpmc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct gpmc_device *gpmc = platform_get_drvdata(pdev);
|
||||
|
||||
cpu_pm_unregister_notifier(&gpmc->nb);
|
||||
gpmc_free_irq(gpmc);
|
||||
gpmc_mem_exit();
|
||||
pm_runtime_put_sync(&pdev->dev);
|
||||
@ -2497,15 +2605,23 @@ static int gpmc_remove(struct platform_device *pdev)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int gpmc_suspend(struct device *dev)
|
||||
{
|
||||
omap3_gpmc_save_context();
|
||||
struct gpmc_device *gpmc = dev_get_drvdata(dev);
|
||||
|
||||
omap3_gpmc_save_context(gpmc);
|
||||
pm_runtime_put_sync(dev);
|
||||
gpmc->is_suspended = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gpmc_resume(struct device *dev)
|
||||
{
|
||||
struct gpmc_device *gpmc = dev_get_drvdata(dev);
|
||||
|
||||
pm_runtime_get_sync(dev);
|
||||
omap3_gpmc_restore_context();
|
||||
omap3_gpmc_restore_context(gpmc);
|
||||
gpmc->is_suspended = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -2527,74 +2643,3 @@ static __init int gpmc_init(void)
|
||||
return platform_driver_register(&gpmc_driver);
|
||||
}
|
||||
postcore_initcall(gpmc_init);
|
||||
|
||||
static struct omap3_gpmc_regs gpmc_context;
|
||||
|
||||
void omap3_gpmc_save_context(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!gpmc_base)
|
||||
return;
|
||||
|
||||
gpmc_context.sysconfig = gpmc_read_reg(GPMC_SYSCONFIG);
|
||||
gpmc_context.irqenable = gpmc_read_reg(GPMC_IRQENABLE);
|
||||
gpmc_context.timeout_ctrl = gpmc_read_reg(GPMC_TIMEOUT_CONTROL);
|
||||
gpmc_context.config = gpmc_read_reg(GPMC_CONFIG);
|
||||
gpmc_context.prefetch_config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1);
|
||||
gpmc_context.prefetch_config2 = gpmc_read_reg(GPMC_PREFETCH_CONFIG2);
|
||||
gpmc_context.prefetch_control = gpmc_read_reg(GPMC_PREFETCH_CONTROL);
|
||||
for (i = 0; i < gpmc_cs_num; i++) {
|
||||
gpmc_context.cs_context[i].is_valid = gpmc_cs_mem_enabled(i);
|
||||
if (gpmc_context.cs_context[i].is_valid) {
|
||||
gpmc_context.cs_context[i].config1 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG1);
|
||||
gpmc_context.cs_context[i].config2 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG2);
|
||||
gpmc_context.cs_context[i].config3 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG3);
|
||||
gpmc_context.cs_context[i].config4 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG4);
|
||||
gpmc_context.cs_context[i].config5 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG5);
|
||||
gpmc_context.cs_context[i].config6 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG6);
|
||||
gpmc_context.cs_context[i].config7 =
|
||||
gpmc_cs_read_reg(i, GPMC_CS_CONFIG7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void omap3_gpmc_restore_context(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!gpmc_base)
|
||||
return;
|
||||
|
||||
gpmc_write_reg(GPMC_SYSCONFIG, gpmc_context.sysconfig);
|
||||
gpmc_write_reg(GPMC_IRQENABLE, gpmc_context.irqenable);
|
||||
gpmc_write_reg(GPMC_TIMEOUT_CONTROL, gpmc_context.timeout_ctrl);
|
||||
gpmc_write_reg(GPMC_CONFIG, gpmc_context.config);
|
||||
gpmc_write_reg(GPMC_PREFETCH_CONFIG1, gpmc_context.prefetch_config1);
|
||||
gpmc_write_reg(GPMC_PREFETCH_CONFIG2, gpmc_context.prefetch_config2);
|
||||
gpmc_write_reg(GPMC_PREFETCH_CONTROL, gpmc_context.prefetch_control);
|
||||
for (i = 0; i < gpmc_cs_num; i++) {
|
||||
if (gpmc_context.cs_context[i].is_valid) {
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG1,
|
||||
gpmc_context.cs_context[i].config1);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG2,
|
||||
gpmc_context.cs_context[i].config2);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG3,
|
||||
gpmc_context.cs_context[i].config3);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG4,
|
||||
gpmc_context.cs_context[i].config4);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG5,
|
||||
gpmc_context.cs_context[i].config5);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG6,
|
||||
gpmc_context.cs_context[i].config6);
|
||||
gpmc_cs_write_reg(i, GPMC_CS_CONFIG7,
|
||||
gpmc_context.cs_context[i].config7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,7 @@ static int tegra186_mc_resume(struct tegra_mc *mc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_IOMMU_API)
|
||||
static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
|
||||
const struct tegra_mc_client *client,
|
||||
unsigned int sid)
|
||||
@ -108,6 +109,7 @@ static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
|
||||
writel(sid, mc->regs + client->regs.sid.override);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
|
||||
{
|
||||
|
@ -81,9 +81,6 @@ extern int gpmc_configure(int cmd, int wval);
|
||||
extern void gpmc_read_settings_dt(struct device_node *np,
|
||||
struct gpmc_settings *p);
|
||||
|
||||
extern void omap3_gpmc_save_context(void);
|
||||
extern void omap3_gpmc_restore_context(void);
|
||||
|
||||
struct gpmc_timings;
|
||||
struct omap_nand_platform_data;
|
||||
struct omap_onenand_platform_data;
|
||||
|
Loading…
Reference in New Issue
Block a user