Changeset 26829


Ignore:
Timestamp:
2011-05-05T16:05:21+02:00 (7 years ago)
Author:
hauke
Message:

brcm47xx: when detecting a ssb pci device without an own sprom write the sprom data from the platform device to the correct pointer.

Location:
trunk/target/linux
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm47xx/patches-2.6.37/031-ssb-add-callback-for-sprom.patch

    r26801 r26829  
    66 }; 
    77+ 
    8 +int bcm63xx_get_fallback_sprom(struct ssb_bus *bus) 
     8+int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out) 
    99+{ 
    1010+       if (bus->bustype == SSB_BUSTYPE_PCI) { 
    11 +               memcpy(&bus->sprom, &bcm63xx_sprom, sizeof(struct ssb_sprom)); 
     11+               memcpy(out, &bcm63xx_sprom, sizeof(struct ssb_sprom)); 
    1212+               return 0; 
    1313+       } else { 
     
    5151+                        * Now we ask the arch code if there is some sprom 
    5252+                        * avaliable for this device in some other storage */ 
    53 +                       err = ssb_fill_sprom_with_fallback(bus); 
     53+                       err = ssb_fill_sprom_with_fallback(bus, sprom); 
    5454+                       if (err) { 
    5555+                               ssb_printk(KERN_WARNING PFX "WARNING: Using" 
     
    6767  
    6868-static const struct ssb_sprom *fallback_sprom; 
    69 +static int(*get_fallback_sprom)(struct ssb_bus *dev); 
     69+static int(*get_fallback_sprom)(struct ssb_bus *dev, struct ssb_sprom *out); 
    7070  
    7171  
     
    9696  */ 
    9797-int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom) 
    98 +int ssb_arch_register_fallback_sprom(int (*sprom_callback)(struct ssb_bus *bus)) 
     98+int ssb_arch_register_fallback_sprom(int (*sprom_callback)(struct ssb_bus *bus, struct ssb_sprom *out)) 
    9999 { 
    100100-       if (fallback_sprom) 
     
    108108  
    109109-const struct ssb_sprom *ssb_get_fallback_sprom(void) 
    110 +int ssb_fill_sprom_with_fallback(struct ssb_bus *bus) 
     110+int ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out) 
    111111 { 
    112112-       return fallback_sprom; 
     
    114114+               return -ENOENT; 
    115115+ 
    116 +       return get_fallback_sprom(bus); 
     116+       return get_fallback_sprom(bus, out); 
    117117 } 
    118118  
     
    125125                             int (*sprom_write)(struct ssb_bus *bus, const u16 *sprom)); 
    126126-extern const struct ssb_sprom *ssb_get_fallback_sprom(void); 
    127 +extern int ssb_fill_sprom_with_fallback(struct ssb_bus *bus); 
     127+extern int ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out); 
    128128  
    129129  
     
    131131--- a/include/linux/ssb/ssb.h 
    132132+++ b/include/linux/ssb/ssb.h 
    133 @@ -404,7 +404,8 @@ extern bool ssb_is_sprom_available(struc 
     133@@ -404,7 +404,9 @@ extern bool ssb_is_sprom_available(struc 
    134134  
    135135 /* Set a fallback SPROM. 
     
    137137-extern int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom); 
    138138+extern int ssb_arch_register_fallback_sprom( 
    139 +               int (*sprom_callback)(struct ssb_bus *bus)); 
     139+               int (*sprom_callback)(struct ssb_bus *bus, 
     140+               struct ssb_sprom *out)); 
    140141  
    141142 /* Suspend a SSB bus. 
  • trunk/target/linux/brcm47xx/patches-2.6.37/033-bcm47xx-register-fallback-callback.patch

    r26801 r26829  
    1616 } 
    1717  
    18 +int bcm47xx_get_sprom(struct ssb_bus *bus) 
     18+int bcm47xx_get_sprom(struct ssb_bus *bus, struct ssb_sprom *out) 
    1919+{ 
    2020+       char prefix[10]; 
     
    2424+                        bus->host_pci->bus->number + 1, 
    2525+                        PCI_SLOT(bus->host_pci->devfn)); 
    26 +               bcm47xx_fill_sprom(&bus->sprom, prefix); 
     26+               bcm47xx_fill_sprom(out, prefix); 
    2727+               return 0; 
    2828+       } else { 
  • trunk/target/linux/brcm47xx/patches-2.6.38/031-ssb-add-callback-for-sprom.patch

    r26801 r26829  
    66 }; 
    77+ 
    8 +int bcm63xx_get_fallback_sprom(struct ssb_bus *bus) 
     8+int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out) 
    99+{ 
    1010+       if (bus->bustype == SSB_BUSTYPE_PCI) { 
    11 +               memcpy(&bus->sprom, &bcm63xx_sprom, sizeof(struct ssb_sprom)); 
     11+               memcpy(out, &bcm63xx_sprom, sizeof(struct ssb_sprom)); 
    1212+               return 0; 
    1313+       } else { 
     
    5151+                        * Now we ask the arch code if there is some sprom 
    5252+                        * avaliable for this device in some other storage */ 
    53 +                       err = ssb_fill_sprom_with_fallback(bus); 
     53+                       err = ssb_fill_sprom_with_fallback(bus, sprom); 
    5454+                       if (err) { 
    5555+                               ssb_printk(KERN_WARNING PFX "WARNING: Using" 
     
    6767  
    6868-static const struct ssb_sprom *fallback_sprom; 
    69 +static int(*get_fallback_sprom)(struct ssb_bus *dev); 
     69+static int(*get_fallback_sprom)(struct ssb_bus *dev, struct ssb_sprom *out); 
    7070  
    7171  
     
    9696  */ 
    9797-int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom) 
    98 +int ssb_arch_register_fallback_sprom(int (*sprom_callback)(struct ssb_bus *bus)) 
     98+int ssb_arch_register_fallback_sprom(int (*sprom_callback)(struct ssb_bus *bus, struct ssb_sprom *out)) 
    9999 { 
    100100-       if (fallback_sprom) 
     
    108108  
    109109-const struct ssb_sprom *ssb_get_fallback_sprom(void) 
    110 +int ssb_fill_sprom_with_fallback(struct ssb_bus *bus) 
     110+int ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out) 
    111111 { 
    112112-       return fallback_sprom; 
     
    114114+               return -ENOENT; 
    115115+ 
    116 +       return get_fallback_sprom(bus); 
     116+       return get_fallback_sprom(bus, out); 
    117117 } 
    118118  
     
    125125                             int (*sprom_write)(struct ssb_bus *bus, const u16 *sprom)); 
    126126-extern const struct ssb_sprom *ssb_get_fallback_sprom(void); 
    127 +extern int ssb_fill_sprom_with_fallback(struct ssb_bus *bus); 
     127+extern int ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out); 
    128128  
    129129  
     
    131131--- a/include/linux/ssb/ssb.h 
    132132+++ b/include/linux/ssb/ssb.h 
    133 @@ -404,7 +404,8 @@ extern bool ssb_is_sprom_available(struc 
     133@@ -404,7 +404,9 @@ extern bool ssb_is_sprom_available(struc 
    134134  
    135135 /* Set a fallback SPROM. 
     
    137137-extern int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom); 
    138138+extern int ssb_arch_register_fallback_sprom( 
    139 +               int (*sprom_callback)(struct ssb_bus *bus)); 
     139+               int (*sprom_callback)(struct ssb_bus *bus, 
     140+               struct ssb_sprom *out)); 
    140141  
    141142 /* Suspend a SSB bus. 
  • trunk/target/linux/brcm47xx/patches-2.6.38/033-bcm47xx-register-fallback-callback.patch

    r26801 r26829  
    1616 } 
    1717  
    18 +int bcm47xx_get_sprom(struct ssb_bus *bus) 
     18+int bcm47xx_get_sprom(struct ssb_bus *bus, struct ssb_sprom *out) 
    1919+{ 
    2020+       char prefix[10]; 
     
    2424+                        bus->host_pci->bus->number + 1, 
    2525+                        PCI_SLOT(bus->host_pci->devfn)); 
    26 +               bcm47xx_fill_sprom(&bus->sprom, prefix); 
     26+               bcm47xx_fill_sprom(out, prefix); 
    2727+               return 0; 
    2828+       } else { 
  • trunk/target/linux/brcm63xx/patches-2.6.37/500-ssb-add-callback-for-sprom.patch

    r26801 r26829  
    1 From 62a518124cff3970d99f7ccdab457f4289e3b982 Mon Sep 17 00:00:00 2001 
    2 From: Hauke Mehrtens <hauke@hauke-m.de> 
    3 Date: Sat, 30 Apr 2011 15:42:30 +0200 
    4 Subject: [PATCH 1/4] ssb: add callback for sprom 
    5  
    6  
    7 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    8 --- 
    9  arch/mips/bcm63xx/boards/board_bcm963xx.c |   16 ++++++++++++++-- 
    10  drivers/ssb/pci.c                         |   13 ++++++++----- 
    11  drivers/ssb/sprom.c                       |   26 +++++++++++++++----------- 
    12  drivers/ssb/ssb_private.h                 |    2 +- 
    13  include/linux/ssb/ssb.h                   |    3 ++- 
    14  5 files changed, 40 insertions(+), 20 deletions(-) 
    15  
    161--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c 
    172+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c 
     
    216 }; 
    227+ 
    23 +int bcm63xx_get_fallback_sprom(struct ssb_bus *bus) 
     8+int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out) 
    249+{ 
    2510+       if (bus->bustype == SSB_BUSTYPE_PCI) { 
    26 +               memcpy(&bus->sprom, &bcm63xx_sprom, sizeof(struct ssb_sprom)); 
     11+               memcpy(out, &bcm63xx_sprom, sizeof(struct ssb_sprom)); 
    2712+               return 0; 
    2813+       } else { 
     
    6651+                        * Now we ask the arch code if there is some sprom 
    6752+                        * avaliable for this device in some other storage */ 
    68 +                       err = ssb_fill_sprom_with_fallback(bus); 
     53+                       err = ssb_fill_sprom_with_fallback(bus, sprom); 
    6954+                       if (err) { 
    7055+                               ssb_printk(KERN_WARNING PFX "WARNING: Using" 
     
    8267  
    8368-static const struct ssb_sprom *fallback_sprom; 
    84 +static int(*get_fallback_sprom)(struct ssb_bus *dev); 
     69+static int(*get_fallback_sprom)(struct ssb_bus *dev, struct ssb_sprom *out); 
    8570  
    8671  
     
    11196  */ 
    11297-int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom) 
    113 +int ssb_arch_register_fallback_sprom(int (*sprom_callback)(struct ssb_bus *bus)) 
     98+int ssb_arch_register_fallback_sprom(int (*sprom_callback)(struct ssb_bus *bus, struct ssb_sprom *out)) 
    11499 { 
    115100-       if (fallback_sprom) 
     
    123108  
    124109-const struct ssb_sprom *ssb_get_fallback_sprom(void) 
    125 +int ssb_fill_sprom_with_fallback(struct ssb_bus *bus) 
     110+int ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out) 
    126111 { 
    127112-       return fallback_sprom; 
     
    129114+               return -ENOENT; 
    130115+ 
    131 +       return get_fallback_sprom(bus); 
     116+       return get_fallback_sprom(bus, out); 
    132117 } 
    133118  
     
    140125                             int (*sprom_write)(struct ssb_bus *bus, const u16 *sprom)); 
    141126-extern const struct ssb_sprom *ssb_get_fallback_sprom(void); 
    142 +extern int ssb_fill_sprom_with_fallback(struct ssb_bus *bus); 
     127+extern int ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out); 
    143128  
    144129  
     
    146131--- a/include/linux/ssb/ssb.h 
    147132+++ b/include/linux/ssb/ssb.h 
    148 @@ -404,7 +404,8 @@ extern bool ssb_is_sprom_available(struc 
     133@@ -404,7 +404,9 @@ extern bool ssb_is_sprom_available(struc 
    149134  
    150135 /* Set a fallback SPROM. 
     
    152137-extern int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom); 
    153138+extern int ssb_arch_register_fallback_sprom( 
    154 +               int (*sprom_callback)(struct ssb_bus *bus)); 
     139+               int (*sprom_callback)(struct ssb_bus *bus, 
     140+               struct ssb_sprom *out)); 
    155141  
    156142 /* Suspend a SSB bus. 
  • trunk/target/linux/brcm63xx/patches-2.6.37/977-ssb_export_fallback_sprom.patch

    r26801 r26829  
    1616+EXPORT_SYMBOL(bcm63xx_sprom); 
    1717  
    18  int bcm63xx_get_fallback_sprom(struct ssb_bus *bus) 
     18 int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out) 
    1919 { 
Note: See TracChangeset for help on using the changeset viewer.