002-wbd111_support.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. --- /dev/null
  2. +++ b/arch/arm/mach-gemini/board-wbd111.c
  3. @@ -0,0 +1,125 @@
  4. +/*
  5. + * Support for Wiliboard WBD-111
  6. + *
  7. + * Copyright (C) 2009 Imre Kaloz <[email protected]>
  8. + *
  9. + * This program is free software; you can redistribute it and/or modify
  10. + * it under the terms of the GNU General Public License as published by
  11. + * the Free Software Foundation; either version 2 of the License, or
  12. + * (at your option) any later version.
  13. + */
  14. +#include <linux/kernel.h>
  15. +#include <linux/init.h>
  16. +#include <linux/platform_device.h>
  17. +#include <linux/leds.h>
  18. +#include <linux/input.h>
  19. +#include <linux/skbuff.h>
  20. +#include <linux/gpio_keys.h>
  21. +#include <linux/mdio-gpio.h>
  22. +#include <asm/mach-types.h>
  23. +#include <asm/mach/arch.h>
  24. +#include <asm/mach/time.h>
  25. +
  26. +#include <mach/gmac.h>
  27. +
  28. +#include "common.h"
  29. +
  30. +static struct mdio_gpio_platform_data wbd111_mdio = {
  31. + .mdc = 22,
  32. + .mdio = 21,
  33. + .phy_mask = ~(1 << 1),
  34. +};
  35. +
  36. +static struct platform_device wbd111_phy_device = {
  37. + .name = "mdio-gpio",
  38. + .id = 0,
  39. + .dev = {
  40. + .platform_data = &wbd111_mdio,
  41. + },
  42. +};
  43. +
  44. +static struct gemini_gmac_platform_data gmac_data = {
  45. + .bus_id[0] = "0:01",
  46. + .interface[0] = PHY_INTERFACE_MODE_MII,
  47. +};
  48. +
  49. +static struct gpio_keys_button wbd111_keys[] = {
  50. + {
  51. + .code = KEY_SETUP,
  52. + .gpio = 5,
  53. + .active_low = 1,
  54. + .desc = "reset",
  55. + .type = EV_KEY,
  56. + },
  57. +};
  58. +
  59. +static struct gpio_keys_platform_data wbd111_keys_data = {
  60. + .buttons = wbd111_keys,
  61. + .nbuttons = ARRAY_SIZE(wbd111_keys),
  62. +};
  63. +
  64. +static struct platform_device wbd111_keys_device = {
  65. + .name = "gpio-keys",
  66. + .id = -1,
  67. + .dev = {
  68. + .platform_data = &wbd111_keys_data,
  69. + },
  70. +};
  71. +
  72. +static struct gpio_led wbd111_leds[] = {
  73. + {
  74. + .name = "L3red",
  75. + .gpio = 1,
  76. + },
  77. + {
  78. + .name = "L4green",
  79. + .gpio = 2,
  80. + },
  81. + {
  82. + .name = "L4red",
  83. + .gpio = 3,
  84. + },
  85. + {
  86. + .name = "L3green",
  87. + .gpio = 5,
  88. + },
  89. +};
  90. +
  91. +static struct gpio_led_platform_data wbd111_leds_data = {
  92. + .num_leds = ARRAY_SIZE(wbd111_leds),
  93. + .leds = wbd111_leds,
  94. +};
  95. +
  96. +static struct platform_device wbd111_leds_device = {
  97. + .name = "leds-gpio",
  98. + .id = -1,
  99. + .dev = {
  100. + .platform_data = &wbd111_leds_data,
  101. + },
  102. +};
  103. +
  104. +static struct sys_timer wbd111_timer = {
  105. + .init = gemini_timer_init,
  106. +};
  107. +
  108. +static void __init wbd111_init(void)
  109. +{
  110. + gemini_gpio_init();
  111. + platform_register_uart();
  112. + platform_register_watchdog();
  113. + platform_register_pflash(SZ_8M, NULL, 0);
  114. + platform_device_register(&wbd111_leds_device);
  115. + platform_device_register(&wbd111_keys_device);
  116. + platform_device_register(&wbd111_phy_device);
  117. + platform_register_ethernet(&gmac_data);
  118. +}
  119. +
  120. +MACHINE_START(WBD111, "Wiliboard WBD-111")
  121. + .phys_io = 0x7fffc000,
  122. + .io_pg_offst = ((0xffffc000) >> 18) & 0xfffc,
  123. + .boot_params = 0x100,
  124. + .map_io = gemini_map_io,
  125. + .init_irq = gemini_init_irq,
  126. + .timer = &wbd111_timer,
  127. + .init_machine = wbd111_init,
  128. +MACHINE_END
  129. --- a/arch/arm/mach-gemini/Kconfig
  130. +++ b/arch/arm/mach-gemini/Kconfig
  131. @@ -16,6 +16,13 @@ config MACH_RUT100
  132. Say Y here if you intend to run this kernel on a
  133. Teltonika 3G Router RUT100.
  134. +config MACH_WBD111
  135. + bool "Wiliboard WBD-111"
  136. + select GEMINI_MEM_SWAP
  137. + help
  138. + Say Y here if you intend to run this kernel on a
  139. + Wiliboard WBD-111.
  140. +
  141. endmenu
  142. config GEMINI_MEM_SWAP
  143. --- a/arch/arm/mach-gemini/Makefile
  144. +++ b/arch/arm/mach-gemini/Makefile
  145. @@ -11,3 +11,4 @@ obj-$(CONFIG_PCI) += pci.o
  146. # Board-specific support
  147. obj-$(CONFIG_MACH_NAS4220B) += board-nas4220b.o
  148. obj-$(CONFIG_MACH_RUT100) += board-rut1xx.o
  149. +obj-$(CONFIG_MACH_WBD111) += board-wbd111.o