From: Florian Fainelli <f.fainelli@gmail.com>
To: Mark Brown <broonie@kernel.org>,
Ralf Baechle <ralf@linux-mips.org>,
Kevin Cernekee <cernekee@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
Johannes Berg <johannes@sipsolutions.net>,
Simon Arlott <simon@fire.lp0.eu>, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH RFC 2/2] MIPS: dt: Explicitly specify native endian behaviour for syscon
Date: Tue, 26 Jan 2016 15:16:15 -0800 [thread overview]
Message-ID: <56A7FE3F.5090909@gmail.com> (raw)
In-Reply-To: <1453848410-24949-2-git-send-email-broonie@kernel.org>
On 26/01/16 14:46, Mark Brown wrote:
> On many MIPS systems the endianness of IP blocks is kept the same as
> that of the CPU by the hardware. This includes the system controllers
> on these systems which are controlled via syscon which uses the regmap
> API which used readl() and writel() to interact with the hardware,
> meaning that all writes are converted to little endian when writing to
> the hardware. This caused a bad interaction with the regmap core in big
> endian mode since it was not aware of the byte swapping and so ended up
> performing little endian writes.
>
> Unfortunately when this issue was noticed it was addressed by updating
> the DT for the affected devices to specify them as little endian. This
> happened to work since it resulted in two endianness swaps which
> cancelled each other out and gave little endian behaviour but meant that
> the DT was clearly not accurately describing the hardware.
>
> The intention of commit 29bb45f25ff305 (regmap-mmio: Use native
> endianness for read/write) was to fix this by making regmap default to
> native endianness but this breaks most other MMIO users where the
> hardware has a fixed endianness and the implementation uses the __raw
> accessors which are not intended to be used outside of architecture
> code. Instead use the newly added native-endian DT property to say
> exactly what we want for these systems.
>
> Fixes: 29bb45f25ff305 (regmap-mmio: Use native endianness for read/write)
> Reported-by: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>
> Posted for review only, this will interact with some other patches
> fixing the implementation of regmap-mmio and will probably need to be
> merged along with them.
>
> arch/mips/boot/dts/brcm/bcm6328.dtsi | 1 +
v4.5-rc1 now contains an arch/mips/boot/dts/brcm/bcm6368.dtsi which
copied the 6328.dtsi and therefore needs this hunk to be added to your
patch series:
diff --git a/arch/mips/boot/dts/brcm/bcm6368.dtsi
b/arch/mips/boot/dts/brcm/bcm6368.dtsi
index 9c8d3fe28b31..1f6b9b5cddb4 100644
--- a/arch/mips/boot/dts/brcm/bcm6368.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm6368.dtsi
@@ -54,7 +54,7 @@
periph_cntl: syscon@10000000 {
compatible = "syscon";
reg = <0x10000000 0x14>;
- little-endian;
+ native-endian;
};
reboot: syscon-reboot@10000008 {
--
Florian
next prev parent reply other threads:[~2016-01-26 23:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-26 22:46 [PATCH 1/2] regmap: Add explict native endian flag to DT bindings Mark Brown
2016-01-26 22:46 ` [PATCH RFC 2/2] MIPS: dt: Explicitly specify native endian behaviour for syscon Mark Brown
2016-01-26 23:16 ` Florian Fainelli [this message]
2016-01-27 9:37 ` Ralf Baechle
2016-01-27 10:33 ` Jonas Gorski
2016-01-27 10:45 ` Johannes Berg
2016-01-27 11:10 ` Mark Brown
2016-01-27 18:51 ` Mark Brown
2016-01-27 11:02 ` [PATCH 1/2] regmap: Add explict native endian flag to DT bindings Arnd Bergmann
2016-01-27 12:19 ` Mark Brown
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=56A7FE3F.5090909@gmail.com \
--to=f.fainelli@gmail.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=cernekee@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=simon@fire.lp0.eu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.