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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From 8879e209111192c5e9752d7bd203cf7582693328 Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <jonas.gorski@gmail.com>
  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_common.c
  10. +++ b/arch/mips/bcm63xx/boards/board_common.c
  11. @@ -36,6 +36,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 "board_common.h"
  17. @@ -196,6 +197,7 @@ int __init board_register_devices(void)
  18. int button_count = 0;
  19. int led_count = 0;
  20. int usbh_ports = 0;
  21. + int i;
  22. #if CONFIG_OF
  23. if (of_have_populated_dt()) {
  24. @@ -296,6 +298,10 @@ int __init board_register_devices(void)
  25. platform_device_register(&bcm63xx_gpio_keys_device);
  26. }
  27. + /* register any fixups */
  28. + for (i = 0; i < board.has_caldata; i++)
  29. + pci_enable_ath9k_fixup(board.caldata[i].slot, board.caldata[i].caldata_offset);
  30. +
  31. return 0;
  32. }
  33. --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  34. +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  35. @@ -10,6 +10,7 @@
  36. #include <bcm63xx_dev_usb_usbd.h>
  37. #include <bcm63xx_dev_dsp.h>
  38. #include <bcm63xx_fallback_sprom.h>
  39. +#include <pci_ath9k_fixup.h>
  40. /*
  41. * flash mapping
  42. @@ -17,6 +18,11 @@
  43. #define BCM963XX_CFE_VERSION_OFFSET 0x570
  44. #define BCM963XX_NVRAM_OFFSET 0x580
  45. +struct ath9k_caldata {
  46. + unsigned int slot;
  47. + u32 caldata_offset;
  48. +};
  49. +
  50. /*
  51. * board definition
  52. */
  53. @@ -37,6 +43,10 @@ struct board_info {
  54. unsigned int has_uart0:1;
  55. unsigned int has_uart1:1;
  56. unsigned int use_fallback_sprom:1;
  57. + unsigned int has_caldata:2;
  58. +
  59. + /* wifi calibration data config */
  60. + struct ath9k_caldata caldata[2];
  61. /* ethernet config */
  62. struct bcm63xx_enet_platform_data enet0;