mach-gs-minibox-v1.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Gainstrong MiniBox V1.0 board support
  3. *
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 as published
  7. * by the Free Software Foundation.
  8. */
  9. #include <linux/gpio.h>
  10. #include <asm/mach-ath79/ath79.h>
  11. #include <asm/mach-ath79/ar71xx_regs.h>
  12. #include "common.h"
  13. #include "dev-eth.h"
  14. #include "dev-gpio-buttons.h"
  15. #include "dev-leds-gpio.h"
  16. #include "dev-m25p80.h"
  17. #include "dev-usb.h"
  18. #include "dev-wmac.h"
  19. #include "machtypes.h"
  20. #define GS_MINIBOX_V1_GPIO_BTN_RESET 11
  21. #define GS_MINIBOX_V1_GPIO_LED_SYSTEM 1
  22. #define GS_MINIBOX_V1_KEYS_POLL_INTERVAL 20 /* msecs */
  23. #define GS_MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 * GS_MINIBOX_V1_KEYS_POLL_INTERVAL)
  24. static const char *gs_minibox_v1_part_probes[] = {
  25. "tp-link",
  26. NULL,
  27. };
  28. static struct flash_platform_data gs_minibox_v1_flash_data = {
  29. .part_probes = gs_minibox_v1_part_probes,
  30. };
  31. static struct gpio_led gs_minibox_v1_leds_gpio[] __initdata = {
  32. {
  33. .name = "minibox-v1:green:system",
  34. .gpio = GS_MINIBOX_V1_GPIO_LED_SYSTEM,
  35. .active_low = 1,
  36. },
  37. };
  38. static struct gpio_keys_button gs_minibox_v1_gpio_keys[] __initdata = {
  39. {
  40. .desc = "reset",
  41. .type = EV_KEY,
  42. .code = KEY_RESTART,
  43. .debounce_interval = GS_MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
  44. .gpio = GS_MINIBOX_V1_GPIO_BTN_RESET,
  45. .active_low = 0,
  46. },
  47. };
  48. static void __init gs_minibox_v1_setup(void)
  49. {
  50. u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
  51. u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
  52. ath79_register_leds_gpio(-1, ARRAY_SIZE(gs_minibox_v1_leds_gpio),
  53. gs_minibox_v1_leds_gpio);
  54. ath79_register_gpio_keys_polled(-1, GS_MINIBOX_V1_KEYS_POLL_INTERVAL,
  55. ARRAY_SIZE(gs_minibox_v1_gpio_keys),
  56. gs_minibox_v1_gpio_keys);
  57. ath79_register_usb();
  58. ath79_register_m25p80(&gs_minibox_v1_flash_data);
  59. ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
  60. ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
  61. ath79_register_mdio(0, 0x0);
  62. ath79_register_eth(1);
  63. ath79_register_eth(0);
  64. ath79_register_wmac(ee, mac);
  65. }
  66. MIPS_MACHINE(ATH79_MACH_GS_MINIBOX_V1, "MINIBOX-V1",
  67. "MiniBox V1.0", gs_minibox_v1_setup);