public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/9] sf: Update Atmel flash params
Date: Fri, 9 Jan 2015 17:27:17 +0800	[thread overview]
Message-ID: <54AF9EF5.4010003@atmel.com> (raw)
In-Reply-To: <1418215892-17617-3-git-send-email-bmeng.cn@gmail.com>

Hi Meng,

On 12/10/2014 08:51 PM, Bin Meng wrote:
> Update flash sector size to 4KiB as long as flash supports sector
> erase (20h) command. Correct AT25DF321 JEDEC ID and bulk erase
> command to 50h instead of D8h. Also add AT25DF321A params per
> datasheet.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>   drivers/mtd/spi/sf_internal.h |  5 +++++
>   drivers/mtd/spi/sf_params.c   | 17 +++++++++--------
>   drivers/mtd/spi/sf_probe.c    |  4 ++++
>   3 files changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
> index 785f7a9..8010fc5 100644
> --- a/drivers/mtd/spi/sf_internal.h
> +++ b/drivers/mtd/spi/sf_internal.h
> @@ -106,6 +106,11 @@ enum {
>   #define SPI_FLASH_PAGE_ERASE_TIMEOUT		(5 * CONFIG_SYS_HZ)
>   #define SPI_FLASH_SECTOR_ERASE_TIMEOUT	(10 * CONFIG_SYS_HZ)
>
> +/* Atmel specific */
> +#ifdef CONFIG_SPI_FLASH_ATMEL
> +# define CMD_ATMEL_BLK_ERASE	0x50
> +#endif
> +
>   /* SST specific */
>   #ifdef CONFIG_SPI_FLASH_SST
>   # define CMD_SST_BP		0x02    /* Byte Program */
> diff --git a/drivers/mtd/spi/sf_params.c b/drivers/mtd/spi/sf_params.c
> index 5482700..cc4cd60 100644
> --- a/drivers/mtd/spi/sf_params.c
> +++ b/drivers/mtd/spi/sf_params.c
> @@ -15,14 +15,15 @@
>   /* SPI/QSPI flash device params structure */
>   const struct spi_flash_params spi_flash_params_table[] = {
>   #ifdef CONFIG_SPI_FLASH_ATMEL		/* ATMEL */
> -	{"AT45DB011D",	   0x1f2200, 0x0,	64 * 1024,     4, RD_NORM,		    SECT_4K},
> -	{"AT45DB021D",	   0x1f2300, 0x0,	64 * 1024,     8, RD_NORM,		    SECT_4K},
> -	{"AT45DB041D",	   0x1f2400, 0x0,	64 * 1024,     8, RD_NORM,		    SECT_4K},
> -	{"AT45DB081D",	   0x1f2500, 0x0,	64 * 1024,    16, RD_NORM,		    SECT_4K},
> -	{"AT45DB161D",	   0x1f2600, 0x0,	64 * 1024,    32, RD_NORM,		    SECT_4K},
> -	{"AT45DB321D",	   0x1f2700, 0x0,	64 * 1024,    64, RD_NORM,		    SECT_4K},
> -	{"AT45DB641D",	   0x1f2800, 0x0,	64 * 1024,   128, RD_NORM,		    SECT_4K},
> -	{"AT25DF321",      0x1f4701, 0x0,	64 * 1024,    64, RD_NORM,		    SECT_4K},
> +	{"AT45DB011D",	   0x1f2200, 0x0,	 2 * 1024,    64, RD_NORM,		          0},
> +	{"AT45DB021D",	   0x1f2300, 0x0,	 2 * 1024,   128, RD_NORM,		          0},
> +	{"AT45DB041D",	   0x1f2400, 0x0,	 2 * 1024,   256, RD_NORM,		          0},
> +	{"AT45DB081D",	   0x1f2500, 0x0,	 2 * 1024,   512, RD_NORM,		          0},
> +	{"AT45DB161D",	   0x1f2600, 0x0,	 4 * 1024,   512, RD_NORM,		          0},
> +	{"AT45DB321D",	   0x1f2700, 0x0,	 4 * 1024,  1024, RD_NORM,		          0},

In datasheet, the id is 0x1f2701. Doc number is: 3597Q-DFLASH-6/11. I 
can not find any new datasheet.

And I test on at91sam9m10g45ek board, it also read as this ID (0x1f2701).

So, if you plan to send new version, can you help add this ID? If not, 
maybe follow up patch will be better.

Thanks.

> +	{"AT45DB641D",	   0x1f2800, 0x0,	 2 * 1024,  4096, RD_NORM,		          0},
> +	{"AT25DF321",      0x1f4700, 0x0,	 4 * 1024,  1024, RD_NORM,		    SECT_4K},
> +	{"AT25DF321A",     0x1f4701, 0x0,	 4 * 1024,  1024, RD_NORM,		    SECT_4K},
>   #endif
>   #ifdef CONFIG_SPI_FLASH_EON		/* EON */
>   	{"EN25Q32B",	   0x1c3016, 0x0,	64 * 1024,    64, RD_NORM,			  0},
> diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
> index ce9987f..13fda44 100644
> --- a/drivers/mtd/spi/sf_probe.c
> +++ b/drivers/mtd/spi/sf_probe.c
> @@ -179,7 +179,11 @@ static int spi_flash_validate_params(struct spi_slave *spi, u8 *idcode,
>   		flash->erase_cmd = CMD_ERASE_32K;
>   		flash->erase_size = 32768 << flash->shift;
>   	} else {
> +#ifdef CONFIG_SPI_FLASH_ATMEL
> +		flash->erase_cmd = CMD_ATMEL_BLK_ERASE;
> +#else
>   		flash->erase_cmd = CMD_ERASE_64K;
> +#endif
>   		flash->erase_size = flash->sector_size;
>   	}
>
>

Best Regards,
Bo Shen

  reply	other threads:[~2015-01-09  9:27 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10 12:51 [U-Boot] [PATCH v3 0/9] sf: Update flash params for supported read commands and sector size Bin Meng
2014-12-10 12:51 ` [U-Boot] [PATCH v3 1/9] sf: Update SST flash params Bin Meng
2015-04-16 18:09   ` Jagan Teki
2015-04-17  1:44     ` Bin Meng
2015-04-17  8:48       ` Jagan Teki
2015-04-20  9:32         ` Bin Meng
2015-04-21 12:47           ` Jagan Teki
2015-04-22  6:44             ` Bin Meng
2015-04-22  7:03               ` Jagan Teki
2015-04-22  7:14                 ` Bin Meng
2015-04-22  8:06                   ` Jagan Teki
2015-04-22  8:43                     ` Bin Meng
2015-04-22  9:15                       ` Jagan Teki
2015-04-22  9:32                         ` Bin Meng
2015-04-22  9:52                           ` Jagan Teki
2014-12-10 12:51 ` [U-Boot] [PATCH v3 2/9] sf: Update Atmel " Bin Meng
2015-01-09  9:27   ` Bo Shen [this message]
2015-01-12  3:32     ` Bin Meng
2014-12-10 12:51 ` [U-Boot] [PATCH v3 3/9] sf: Update EON " Bin Meng
2014-12-10 18:31   ` Jagan Teki
2014-12-11  2:33     ` Bin Meng
2014-12-10 12:51 ` [U-Boot] [PATCH v3 4/9] sf: Update GigaDevice " Bin Meng
2014-12-10 12:51 ` [U-Boot] [PATCH v3 5/9] sf: Update Macronix " Bin Meng
2014-12-10 12:51 ` [U-Boot] [PATCH v3 6/9] sf: Update Spansion " Bin Meng
2014-12-10 20:09   ` Jagan Teki
2014-12-11  2:53     ` Bin Meng
2014-12-10 12:51 ` [U-Boot] [PATCH v3 7/9] sf: Update Micron " Bin Meng
2014-12-10 12:51 ` [U-Boot] [PATCH v3 8/9] sf: Update Winbond " Bin Meng
2014-12-10 12:51 ` [U-Boot] [PATCH v3 9/9] sf: Give proper spacing between flash table params Bin Meng
2014-12-10 18:41 ` [U-Boot] [PATCH v3 0/9] sf: Update flash params for supported read commands and sector size Jagan Teki
2014-12-11  3:04   ` Bin Meng
2014-12-11  7:26     ` Jagan Teki
2014-12-11  7:40       ` Bin Meng
2014-12-15 13:51         ` Bin Meng
2014-12-17  7:59           ` Jagan Teki
2014-12-17  8:02             ` Bin Meng
2014-12-17  8:39               ` Jagan Teki
2015-01-12  3:42                 ` Bin Meng
2015-01-12  6:52                   ` Jagan Teki
2015-01-24 10:34                     ` Bin Meng
2015-01-27 13:50                       ` Bin Meng
2015-03-03  8:31                         ` Bin Meng
2015-03-03 22:52                           ` Tom Rini
2015-03-04  3:32                             ` Bin Meng
2015-03-05 17:43                               ` Jagan Teki
2015-03-06  1:00                                 ` Bin Meng
2015-03-06 10:21                                   ` Jagan Teki
2015-04-15  1:06                                     ` Bin Meng

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=54AF9EF5.4010003@atmel.com \
    --to=voice.shen@atmel.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox