linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: Timur Tabi <timur@tabi.org>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/512x: add function for CS parameter configuration
Date: Sat, 2 Feb 2013 13:02:01 +0100	[thread overview]
Message-ID: <20130202130201.204ee2fd@crub> (raw)
In-Reply-To: <CAOZdJXUfe5KWBtabUUPrGHhcFb6dbnPNJCsU23yoxb-4GeKQsg@mail.gmail.com>

On Fri, 1 Feb 2013 22:31:51 -0600
Timur Tabi <timur@tabi.org> wrote:

> On Fri, Feb 1, 2013 at 7:28 AM, Anatolij Gustschin <agust@denx.de> wrote:
> > Add ability to configure CS parameters for devices that need
> > different CS parameters setup after their configuration. I.e.
> > an FPGA device on LP bus can require different CS parameters
> > for its bus interface after loading firmware into it. A driver
> > can easily reconfigure the LPC CS parameters using this function.
> 
> Could you define "CS" somewhere?

I'll define it in revised commit log in v2.

> > +struct mpc512x_lpc {
> > +       u32     cs_cfg[8];      /* CS config */
> > +       u32     cs_ctrl;        /* CS Control Register */
> > +       u32     cs_status;      /* CS Status Register */
> > +       u32     burst_ctrl;     /* CS Burst Control Register */
> > +       u32     deadcycle_ctrl; /* CS Deadcycle Control Register */
> > +       u32     holdcycle_ctrl; /* CS Holdcycle Control Register */
> > +       u32     alt;            /* Address Latch Timing Register */
> > +};
> 
> These should be __be32.

Why? To add a new bunch of sparse warnings?

...
> > +       if (cs < 0 || cs > 7)
> > +               return -EINVAL;
> 
> If you make cs an unsigned int, you won't need to test for < 0.

can do that, yes.

> > +
> > +       if (!lpc) {
> > +               np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-lpc");
> > +               lpc = of_iomap(np, 0);
> > +               of_node_put(np);
> > +               if (!lpc)
> > +                       return -ENOMEM;
> > +       }
> > +
> > +       out_be32(&lpc->cs_cfg[cs], val);
> 
> You forgot the iounmap() if lpc == NULL.

No, it is intentional, no need to map/unmap again and again for all
subsequent calls.


> > +       return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(mpc512x_cs_config);
> 
> EXPORT_SYMBOL, please, to match the rest of the Freescale platforms.

I'll change it in v2. Thanks!

Anatolij

  reply	other threads:[~2013-02-02 12:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 13:28 [PATCH] powerpc/512x: add function for CS parameter configuration Anatolij Gustschin
2013-02-02  4:31 ` Timur Tabi
2013-02-02 12:02   ` Anatolij Gustschin [this message]
2013-02-02 12:31     ` Timur Tabi
2013-02-04 10:16 ` [PATCH v2] powerpc/512x: add function for chip select " Anatolij Gustschin
2013-02-04 21:22   ` Timur Tabi

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=20130202130201.204ee2fd@crub \
    --to=agust@denx.de \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=timur@tabi.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).