From: Tony Lindgren <tony@atomide.com> To: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org Subject: [PATCH 4/6] ARM: OMAP2+: Remove omap4 pdata from hsmmc.c Date: Fri, 17 May 2013 12:17:59 -0700 [thread overview] Message-ID: <20130517191759.468.9983.stgit@localhost> (raw) In-Reply-To: <20130517191304.468.73487.stgit@localhost> This is no longer needed as omap4 is now booted using device tree. Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/mach-omap2/hsmmc.c | 103 ++++--------------------------------------- 1 file changed, 10 insertions(+), 93 deletions(-) diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 2ef1f87..07d4c7b 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c @@ -29,7 +29,6 @@ static u16 control_pbias_offset; static u16 control_devconf1_offset; -static u16 control_mmc1; #define HSMMC_NAME_LEN 9 @@ -121,57 +120,6 @@ static void omap_hsmmc1_after_set_reg(struct device *dev, int slot, } } -static void omap4_hsmmc1_before_set_reg(struct device *dev, int slot, - int power_on, int vdd) -{ - u32 reg; - - /* - * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the - * card with Vcc regulator (from twl4030 or whatever). OMAP has both - * 1.8V and 3.0V modes, controlled by the PBIAS register. - */ - reg = omap4_ctrl_pad_readl(control_pbias_offset); - reg &= ~(OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK | - OMAP4_MMC1_PWRDNZ_MASK | - OMAP4_MMC1_PBIASLITE_VMODE_MASK); - omap4_ctrl_pad_writel(reg, control_pbias_offset); -} - -static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot, - int power_on, int vdd) -{ - u32 reg; - unsigned long timeout; - - if (power_on) { - reg = omap4_ctrl_pad_readl(control_pbias_offset); - reg |= OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK; - if ((1 << vdd) <= MMC_VDD_165_195) - reg &= ~OMAP4_MMC1_PBIASLITE_VMODE_MASK; - else - reg |= OMAP4_MMC1_PBIASLITE_VMODE_MASK; - reg |= (OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK | - OMAP4_MMC1_PWRDNZ_MASK); - omap4_ctrl_pad_writel(reg, control_pbias_offset); - - timeout = jiffies + msecs_to_jiffies(5); - do { - reg = omap4_ctrl_pad_readl(control_pbias_offset); - if (!(reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK)) - break; - usleep_range(100, 200); - } while (!time_after(jiffies, timeout)); - - if (reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK) { - pr_err("Pbias Voltage is not same as LDO\n"); - /* Caution : On VMODE_ERROR Power Down MMC IO */ - reg &= ~(OMAP4_MMC1_PWRDNZ_MASK); - omap4_ctrl_pad_writel(reg, control_pbias_offset); - } - } -} - static void hsmmc2_select_input_clk_src(struct omap_mmc_platform_data *mmc) { u32 reg; @@ -317,11 +265,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, mmc->slots[0].pm_caps = c->pm_caps; mmc->slots[0].internal_clock = !c->ext_clock; mmc->max_freq = c->max_freq; - if (cpu_is_omap44xx()) - mmc->reg_offset = OMAP4_MMC_REG_OFFSET; - else - mmc->reg_offset = 0; - + mmc->reg_offset = 0; mmc->get_context_loss_count = hsmmc_get_context_loss; mmc->slots[0].switch_pin = c->gpio_cd; @@ -368,24 +312,14 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, if (!soc_is_am35xx()) mmc->slots[0].features |= HSMMC_HAS_PBIAS; - if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) - mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET; - switch (c->mmc) { case 1: if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { /* on-chip level shifting via PBIAS0/PBIAS1 */ - if (cpu_is_omap44xx()) { - mmc->slots[0].before_set_reg = - omap4_hsmmc1_before_set_reg; - mmc->slots[0].after_set_reg = - omap4_hsmmc1_after_set_reg; - } else { - mmc->slots[0].before_set_reg = - omap_hsmmc1_before_set_reg; - mmc->slots[0].after_set_reg = - omap_hsmmc1_after_set_reg; - } + mmc->slots[0].before_set_reg = + omap_hsmmc1_before_set_reg; + mmc->slots[0].after_set_reg = + omap_hsmmc1_after_set_reg; } if (soc_is_am35xx()) @@ -563,34 +497,17 @@ free_mmc: void __init omap_hsmmc_init(struct omap2_hsmmc_info *controllers) { - u32 reg; - if (omap_hsmmc_done) return; omap_hsmmc_done = 1; - if (!cpu_is_omap44xx()) { - if (cpu_is_omap2430()) { - control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; - control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; - } else { - control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; - control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; - } + if (cpu_is_omap2430()) { + control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; + control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; } else { - control_pbias_offset = - OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_PBIASLITE; - control_mmc1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MMC1; - reg = omap4_ctrl_pad_readl(control_mmc1); - reg |= (OMAP4_SDMMC1_PUSTRENGTH_GRP0_MASK | - OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK); - reg &= ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK | - OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK); - reg |= (OMAP4_SDMMC1_DR0_SPEEDCTRL_MASK | - OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK | - OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK); - omap4_ctrl_pad_writel(reg, control_mmc1); + control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; + control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; } for (; controllers->mmc; controllers++)
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/6] ARM: OMAP2+: Remove omap4 pdata from hsmmc.c Date: Fri, 17 May 2013 12:17:59 -0700 [thread overview] Message-ID: <20130517191759.468.9983.stgit@localhost> (raw) In-Reply-To: <20130517191304.468.73487.stgit@localhost> This is no longer needed as omap4 is now booted using device tree. Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/mach-omap2/hsmmc.c | 103 ++++--------------------------------------- 1 file changed, 10 insertions(+), 93 deletions(-) diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 2ef1f87..07d4c7b 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c @@ -29,7 +29,6 @@ static u16 control_pbias_offset; static u16 control_devconf1_offset; -static u16 control_mmc1; #define HSMMC_NAME_LEN 9 @@ -121,57 +120,6 @@ static void omap_hsmmc1_after_set_reg(struct device *dev, int slot, } } -static void omap4_hsmmc1_before_set_reg(struct device *dev, int slot, - int power_on, int vdd) -{ - u32 reg; - - /* - * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the - * card with Vcc regulator (from twl4030 or whatever). OMAP has both - * 1.8V and 3.0V modes, controlled by the PBIAS register. - */ - reg = omap4_ctrl_pad_readl(control_pbias_offset); - reg &= ~(OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK | - OMAP4_MMC1_PWRDNZ_MASK | - OMAP4_MMC1_PBIASLITE_VMODE_MASK); - omap4_ctrl_pad_writel(reg, control_pbias_offset); -} - -static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot, - int power_on, int vdd) -{ - u32 reg; - unsigned long timeout; - - if (power_on) { - reg = omap4_ctrl_pad_readl(control_pbias_offset); - reg |= OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK; - if ((1 << vdd) <= MMC_VDD_165_195) - reg &= ~OMAP4_MMC1_PBIASLITE_VMODE_MASK; - else - reg |= OMAP4_MMC1_PBIASLITE_VMODE_MASK; - reg |= (OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK | - OMAP4_MMC1_PWRDNZ_MASK); - omap4_ctrl_pad_writel(reg, control_pbias_offset); - - timeout = jiffies + msecs_to_jiffies(5); - do { - reg = omap4_ctrl_pad_readl(control_pbias_offset); - if (!(reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK)) - break; - usleep_range(100, 200); - } while (!time_after(jiffies, timeout)); - - if (reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK) { - pr_err("Pbias Voltage is not same as LDO\n"); - /* Caution : On VMODE_ERROR Power Down MMC IO */ - reg &= ~(OMAP4_MMC1_PWRDNZ_MASK); - omap4_ctrl_pad_writel(reg, control_pbias_offset); - } - } -} - static void hsmmc2_select_input_clk_src(struct omap_mmc_platform_data *mmc) { u32 reg; @@ -317,11 +265,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, mmc->slots[0].pm_caps = c->pm_caps; mmc->slots[0].internal_clock = !c->ext_clock; mmc->max_freq = c->max_freq; - if (cpu_is_omap44xx()) - mmc->reg_offset = OMAP4_MMC_REG_OFFSET; - else - mmc->reg_offset = 0; - + mmc->reg_offset = 0; mmc->get_context_loss_count = hsmmc_get_context_loss; mmc->slots[0].switch_pin = c->gpio_cd; @@ -368,24 +312,14 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, if (!soc_is_am35xx()) mmc->slots[0].features |= HSMMC_HAS_PBIAS; - if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) - mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET; - switch (c->mmc) { case 1: if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { /* on-chip level shifting via PBIAS0/PBIAS1 */ - if (cpu_is_omap44xx()) { - mmc->slots[0].before_set_reg = - omap4_hsmmc1_before_set_reg; - mmc->slots[0].after_set_reg = - omap4_hsmmc1_after_set_reg; - } else { - mmc->slots[0].before_set_reg = - omap_hsmmc1_before_set_reg; - mmc->slots[0].after_set_reg = - omap_hsmmc1_after_set_reg; - } + mmc->slots[0].before_set_reg = + omap_hsmmc1_before_set_reg; + mmc->slots[0].after_set_reg = + omap_hsmmc1_after_set_reg; } if (soc_is_am35xx()) @@ -563,34 +497,17 @@ free_mmc: void __init omap_hsmmc_init(struct omap2_hsmmc_info *controllers) { - u32 reg; - if (omap_hsmmc_done) return; omap_hsmmc_done = 1; - if (!cpu_is_omap44xx()) { - if (cpu_is_omap2430()) { - control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; - control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; - } else { - control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; - control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; - } + if (cpu_is_omap2430()) { + control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; + control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; } else { - control_pbias_offset = - OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_PBIASLITE; - control_mmc1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MMC1; - reg = omap4_ctrl_pad_readl(control_mmc1); - reg |= (OMAP4_SDMMC1_PUSTRENGTH_GRP0_MASK | - OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK); - reg &= ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK | - OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK); - reg |= (OMAP4_SDMMC1_DR0_SPEEDCTRL_MASK | - OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK | - OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK); - omap4_ctrl_pad_writel(reg, control_mmc1); + control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; + control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; } for (; controllers->mmc; controllers++)
next prev parent reply other threads:[~2013-05-17 19:18 UTC|newest] Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-05-17 19:17 [PATCH 0/6] Drop legacy booting for omap4 for v3.11, boot with device tree only Tony Lindgren 2013-05-17 19:17 ` Tony Lindgren 2013-05-17 19:17 ` [PATCH 1/6] ARM: OMAP2+: Remove board-4430sdp.c Tony Lindgren 2013-05-17 19:17 ` Tony Lindgren 2013-05-20 9:54 ` Russell King - ARM Linux 2013-05-20 9:54 ` Russell King - ARM Linux 2013-05-20 17:10 ` Tony Lindgren 2013-05-20 17:10 ` Tony Lindgren 2013-07-06 13:10 ` Russell King - ARM Linux 2013-07-06 13:10 ` Russell King - ARM Linux 2013-07-06 13:36 ` Russell King - ARM Linux 2013-07-06 13:36 ` Russell King - ARM Linux 2013-07-08 9:34 ` Tony Lindgren 2013-07-08 9:34 ` Tony Lindgren 2013-07-08 14:21 ` Russell King - ARM Linux 2013-07-08 14:21 ` Russell King - ARM Linux 2013-07-09 8:23 ` Tony Lindgren 2013-07-09 8:23 ` Tony Lindgren 2013-07-12 9:09 ` Peter Ujfalusi 2013-07-12 9:09 ` Peter Ujfalusi 2013-07-22 9:40 ` Tomi Valkeinen 2013-07-22 9:40 ` Tomi Valkeinen 2013-10-27 13:26 ` Javier Martinez Canillas 2013-10-27 13:26 ` Javier Martinez Canillas 2013-10-28 13:32 ` Tomi Valkeinen 2013-10-28 13:32 ` Tomi Valkeinen 2013-10-28 14:25 ` Javier Martinez Canillas 2013-10-28 14:25 ` Javier Martinez Canillas 2013-07-13 2:31 ` Olof Johansson 2013-07-13 2:31 ` Olof Johansson 2013-07-13 3:10 ` Olof Johansson 2013-07-13 3:10 ` Olof Johansson 2013-07-15 6:55 ` Tony Lindgren 2013-07-15 6:55 ` Tony Lindgren 2013-07-06 21:36 ` Arnd Bergmann 2013-07-06 21:36 ` Arnd Bergmann 2013-07-06 23:37 ` debugging options (was: Re: [PATCH 1/6] ARM: OMAP2+: Remove board-4430sdp.c) Russell King - ARM Linux 2013-07-06 23:37 ` Russell King - ARM Linux 2013-05-17 19:17 ` [PATCH 2/6] ARM: OMAP2+: Remove board-omap4panda.c Tony Lindgren 2013-05-17 19:17 ` Tony Lindgren 2013-06-03 15:28 ` Ming Lei 2013-06-03 15:28 ` Ming Lei 2013-06-12 16:31 ` Tony Lindgren 2013-06-12 16:31 ` Tony Lindgren 2013-06-12 17:14 ` Tony Lindgren 2013-06-12 17:14 ` Tony Lindgren 2013-06-13 9:21 ` Sricharan R 2013-06-13 9:21 ` Sricharan R 2013-06-13 10:12 ` Sricharan R 2013-06-13 10:12 ` Sricharan R 2013-06-13 11:05 ` Tony Lindgren 2013-06-13 11:05 ` Tony Lindgren 2013-06-13 13:36 ` Ming Lei 2013-06-13 13:36 ` Ming Lei 2013-06-14 13:31 ` Ming Lei 2013-06-14 13:31 ` Ming Lei 2013-06-14 13:58 ` Ming Lei 2013-06-14 13:58 ` Ming Lei 2013-06-17 7:42 ` Sricharan R 2013-06-17 7:42 ` Sricharan R 2013-06-17 8:06 ` Arnaud Patard 2013-06-17 8:06 ` Arnaud Patard (Rtp) 2013-06-17 8:16 ` Ming Lei 2013-06-17 8:16 ` Ming Lei 2013-06-17 8:27 ` Tony Lindgren 2013-06-17 8:27 ` Tony Lindgren 2013-06-17 8:41 ` Ming Lei 2013-06-17 8:41 ` Ming Lei 2013-06-17 8:49 ` Tony Lindgren 2013-06-17 8:49 ` Tony Lindgren 2013-06-17 8:24 ` Tony Lindgren 2013-06-17 8:24 ` Tony Lindgren 2013-06-17 9:46 ` Arnaud Patard 2013-06-17 9:46 ` Arnaud Patard (Rtp) 2013-06-17 10:26 ` Tony Lindgren 2013-06-17 10:26 ` Tony Lindgren 2013-06-18 11:27 ` Tony Lindgren 2013-06-18 11:27 ` Tony Lindgren 2013-06-19 9:45 ` Arnaud Patard 2013-06-19 9:45 ` Arnaud Patard (Rtp) 2013-06-19 9:58 ` Tony Lindgren 2013-06-19 9:58 ` Tony Lindgren 2013-06-20 7:29 ` Arnaud Patard 2013-06-20 7:29 ` Arnaud Patard (Rtp) 2013-06-21 6:01 ` Tony Lindgren 2013-06-21 6:01 ` Tony Lindgren 2013-05-17 19:17 ` [PATCH 3/6] ARM: OMAP2+: Remove legacy mux data for omap4 Tony Lindgren 2013-05-17 19:17 ` Tony Lindgren 2013-05-17 19:17 ` Tony Lindgren [this message] 2013-05-17 19:17 ` [PATCH 4/6] ARM: OMAP2+: Remove omap4 pdata from hsmmc.c Tony Lindgren 2013-05-17 19:18 ` [PATCH 5/6] ARM: OMAP2+: Remove omap4 pdata for USB Tony Lindgren 2013-05-17 19:18 ` Tony Lindgren 2013-05-17 19:18 ` [PATCH 6/6] ARM: OMAP2+: Remove omap4 ocp2scp pdata Tony Lindgren 2013-05-17 19:18 ` Tony Lindgren 2013-05-17 20:05 ` Felipe Balbi 2013-05-17 20:05 ` Felipe Balbi 2013-05-21 11:53 ` Kishon Vijay Abraham I 2013-05-21 11:53 ` Kishon Vijay Abraham I 2013-06-07 10:05 ` [PATCH 0/6] Drop legacy booting for omap4 for v3.11, boot with device tree only Tomi Valkeinen 2013-06-07 10:05 ` Tomi Valkeinen
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20130517191759.468.9983.stgit@localhost \ --to=tony@atomide.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.