--- zzzz-none-000/linux-4.9.279/drivers/mmc/host/sdhci-pltfm.c 2021-08-08 06:38:54.000000000 +0000 +++ puma7-arm-6591-750/linux-4.9.279/drivers/mmc/host/sdhci-pltfm.c 2023-02-08 10:58:13.000000000 +0000 @@ -27,6 +27,10 @@ * * Inspired by sdhci-pci.c, by Pierre Ossman */ +/* + * Includes Intel Corporation's changes/modifications dated: 2014. + * Changed/modified portions - Copyright © 2012-2017 , Intel Corporation. + */ #include #include @@ -123,7 +127,18 @@ int irq, ret; iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + +#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_ioremap_resource(&pdev->dev, iomem); +#else + /* Get virtual address */ + ioaddr = (unsigned int __iomem *)(iomem->start); +#endif + if (IS_ERR(ioaddr)) { ret = PTR_ERR(ioaddr); goto err; @@ -186,7 +201,17 @@ sdhci_get_of_property(pdev); +#ifdef CONFIG_ARCH_GEN3 + MMC_LOCK_HW_MUTEX(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);