linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: f.fainelli@gmail.com (Florian Fainelli)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/9] bus: brcmstb_gisb: Honor the "big-endian" and "native-endian" DT properties
Date: Mon, 09 Feb 2015 13:59:42 -0800	[thread overview]
Message-ID: <54D92DCE.8090100@gmail.com> (raw)
In-Reply-To: <1416962994-27095-9-git-send-email-cernekee@gmail.com>

On 25/11/14 16:49, Kevin Cernekee wrote:
> On chips strapped for BE, we'll need to use ioread32be/iowrite32be instead of
> ioread32/iowrite32.

Has of_device_is_big_endian() been merged in a tree now, I am not seeing
it in Linus' tree, but have not look at Grant's tree yet. Thanks

> 
> Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
> ---
>  drivers/bus/brcmstb_gisb.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
> index 172908d..969b992 100644
> --- a/drivers/bus/brcmstb_gisb.c
> +++ b/drivers/bus/brcmstb_gisb.c
> @@ -90,6 +90,7 @@ static const int gisb_offsets_bcm7445[] = {
>  struct brcmstb_gisb_arb_device {
>  	void __iomem	*base;
>  	const int	*gisb_offsets;
> +	bool		big_endian;
>  	struct mutex	lock;
>  	struct list_head next;
>  	u32 valid_mask;
> @@ -106,7 +107,10 @@ static u32 gisb_read(struct brcmstb_gisb_arb_device *gdev, int reg)
>  	if (offset == -1)
>  		return 1;
>  
> -	return ioread32(gdev->base + offset);
> +	if (gdev->big_endian)
> +		return ioread32be(gdev->base + offset);
> +	else
> +		return ioread32(gdev->base + offset);
>  }
>  
>  static void gisb_write(struct brcmstb_gisb_arb_device *gdev, u32 val, int reg)
> @@ -115,7 +119,11 @@ static void gisb_write(struct brcmstb_gisb_arb_device *gdev, u32 val, int reg)
>  
>  	if (offset == -1)
>  		return;
> -	iowrite32(val, gdev->base + reg);
> +
> +	if (gdev->big_endian)
> +		iowrite32be(val, gdev->base + reg);
> +	else
> +		iowrite32(val, gdev->base + reg);
>  }
>  
>  static ssize_t gisb_arb_get_timeout(struct device *dev,
> @@ -300,6 +308,7 @@ static int brcmstb_gisb_arb_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  	}
>  	gdev->gisb_offsets = of_id->data;
> +	gdev->big_endian = of_device_is_big_endian(dn);
>  
>  	err = devm_request_irq(&pdev->dev, timeout_irq,
>  				brcmstb_gisb_timeout_handler, 0, pdev->name,
> 


-- 
Florian

  reply	other threads:[~2015-02-09 21:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26  0:49 [PATCH 0/9] Extend various drivers to run on bi-endian BMIPS hosts Kevin Cernekee
2014-11-26  0:49 ` [PATCH 1/9] power/reset: brcmstb: Make the driver buildable on MIPS Kevin Cernekee
2015-01-22  1:46   ` Sebastian Reichel
2014-11-26  0:49 ` [PATCH 2/9] power/reset: brcmstb: Use the DT "compatible" string to indicate bit positions Kevin Cernekee
2015-01-22  1:46   ` Sebastian Reichel
2014-11-26  0:49 ` [PATCH 3/9] power/reset: brcmstb: Add support for old 65nm chips Kevin Cernekee
2015-01-22  1:47   ` Sebastian Reichel
2014-11-26  0:49 ` [PATCH 4/9] bus: brcmstb_gisb: Make the driver buildable on MIPS Kevin Cernekee
2014-11-26  0:49 ` [PATCH 5/9] bus: brcmstb_gisb: Introduce wrapper functions for MMIO accesses Kevin Cernekee
2014-11-26  0:49 ` [PATCH 6/9] bus: brcmstb_gisb: Look up register offsets in a table Kevin Cernekee
2014-11-26  0:49 ` [PATCH 7/9] bus: brcmstb_gisb: Add register offset tables for older chips Kevin Cernekee
2014-11-26  0:49 ` [PATCH 8/9] bus: brcmstb_gisb: Honor the "big-endian" and "native-endian" DT properties Kevin Cernekee
2015-02-09 21:59   ` Florian Fainelli [this message]
2015-05-29  4:01   ` Florian Fainelli
2014-11-26  0:49 ` [PATCH 9/9] usb: {ohci, ehci}-platform: Use new OF big-endian helper function Kevin Cernekee
2014-11-26  4:15   ` [PATCH 9/9] usb: {ohci,ehci}-platform: " Tony Prisk
2014-11-26 15:14   ` Alan Stern
2014-11-26 16:07     ` Kevin Cernekee
2014-11-26 16:24       ` Alan Stern
2014-11-26  5:33 ` [PATCH 0/9] Extend various drivers to run on bi-endian BMIPS hosts Florian Fainelli

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=54D92DCE.8090100@gmail.com \
    --to=f.fainelli@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).