From 1c5794a13e9baeafbace8cc1f1890b9e0a3b575c Mon Sep 17 00:00:00 2001 From: "Wu, Josh" Date: Wed, 5 Sep 2012 22:14:28 +0000 Subject: at91sam9x5: set default EBI I/O drive configuration. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch configure at91sam9x5's EBI drive I/O. Without this, When SD card boot, the nand flash read/write are not stable. Which will cause kernel MTD test fail (Since mainline kernel doesn't configure the EBI register). Signed-off-by: Josh Wu Signed-off-by: Andreas Bießmann --- board/atmel/at91sam9x5ek/at91sam9x5ek.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/board/atmel/at91sam9x5ek/at91sam9x5ek.c b/board/atmel/at91sam9x5ek/at91sam9x5ek.c index ae408bc..06028aa 100644 --- a/board/atmel/at91sam9x5ek/at91sam9x5ek.c +++ b/board/atmel/at91sam9x5ek/at91sam9x5ek.c @@ -62,6 +62,10 @@ static void at91sam9x5ek_nand_hw_init(void) csa |= AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA; /* NAND flash on D16 */ csa |= AT91_MATRIX_NFD0_ON_D16; + + /* Configure IO drive */ + csa &= ~AT91_MATRIX_EBI_EBI_IOSR_NORMAL; + writel(csa, &matrix->ebicsa); /* Configure SMC CS3 for NAND/SmartMedia */ -- cgit v1.1 From b9c83c68151636656c15d069397a716932872bd7 Mon Sep 17 00:00:00 2001 From: "Wu, Josh" Date: Sun, 9 Sep 2012 23:45:49 +0000 Subject: atmel_nand: fix the U-Boot output information about nand flash with PMECC enable. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before the patch, it looks like: |U-Boot 2012.07-00441-gd578d6f-dirty (Sep 10 2012 - 16:11:06) | |CPU: AT91SAM9G35 |Crystal frequency: 12 MHz |CPU clock : 400 MHz |Master clock : 133.333 MHz |DRAM: 128 MiB |WARNING: Caches not enabled > |NAND: Initialize PMECC params, cap: 2, sector: 512 > |256 MiB |MMC: mci: 0 |In: serial |Out: serial |Err: serial |Net: macb0 |Hit any key to stop autoboot: 0 After the patch: |U-Boot 2012.07-00441-gd578d6f-dirty (Sep 10 2012 - 16:18:11) | |CPU: AT91SAM9G35 |Crystal frequency: 12 MHz |CPU clock : 400 MHz |Master clock : 133.333 MHz |DRAM: 128 MiB |WARNING: Caches not enabled > |NAND: 256 MiB | ... ... |Hit any key to stop autoboot: 0 Signed-off-by: Josh Wu Signed-off-by: Andreas Bießmann --- drivers/mtd/nand/atmel_nand.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index c6aa5db..994dd9f 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -652,8 +652,9 @@ static int atmel_pmecc_nand_init_params(struct nand_chip *nand, sector_size = host->pmecc_sector_size = CONFIG_PMECC_SECTOR_SIZE; host->pmecc_index_table_offset = CONFIG_PMECC_INDEX_TABLE_OFFSET; - printk(KERN_INFO "Initialize PMECC params, cap: %d, sector: %d\n", - cap, sector_size); + MTDDEBUG(MTD_DEBUG_LEVEL1, + "Initialize PMECC params, cap: %d, sector: %d\n", + cap, sector_size); host->pmecc = (struct pmecc_regs __iomem *) ATMEL_BASE_PMECC; host->pmerrloc = (struct pmecc_errloc_regs __iomem *) -- cgit v1.1 From 053a4d1f5d6be74288460b8fceaa09ba3e35768c Mon Sep 17 00:00:00 2001 From: Bo Shen Date: Wed, 15 Aug 2012 18:44:25 +0000 Subject: spi: add atmel at25df321 serial flash support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add atmel at25df321 serial flash support Signed-off-by: Bo Shen Signed-off-by: Andreas Bießmann --- drivers/mtd/spi/atmel.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mtd/spi/atmel.c b/drivers/mtd/spi/atmel.c index 1ecece0..89ebe9d 100644 --- a/drivers/mtd/spi/atmel.c +++ b/drivers/mtd/spi/atmel.c @@ -109,6 +109,14 @@ static const struct atmel_spi_flash_params atmel_spi_flash_table[] = { .nr_sectors = 32, .name = "AT45DB642D", }, + { + .idcode1 = 0x47, + .l2_page_size = 8, + .pages_per_block = 16, + .blocks_per_sector = 16, + .nr_sectors = 64, + .name = "AT25DF321", + }, }; static int at45_wait_ready(struct spi_flash *flash, unsigned long timeout) @@ -515,6 +523,8 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode) case DF_FAMILY_AT26F: case DF_FAMILY_AT26DF: asf->flash.read = spi_flash_cmd_read_fast; + asf->flash.write = dataflash_write_p2; + asf->flash.erase = dataflash_erase_p2; break; default: -- cgit v1.1 From 83fd09a0491034ee28c6948732b570f3e9e15b68 Mon Sep 17 00:00:00 2001 From: Bo Shen Date: Sun, 19 Aug 2012 20:32:21 +0000 Subject: spiflash: at25: using common spi flash operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using common spi flash operation function to replace private operation funtion Signed-off-by: Bo Shen Signed-off-by: Andreas Bießmann --- drivers/mtd/spi/atmel.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/spi/atmel.c b/drivers/mtd/spi/atmel.c index 89ebe9d..006f6d5 100644 --- a/drivers/mtd/spi/atmel.c +++ b/drivers/mtd/spi/atmel.c @@ -518,13 +518,19 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode) asf->flash.erase = dataflash_erase_p2; } + asf->flash.page_size = page_size; + asf->flash.sector_size = page_size; break; case DF_FAMILY_AT26F: case DF_FAMILY_AT26DF: asf->flash.read = spi_flash_cmd_read_fast; - asf->flash.write = dataflash_write_p2; - asf->flash.erase = dataflash_erase_p2; + asf->flash.write = spi_flash_cmd_write_multi; + asf->flash.erase = spi_flash_cmd_erase; + asf->flash.page_size = page_size; + asf->flash.sector_size = 4096; + /* clear SPRL# bit for locked flash */ + spi_flash_cmd_write_status(&asf->flash, 0); break; default: @@ -532,7 +538,6 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode) goto err; } - asf->flash.sector_size = page_size; asf->flash.size = page_size * params->pages_per_block * params->blocks_per_sector * params->nr_sectors; -- cgit v1.1 From dc3e30bab7c5ef87bd24ebcbb7cdfc3fb2b44555 Mon Sep 17 00:00:00 2001 From: Bo Shen Date: Tue, 4 Sep 2012 23:22:55 +0000 Subject: Atmel: sam9g10/9m10/9x5: Add support to boot DT kernel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mainline linux kernel is moving to flatten device tree support Add the CONFIG_OF_LIBFDT option to support booting DT linux kernel Signed-off-by: Bo Shen Signed-off-by: Andreas Bießmann --- include/configs/at91sam9261ek.h | 2 ++ include/configs/at91sam9m10g45ek.h | 2 ++ include/configs/at91sam9x5ek.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h index 1e1fbe5..611e3e2 100644 --- a/include/configs/at91sam9261ek.h +++ b/include/configs/at91sam9261ek.h @@ -48,6 +48,8 @@ #define CONFIG_DISPLAY_CPUINFO +#define CONFIG_OF_LIBFDT + #define CONFIG_ATMEL_LEGACY #define CONFIG_SYS_TEXT_BASE 0x21f00000 diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h index 4ca280a..e988d81 100644 --- a/include/configs/at91sam9m10g45ek.h +++ b/include/configs/at91sam9m10g45ek.h @@ -47,6 +47,8 @@ #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_DISPLAY_CPUINFO +#define CONFIG_OF_LIBFDT + /* general purpose I/O */ #define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */ #define CONFIG_AT91_GPIO diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h index 1ceb31a..cbdc3e9 100644 --- a/include/configs/at91sam9x5ek.h +++ b/include/configs/at91sam9x5ek.h @@ -42,6 +42,8 @@ #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_DISPLAY_CPUINFO +#define CONFIG_OF_LIBFDT + /* general purpose I/O */ #define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */ #define CONFIG_AT91_GPIO -- cgit v1.1