Commit 98b5ce4c authored by Al Cooper's avatar Al Cooper Committed by Ulf Hansson

mmc: sdhci-iproc: Add support for the legacy sdhci controller on the BCM7211

Add support for the legacy Arasan sdhci controller on the BCM7211 and
related SoC's. This includes adding a .shutdown callback to increase
the power savings during S5.
Signed-off-by: default avatarAl Cooper <alcooperx@gmail.com>
Link: https://lore.kernel.org/r/20210602192758.38735-2-alcooperx@gmail.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 09a8ec9a
...@@ -412,7 +412,7 @@ config MMC_SDHCI_MILBEAUT ...@@ -412,7 +412,7 @@ config MMC_SDHCI_MILBEAUT
config MMC_SDHCI_IPROC config MMC_SDHCI_IPROC
tristate "SDHCI support for the BCM2835 & iProc SD/MMC Controller" tristate "SDHCI support for the BCM2835 & iProc SD/MMC Controller"
depends on ARCH_BCM2835 || ARCH_BCM_IPROC || COMPILE_TEST depends on ARCH_BCM2835 || ARCH_BCM_IPROC || ARCH_BRCMSTB || COMPILE_TEST
depends on MMC_SDHCI_PLTFM depends on MMC_SDHCI_PLTFM
depends on OF || ACPI depends on OF || ACPI
default ARCH_BCM_IPROC default ARCH_BCM_IPROC
......
...@@ -286,11 +286,35 @@ static const struct sdhci_iproc_data bcm2711_data = { ...@@ -286,11 +286,35 @@ static const struct sdhci_iproc_data bcm2711_data = {
.mmc_caps = MMC_CAP_3_3V_DDR, .mmc_caps = MMC_CAP_3_3V_DDR,
}; };
static const struct sdhci_pltfm_data sdhci_bcm7211a0_pltfm_data = {
.quirks = SDHCI_QUIRK_MISSING_CAPS |
SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
SDHCI_QUIRK_BROKEN_DMA |
SDHCI_QUIRK_BROKEN_ADMA,
.ops = &sdhci_iproc_ops,
};
#define BCM7211A0_BASE_CLK_MHZ 100
static const struct sdhci_iproc_data bcm7211a0_data = {
.pdata = &sdhci_bcm7211a0_pltfm_data,
.caps = ((BCM7211A0_BASE_CLK_MHZ / 2) << SDHCI_TIMEOUT_CLK_SHIFT) |
(BCM7211A0_BASE_CLK_MHZ << SDHCI_CLOCK_BASE_SHIFT) |
((0x2 << SDHCI_MAX_BLOCK_SHIFT)
& SDHCI_MAX_BLOCK_MASK) |
SDHCI_CAN_VDD_330 |
SDHCI_CAN_VDD_180 |
SDHCI_CAN_DO_SUSPEND |
SDHCI_CAN_DO_HISPD,
.caps1 = SDHCI_DRIVER_TYPE_C |
SDHCI_DRIVER_TYPE_D,
};
static const struct of_device_id sdhci_iproc_of_match[] = { static const struct of_device_id sdhci_iproc_of_match[] = {
{ .compatible = "brcm,bcm2835-sdhci", .data = &bcm2835_data }, { .compatible = "brcm,bcm2835-sdhci", .data = &bcm2835_data },
{ .compatible = "brcm,bcm2711-emmc2", .data = &bcm2711_data }, { .compatible = "brcm,bcm2711-emmc2", .data = &bcm2711_data },
{ .compatible = "brcm,sdhci-iproc-cygnus", .data = &iproc_cygnus_data}, { .compatible = "brcm,sdhci-iproc-cygnus", .data = &iproc_cygnus_data},
{ .compatible = "brcm,sdhci-iproc", .data = &iproc_data }, { .compatible = "brcm,sdhci-iproc", .data = &iproc_data },
{ .compatible = "brcm,bcm7211a0-sdhci", .data = &bcm7211a0_data },
{ } { }
}; };
MODULE_DEVICE_TABLE(of, sdhci_iproc_of_match); MODULE_DEVICE_TABLE(of, sdhci_iproc_of_match);
...@@ -384,6 +408,11 @@ static int sdhci_iproc_probe(struct platform_device *pdev) ...@@ -384,6 +408,11 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
return ret; return ret;
} }
static void sdhci_iproc_shutdown(struct platform_device *pdev)
{
sdhci_pltfm_suspend(&pdev->dev);
}
static struct platform_driver sdhci_iproc_driver = { static struct platform_driver sdhci_iproc_driver = {
.driver = { .driver = {
.name = "sdhci-iproc", .name = "sdhci-iproc",
...@@ -394,6 +423,7 @@ static struct platform_driver sdhci_iproc_driver = { ...@@ -394,6 +423,7 @@ static struct platform_driver sdhci_iproc_driver = {
}, },
.probe = sdhci_iproc_probe, .probe = sdhci_iproc_probe,
.remove = sdhci_pltfm_unregister, .remove = sdhci_pltfm_unregister,
.shutdown = sdhci_iproc_shutdown,
}; };
module_platform_driver(sdhci_iproc_driver); module_platform_driver(sdhci_iproc_driver);
......
...@@ -201,8 +201,10 @@ ...@@ -201,8 +201,10 @@
#define SDHCI_CAPABILITIES 0x40 #define SDHCI_CAPABILITIES 0x40
#define SDHCI_TIMEOUT_CLK_MASK GENMASK(5, 0) #define SDHCI_TIMEOUT_CLK_MASK GENMASK(5, 0)
#define SDHCI_TIMEOUT_CLK_SHIFT 0
#define SDHCI_TIMEOUT_CLK_UNIT 0x00000080 #define SDHCI_TIMEOUT_CLK_UNIT 0x00000080
#define SDHCI_CLOCK_BASE_MASK GENMASK(13, 8) #define SDHCI_CLOCK_BASE_MASK GENMASK(13, 8)
#define SDHCI_CLOCK_BASE_SHIFT 8
#define SDHCI_CLOCK_V3_BASE_MASK GENMASK(15, 8) #define SDHCI_CLOCK_V3_BASE_MASK GENMASK(15, 8)
#define SDHCI_MAX_BLOCK_MASK 0x00030000 #define SDHCI_MAX_BLOCK_MASK 0x00030000
#define SDHCI_MAX_BLOCK_SHIFT 16 #define SDHCI_MAX_BLOCK_SHIFT 16
......
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