2 * (C) Copyright 2012 SAMSUNG Electronics
3 * Jaehoon Chung <jh80.chung@samsung.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <asm/arch/dwmmc.h>
25 #include <asm/arch/clk.h>
27 static char *EXYNOS_NAME = "EXYNOS DWMMC";
29 static void exynos_dwmci_clksel(struct dwmci_host *host)
32 val = DWMCI_SET_SAMPLE_CLK(DWMCI_SHIFT_0) |
33 DWMCI_SET_DRV_CLK(DWMCI_SHIFT_0) | DWMCI_SET_DIV_RATIO(0);
35 dwmci_writel(host, DWMCI_CLKSEL, val);
38 int exynos_dwmci_init(u32 regbase, int bus_width, int index)
40 struct dwmci_host *host = NULL;
41 host = malloc(sizeof(struct dwmci_host));
43 printf("dwmci_host malloc fail!\n");
47 host->name = EXYNOS_NAME;
48 host->ioaddr = (void *)regbase;
49 host->buswidth = bus_width;
50 host->clksel = exynos_dwmci_clksel;
51 host->dev_index = index;
53 add_dwmci(host, 52000000, 400000);