b4ccc267a778f9a0be15e3efefe4f8c9fccea48b
[15.05/openwrt.git] / target / linux / brcm63xx / patches-3.14 / 413-BCM63XX-allow-providing-fixup-data-in-board-data.patch
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 ---
7  arch/mips/bcm63xx/boards/board_bcm963xx.c           |    9 ++++++++-
8  arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h |   10 ++++++++++
9  2 files changed, 18 insertions(+), 1 deletion(-)
10
11 --- a/arch/mips/bcm63xx/boards/board_common.c
12 +++ b/arch/mips/bcm63xx/boards/board_common.c
13 @@ -33,6 +33,7 @@
14  #include <bcm63xx_dev_usb_ohci.h>
15  #include <bcm63xx_dev_usb_usbd.h>
16  #include <board_bcm963xx.h>
17 +#include <pci_ath9k_fixup.h>
18  
19  #include "board_common.h"
20  
21 @@ -159,6 +160,7 @@ int __init board_register_devices(void)
22         int button_count = 0;
23         int led_count = 0;
24         int usbh_ports = 0;
25 +       int i;
26  
27         if (board.has_uart0)
28                 bcm63xx_uart_register(0);
29 @@ -247,5 +249,9 @@ int __init board_register_devices(void)
30                 platform_device_register(&bcm63xx_gpio_keys_device);
31         }
32  
33 +       /* register any fixups */
34 +       for (i = 0; i < board.has_caldata; i++)
35 +               pci_enable_ath9k_fixup(board.caldata[i].slot, board.caldata[i].caldata_offset);
36 +
37         return 0;
38  }
39 --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
40 +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
41 @@ -9,6 +9,7 @@
42  #include <bcm63xx_dev_usb_usbd.h>
43  #include <bcm63xx_dev_dsp.h>
44  #include <bcm63xx_fallback_sprom.h>
45 +#include <pci_ath9k_fixup.h>
46  
47  /*
48   * flash mapping
49 @@ -16,6 +17,11 @@
50  #define BCM963XX_CFE_VERSION_OFFSET    0x570
51  #define BCM963XX_NVRAM_OFFSET          0x580
52  
53 +struct ath9k_caldata {
54 +       unsigned int    slot;
55 +       u32             caldata_offset;
56 +};
57 +
58  /*
59   * board definition
60   */
61 @@ -36,6 +42,10 @@ struct board_info {
62         unsigned int    has_uart0:1;
63         unsigned int    has_uart1:1;
64         unsigned int    use_fallback_sprom:1;
65 +       unsigned int    has_caldata:2;
66 +
67 +       /* wifi calibration data config */
68 +       struct ath9k_caldata caldata[2];
69  
70         /* ethernet config */
71         struct bcm63xx_enet_platform_data enet0;