diff mbox

[V4,1/2] mtd: spi-nor: Bindings for Cadence Quad SPI Flash Controller driver.

Message ID 201507241445.07988.marex@denx.de
State Superseded
Headers show

Commit Message

Marek Vasut July 24, 2015, 12:45 p.m. UTC
On Monday, March 23, 2015 at 02:36:21 PM, Graham Moore wrote:
> Signed-off-by: Graham Moore <grmoore@opensource.altera.com>
> ---
> V2: Add cdns prefix to driver-specific bindings.
> V3: Use existing property "is-decoded-cs" instead of creating a duplicate,
> "ext-decoder".  Timing parameters are in nanoseconds, not master reference
> clocks.  Remove bus-num completely.

Hi!

do you plan to continue on this driver any soon? If not, I'd like to take
over the mainlining if you're not opposed. I'd like to see this in mainline
soon.

btw you'll need some kind of a variation on the attached two patches in
the next iteration.

Best regards,
Marek Vasut

Comments

Graham Moore July 24, 2015, 4:12 p.m. UTC | #1
On 07/24/2015 07:45 AM, Marek Vasut wrote:
> On Monday, March 23, 2015 at 02:36:21 PM, Graham Moore wrote:
>> Signed-off-by: Graham Moore <grmoore@opensource.altera.com>
>> ---
>> V2: Add cdns prefix to driver-specific bindings.
>> V3: Use existing property "is-decoded-cs" instead of creating a duplicate,
>> "ext-decoder".  Timing parameters are in nanoseconds, not master reference
>> clocks.  Remove bus-num completely.
>
> Hi!
>
> do you plan to continue on this driver any soon? If not, I'd like to take
> over the mainlining if you're not opposed. I'd like to see this in mainline
> soon.
>

I don't have a problem with you taking over the mainlining.  I've been 
stalled on the micron quad protocol issue that Cyrille Pitchen has solved.

> btw you'll need some kind of a variation on the attached two patches in
> the next iteration.
>

I have a V5 with fixes for sparse and smatch issues.  Do you want me to 
post it and you add those two patches?  Alternatively I can incorporate 
them into my V5.

Best regards,
Graham

> Best regards,
> Marek Vasut
>
Marek Vasut July 24, 2015, 4:25 p.m. UTC | #2
On Friday, July 24, 2015 at 06:12:01 PM, Graham Moore wrote:
> On 07/24/2015 07:45 AM, Marek Vasut wrote:
> > On Monday, March 23, 2015 at 02:36:21 PM, Graham Moore wrote:
> >> Signed-off-by: Graham Moore <grmoore@opensource.altera.com>
> >> ---
> >> V2: Add cdns prefix to driver-specific bindings.
> >> V3: Use existing property "is-decoded-cs" instead of creating a
> >> duplicate, "ext-decoder".  Timing parameters are in nanoseconds, not
> >> master reference clocks.  Remove bus-num completely.
> > 
> > Hi!
> > 
> > do you plan to continue on this driver any soon? If not, I'd like to take
> > over the mainlining if you're not opposed. I'd like to see this in
> > mainline soon.
> 
> I don't have a problem with you taking over the mainlining.  I've been
> stalled on the micron quad protocol issue that Cyrille Pitchen has solved.

Do you mean the protocol change notification please?

> > btw you'll need some kind of a variation on the attached two patches in
> > the next iteration.
> 
> I have a V5 with fixes for sparse and smatch issues.  Do you want me to
> post it and you add those two patches?  Alternatively I can incorporate
> them into my V5.

Please post those patches, yup, that'd be nice :)

Also, just squash those two micropatches into yours, no problem.

Be careful about the 0002 patch, see the commit message. I do NOT think
it is correct to pass the pdev->dev which represents the controller, not
the subnode, into spi_nor_scan() in cqspi_probe() . I might be wrong here
though, I am not sure. I think Brian or David would be much better people
to comment on this part.

Best regards,
Marek Vasut
Graham Moore July 24, 2015, 5:16 p.m. UTC | #3
On 07/24/2015 11:25 AM, Marek Vasut wrote:
> On Friday, July 24, 2015 at 06:12:01 PM, Graham Moore wrote:
>> On 07/24/2015 07:45 AM, Marek Vasut wrote:
>>> On Monday, March 23, 2015 at 02:36:21 PM, Graham Moore wrote:
>>>> Signed-off-by: Graham Moore <grmoore@opensource.altera.com>
>>>> ---
>>>> V2: Add cdns prefix to driver-specific bindings.
>>>> V3: Use existing property "is-decoded-cs" instead of creating a
>>>> duplicate, "ext-decoder".  Timing parameters are in nanoseconds, not
>>>> master reference clocks.  Remove bus-num completely.
>>>
>>> Hi!
>>>
>>> do you plan to continue on this driver any soon? If not, I'd like to take
>>> over the mainlining if you're not opposed. I'd like to see this in
>>> mainline soon.
>>
>> I don't have a problem with you taking over the mainlining.  I've been
>> stalled on the micron quad protocol issue that Cyrille Pitchen has solved.
>
> Do you mean the protocol change notification please?
>

Yes, that's what I mean, the protocol change notification.

>>> btw you'll need some kind of a variation on the attached two patches in
>>> the next iteration.
>>
>> I have a V5 with fixes for sparse and smatch issues.  Do you want me to
>> post it and you add those two patches?  Alternatively I can incorporate
>> them into my V5.
>
> Please post those patches, yup, that'd be nice :)
>
> Also, just squash those two micropatches into yours, no problem.
>
> Be careful about the 0002 patch, see the commit message. I do NOT think
> it is correct to pass the pdev->dev which represents the controller, not
> the subnode, into spi_nor_scan() in cqspi_probe() . I might be wrong here
> though, I am not sure. I think Brian or David would be much better people
> to comment on this part.
>

I'm doing it the way fsl_quadspi.c does it.  It works on my Cyclone5 
test system with and without that 0002 patch.  So maybe I'll leave it 
out for now.

V5 patches on the way...

BR,
Graham

> Best regards,
> Marek Vasut
>
Marek Vasut July 24, 2015, 7:57 p.m. UTC | #4
On Friday, July 24, 2015 at 07:16:48 PM, Graham Moore wrote:
> On 07/24/2015 11:25 AM, Marek Vasut wrote:
> > On Friday, July 24, 2015 at 06:12:01 PM, Graham Moore wrote:
> >> On 07/24/2015 07:45 AM, Marek Vasut wrote:
> >>> On Monday, March 23, 2015 at 02:36:21 PM, Graham Moore wrote:
> >>>> Signed-off-by: Graham Moore <grmoore@opensource.altera.com>
> >>>> ---
> >>>> V2: Add cdns prefix to driver-specific bindings.
> >>>> V3: Use existing property "is-decoded-cs" instead of creating a
> >>>> duplicate, "ext-decoder".  Timing parameters are in nanoseconds, not
> >>>> master reference clocks.  Remove bus-num completely.
> >>> 
> >>> Hi!
> >>> 
> >>> do you plan to continue on this driver any soon? If not, I'd like to
> >>> take over the mainlining if you're not opposed. I'd like to see this
> >>> in mainline soon.
> >> 
> >> I don't have a problem with you taking over the mainlining.  I've been
> >> stalled on the micron quad protocol issue that Cyrille Pitchen has
> >> solved.
> > 
> > Do you mean the protocol change notification please?
> 
> Yes, that's what I mean, the protocol change notification.

OK

> >>> btw you'll need some kind of a variation on the attached two patches in
> >>> the next iteration.
> >> 
> >> I have a V5 with fixes for sparse and smatch issues.  Do you want me to
> >> post it and you add those two patches?  Alternatively I can incorporate
> >> them into my V5.
> > 
> > Please post those patches, yup, that'd be nice :)
> > 
> > Also, just squash those two micropatches into yours, no problem.
> > 
> > Be careful about the 0002 patch, see the commit message. I do NOT think
> > it is correct to pass the pdev->dev which represents the controller, not
> > the subnode, into spi_nor_scan() in cqspi_probe() . I might be wrong here
> > though, I am not sure. I think Brian or David would be much better people
> > to comment on this part.
> 
> I'm doing it the way fsl_quadspi.c does it.  It works on my Cyclone5
> test system with and without that 0002 patch.  So maybe I'll leave it
> out for now.

It indeed works, but that doesn't mean it is correct. The most simple test
to show you why I needed that 0002 patch would be for you to check if the
m25p,fast-read prop, which you are actually adding in this patchset to the
QSPI flash device, is set from within the spi-nor driver. It will never be
set because you're not passing the DT of_node pointer into the spi-nor driver.

> V5 patches on the way...

Thanks!

Best regards,
Marek Vasut
diff mbox

Patch

From fac766b916a64c263fdb044bdaba80a52f582ecb Mon Sep 17 00:00:00 2001
From: Marek Vasut <marex@denx.de>
Date: Fri, 24 Jul 2015 14:10:09 +0200
Subject: [PATCH 2/2] mtd: spi-nor: Pass OF node into subdevs

The entire mechanism by which the CQSPI driver probes the SPI NORs
is probably broken, in particular because it uses dev pointer of
the CQSPI and passes it into spi_nor_scan(). Since the dev->of_node
therefore points into the of_node of the CQSPI, the spi-nor driver
cannot properly parse the OF properties of the subnode and thus can
not configure itself accordingly. Add a nasty hack to work around
this for now.

Signed-off-by: Marek Vasut <marex@denx.de>
---
 drivers/mtd/spi-nor/cadence-quadspi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c
index a18732c..017460e 100644
--- a/drivers/mtd/spi-nor/cadence-quadspi.c
+++ b/drivers/mtd/spi-nor/cadence-quadspi.c
@@ -1203,6 +1203,7 @@  static int cqspi_probe(struct platform_device *pdev)
 
 		nor->mtd = mtd;
 		nor->dev = dev;
+		nor->dev->of_node = np;
 		nor->priv = cqspi;
 		mtd->priv = nor;
 
-- 
2.1.4