pm9263: add nand support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Ilko Iliev <iliev@ronetix.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
78c8011603
commit
2e092539f5
|
@ -191,7 +191,11 @@ CONFIG_DRIVER_CFI_BANK_WIDTH_2=y
|
|||
CONFIG_DRIVER_CFI_BANK_WIDTH_4=y
|
||||
# CONFIG_DRIVER_CFI_BANK_WIDTH_8 is not set
|
||||
CONFIG_CFI_BUFFER_WRITE=y
|
||||
# CONFIG_NAND is not set
|
||||
CONFIG_NAND=y
|
||||
CONFIG_NAND_ATMEL=y
|
||||
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
|
||||
# CONFIG_MTD_NAND_ECC_SMC is not set
|
||||
CONFIG_MTD_NAND_IDS=y
|
||||
|
||||
#
|
||||
# Filesystem support
|
||||
|
|
|
@ -37,6 +37,55 @@
|
|||
#include <mach/board.h>
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/io.h>
|
||||
#include <mach/at91sam9_smc.h>
|
||||
#include <mach/sam9_smc.h>
|
||||
|
||||
static struct atmel_nand_data nand_pdata = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
/* .det_pin = ... not connected */
|
||||
.ecc_base = (void __iomem *)(AT91_BASE_SYS + AT91_ECC0),
|
||||
.ecc_mode = NAND_ECC_HW,
|
||||
.rdy_pin = AT91_PIN_PB30,
|
||||
.enable_pin = AT91_PIN_PD15,
|
||||
#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
|
||||
.bus_width_16 = 1,
|
||||
#else
|
||||
.bus_width_16 = 0,
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct sam9_smc_config pm_nand_smc_config = {
|
||||
.ncs_read_setup = 1,
|
||||
.nrd_setup = 1,
|
||||
.ncs_write_setup = 1,
|
||||
.nwe_setup = 1,
|
||||
|
||||
.ncs_read_pulse = 3,
|
||||
.nrd_pulse = 3,
|
||||
.ncs_write_pulse = 3,
|
||||
.nwe_pulse = 3,
|
||||
|
||||
.read_cycle = 5,
|
||||
.write_cycle = 5,
|
||||
|
||||
.mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
|
||||
.tdf_cycles = 2,
|
||||
};
|
||||
|
||||
static void pm_add_device_nand(void)
|
||||
{
|
||||
/* setup bus-width (8 or 16) */
|
||||
if (nand_pdata.bus_width_16)
|
||||
pm_nand_smc_config.mode |= AT91_SMC_DBW_16;
|
||||
else
|
||||
pm_nand_smc_config.mode |= AT91_SMC_DBW_8;
|
||||
|
||||
/* configure chip-select 3 (NAND) */
|
||||
sam9_smc_configure(3, &pm_nand_smc_config);
|
||||
|
||||
at91_add_device_nand(&nand_pdata);
|
||||
}
|
||||
|
||||
static struct device_d cfi_dev = {
|
||||
.name = "cfi_flash",
|
||||
|
@ -63,6 +112,7 @@ static int pm9263_devices_init(void)
|
|||
at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_EMAC);
|
||||
|
||||
at91_add_device_sdram(64 * 1024 * 1024);
|
||||
pm_add_device_nand();
|
||||
at91_add_device_eth(&macb_pdata);
|
||||
register_device(&cfi_dev);
|
||||
|
||||
|
|
Loading…
Reference in New Issue