blob: 67bbcf0785f61da1d4a832e016de1cb99dd313a9 [file] [log] [blame]
Andreas Fenkart551434382014-11-08 15:33:09 +01001/*
2 * MMC definitions for OMAP2
3 *
4 * Copyright (C) 2006 Nokia Corporation
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
Andreas Fenkart551434382014-11-08 15:33:09 +010011/*
12 * struct omap_hsmmc_dev_attr.flags possibilities
13 *
14 * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can
15 * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag
16 * should be set if this is the case. See for example Section 22.5.3
17 * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia
18 * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R).
19 *
20 * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers
21 * don't work correctly on some MMC controller instances on some
22 * OMAP3 SoCs; this flag should be set if this is the case. See
23 * for example Advisory 2.1.1.128 "MMC: Multiple Block Read
24 * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
25 * Revision F (October 2010) (SPRZ278F).
26 */
27#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0)
28#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1)
29#define OMAP_HSMMC_SWAKEUP_MISSING BIT(2)
30
31struct omap_hsmmc_dev_attr {
32 u8 flags;
33};
34
35struct mmc_card;
36
37struct omap_hsmmc_platform_data {
38 /* back-link to device */
39 struct device *dev;
40
Andreas Fenkart551434382014-11-08 15:33:09 +010041 /* set if your board has components or wiring that limits the
42 * maximum frequency on the MMC bus */
43 unsigned int max_freq;
44
Andreas Fenkart551434382014-11-08 15:33:09 +010045 /* Integrating attributes from the omap_hwmod layer */
46 u8 controller_flags;
47
48 /* Register offset deviation */
49 u16 reg_offset;
50
Andreas Fenkart326119c2014-11-08 15:33:14 +010051 /*
52 * 4/8 wires and any additional host capabilities
53 * need to OR'd all capabilities (ref. linux/mmc/host.h)
54 */
55 u32 caps; /* Used for the MMC driver on 2430 and later */
56 u32 pm_caps; /* PM capabilities of the mmc */
Andreas Fenkart551434382014-11-08 15:33:09 +010057
Andreas Fenkart326119c2014-11-08 15:33:14 +010058 /* switch pin can be for card detect (default) or card cover */
59 unsigned cover:1;
Andreas Fenkart551434382014-11-08 15:33:09 +010060
Andreas Fenkart326119c2014-11-08 15:33:14 +010061 /* use the internal clock */
62 unsigned internal_clock:1;
Andreas Fenkart551434382014-11-08 15:33:09 +010063
Andreas Fenkart326119c2014-11-08 15:33:14 +010064 /* nonremovable e.g. eMMC */
65 unsigned nonremovable:1;
Andreas Fenkart551434382014-11-08 15:33:09 +010066
Andreas Fenkart326119c2014-11-08 15:33:14 +010067 /* eMMC does not handle power off when not in sleep state */
68 unsigned no_regulator_off_init:1;
Andreas Fenkart551434382014-11-08 15:33:09 +010069
Andreas Fenkart326119c2014-11-08 15:33:14 +010070 /* we can put the features above into this variable */
Andreas Fenkart551434382014-11-08 15:33:09 +010071#define HSMMC_HAS_PBIAS (1 << 0)
72#define HSMMC_HAS_UPDATED_RESET (1 << 1)
73#define HSMMC_HAS_HSPE_SUPPORT (1 << 2)
Andreas Fenkart326119c2014-11-08 15:33:14 +010074 unsigned features;
Andreas Fenkart551434382014-11-08 15:33:09 +010075
Andreas Fenkart326119c2014-11-08 15:33:14 +010076 int switch_pin; /* gpio (card detect) */
77 int gpio_wp; /* gpio (write protect) */
Andreas Fenkart551434382014-11-08 15:33:09 +010078
Andreas Fenkart80412ca2014-11-08 15:33:17 +010079 int (*set_power)(struct device *dev, int power_on, int vdd);
80 void (*remux)(struct device *dev, int power_on);
Andreas Fenkart326119c2014-11-08 15:33:14 +010081 /* Call back before enabling / disabling regulators */
Andreas Fenkart80412ca2014-11-08 15:33:17 +010082 void (*before_set_reg)(struct device *dev, int power_on, int vdd);
Andreas Fenkart326119c2014-11-08 15:33:14 +010083 /* Call back after enabling / disabling regulators */
Andreas Fenkart80412ca2014-11-08 15:33:17 +010084 void (*after_set_reg)(struct device *dev, int power_on, int vdd);
Andreas Fenkart326119c2014-11-08 15:33:14 +010085 /* if we have special card, init it using this callback */
86 void (*init_card)(struct mmc_card *card);
Andreas Fenkart551434382014-11-08 15:33:09 +010087
Andreas Fenkart326119c2014-11-08 15:33:14 +010088 const char *name;
89 u32 ocr_mask;
Andreas Fenkart551434382014-11-08 15:33:09 +010090};