[PATCH 1/2] nand: pxa3xx: Increase READ_ID buffer and make the size static
Jonas Gorski
jogo at openwrt.org
Fri Aug 14 09:12:22 PDT 2015
Hi,
On Mon, Aug 3, 2015 at 4:31 PM, Ezequiel Garcia
<ezequiel at vanguardiasur.com.ar> wrote:
> The read ID count should be made as large as the maximum READ_ID size,
> so there's no need to have dynamic size. This commit sets the hardware
> maximum read ID count, which should be more than enough on all cases.
> Also, we get rid of the read_id_bytes, and use a macro instead.
>
> Signed-off-by: Ezequiel Garcia <ezequiel at vanguardiasur.com.ar>
> ---
> drivers/mtd/nand/pxa3xx_nand.c | 28 ++++++----------------------
> 1 file changed, 6 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
> index 1259cc5..0815f11 100644
> --- a/drivers/mtd/nand/pxa3xx_nand.c
> +++ b/drivers/mtd/nand/pxa3xx_nand.c
> @@ -126,6 +126,8 @@
> #define EXT_CMD_TYPE_LAST_RW 1 /* Last naked read/write */
> #define EXT_CMD_TYPE_MONO 0 /* Monolithic read/write */
>
> +#define READ_ID_BYTES 7 /* Large enough to read 'JEDEC' */
> +
> /* macros for registers read/write */
> #define nand_writel(info, off, val) \
> writel_relaxed((val), (info)->mmio_base + (off))
> @@ -173,8 +175,6 @@ struct pxa3xx_nand_host {
> /* calculated from pxa3xx_nand_flash data */
> unsigned int col_addr_cycles;
> unsigned int row_addr_cycles;
> - size_t read_id_bytes;
> -
> };
>
> struct pxa3xx_nand_info {
> @@ -910,13 +910,13 @@ static int prepare_set_command(struct pxa3xx_nand_info *info, int command,
> break;
>
> case NAND_CMD_READID:
> - info->buf_count = host->read_id_bytes;
> + info->buf_count = READ_ID_BYTES;
> info->ndcb0 |= NDCB0_CMD_TYPE(3)
> | NDCB0_ADDR_CYC(1)
> | command;
> info->ndcb1 = (column & 0xFF);
>
> - info->data_size = 8;
> + info->data_size = READ_ID_BYTES;
You are reducing ->data_size from 8 to 7 here, is this intentional?
Jonas
More information about the linux-mtd
mailing list