public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] mtd: nand: mxs: fix PIO_WORD number
@ 2015-02-11 12:55 Luca Ellero
  2015-02-11 20:37 ` Marek Vasut
  0 siblings, 1 reply; 3+ messages in thread
From: Luca Ellero @ 2015-02-11 12:55 UTC (permalink / raw)
  To: u-boot

As stated in the iMX6 Reference Manual (Ch. 14.2), the CMDPIOWORDS field
should reflect the number of pio_words sent in the actual DMA transfer.
In all these transfers there is only one pio_word, so data field must be 1.

Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com>
---
Changes for v2:
   - merge together all the patchset

 drivers/mtd/nand/mxs_nand.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
index 7a064ab..428a250 100644
--- a/drivers/mtd/nand/mxs_nand.c
+++ b/drivers/mtd/nand/mxs_nand.c
@@ -305,7 +305,7 @@ static void mxs_nand_cmd_ctrl(struct mtd_info *mtd, int data, unsigned int ctrl)
 	d->cmd.data =
 		MXS_DMA_DESC_COMMAND_DMA_READ | MXS_DMA_DESC_IRQ |
 		MXS_DMA_DESC_CHAIN | MXS_DMA_DESC_DEC_SEM |
-		MXS_DMA_DESC_WAIT4END | (3 << MXS_DMA_DESC_PIO_WORDS_OFFSET) |
+		MXS_DMA_DESC_WAIT4END | (1 << MXS_DMA_DESC_PIO_WORDS_OFFSET) |
 		(nand_info->cmd_queue_len << MXS_DMA_DESC_BYTES_OFFSET);
 
 	d->cmd.address = (dma_addr_t)nand_info->cmd_buf;
@@ -453,7 +453,7 @@ static void mxs_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int length)
 	d->cmd.data =
 		MXS_DMA_DESC_COMMAND_NO_DMAXFER | MXS_DMA_DESC_IRQ |
 		MXS_DMA_DESC_NAND_WAIT_4_READY | MXS_DMA_DESC_DEC_SEM |
-		MXS_DMA_DESC_WAIT4END | (4 << MXS_DMA_DESC_PIO_WORDS_OFFSET);
+		MXS_DMA_DESC_WAIT4END | (1 << MXS_DMA_DESC_PIO_WORDS_OFFSET);
 
 	d->cmd.address = 0;
 
@@ -510,7 +510,7 @@ static void mxs_nand_write_buf(struct mtd_info *mtd, const uint8_t *buf,
 	d->cmd.data =
 		MXS_DMA_DESC_COMMAND_DMA_READ | MXS_DMA_DESC_IRQ |
 		MXS_DMA_DESC_DEC_SEM | MXS_DMA_DESC_WAIT4END |
-		(4 << MXS_DMA_DESC_PIO_WORDS_OFFSET) |
+		(1 << MXS_DMA_DESC_PIO_WORDS_OFFSET) |
 		(length << MXS_DMA_DESC_BYTES_OFFSET);
 
 	d->cmd.address = (dma_addr_t)nand_info->data_buf;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2] mtd: nand: mxs: fix PIO_WORD number
  2015-02-11 12:55 [U-Boot] [PATCH v2] mtd: nand: mxs: fix PIO_WORD number Luca Ellero
@ 2015-02-11 20:37 ` Marek Vasut
  2015-02-12  7:53   ` Luca Ellero
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2015-02-11 20:37 UTC (permalink / raw)
  To: u-boot

On Wednesday, February 11, 2015 at 01:55:16 PM, Luca Ellero wrote:
> As stated in the iMX6 Reference Manual (Ch. 14.2), the CMDPIOWORDS field
> should reflect the number of pio_words sent in the actual DMA transfer.
> In all these transfers there is only one pio_word, so data field must be 1.
> 
> Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com>

This was tested on MX6 only, right ?

Reviewed-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2] mtd: nand: mxs: fix PIO_WORD number
  2015-02-11 20:37 ` Marek Vasut
@ 2015-02-12  7:53   ` Luca Ellero
  0 siblings, 0 replies; 3+ messages in thread
From: Luca Ellero @ 2015-02-12  7:53 UTC (permalink / raw)
  To: u-boot

On 11/02/2015 21:37, Marek Vasut wrote:
> On Wednesday, February 11, 2015 at 01:55:16 PM, Luca Ellero wrote:
>> As stated in the iMX6 Reference Manual (Ch. 14.2), the CMDPIOWORDS field
>> should reflect the number of pio_words sent in the actual DMA transfer.
>> In all these transfers there is only one pio_word, so data field must be 1.
>>
>> Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com>
>
> This was tested on MX6 only, right ?
>
> Reviewed-by: Marek Vasut <marex@denx.de>
>
> Best regards,
> Marek Vasut
>

Yes, I tested it only on iMX6.
Regards
Luca Ellero


-- 
Luca Ellero

E-mail: luca.ellero at brickedbrain.com
Internet: www.brickedbrain.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-12  7:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-11 12:55 [U-Boot] [PATCH v2] mtd: nand: mxs: fix PIO_WORD number Luca Ellero
2015-02-11 20:37 ` Marek Vasut
2015-02-12  7:53   ` Luca Ellero

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox