mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: vj <vicencb@gmail.com>
To: "Teresa Gámez" <t.gamez@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/3] ARM OMAP: Remove usage of gpio lib calls in lowlevel code
Date: Wed, 10 Oct 2012 00:50:37 +0200	[thread overview]
Message-ID: <CAAMcf8D_YWMGrE2jvHGVT-5=7f8kwmELthj-YVnpd74FREx4zQ@mail.gmail.com> (raw)
In-Reply-To: <1349776406-14453-2-git-send-email-t.gamez@phytec.de>

On Tue, Oct 9, 2012 at 11:53 AM, Teresa Gámez <t.gamez@phytec.de> wrote:
> As the gpio functions are not available at this point, set the gpio manually.
>
> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> ---
>  arch/arm/mach-omap/omap4_generic.c |   29 +++++++++++++++++++++++++++--
>  1 files changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c
> index a159dfc..81b39f9 100644
> --- a/arch/arm/mach-omap/omap4_generic.c
> +++ b/arch/arm/mach-omap/omap4_generic.c
> @@ -484,11 +484,27 @@ enum omap_boot_src omap4_bootsrc(void)
>         return OMAP_BOOTSRC_UNKNOWN;
>  }
>
> +#define GPIO_MASK 0x1f
> +
> +static void __iomem *omap4_get_gpio_base(unsigned gpio)
> +{
> +       void __iomem *base;
> +
> +       if (gpio < 32)
> +               base = (void *)0x4a310000;
> +       else
> +               base = (void *)(0x48053000 + ((gpio & ~GPIO_MASK) << 8));
> +
> +       return base;
> +}
> +
>  #define I2C_SLAVE 0x12
>
>  noinline int omap4_scale_vcores(unsigned vsel0_pin)
>  {
> +       void __iomem *base;
>         unsigned int rev = omap4_revision();
> +       u32 val = 0;
>
>         /* For VC bypass only VCOREx_CGF_FORCE  is necessary and
>          * VCOREx_CFG_VOLTAGE  changes can be discarded
> @@ -510,8 +526,17 @@ noinline int omap4_scale_vcores(unsigned vsel0_pin)
>                  * VSEL1 is grounded on board. So the following selects
>                  * VSEL1 = 0 and VSEL0 = 1
>                  */
> -               gpio_direction_output(vsel0_pin, 0);
> -               gpio_set_value(vsel0_pin, 1);
> +               base = omap4_get_gpio_base(vsel0_pin);
> +
> +               val = 1 << (vsel0_pin & GPIO_MASK);
> +               writel(val, base + 0x190);
> +
> +               val =  readl(base + 0x134);
> +               val &= (1 << (vsel0_pin & GPIO_MASK));
> +               writel(val, base + 0x134);
> +
> +               val = 1 << (vsel0_pin & GPIO_MASK);
> +               writel(val, base + 0x194);
>         }
>
>         /* set VCORE1 force VSEL */
> --
> 1.7.0.4
>

Yes Teresa, this also works in my case.
Thanks,
  Vicente.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-10-09 22:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09  9:53 [PATCH 1/3] ARM OMAP: gpiolib fix chip.base Teresa Gámez
2012-10-09  9:53 ` [PATCH 2/3] ARM OMAP: Remove usage of gpio lib calls in lowlevel code Teresa Gámez
2012-10-09 22:50   ` vj [this message]
2012-10-09  9:53 ` [PATCH 3/3] ARM OMAP: change region size for gpio banks Teresa Gámez
2012-10-10  7:32 ` [PATCH 1/3] ARM OMAP: gpiolib fix chip.base Sascha Hauer

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='CAAMcf8D_YWMGrE2jvHGVT-5=7f8kwmELthj-YVnpd74FREx4zQ@mail.gmail.com' \
    --to=vicencb@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=t.gamez@phytec.de \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox