--- zzzz-none-000/linux-5.15.111/drivers/mmc/host/sdhci-pltfm.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-arm-6670-761/linux-5.15.111/drivers/mmc/host/sdhci-pltfm.c 2024-02-07 09:27:48.000000000 +0000 @@ -16,6 +16,13 @@ * Inspired by sdhci-pci.c, by Pierre Ossman */ +/* + * Includes Maxlinear's changes dated: 2022. + * Changed portions - Copyright 2020-2022 MaxLinear, Inc. + * Includes Intel Corporation's changes dated: 2014. + * Changed portions - Copyright 2012-2020, Intel Corporation. + */ + #include #include #include @@ -121,7 +128,19 @@ void __iomem *ioaddr; int irq, ret; +#ifndef CONFIG_ARCH_GEN3 +/* + in Puma we do not use ioremap, ioumap, request_mem_region and release_mem_region - virtual addresses are + predefined. +*/ ioaddr = devm_platform_ioremap_resource(pdev, 0); +#else + struct resource *iomem; + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + + /* Get virtual address */ + ioaddr = (unsigned int __iomem *)(iomem->start); +#endif if (IS_ERR(ioaddr)) { ret = PTR_ERR(ioaddr); goto err; @@ -183,7 +202,17 @@ sdhci_get_property(pdev); +#ifdef CONFIG_ARCH_GEN3 + MMC_LOCK_HW_MUTEX_INIT(host->mmc); + pr_info("sdhci-pltfm: For dual boot with APP-CPU, disable all writes to host controller during initialization \n"); + host->flags |= SDHCI_DISABLE_REGISTER_WRITE; /* For non-destructive initialization, disable all writes to host controller */ +#endif ret = sdhci_add_host(host); +#ifdef CONFIG_ARCH_GEN3 + host->flags &= ~SDHCI_DISABLE_REGISTER_WRITE; /* enable writes to host controller */ + MMC_UNLOCK_HW_MUTEX(host->mmc); +#endif + if (ret) sdhci_pltfm_free(pdev);