]> git.sur5r.net Git - u-boot/blobdiff - include/mmc.h
x86: Enable the queensbay cpu directory build
[u-boot] / include / mmc.h
index a3a100bd392f7d5591297192b4487fc28974e3d3..7ec255d882199c88dc7bf79f52857c87a796a46c 100644 (file)
 #define MMC_VERSION_4_3                (MMC_VERSION_MMC | 0x403)
 #define MMC_VERSION_4_41       (MMC_VERSION_MMC | 0x429)
 #define MMC_VERSION_4_5                (MMC_VERSION_MMC | 0x405)
+#define MMC_VERSION_5_0                (MMC_VERSION_MMC | 0x500)
 
-#define MMC_MODE_HS            0x001
-#define MMC_MODE_HS_52MHz      0x010
-#define MMC_MODE_4BIT          0x100
-#define MMC_MODE_8BIT          0x200
-#define MMC_MODE_SPI           0x400
-#define MMC_MODE_HC            0x800
-
-#define MMC_MODE_MASK_WIDTH_BITS (MMC_MODE_4BIT | MMC_MODE_8BIT)
-#define MMC_MODE_WIDTH_BITS_SHIFT 8
+#define MMC_MODE_HS            (1 << 0)
+#define MMC_MODE_HS_52MHz      (1 << 1)
+#define MMC_MODE_4BIT          (1 << 2)
+#define MMC_MODE_8BIT          (1 << 3)
+#define MMC_MODE_SPI           (1 << 4)
+#define MMC_MODE_HC            (1 << 5)
+#define MMC_MODE_DDR_52MHz     (1 << 6)
 
 #define SD_DATA_4BIT   0x00040000
 
 #define SD_HIGHSPEED_BUSY      0x00020000
 #define SD_HIGHSPEED_SUPPORTED 0x00020000
 
-#define MMC_HS_TIMING          0x00000100
-#define MMC_HS_52MHZ           0x2
-
 #define OCR_BUSY               0x80000000
 #define OCR_HCS                        0x40000000
 #define OCR_VOLTAGE_MASK       0x007FFF80
  * EXT_CSD fields
  */
 #define EXT_CSD_GP_SIZE_MULT           143     /* R/W */
+#define EXT_CSD_PARTITION_SETTING      155     /* R/W */
 #define EXT_CSD_PARTITIONS_ATTRIBUTE   156     /* R/W */
 #define EXT_CSD_PARTITIONING_SUPPORT   160     /* RO */
 #define EXT_CSD_RST_N_FUNCTION         162     /* R/W */
 
 #define EXT_CSD_CARD_TYPE_26   (1 << 0)        /* Card can run at 26MHz */
 #define EXT_CSD_CARD_TYPE_52   (1 << 1)        /* Card can run at 52MHz */
+#define EXT_CSD_CARD_TYPE_DDR_1_8V     (1 << 2)
+#define EXT_CSD_CARD_TYPE_DDR_1_2V     (1 << 3)
+#define EXT_CSD_CARD_TYPE_DDR_52       (EXT_CSD_CARD_TYPE_DDR_1_8V \
+                                       | EXT_CSD_CARD_TYPE_DDR_1_2V)
 
 #define EXT_CSD_BUS_WIDTH_1    0       /* Card is in 1 bit mode */
 #define EXT_CSD_BUS_WIDTH_4    1       /* Card is in 4 bit mode */
 #define EXT_CSD_BUS_WIDTH_8    2       /* Card is in 8 bit mode */
+#define EXT_CSD_DDR_BUS_WIDTH_4        5       /* Card is in 4 bit DDR mode */
+#define EXT_CSD_DDR_BUS_WIDTH_8        6       /* Card is in 8 bit DDR mode */
 
 #define EXT_CSD_BOOT_ACK_ENABLE                        (1 << 6)
 #define EXT_CSD_BOOT_PARTITION_ENABLE          (1 << 3)
 #define EXT_CSD_BOOT_BUS_WIDTH_RESET(x)        (x << 2)
 #define EXT_CSD_BOOT_BUS_WIDTH_WIDTH(x)        (x)
 
+#define EXT_CSD_PARTITION_SETTING_COMPLETED    (1 << 0)
+
 #define R1_ILLEGAL_COMMAND             (1 << 22)
 #define R1_APP_CMD                     (1 << 5)
 
@@ -313,6 +318,7 @@ struct mmc {
        char init_in_progress;  /* 1 if we have done mmc_start_init() */
        char preinit;           /* start init as early as possible */
        uint op_cond_response;  /* the response byte from the last op_cond */
+       int ddr_mode;
 };
 
 int mmc_register(struct mmc *mmc);
@@ -326,10 +332,11 @@ struct mmc *find_mmc_device(int dev_num);
 int mmc_set_dev(int dev_num);
 void print_mmc_devices(char separator);
 int get_mmc_num(void);
-int board_mmc_getcd(struct mmc *mmc);
 int mmc_switch_part(int dev_num, unsigned int part_num);
 int mmc_getcd(struct mmc *mmc);
+int board_mmc_getcd(struct mmc *mmc);
 int mmc_getwp(struct mmc *mmc);
+int board_mmc_getwp(struct mmc *mmc);
 int mmc_set_dsr(struct mmc *mmc, u16 val);
 /* Function to change the size of boot partition and rpmb partitions */
 int mmc_boot_partition_size_change(struct mmc *mmc, unsigned long bootsize,
@@ -383,7 +390,10 @@ struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode);
 int mmc_legacy_init(int verbose);
 #endif
 
+void board_mmc_power_init(void);
 int board_mmc_init(bd_t *bis);
+int cpu_mmc_init(bd_t *bis);
+int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr);
 
 /* Set block count limit because of 16 bit register limit on some hardware*/
 #ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT