|
@@ -318,3 +318,89 @@ static struct mtd_partition da830_evm_nand_partitions[] = {
|
|
|
.name = "params",
|
|
|
.offset = MTDPART_OFS_APPEND,
|
|
|
.size = SZ_128K,
|
|
|
+ .mask_flags = MTD_WRITEABLE, /* force read-only */
|
|
|
+ },
|
|
|
+ /* kernel */
|
|
|
+ [2] = {
|
|
|
+ .name = "kernel",
|
|
|
+ .offset = MTDPART_OFS_APPEND,
|
|
|
+ .size = SZ_2M,
|
|
|
+ .mask_flags = 0,
|
|
|
+ },
|
|
|
+ /* file system */
|
|
|
+ [3] = {
|
|
|
+ .name = "filesystem",
|
|
|
+ .offset = MTDPART_OFS_APPEND,
|
|
|
+ .size = MTDPART_SIZ_FULL,
|
|
|
+ .mask_flags = 0,
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/* flash bbt decriptors */
|
|
|
+static uint8_t da830_evm_nand_bbt_pattern[] = { 'B', 'b', 't', '0' };
|
|
|
+static uint8_t da830_evm_nand_mirror_pattern[] = { '1', 't', 'b', 'B' };
|
|
|
+
|
|
|
+static struct nand_bbt_descr da830_evm_nand_bbt_main_descr = {
|
|
|
+ .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE |
|
|
|
+ NAND_BBT_WRITE | NAND_BBT_2BIT |
|
|
|
+ NAND_BBT_VERSION | NAND_BBT_PERCHIP,
|
|
|
+ .offs = 2,
|
|
|
+ .len = 4,
|
|
|
+ .veroffs = 16,
|
|
|
+ .maxblocks = 4,
|
|
|
+ .pattern = da830_evm_nand_bbt_pattern
|
|
|
+};
|
|
|
+
|
|
|
+static struct nand_bbt_descr da830_evm_nand_bbt_mirror_descr = {
|
|
|
+ .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE |
|
|
|
+ NAND_BBT_WRITE | NAND_BBT_2BIT |
|
|
|
+ NAND_BBT_VERSION | NAND_BBT_PERCHIP,
|
|
|
+ .offs = 2,
|
|
|
+ .len = 4,
|
|
|
+ .veroffs = 16,
|
|
|
+ .maxblocks = 4,
|
|
|
+ .pattern = da830_evm_nand_mirror_pattern
|
|
|
+};
|
|
|
+
|
|
|
+static struct davinci_aemif_timing da830_evm_nandflash_timing = {
|
|
|
+ .wsetup = 24,
|
|
|
+ .wstrobe = 21,
|
|
|
+ .whold = 14,
|
|
|
+ .rsetup = 19,
|
|
|
+ .rstrobe = 50,
|
|
|
+ .rhold = 0,
|
|
|
+ .ta = 20,
|
|
|
+};
|
|
|
+
|
|
|
+static struct davinci_nand_pdata da830_evm_nand_pdata = {
|
|
|
+ .parts = da830_evm_nand_partitions,
|
|
|
+ .nr_parts = ARRAY_SIZE(da830_evm_nand_partitions),
|
|
|
+ .ecc_mode = NAND_ECC_HW,
|
|
|
+ .ecc_bits = 4,
|
|
|
+ .bbt_options = NAND_BBT_USE_FLASH,
|
|
|
+ .bbt_td = &da830_evm_nand_bbt_main_descr,
|
|
|
+ .bbt_md = &da830_evm_nand_bbt_mirror_descr,
|
|
|
+ .timing = &da830_evm_nandflash_timing,
|
|
|
+};
|
|
|
+
|
|
|
+static struct resource da830_evm_nand_resources[] = {
|
|
|
+ [0] = { /* First memory resource is NAND I/O window */
|
|
|
+ .start = DA8XX_AEMIF_CS3_BASE,
|
|
|
+ .end = DA8XX_AEMIF_CS3_BASE + PAGE_SIZE - 1,
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
+ },
|
|
|
+ [1] = { /* Second memory resource is AEMIF control registers */
|
|
|
+ .start = DA8XX_AEMIF_CTL_BASE,
|
|
|
+ .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1,
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device da830_evm_nand_device = {
|
|
|
+ .name = "davinci_nand",
|
|
|
+ .id = 1,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &da830_evm_nand_pdata,
|
|
|
+ },
|
|
|
+ .num_resources = ARRAY_SIZE(da830_evm_nand_resources),
|
|
|
+ .resource = da830_evm_nand_resources,
|