diff options
Diffstat (limited to 'arch/arm/plat-aspeed/dev-spi.c')
-rw-r--r-- | arch/arm/plat-aspeed/dev-spi.c | 74 |
1 files changed, 60 insertions, 14 deletions
diff --git a/arch/arm/plat-aspeed/dev-spi.c b/arch/arm/plat-aspeed/dev-spi.c index 7ddd2e437212..e22c49ea3cbf 100644 --- a/arch/arm/plat-aspeed/dev-spi.c +++ b/arch/arm/plat-aspeed/dev-spi.c @@ -210,8 +210,8 @@ static struct ast_spi_driver_data ast_spi0_data = { static struct resource ast_spi_resource0[] = { { - .start = AST_SPI0_BASE, - .end = AST_SPI0_BASE + SZ_16, + .start = AST_SPI_BASE, + .end = AST_SPI_BASE + SZ_16, .flags = IORESOURCE_MEM, }, { @@ -299,21 +299,21 @@ static struct mtd_partition ast_spi_flash_partitions[] = { static struct mtd_partition ast_spi_flash_partitions[] = { { .name = "u-boot", - .offset = 0, - .size = 0x80000, + .offset = 0, /* From 0 */ + .size = 0x60000, /* Size 384K */ .mask_flags = MTD_WRITEABLE, + }, { + .name = "env", + .offset = 0x60000, /* From 384K */ + .size = 0x20000, /* Size 128K, two sectors */ }, { - .name = "kernel", - .offset = 0x80000, - .size = 0x200000, + .name = "kernel", + .offset = 0x80000, /* From 512K */ + .size = 0x200000, /* Size 2M */ }, { - .name = "rootfs", - .offset = 0x300000, - .size = 0x4F0000, - }, { - .name = "env", - .offset = 0x7f0000, - .size = 0x10000, + .name = "rootfs", + .offset = 0x300000, /* From 3M */ + .size = 0xC00000, /* Size 12M */ }, { .name = "data0", .offset = MTDPART_OFS_APPEND, @@ -334,7 +334,34 @@ static struct flash_platform_data ast_spi_flash_data = { .parts = ast_spi_flash_partitions, }; +#ifdef CONFIG_ARCH_AST2400 +static struct flash_platform_data wedge_spi_flash_data = { + .type = "n25q128a13", + .nr_parts = ARRAY_SIZE(ast_spi_flash_partitions), + .parts = ast_spi_flash_partitions, +}; +#endif + + +/* Device info for the flash on ast-spi */ +#ifdef CONFIG_ARCH_AST2400 +static struct mtd_partition ast_spi5_flash_partitions[] = { + { + .name = "led-fpga", + .offset = 0, /* From 0 */ + .size = MTDPART_SIZ_FULL, + }, +}; + +static struct flash_platform_data wedge_spi5_flash_data = { + .type = "at45db011d", + .nr_parts = ARRAY_SIZE(ast_spi5_flash_partitions), + .parts = ast_spi5_flash_partitions, +}; +#endif + static struct spi_board_info ast_spi_devices[] = { +#if 0 { .modalias = "m25p80", .platform_data = &ast_spi_flash_data, @@ -343,6 +370,25 @@ static struct spi_board_info ast_spi_devices[] = { .bus_num = 0, // This chooses if SPI0 or SPI1 of the SoC is used. .mode = SPI_MODE_0, }, +#endif +#ifdef CONFIG_ARCH_AST2400 + { + .modalias = "mtd_dataflash", + .platform_data = &wedge_spi5_flash_data, + .chip_select = 0, + .max_speed_hz = 33 * 1000 * 1000, + .bus_num = 5, + .mode = SPI_MODE_0, + }, + { + .modalias = "m25p80", + .platform_data = &wedge_spi_flash_data, + .chip_select = 0, //.chip_select This tells your device driver which chipselect to use. + .max_speed_hz = 50 * 1000 * 1000, + .bus_num = 0, // This chooses if SPI0 or SPI1 of the SoC is used. + .mode = SPI_MODE_0, + }, +#endif { .modalias = "spidev", .chip_select = 0, |