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"
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
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
19 #include <asm/mach-ath79/irq.h>
21 -#include "machtypes.h"
22 +#include "dev-ap9x-pci.h"
23 #include "dev-gpio-buttons.h"
24 #include "dev-leds-gpio.h"
26 +#include "dev-m25p80.h"
27 +#include "machtypes.h"
30 #define UBNT_XM_GPIO_LED_L1 0
32 #define UBNT_XM_KEYS_POLL_INTERVAL 20
33 #define UBNT_XM_KEYS_DEBOUNCE_INTERVAL (3 * UBNT_XM_KEYS_POLL_INTERVAL)
35 -#define UBNT_XM_EEPROM_ADDR (u8 *) KSEG1ADDR(0x1fff1000)
36 +#define UBNT_XM_EEPROM_ADDR 0x1fff1000
38 static struct gpio_led ubnt_xm_leds_gpio[] __initdata = {
40 @@ -65,48 +66,10 @@ static struct gpio_keys_button ubnt_xm_g
44 -static struct spi_board_info ubnt_xm_spi_info[] = {
48 - .max_speed_hz = 25000000,
49 - .modalias = "mx25l6405d",
53 -static struct ath79_spi_platform_data ubnt_xm_spi_data = {
55 - .num_chipselect = 1,
59 -static struct ath9k_platform_data ubnt_xm_eeprom_data;
61 -static int ubnt_xm_pci_plat_dev_init(struct pci_dev *dev)
63 - switch (PCI_SLOT(dev->devfn)) {
65 - dev->dev.platform_data = &ubnt_xm_eeprom_data;
72 -static void __init ubnt_xm_pci_init(void)
74 - memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
75 - sizeof(ubnt_xm_eeprom_data.eeprom_data));
77 - ath79_pci_set_plat_dev_init(ubnt_xm_pci_plat_dev_init);
78 - ath79_register_pci();
81 -static inline void ubnt_xm_pci_init(void) {}
82 -#endif /* CONFIG_PCI */
84 static void __init ubnt_xm_init(void)
86 + u8 *eeprom = (u8 *) KSEG1ADDR(UBNT_XM_EEPROM_ADDR);
88 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio),
91 @@ -114,10 +77,8 @@ static void __init ubnt_xm_init(void)
92 ARRAY_SIZE(ubnt_xm_gpio_keys),
95 - ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info,
96 - ARRAY_SIZE(ubnt_xm_spi_info));
99 + ath79_register_m25p80(NULL);
100 + ap91_pci_init(eeprom, NULL);
103 MIPS_MACHINE(ATH79_MACH_UBNT_XM,