setup.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * linux/arch/sh/boards/se/7721/setup.c
  4. *
  5. * Copyright (C) 2008 Renesas Solutions Corp.
  6. *
  7. * Hitachi UL SolutionEngine 7721 Support.
  8. */
  9. #include <linux/init.h>
  10. #include <linux/platform_device.h>
  11. #include <mach-se/mach/se7721.h>
  12. #include <mach-se/mach/mrshpc.h>
  13. #include <asm/machvec.h>
  14. #include <asm/io.h>
  15. #include <asm/heartbeat.h>
  16. static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
  17. static struct heartbeat_data heartbeat_data = {
  18. .bit_pos = heartbeat_bit_pos,
  19. .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
  20. };
  21. static struct resource heartbeat_resource = {
  22. .start = PA_LED,
  23. .end = PA_LED,
  24. .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
  25. };
  26. static struct platform_device heartbeat_device = {
  27. .name = "heartbeat",
  28. .id = -1,
  29. .dev = {
  30. .platform_data = &heartbeat_data,
  31. },
  32. .num_resources = 1,
  33. .resource = &heartbeat_resource,
  34. };
  35. static struct resource cf_ide_resources[] = {
  36. [0] = {
  37. .start = PA_MRSHPC_IO + 0x1f0,
  38. .end = PA_MRSHPC_IO + 0x1f0 + 8 ,
  39. .flags = IORESOURCE_IO,
  40. },
  41. [1] = {
  42. .start = PA_MRSHPC_IO + 0x1f0 + 0x206,
  43. .end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
  44. .flags = IORESOURCE_IO,
  45. },
  46. [2] = {
  47. .start = MRSHPC_IRQ0,
  48. .flags = IORESOURCE_IRQ,
  49. },
  50. };
  51. static struct platform_device cf_ide_device = {
  52. .name = "pata_platform",
  53. .id = -1,
  54. .num_resources = ARRAY_SIZE(cf_ide_resources),
  55. .resource = cf_ide_resources,
  56. };
  57. static struct platform_device *se7721_devices[] __initdata = {
  58. &cf_ide_device,
  59. &heartbeat_device
  60. };
  61. static int __init se7721_devices_setup(void)
  62. {
  63. mrshpc_setup_windows();
  64. return platform_add_devices(se7721_devices, ARRAY_SIZE(se7721_devices));
  65. }
  66. device_initcall(se7721_devices_setup);
  67. static void __init se7721_setup(char **cmdline_p)
  68. {
  69. /* for USB */
  70. __raw_writew(0x0000, 0xA405010C); /* PGCR */
  71. __raw_writew(0x0000, 0xA405010E); /* PHCR */
  72. __raw_writew(0x00AA, 0xA4050118); /* PPCR */
  73. __raw_writew(0x0000, 0xA4050124); /* PSELA */
  74. }
  75. /*
  76. * The Machine Vector
  77. */
  78. struct sh_machine_vector mv_se7721 __initmv = {
  79. .mv_name = "Solution Engine 7721",
  80. .mv_setup = se7721_setup,
  81. .mv_init_irq = init_se7721_IRQ,
  82. };