From: Brian Norris <computersforpeace@gmail.com>
To: bayi cheng <bayi.cheng@mediatek.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Daniel Kurtz <djkurtz@chromium.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org, srv_heupstream@mediatek.com,
jteki@openedev.com, ezequiel@vanguardiasur.com.ar
Subject: Re: [PATCH v6 0/3] Mediatek SPI-NOR flash driver
Date: Wed, 11 Nov 2015 12:26:21 -0800 [thread overview]
Message-ID: <20151111202621.GI12143@google.com> (raw)
In-Reply-To: <1447250654.19991.15.camel@mhfsdcap03>
On Wed, Nov 11, 2015 at 10:04:14PM +0800, Bayi Cheng wrote:
> On Mon, 2015-11-09 at 18:46 -0800, Brian Norris wrote:
> > I believe you didn't completely answer all my questions from v5 though.
> > I'll repeat a bit here. Particularly, refer to [1].
> > I'll summarize; I understand that your common transmit/receive operation
> > works something like this:
> >
> > Quoting from [1]:
> > > (1) total number of bits to send/receive goes in the COUNT register (so
> > > far, as many as 7*8=56?)
> > > (2) opcode is written to PRGDATA5
> > > (3) other "transmit" data (like addresses), if any, are placed on PRGDATA4..0
> > > (4) command is sent (execute_cmd())
> > > (5) data is read back in SHREG{X..0}, if needed
> >
> > My questions were:
> >
> > (a) Why does mt8173_nor_set_read_mode() use PRGDATA3? That's not
> > mentioned in the SoC manual, and it doesn't really match any of the
> > steps above. Perhaps it's just a quirk of the controller's
> > programming model?
> >
> yes, for this question, I have done some testes, If I change the
> PRGDATA3 to PRGDATA5 for mt8173_nor_set_read_mode() like others
> functions, then the controller will be hanged, and I have asked our
> designer for double confirm.
I wasn't suggesting to change this to PRGDATA5. I just was wondering why
the difference. It's not documented. (I suppose an acceptable answer is
just "because that's how the HW works.")
> > (b) How do you determine X from step (5)?
> >
> > Right now, your code seems to answer that X is "rxlen - 1". Correct?
> >
> yes, I have used "rxlen -1", because the first of nor flash output is
> located at SHREG[0], in the other words, the output data starts at
> SHREG[0] and go up to SHREG[relen -1]
But, we aren't reading from SHREG[0] first; we're reading backwards from
SHREG[rxlen - 1] down to SHREG[0]. It seems that's correct, right?
> > If that's correct and if I put all of my understanding together
> > correctly, this means that you can actually shift out (in PRGDATA) up to
> > 6 bytes (that is, 1 opcode and 5 tx bytes) and shift in (in SHREG) up to
> > 7 bytes, except that the first byte is received during the opcode cycle,
> > and so it is discarded, and we effectively receive only 6 bytes.
> >
> > Is that all correct? If so, then I think you still need to adjust the
> > boundary conditions in your do_tx_rx() function. (I'll comment on the
> > driver to point out the specifics.)
>
> Yes, you are right! and I will adjust the boundary conditions in
> do_tx_rx() function.
OK, good. BTW, can you make sure to rewrite the appropriate MAX macro(s)
to reflect the right values? It seems like maybe you'll want separate
macros for the maximum TX and RX -- and total (?), or is this just the
same as RX? -- since they seem to have different limits.
> By the way, could you tell me whether I need to publish a new patch? or
> you can fix them up directly?
I think there are a few more adjustments to make, so please just post a
new version of the driver only. The DT binding and DTS changes look good
to go now.
Regards,
Brian
> > [1] http://lists.infradead.org/pipermail/linux-mtd/2015-October/062951.html
WARNING: multiple messages have this Message-ID (diff)
From: computersforpeace@gmail.com (Brian Norris)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 0/3] Mediatek SPI-NOR flash driver
Date: Wed, 11 Nov 2015 12:26:21 -0800 [thread overview]
Message-ID: <20151111202621.GI12143@google.com> (raw)
In-Reply-To: <1447250654.19991.15.camel@mhfsdcap03>
On Wed, Nov 11, 2015 at 10:04:14PM +0800, Bayi Cheng wrote:
> On Mon, 2015-11-09 at 18:46 -0800, Brian Norris wrote:
> > I believe you didn't completely answer all my questions from v5 though.
> > I'll repeat a bit here. Particularly, refer to [1].
> > I'll summarize; I understand that your common transmit/receive operation
> > works something like this:
> >
> > Quoting from [1]:
> > > (1) total number of bits to send/receive goes in the COUNT register (so
> > > far, as many as 7*8=56?)
> > > (2) opcode is written to PRGDATA5
> > > (3) other "transmit" data (like addresses), if any, are placed on PRGDATA4..0
> > > (4) command is sent (execute_cmd())
> > > (5) data is read back in SHREG{X..0}, if needed
> >
> > My questions were:
> >
> > (a) Why does mt8173_nor_set_read_mode() use PRGDATA3? That's not
> > mentioned in the SoC manual, and it doesn't really match any of the
> > steps above. Perhaps it's just a quirk of the controller's
> > programming model?
> >
> yes, for this question, I have done some testes, If I change the
> PRGDATA3 to PRGDATA5 for mt8173_nor_set_read_mode() like others
> functions, then the controller will be hanged, and I have asked our
> designer for double confirm.
I wasn't suggesting to change this to PRGDATA5. I just was wondering why
the difference. It's not documented. (I suppose an acceptable answer is
just "because that's how the HW works.")
> > (b) How do you determine X from step (5)?
> >
> > Right now, your code seems to answer that X is "rxlen - 1". Correct?
> >
> yes, I have used "rxlen -1", because the first of nor flash output is
> located at SHREG[0], in the other words, the output data starts at
> SHREG[0] and go up to SHREG[relen -1]
But, we aren't reading from SHREG[0] first; we're reading backwards from
SHREG[rxlen - 1] down to SHREG[0]. It seems that's correct, right?
> > If that's correct and if I put all of my understanding together
> > correctly, this means that you can actually shift out (in PRGDATA) up to
> > 6 bytes (that is, 1 opcode and 5 tx bytes) and shift in (in SHREG) up to
> > 7 bytes, except that the first byte is received during the opcode cycle,
> > and so it is discarded, and we effectively receive only 6 bytes.
> >
> > Is that all correct? If so, then I think you still need to adjust the
> > boundary conditions in your do_tx_rx() function. (I'll comment on the
> > driver to point out the specifics.)
>
> Yes, you are right! and I will adjust the boundary conditions in
> do_tx_rx() function.
OK, good. BTW, can you make sure to rewrite the appropriate MAX macro(s)
to reflect the right values? It seems like maybe you'll want separate
macros for the maximum TX and RX -- and total (?), or is this just the
same as RX? -- since they seem to have different limits.
> By the way, could you tell me whether I need to publish a new patch? or
> you can fix them up directly?
I think there are a few more adjustments to make, so please just post a
new version of the driver only. The DT binding and DTS changes look good
to go now.
Regards,
Brian
> > [1] http://lists.infradead.org/pipermail/linux-mtd/2015-October/062951.html
next prev parent reply other threads:[~2015-11-11 20:26 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 15:48 [PATCH v6 0/3] Mediatek SPI-NOR flash driver Bayi Cheng
2015-11-06 15:48 ` Bayi Cheng
2015-11-06 15:48 ` Bayi Cheng
2015-11-06 15:48 ` [PATCH v6 1/3] doc: dt: add documentation for Mediatek spi-nor controller Bayi Cheng
2015-11-06 15:48 ` Bayi Cheng
2015-11-06 15:48 ` Bayi Cheng
[not found] ` <1446824889-16144-2-git-send-email-bayi.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-11-09 16:39 ` Rob Herring
2015-11-09 16:39 ` Rob Herring
2015-11-09 16:39 ` Rob Herring
2015-11-11 20:38 ` Brian Norris
2015-11-11 20:38 ` Brian Norris
2015-11-11 20:38 ` Brian Norris
[not found] ` <20151111203823.GJ12143-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-11-13 7:20 ` bayi cheng
2015-11-13 7:20 ` bayi cheng
2015-11-13 7:20 ` bayi cheng
2015-11-13 19:13 ` Brian Norris
2015-11-13 19:13 ` Brian Norris
[not found] ` <1446824889-16144-1-git-send-email-bayi.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-11-06 15:48 ` [PATCH v6 2/3] mtd: mtk-nor: mtk serial flash controller driver Bayi Cheng
2015-11-06 15:48 ` Bayi Cheng
2015-11-06 15:48 ` Bayi Cheng
2015-11-06 17:19 ` [PATCH] mtd: mtk-nor: fix compare_const_fl.cocci warnings kbuild test robot
2015-11-06 17:19 ` kbuild test robot
2015-11-06 17:19 ` kbuild test robot
2015-11-06 17:19 ` [PATCH v6 2/3] mtd: mtk-nor: mtk serial flash controller driver kbuild test robot
2015-11-06 17:19 ` kbuild test robot
2015-11-06 17:19 ` kbuild test robot
2015-11-10 3:01 ` Brian Norris
2015-11-10 3:01 ` Brian Norris
[not found] ` <20151110030115.GM12143-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-11-11 13:51 ` bayi cheng
2015-11-11 13:51 ` bayi cheng
2015-11-11 13:51 ` bayi cheng
[not found] ` <1446824889-16144-3-git-send-email-bayi.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-11-11 21:41 ` Brian Norris
2015-11-11 21:41 ` Brian Norris
2015-11-11 21:41 ` Brian Norris
[not found] ` <20151111214146.GL12143-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-11-13 7:25 ` bayi cheng
2015-11-13 7:25 ` bayi cheng
2015-11-13 7:25 ` bayi cheng
2015-11-06 15:48 ` [PATCH v6 3/3] arm64: dts: mt8173: Add nor flash node Bayi Cheng
2015-11-06 15:48 ` Bayi Cheng
2015-11-06 15:48 ` Bayi Cheng
[not found] ` <1446824889-16144-4-git-send-email-bayi.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-11-11 21:39 ` Brian Norris
2015-11-11 21:39 ` Brian Norris
2015-11-11 21:39 ` Brian Norris
2015-11-10 2:46 ` [PATCH v6 0/3] Mediatek SPI-NOR flash driver Brian Norris
2015-11-10 2:46 ` Brian Norris
2015-11-11 14:04 ` bayi cheng
2015-11-11 14:04 ` bayi cheng
2015-11-11 14:04 ` bayi cheng
2015-11-11 20:26 ` Brian Norris [this message]
2015-11-11 20:26 ` Brian Norris
2015-11-13 6:45 ` bayi cheng
2015-11-13 6:45 ` bayi cheng
2015-11-13 6:45 ` bayi cheng
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=20151111202621.GI12143@google.com \
--to=computersforpeace@gmail.com \
--cc=bayi.cheng@mediatek.com \
--cc=devicetree@vger.kernel.org \
--cc=djkurtz@chromium.org \
--cc=dwmw2@infradead.org \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jteki@openedev.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=srv_heupstream@mediatek.com \
/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.