1 --- a/arch/mips/ath79/Kconfig
2 +++ b/arch/mips/ath79/Kconfig
3 @@ -57,9 +57,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,54 +66,10 @@ static struct gpio_keys_button ubnt_xm_g
44 -static struct ath79_spi_controller_data ubnt_xm_spi0_data = {
45 - .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
49 -static struct spi_board_info ubnt_xm_spi_info[] = {
53 - .max_speed_hz = 25000000,
54 - .modalias = "mx25l6405d",
55 - .controller_data = &ubnt_xm_spi0_data,
59 -static struct ath79_spi_platform_data ubnt_xm_spi_data = {
61 - .num_chipselect = 1,
65 -static struct ath9k_platform_data ubnt_xm_eeprom_data;
67 -static int ubnt_xm_pci_plat_dev_init(struct pci_dev *dev)
69 - switch (PCI_SLOT(dev->devfn)) {
71 - dev->dev.platform_data = &ubnt_xm_eeprom_data;
78 -static void __init ubnt_xm_pci_init(void)
80 - memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
81 - sizeof(ubnt_xm_eeprom_data.eeprom_data));
83 - ath79_pci_set_plat_dev_init(ubnt_xm_pci_plat_dev_init);
84 - ath79_register_pci();
87 -static inline void ubnt_xm_pci_init(void) {}
88 -#endif /* CONFIG_PCI */
90 static void __init ubnt_xm_init(void)
92 + u8 *eeprom = (u8 *) KSEG1ADDR(UBNT_XM_EEPROM_ADDR);
94 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio),
97 @@ -120,10 +77,8 @@ static void __init ubnt_xm_init(void)
98 ARRAY_SIZE(ubnt_xm_gpio_keys),
101 - ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info,
102 - ARRAY_SIZE(ubnt_xm_spi_info));
104 - ubnt_xm_pci_init();
105 + ath79_register_m25p80(NULL);
106 + ap91_pci_init(eeprom, NULL);
109 MIPS_MACHINE(ATH79_MACH_UBNT_XM,