604-MIPS-ath79-ap81-fixes.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. --- a/arch/mips/ath79/mach-ap81.c
  2. +++ b/arch/mips/ath79/mach-ap81.c
  3. @@ -9,12 +9,16 @@
  4. * by the Free Software Foundation.
  5. */
  6. -#include "machtypes.h"
  7. -#include "dev-wmac.h"
  8. +#include <linux/mtd/mtd.h>
  9. +#include <linux/mtd/partitions.h>
  10. +
  11. +#include "dev-eth.h"
  12. #include "dev-gpio-buttons.h"
  13. #include "dev-leds-gpio.h"
  14. -#include "dev-spi.h"
  15. +#include "dev-m25p80.h"
  16. #include "dev-usb.h"
  17. +#include "dev-wmac.h"
  18. +#include "machtypes.h"
  19. #define AP81_GPIO_LED_STATUS 1
  20. #define AP81_GPIO_LED_AOSS 3
  21. @@ -67,20 +71,6 @@ static struct gpio_keys_button ap81_gpio
  22. }
  23. };
  24. -static struct spi_board_info ap81_spi_info[] = {
  25. - {
  26. - .bus_num = 0,
  27. - .chip_select = 0,
  28. - .max_speed_hz = 25000000,
  29. - .modalias = "m25p64",
  30. - }
  31. -};
  32. -
  33. -static struct ath79_spi_platform_data ap81_spi_data = {
  34. - .bus_num = 0,
  35. - .num_chipselect = 1,
  36. -};
  37. -
  38. static void __init ap81_setup(void)
  39. {
  40. u8 *cal_data = (u8 *) KSEG1ADDR(AP81_CAL_DATA_ADDR);
  41. @@ -90,10 +80,24 @@ static void __init ap81_setup(void)
  42. ath79_register_gpio_keys_polled(-1, AP81_KEYS_POLL_INTERVAL,
  43. ARRAY_SIZE(ap81_gpio_keys),
  44. ap81_gpio_keys);
  45. - ath79_register_spi(&ap81_spi_data, ap81_spi_info,
  46. - ARRAY_SIZE(ap81_spi_info));
  47. + ath79_register_m25p80(NULL);
  48. ath79_register_wmac(cal_data, NULL);
  49. ath79_register_usb();
  50. +
  51. + ath79_register_mdio(0, 0x0);
  52. +
  53. + ath79_init_mac(ath79_eth0_data.mac_addr, cal_data, 0);
  54. + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
  55. + ath79_eth0_data.speed = SPEED_100;
  56. + ath79_eth0_data.duplex = DUPLEX_FULL;
  57. + ath79_eth0_data.has_ar8216 = 1;
  58. +
  59. + ath79_init_mac(ath79_eth1_data.mac_addr, cal_data, 1);
  60. + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
  61. + ath79_eth1_data.phy_mask = 0x10;
  62. +
  63. + ath79_register_eth(0);
  64. + ath79_register_eth(1);
  65. }
  66. MIPS_MACHINE(ATH79_MACH_AP81, "AP81", "Atheros AP81 reference board",
  67. --- a/arch/mips/ath79/Kconfig
  68. +++ b/arch/mips/ath79/Kconfig
  69. @@ -30,9 +30,10 @@ config ATH79_MACH_AP136
  70. config ATH79_MACH_AP81
  71. bool "Atheros AP81 reference board"
  72. select SOC_AR913X
  73. + select ATH79_DEV_ETH
  74. select ATH79_DEV_GPIO_BUTTONS
  75. select ATH79_DEV_LEDS_GPIO
  76. - select ATH79_DEV_SPI
  77. + select ATH79_DEV_M25P80
  78. select ATH79_DEV_USB
  79. select ATH79_DEV_WMAC
  80. help