Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 1 | /* |
Paul Mundt | ea0aac1 | 2008-12-08 14:32:03 +0900 | [diff] [blame] | 2 | * Renesas Technology Europe RSK+ Support. |
Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 3 | * |
Paul Mundt | ea0aac1 | 2008-12-08 14:32:03 +0900 | [diff] [blame] | 4 | * Copyright (C) 2008 Paul Mundt |
Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 5 | * Copyright (C) 2008 Peter Griffin <pgriffin@mpc-data.co.uk> |
| 6 | * |
| 7 | * This file is subject to the terms and conditions of the GNU General Public |
| 8 | * License. See the file "COPYING" in the main directory of this archive |
| 9 | * for more details. |
| 10 | */ |
| 11 | #include <linux/init.h> |
| 12 | #include <linux/types.h> |
| 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/mtd/mtd.h> |
| 16 | #include <linux/mtd/partitions.h> |
| 17 | #include <linux/mtd/physmap.h> |
| 18 | #include <linux/mtd/map.h> |
Guennadi Liakhovetski | 1190ef9 | 2012-06-27 00:50:07 +0200 | [diff] [blame] | 19 | #include <linux/regulator/fixed.h> |
| 20 | #include <linux/regulator/machine.h> |
Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 21 | #include <asm/machvec.h> |
| 22 | #include <asm/io.h> |
| 23 | |
Guennadi Liakhovetski | 1190ef9 | 2012-06-27 00:50:07 +0200 | [diff] [blame] | 24 | /* Dummy supplies, where voltage doesn't matter */ |
| 25 | static struct regulator_consumer_supply dummy_supplies[] = { |
| 26 | REGULATOR_SUPPLY("vddvario", "smsc911x"), |
| 27 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), |
| 28 | }; |
| 29 | |
Paul Mundt | 603129a | 2012-01-12 13:47:42 +0900 | [diff] [blame] | 30 | static const char *part_probes[] = { "cmdlinepart", NULL }; |
| 31 | |
Paul Mundt | ea0aac1 | 2008-12-08 14:32:03 +0900 | [diff] [blame] | 32 | static struct mtd_partition rsk_partitions[] = { |
Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 33 | { |
| 34 | .name = "Bootloader", |
| 35 | .offset = 0x00000000, |
| 36 | .size = 0x00040000, |
| 37 | .mask_flags = MTD_WRITEABLE, |
| 38 | }, { |
| 39 | .name = "Kernel", |
| 40 | .offset = MTDPART_OFS_NXTBLK, |
| 41 | .size = 0x001c0000, |
| 42 | }, { |
| 43 | .name = "Flash_FS", |
| 44 | .offset = MTDPART_OFS_NXTBLK, |
| 45 | .size = MTDPART_SIZ_FULL, |
| 46 | } |
| 47 | }; |
| 48 | |
| 49 | static struct physmap_flash_data flash_data = { |
Paul Mundt | 603129a | 2012-01-12 13:47:42 +0900 | [diff] [blame] | 50 | .parts = rsk_partitions, |
| 51 | .nr_parts = ARRAY_SIZE(rsk_partitions), |
| 52 | .width = 2, |
| 53 | .part_probe_types = part_probes, |
Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | static struct resource flash_resource = { |
| 57 | .start = 0x20000000, |
| 58 | .end = 0x20400000, |
| 59 | .flags = IORESOURCE_MEM, |
| 60 | }; |
| 61 | |
| 62 | static struct platform_device flash_device = { |
| 63 | .name = "physmap-flash", |
| 64 | .id = -1, |
| 65 | .resource = &flash_resource, |
| 66 | .num_resources = 1, |
| 67 | .dev = { |
| 68 | .platform_data = &flash_data, |
| 69 | }, |
| 70 | }; |
| 71 | |
Paul Mundt | ea0aac1 | 2008-12-08 14:32:03 +0900 | [diff] [blame] | 72 | static struct platform_device *rsk_devices[] __initdata = { |
Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 73 | &flash_device, |
| 74 | }; |
| 75 | |
Paul Mundt | ea0aac1 | 2008-12-08 14:32:03 +0900 | [diff] [blame] | 76 | static int __init rsk_devices_setup(void) |
Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 77 | { |
Guennadi Liakhovetski | 1190ef9 | 2012-06-27 00:50:07 +0200 | [diff] [blame] | 78 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); |
| 79 | |
Paul Mundt | ea0aac1 | 2008-12-08 14:32:03 +0900 | [diff] [blame] | 80 | return platform_add_devices(rsk_devices, |
| 81 | ARRAY_SIZE(rsk_devices)); |
Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 82 | } |
Paul Mundt | ea0aac1 | 2008-12-08 14:32:03 +0900 | [diff] [blame] | 83 | device_initcall(rsk_devices_setup); |
Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 84 | |
| 85 | /* |
| 86 | * The Machine Vector |
| 87 | */ |
Paul Mundt | ea0aac1 | 2008-12-08 14:32:03 +0900 | [diff] [blame] | 88 | static struct sh_machine_vector mv_rsk __initmv = { |
| 89 | .mv_name = "RSK+", |
Peter Griffin | 6feb348 | 2008-11-28 22:56:45 +0900 | [diff] [blame] | 90 | }; |