diff options
| -rw-r--r-- | arch/sh/boards/mach-kfr2r09/setup.c | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index 224318abc9e6..382bf1884300 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
| 11 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
| 12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
| 13 | #include <linux/mtd/physmap.h> | ||
| 13 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
| 14 | #include <linux/clk.h> | 15 | #include <linux/clk.h> |
| 15 | #include <linux/gpio.h> | 16 | #include <linux/gpio.h> |
| @@ -18,13 +19,64 @@ | |||
| 18 | #include <asm/io.h> | 19 | #include <asm/io.h> |
| 19 | #include <cpu/sh7724.h> | 20 | #include <cpu/sh7724.h> |
| 20 | 21 | ||
| 22 | static struct mtd_partition kfr2r09_nor_flash_partitions[] = | ||
| 23 | { | ||
| 24 | { | ||
| 25 | .name = "boot", | ||
| 26 | .offset = 0, | ||
| 27 | .size = (4 * 1024 * 1024), | ||
| 28 | .mask_flags = MTD_WRITEABLE, /* Read-only */ | ||
| 29 | }, | ||
| 30 | { | ||
| 31 | .name = "other", | ||
| 32 | .offset = MTDPART_OFS_APPEND, | ||
| 33 | .size = MTDPART_SIZ_FULL, | ||
| 34 | }, | ||
| 35 | }; | ||
| 36 | |||
| 37 | static struct physmap_flash_data kfr2r09_nor_flash_data = { | ||
| 38 | .width = 2, | ||
| 39 | .parts = kfr2r09_nor_flash_partitions, | ||
| 40 | .nr_parts = ARRAY_SIZE(kfr2r09_nor_flash_partitions), | ||
| 41 | }; | ||
| 42 | |||
| 43 | static struct resource kfr2r09_nor_flash_resources[] = { | ||
| 44 | [0] = { | ||
| 45 | .name = "NOR Flash", | ||
| 46 | .start = 0x00000000, | ||
| 47 | .end = 0x03ffffff, | ||
| 48 | .flags = IORESOURCE_MEM, | ||
| 49 | } | ||
| 50 | }; | ||
| 51 | |||
| 52 | static struct platform_device kfr2r09_nor_flash_device = { | ||
| 53 | .name = "physmap-flash", | ||
| 54 | .resource = kfr2r09_nor_flash_resources, | ||
| 55 | .num_resources = ARRAY_SIZE(kfr2r09_nor_flash_resources), | ||
| 56 | .dev = { | ||
| 57 | .platform_data = &kfr2r09_nor_flash_data, | ||
| 58 | }, | ||
| 59 | }; | ||
| 60 | |||
| 61 | static struct platform_device *kfr2r09_devices[] __initdata = { | ||
| 62 | &kfr2r09_nor_flash_device, | ||
| 63 | }; | ||
| 64 | |||
| 65 | #define BSC_CS0BCR 0xfec10004 | ||
| 66 | #define BSC_CS0WCR 0xfec10024 | ||
| 67 | |||
| 21 | static int __init kfr2r09_devices_setup(void) | 68 | static int __init kfr2r09_devices_setup(void) |
| 22 | { | 69 | { |
| 23 | /* enable SCIF1 serial port for YC401 console support */ | 70 | /* enable SCIF1 serial port for YC401 console support */ |
| 24 | gpio_request(GPIO_FN_SCIF1_RXD, NULL); | 71 | gpio_request(GPIO_FN_SCIF1_RXD, NULL); |
| 25 | gpio_request(GPIO_FN_SCIF1_TXD, NULL); | 72 | gpio_request(GPIO_FN_SCIF1_TXD, NULL); |
| 26 | 73 | ||
| 27 | return 0; | 74 | /* setup NOR flash at CS0 */ |
| 75 | ctrl_outl(0x36db0400, BSC_CS0BCR); | ||
| 76 | ctrl_outl(0x00000500, BSC_CS0WCR); | ||
| 77 | |||
| 78 | return platform_add_devices(kfr2r09_devices, | ||
| 79 | ARRAY_SIZE(kfr2r09_devices)); | ||
| 28 | } | 80 | } |
| 29 | device_initcall(kfr2r09_devices_setup); | 81 | device_initcall(kfr2r09_devices_setup); |
| 30 | 82 | ||
