|
@@ -419,3 +419,160 @@ static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int
|
|
|
static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
|
|
|
{
|
|
|
return gpio_get_value(BFIN_NAND_PLAT_READY);
|
|
|
+}
|
|
|
+
|
|
|
+static struct platform_nand_data bfin_plat_nand_data = {
|
|
|
+ .chip = {
|
|
|
+ .nr_chips = 1,
|
|
|
+ .chip_delay = 30,
|
|
|
+ .part_probe_types = part_probes,
|
|
|
+ .partitions = bfin_plat_nand_partitions,
|
|
|
+ .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
|
|
|
+ },
|
|
|
+ .ctrl = {
|
|
|
+ .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
|
|
|
+ .dev_ready = bfin_plat_nand_dev_ready,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+#define MAX(x, y) (x > y ? x : y)
|
|
|
+static struct resource bfin_plat_nand_resources = {
|
|
|
+ .start = 0x20212000,
|
|
|
+ .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device bfin_async_nand_device = {
|
|
|
+ .name = "gen_nand",
|
|
|
+ .id = -1,
|
|
|
+ .num_resources = 1,
|
|
|
+ .resource = &bfin_plat_nand_resources,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &bfin_plat_nand_data,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static void bfin_plat_nand_init(void)
|
|
|
+{
|
|
|
+ gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
|
|
|
+}
|
|
|
+#else
|
|
|
+static void bfin_plat_nand_init(void) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
|
|
|
+static struct mtd_partition stamp_partitions[] = {
|
|
|
+ {
|
|
|
+ .name = "bootloader(nor)",
|
|
|
+ .size = 0x40000,
|
|
|
+ .offset = 0,
|
|
|
+ }, {
|
|
|
+ .name = "linux kernel(nor)",
|
|
|
+ .size = 0x180000,
|
|
|
+ .offset = MTDPART_OFS_APPEND,
|
|
|
+ }, {
|
|
|
+ .name = "file system(nor)",
|
|
|
+ .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
|
|
|
+ .offset = MTDPART_OFS_APPEND,
|
|
|
+ }, {
|
|
|
+ .name = "MAC Address(nor)",
|
|
|
+ .size = MTDPART_SIZ_FULL,
|
|
|
+ .offset = 0x3F0000,
|
|
|
+ .mask_flags = MTD_WRITEABLE,
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+static struct physmap_flash_data stamp_flash_data = {
|
|
|
+ .width = 2,
|
|
|
+ .parts = stamp_partitions,
|
|
|
+ .nr_parts = ARRAY_SIZE(stamp_partitions),
|
|
|
+#ifdef CONFIG_ROMKERNEL
|
|
|
+ .probe_type = "map_rom",
|
|
|
+#endif
|
|
|
+};
|
|
|
+
|
|
|
+static struct resource stamp_flash_resource = {
|
|
|
+ .start = 0x20000000,
|
|
|
+ .end = 0x203fffff,
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device stamp_flash_device = {
|
|
|
+ .name = "physmap-flash",
|
|
|
+ .id = 0,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &stamp_flash_data,
|
|
|
+ },
|
|
|
+ .num_resources = 1,
|
|
|
+ .resource = &stamp_flash_resource,
|
|
|
+};
|
|
|
+#endif
|
|
|
+
|
|
|
+#if defined(CONFIG_MTD_M25P80) \
|
|
|
+ || defined(CONFIG_MTD_M25P80_MODULE)
|
|
|
+static struct mtd_partition bfin_spi_flash_partitions[] = {
|
|
|
+ {
|
|
|
+ .name = "bootloader(spi)",
|
|
|
+ .size = 0x00040000,
|
|
|
+ .offset = 0,
|
|
|
+ .mask_flags = MTD_CAP_ROM
|
|
|
+ }, {
|
|
|
+ .name = "linux kernel(spi)",
|
|
|
+ .size = 0x180000,
|
|
|
+ .offset = MTDPART_OFS_APPEND,
|
|
|
+ }, {
|
|
|
+ .name = "file system(spi)",
|
|
|
+ .size = MTDPART_SIZ_FULL,
|
|
|
+ .offset = MTDPART_OFS_APPEND,
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+static struct flash_platform_data bfin_spi_flash_data = {
|
|
|
+ .name = "m25p80",
|
|
|
+ .parts = bfin_spi_flash_partitions,
|
|
|
+ .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
|
|
|
+ /* .type = "m25p64", */
|
|
|
+};
|
|
|
+
|
|
|
+/* SPI flash chip (m25p64) */
|
|
|
+static struct bfin5xx_spi_chip spi_flash_chip_info = {
|
|
|
+ .enable_dma = 0, /* use dma transfer with this chip*/
|
|
|
+};
|
|
|
+#endif
|
|
|
+
|
|
|
+#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
|
|
|
+#include <linux/input/ad714x.h>
|
|
|
+
|
|
|
+static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
|
|
|
+ {
|
|
|
+ .start_stage = 0,
|
|
|
+ .end_stage = 7,
|
|
|
+ .max_coord = 128,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct ad714x_button_plat ad7147_spi_button_plat[] = {
|
|
|
+ {
|
|
|
+ .keycode = BTN_FORWARD,
|
|
|
+ .l_mask = 0,
|
|
|
+ .h_mask = 0x600,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .keycode = BTN_LEFT,
|
|
|
+ .l_mask = 0,
|
|
|
+ .h_mask = 0x500,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .keycode = BTN_MIDDLE,
|
|
|
+ .l_mask = 0,
|
|
|
+ .h_mask = 0x800,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .keycode = BTN_RIGHT,
|
|
|
+ .l_mask = 0x100,
|
|
|
+ .h_mask = 0x400,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .keycode = BTN_BACK,
|
|
|
+ .l_mask = 0x200,
|
|
|
+ .h_mask = 0x400,
|