607-MIPS-ath79-ubnt-xm-fixes.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. --- a/arch/mips/ath79/Kconfig
  2. +++ b/arch/mips/ath79/Kconfig
  3. @@ -70,9 +70,10 @@ config ATH79_MACH_PB44
  4. config ATH79_MACH_UBNT_XM
  5. bool "Ubiquiti Networks XM (rev 1.0) board"
  6. select SOC_AR724X
  7. + select ATH79_DEV_AP9X_PCI if PCI
  8. select ATH79_DEV_GPIO_BUTTONS
  9. select ATH79_DEV_LEDS_GPIO
  10. - select ATH79_DEV_SPI
  11. + select ATH79_DEV_M25P80
  12. help
  13. Say 'Y' here if you want your kernel to support the
  14. Ubiquiti Networks XM (rev 1.0) board.
  15. --- a/arch/mips/ath79/mach-ubnt-xm.c
  16. +++ b/arch/mips/ath79/mach-ubnt-xm.c
  17. @@ -16,10 +16,11 @@
  18. #include <asm/mach-ath79/irq.h>
  19. -#include "machtypes.h"
  20. +#include "dev-ap9x-pci.h"
  21. #include "dev-gpio-buttons.h"
  22. #include "dev-leds-gpio.h"
  23. -#include "dev-spi.h"
  24. +#include "dev-m25p80.h"
  25. +#include "machtypes.h"
  26. #include "pci.h"
  27. #define UBNT_XM_GPIO_LED_L1 0
  28. @@ -32,7 +33,7 @@
  29. #define UBNT_XM_KEYS_POLL_INTERVAL 20
  30. #define UBNT_XM_KEYS_DEBOUNCE_INTERVAL (3 * UBNT_XM_KEYS_POLL_INTERVAL)
  31. -#define UBNT_XM_EEPROM_ADDR (u8 *) KSEG1ADDR(0x1fff1000)
  32. +#define UBNT_XM_EEPROM_ADDR 0x1fff1000
  33. static struct gpio_led ubnt_xm_leds_gpio[] __initdata = {
  34. {
  35. @@ -65,48 +66,10 @@ static struct gpio_keys_button ubnt_xm_g
  36. }
  37. };
  38. -static struct spi_board_info ubnt_xm_spi_info[] = {
  39. - {
  40. - .bus_num = 0,
  41. - .chip_select = 0,
  42. - .max_speed_hz = 25000000,
  43. - .modalias = "mx25l6405d",
  44. - }
  45. -};
  46. -
  47. -static struct ath79_spi_platform_data ubnt_xm_spi_data = {
  48. - .bus_num = 0,
  49. - .num_chipselect = 1,
  50. -};
  51. -
  52. -#ifdef CONFIG_PCI
  53. -static struct ath9k_platform_data ubnt_xm_eeprom_data;
  54. -
  55. -static int ubnt_xm_pci_plat_dev_init(struct pci_dev *dev)
  56. -{
  57. - switch (PCI_SLOT(dev->devfn)) {
  58. - case 0:
  59. - dev->dev.platform_data = &ubnt_xm_eeprom_data;
  60. - break;
  61. - }
  62. -
  63. - return 0;
  64. -}
  65. -
  66. -static void __init ubnt_xm_pci_init(void)
  67. -{
  68. - memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
  69. - sizeof(ubnt_xm_eeprom_data.eeprom_data));
  70. -
  71. - ath79_pci_set_plat_dev_init(ubnt_xm_pci_plat_dev_init);
  72. - ath79_register_pci();
  73. -}
  74. -#else
  75. -static inline void ubnt_xm_pci_init(void) {}
  76. -#endif /* CONFIG_PCI */
  77. -
  78. static void __init ubnt_xm_init(void)
  79. {
  80. + u8 *eeprom = (u8 *) KSEG1ADDR(UBNT_XM_EEPROM_ADDR);
  81. +
  82. ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio),
  83. ubnt_xm_leds_gpio);
  84. @@ -114,10 +77,8 @@ static void __init ubnt_xm_init(void)
  85. ARRAY_SIZE(ubnt_xm_gpio_keys),
  86. ubnt_xm_gpio_keys);
  87. - ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info,
  88. - ARRAY_SIZE(ubnt_xm_spi_info));
  89. -
  90. - ubnt_xm_pci_init();
  91. + ath79_register_m25p80(NULL);
  92. + ap91_pci_init(eeprom, NULL);
  93. }
  94. MIPS_MACHINE(ATH79_MACH_UBNT_XM,