setup.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * linux/arch/sh/boards/se/7780/setup.c
  3. *
  4. * Copyright (C) 2006,2007 Nobuhiro Iwamatsu
  5. *
  6. * Hitachi UL SolutionEngine 7780 Support.
  7. *
  8. * This file is subject to the terms and conditions of the GNU General Public
  9. * License. See the file "COPYING" in the main directory of this archive
  10. * for more details.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/platform_device.h>
  14. #include <asm/machvec.h>
  15. #include <mach-se/mach/se7780.h>
  16. #include <asm/io.h>
  17. #include <asm/heartbeat.h>
  18. /* Heartbeat */
  19. static struct heartbeat_data heartbeat_data = {
  20. .regsize = 16,
  21. };
  22. static struct resource heartbeat_resources[] = {
  23. [0] = {
  24. .start = PA_LED,
  25. .end = PA_LED,
  26. .flags = IORESOURCE_MEM,
  27. },
  28. };
  29. static struct platform_device heartbeat_device = {
  30. .name = "heartbeat",
  31. .id = -1,
  32. .dev = {
  33. .platform_data = &heartbeat_data,
  34. },
  35. .num_resources = ARRAY_SIZE(heartbeat_resources),
  36. .resource = heartbeat_resources,
  37. };
  38. /* SMC91x */
  39. static struct resource smc91x_eth_resources[] = {
  40. [0] = {
  41. .name = "smc91x-regs" ,
  42. .start = PA_LAN + 0x300,
  43. .end = PA_LAN + 0x300 + 0x10 ,
  44. .flags = IORESOURCE_MEM,
  45. },
  46. [1] = {
  47. .start = SMC_IRQ,
  48. .end = SMC_IRQ,
  49. .flags = IORESOURCE_IRQ,
  50. },
  51. };
  52. static struct platform_device smc91x_eth_device = {
  53. .name = "smc91x",
  54. .id = 0,
  55. .dev = {
  56. .dma_mask = NULL, /* don't use dma */
  57. .coherent_dma_mask = 0xffffffff,
  58. },
  59. .num_resources = ARRAY_SIZE(smc91x_eth_resources),
  60. .resource = smc91x_eth_resources,
  61. };
  62. static struct platform_device *se7780_devices[] __initdata = {
  63. &heartbeat_device,
  64. &smc91x_eth_device,
  65. };
  66. static int __init se7780_devices_setup(void)
  67. {
  68. return platform_add_devices(se7780_devices,
  69. ARRAY_SIZE(se7780_devices));
  70. }
  71. device_initcall(se7780_devices_setup);
  72. #define GPIO_PHCR 0xFFEA000E
  73. #define GPIO_PMSELR 0xFFEA0080
  74. #define GPIO_PECR 0xFFEA0008
  75. static void __init se7780_setup(char **cmdline_p)
  76. {
  77. /* "SH-Linux" on LED Display */
  78. ctrl_outw( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) );
  79. ctrl_outw( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) );
  80. ctrl_outw( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) );
  81. ctrl_outw( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) );
  82. ctrl_outw( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) );
  83. ctrl_outw( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) );
  84. ctrl_outw( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) );
  85. ctrl_outw( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) );
  86. printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n");
  87. /*
  88. * PCI REQ/GNT setting
  89. * REQ0/GNT0 -> USB
  90. * REQ1/GNT1 -> PC Card
  91. * REQ2/GNT2 -> Serial ATA
  92. * REQ3/GNT3 -> PCI slot
  93. */
  94. ctrl_outw(0x0213, FPGA_REQSEL);
  95. /* GPIO setting */
  96. ctrl_outw(0x0000, GPIO_PECR);
  97. ctrl_outw(ctrl_inw(GPIO_PHCR)&0xfff3, GPIO_PHCR);
  98. ctrl_outw(0x0c00, GPIO_PMSELR);
  99. /* iVDR Power ON */
  100. ctrl_outw(0x0001, FPGA_IVDRPW);
  101. }
  102. /*
  103. * The Machine Vector
  104. */
  105. static struct sh_machine_vector mv_se7780 __initmv = {
  106. .mv_name = "Solution Engine 7780" ,
  107. .mv_setup = se7780_setup ,
  108. .mv_nr_irqs = 111 ,
  109. .mv_init_irq = init_se7780_IRQ,
  110. };