diff options
author | Seungwon Jeon <tgih.jun@samsung.com> | 2014-12-22 07:12:04 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-01-19 03:56:11 -0500 |
commit | 0b5fce48a67d7fb5792e15ac635a1000f9dd6201 (patch) | |
tree | 14f3f7ba1827ac94c2baca5b3612ed0a8085acee | |
parent | a2a1fed8ea69ffae682eb606f1a722e7d034df8e (diff) |
mmc: dw_mmc: exynos: move definitions to header file
Move exynos related definition to header file. And this
also changes some of the registers name to match the standard
naming convention.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
[Alim: updated the commit message]
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/dw_mmc-exynos.c | 48 | ||||
-rw-r--r-- | drivers/mmc/host/dw_mmc-exynos.h | 56 |
2 files changed, 62 insertions, 42 deletions
diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index 556663fe9b47..f936704a1182 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c | |||
@@ -21,43 +21,7 @@ | |||
21 | 21 | ||
22 | #include "dw_mmc.h" | 22 | #include "dw_mmc.h" |
23 | #include "dw_mmc-pltfm.h" | 23 | #include "dw_mmc-pltfm.h" |
24 | 24 | #include "dw_mmc-exynos.h" | |
25 | #define NUM_PINS(x) (x + 2) | ||
26 | |||
27 | #define SDMMC_CLKSEL 0x09C | ||
28 | #define SDMMC_CLKSEL64 0x0A8 | ||
29 | #define SDMMC_CLKSEL_CCLK_SAMPLE(x) (((x) & 7) << 0) | ||
30 | #define SDMMC_CLKSEL_CCLK_DRIVE(x) (((x) & 7) << 16) | ||
31 | #define SDMMC_CLKSEL_CCLK_DIVIDER(x) (((x) & 7) << 24) | ||
32 | #define SDMMC_CLKSEL_GET_DRV_WD3(x) (((x) >> 16) & 0x7) | ||
33 | #define SDMMC_CLKSEL_TIMING(x, y, z) (SDMMC_CLKSEL_CCLK_SAMPLE(x) | \ | ||
34 | SDMMC_CLKSEL_CCLK_DRIVE(y) | \ | ||
35 | SDMMC_CLKSEL_CCLK_DIVIDER(z)) | ||
36 | #define SDMMC_CLKSEL_WAKEUP_INT BIT(11) | ||
37 | |||
38 | #define EXYNOS4210_FIXED_CIU_CLK_DIV 2 | ||
39 | #define EXYNOS4412_FIXED_CIU_CLK_DIV 4 | ||
40 | |||
41 | /* Block number in eMMC */ | ||
42 | #define DWMCI_BLOCK_NUM 0xFFFFFFFF | ||
43 | |||
44 | #define SDMMC_EMMCP_BASE 0x1000 | ||
45 | #define SDMMC_MPSECURITY (SDMMC_EMMCP_BASE + 0x0010) | ||
46 | #define SDMMC_MPSBEGIN0 (SDMMC_EMMCP_BASE + 0x0200) | ||
47 | #define SDMMC_MPSEND0 (SDMMC_EMMCP_BASE + 0x0204) | ||
48 | #define SDMMC_MPSCTRL0 (SDMMC_EMMCP_BASE + 0x020C) | ||
49 | |||
50 | /* SMU control bits */ | ||
51 | #define DWMCI_MPSCTRL_SECURE_READ_BIT BIT(7) | ||
52 | #define DWMCI_MPSCTRL_SECURE_WRITE_BIT BIT(6) | ||
53 | #define DWMCI_MPSCTRL_NON_SECURE_READ_BIT BIT(5) | ||
54 | #define DWMCI_MPSCTRL_NON_SECURE_WRITE_BIT BIT(4) | ||
55 | #define DWMCI_MPSCTRL_USE_FUSE_KEY BIT(3) | ||
56 | #define DWMCI_MPSCTRL_ECB_MODE BIT(2) | ||
57 | #define DWMCI_MPSCTRL_ENCRYPTION BIT(1) | ||
58 | #define DWMCI_MPSCTRL_VALID BIT(0) | ||
59 | |||
60 | #define EXYNOS_CCLKIN_MIN 50000000 /* unit: HZ */ | ||
61 | 25 | ||
62 | /* Variations in Exynos specific dw-mshc controller */ | 26 | /* Variations in Exynos specific dw-mshc controller */ |
63 | enum dw_mci_exynos_type { | 27 | enum dw_mci_exynos_type { |
@@ -114,11 +78,11 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host) | |||
114 | if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS5420_SMU || | 78 | if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS5420_SMU || |
115 | priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU) { | 79 | priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU) { |
116 | mci_writel(host, MPSBEGIN0, 0); | 80 | mci_writel(host, MPSBEGIN0, 0); |
117 | mci_writel(host, MPSEND0, DWMCI_BLOCK_NUM); | 81 | mci_writel(host, MPSEND0, SDMMC_ENDING_SEC_NR_MAX); |
118 | mci_writel(host, MPSCTRL0, DWMCI_MPSCTRL_SECURE_WRITE_BIT | | 82 | mci_writel(host, MPSCTRL0, SDMMC_MPSCTRL_SECURE_WRITE_BIT | |
119 | DWMCI_MPSCTRL_NON_SECURE_READ_BIT | | 83 | SDMMC_MPSCTRL_NON_SECURE_READ_BIT | |
120 | DWMCI_MPSCTRL_VALID | | 84 | SDMMC_MPSCTRL_VALID | |
121 | DWMCI_MPSCTRL_NON_SECURE_WRITE_BIT); | 85 | SDMMC_MPSCTRL_NON_SECURE_WRITE_BIT); |
122 | } | 86 | } |
123 | 87 | ||
124 | return 0; | 88 | return 0; |
diff --git a/drivers/mmc/host/dw_mmc-exynos.h b/drivers/mmc/host/dw_mmc-exynos.h new file mode 100644 index 000000000000..7872ce586b55 --- /dev/null +++ b/drivers/mmc/host/dw_mmc-exynos.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Exynos Specific Extensions for Synopsys DW Multimedia Card Interface driver | ||
3 | * | ||
4 | * Copyright (C) 2012-2014 Samsung Electronics Co., Ltd. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _DW_MMC_EXYNOS_H_ | ||
13 | #define _DW_MMC_EXYNOS_H_ | ||
14 | |||
15 | /* Extended Register's Offset */ | ||
16 | #define SDMMC_CLKSEL 0x09C | ||
17 | #define SDMMC_CLKSEL64 0x0A8 | ||
18 | |||
19 | /* CLKSEL register defines */ | ||
20 | #define SDMMC_CLKSEL_CCLK_SAMPLE(x) (((x) & 7) << 0) | ||
21 | #define SDMMC_CLKSEL_CCLK_DRIVE(x) (((x) & 7) << 16) | ||
22 | #define SDMMC_CLKSEL_CCLK_DIVIDER(x) (((x) & 7) << 24) | ||
23 | #define SDMMC_CLKSEL_GET_DRV_WD3(x) (((x) >> 16) & 0x7) | ||
24 | #define SDMMC_CLKSEL_TIMING(x, y, z) (SDMMC_CLKSEL_CCLK_SAMPLE(x) | \ | ||
25 | SDMMC_CLKSEL_CCLK_DRIVE(y) | \ | ||
26 | SDMMC_CLKSEL_CCLK_DIVIDER(z)) | ||
27 | #define SDMMC_CLKSEL_WAKEUP_INT BIT(11) | ||
28 | |||
29 | /* Protector Register */ | ||
30 | #define SDMMC_EMMCP_BASE 0x1000 | ||
31 | #define SDMMC_MPSECURITY (SDMMC_EMMCP_BASE + 0x0010) | ||
32 | #define SDMMC_MPSBEGIN0 (SDMMC_EMMCP_BASE + 0x0200) | ||
33 | #define SDMMC_MPSEND0 (SDMMC_EMMCP_BASE + 0x0204) | ||
34 | #define SDMMC_MPSCTRL0 (SDMMC_EMMCP_BASE + 0x020C) | ||
35 | |||
36 | /* SMU control defines */ | ||
37 | #define SDMMC_MPSCTRL_SECURE_READ_BIT BIT(7) | ||
38 | #define SDMMC_MPSCTRL_SECURE_WRITE_BIT BIT(6) | ||
39 | #define SDMMC_MPSCTRL_NON_SECURE_READ_BIT BIT(5) | ||
40 | #define SDMMC_MPSCTRL_NON_SECURE_WRITE_BIT BIT(4) | ||
41 | #define SDMMC_MPSCTRL_USE_FUSE_KEY BIT(3) | ||
42 | #define SDMMC_MPSCTRL_ECB_MODE BIT(2) | ||
43 | #define SDMMC_MPSCTRL_ENCRYPTION BIT(1) | ||
44 | #define SDMMC_MPSCTRL_VALID BIT(0) | ||
45 | |||
46 | /* Maximum number of Ending sector */ | ||
47 | #define SDMMC_ENDING_SEC_NR_MAX 0xFFFFFFFF | ||
48 | |||
49 | /* Fixed clock divider */ | ||
50 | #define EXYNOS4210_FIXED_CIU_CLK_DIV 2 | ||
51 | #define EXYNOS4412_FIXED_CIU_CLK_DIV 4 | ||
52 | |||
53 | /* Minimal required clock frequency for cclkin, unit: HZ */ | ||
54 | #define EXYNOS_CCLKIN_MIN 50000000 | ||
55 | |||
56 | #endif /* _DW_MMC_EXYNOS_H_ */ | ||