global: Migrate CONFIG_STACKBASE to CFG
[platform/kernel/u-boot.git] / include / sdhci.h
index 1fd20ec..24b4599 100644 (file)
@@ -65,6 +65,8 @@
 #define  SDHCI_CARD_STATE_STABLE       BIT(17)
 #define  SDHCI_CARD_DETECT_PIN_LEVEL   BIT(18)
 #define  SDHCI_WRITE_PROTECT   BIT(19)
+#define  SDHCI_DATA_LVL_MASK   0x00F00000
+#define   SDHCI_DATA_0_LVL_MASK BIT(20)
 
 #define SDHCI_HOST_CONTROL     0x28
 #define  SDHCI_CTRL_LED                BIT(0)
 #define SDHCI_QUIRK_WAIT_SEND_CMD      (1 << 6)
 #define SDHCI_QUIRK_USE_WIDE8          (1 << 8)
 #define SDHCI_QUIRK_NO_1_8_V           (1 << 9)
+#define SDHCI_QUIRK_SUPPORT_SINGLE     (1 << 10)
 
 /* to make gcc happy */
 struct sdhci_host;
@@ -268,8 +271,20 @@ struct sdhci_ops {
        int     (*set_ios_post)(struct sdhci_host *host);
        void    (*set_clock)(struct sdhci_host *host, u32 div);
        int (*platform_execute_tuning)(struct mmc *host, u8 opcode);
-       void (*set_delay)(struct sdhci_host *host);
+       int (*set_delay)(struct sdhci_host *host);
        int     (*deferred_probe)(struct sdhci_host *host);
+
+       /**
+        * set_enhanced_strobe() - Set HS400 Enhanced Strobe config
+        *
+        * This is called after setting the card speed and mode to
+        * HS400 ES, and should set any host-specific configuration
+        * necessary for it.
+        *
+        * @host: SDHCI host structure
+        * Return: 0 if successful, -ve on error
+        */
+       int     (*set_enhanced_strobe)(struct sdhci_host *host);
 };
 
 #define ADMA_MAX_LEN   65532
@@ -440,10 +455,10 @@ static inline u8 sdhci_readb(struct sdhci_host *host, int reg)
  * ...
  *
  * Inside U_BOOT_DRIVER():
- *     .platdata_auto_alloc_size = sizeof(struct msm_sdhc_plat),
+ *     .plat_auto      = sizeof(struct msm_sdhc_plat),
  *
  * To access platform data:
- *     struct msm_sdhc_plat *plat = dev_get_platdata(dev);
+ *     struct msm_sdhc_plat *plat = dev_get_plat(dev);
  *
  * See msm_sdhci.c for an example.
  *
@@ -468,7 +483,7 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
  * @cfg:       Empty configuration structure (generally &plat->cfg). This is
  *             normally all zeroes at this point. The only purpose of passing
  *             this in is to set mmc->cfg to it.
- * @return 0 if OK, -ve if the block device could not be created
+ * Return: 0 if OK, -ve if the block device could not be created
  */
 int sdhci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg);
 #else
@@ -481,7 +496,7 @@ int sdhci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg);
  * @host:      SDHCI host structure
  * @f_max:     Maximum supported clock frequency in HZ (0 for default)
  * @f_min:     Minimum supported clock frequency in HZ (0 for default)
- * @return 0 if OK, -ve on error
+ * Return: 0 if OK, -ve on error
  */
 int add_sdhci(struct sdhci_host *host, u32 f_max, u32 f_min);
 #endif /* !CONFIG_BLK */
@@ -491,6 +506,16 @@ void sdhci_set_uhs_timing(struct sdhci_host *host);
 /* Export the operations to drivers */
 int sdhci_probe(struct udevice *dev);
 int sdhci_set_clock(struct mmc *mmc, unsigned int clock);
+
+/**
+ * sdhci_set_control_reg - Set control registers
+ *
+ * This is used set up control registers for voltage level and UHS speed
+ * mode.
+ *
+ * @host: SDHCI host structure
+ */
+void sdhci_set_control_reg(struct sdhci_host *host);
 extern const struct dm_mmc_ops sdhci_ops;
 #else
 #endif