* [PATCH v3 0/1] Set FORCE_CSX bit when arbitration between NAND and NOR is enabled.
@ 2017-09-28 0:57 Kalyan Kinthada
[not found] ` <20170928005756.3938-1-kalyan.kinthada-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Kalyan Kinthada @ 2017-09-28 0:57 UTC (permalink / raw)
To: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
computersforpeace-Re5JQEeQqe8AvxtiuMwx3w,
boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
marek.vasut-Re5JQEeQqe8AvxtiuMwx3w, richard-/L3Ra7n9ekc,
cyrille.pitchen-yU5RGvR974pGWvitb5QawA,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
miquel.raynal-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu, Kalyan Kinthada
When the arbitration between NOR and NAND flash is enabled
the <FORCE_CSX> field bit[21] in the Data Flash Control Register
needs to be set to 1 according to guidleine GL-5830741
mentioned in Marvell Errata document MV-S501377-00, Rev. D.
Set the FORCE_CSX bit in NDCR for ARMADA370 variants as the arbitration
is always enabled by default. This change does not apply for pxa3xx
variants because FORCE_CSX bit does not exist/reserved on the NFCv1.
Ran the "flash_speed" tool on NAND flash on a board with
Armada-xp based SoC which uses only one NAND chip and not using
the arbiter. There is no regression or speed penalty
introduced due to this change.
Changes since v2:
Thanks Miquel RAYNAL for the suggestion.
* "mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants."
Modified commit message to mention that this change does not apply
for pxa3xx variants.
Fixed the missing space in comments.
Removed unused macros "NDCR_ND_MODE" and "NDCR_NAND_MODE".
Changes since v1:
Thanks Miquel RAYNAL for the suggestion.
* Deleted: "dt-bindings: mtd: pxa3xx: Add "marvell,nand-force-csx" compatible string"
Not necessary to create a new compatible string.
* "mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants."
Modified commit message.
This commit sets the FORCE_CSX bit for all ARMADA370 variants.
-----
Kalyan Kinthada (1):
mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants.
drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--
2.14.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants.
[not found] ` <20170928005756.3938-1-kalyan.kinthada-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
@ 2017-09-28 0:57 ` Kalyan Kinthada
2017-10-05 7:41 ` Miquel RAYNAL
2017-10-14 13:12 ` Boris Brezillon
0 siblings, 2 replies; 9+ messages in thread
From: Kalyan Kinthada @ 2017-09-28 0:57 UTC (permalink / raw)
To: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
computersforpeace-Re5JQEeQqe8AvxtiuMwx3w,
boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
marek.vasut-Re5JQEeQqe8AvxtiuMwx3w, richard-/L3Ra7n9ekc,
cyrille.pitchen-yU5RGvR974pGWvitb5QawA,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
miquel.raynal-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu, Kalyan Kinthada
When the arbitration between NOR and NAND flash is enabled
the <FORCE_CSX> field bit[21] in the Data Flash Control Register
needs to be set to 1 according to guidleine GL-5830741 mentioned
in Marvell Errata document MV-S501377-00, Rev. D.
This commit sets the FORCE_CSX bit to 1 for all
ARMADA370 variants as the arbitration is always enabled by default.
This change does not apply for pxa3xx variants because the FORCE_CSX
bit does not exist/reserved on the NFCv1.
The NDCR_ND_MODE conflicts with the new NDCR_FORCE_CSX but is unused so
remove it along with NDCR_NAND_MODE.
Signed-off-by: Kalyan Kinthada <kalyan.kinthada-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
---
drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 85cff68643e0..a6a7a5af7bed 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -67,8 +67,7 @@
#define NDCR_DWIDTH_M (0x1 << 26)
#define NDCR_PAGE_SZ (0x1 << 24)
#define NDCR_NCSX (0x1 << 23)
-#define NDCR_ND_MODE (0x3 << 21)
-#define NDCR_NAND_MODE (0x0)
+#define NDCR_FORCE_CSX (0x1 << 21)
#define NDCR_CLR_PG_CNT (0x1 << 20)
#define NFCV1_NDCR_ARB_CNTL (0x1 << 19)
#define NFCV2_NDCR_STOP_ON_UNCOR (0x1 << 19)
@@ -1464,6 +1463,9 @@ static int pxa3xx_nand_config_ident(struct pxa3xx_nand_info *info)
info->chunk_size = PAGE_CHUNK_SIZE;
info->reg_ndcr = 0x0; /* enable all interrupts */
info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0;
+ /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#: GL-5830741 */
+ if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
+ info->reg_ndcr |= NDCR_FORCE_CSX;
info->reg_ndcr |= NDCR_RD_ID_CNT(READ_ID_BYTES);
info->reg_ndcr |= NDCR_SPARE_EN;
@@ -1498,6 +1500,9 @@ static void pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info)
info->reg_ndcr = ndcr &
~(NDCR_INT_MASK | NDCR_ND_ARB_EN | NFCV1_NDCR_ARB_CNTL);
info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0;
+ /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#: GL-5830741 */
+ if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
+ info->reg_ndcr |= NDCR_FORCE_CSX;
info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
info->ndtr1cs0 = nand_readl(info, NDTR1CS0);
}
--
2.14.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants.
2017-09-28 0:57 ` [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants Kalyan Kinthada
@ 2017-10-05 7:41 ` Miquel RAYNAL
2017-10-09 2:31 ` Kalyan Kinthada
2017-10-14 13:12 ` Boris Brezillon
1 sibling, 1 reply; 9+ messages in thread
From: Miquel RAYNAL @ 2017-10-05 7:41 UTC (permalink / raw)
To: Kalyan Kinthada
Cc: dwmw2, computersforpeace, boris.brezillon, marek.vasut, richard,
cyrille.pitchen, robh+dt, mark.rutland, ezequiel.garcia,
devicetree, chris.packham, linux-mtd, linux-kernel
Hello Kalyan,
On Thu, 28 Sep 2017 13:57:56 +1300
Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz> wrote:
> When the arbitration between NOR and NAND flash is enabled
> the <FORCE_CSX> field bit[21] in the Data Flash Control Register
> needs to be set to 1 according to guidleine GL-5830741 mentioned
Typo: guideline ^
> in Marvell Errata document MV-S501377-00, Rev. D.
Thanks for that, I checked it.
>
> This commit sets the FORCE_CSX bit to 1 for all
> ARMADA370 variants as the arbitration is always enabled by default.
> This change does not apply for pxa3xx variants because the FORCE_CSX
> bit does not exist/reserved on the NFCv1.
Sorry to bother you again but I am reworking the pxa3xx_nand driver and
so I would like to deeply understand why this is needed because I will
have to integrate it in my work too.
So please tell me what is your setup, do you really use NAND/NOR
arbitration? Do you have not-Don't Care CS NAND chips? I have some
doubts because even if the spec precises in the NAND controller chapter
that arbitration is always enabled by default, the bit 27 (NfArbiterEn)
in the SoC Device Multiplex Register at offset 0x00018208 is actually
at 0 by default (disabled). Did you enable this bit manually ? I
checked with devmem on my setup and this bit was unset.
Thank you for your time,
Miquèl
>
> The NDCR_ND_MODE conflicts with the new NDCR_FORCE_CSX but is unused
> so remove it along with NDCR_NAND_MODE.
>
> Signed-off-by: Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz>
> ---
> drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/pxa3xx_nand.c
> b/drivers/mtd/nand/pxa3xx_nand.c index 85cff68643e0..a6a7a5af7bed
> 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c
> +++ b/drivers/mtd/nand/pxa3xx_nand.c
> @@ -67,8 +67,7 @@
> #define NDCR_DWIDTH_M (0x1 << 26)
> #define NDCR_PAGE_SZ (0x1 << 24)
> #define NDCR_NCSX (0x1 << 23)
> -#define NDCR_ND_MODE (0x3 << 21)
> -#define NDCR_NAND_MODE (0x0)
> +#define NDCR_FORCE_CSX (0x1 << 21)
> #define NDCR_CLR_PG_CNT (0x1 << 20)
> #define NFCV1_NDCR_ARB_CNTL (0x1 << 19)
> #define NFCV2_NDCR_STOP_ON_UNCOR (0x1 << 19)
> @@ -1464,6 +1463,9 @@ static int pxa3xx_nand_config_ident(struct
> pxa3xx_nand_info *info) info->chunk_size = PAGE_CHUNK_SIZE;
> info->reg_ndcr = 0x0; /* enable all interrupts */
> info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN :
> 0;
> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#:
> GL-5830741 */
> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
> + info->reg_ndcr |= NDCR_FORCE_CSX;
> info->reg_ndcr |= NDCR_RD_ID_CNT(READ_ID_BYTES);
> info->reg_ndcr |= NDCR_SPARE_EN;
>
> @@ -1498,6 +1500,9 @@ static void pxa3xx_nand_detect_config(struct
> pxa3xx_nand_info *info) info->reg_ndcr = ndcr &
> ~(NDCR_INT_MASK | NDCR_ND_ARB_EN |
> NFCV1_NDCR_ARB_CNTL); info->reg_ndcr |= (pdata->enable_arbiter) ?
> NDCR_ND_ARB_EN : 0;
> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#:
> GL-5830741 */
> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
> + info->reg_ndcr |= NDCR_FORCE_CSX;
> info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
> info->ndtr1cs0 = nand_readl(info, NDTR1CS0);
> }
--
Miquel Raynal, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants.
2017-10-05 7:41 ` Miquel RAYNAL
@ 2017-10-09 2:31 ` Kalyan Kinthada
[not found] ` <c6832720-7c58-4afe-2d1b-76bb9397299e-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Kalyan Kinthada @ 2017-10-09 2:31 UTC (permalink / raw)
To: Miquel RAYNAL
Cc: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
richard-/L3Ra7n9ekc@public.gmane.org,
cyrille.pitchen-yU5RGvR974pGWvitb5QawA@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Chris Packham,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On 05/10/17 20:41, Miquel RAYNAL wrote:
> Hello Kalyan,
>
> On Thu, 28 Sep 2017 13:57:56 +1300
> Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz> wrote:
>
>> When the arbitration between NOR and NAND flash is enabled
>> the <FORCE_CSX> field bit[21] in the Data Flash Control Register
>> needs to be set to 1 according to guidleine GL-5830741 mentioned
> Typo: guideline ^
I will correct this typo in the next patch version.
>> in Marvell Errata document MV-S501377-00, Rev. D.
> Thanks for that, I checked it.
>
>> This commit sets the FORCE_CSX bit to 1 for all
>> ARMADA370 variants as the arbitration is always enabled by default.
>> This change does not apply for pxa3xx variants because the FORCE_CSX
>> bit does not exist/reserved on the NFCv1.
> Sorry to bother you again but I am reworking the pxa3xx_nand driver and
> so I would like to deeply understand why this is needed because I will
> have to integrate it in my work too.
>
> So please tell me what is your setup, do you really use NAND/NOR
> arbitration? Do you have not-Don't Care CS NAND chips? I have some
> doubts because even if the spec precises in the NAND controller chapter
> that arbitration is always enabled by default, the bit 27 (NfArbiterEn)
> in the SoC Device Multiplex Register at offset 0x00018208 is actually
> at 0 by default (disabled). Did you enable this bit manually ? I
> checked with devmem on my setup and this bit was unset.
Yes, my setup use NAND/NOR arbitration and use a Don't
care CS Nand Chip. The bit 27 at offset 0x00018208 is set to 1
by default in my case. I did not manually set the bit 27 to 1.
Please let me now if you have any other question or do you want me
to send the updated patch version with the typo fixed.
Thank You,
Kalyan
>
> Thank you for your time,
> Miquèl
>
>> The NDCR_ND_MODE conflicts with the new NDCR_FORCE_CSX but is unused
>> so remove it along with NDCR_NAND_MODE.
>>
>> Signed-off-by: Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz>
>> ---
>
>
>> drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mtd/nand/pxa3xx_nand.c
>> b/drivers/mtd/nand/pxa3xx_nand.c index 85cff68643e0..a6a7a5af7bed
>> 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c
>> +++ b/drivers/mtd/nand/pxa3xx_nand.c
>> @@ -67,8 +67,7 @@
>> #define NDCR_DWIDTH_M (0x1 << 26)
>> #define NDCR_PAGE_SZ (0x1 << 24)
>> #define NDCR_NCSX (0x1 << 23)
>> -#define NDCR_ND_MODE (0x3 << 21)
>> -#define NDCR_NAND_MODE (0x0)
>> +#define NDCR_FORCE_CSX (0x1 << 21)
>> #define NDCR_CLR_PG_CNT (0x1 << 20)
>> #define NFCV1_NDCR_ARB_CNTL (0x1 << 19)
>> #define NFCV2_NDCR_STOP_ON_UNCOR (0x1 << 19)
>> @@ -1464,6 +1463,9 @@ static int pxa3xx_nand_config_ident(struct
>> pxa3xx_nand_info *info) info->chunk_size = PAGE_CHUNK_SIZE;
>> info->reg_ndcr = 0x0; /* enable all interrupts */
>> info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN :
>> 0;
>> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#:
>> GL-5830741 */
>> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
>> + info->reg_ndcr |= NDCR_FORCE_CSX;
>> info->reg_ndcr |= NDCR_RD_ID_CNT(READ_ID_BYTES);
>> info->reg_ndcr |= NDCR_SPARE_EN;
>>
>> @@ -1498,6 +1500,9 @@ static void pxa3xx_nand_detect_config(struct
>> pxa3xx_nand_info *info) info->reg_ndcr = ndcr &
>> ~(NDCR_INT_MASK | NDCR_ND_ARB_EN |
>> NFCV1_NDCR_ARB_CNTL); info->reg_ndcr |= (pdata->enable_arbiter) ?
>> NDCR_ND_ARB_EN : 0;
>> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#:
>> GL-5830741 */
>> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
>> + info->reg_ndcr |= NDCR_FORCE_CSX;
>> info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
>> info->ndtr1cs0 = nand_readl(info, NDTR1CS0);
>> }
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants.
[not found] ` <c6832720-7c58-4afe-2d1b-76bb9397299e-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
@ 2017-10-09 6:18 ` Miquel RAYNAL
2017-10-10 20:26 ` Kalyan Kinthada
2017-10-31 3:15 ` Chris Packham
0 siblings, 2 replies; 9+ messages in thread
From: Miquel RAYNAL @ 2017-10-09 6:18 UTC (permalink / raw)
To: Kalyan Kinthada
Cc: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
richard-/L3Ra7n9ekc@public.gmane.org,
cyrille.pitchen-yU5RGvR974pGWvitb5QawA@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Chris Packham,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Hello Kalyan,
On Mon, 9 Oct 2017 02:31:30 +0000
Kalyan Kinthada <Kalyan.Kinthada-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org> wrote:
> On 05/10/17 20:41, Miquel RAYNAL wrote:
> > Hello Kalyan,
> >
> > On Thu, 28 Sep 2017 13:57:56 +1300
> > Kalyan Kinthada <kalyan.kinthada-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org> wrote:
> >
> >> When the arbitration between NOR and NAND flash is enabled
> >> the <FORCE_CSX> field bit[21] in the Data Flash Control Register
> >> needs to be set to 1 according to guidleine GL-5830741 mentioned
> > Typo: guideline ^
> I will correct this typo in the next patch version.
> >> in Marvell Errata document MV-S501377-00, Rev. D.
> > Thanks for that, I checked it.
> >
> >> This commit sets the FORCE_CSX bit to 1 for all
> >> ARMADA370 variants as the arbitration is always enabled by default.
> >> This change does not apply for pxa3xx variants because the
> >> FORCE_CSX bit does not exist/reserved on the NFCv1.
> > Sorry to bother you again but I am reworking the pxa3xx_nand driver
> > and so I would like to deeply understand why this is needed because
> > I will have to integrate it in my work too.
> >
> > So please tell me what is your setup, do you really use NAND/NOR
> > arbitration? Do you have not-Don't Care CS NAND chips? I have some
> > doubts because even if the spec precises in the NAND controller
> > chapter that arbitration is always enabled by default, the bit 27
> > (NfArbiterEn) in the SoC Device Multiplex Register at offset
> > 0x00018208 is actually at 0 by default (disabled). Did you enable
> > this bit manually ? I checked with devmem on my setup and this bit
> > was unset.
> Yes, my setup use NAND/NOR arbitration and use a Don't
> care CS Nand Chip. The bit 27 at offset 0x00018208 is set to 1
> by default in my case. I did not manually set the bit 27 to 1.
Actually if you use Don't Care CS NAND chips you should not need the
force CS bit, as it is mentioned in the guidelines you pointed, this
bit is only useful for *not* don't care CS NAND chips (and the name
"force CS" is pretty straight forward too!).
Otherwise what bootloader and kernel do you use to have this
bit set by default? You may also want to check if this bit is set by
your bootloader by stopping it before it loads Linux and check manually
the value of this bit with 'md' (on U-Boot).
Thank you,
Miquèl
>
> Please let me now if you have any other question or do you want me
> to send the updated patch version with the typo fixed.
>
> Thank You,
> Kalyan
>
> >
> > Thank you for your time,
> > Miquèl
> >
> >> The NDCR_ND_MODE conflicts with the new NDCR_FORCE_CSX but is
> >> unused so remove it along with NDCR_NAND_MODE.
> >>
> >> Signed-off-by: Kalyan Kinthada
> >> <kalyan.kinthada-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org> ---
> >
> >
> >> drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++--
> >> 1 file changed, 7 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/mtd/nand/pxa3xx_nand.c
> >> b/drivers/mtd/nand/pxa3xx_nand.c index 85cff68643e0..a6a7a5af7bed
> >> 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c
> >> +++ b/drivers/mtd/nand/pxa3xx_nand.c
> >> @@ -67,8 +67,7 @@
> >> #define NDCR_DWIDTH_M (0x1 << 26)
> >> #define NDCR_PAGE_SZ (0x1 << 24)
> >> #define NDCR_NCSX (0x1 << 23)
> >> -#define NDCR_ND_MODE (0x3 << 21)
> >> -#define NDCR_NAND_MODE (0x0)
> >> +#define NDCR_FORCE_CSX (0x1 << 21)
> >> #define NDCR_CLR_PG_CNT (0x1 << 20)
> >> #define NFCV1_NDCR_ARB_CNTL (0x1 << 19)
> >> #define NFCV2_NDCR_STOP_ON_UNCOR (0x1 << 19)
> >> @@ -1464,6 +1463,9 @@ static int pxa3xx_nand_config_ident(struct
> >> pxa3xx_nand_info *info) info->chunk_size = PAGE_CHUNK_SIZE;
> >> info->reg_ndcr = 0x0; /* enable all interrupts */
> >> info->reg_ndcr |= (pdata->enable_arbiter) ?
> >> NDCR_ND_ARB_EN : 0;
> >> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#:
> >> GL-5830741 */
> >> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
> >> + info->reg_ndcr |= NDCR_FORCE_CSX;
> >> info->reg_ndcr |= NDCR_RD_ID_CNT(READ_ID_BYTES);
> >> info->reg_ndcr |= NDCR_SPARE_EN;
> >>
> >> @@ -1498,6 +1500,9 @@ static void pxa3xx_nand_detect_config(struct
> >> pxa3xx_nand_info *info) info->reg_ndcr = ndcr &
> >> ~(NDCR_INT_MASK | NDCR_ND_ARB_EN |
> >> NFCV1_NDCR_ARB_CNTL); info->reg_ndcr |= (pdata->enable_arbiter) ?
> >> NDCR_ND_ARB_EN : 0;
> >> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#:
> >> GL-5830741 */
> >> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
> >> + info->reg_ndcr |= NDCR_FORCE_CSX;
> >> info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
> >> info->ndtr1cs0 = nand_readl(info, NDTR1CS0);
> >> }
> >
> >
--
Miquel Raynal, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants.
2017-10-09 6:18 ` Miquel RAYNAL
@ 2017-10-10 20:26 ` Kalyan Kinthada
2017-10-31 3:15 ` Chris Packham
1 sibling, 0 replies; 9+ messages in thread
From: Kalyan Kinthada @ 2017-10-10 20:26 UTC (permalink / raw)
To: Miquel RAYNAL
Cc: dwmw2@infradead.org, computersforpeace@gmail.com,
boris.brezillon@free-electrons.com, marek.vasut@gmail.com,
richard@nod.at, cyrille.pitchen@wedev4u.fr, robh+dt@kernel.org,
mark.rutland@arm.com, ezequiel.garcia@free-electrons.com,
devicetree@vger.kernel.org, Chris Packham,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Hello Miquel,
On 09/10/17 19:18, Miquel RAYNAL wrote:
> Hello Kalyan,
>
> On Mon, 9 Oct 2017 02:31:30 +0000
> Kalyan Kinthada <Kalyan.Kinthada@alliedtelesis.co.nz> wrote:
>
>> On 05/10/17 20:41, Miquel RAYNAL wrote:
>>> Hello Kalyan,
>>>
>>> On Thu, 28 Sep 2017 13:57:56 +1300
>>> Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz> wrote:
>>>
>>>> When the arbitration between NOR and NAND flash is enabled
>>>> the <FORCE_CSX> field bit[21] in the Data Flash Control Register
>>>> needs to be set to 1 according to guidleine GL-5830741 mentioned
>>> Typo: guideline ^
>> I will correct this typo in the next patch version.
>>>> in Marvell Errata document MV-S501377-00, Rev. D.
>>> Thanks for that, I checked it.
>>>
>>>> This commit sets the FORCE_CSX bit to 1 for all
>>>> ARMADA370 variants as the arbitration is always enabled by default.
>>>> This change does not apply for pxa3xx variants because the
>>>> FORCE_CSX bit does not exist/reserved on the NFCv1.
>>> Sorry to bother you again but I am reworking the pxa3xx_nand driver
>>> and so I would like to deeply understand why this is needed because
>>> I will have to integrate it in my work too.
>>>
>>> So please tell me what is your setup, do you really use NAND/NOR
>>> arbitration? Do you have not-Don't Care CS NAND chips? I have some
>>> doubts because even if the spec precises in the NAND controller
>>> chapter that arbitration is always enabled by default, the bit 27
>>> (NfArbiterEn) in the SoC Device Multiplex Register at offset
>>> 0x00018208 is actually at 0 by default (disabled). Did you enable
>>> this bit manually ? I checked with devmem on my setup and this bit
>>> was unset.
>> Yes, my setup use NAND/NOR arbitration and use a Don't
>> care CS Nand Chip. The bit 27 at offset 0x00018208 is set to 1
>> by default in my case. I did not manually set the bit 27 to 1.
> Actually if you use Don't Care CS NAND chips you should not need the
> force CS bit, as it is mentioned in the guidelines you pointed, this
> bit is only useful for *not* don't care CS NAND chips (and the name
> "force CS" is pretty straight forward too!).
Ok. I understand now. Thank you.
>
> Otherwise what bootloader and kernel do you use to have this
> bit set by default? You may also want to check if this bit is set by
> your bootloader by stopping it before it loads Linux and check manually
> the value of this bit with 'md' (on U-Boot).
The bit27 at offset 0x00018208 is set in bootloader.
Uboot version 2016.11
Linux Kernel 4.4.6
Thanks,
Kalyan
>
> Thank you,
> Miquèl
>
>> Please let me now if you have any other question or do you want me
>> to send the updated patch version with the typo fixed.
>>
>> Thank You,
>> Kalyan
>>
>>> Thank you for your time,
>>> Miquèl
>>>
>>>> The NDCR_ND_MODE conflicts with the new NDCR_FORCE_CSX but is
>>>> unused so remove it along with NDCR_NAND_MODE.
>>>>
>>>> Signed-off-by: Kalyan Kinthada
>>>> <kalyan.kinthada@alliedtelesis.co.nz> ---
>>>
>>>> drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++--
>>>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/mtd/nand/pxa3xx_nand.c
>>>> b/drivers/mtd/nand/pxa3xx_nand.c index 85cff68643e0..a6a7a5af7bed
>>>> 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c
>>>> +++ b/drivers/mtd/nand/pxa3xx_nand.c
>>>> @@ -67,8 +67,7 @@
>>>> #define NDCR_DWIDTH_M (0x1 << 26)
>>>> #define NDCR_PAGE_SZ (0x1 << 24)
>>>> #define NDCR_NCSX (0x1 << 23)
>>>> -#define NDCR_ND_MODE (0x3 << 21)
>>>> -#define NDCR_NAND_MODE (0x0)
>>>> +#define NDCR_FORCE_CSX (0x1 << 21)
>>>> #define NDCR_CLR_PG_CNT (0x1 << 20)
>>>> #define NFCV1_NDCR_ARB_CNTL (0x1 << 19)
>>>> #define NFCV2_NDCR_STOP_ON_UNCOR (0x1 << 19)
>>>> @@ -1464,6 +1463,9 @@ static int pxa3xx_nand_config_ident(struct
>>>> pxa3xx_nand_info *info) info->chunk_size = PAGE_CHUNK_SIZE;
>>>> info->reg_ndcr = 0x0; /* enable all interrupts */
>>>> info->reg_ndcr |= (pdata->enable_arbiter) ?
>>>> NDCR_ND_ARB_EN : 0;
>>>> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#:
>>>> GL-5830741 */
>>>> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
>>>> + info->reg_ndcr |= NDCR_FORCE_CSX;
>>>> info->reg_ndcr |= NDCR_RD_ID_CNT(READ_ID_BYTES);
>>>> info->reg_ndcr |= NDCR_SPARE_EN;
>>>>
>>>> @@ -1498,6 +1500,9 @@ static void pxa3xx_nand_detect_config(struct
>>>> pxa3xx_nand_info *info) info->reg_ndcr = ndcr &
>>>> ~(NDCR_INT_MASK | NDCR_ND_ARB_EN |
>>>> NFCV1_NDCR_ARB_CNTL); info->reg_ndcr |= (pdata->enable_arbiter) ?
>>>> NDCR_ND_ARB_EN : 0;
>>>> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#:
>>>> GL-5830741 */
>>>> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
>>>> + info->reg_ndcr |= NDCR_FORCE_CSX;
>>>> info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
>>>> info->ndtr1cs0 = nand_readl(info, NDTR1CS0);
>>>> }
>>>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants.
2017-09-28 0:57 ` [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants Kalyan Kinthada
2017-10-05 7:41 ` Miquel RAYNAL
@ 2017-10-14 13:12 ` Boris Brezillon
2017-10-15 20:55 ` Chris Packham
1 sibling, 1 reply; 9+ messages in thread
From: Boris Brezillon @ 2017-10-14 13:12 UTC (permalink / raw)
To: Kalyan Kinthada
Cc: dwmw2, computersforpeace, marek.vasut, richard, cyrille.pitchen,
robh+dt, mark.rutland, ezequiel.garcia, miquel.raynal, devicetree,
linux-mtd, linux-kernel, chris.packham
Hi Kalyan,
On Thu, 28 Sep 2017 13:57:56 +1300
Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz> wrote:
> When the arbitration between NOR and NAND flash is enabled
> the <FORCE_CSX> field bit[21] in the Data Flash Control Register
> needs to be set to 1 according to guidleine GL-5830741 mentioned
> in Marvell Errata document MV-S501377-00, Rev. D.
The real question is, is this patch fixing a real bug or are you just
setting this bit because a guideline says it should be set? As far as I
understand, noone fully understands what this bit does and why it needs
to be set, so if you're not fixing a real bug, I'd prefer keeping the
code unchanged code until someone complains for a good reason.
Regards,
Boris
>
> This commit sets the FORCE_CSX bit to 1 for all
> ARMADA370 variants as the arbitration is always enabled by default.
> This change does not apply for pxa3xx variants because the FORCE_CSX
> bit does not exist/reserved on the NFCv1.
>
> The NDCR_ND_MODE conflicts with the new NDCR_FORCE_CSX but is unused so
> remove it along with NDCR_NAND_MODE.
>
> Signed-off-by: Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz>
> ---
> drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
> index 85cff68643e0..a6a7a5af7bed 100644
> --- a/drivers/mtd/nand/pxa3xx_nand.c
> +++ b/drivers/mtd/nand/pxa3xx_nand.c
> @@ -67,8 +67,7 @@
> #define NDCR_DWIDTH_M (0x1 << 26)
> #define NDCR_PAGE_SZ (0x1 << 24)
> #define NDCR_NCSX (0x1 << 23)
> -#define NDCR_ND_MODE (0x3 << 21)
> -#define NDCR_NAND_MODE (0x0)
> +#define NDCR_FORCE_CSX (0x1 << 21)
> #define NDCR_CLR_PG_CNT (0x1 << 20)
> #define NFCV1_NDCR_ARB_CNTL (0x1 << 19)
> #define NFCV2_NDCR_STOP_ON_UNCOR (0x1 << 19)
> @@ -1464,6 +1463,9 @@ static int pxa3xx_nand_config_ident(struct pxa3xx_nand_info *info)
> info->chunk_size = PAGE_CHUNK_SIZE;
> info->reg_ndcr = 0x0; /* enable all interrupts */
> info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0;
> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#: GL-5830741 */
> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
> + info->reg_ndcr |= NDCR_FORCE_CSX;
> info->reg_ndcr |= NDCR_RD_ID_CNT(READ_ID_BYTES);
> info->reg_ndcr |= NDCR_SPARE_EN;
>
> @@ -1498,6 +1500,9 @@ static void pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info)
> info->reg_ndcr = ndcr &
> ~(NDCR_INT_MASK | NDCR_ND_ARB_EN | NFCV1_NDCR_ARB_CNTL);
> info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0;
> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#: GL-5830741 */
> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
> + info->reg_ndcr |= NDCR_FORCE_CSX;
> info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
> info->ndtr1cs0 = nand_readl(info, NDTR1CS0);
> }
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants.
2017-10-14 13:12 ` Boris Brezillon
@ 2017-10-15 20:55 ` Chris Packham
0 siblings, 0 replies; 9+ messages in thread
From: Chris Packham @ 2017-10-15 20:55 UTC (permalink / raw)
To: Boris Brezillon, Kalyan Kinthada
Cc: dwmw2@infradead.org, computersforpeace@gmail.com,
marek.vasut@gmail.com, richard@nod.at, cyrille.pitchen@wedev4u.fr,
robh+dt@kernel.org, mark.rutland@arm.com,
ezequiel.garcia@free-electrons.com,
miquel.raynal@free-electrons.com, devicetree@vger.kernel.org,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Hi Boris,
On 15/10/17 02:13, Boris Brezillon wrote:
> Hi Kalyan,
>
> On Thu, 28 Sep 2017 13:57:56 +1300
> Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz> wrote:
>
>> When the arbitration between NOR and NAND flash is enabled
>> the <FORCE_CSX> field bit[21] in the Data Flash Control Register
>> needs to be set to 1 according to guidleine GL-5830741 mentioned
>> in Marvell Errata document MV-S501377-00, Rev. D.
>
> The real question is, is this patch fixing a real bug or are you just
> setting this bit because a guideline says it should be set?
Yes that's a fair summary. It is in a document called "Functional
Errata" so there is some feeling here that we (allied telesis) should
follow up things in these kinds of documents.
> As far as I
> understand, noone fully understands what this bit does and why it needs
> to be set, so if you're not fixing a real bug, I'd prefer keeping the
> code unchanged code until someone complains for a good reason.
Agreed. We've certainly not noticed a change in behaviour on our boards.
I've requested more information from Marvell through their support
channels. I'll share what I can if/when they come back with something
useful.
>
> Regards,
>
> Boris
>
>>
>> This commit sets the FORCE_CSX bit to 1 for all
>> ARMADA370 variants as the arbitration is always enabled by default.
>> This change does not apply for pxa3xx variants because the FORCE_CSX
>> bit does not exist/reserved on the NFCv1.
>>
>> The NDCR_ND_MODE conflicts with the new NDCR_FORCE_CSX but is unused so
>> remove it along with NDCR_NAND_MODE.
>>
>> Signed-off-by: Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz>
>> ---
>> drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
>> index 85cff68643e0..a6a7a5af7bed 100644
>> --- a/drivers/mtd/nand/pxa3xx_nand.c
>> +++ b/drivers/mtd/nand/pxa3xx_nand.c
>> @@ -67,8 +67,7 @@
>> #define NDCR_DWIDTH_M (0x1 << 26)
>> #define NDCR_PAGE_SZ (0x1 << 24)
>> #define NDCR_NCSX (0x1 << 23)
>> -#define NDCR_ND_MODE (0x3 << 21)
>> -#define NDCR_NAND_MODE (0x0)
>> +#define NDCR_FORCE_CSX (0x1 << 21)
>> #define NDCR_CLR_PG_CNT (0x1 << 20)
>> #define NFCV1_NDCR_ARB_CNTL (0x1 << 19)
>> #define NFCV2_NDCR_STOP_ON_UNCOR (0x1 << 19)
>> @@ -1464,6 +1463,9 @@ static int pxa3xx_nand_config_ident(struct pxa3xx_nand_info *info)
>> info->chunk_size = PAGE_CHUNK_SIZE;
>> info->reg_ndcr = 0x0; /* enable all interrupts */
>> info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0;
>> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#: GL-5830741 */
>> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
>> + info->reg_ndcr |= NDCR_FORCE_CSX;
>> info->reg_ndcr |= NDCR_RD_ID_CNT(READ_ID_BYTES);
>> info->reg_ndcr |= NDCR_SPARE_EN;
>>
>> @@ -1498,6 +1500,9 @@ static void pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info)
>> info->reg_ndcr = ndcr &
>> ~(NDCR_INT_MASK | NDCR_ND_ARB_EN | NFCV1_NDCR_ARB_CNTL);
>> info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0;
>> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#: GL-5830741 */
>> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
>> + info->reg_ndcr |= NDCR_FORCE_CSX;
>> info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
>> info->ndtr1cs0 = nand_readl(info, NDTR1CS0);
>> }
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants.
2017-10-09 6:18 ` Miquel RAYNAL
2017-10-10 20:26 ` Kalyan Kinthada
@ 2017-10-31 3:15 ` Chris Packham
1 sibling, 0 replies; 9+ messages in thread
From: Chris Packham @ 2017-10-31 3:15 UTC (permalink / raw)
To: Miquel RAYNAL, Kalyan Kinthada
Cc: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
richard-/L3Ra7n9ekc@public.gmane.org,
cyrille.pitchen-yU5RGvR974pGWvitb5QawA@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Hi Miquel,
On 09/10/17 19:19, Miquel RAYNAL wrote:
> Hello Kalyan,
>
> On Mon, 9 Oct 2017 02:31:30 +0000
> Kalyan Kinthada <Kalyan.Kinthada-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org> wrote:
>
>> On 05/10/17 20:41, Miquel RAYNAL wrote:
>>> Hello Kalyan,
>>>
>>> On Thu, 28 Sep 2017 13:57:56 +1300
>>> Kalyan Kinthada <kalyan.kinthada-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org> wrote:
>>>
>>>> When the arbitration between NOR and NAND flash is enabled
>>>> the <FORCE_CSX> field bit[21] in the Data Flash Control Register
>>>> needs to be set to 1 according to guidleine GL-5830741 mentioned
>>> Typo: guideline ^
>> I will correct this typo in the next patch version.
>>>> in Marvell Errata document MV-S501377-00, Rev. D.
>>> Thanks for that, I checked it.
>>>
>>>> This commit sets the FORCE_CSX bit to 1 for all
>>>> ARMADA370 variants as the arbitration is always enabled by default.
>>>> This change does not apply for pxa3xx variants because the
>>>> FORCE_CSX bit does not exist/reserved on the NFCv1.
>>> Sorry to bother you again but I am reworking the pxa3xx_nand driver
>>> and so I would like to deeply understand why this is needed because
>>> I will have to integrate it in my work too.
>>>
>>> So please tell me what is your setup, do you really use NAND/NOR
>>> arbitration? Do you have not-Don't Care CS NAND chips? I have some
>>> doubts because even if the spec precises in the NAND controller
>>> chapter that arbitration is always enabled by default, the bit 27
>>> (NfArbiterEn) in the SoC Device Multiplex Register at offset
>>> 0x00018208 is actually at 0 by default (disabled). Did you enable
>>> this bit manually ? I checked with devmem on my setup and this bit
>>> was unset.
>> Yes, my setup use NAND/NOR arbitration and use a Don't
>> care CS Nand Chip. The bit 27 at offset 0x00018208 is set to 1
>> by default in my case. I did not manually set the bit 27 to 1.
>
> Actually if you use Don't Care CS NAND chips you should not need the
> force CS bit, as it is mentioned in the guidelines you pointed, this
> bit is only useful for *not* don't care CS NAND chips (and the name
> "force CS" is pretty straight forward too!).
It's less straight forward than you think. It's FORCE_CSX (the X is
important) which is defined as "force chip select false on busy". What
it means is that the NF_CSn is de-asserted if the interface is
arbitrated away from the NAND flash controller. I think that means you
won't end up with the chip-select for the dev-bus/NOR firing immediately
when that device is arbitrated.
> Otherwise what bootloader and kernel do you use to have this
> bit set by default? You may also want to check if this bit is set by
> your bootloader by stopping it before it loads Linux and check manually
> the value of this bit with 'md' (on U-Boot).
>
> Thank you,
> Miquèl
>
>>
>> Please let me now if you have any other question or do you want me
>> to send the updated patch version with the typo fixed.
>>
>> Thank You,
>> Kalyan
>>
>>>
>>> Thank you for your time,
>>> Miquèl
>>>
>>>> The NDCR_ND_MODE conflicts with the new NDCR_FORCE_CSX but is
>>>> unused so remove it along with NDCR_NAND_MODE.
>>>>
>>>> Signed-off-by: Kalyan Kinthada
>>>> <kalyan.kinthada-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org> ---
>>>
>>>
>>>> drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++--
>>>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/mtd/nand/pxa3xx_nand.c
>>>> b/drivers/mtd/nand/pxa3xx_nand.c index 85cff68643e0..a6a7a5af7bed
>>>> 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c
>>>> +++ b/drivers/mtd/nand/pxa3xx_nand.c
>>>> @@ -67,8 +67,7 @@
>>>> #define NDCR_DWIDTH_M (0x1 << 26)
>>>> #define NDCR_PAGE_SZ (0x1 << 24)
>>>> #define NDCR_NCSX (0x1 << 23)
>>>> -#define NDCR_ND_MODE (0x3 << 21)
>>>> -#define NDCR_NAND_MODE (0x0)
>>>> +#define NDCR_FORCE_CSX (0x1 << 21)
>>>> #define NDCR_CLR_PG_CNT (0x1 << 20)
>>>> #define NFCV1_NDCR_ARB_CNTL (0x1 << 19)
>>>> #define NFCV2_NDCR_STOP_ON_UNCOR (0x1 << 19)
>>>> @@ -1464,6 +1463,9 @@ static int pxa3xx_nand_config_ident(struct
>>>> pxa3xx_nand_info *info) info->chunk_size = PAGE_CHUNK_SIZE;
>>>> info->reg_ndcr = 0x0; /* enable all interrupts */
>>>> info->reg_ndcr |= (pdata->enable_arbiter) ?
>>>> NDCR_ND_ARB_EN : 0;
>>>> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#:
>>>> GL-5830741 */
>>>> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
>>>> + info->reg_ndcr |= NDCR_FORCE_CSX;
>>>> info->reg_ndcr |= NDCR_RD_ID_CNT(READ_ID_BYTES);
>>>> info->reg_ndcr |= NDCR_SPARE_EN;
>>>>
>>>> @@ -1498,6 +1500,9 @@ static void pxa3xx_nand_detect_config(struct
>>>> pxa3xx_nand_info *info) info->reg_ndcr = ndcr &
>>>> ~(NDCR_INT_MASK | NDCR_ND_ARB_EN |
>>>> NFCV1_NDCR_ARB_CNTL); info->reg_ndcr |= (pdata->enable_arbiter) ?
>>>> NDCR_ND_ARB_EN : 0;
>>>> + /* Set FORCE_CSX bit for all ARMADA370 Variants. Ref#:
>>>> GL-5830741 */
>>>> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
>>>> + info->reg_ndcr |= NDCR_FORCE_CSX;
>>>> info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
>>>> info->ndtr1cs0 = nand_readl(info, NDTR1CS0);
>>>> }
>>>
>>>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-10-31 3:15 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-28 0:57 [PATCH v3 0/1] Set FORCE_CSX bit when arbitration between NAND and NOR is enabled Kalyan Kinthada
[not found] ` <20170928005756.3938-1-kalyan.kinthada-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
2017-09-28 0:57 ` [PATCH v3 1/1] mtd: nand: pxa3xx: Set FORCE_CSX bit to ARMADA370 variants Kalyan Kinthada
2017-10-05 7:41 ` Miquel RAYNAL
2017-10-09 2:31 ` Kalyan Kinthada
[not found] ` <c6832720-7c58-4afe-2d1b-76bb9397299e-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
2017-10-09 6:18 ` Miquel RAYNAL
2017-10-10 20:26 ` Kalyan Kinthada
2017-10-31 3:15 ` Chris Packham
2017-10-14 13:12 ` Boris Brezillon
2017-10-15 20:55 ` Chris Packham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).