memory: atmel-sdramc: remove the driver
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Tue, 16 May 2023 07:24:05 +0000 (10:24 +0300)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fri, 2 Jun 2023 08:39:24 +0000 (10:39 +0200)
Driver does only clock request + enable for DDR clocks. DDR clocks are
enabled by bootloader and need to stay that way in Linux. To avoid having
these clocks disabled by clock subsystem in case there are no Linux
consumers for them the clocks were marked as critical in clock drivers
(in commit 68b3b6f1773d ("clk: at91: mark ddr clocks as critical")).
With this, there is no need to have a separate driver that only does
clock request + enable.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230516072405.2696225-1-claudiu.beznea@microchip.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
arch/arm/mach-at91/Kconfig
drivers/memory/Kconfig
drivers/memory/Makefile
drivers/memory/atmel-sdramc.c [deleted file]

index 3dd9e718661b5fd0307a0fb914f6502712f83153..a8c022b4c0535a20aa818a39d36e0e4f7584ab5c 100644 (file)
@@ -97,7 +97,6 @@ config SOC_AT91SAM9
        depends on ARCH_MULTI_V5
        select ATMEL_AIC_IRQ
        select ATMEL_PM if PM
-       select ATMEL_SDRAMC
        select CPU_ARM926T
        select HAVE_AT91_SMD
        select HAVE_AT91_USB_CLK
@@ -131,7 +130,6 @@ config SOC_SAM9X60
        depends on ARCH_MULTI_V5
        select ATMEL_AIC5_IRQ
        select ATMEL_PM if PM
-       select ATMEL_SDRAMC
        select CPU_ARM926T
        select HAVE_AT91_USB_CLK
        select HAVE_AT91_GENERATED_CLK
@@ -213,7 +211,6 @@ config SOC_SAMA5
        bool
        select ATMEL_AIC5_IRQ
        select ATMEL_PM if PM
-       select ATMEL_SDRAMC
        select MEMORY
        select SOC_SAM_V7
        select SRAM if PM
@@ -234,7 +231,6 @@ config SOC_SAMA7
        bool
        select ARM_GIC
        select ATMEL_PM if PM
-       select ATMEL_SDRAMC
        select MEMORY
        select SOC_SAM_V7
        select SRAM if PM
index 91774e6ee6240e3718c4a657c8ac35471caa56e4..8efdd1f9713950766fa04eac0c215988fbdb1b60 100644 (file)
@@ -30,17 +30,6 @@ config ARM_PL172_MPMC
          If you have an embedded system with an AMBA bus and a PL172
          controller, say Y or M here.
 
-config ATMEL_SDRAMC
-       bool "Atmel (Multi-port DDR-)SDRAM Controller"
-       default y if ARCH_AT91
-       depends on ARCH_AT91 || COMPILE_TEST
-       depends on OF
-       help
-         This driver is for Atmel SDRAM Controller or Atmel Multi-port
-         DDR-SDRAM Controller available on Atmel AT91SAM9 and SAMA5 SoCs.
-         Starting with the at91sam9g45, this controller supports SDR, DDR and
-         LP-DDR memories.
-
 config ATMEL_EBI
        bool "Atmel EBI driver"
        default y if ARCH_AT91
index ae14ded464a840bd94e75bbf2a97841a42130144..d2e6ca9abbe0231c14284e3818ce734c618f83d0 100644 (file)
@@ -8,7 +8,6 @@ ifeq ($(CONFIG_DDR),y)
 obj-$(CONFIG_OF)               += of_memory.o
 endif
 obj-$(CONFIG_ARM_PL172_MPMC)   += pl172.o
-obj-$(CONFIG_ATMEL_SDRAMC)     += atmel-sdramc.o
 obj-$(CONFIG_ATMEL_EBI)                += atmel-ebi.o
 obj-$(CONFIG_BRCMSTB_DPFE)     += brcmstb_dpfe.o
 obj-$(CONFIG_BRCMSTB_MEMC)     += brcmstb_memc.o
diff --git a/drivers/memory/atmel-sdramc.c b/drivers/memory/atmel-sdramc.c
deleted file mode 100644 (file)
index ea6e9e1..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Atmel (Multi-port DDR-)SDRAM Controller driver
- *
- * Author: Alexandre Belloni <alexandre.belloni@free-electrons.com>
- *
- * Copyright (C) 2014 Atmel
- */
-
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/of_platform.h>
-#include <linux/platform_device.h>
-
-struct at91_ramc_caps {
-       bool has_ddrck;
-       bool has_mpddr_clk;
-};
-
-static const struct at91_ramc_caps at91rm9200_caps = { };
-
-static const struct at91_ramc_caps at91sam9g45_caps = {
-       .has_ddrck = 1,
-       .has_mpddr_clk = 0,
-};
-
-static const struct at91_ramc_caps sama5d3_caps = {
-       .has_ddrck = 1,
-       .has_mpddr_clk = 1,
-};
-
-static const struct of_device_id atmel_ramc_of_match[] = {
-       { .compatible = "atmel,at91rm9200-sdramc", .data = &at91rm9200_caps, },
-       { .compatible = "atmel,at91sam9260-sdramc", .data = &at91rm9200_caps, },
-       { .compatible = "atmel,at91sam9g45-ddramc", .data = &at91sam9g45_caps, },
-       { .compatible = "atmel,sama5d3-ddramc", .data = &sama5d3_caps, },
-       {},
-};
-
-static int atmel_ramc_probe(struct platform_device *pdev)
-{
-       const struct at91_ramc_caps *caps;
-       struct clk *clk;
-
-       caps = of_device_get_match_data(&pdev->dev);
-
-       if (caps->has_ddrck) {
-               clk = devm_clk_get_enabled(&pdev->dev, "ddrck");
-               if (IS_ERR(clk))
-                       return PTR_ERR(clk);
-       }
-
-       if (caps->has_mpddr_clk) {
-               clk = devm_clk_get_enabled(&pdev->dev, "mpddr");
-               if (IS_ERR(clk)) {
-                       pr_err("AT91 RAMC: couldn't get mpddr clock\n");
-                       return PTR_ERR(clk);
-               }
-       }
-
-       return 0;
-}
-
-static struct platform_driver atmel_ramc_driver = {
-       .probe          = atmel_ramc_probe,
-       .driver         = {
-               .name   = "atmel-ramc",
-               .of_match_table = atmel_ramc_of_match,
-       },
-};
-
-builtin_platform_driver(atmel_ramc_driver);