linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/13] ARM: pxa: Access SMEMC via virtual addresses
Date: Sun, 10 Oct 2010 04:03:21 +0200	[thread overview]
Message-ID: <201010100403.22064.marek.vasut@gmail.com> (raw)
In-Reply-To: <AANLkTikPa+5gp13mLdFYhvcwGdXuPU4th_9CxdFsoC4u@mail.gmail.com>

Dne Ne 10. ??jna 2010 02:31:24 Haojian Zhuang napsal(a):
> On Sun, Oct 10, 2010 at 6:39 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > This is important because on PXA3xx, the physical mapping of SMEMC
> > registers differs from the one on PXA2xx. In order to get PCMCIA working
> > on both PXA2xx and PXA320, the PCMCIA driver was adjusted accordingly as
> > well.
> > 
> > Also, various places in the kernel had to be patched to use
> > __raw_read/__raw_write.
> > 
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> > ---

[SNIP]
> > @@ -205,19 +218,18 @@ pxa2xx_pcmcia_frequency_change(struct
> > soc_pcmcia_socket *skt, static void pxa2xx_configure_sockets(struct
> > device *dev)
> >  {
> >        struct pcmcia_low_level *ops = dev->platform_data;
> > -
> >        /*
> >         * We have at least one socket, so set MECR:CIT
> >         * (Card Is There)
> >         */
> > -       MECR |= MECR_CIT;
> > +       uint32_t mecr = MECR_CIT;
> > 
> >        /* Set MECR:NOS (Number Of Sockets) */
> >        if ((ops->first + ops->nr) > 1 ||
> >            machine_is_viper() || machine_is_arcom_zeus())
> > -               MECR |= MECR_NOS;
> > -       else
> > -               MECR &= ~MECR_NOS;
> > +               mecr |= MECR_NOS;
> > +
> > +       __raw_writel(mecr, MECR);
> 
> In original, it only wants MECR |= MECR_NOS. But now, it becomes MECR
> = MECR_NOS. The meaning is changed.

The meaning is actually still the same, check the datasheet.

I admit the logic has changed a bit though.

Are you fine with having it this way ?

Cheers
> 
> >  }
> > 
> >  static const char *skt_names[] = {
> > @@ -272,14 +284,24 @@ static int pxa2xx_drv_pcmcia_probe(struct
> > platform_device *dev) struct soc_pcmcia_socket *skt;
> > 
> >        ops = (struct pcmcia_low_level *)dev->dev.platform_data;
> > -       if (!ops)
> > -               return -ENODEV;
> > +       if (!ops) {
> > +               ret = -ENODEV;
> > +               goto err0;
> > +       }
> > +
> > +       if (cpu_is_pxa320() && ops->nr > 1) {
> > +               dev_err(&dev->dev, "pxa320 supports only one pcmcia
> > slot"); +               ret = -EINVAL;
> > +               goto err0;
> > +       }
> > 
> >        pxa2xx_drv_pcmcia_ops(ops);
> > 
> >        sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL);
> > -       if (!sinfo)
> > -               return -ENOMEM;
> > +       if (!sinfo) {
> > +               ret = -ENOMEM;
> > +               goto err0;
> > +       }
> > 
> >        sinfo->nskt = ops->nr;
> > 
> > @@ -295,18 +317,19 @@ static int pxa2xx_drv_pcmcia_probe(struct
> > platform_device *dev)
> > 
> >                ret = pxa2xx_drv_pcmcia_add_one(skt);
> >                if (ret)
> > -                       break;
> > +                       goto err1;
> >        }
> > 
> > -       if (ret) {
> > -               while (--i >= 0)
> > -                       soc_pcmcia_remove_one(&sinfo->skt[i]);
> > -               kfree(sinfo);
> > -       } else {
> > -               pxa2xx_configure_sockets(&dev->dev);
> > -               dev_set_drvdata(&dev->dev, sinfo);
> > -       }
> > +       pxa2xx_configure_sockets(&dev->dev);
> > +       dev_set_drvdata(&dev->dev, sinfo);
> > 
> > +       return 0;
> > +
> > +err1:
> > +       while (--i >= 0)
> > +               soc_pcmcia_remove_one(&sinfo->skt[i]);
> > +       kfree(sinfo);
> > +err0:
> >        return ret;
> >  }
> > 
> > --
> > 1.7.1

  reply	other threads:[~2010-10-10  2:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-09 22:39 [PATCH 01/13] ARM: pxa: Introduce pxa[23]xx_map_io Marek Vasut
2010-10-09 22:39 ` [PATCH 02/13] ARM: pxa: Access SMEMC via virtual addresses Marek Vasut
2010-10-10  0:31   ` Haojian Zhuang
2010-10-10  2:03     ` Marek Vasut [this message]
2010-10-09 22:39 ` [PATCH 03/13] ARM: pxa: Toradex Colibri PXA270 CF support Marek Vasut
2010-10-09 22:39 ` [PATCH 04/13] ARM: pxa: Push Colibri evalboard MFP into module files Marek Vasut
2010-10-09 22:39 ` [PATCH 05/13] ARM: pxa: Add M41T00 RTC support into Colibri evalboard Marek Vasut
2010-10-09 22:39 ` [PATCH 06/13] ARM: pxa: Rename " Marek Vasut
2010-10-09 22:39 ` [PATCH 07/13] ARM: pxa: Colibri PXA320 PCMCIA driver Marek Vasut
2010-10-09 22:39 ` [PATCH 08/13] ARM: pxa: Modularize Palm Tungsten|C Marek Vasut
2010-10-09 22:39 ` [PATCH 09/13] UCB1400: Pass ucb1400-gpio data through ac97 bus Marek Vasut
2010-10-09 22:39 ` [PATCH 10/13] ARM: pxa: Correct touch IRQ passing to UCB1400 on vpac270 Marek Vasut
2010-10-09 22:39 ` [PATCH 11/13] ARM: pxa: Pass GPIO offset to ucb1400-gpio on PalmTC Marek Vasut
2010-10-09 22:39 ` [PATCH 12/13] ARM: pxa: Add gpio-leds and vibrator support to PalmTC Marek Vasut
2010-10-10  0:34   ` Haojian Zhuang
2010-10-10  2:04     ` Marek Vasut
2010-10-09 22:39 ` [PATCH 13/13] ARM: pxa: Fix pxa2xx-flash section mismatch Marek Vasut
2010-10-10  0:32   ` Haojian Zhuang
2010-10-10  2:05     ` Marek Vasut
2010-10-10  7:38 ` [PATCH 01/13] ARM: pxa: Introduce pxa[23]xx_map_io Igor Grinberg
2010-10-10 18:16   ` Marek Vasut

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=201010100403.22064.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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: 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;
as well as URLs for NNTP newsgroup(s).