From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752312AbcAZXRN (ORCPT ); Tue, 26 Jan 2016 18:17:13 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:36043 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbcAZXRK (ORCPT ); Tue, 26 Jan 2016 18:17:10 -0500 Message-ID: <56A7FE3F.5090909@gmail.com> Date: Tue, 26 Jan 2016 15:16:15 -0800 From: Florian Fainelli User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Mark Brown , Ralf Baechle , Kevin Cernekee CC: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Johannes Berg , Simon Arlott , Arnd Bergmann Subject: Re: [PATCH RFC 2/2] MIPS: dt: Explicitly specify native endian behaviour for syscon References: <1453848410-24949-1-git-send-email-broonie@kernel.org> <1453848410-24949-2-git-send-email-broonie@kernel.org> In-Reply-To: <1453848410-24949-2-git-send-email-broonie@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.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 > Signed-off-by: Mark Brown > --- > > 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