setup.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Renesas Technology Europe RSK+ Support.
  3. *
  4. * Copyright (C) 2008 Paul Mundt
  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>
  19. #include <linux/regulator/fixed.h>
  20. #include <linux/regulator/machine.h>
  21. #include <asm/machvec.h>
  22. #include <asm/io.h>
  23. /* Dummy supplies, where voltage doesn't matter */
  24. static struct regulator_consumer_supply dummy_supplies[] = {
  25. REGULATOR_SUPPLY("vddvario", "smsc911x"),
  26. REGULATOR_SUPPLY("vdd33a", "smsc911x"),
  27. };
  28. static struct mtd_partition rsk_partitions[] = {
  29. {
  30. .name = "Bootloader",
  31. .offset = 0x00000000,
  32. .size = 0x00040000,
  33. .mask_flags = MTD_WRITEABLE,
  34. }, {
  35. .name = "Kernel",
  36. .offset = MTDPART_OFS_NXTBLK,
  37. .size = 0x001c0000,
  38. }, {
  39. .name = "Flash_FS",
  40. .offset = MTDPART_OFS_NXTBLK,
  41. .size = MTDPART_SIZ_FULL,
  42. }
  43. };
  44. static struct physmap_flash_data flash_data = {
  45. .parts = rsk_partitions,
  46. .nr_parts = ARRAY_SIZE(rsk_partitions),
  47. .width = 2,
  48. };
  49. static struct resource flash_resource = {
  50. .start = 0x20000000,
  51. .end = 0x20400000,
  52. .flags = IORESOURCE_MEM,
  53. };
  54. static struct platform_device flash_device = {
  55. .name = "physmap-flash",
  56. .id = -1,
  57. .resource = &flash_resource,
  58. .num_resources = 1,
  59. .dev = {
  60. .platform_data = &flash_data,
  61. },
  62. };
  63. static struct platform_device *rsk_devices[] __initdata = {
  64. &flash_device,
  65. };
  66. static int __init rsk_devices_setup(void)
  67. {
  68. regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
  69. return platform_add_devices(rsk_devices,
  70. ARRAY_SIZE(rsk_devices));
  71. }
  72. device_initcall(rsk_devices_setup);
  73. /*
  74. * The Machine Vector
  75. */
  76. static struct sh_machine_vector mv_rsk __initmv = {
  77. .mv_name = "RSK+",
  78. };