This patch prepares for supporting STM32 variant which doesn't
have opendrain bit in MMCIPOWER register.
ST others variant (u300, nomadik and ux500) uses MCI_OD bit whereas
others variants uses MCI_ROD bit.
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
* @mmcimask1: true if variant have a MMCIMASK1 register.
* @start_err: bitmask identifying the STARTBITERR bit inside MMCISTATUS
* register.
* @mmcimask1: true if variant have a MMCIMASK1 register.
* @start_err: bitmask identifying the STARTBITERR bit inside MMCISTATUS
* register.
+ * @opendrain: bitmask identifying the OPENDRAIN bit inside MMCIPOWER register
*/
struct variant_data {
unsigned int clkreg;
*/
struct variant_data {
unsigned int clkreg;
bool reversed_irq_handling;
bool mmcimask1;
u32 start_err;
bool reversed_irq_handling;
bool mmcimask1;
u32 start_err;
};
static struct variant_data variant_arm = {
};
static struct variant_data variant_arm = {
.reversed_irq_handling = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
.reversed_irq_handling = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
};
static struct variant_data variant_arm_extended_fifo = {
};
static struct variant_data variant_arm_extended_fifo = {
.f_max = 100000000,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
.f_max = 100000000,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
};
static struct variant_data variant_arm_extended_fifo_hwfc = {
};
static struct variant_data variant_arm_extended_fifo_hwfc = {
.f_max = 100000000,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
.f_max = 100000000,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
};
static struct variant_data variant_u300 = {
};
static struct variant_data variant_u300 = {
.pwrreg_nopower = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
.pwrreg_nopower = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
};
static struct variant_data variant_nomadik = {
};
static struct variant_data variant_nomadik = {
.pwrreg_nopower = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
.pwrreg_nopower = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
};
static struct variant_data variant_ux500 = {
};
static struct variant_data variant_ux500 = {
.pwrreg_nopower = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
.pwrreg_nopower = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
};
static struct variant_data variant_ux500v2 = {
};
static struct variant_data variant_ux500v2 = {
.pwrreg_nopower = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
.pwrreg_nopower = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
};
static struct variant_data variant_qcom = {
};
static struct variant_data variant_qcom = {
.qcom_dml = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
.qcom_dml = true,
.mmcimask1 = true,
.start_err = MCI_STARTBITERR,
};
/* Busy detection for the ST Micro variant */
};
/* Busy detection for the ST Micro variant */
- if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) {
- if (host->hw_designer != AMBA_VENDOR_ST)
- pwr |= MCI_ROD;
- else {
- /*
- * The ST Micro variant use the ROD bit for something
- * else and only has OD (Open Drain).
- */
- pwr |= MCI_OD;
- }
- }
+ if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN && variant->opendrain)
+ pwr |= variant->opendrain;
/*
* If clock = 0 and the variant requires the MMCIPOWER to be used for
/*
* If clock = 0 and the variant requires the MMCIPOWER to be used for