Advertisement
Guest User

Ix2-200 Board config

a guest
Aug 10th, 2012
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.50 KB | None | 0 0
  1. /*
  2. * arch/arm/mach-kirkwood/board-ix2200.c
  3. *
  4. * Iomega Ix2-200 Board Setup
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10.  
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/irq.h>
  15. #include <linux/mtd/partitions.h>
  16. #include <linux/ata_platform.h>
  17. #include <linux/mv643xx_eth.h>
  18. #include <linux/ethtool.h>
  19. #include <net/dsa.h>
  20. #include <linux/gpio.h>
  21. #include <linux/leds.h>
  22. #include <linux/gpio_keys.h>
  23. #include <linux/i2c.h>
  24. #include <linux/input.h>
  25. #include <asm/mach-types.h>
  26. #include <asm/mach/arch.h>
  27. #include <mach/kirkwood.h>
  28. #include "common.h"
  29. #include "mpp.h"
  30.  
  31. static struct mv643xx_eth_platform_data ix2200_ge00_data = {
  32. .phy_addr = MV643XX_ETH_PHY_NONE,
  33. .speed = SPEED_1000,
  34. .duplex = DUPLEX_FULL,
  35. };
  36.  
  37. static struct mv643xx_eth_platform_data ix2200_ge01_data = {
  38. .phy_addr = MV643XX_ETH_PHY_ADDR(11),
  39. };
  40.  
  41.  
  42. /*
  43. #define ORION_BLINK_HALF_PERIOD 100 ms
  44.  
  45. int ix2200_gpio_blink_set(unsigned gpio, int state,
  46. unsigned long *delay_on, unsigned long *delay_off)
  47. {
  48. orion_gpio_set_blink(gpio, state);
  49. return 0;
  50. }
  51.  
  52. static struct gpio_led_platform_data ix2200_led_data = {
  53. .leds = ix2200_led_pins,
  54. .num_leds = ARRAY_SIZE(ix220turn off boot console earlycon00_led_pins),
  55. .gpio_blink_set = (void*)ix2200_gpio_blink_set,
  56. };
  57.  
  58. static struct platform_device ix2200_leds = {
  59. .name = "leds-gpio",
  60. .id = -1,
  61. .dev = {
  62. .platform_data = &ix2200_led_data,
  63. }
  64. };
  65. */
  66. /****************************************************************************
  67. * GPIO Attached Keys
  68. ****************************************************************************/
  69. /*
  70. #define ix2200_GPIO_KEY_RESET 12
  71. #define ix2200_GPIO_KEY_POWER 14
  72. #define ix2200_GPIO_KEY_OTB 35
  73.  
  74. #define ix2200_SW_RESET 0x00
  75. #define ix2200_SW_POWER 0x01
  76. #define ix2200_SW_OTB 0x02
  77.  
  78. static struct gpio_keys_button ix2200_buttons[] = {
  79. {
  80. .type = EV_SW,
  81. .code = ix2200_SW_RESET,
  82. .gpio = ix2200_GPIO_KEY_RESET,
  83. .desc = "Reset Button",
  84. .active_low = 1,
  85. .debounce_interval = 100,
  86. },
  87. {
  88. .type = EV_SW,
  89. .code = ix2200_SW_POWER,
  90. .gpio = ix2200_GPIO_KEY_POWER,
  91. .desc = "Power Button",
  92. .active_low = 1,
  93. .debounce_interval = 100,
  94. },
  95. {
  96. .type = EV_SW,
  97. .code = ix2200_SW_OTB,
  98. .gpio = ix2200_GPIO_KEY_OTB,
  99. .desc = "OTB Button",
  100. .active_low = 1,
  101. .debounce_interval = 100,
  102. },
  103.  
  104. };
  105.  
  106. static struct gpio_keys_platform_data ix2200_button_data = {
  107. .buttons = ix2200_buttons,
  108. .nbuttons = ARRAY_SIZE(ix2200_buttons),
  109. };
  110.  
  111. static struct platform_device ix2200_button_device = {
  112. .name = "gpio-keys",
  113. .id = -1,
  114. .num_resources = 0,
  115. .dev = {
  116. .platform_data = &ix2200_button_data,
  117. },
  118. };
  119. */
  120. static unsigned int ix2200_mpp_config[] __initdata = {
  121. MPP12_GPIO, /* Reset Button */
  122. MPP14_GPIO, /* Power Button */
  123. MPP15_GPIO, /* Backup LED (blue) */
  124. MPP16_GPIO, /* Power LED (white) */
  125. MPP35_GPIO, /* OTB Button */
  126. MPP36_GPIO, /* Rebuild LED (white) */
  127. MPP37_GPIO, /* Health LED (red) */
  128. MPP38_GPIO, /* SATA LED brightness control 1 */
  129. MPP39_GPIO, /* SATA LED brightness control 2 */
  130. MPP40_GPIO, /* Backup LED brightness control 1 */
  131. MPP41_GPIO, /* Backup LED brightness control 2 */
  132. MPP42_GPIO, /* Power LED brightness control 1 */
  133. MPP43_GPIO, /* Power LED brightness control 2 */
  134. MPP44_GPIO, /* Health LED brightness control 1 */
  135. MPP45_GPIO, /* Health LED brightness control 2 */
  136. MPP46_GPIO, /* Rebuild LED brightness control 1 */
  137. MPP47_GPIO, /* Rebuild LED brightness control 2 */
  138. 0
  139. };
  140.  
  141. void __init ix2200_init(void)
  142. {
  143. /*
  144. * Basic setup. Needs to be called early.
  145. */
  146. /*kirkwood_init();*/
  147. kirkwood_mpp_conf(ix2200_mpp_config);
  148.  
  149. kirkwood_ehci_init();
  150.  
  151. kirkwood_ge00_init(&ix2200_ge00_data);
  152. kirkwood_ge01_init(&ix2200_ge01_data);
  153. kirkwood_uart0_init();
  154. /*platform_device_register(&ix2200_button_device);*/
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement