~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to arch/arm/mach-ux500/board-mop500-sdi.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#define MCI_DATA31DIREN         (1 << 5)
33
33
#define MCI_FBCLKEN             (1 << 7)
34
34
 
35
 
/* GPIO pins used by the sdi0 level shifter */
36
 
static int sdi0_en = -1;
37
 
static int sdi0_vsel = -1;
38
 
 
39
35
static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd,
40
36
                                   unsigned char power_mode)
41
37
{
42
 
        switch (power_mode) {
43
 
        case MMC_POWER_UP:
44
 
        case MMC_POWER_ON:
45
 
                /*
46
 
                 * Level shifter voltage should depend on vdd to when deciding
47
 
                 * on either 1.8V or 2.9V. Once the decision has been made the
48
 
                 * level shifter must be disabled and re-enabled with a changed
49
 
                 * select signal in order to switch the voltage. Since there is
50
 
                 * no framework support yet for indicating 1.8V in vdd, use the
51
 
                 * default 2.9V.
52
 
                 */
53
 
                gpio_direction_output(sdi0_vsel, 0);
54
 
                gpio_direction_output(sdi0_en, 1);
55
 
                break;
56
 
        case MMC_POWER_OFF:
57
 
                gpio_direction_output(sdi0_vsel, 0);
58
 
                gpio_direction_output(sdi0_en, 0);
59
 
                break;
60
 
        }
 
38
        if (power_mode == MMC_POWER_UP)
 
39
                gpio_set_value_cansleep(GPIO_SDMMC_EN, 1);
 
40
        else if (power_mode == MMC_POWER_OFF)
 
41
                gpio_set_value_cansleep(GPIO_SDMMC_EN, 0);
61
42
 
62
43
        return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN |
63
44
               MCI_DATA2DIREN | MCI_DATA31DIREN;
86
67
static struct mmci_platform_data mop500_sdi0_data = {
87
68
        .vdd_handler    = mop500_sdi0_vdd_handler,
88
69
        .ocr_mask       = MMC_VDD_29_30,
89
 
        .f_max          = 50000000,
90
 
        .capabilities   = MMC_CAP_4_BIT_DATA |
91
 
                                MMC_CAP_SD_HIGHSPEED |
92
 
                                MMC_CAP_MMC_HIGHSPEED,
 
70
        .f_max          = 100000000,
 
71
        .capabilities   = MMC_CAP_4_BIT_DATA,
93
72
        .gpio_wp        = -1,
94
73
#ifdef CONFIG_STE_DMA40
95
74
        .dma_filter     = stedma40_filter,
98
77
#endif
99
78
};
100
79
 
 
80
/* GPIO pins used by the sdi0 level shifter */
 
81
static int sdi0_en = -1;
 
82
static int sdi0_vsel = -1;
 
83
 
101
84
static void sdi0_configure(void)
102
85
{
103
86
        int ret;
157
140
 
158
141
static struct mmci_platform_data mop500_sdi2_data = {
159
142
        .ocr_mask       = MMC_VDD_165_195,
160
 
        .f_max          = 50000000,
 
143
        .f_max          = 100000000,
161
144
        .capabilities   = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
162
145
        .gpio_cd        = -1,
163
146
        .gpio_wp        = -1,
194
177
 
195
178
static struct mmci_platform_data mop500_sdi4_data = {
196
179
        .ocr_mask       = MMC_VDD_29_30,
197
 
        .f_max          = 50000000,
 
180
        .f_max          = 100000000,
198
181
        .capabilities   = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
199
182
                          MMC_CAP_MMC_HIGHSPEED,
200
183
        .gpio_cd        = -1,
216
199
        /* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */
217
200
        if (!cpu_is_u8500v10())
218
201
                mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
219
 
        /* sdi2 on snowball is in ATL_B mode for FSMC (LAN) */
220
 
        if (!machine_is_snowball())
221
 
                db8500_add_sdi2(&mop500_sdi2_data, periphid);
 
202
        db8500_add_sdi2(&mop500_sdi2_data, periphid);
222
203
 
223
204
        /* On-board eMMC */
224
205
        db8500_add_sdi4(&mop500_sdi4_data, periphid);
225
206
 
226
 
        if (machine_is_hrefv60() || machine_is_snowball()) {
227
 
                if (machine_is_hrefv60()) {
228
 
                        mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
229
 
                        sdi0_en = HREFV60_SDMMC_EN_GPIO;
230
 
                        sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
231
 
                } else if (machine_is_snowball()) {
232
 
                        mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
233
 
                        mop500_sdi0_data.cd_invert = true;
234
 
                        sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
235
 
                        sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
236
 
                }
 
207
        if (machine_is_hrefv60()) {
 
208
                mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
 
209
                sdi0_en = HREFV60_SDMMC_EN_GPIO;
 
210
                sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
237
211
                sdi0_configure();
238
212
        }
239
 
 
240
213
        /*
241
214
         * On boards with the TC35892 GPIO expander, sdi0 will finally
242
215
         * be added when the TC35892 initializes and calls