diff mbox

ARM: dts: sunxi: Add num-cs for A20 spi nodes

Message ID 20161122170616.29557-1-manu@bidouilliste.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emmanuel Vadot Nov. 22, 2016, 5:06 p.m. UTC
The spi0 controller on the A20 have up to 4 CS (Chip Select) while the
others three only have 1.
Add the num-cs property to each node.

Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
---
 arch/arm/boot/dts/sun7i-a20.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Maxime Ripard Nov. 24, 2016, 7:55 p.m. UTC | #1
On Tue, Nov 22, 2016 at 06:06:16PM +0100, Emmanuel Vadot wrote:
> The spi0 controller on the A20 have up to 4 CS (Chip Select) while the
> others three only have 1.
> Add the num-cs property to each node.
> 
> Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>

I don't think we have any code that uses it at the moment. What is the
rationale behind this patch?

Thanks!
Maxime
Emmanuel Vadot Nov. 24, 2016, 8:05 p.m. UTC | #2
On Thu, 24 Nov 2016 20:55:17 +0100
Maxime Ripard <maxime.ripard@free-electrons.com> wrote:

> On Tue, Nov 22, 2016 at 06:06:16PM +0100, Emmanuel Vadot wrote:
> > The spi0 controller on the A20 have up to 4 CS (Chip Select) while the
> > others three only have 1.
> > Add the num-cs property to each node.
> > 
> > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
> 
> I don't think we have any code that uses it at the moment. What is the
> rationale behind this patch?
> 
> Thanks!
> Maxime
> 
> -- 
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

 Hi Maxime,

 If num-cs isn't present nothing prevent to start a transfer with a
non-valid CS pin, resulting in an error.
 num-cs are default property especially made for this and a SPI driver
should try to get the property at probe/attach time.

 Cheers,
Maxime Ripard Nov. 25, 2016, 3:20 p.m. UTC | #3
On Thu, Nov 24, 2016 at 09:05:09PM +0100, Emmanuel Vadot wrote:
> On Thu, 24 Nov 2016 20:55:17 +0100
> Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> 
> > On Tue, Nov 22, 2016 at 06:06:16PM +0100, Emmanuel Vadot wrote:
> > > The spi0 controller on the A20 have up to 4 CS (Chip Select) while the
> > > others three only have 1.
> > > Add the num-cs property to each node.
> > > 
> > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
> > 
> > I don't think we have any code that uses it at the moment. What is the
> > rationale behind this patch?
> > 
> > Thanks!
> > Maxime
> > 
> > -- 
> > Maxime Ripard, Free Electrons
> > Embedded Linux and Kernel engineering
> > http://free-electrons.com
> 
>  Hi Maxime,
> 
>  If num-cs isn't present nothing prevent to start a transfer with a
> non-valid CS pin, resulting in an error.
>  num-cs are default property especially made for this and a SPI driver
> should try to get the property at probe/attach time.

Yes, but as far as I know, our driver doesn't. I'm all in for having
support for that in our driver, but without it, that patch is kind of
useless.

Maxime
Emmanuel Vadot Nov. 25, 2016, 9:07 p.m. UTC | #4
On Fri, 25 Nov 2016 16:20:47 +0100
Maxime Ripard <maxime.ripard@free-electrons.com> wrote:

> On Thu, Nov 24, 2016 at 09:05:09PM +0100, Emmanuel Vadot wrote:
> > On Thu, 24 Nov 2016 20:55:17 +0100
> > Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> > 
> > > On Tue, Nov 22, 2016 at 06:06:16PM +0100, Emmanuel Vadot wrote:
> > > > The spi0 controller on the A20 have up to 4 CS (Chip Select) while the
> > > > others three only have 1.
> > > > Add the num-cs property to each node.
> > > > 
> > > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
> > > 
> > > I don't think we have any code that uses it at the moment. What is the
> > > rationale behind this patch?
> > > 
> > > Thanks!
> > > Maxime
> > > 
> > > -- 
> > > Maxime Ripard, Free Electrons
> > > Embedded Linux and Kernel engineering
> > > http://free-electrons.com
> > 
> >  Hi Maxime,
> > 
> >  If num-cs isn't present nothing prevent to start a transfer with a
> > non-valid CS pin, resulting in an error.
> >  num-cs are default property especially made for this and a SPI driver
> > should try to get the property at probe/attach time.
> 
> Yes, but as far as I know, our driver doesn't. I'm all in for having
> support for that in our driver, but without it, that patch is kind of
> useless.
> 
> Maxime
> 
> -- 
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

 Yes the Linux driver doesn't use it but my upcoming one for FreeBSD
uses it. So it is not useless for downstream user of DTS.

 Cheers,
Maxime Ripard Dec. 1, 2016, 9:21 a.m. UTC | #5
Hi Emmanuel,

On Fri, Nov 25, 2016 at 10:07:52PM +0100, Emmanuel Vadot wrote:
> On Fri, 25 Nov 2016 16:20:47 +0100
> Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> 
> > On Thu, Nov 24, 2016 at 09:05:09PM +0100, Emmanuel Vadot wrote:
> > > On Thu, 24 Nov 2016 20:55:17 +0100
> > > Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> > > 
> > > > On Tue, Nov 22, 2016 at 06:06:16PM +0100, Emmanuel Vadot wrote:
> > > > > The spi0 controller on the A20 have up to 4 CS (Chip Select) while the
> > > > > others three only have 1.
> > > > > Add the num-cs property to each node.
> > > > > 
> > > > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
> > > > 
> > > > I don't think we have any code that uses it at the moment. What is the
> > > > rationale behind this patch?
> > > > 
> > > > Thanks!
> > > > Maxime
> > > > 
> > > > -- 
> > > > Maxime Ripard, Free Electrons
> > > > Embedded Linux and Kernel engineering
> > > > http://free-electrons.com
> > > 
> > >  Hi Maxime,
> > > 
> > >  If num-cs isn't present nothing prevent to start a transfer with a
> > > non-valid CS pin, resulting in an error.
> > >  num-cs are default property especially made for this and a SPI driver
> > > should try to get the property at probe/attach time.
> > 
> > Yes, but as far as I know, our driver doesn't. I'm all in for having
> > support for that in our driver, but without it, that patch is kind of
> > useless.
> 
>  Yes the Linux driver doesn't use it but my upcoming one for FreeBSD
> uses it. So it is not useless for downstream user of DTS.

Ah, I didn't know this was for FreeBSD. So you started to use our DTs,
or do you have some modifications to it? How does that work?

Anyway, the fact that it isn't used by our driver at the moment and
that it's meant for other OSes should be mentionned in the commit log.

Thanks!
Maxime
Emmanuel Vadot Dec. 1, 2016, 10:24 a.m. UTC | #6
Hi Maxime,

On Thu, 1 Dec 2016 10:21:50 +0100
Maxime Ripard <maxime.ripard@free-electrons.com> wrote:

> Hi Emmanuel,
> 
> On Fri, Nov 25, 2016 at 10:07:52PM +0100, Emmanuel Vadot wrote:
> > On Fri, 25 Nov 2016 16:20:47 +0100
> > Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> > 
> > > On Thu, Nov 24, 2016 at 09:05:09PM +0100, Emmanuel Vadot wrote:
> > > > On Thu, 24 Nov 2016 20:55:17 +0100
> > > > Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> > > > 
> > > > > On Tue, Nov 22, 2016 at 06:06:16PM +0100, Emmanuel Vadot wrote:
> > > > > > The spi0 controller on the A20 have up to 4 CS (Chip Select) while the
> > > > > > others three only have 1.
> > > > > > Add the num-cs property to each node.
> > > > > > 
> > > > > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
> > > > > 
> > > > > I don't think we have any code that uses it at the moment. What is the
> > > > > rationale behind this patch?
> > > > > 
> > > > > Thanks!
> > > > > Maxime
> > > > > 
> > > > > -- 
> > > > > Maxime Ripard, Free Electrons
> > > > > Embedded Linux and Kernel engineering
> > > > > http://free-electrons.com
> > > > 
> > > >  Hi Maxime,
> > > > 
> > > >  If num-cs isn't present nothing prevent to start a transfer with a
> > > > non-valid CS pin, resulting in an error.
> > > >  num-cs are default property especially made for this and a SPI driver
> > > > should try to get the property at probe/attach time.
> > > 
> > > Yes, but as far as I know, our driver doesn't. I'm all in for having
> > > support for that in our driver, but without it, that patch is kind of
> > > useless.
> > 
> >  Yes the Linux driver doesn't use it but my upcoming one for FreeBSD
> > uses it. So it is not useless for downstream user of DTS.
> 
> Ah, I didn't know this was for FreeBSD. So you started to use our DTs,
> or do you have some modifications to it? How does that work?

 Yes we use the DTS from linux from quite some times now. We're
currently synced with 4.7-ish.
 We either use them directly or modify them according to our needs and
driver support.

> Anyway, the fact that it isn't used by our driver at the moment and
> that it's meant for other OSes should be mentionned in the commit log.

 Yeah I understand, I'll send a v2 with this in the commit log.

> Thanks!
> Maxime
> 
> -- 
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
kernel test robot Dec. 3, 2016, 11:10 p.m. UTC | #7
Hi Emmanuel,

[auto build test ERROR on robh/for-next]
[also build test ERROR on v4.9-rc7 next-20161202]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Emmanuel-Vadot/ARM-dts-sunxi-Add-num-cs-for-A20-spi-nodes/20161123-034323
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arm-vexpress_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All errors (new ones prefixed by >>):

>> Error: arch/arm/boot/dts/sun7i-a20.dtsi:874.13-14 syntax error
>> FATAL ERROR: Unable to parse input tree

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Maxime Ripard Dec. 5, 2016, 9:28 a.m. UTC | #8
On Thu, Dec 01, 2016 at 11:24:14AM +0100, Emmanuel Vadot wrote:
> > > > >  If num-cs isn't present nothing prevent to start a transfer
> > > > > with a non-valid CS pin, resulting in an error.  num-cs are
> > > > > default property especially made for this and a SPI driver
> > > > > should try to get the property at probe/attach time.
> > > > 
> > > > Yes, but as far as I know, our driver doesn't. I'm all in for
> > > > having support for that in our driver, but without it, that
> > > > patch is kind of useless.
> > > 
> > >  Yes the Linux driver doesn't use it but my upcoming one for FreeBSD
> > > uses it. So it is not useless for downstream user of DTS.
> > 
> > Ah, I didn't know this was for FreeBSD. So you started to use our DTs,
> > or do you have some modifications to it? How does that work?
> 
> Yes we use the DTS from linux from quite some times now. We're
> currently synced with 4.7-ish.  We either use them directly or
> modify them according to our needs and driver support.

Do you have a link to those modifications?

Thanks,
Maxime
Emmanuel Vadot Dec. 5, 2016, 9:39 a.m. UTC | #9
On Mon, 5 Dec 2016 10:28:21 +0100
Maxime Ripard <maxime.ripard@free-electrons.com> wrote:

> On Thu, Dec 01, 2016 at 11:24:14AM +0100, Emmanuel Vadot wrote:
> > > > > >  If num-cs isn't present nothing prevent to start a transfer
> > > > > > with a non-valid CS pin, resulting in an error.  num-cs are
> > > > > > default property especially made for this and a SPI driver
> > > > > > should try to get the property at probe/attach time.
> > > > > 
> > > > > Yes, but as far as I know, our driver doesn't. I'm all in for
> > > > > having support for that in our driver, but without it, that
> > > > > patch is kind of useless.
> > > > 
> > > >  Yes the Linux driver doesn't use it but my upcoming one for FreeBSD
> > > > uses it. So it is not useless for downstream user of DTS.
> > > 
> > > Ah, I didn't know this was for FreeBSD. So you started to use our DTs,
> > > or do you have some modifications to it? How does that work?
> > 
> > Yes we use the DTS from linux from quite some times now. We're
> > currently synced with 4.7-ish.  We either use them directly or
> > modify them according to our needs and driver support.
> 
> Do you have a link to those modifications?
> 
> Thanks,
> Maxime
> 
> -- 
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

 Sure,

 https://svnweb.freebsd.org/base/head/sys/boot/fdt/dts/arm/
diff mbox

Patch

diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
index 94cf5a1..ed21982 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -871,6 +871,7 @@ 
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
+			num-cs = 4;
 		};
 
 		spi1: spi@01c06000 {
@@ -885,6 +886,7 @@ 
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
+			num-cs = 1;
 		};
 
 		emac: ethernet@01c0b000 {
@@ -1037,6 +1039,7 @@ 
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
+			num-cs = 1;
 		};
 
 		ahci: sata@01c18000 {
@@ -1079,6 +1082,7 @@ 
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
+			num-cs = 1;
 		};
 
 		pio: pinctrl@01c20800 {