413-BCM63XX-allow-providing-fixup-data-in-board-data.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. From 8879e209111192c5e9752d7bd203cf7582693328 Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <[email protected]>
  3. Date: Thu, 3 May 2012 14:40:03 +0200
  4. Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data
  5. ---
  6. arch/mips/bcm63xx/boards/board_bcm963xx.c | 9 ++++++++-
  7. arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 10 ++++++++++
  8. 2 files changed, 18 insertions(+), 1 deletion(-)
  9. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
  10. +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
  11. @@ -33,6 +33,7 @@
  12. #include <bcm63xx_dev_usb_ohci.h>
  13. #include <bcm63xx_dev_usb_usbd.h>
  14. #include <board_bcm963xx.h>
  15. +#include <pci_ath9k_fixup.h>
  16. #include <uapi/linux/bcm933xx_hcs.h>
  17. #include <uapi/linux/bcm963xx_tag.h>
  18. @@ -958,6 +959,7 @@ int __init board_register_devices(void)
  19. {
  20. int button_count = 0;
  21. int led_count = 0;
  22. + int i;
  23. if (board.has_uart0)
  24. bcm63xx_uart_register(0);
  25. @@ -996,7 +998,8 @@ int __init board_register_devices(void)
  26. * do this after registering enet devices
  27. */
  28. #ifdef CONFIG_SSB_PCIHOST
  29. - if (!bcm63xx_nvram_get_mac_address(bcm63xx_sprom.il0mac)) {
  30. + if (!board.has_caldata &&
  31. + !bcm63xx_nvram_get_mac_address(bcm63xx_sprom.il0mac)) {
  32. memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
  33. memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
  34. if (ssb_arch_register_fallback_sprom(
  35. @@ -1042,5 +1045,9 @@ int __init board_register_devices(void)
  36. platform_device_register(&bcm63xx_gpio_keys_device);
  37. }
  38. + /* register any fixups */
  39. + for (i = 0; i < board.has_caldata; i++)
  40. + pci_enable_ath9k_fixup(board.caldata[i].slot, board.caldata[i].caldata_offset);
  41. +
  42. return 0;
  43. }
  44. --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  45. +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  46. @@ -8,6 +8,7 @@
  47. #include <bcm63xx_dev_enet.h>
  48. #include <bcm63xx_dev_usb_usbd.h>
  49. #include <bcm63xx_dev_dsp.h>
  50. +#include <pci_ath9k_fixup.h>
  51. /*
  52. * flash mapping
  53. @@ -15,6 +16,11 @@
  54. #define BCM963XX_CFE_VERSION_OFFSET 0x570
  55. #define BCM963XX_NVRAM_OFFSET 0x580
  56. +struct ath9k_caldata {
  57. + unsigned int slot;
  58. + u32 caldata_offset;
  59. +};
  60. +
  61. /*
  62. * board definition
  63. */
  64. @@ -34,6 +40,10 @@ struct board_info {
  65. unsigned int has_dsp:1;
  66. unsigned int has_uart0:1;
  67. unsigned int has_uart1:1;
  68. + unsigned int has_caldata:2;
  69. +
  70. + /* wifi calibration data config */
  71. + struct ath9k_caldata caldata[2];
  72. /* ethernet config */
  73. struct bcm63xx_enet_platform_data enet0;