mtd: nand: Fixes and improvements on pxa3xx
Subsystems (2)
cover mtd: nand: Fixes and improvements on pxa3xx
The Armada 370 and Armada XP SoC include a NAND controller (NFCv2) that is similar to the one in PXA SoC. Therefore, it should be possible to support Armada NAND using pxa3xx-nand driver.
While this effort is not ready yet, here is a set of patches that are needed for such work.
A small summary of the patches:
* 1/5 is a fix for a 2-year regression that removed DMA support.
* 2/5 and 3/5 are needed to build the driver on platforms other PXA.
* 4/5 and 5/5 add ONFI-compliant device detection and are needed to successfully probe newer flash devices.
Applies cleanly on top of l2-mtd.git.
Thanks!
Ezequiel Garcia (5):
mtd: nand: pxa3xx: Set info->use_dma properly
mtd: nand: pxa3xx: Use of_machine_is_compatible()
mtd: nand: pxa3xx: Fix MODULE_DEVICE_TABLE declaration
mtd: nand: pxa3xx: Add address support for READID command
mtd: nand: pxa3xx: Add support for Read parameter page command
drivers/mtd/nand/pxa3xx_nand.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.1.5
PATCH 1/5 mtd: nand: pxa3xx: Set info->use_dma properly
From: Ezequiel Garcia <[email protected]>
Currently, the variable info->use_dma is never set and always zero-valued which means the driver never does DMA transfers. We fix this by simply setting info->use_dma to the module parameter, also named 'use_dma'. Note that the module parameter has the same name, but different semantics.
This fixes a regression introduced by the below commit which removed the info->use_dma variable set.
commit 4eb2da8994042d68e84e31138788429a102da2ea
Author: Lei Wen <[email protected]>
Date: Mon Feb 28 10:32:13 2011 +0800
mtd: pxa3xx_nand: unify prepare command
Before the above commit, the driver had use_dma=1 on all NAND commands except on CMD_STATUS. This behavior is long lost and we are not recovering in this patch, either.
This was spotted and verified only by human inspection. No testing of any kind has been performed for lack of hardware.
--- drivers/mtd/nand/pxa3xx_nand.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/pxa3xx_nand.c +1 -0
@@ -506,6 +506,7 @@ static int prepare_command_pool(struct pxa3xx_nand_info *info, int command, info->buf_count =0 ; info->oob_size =0 ; info->use_ecc =0 ; + info->use_dma = (use_dma) ?1 :0 ; info->is_ready =0 ; info->retcode =ERR_NONE ;if (info->cs !=0 )
Signature · 1 line
1.8.1.5
PATCH 2/5 mtd: nand: pxa3xx: Use of_machine_is_compatible()
In reply to Ezequiel GarciaFrom: Ezequiel Garcia <[email protected]>
This patch replaces cpu_is_pxa3xx() with of_machine_is_compatible() which allows to build this driver for other platforms than ARCH_PXA.
--- drivers/mtd/nand/pxa3xx_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/pxa3xx_nand.c +1 -1
@@ -1094,7 +1094,7 @@ static int alloc_nand_resource(struct platform_device *pdev)* bindings. It can be removed once we have a prober DMA controller * framework for DT. */ -if (pdev->dev.of_node &&cpu_is_pxa3xx ()) { +if (pdev->dev.of_node &&of_machine_is_compatible ("marvell,pxa3xx" )) { info->drcmr_dat =97 ; info->drcmr_cmd =99 ; }else {
Signature · 1 line
1.8.1.5
PATCH 3/5 mtd: nand: pxa3xx: Fix MODULE_DEVICE_TABLE declaration
In reply to Ezequiel GarciaFrom: Ezequiel Garcia <[email protected]>
This module's device table is incorrectly declared using i2c_pxa_dt_ids, instead of pxa3xx_nand_dt_ids.
--- drivers/mtd/nand/pxa3xx_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/pxa3xx_nand.c +1 -1
@@ -1185,7 +1185,7 @@ static struct of_device_id pxa3xx_nand_dt_ids[] = { { .compatible = "marvell,pxa3xx-nand" }, {} }; -MODULE_DEVICE_TABLE (of, i2c_pxa_dt_ids); +MODULE_DEVICE_TABLE (of, pxa3xx_nand_dt_ids);static int pxa3xx_nand_probe_dt (struct platform_device *pdev) {
Signature · 1 line
1.8.1.5
PATCH 4/5 mtd: nand: pxa3xx: Add address support for READID command
In reply to Ezequiel GarciaFrom: Ezequiel Garcia <[email protected]>
This allows to support READID ONFI command which sends 0x20 as address together with the 0x90 READID command.
This is required to detect ONFI compliant devices.
--- drivers/mtd/nand/pxa3xx_nand.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/pxa3xx_nand.c +1 -0
@@ -596,6 +596,7 @@ static int prepare_command_pool(struct pxa3xx_nand_info *info, int command, info->ndcb0 |=NDCB0_CMD_TYPE (3 ) |NDCB0_ADDR_CYC (1 ) | cmd; + info->ndcb1 = (column &0xFF ); info->data_size =8 ;break ;
Signature · 1 line
1.8.1.5
PATCH 5/5 mtd: nand: pxa3xx: Add support for Read parameter page command
In reply to Ezequiel GarciaFrom: Ezequiel Garcia <[email protected]>
This command is required to identify ONFI-compliant devices.
--- drivers/mtd/nand/pxa3xx_nand.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/mtd/nand/pxa3xx_nand.c +10 -0
@@ -590,6 +590,16 @@ static int prepare_command_pool(struct pxa3xx_nand_info *info, int command, | addr_cycle;break ; +case NAND_CMD_PARAM : + cmd =NAND_CMD_PARAM ; + info->buf_count =256 ; + info->ndcb0 |=NDCB0_CMD_TYPE (0 ) + |NDCB0_ADDR_CYC (1 ) + | cmd; + info->ndcb1 = (column &0xFF ); + info->data_size =256 ; +break ; +case NAND_CMD_READID : cmd = host->cmdset->read_id; info->buf_count = host->read_id_bytes;
Signature · 1 line
1.8.1.5
Hi,
(adding Eric Miao in Cc)
Quoted 7 lines · Ezequiel Garcia
The Armada 370 and Armada XP SoC include a NAND controller (NFCv2) that is similar to the one in PXA SoC. Therefore, it should be possible to support Armada NAND using pxa3xx-nand driver.
While this effort is not ready yet, here is a set of patches that are needed for such work.
Quoted 9 lines
A small summary of the patches:
* 1/5 is a fix for a 2-year regression that removed DMA support.
* 2/5 and 3/5 are needed to build the driver on platforms other PXA.
* 4/5 and 5/5 add ONFI-compliant device detection and are needed to successfully probe newer flash devices.
Since this patch affects directly the PXA hardware, I'd like to have some response from PXA maintainers.
Guys, could you take a look at this?
Thanks a lot,
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Quoted 18 lines · Ezequiel Garcia
Hi,
(adding Eric Miao in Cc)
Quoted 13 lines · Ezequiel Garcia
The Armada 370 and Armada XP SoC include a NAND controller (NFCv2) that is similar to the one in PXA SoC. Therefore, it should be possible to support Armada NAND using pxa3xx-nand driver.
While this effort is not ready yet, here is a set of patches that are needed for such work.
A small summary of the patches:
* 1/5 is a fix for a 2-year regression that removed DMA support.
* 2/5 and 3/5 are needed to build the driver on platforms other PXA.
Quoted 9 lines
Quoted 3 lines
* 4/5 and 5/5 add ONFI-compliant device detection and are needed to successfully probe newer flash devices.
Since this patch affects directly the PXA hardware, I'd like to have some response from PXA maintainers.
Guys, could you take a look at this?
Ping?
Signature · 1 line
Ezequiel
Quoted 27 lines · Ezequiel Garcia
Quoted 25 lines · Ezequiel Garcia
Hi,
(adding Eric Miao in Cc)
Quoted 7 lines · Ezequiel Garcia
The Armada 370 and Armada XP SoC include a NAND controller (NFCv2) that is similar to the one in PXA SoC. Therefore, it should be possible to support Armada NAND using pxa3xx-nand driver.
While this effort is not ready yet, here is a set of patches that are needed for such work.
Quoted 9 lines
A small summary of the patches:
* 1/5 is a fix for a 2-year regression that removed DMA support.
* 2/5 and 3/5 are needed to build the driver on platforms other PXA.
* 4/5 and 5/5 add ONFI-compliant device detection and are needed to successfully probe newer flash devices.
Since this patch affects directly the PXA hardware, I'd like to have some response from PXA maintainers.
Quoted 7 lines
Quoted 2 lines
Guys, could you take a look at this?
Ping?
--
Ezequiel
Hi Ezequiel,
As I didn't have the test environment, I looped some Marvell guys. But they didn't
have any time on test it.
So let's loop Marek, Daniel & Igor. I hope that we could help us.
By the way, my zylonite pxa310 fails on running uboot. I can't fix it right now.
Regards
Haojian
Haojian Zhuang
Reviewed-byQuoted 42 lines · Haojian Zhuang
Quoted 27 lines · Ezequiel Garcia
Quoted 25 lines · Ezequiel Garcia
Hi,
(adding Eric Miao in Cc)
Quoted 7 lines · Ezequiel Garcia
The Armada 370 and Armada XP SoC include a NAND controller (NFCv2) that is similar to the one in PXA SoC. Therefore, it should be possible to support Armada NAND using pxa3xx-nand driver.
While this effort is not ready yet, here is a set of patches that are needed for such work.
Quoted 9 lines
A small summary of the patches:
* 1/5 is a fix for a 2-year regression that removed DMA support.
* 2/5 and 3/5 are needed to build the driver on platforms other PXA.
* 4/5 and 5/5 add ONFI-compliant device detection and are needed to successfully probe newer flash devices.
Since this patch affects directly the PXA hardware, I'd like to have some response from PXA maintainers.
Quoted 7 lines
Quoted 2 lines
Guys, could you take a look at this?
Ping?
--
EzequielHi Ezequiel,
As I didn't have the test environment, I looped some Marvell guys. But they didn't
have any time on test it.
Quoted 6 lines
So let's loop Marek, Daniel & Igor. I hope that we could help us.
By the way, my zylonite pxa310 fails on running uboot. I can't fix it right now.
Regards
Haojian
I'm OK on these patches.
Quoted 37 lines · Haojian Zhuang
Quoted 36 lines · Haojian Zhuang
Quoted 34 lines · Ezequiel Garcia
Quoted 18 lines · Ezequiel Garcia
Hi,
(adding Eric Miao in Cc)
Quoted 13 lines · Ezequiel Garcia
The Armada 370 and Armada XP SoC include a NAND controller (NFCv2) that is similar to the one in PXA SoC. Therefore, it should be possible to support Armada NAND using pxa3xx-nand driver.
While this effort is not ready yet, here is a set of patches that are needed for such work.
A small summary of the patches:
* 1/5 is a fix for a 2-year regression that removed DMA support.
* 2/5 and 3/5 are needed to build the driver on platforms other PXA.
Quoted 9 lines
Quoted 3 lines
* 4/5 and 5/5 add ONFI-compliant device detection and are needed to successfully probe newer flash devices.
Since this patch affects directly the PXA hardware, I'd like to have some response from PXA maintainers.
Guys, could you take a look at this?
Ping?
--
Ezequiel
Quoted 8 lines
Quoted 8 lines
Hi Ezequiel,
As I didn't have the test environment, I looped some Marvell guys. But they didn't
have any time on test it.So let's loop Marek, Daniel & Igor. I hope that we could help us.
Great, thanks a lot! Let's hope they can give it a test...
Quoted 4 lines
I'm OK on these patches.
Reviewed-by Haojian Zhuang <[email protected]>
Great!
Thanks a lot,
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Hi Ezequiel,
Quoted 18 lines · Ezequiel Garcia
The Armada 370 and Armada XP SoC include a NAND controller (NFCv2) that is similar to the one in PXA SoC. Therefore, it should be possible to support Armada NAND using pxa3xx-nand driver.
While this effort is not ready yet, here is a set of patches that are needed for such work.
A small summary of the patches:
* 1/5 is a fix for a 2-year regression that removed DMA support.
* 2/5 and 3/5 are needed to build the driver on platforms other PXA.
* 4/5 and 5/5 add ONFI-compliant device detection and are needed to successfully probe newer flash devices.
Applies cleanly on top of l2-mtd.git.
Quoted 8 lines
Thanks!
Ezequiel Garcia (5):
mtd: nand: pxa3xx: Setinfo->use_dmaproperly
mtd: nand: pxa3xx: Useof_machine_is_compatible()
mtd: nand: pxa3xx: FixMODULE_DEVICE_TABLEdeclaration
mtd: nand: pxa3xx: Add address support for READID command
mtd: nand: pxa3xx: Add support for Read parameter page command
tested on cm-x300, upstream 3.10-rc5 and no regressions seen.
Quoted 4 lines
drivers/mtd/nand/pxa3xx_nand.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
Signature · 2 lines
Regards, Igor.
Nikita, Igor:
Quoted 28 lines · Igor Grinberg
Quoted 18 lines · Ezequiel Garcia
The Armada 370 and Armada XP SoC include a NAND controller (NFCv2) that is similar to the one in PXA SoC. Therefore, it should be possible to support Armada NAND using pxa3xx-nand driver.
While this effort is not ready yet, here is a set of patches that are needed for such work.
A small summary of the patches:
* 1/5 is a fix for a 2-year regression that removed DMA support.
* 2/5 and 3/5 are needed to build the driver on platforms other PXA.
* 4/5 and 5/5 add ONFI-compliant device detection and are needed to successfully probe newer flash devices.
Applies cleanly on top of l2-mtd.git.
Quoted 8 lines
Thanks!
Ezequiel Garcia (5):
mtd: nand: pxa3xx: Setinfo->use_dmaproperly
mtd: nand: pxa3xx: Useof_machine_is_compatible()
mtd: nand: pxa3xx: FixMODULE_DEVICE_TABLEdeclaration
mtd: nand: pxa3xx: Add address support for READID command
mtd: nand: pxa3xx: Add support for Read parameter page command
Quoted 5 lines
tested on cm-x300, upstream 3.10-rc5 and no regressions seen.
Tested-by Nikita Kiryanov <[email protected]>Acked-by Igor Grinberg <[email protected]>
Thanks a lot for the review and the test!
Artem, do you think this could be queued for v3.11?
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Hi Artem,
Quoted 33 lines · Ezequiel Garcia
Nikita, Igor:
Quoted 30 lines · Igor Grinberg
Quoted 18 lines · Ezequiel Garcia
The Armada 370 and Armada XP SoC include a NAND controller (NFCv2) that is similar to the one in PXA SoC. Therefore, it should be possible to support Armada NAND using pxa3xx-nand driver.
While this effort is not ready yet, here is a set of patches that are needed for such work.
A small summary of the patches:
* 1/5 is a fix for a 2-year regression that removed DMA support.
* 2/5 and 3/5 are needed to build the driver on platforms other PXA.
* 4/5 and 5/5 add ONFI-compliant device detection and are needed to successfully probe newer flash devices.
Applies cleanly on top of l2-mtd.git.
Quoted 8 lines
Thanks!
Ezequiel Garcia (5):
mtd: nand: pxa3xx: Setinfo->use_dmaproperly
mtd: nand: pxa3xx: Useof_machine_is_compatible()
mtd: nand: pxa3xx: FixMODULE_DEVICE_TABLEdeclaration
mtd: nand: pxa3xx: Add address support for READID command
mtd: nand: pxa3xx: Add support for Read parameter page commandtested on cm-x300, upstream 3.10-rc5 and no regressions seen.
Quoted 8 lines
Quoted 3 lines
Tested-by Nikita Kiryanov <[email protected]>Acked-by Igor Grinberg <[email protected]>Thanks a lot for the review and the test!
Artem, do you think this could be queued for v3.11?
I guess it's already too late to have this merged for v3.11, right?
Given this has Tested-by, Acked-by and Reviewed-by, I think it should be ready to apply. If there's anything you want me to review, just let me know.
Thanks!
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Quoted 7 lines · Ezequiel Garcia
Quoted 5 lines
Since this patch affects directly the PXA hardware, I'd like to have some response from PXA maintainers.
Guys, could you take a look at this?
Ping?
Hi Ezequiel,
sorry for long delay. I simply had no time to look an any of my open-source things, too busy.
I've pushed this series to l2-mtd.git, thanks!
Signature · 2 lines
Best Regards, Artem Bityutskiy
Quoted 4 lines · Artem Bityutskiy
Quoted 3 lines · Ezequiel Garcia
Quoted 3 lines
Since this patch affects directly the PXA hardware, I'd like to have some response from PXA maintainers.
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Guys, could you take a look at this?
Ping?
sorry for long delay. I simply had no time to look an any of my open-source things, too busy.
No worries...
Quoted 2 lines
I've pushed this series to l2-mtd.git, thanks!
Great, thanks!
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Hi Artem,
Quoted 7 lines · Artem Bityutskiy
Quoted 6 lines · Ezequiel Garcia
Quoted 5 lines
Since this patch affects directly the PXA hardware, I'd like to have some response from PXA maintainers.
Guys, could you take a look at this?
Quoted 8 lines
Quoted 1 line
Ping?
sorry for long delay. I simply had no time to look an any of my open-source things, too busy.
I've pushed this series to l2-mtd.git, thanks!
Thanks!
Any chance you can push this to some branch that's included in linux-next? (when you get back to work, of course)
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Hi Ezequiel,
Quoted 16 lines · Ezequiel Garcia
Hi Artem,
Quoted 13 lines · Artem Bityutskiy
Quoted 7 lines · Ezequiel Garcia
Quoted 5 lines
Since this patch affects directly the PXA hardware, I'd like to have some response from PXA maintainers.
Guys, could you take a look at this?
Ping?
sorry for long delay. I simply had no time to look an any of my open-source things, too busy.
Quoted 7 lines
Quoted 2 lines
I've pushed this series to l2-mtd.git, thanks!
Thanks!
Any chance you can push this to some branch that's included in linux-next? (when you get back to work, of course)
Artem's l2-mtd.git 'master' branch is already included in linux-next. Your patch series appears to be included as the following commit (and its parents):
commit 3f81a731d931cc66abec2d0c205c4a6ecda7dac9
Author: Ezequiel Garcia <[email protected]> Date: Tue May 14 08:15:25 2013 -0300
mtd: nand: pxa3xx: Add support for Read parameter page command
Regards,
Brian
Quoted 23 lines · Brian Norris
Hi Ezequiel,
Quoted 19 lines · Ezequiel Garcia
Hi Artem,
Quoted 15 lines · Artem Bityutskiy
Quoted 7 lines · Ezequiel Garcia
Quoted 5 lines
Since this patch affects directly the PXA hardware, I'd like to have some response from PXA maintainers.
Guys, could you take a look at this?
Ping?
sorry for long delay. I simply had no time to look an any of my open-source things, too busy.
I've pushed this series to l2-mtd.git, thanks!
Quoted 6 lines
Quoted 4 lines
Thanks!
Any chance you can push this to some branch that's included in linux-next? (when you get back to work, of course)
Artem's l2-mtd.git 'master' branch is already included in linux-next.
Indeed.
I checked before asking but somehow thought it wasn't...
Sorry for the noise and thanks!
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com