linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Horia Geantă" <horia.geanta@freescale.com>
To: Scott Wood <scottwood@freescale.com>,
	Roy Pledge <roy.pledge@freescale.com>
Cc: <linuxppc-dev@lists.ozlabs.org>,
	Victoria Milhoan <Vicki.Milhoan@freescale.com>
Subject: Re: [PATCH 02/11] soc/fsl: Introduce DPAA BMan device management driver
Date: Wed, 22 Jul 2015 19:15:20 +0300	[thread overview]
Message-ID: <55AFC198.1070501@freescale.com> (raw)
In-Reply-To: <1436554227.2658.161.camel@freescale.com>

On 7/10/2015 9:50 PM, scottwood at freescale.com (Scott Wood) wrote:
> On Fri, 2015-07-10 at 13:29 -0500, Pledge Roy-R01356 wrote:
>>>   return in_be32((void *)bm + offset);
>>>>          ^
>>>> [...]/drivers/soc/fsl/qbman/bman.c: In function ‘__bm_out’:
>>>> [...]/drivers/soc/fsl/qbman/bman.c:172:2: error: implicit declaration
>>>> of function ‘out_be32’ [-Werror=implicit-function-declaration]
>>>>   out_be32((void *)bm + offset, val);
>>>
>>> These PPCisms will need to be fixed.  LS1043A is an ARM chip with DPAA 
>>> 1.0.
>>
>> LS1043 (ARM, Little Endian) support is still work in progress.  The patches 
>> for that are being tested now but are based on the SDK version of the 
>> driver and will need to be massaged in order to get them applied here.  Our 
>> plan of record is to add upstream support for this at a later time.
> 
> If you're already reworking this for upstream acceptance, why not fix the 
> more obvious PPCisms now?

Other drivers are facing similar problems wrt. I/O accessors.
How should the problem be solved?

For caam driver (drivers/crypto/caam) we have the following combinations:
ARCH	CORE	CAAM		SoC, options
PPC	BIG	BIG		P4080 etc.
PPC	BIG	LITTLE		N/A
PPC	LITTLE	BIG		P4080 + CONFIG_CPU_LITTLE_ENDIAN
PPC	LITTLE	LITTLE		N/A
ARM	LITTLE	LITTLE		LS1021A, LS2085A etc.
ARM	LITTLE	BIG		LS1043A
ARM	BIG 	LITTLE		LS1021A + CONFIG_CPU_BIG_ENDIAN
ARM	BIG	BIG		LS1043A + CONFIG_CPU_BIG_ENDIAN

Not all need to be supported, but for e.g. we are being requested to run
on ARM in BE mode.

Existing MMIO accessors have one of the following drawbacks:
-readl/writel: on ARM do swapping (cpu <--> le), while on PPC are
bus-specific (for PCI)
-have weak semantics (no barriers / sequence points etc.), like __raw_*

Thus, it looks like drivers have to define their own MMIO accessors,
taking into account:
-core endianness (which is independent of arch)
-device endianness
-already-defined MMIO accessors availability, depending on arch
-semantics will have to match

Unfortunately, the code will look terrible. In each driver.

Thanks,
Horia

P.S. Sorry if the To/Cc list is screwed up, I've taken the message from
the archive.

  reply	other threads:[~2015-07-22 16:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 20:21 [PATCH 00/11] Freescale DPAA QBMan Drivers Roy Pledge
2015-07-09 20:21 ` [PATCH 01/11] powerpc: re-add devm_ioremap_prot() Roy Pledge
2015-07-09 20:21 ` [PATCH 02/11] soc/fsl: Introduce DPAA BMan device management driver Roy Pledge
2015-07-10  8:38   ` Paul Bolle
2015-07-10 17:31     ` Scott Wood
2015-07-10 18:29       ` Roy Pledge
2015-07-10 18:50         ` Scott Wood
2015-07-22 16:15           ` Horia Geantă [this message]
2015-07-10 11:36   ` Paul Bolle
2015-07-10 17:33     ` Scott Wood
2015-07-10 20:57       ` Roy Pledge
2015-07-10 21:12         ` Scott Wood
2015-07-09 20:21 ` [PATCH 03/11] soc/fsl: Introduce the DPAA BMan portal driver Roy Pledge
2015-07-10 13:32   ` Paul Bolle
2015-07-10 15:19     ` Roy Pledge
2015-07-10 16:47       ` Paul Bolle
2015-07-09 20:21 ` [PATCH 04/11] soc/fsl: Introduce drivers for the DPAA QMan Roy Pledge
2015-07-11 10:34   ` Paul Bolle
2015-07-09 20:21 ` [PATCH 05/11] soc/bman: Add self-tester for BMan driver Roy Pledge
2015-07-09 20:21 ` [PATCH 06/11] soc/qman: Add self-tester for QMan driver Roy Pledge
2015-07-09 20:21 ` [PATCH 07/11] soc/bman: Add debugfs support for the BMan driver Roy Pledge
2015-07-09 20:21 ` [PATCH 08/11] soc/qman: Add debugfs support for the QMan driver Roy Pledge
2015-07-09 20:22 ` [PATCH 09/11] soc/bman: Add HOTPLUG_CPU support to the BMan driver Roy Pledge
2015-07-09 20:22 ` [PATCH 10/11] soc/qman: Add HOTPLUG_CPU support to the QMan driver Roy Pledge
2015-07-09 20:22 ` [PATCH 11/11] soc/qman: add qman_delete_cgr_safe() Roy Pledge

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=55AFC198.1070501@freescale.com \
    --to=horia.geanta@freescale.com \
    --cc=Vicki.Milhoan@freescale.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=roy.pledge@freescale.com \
    --cc=scottwood@freescale.com \
    /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).