setup.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 <asm/machvec.h>
  20. #include <asm/io.h>
  21. static const char *part_probes[] = { "cmdlinepart", NULL };
  22. static struct mtd_partition rsk_partitions[] = {
  23. {
  24. .name = "Bootloader",
  25. .offset = 0x00000000,
  26. .size = 0x00040000,
  27. .mask_flags = MTD_WRITEABLE,
  28. }, {
  29. .name = "Kernel",
  30. .offset = MTDPART_OFS_NXTBLK,
  31. .size = 0x001c0000,
  32. }, {
  33. .name = "Flash_FS",
  34. .offset = MTDPART_OFS_NXTBLK,
  35. .size = MTDPART_SIZ_FULL,
  36. }
  37. };
  38. static struct physmap_flash_data flash_data = {
  39. .parts = rsk_partitions,
  40. .nr_parts = ARRAY_SIZE(rsk_partitions),
  41. .width = 2,
  42. .part_probe_types = part_probes,
  43. };
  44. static struct resource flash_resource = {
  45. .start = 0x20000000,
  46. .end = 0x20400000,
  47. .flags = IORESOURCE_MEM,
  48. };
  49. static struct platform_device flash_device = {
  50. .name = "physmap-flash",
  51. .id = -1,
  52. .resource = &flash_resource,
  53. .num_resources = 1,
  54. .dev = {
  55. .platform_data = &flash_data,
  56. },
  57. };
  58. static struct platform_device *rsk_devices[] __initdata = {
  59. &flash_device,
  60. };
  61. static int __init rsk_devices_setup(void)
  62. {
  63. return platform_add_devices(rsk_devices,
  64. ARRAY_SIZE(rsk_devices));
  65. }
  66. device_initcall(rsk_devices_setup);
  67. /*
  68. * The Machine Vector
  69. */
  70. static struct sh_machine_vector mv_rsk __initmv = {
  71. .mv_name = "RSK+",
  72. };