[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5197da248c48434495eddebae9276072@BN1PR03MB220.namprd03.prod.outlook.com>
Date: Wed, 25 Jun 2014 09:55:10 +0000
From: "bhupesh.sharma@...escale.com" <bhupesh.sharma@...escale.com>
To: David Laight <David.Laight@...LAB.COM>,
"mkl@...gutronix.de" <mkl@...gutronix.de>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>
CC: "wg@...ndegger.com" <wg@...ndegger.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH] net: can: Remodel FlexCAN register read/write APIs for BE
instances
> -----Original Message-----
> From: David Laight [mailto:David.Laight@...LAB.COM]
> Sent: Wednesday, June 25, 2014 2:28 PM
> To: Sharma Bhupesh-B45370; mkl@...gutronix.de; linux-can@...r.kernel.org
> Cc: wg@...ndegger.com; netdev@...r.kernel.org
> Subject: RE: [PATCH] net: can: Remodel FlexCAN register read/write APIs
> for BE instances
>
> From: Bhupesh Sharma
> > The FlexCAN IP on certain SoCs like (Freescale's LS1021A) is modelled
> > in a big-endian fashion, i.e. the registers and the message buffers
> > are organized in a BE way.
> >
> > More details about the LS1021A SoC can be seen here:
> > http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=LS1021A
> > &nodeId=018rH325E4017B#
> >
> > This patch ensures that the register read/write APIs are remodelled to
> > address such cases, while ensuring that existing platforms (where the
> > FlexCAN IP was modelled in LE way) do not break.
> ...
> Munged to the new code....
> > +static inline u32 flexcan_read(const struct flexcan_priv *priv,
> > + void __iomem *addr)
> > {
> > + if (priv->devtype_data->module_is_big_endian)
> > + return ioread32be(addr);
> > + else
> > + return ioread32(addr);
> > }
> >
> > +static inline void flexcan_write(const struct flexcan_priv *priv,
> > + u32 val, void __iomem *addr)
> > {
> > + if (priv->devtype_data->module_is_big_endian)
> > + iowrite32be(val, addr);
> > + else
> > + iowrite32(val, addr);
> > }
>
> Hmmm....
> If performance ever matters that is horrid.
> Probably to the point where making the functions 'inline' is just code
> bloat.
>
Got the point. See my reply already sent to Marc's review comments.
Regards,
Bhupesh
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists