From: Yangbo Lu <yangbo.lu@nxp.com> Date: 2016-03-09 10:18:15
This patchset is used to fix a host version register bug in the T4240-R1.0-R2.0
eSDHC controller. To get the SoC version and revision, it's needed to add the
GUTS driver to access the global utilities registers.
So, the first three patches are to add the GUTS driver.
The following two patches are to enable GUTS driver support to get SVR in eSDHC
driver and fix host version for T4240.
Yangbo Lu (5):
ARM64: dts: ls2080a: add device configuration node
soc: fsl: add GUTS driver for QorIQ platforms
dt: move guts devicetree doc out of powerpc directory
powerpc/fsl: move mpc85xx.h to include/linux/fsl
mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0
.../bindings/{powerpc => soc}/fsl/guts.txt | 3 +
arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi | 6 ++
drivers/clk/clk-qoriq.c | 3 +-
drivers/i2c/busses/i2c-mpc.c | 2 +-
drivers/iommu/fsl_pamu.c | 3 +-
drivers/mmc/host/Kconfig | 1 +
drivers/mmc/host/sdhci-of-esdhc.c | 23 ++++
drivers/net/ethernet/freescale/gianfar.c | 2 +-
drivers/soc/Kconfig | 2 +-
drivers/soc/fsl/Kconfig | 8 ++
drivers/soc/fsl/Makefile | 1 +
drivers/soc/fsl/guts.c | 119 +++++++++++++++++++++
include/linux/fsl/guts.h | 100 ++++++++---------
.../asm/mpc85xx.h => include/linux/fsl/svr.h | 4 +-
14 files changed, 220 insertions(+), 57 deletions(-)
rename Documentation/devicetree/bindings/{powerpc => soc}/fsl/guts.txt (91%)
create mode 100644 drivers/soc/fsl/Kconfig
create mode 100644 drivers/soc/fsl/guts.c
rename arch/powerpc/include/asm/mpc85xx.h => include/linux/fsl/svr.h (97%)
--
2.1.0.27.g96db324
@@ -2,7 +2,7 @@ menu "SOC (System On Chip) specific Drivers"source"drivers/soc/bcm/Kconfig"source"drivers/soc/brcmstb/Kconfig"-source"drivers/soc/fsl/qe/Kconfig"+source"drivers/soc/fsl/Kconfig"source"drivers/soc/mediatek/Kconfig"source"drivers/soc/qcom/Kconfig"source"drivers/soc/rockchip/Kconfig"
@@ -0,0 +1,119 @@+/*+*FreescaleQorIQPlatformsGUTSDriver+*+*Copyright(C)2016FreescaleSemiconductor,Inc.+*+*Thisprogramisfreesoftware;youcanredistributeitand/ormodify+*itunderthetermsoftheGNUGeneralPublicLicenseaspublishedby+*theFreeSoftwareFoundation;eitherversion2oftheLicense,or+*(atyouroption)anylaterversion.+*/++#include<linux/io.h>+#include<linux/module.h>+#include<linux/slab.h>+#include<linux/mutex.h>+#include<linux/of_address.h>+#include<linux/of_platform.h>+#include<linux/fsl/guts.h>++structguts{+structccsr_guts__iomem*regs;+boollittle_endian;+};++staticstructguts*guts;+staticDEFINE_MUTEX(guts_lock);++u32fsl_guts_get_svr(void)+{+u32svr=0;++if(!guts||!guts->regs){+#ifdef CONFIG_PPC+svr=mfspr(SPRN_SVR);+#endif+returnsvr;+}++if(guts->little_endian)+svr=ioread32(&guts->regs->svr);+else+svr=ioread32be(&guts->regs->svr);++returnsvr;+}+EXPORT_SYMBOL(fsl_guts_get_svr);++/*+*Tableformatchingcompatiblestrings,fordevicetree+*gutsnode,forFreescaleQorIQSOCs.+*/+staticconststructof_device_idguts_of_match[]={+/* For T4 & B4 Series SOCs */+{.compatible="fsl,qoriq-device-config-1.0",},+/* For P Series SOCs */+{.compatible="fsl,qoriq-device-config-2.0",},+{.compatible="fsl,p1010-guts",},+{.compatible="fsl,p1020-guts",},+{.compatible="fsl,p1021-guts",},+{.compatible="fsl,p1022-guts",},+{.compatible="fsl,p1023-guts",},+{.compatible="fsl,p2020-guts",},+/* For BSC Series SOCs */+{.compatible="fsl,bsc9131-guts",},+{.compatible="fsl,bsc9132-guts",},+/* For MPC85xx Series SOCs */+{.compatible="fsl,mpc8536-guts",},+{.compatible="fsl,mpc8544-guts",},+{.compatible="fsl,mpc8548-guts",},+{.compatible="fsl,mpc8568-guts",},+{.compatible="fsl,mpc8569-guts",},+{.compatible="fsl,mpc8572-guts",},+/* For Layerscape Series SOCs */+{.compatible="fsl,ls1021a-dcfg",},+{.compatible="fsl,ls1043a-dcfg",},+{.compatible="fsl,ls2080a-dcfg",},+{}+};++intfsl_guts_init(void)+{+structdevice_node*np;+intret;++mutex_lock(&guts_lock);+/* Initialize guts only once */+if(guts){+ret=guts->regs?0:-ENOMEM;+gotoout;+}++np=of_find_matching_node(NULL,guts_of_match);+if(!np){+ret=-ENODEV;+gotoout;+}++guts=kzalloc(sizeof(*guts),GFP_KERNEL);+if(!guts){+ret=-ENOMEM;+gotoout;+}++guts->little_endian=of_property_read_bool(np,"little-endian");++guts->regs=of_iomap(np,0);+if(!guts->regs){+ret=-ENOMEM;+kfree(guts);+gotoout;+}++of_node_put(np);+ret=0;+out:+mutex_unlock(&guts_lock);+returnret;+}+EXPORT_SYMBOL(fsl_guts_init);
From: Yangbo Lu <yangbo.lu@nxp.com> Date: 2016-03-09 10:34:09
The eSDHC of T4240-R1.0-R2.0 has incorrect vender version and spec version.
Acturally the right version numbers should be VVN=0x13 and SVN = 0x1.
This patch adds the GUTS driver support for eSDHC driver to get SVR(System
version register). And fix host version to avoid that incorrect version
numbers break down the ADMA data transfer.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Acked-by: Ulf Hansson <redacted>
---
Changes for v2:
- Got SVR through iomap instead of dts
Changes for v3:
- Managed GUTS through syscon instead of iomap in eSDHC driver
Changes for v4:
- Got SVR by GUTS driver instead of SYSCON
Changes for v5:
- Changed to get SVR through API fsl_guts_get_svr()
- Combined patch 4, patch 5 and patch 6 into one
Changes for v6:
- Added 'Acked-by: Ulf Hansson'
---
drivers/mmc/host/Kconfig | 1 +
drivers/mmc/host/sdhci-of-esdhc.c | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+)
From: Yangbo Lu <yangbo.lu@nxp.com> Date: 2016-03-09 10:34:28
Move guts devicetree doc to Documentation/devicetree/bindings/soc/fsl/
since it's used by not only PowerPC but also ARM. And add a specification
for 'little-endian' property.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
- None
Changes for v3:
- None
Changes for v4:
- Added this patch
Changes for v5:
- Modified the description for little-endian property
Changes for v6:
- None
---
Documentation/devicetree/bindings/{powerpc => soc}/fsl/guts.txt | 3 +++
1 file changed, 3 insertions(+)
rename Documentation/devicetree/bindings/{powerpc => soc}/fsl/guts.txt (91%)
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt b/Documentation/devicetree/bindings/soc/fsl/guts.txtsimilarity index 91%rename from Documentation/devicetree/bindings/powerpc/fsl/guts.txtrename to Documentation/devicetree/bindings/soc/fsl/guts.txtindex b71b203..07adca9 100644--- a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt+++ b/Documentation/devicetree/bindings/soc/fsl/guts.txt
@@ -25,6 +25,9 @@ Recommended properties: - fsl,liodn-bits : Indicates the number of defined bits in the LIODN registers, for those SOCs that have a PAMU device.+ - little-endian : Indicates that the global utilities block is little+ endian. The default is big endian.+ Examples: global-utilities@e0000 { /* global utilities block */ compatible = "fsl,mpc8548-guts";
From: Yangbo Lu <yangbo.lu@nxp.com> Date: 2016-03-09 10:50:56
Add the dts node for device configuration unit that provides
general purpose configuration and status for the device.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
- None
Changes for v3:
- None
Changes for v4:
- None
Changes for v5:
- Added this patch
Changes for v6:
- None
---
arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
From: Yangbo Lu <yangbo.lu@nxp.com> Date: 2016-03-09 10:52:09
Move mpc85xx.h to include/linux/fsl and rename it to svr.h as
a common header file. It has been used for mpc85xx and it will
be used for ARM-based SoC as well.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
- None
Changes for v3:
- None
Changes for v4:
- None
Changes for v5:
- Changed to Move mpc85xx.h to include/linux/fsl/
- Adjusted '#include <linux/fsl/svr.h>' position in file
Changes for v6:
- None
---
drivers/clk/clk-qoriq.c | 3 +--
drivers/i2c/busses/i2c-mpc.c | 2 +-
drivers/iommu/fsl_pamu.c | 3 +--
drivers/net/ethernet/freescale/gianfar.c | 2 +-
arch/powerpc/include/asm/mpc85xx.h => include/linux/fsl/svr.h | 4 ++--
5 files changed, 6 insertions(+), 8 deletions(-)
rename arch/powerpc/include/asm/mpc85xx.h => include/linux/fsl/svr.h (97%)
diff --git a/arch/powerpc/include/asm/mpc85xx.h b/include/linux/fsl/svr.hsimilarity index 97%rename from arch/powerpc/include/asm/mpc85xx.hrename to include/linux/fsl/svr.hindex 213f3a8..8d13836 100644--- a/arch/powerpc/include/asm/mpc85xx.h+++ b/include/linux/fsl/svr.h
From: Wolfram Sang <hidden> Date: 2016-03-12 15:53:06
On Wed, Mar 09, 2016 at 06:08:50PM +0800, Yangbo Lu wrote:
Move mpc85xx.h to include/linux/fsl and rename it to svr.h as
a common header file. It has been used for mpc85xx and it will
be used for ARM-based SoC as well.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
From a glimpse, looks like proper refactoring. Thanks!
For the I2C part:
Acked-by: Wolfram Sang <redacted>
This makes the driver non-portable. Better identify the specific workarounds
based on the compatible string for this device, or add a boolean DT property
for the quirk.
Arnd
=20
This makes the driver non-portable. Better identify the specific
workarounds based on the compatible string for this device, or add a
boolean DT property for the quirk.
=20
Arnd
[Lu Yangbo-B47093] Hi Arnd, we did have a discussion about using DTS in v1 =
before.
https://patchwork.kernel.org/patch/6834221/
We don't have a separate DTS file for each revision of an SOC and if we did=
, we'd constantly have people using the wrong one.
In addition, the device tree is stable ABI and errata are often discovered =
after device tree are deployed.
See the link for details.
So we decide to read SVR from the device-config/guts MMIO block other than =
using DTS.
Thanks.
=0A=
This makes the driver non-portable. Better identify the specific=0A=
workarounds based on the compatible string for this device, or add a=0A=
boolean DT property for the quirk.=0A=
=0A=
Arnd=0A=
=0A=
[Lu Yangbo-B47093] Hi Arnd, we did have a discussion about using DTS in v=
did, we'd constantly have people using the wrong one.=0A=
In addition, the device tree is stable ABI and errata are often discovere=
d after device tree are deployed.=0A=
See the link for details.=0A=
=0A=
So we decide to read SVR from the device-config/guts MMIO block other tha=
n using DTS.=0A=
Thanks.=0A=
=0A=
Also note that this driver is already only for fsl-specific hardware,=0A=
and it will still work even if fsl_guts doesn't find anything to bind to=0A=
-- it just wouldn't be able to detect errata based on SVR in that case.=0A=
=0A=
-Scott=0A=
=0A=
This makes the driver non-portable. Better identify the specific
workarounds based on the compatible string for this device, or add a
boolean DT property for the quirk.
Arnd
[Lu Yangbo-B47093] Hi Arnd, we did have a discussion about using DTS in v1 before.
https://patchwork.kernel.org/patch/6834221/
We don’t have a separate DTS file for each revision of an SOC and if we did, we'd constantly have people using the wrong one.
In addition, the device tree is stable ABI and errata are often discovered after device tree are deployed.
See the link for details.
So we decide to read SVR from the device-config/guts MMIO block other than using DTS.
Thanks.
Also note that this driver is already only for fsl-specific hardware,
and it will still work even if fsl_guts doesn't find anything to bind to
-- it just wouldn't be able to detect errata based on SVR in that case.
IIRC, it is the same IP block as i.MX and Arnd's point is this won't
even compile on !PPC. It is things like this that prevent sharing the
driver. Dealing with Si revs is a common problem. We should have a
common solution. There is soc_device for this purpose.
OTOH, the integration differences may be enough that trying to have a
common driver with i.MX would not be worth it.
Rob
From: Rob Herring <robh@kernel.org> Date: 2016-03-17 17:06:49
On Wed, Mar 09, 2016 at 06:08:49PM +0800, Yangbo Lu wrote:
quoted hunk
Move guts devicetree doc to Documentation/devicetree/bindings/soc/fsl/
since it's used by not only PowerPC but also ARM. And add a specification
for 'little-endian' property.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
- None
Changes for v3:
- None
Changes for v4:
- Added this patch
Changes for v5:
- Modified the description for little-endian property
Changes for v6:
- None
---
Documentation/devicetree/bindings/{powerpc => soc}/fsl/guts.txt | 3 +++
1 file changed, 3 insertions(+)
rename Documentation/devicetree/bindings/{powerpc => soc}/fsl/guts.txt (91%)
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt b/Documentation/devicetree/bindings/soc/fsl/guts.txtsimilarity index 91%rename from Documentation/devicetree/bindings/powerpc/fsl/guts.txtrename to Documentation/devicetree/bindings/soc/fsl/guts.txtindex b71b203..07adca9 100644--- a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt+++ b/Documentation/devicetree/bindings/soc/fsl/guts.txt
@@ -25,6 +25,9 @@ Recommended properties: - fsl,liodn-bits : Indicates the number of defined bits in the LIODN registers, for those SOCs that have a PAMU device.+ - little-endian : Indicates that the global utilities block is little+ endian. The default is big endian.
The default is "the native endianness of the system". So absence on an
ARM system would be LE. This property is valid for any simple-bus
device, so it isn't really required to document per device. You can, but
your description had better match the documented behaviour.
Rob
SOC and if we did, we'd constantly have people using the wrong one.
quoted
quoted
In addition, the device tree is stable ABI and errata are often d=
iscovered after device tree are deployed.
quoted
quoted
See the link for details.
=20
So we decide to read SVR from the device-config/guts MMIO block o=
ther than using DTS.
quoted
quoted
Thanks.
=20
Also note that this driver is already only for fsl-specific hardwar=
e,
quoted
and it will still work even if fsl_guts doesn't find anything to bi=
nd to
quoted
-- it just wouldn't be able to detect errata based on SVR in that c=
ase.
=20
IIRC, it is the same IP block as i.MX and Arnd's point is this won't=20=
even compile on !PPC. It is things like this that prevent sharing the=
=20
driver.
I think the first four patches take care of building for ARM,
but the problem remains if you want to enable COMPILE_TEST as
we need for certain automated checking.
Dealing with Si revs is a common problem. We should have a=20
common solution. There is soc_device for this purpose.
Exactly. The last time this came up, I think we agreed to implement a
helper using glob_match() on the soc_device strings. Unfortunately
this hasn't happened then, but I'd still prefer that over yet another
vendor-specific way of dealing with the generic issue.
=09Arnd
On Thursday 17 March 2016 12:06:40 Rob Herring wrote:
quoted
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt b/Documentation/devicetree/bindings/soc/fsl/guts.txtsimilarity index 91%rename from Documentation/devicetree/bindings/powerpc/fsl/guts.txtrename to Documentation/devicetree/bindings/soc/fsl/guts.txtindex b71b203..07adca9 100644--- a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt+++ b/Documentation/devicetree/bindings/soc/fsl/guts.txt
@@ -25,6 +25,9 @@ Recommended properties: - fsl,liodn-bits : Indicates the number of defined bits in the LIODN registers, for those SOCs that have a PAMU device.+ - little-endian : Indicates that the global utilities block is little+ endian. The default is big endian.
The default is "the native endianness of the system".
This may be what is currently documented, but not what we are doing
in practice, as there is no "native endianess" for either PowerPC or
ARM -- both allow running big-endian or little-endian kernels and the
device registers are fixed.
I think the property here is fine.
Arnd
From: Rob Herring <robh@kernel.org> Date: 2016-03-17 17:58:16
On Thu, Mar 17, 2016 at 12:11 PM, Arnd Bergmann [off-list ref] wrote:
On Thursday 17 March 2016 12:06:40 Rob Herring wrote:
quoted
quoted
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt b/Documentation/devicetree/bindings/soc/fsl/guts.txtsimilarity index 91%rename from Documentation/devicetree/bindings/powerpc/fsl/guts.txtrename to Documentation/devicetree/bindings/soc/fsl/guts.txtindex b71b203..07adca9 100644--- a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt+++ b/Documentation/devicetree/bindings/soc/fsl/guts.txt
@@ -25,6 +25,9 @@ Recommended properties: - fsl,liodn-bits : Indicates the number of defined bits in the LIODN registers, for those SOCs that have a PAMU device.+ - little-endian : Indicates that the global utilities block is little+ endian. The default is big endian.
The default is "the native endianness of the system".
This may be what is currently documented, but not what we are doing
in practice, as there is no "native endianess" for either PowerPC or
ARM -- both allow running big-endian or little-endian kernels and the
device registers are fixed.
Notice I said system, not architecture. The way the device registers
are fixed is what I mean by native endianness.
If the purpose of adding this property now is to support GUTS on the
ARM SoCs, then I'd argue using this property is probably wrong. If the
PPC systems are designed with BE device registers and ARM systems with
LE, then this property is not needed.
I think the property here is fine.
Unless you have studied the FSL ARM based SoCs, then there is not
enough information here to tell.
Rob
On Thu, Mar 17, 2016 at 12:57 PM, Rob Herring [off-list ref] wrote:
On Thu, Mar 17, 2016 at 12:11 PM, Arnd Bergmann [off-list ref] wrote:
quoted
On Thursday 17 March 2016 12:06:40 Rob Herring wrote:
quoted
quoted
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt b/Documentation/devicetree/bindings/soc/fsl/guts.txtsimilarity index 91%rename from Documentation/devicetree/bindings/powerpc/fsl/guts.txtrename to Documentation/devicetree/bindings/soc/fsl/guts.txtindex b71b203..07adca9 100644--- a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt+++ b/Documentation/devicetree/bindings/soc/fsl/guts.txt
@@ -25,6 +25,9 @@ Recommended properties: - fsl,liodn-bits : Indicates the number of defined bits in the LIODN registers, for those SOCs that have a PAMU device.+ - little-endian : Indicates that the global utilities block is little+ endian. The default is big endian.
The default is "the native endianness of the system".
This may be what is currently documented, but not what we are doing
in practice, as there is no "native endianess" for either PowerPC or
ARM -- both allow running big-endian or little-endian kernels and the
device registers are fixed.
Notice I said system, not architecture. The way the device registers
are fixed is what I mean by native endianness.
I think sometimes it's also hard to define the native endianess of the
system too. For whatever reason, we have hardware that having
big-endian registers on some on-chip devices but using little-endian
registers on other devices. Even if all the devices on certain
hardware use registers of the same endianess, it is also hard for the
device driver to know what the native endianess really is.
If the purpose of adding this property now is to support GUTS on the
ARM SoCs, then I'd argue using this property is probably wrong. If the
PPC systems are designed with BE device registers and ARM systems with
LE, then this property is not needed.
quoted
I think the property here is fine.
Unless you have studied the FSL ARM based SoCs, then there is not
enough information here to tell.
Recent FSL ARM SoCs seems to have more weird endianess issue. :( The
same IP could have registers of different endianess on different ARM
SoCs. That why we need to define the endianess explicitly in device
tree.
Regards,
Leo
From: Scott Wood <hidden> Date: 2016-03-18 18:16:14
On 03/17/2016 12:06 PM, Rob Herring wrote:=0A=
On Wed, Mar 09, 2016 at 06:08:49PM +0800, Yangbo Lu wrote:=0A=
quoted
Move guts devicetree doc to Documentation/devicetree/bindings/soc/fsl/=
=0A=
quoted
since it's used by not only PowerPC but also ARM. And add a specificatio=
n=0A=
quoted
for 'little-endian' property.=0A=
=0A=
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>=0A=
---=0A=
Changes for v2:=0A=
- None=0A=
Changes for v3:=0A=
- None=0A=
Changes for v4:=0A=
- Added this patch=0A=
Changes for v5:=0A=
- Modified the description for little-endian property=0A=
Changes for v6:=0A=
- None=0A=
---=0A=
Documentation/devicetree/bindings/{powerpc =3D> soc}/fsl/guts.txt | 3 +=
similarity index 91%=0A=
rename from Documentation/devicetree/bindings/powerpc/fsl/guts.txt=0A=
rename to Documentation/devicetree/bindings/soc/fsl/guts.txt=0A=
index b71b203..07adca9 100644=0A=
@@ -25,6 +25,9 @@ Recommended properties:=0A= - fsl,liodn-bits : Indicates the number of defined bits in the LIODN=
=0A=
quoted
registers, for those SOCs that have a PAMU device.=0A=
=0A=
+ - little-endian : Indicates that the global utilities block is little=
=0A=
quoted
+ endian. The default is big endian.=0A=
=0A=
The default is "the native endianness of the system". So absence on an =
=0A=
ARM system would be LE.=0A=
=0A=
No. For this binding, the default is big-endian, because that's what=0A=
existed for this device before an endian property was added.=0A=
=0A=
"endianness of the system" is not a well-defined concept.=0A=
=0A=
This property is valid for any simple-bus device, =0A=
=0A=
Since when does simple-bus mean anything more than that the nodes=0A=
underneath it can be used without bus-specific knowledge?=0A=
=0A=
so it isn't really required to document per device. You can, but =0A=
your description had better match the documented behaviour.=0A=
=0A=
Documented where?=0A=
=0A=
In fact, Documentation/devicetree/bindings/common-properties.txt=0A=
explicitly says of the endian properties, "If a binding supports these=0A=
properties, then the binding should also specify the default behavior if=0A=
none of these properties are present."=0A=
=0A=
-Scott=0A=
=0A=
we did, we'd constantly have people using the wrong one.=0A=
quoted
quoted
quoted
In addition, the device tree is stable ABI and errata are often discov=
ered after device tree are deployed.=0A=
quoted
quoted
quoted
See the link for details.=0A=
=0A=
So we decide to read SVR from the device-config/guts MMIO block other =
than using DTS.=0A=
quoted
quoted
quoted
Thanks.=0A=
=0A=
Also note that this driver is already only for fsl-specific hardware,=
=0A=
quoted
quoted
and it will still work even if fsl_guts doesn't find anything to bind t=
o=0A=
quoted
quoted
-- it just wouldn't be able to detect errata based on SVR in that case.=
=0A=
quoted
=0A=
IIRC, it is the same IP block as i.MX and Arnd's point is this won't =0A=
even compile on !PPC. It is things like this that prevent sharing the =
=0A=
quoted
driver.=0A=
=0A=
The whole point of using the MMIO SVR instead of the PPC SPR is so that=0A=
it will work on ARM... The guts driver should build on any platform as=0A=
long as OF is enabled, and if it doesn't find a node to bind to it will=0A=
return 0 for SVR, and the eSDHC driver will continue (after printing an=0A=
error that should be removed) without the ability to test for errata=0A=
based on SVR.=0A=
=0A=
I think the first four patches take care of building for ARM,=0A=
but the problem remains if you want to enable COMPILE_TEST as=0A=
we need for certain automated checking.=0A=
=0A=
What specific problem is there with COMPILE_TEST?=0A=
=0A=
quoted
Dealing with Si revs is a common problem. We should have a =0A=
common solution. There is soc_device for this purpose.=0A=
=0A=
Exactly. The last time this came up, I think we agreed to implement a=0A=
helper using glob_match() on the soc_device strings. Unfortunately=0A=
this hasn't happened then, but I'd still prefer that over yet another=0A=
vendor-specific way of dealing with the generic issue.=0A=
=0A=
soc_device would require encoding the SVR as a string and then decoding=0A=
the string, which is more complicated and error prone than having=0A=
platform-specific code test a platform-specific number. And when would=0A=
it get registered on arm64, which doesn't have platform code?=0A=
=0A=
-Scott=0A=
=0A=
From: Yangbo Lu <yangbo.lu@nxp.com> Date: 2016-03-25 06:43:34
-----Original Message-----
From: Scott Wood
Sent: Saturday, March 19, 2016 2:28 AM
To: Arnd Bergmann; Rob Herring
Cc: Yangbo Lu; linuxppc-dev@lists.ozlabs.org; devicetree@vger.kernel.org;
ulf.hansson@linaro.org; Zhao Qiang; Russell King; Bhupesh Sharma;
netdev@vger.kernel.org; Joerg Roedel; Kumar Gala; linux-
mmc@vger.kernel.org; linux-kernel@vger.kernel.org; Yang-Leo Li;
iommu@lists.linux-foundation.org; linux-i2c@vger.kernel.org; Claudiu
Manoil; Santosh Shilimkar; Xiaobo Xie; linux-clk@vger.kernel.org; linux-
arm-kernel@lists.infradead.org
Subject: Re: [v6, 5/5] mmc: sdhci-of-esdhc: fix host version for T4240-
R1.0-R2.0
=20
On 03/17/2016 12:06 PM, Arnd Bergmann wrote:
quoted
On Thursday 17 March 2016 12:01:01 Rob Herring wrote:
quoted
On Mon, Mar 14, 2016 at 05:45:43PM +0000, Scott Wood wrote:
quoted
quoted
quoted
quoted
This makes the driver non-portable. Better identify the specific
workarounds based on the compatible string for this device, or add
a boolean DT property for the quirk.
Arnd
[Lu Yangbo-B47093] Hi Arnd, we did have a discussion about using DTS
we did, we'd constantly have people using the wrong one.
quoted
quoted
quoted
quoted
In addition, the device tree is stable ABI and errata are often
discovered after device tree are deployed.
quoted
quoted
quoted
quoted
See the link for details.
So we decide to read SVR from the device-config/guts MMIO block
other than using DTS.
quoted
quoted
quoted
quoted
Thanks.
Also note that this driver is already only for fsl-specific
hardware, and it will still work even if fsl_guts doesn't find
anything to bind to
-- it just wouldn't be able to detect errata based on SVR in that
case.
quoted
quoted
IIRC, it is the same IP block as i.MX and Arnd's point is this won't
even compile on !PPC. It is things like this that prevent sharing the
driver.
=20
The whole point of using the MMIO SVR instead of the PPC SPR is so that
it will work on ARM... The guts driver should build on any platform as
long as OF is enabled, and if it doesn't find a node to bind to it will
return 0 for SVR, and the eSDHC driver will continue (after printing an
error that should be removed) without the ability to test for errata
based on SVR.
=20
quoted
I think the first four patches take care of building for ARM, but the
problem remains if you want to enable COMPILE_TEST as we need for
certain automated checking.
=20
What specific problem is there with COMPILE_TEST?
=20
quoted
quoted
Dealing with Si revs is a common problem. We should have a common
solution. There is soc_device for this purpose.
Exactly. The last time this came up, I think we agreed to implement a
helper using glob_match() on the soc_device strings. Unfortunately
this hasn't happened then, but I'd still prefer that over yet another
vendor-specific way of dealing with the generic issue.
=20
soc_device would require encoding the SVR as a string and then decoding
the string, which is more complicated and error prone than having
platform-specific code test a platform-specific number. And when would
it get registered on arm64, which doesn't have platform code?
=20
-Scott
[Lu Yangbo-B47093] Hi Arnd, could you answer Scott's questions?
If you don't oppose this patch, I'd like to rework a new version for mergin=
g.
Thanks.
:)
From: Yangbo Lu <yangbo.lu@nxp.com> Date: 2016-03-25 06:54:17
-----Original Message-----
From: Scott Wood
Sent: Saturday, March 19, 2016 2:16 AM
To: Rob Herring; Yangbo Lu
Cc: devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
linux-kernel@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux-
clk@vger.kernel.org; linux-i2c@vger.kernel.org; iommu@lists.linux-
foundation.org; netdev@vger.kernel.org; linux-mmc@vger.kernel.org;
Russell King; Jochen Friedrich; Joerg Roedel; Claudiu Manoil;
ulf.hansson@linaro.org; Bhupesh Sharma; Zhao Qiang; Kumar Gala; Santosh
Shilimkar; Yang-Leo Li; Xiaobo Xie
Subject: Re: [v6, 3/5] dt: move guts devicetree doc out of powerpc
directory
=20
On 03/17/2016 12:06 PM, Rob Herring wrote:
quoted
On Wed, Mar 09, 2016 at 06:08:49PM +0800, Yangbo Lu wrote:
quoted
Move guts devicetree doc to
Documentation/devicetree/bindings/soc/fsl/
since it's used by not only PowerPC but also ARM. And add a
specification for 'little-endian' property.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
- None
Changes for v3:
- None
Changes for v4:
- Added this patch
Changes for v5:
- Modified the description for little-endian property Changes for
v6:
- None
---
Documentation/devicetree/bindings/{powerpc =3D> soc}/fsl/guts.txt | 3
+++
1 file changed, 3 insertions(+)
rename Documentation/devicetree/bindings/{powerpc =3D>
soc}/fsl/guts.txt (91%)
b/Documentation/devicetree/bindings/soc/fsl/guts.txt
similarity index 91%
rename from Documentation/devicetree/bindings/powerpc/fsl/guts.txt
rename to Documentation/devicetree/bindings/soc/fsl/guts.txt
index b71b203..07adca9 100644
@@ -25,6 +25,9 @@ Recommended properties: - fsl,liodn-bits : Indicates the number of defined bits in the LIODN registers, for those SOCs that have a PAMU device.+ - little-endian : Indicates that the global utilities block is
little
quoted
quoted
+ endian. The default is big endian.
The default is "the native endianness of the system". So absence on an
ARM system would be LE.
=20
No. For this binding, the default is big-endian, because that's what
existed for this device before an endian property was added.
=20
"endianness of the system" is not a well-defined concept.
=20
quoted
This property is valid for any simple-bus device,
=20
Since when does simple-bus mean anything more than that the nodes
underneath it can be used without bus-specific knowledge?
=20
quoted
so it isn't really required to document per device. You can, but your
description had better match the documented behaviour.
=20
Documented where?
=20
In fact, Documentation/devicetree/bindings/common-properties.txt
explicitly says of the endian properties, "If a binding supports these
properties, then the binding should also specify the default behavior if
none of these properties are present."
=20
-Scott
[Lu Yangbo-B47093] So, Rob, could you accept this patch after so much discu=
ssion?
:)