]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/ti/dra7xx/evm.c
ARM: DRA7x/AM57x: Add MMC/SD fixups for rev1.0 and rev 1.1
[people/ms/u-boot.git] / board / ti / dra7xx / evm.c
index bd871fa749c0e2ce203e983b5f75baca4af21f03..06f061c92c88118c7f6aa007b83c4cf7a3d3c98d 100644 (file)
@@ -285,6 +285,8 @@ void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs)
                        break;
                }
                break;
+       case DRA762_ABZ_ES1_0:
+       case DRA762_ACD_ES1_0:
        case DRA762_ES1_0:
                if (emif_nr == 1)
                        *regs = &emif_1_regs_ddr3_666_mhz_1cs_dra76;
@@ -293,6 +295,7 @@ void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs)
                break;
        case DRA722_ES1_0:
        case DRA722_ES2_0:
+       case DRA722_ES2_1:
                if (ram_size < CONFIG_MAX_MEM_MAPPED)
                        *regs = &emif_1_regs_ddr3_666_mhz_1cs_dra_es1;
                else
@@ -346,6 +349,8 @@ void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs)
        ram_size = board_ti_get_emif_size();
 
        switch (omap_revision()) {
+       case DRA762_ABZ_ES1_0:
+       case DRA762_ACD_ES1_0:
        case DRA762_ES1_0:
        case DRA752_ES1_0:
        case DRA752_ES1_1:
@@ -357,6 +362,7 @@ void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs)
                break;
        case DRA722_ES1_0:
        case DRA722_ES2_0:
+       case DRA722_ES2_1:
        default:
                if (ram_size < CONFIG_MAX_MEM_MAPPED)
                        *dmm_lisa_regs = &lisa_map_2G_x_2;
@@ -653,8 +659,10 @@ int board_late_init(void)
                        name = "dra71x";
                else
                        name = "dra72x";
-       } else if (is_dra76x()) {
-               name = "dra76x";
+       } else if (is_dra76x_abz()) {
+               name = "dra76x_abz";
+       } else if (is_dra76x_acd()) {
+               name = "dra76x_acd";
        } else {
                name = "dra7xx";
        }
@@ -670,6 +678,13 @@ int board_late_init(void)
 
        omap_die_id_serial();
        omap_set_fastboot_vars();
+
+       /*
+        * Hook the LDO1 regulator to EN pin. This applies only to LP8733
+        * Rest all regulators are hooked to EN Pin at reset.
+        */
+       if (board_is_dra71x_evm())
+               palmas_i2c_write_u8(LP873X_I2C_SLAVE_ADDR, 0x9, 0x7);
 #endif
        return 0;
 }
@@ -755,6 +770,7 @@ void recalibrate_iodelay(void)
        switch (omap_revision()) {
        case DRA722_ES1_0:
        case DRA722_ES2_0:
+       case DRA722_ES2_1:
                pads = dra72x_core_padconf_array_common;
                npads = ARRAY_SIZE(dra72x_core_padconf_array_common);
                if (board_is_dra71x_evm()) {
@@ -783,6 +799,7 @@ void recalibrate_iodelay(void)
                iodelay = dra742_es1_1_iodelay_cfg_array;
                niodelays = ARRAY_SIZE(dra742_es1_1_iodelay_cfg_array);
                break;
+       case DRA762_ACD_ES1_0:
        case DRA762_ES1_0:
                pads = dra76x_core_padconf_array;
                npads = ARRAY_SIZE(dra76x_core_padconf_array);
@@ -791,6 +808,7 @@ void recalibrate_iodelay(void)
                break;
        default:
        case DRA752_ES2_0:
+       case DRA762_ABZ_ES1_0:
                pads = dra74x_core_padconf_array;
                npads = ARRAY_SIZE(dra74x_core_padconf_array);
                iodelay = dra742_es2_0_iodelay_cfg_array;
@@ -813,6 +831,11 @@ void recalibrate_iodelay(void)
                do_set_mux32((*ctrl)->control_padconf_core_base,
                             delta_pads, delta_npads);
 
+       if (is_dra76x())
+               /* Set mux for MCAN instead of DCAN1 */
+               clrsetbits_le32((*ctrl)->control_core_control_spare_rw,
+                               MCAN_SEL_ALT_MASK, MCAN_SEL);
+
        /* Setup IOdelay configuration */
        ret = do_set_iodelay((*ctrl)->iodelay_config_base, iodelay, niodelays);
 err:
@@ -843,6 +866,35 @@ void board_mmc_poweron_ldo(uint voltage)
                palmas_mmc1_poweron_ldo(LDO1_VOLTAGE, LDO1_CTRL, voltage);
        }
 }
+
+static const struct mmc_platform_fixups dra7x_es1_1_mmc1_fixups = {
+       .hw_rev = "rev11",
+       .unsupported_caps = MMC_CAP(MMC_HS_200) |
+                           MMC_CAP(UHS_SDR104),
+       .max_freq = 96000000,
+};
+
+static const struct mmc_platform_fixups dra7x_es1_1_mmc23_fixups = {
+       .hw_rev = "rev11",
+       .unsupported_caps = MMC_CAP(MMC_HS_200) |
+                           MMC_CAP(UHS_SDR104) |
+                           MMC_CAP(UHS_SDR50),
+       .max_freq = 48000000,
+};
+
+const struct mmc_platform_fixups *platform_fixups_mmc(uint32_t addr)
+{
+       switch (omap_revision()) {
+       case DRA752_ES1_0:
+       case DRA752_ES1_1:
+               if (addr == OMAP_HSMMC1_BASE)
+                       return &dra7x_es1_1_mmc1_fixups;
+               else
+                       return &dra7x_es1_1_mmc23_fixups;
+       default:
+               return NULL;
+       }
+}
 #endif
 
 #ifdef CONFIG_USB_DWC3
@@ -884,7 +936,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
        .index = 1,
 };
 
-int omap_xhci_board_usb_init(int index, enum usb_init_type init)
+int board_usb_init(int index, enum usb_init_type init)
 {
        enable_usb_clocks(index);
        switch (index) {
@@ -921,7 +973,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type init)
        return 0;
 }
 
-int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
+int board_usb_cleanup(int index, enum usb_init_type init)
 {
        switch (index) {
        case 0:
@@ -1115,9 +1167,10 @@ int board_fit_config_name_match(const char *name)
                } else if (!strcmp(name, "dra72-evm")) {
                        return 0;
                }
-       } else if (is_dra76x() && !strcmp(name, "dra76-evm")) {
+       } else if (is_dra76x_acd() && !strcmp(name, "dra76-evm")) {
                return 0;
-       } else if (!is_dra72x() && !is_dra76x() && !strcmp(name, "dra7-evm")) {
+       } else if (!is_dra72x() && !is_dra76x_acd() &&
+                  !strcmp(name, "dra7-evm")) {
                return 0;
        }