setup.c 1.9 KB

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