arc: emsdp/iotdk: Switch to DM_MMC
authorAlexey Brodkin <abrodkin@synopsys.com>
Tue, 8 Oct 2019 10:24:29 +0000 (13:24 +0300)
committerAlexey Brodkin <abrodkin@synopsys.com>
Fri, 1 Nov 2019 13:45:40 +0000 (16:45 +0300)
Somehow EMSDP & IoT DK boards were skipped on ARC boads conversion
to DM MMC. So doing it now.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
arch/arc/dts/emsdp.dts
arch/arc/dts/iot_devkit.dts
board/synopsys/emsdp/emsdp.c
board/synopsys/iot_devkit/iot_devkit.c
configs/emsdp_defconfig
configs/iot_devkit_defconfig

index d307b95d8effea5cd878fb8aab1d5bd8b553f08a..dbebdb4e76989237afc92b0ca8fa5eafff60a31f 100644 (file)
                reg-shift = <2>;
                reg-io-width = <4>;
        };
+
+       mmcclk_biu: mmcclk-biu {
+               compatible = "fixed-clock";
+               clock-frequency = <50000000>;
+               #clock-cells = <0>;
+       };
+
+       mmcclk_ciu: mmcclk-ciu {
+               compatible = "fixed-clock";
+               clock-frequency = <100000000>;
+               #clock-cells = <0>;
+       };
+
+       mmc: mmc0@f0010000 {
+               compatible = "snps,dw-mshc";
+               reg = <0xf0010000 0x400>;
+               bus-width = <4>;
+               fifo-depth = <256>;
+               clocks = <&mmcclk_biu>, <&mmcclk_ciu>;
+               clock-names = "biu", "ciu";
+               max-frequency = <25000000>;
+       };
+
 };
index ebf5a950f0f228f58e9c9c991f98b51c69cead82..c0173fa5ab4d4fc80c54754ebd1b052701695d45 100644 (file)
                compatible = "nop-phy";
                #phy-cells = <0>;
        };
+
+       mmcclk_biu: mmcclk-biu {
+               compatible = "fixed-clock";
+               clock-frequency = <50000000>;
+               #clock-cells = <0>;
+       };
+
+       mmcclk_ciu: mmcclk-ciu {
+               compatible = "fixed-clock";
+               clock-frequency = <50000000>;
+               #clock-cells = <0>;
+       };
+
+       mmc: mmc0@f000b000 {
+               compatible = "snps,dw-mshc";
+               reg = <0xf000b000 0x400>;
+               bus-width = <4>;
+               fifo-depth = <128>;
+               clocks = <&mmcclk_biu>, <&mmcclk_ciu>;
+               clock-names = "biu", "ciu";
+               max-frequency = <25000000>;
+       };
 };
index 7a3fd5b7f2cee49d8b349c13459d88684ed66c08..5ba9f862e14a3a65c8700725308b0ff58271b2f2 100644 (file)
@@ -85,35 +85,6 @@ int board_early_init_r(void)
        return 0;
 }
 
-int board_mmc_init(bd_t *bis)
-{
-       struct dwmci_host *host = NULL;
-
-       host = malloc(sizeof(struct dwmci_host));
-       if (!host) {
-               printf("dwmci_host malloc fail!\n");
-               return 1;
-       }
-
-       memset(host, 0, sizeof(struct dwmci_host));
-       host->name = "Synopsys Mobile storage";
-       host->ioaddr = SDIO_BASE;
-       host->buswidth = 4;
-       host->dev_index = 0;
-       host->bus_hz = 50000000;
-
-       add_dwmci(host, host->bus_hz / 2, 400000);
-
-       return 0;
-}
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-       struct dwmci_host *host = mmc->priv;
-
-       return !(dwmci_readl(host, DWMCI_CDETECT) & 1);
-}
-
 #define CREG_BASE              0xF0001000
 #define CREG_BOOT              (void *)(CREG_BASE + 0x0FF0)
 #define CREG_IP_SW_RESET       (void *)(CREG_BASE + 0x0FF0)
index 8424e09bd3cf2299d1338ce04917a4f34616693a..9dbdc128f8f3513290f09863c14faf958211b5c6 100644 (file)
@@ -145,38 +145,6 @@ int mach_cpu_init(void)
        return set_cpu_freq(gd->cpu_clk);
 }
 
-#define ARC_PERIPHERAL_BASE    0xF0000000
-#define SDIO_BASE              (ARC_PERIPHERAL_BASE + 0xB000)
-
-int board_mmc_init(bd_t *bis)
-{
-       struct dwmci_host *host = NULL;
-
-       host = malloc(sizeof(struct dwmci_host));
-       if (!host) {
-               printf("dwmci_host malloc fail!\n");
-               return -ENOMEM;
-       }
-
-       memset(host, 0, sizeof(struct dwmci_host));
-       host->name = "Synopsys Mobile storage";
-       host->ioaddr = (void *)SDIO_BASE;
-       host->buswidth = 4;
-       host->dev_index = 0;
-       host->bus_hz = 50000000;
-
-       add_dwmci(host, host->bus_hz / 2, 400000);
-
-       return 0;
-}
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-       struct dwmci_host *host = mmc->priv;
-
-       return !(dwmci_readl(host, DWMCI_CDETECT) & 1);
-}
-
 #define IOTDK_RESET_SEQ                0x55AA6699
 
 void reset_cpu(ulong addr)
index 1eca23fa9588e43be532dfeb868920873d132566..09fe388e5869b249f9d560196aa5dc2265da3477 100644 (file)
@@ -24,7 +24,9 @@ CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 # CONFIG_NET is not set
 CONFIG_DM=y
 CONFIG_MMC=y
+CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
+CONFIG_MMC_DW_SNPS=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=32768
index 24bbe3fc5df305748bbb94b36ce093d1b3f9e868..42278d4fb16b74b61fcf7b996e28048096325db5 100644 (file)
@@ -29,7 +29,9 @@ CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 # CONFIG_NET is not set
 CONFIG_DM=y
 CONFIG_MMC=y
+CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
+CONFIG_MMC_DW_SNPS=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y