From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Mon, 12 Jan 2015 11:32:43 +0800 Subject: [U-Boot] [PATCH v3 2/9] sf: Update Atmel flash params In-Reply-To: <54AF9EF5.4010003@atmel.com> References: <1418215892-17617-1-git-send-email-bmeng.cn@gmail.com> <1418215892-17617-3-git-send-email-bmeng.cn@gmail.com> <54AF9EF5.4010003@atmel.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Bo, On Fri, Jan 9, 2015 at 5:27 PM, Bo Shen wrote: > 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 >> --- >> >> 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. > Yes, I do plan to send a new version. However I am still waiting for Jagan's testing results of this patch series. I checked the AT45DB321D datasheet, the flash ID is indeed 0x1f2701. So the original value on the params table is wrong. I will fix this in the v4 patch. [snip] Regards, Bin