Changeset 17066


Ignore:
Timestamp:
05/15/11 18:49:29 (2 years ago)
Author:
eko
Message:

now switch-adm working again on k24

Location:
src/linux/brcm/linux.v24_2/drivers/net/switch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/linux/brcm/linux.v24_2/drivers/net/switch/gpio-bcm947xx.h

    r16812 r17066  
    11#ifndef __SWITCH_GPIO_H 
    22#define __SWITCH_GPIO_H 
    3 #include <linux/interrupt.h> 
    43 
    5 #ifndef BCMDRIVER 
    6 #include <linux/ssb/ssb_embedded.h> 
    74 
    8 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) 
    9 #define ssb ssb_bcm47xx 
     5#if defined(BCMGPIO2) 
     6 
     7#ifdef LINUX_2_4 
     8#define sbh bcm947xx_sbh 
     9extern void *bcm947xx_sbh; 
     10#else 
     11extern void *sbh; 
    1012#endif 
    1113 
    12 extern struct ssb_bus ssb; 
     14extern __u32 sb_gpioin(void *sbh); 
     15extern __u32 sb_gpiointpolarity(void *sbh, __u32 mask, __u32 val, __u8 prio); 
     16extern __u32 sb_gpiointmask(void *sbh, __u32 mask, __u32 val, __u8 prio); 
     17extern __u32 sb_gpioouten(void *sbh, __u32 mask, __u32 val, __u8 prio); 
     18extern __u32 sb_gpioout(void *sbh, __u32 mask, __u32 val, __u8 prio); 
     19 
     20#define gpio_in() sb_gpioin(sbh) 
     21#define gpio_intpolarity(mask,val) sb_gpiointpolarity(sbh, mask, val, 0) 
     22#define gpio_intmask(mask,val) sb_gpiointmask(sbh, mask, val, 0) 
     23#define gpio_outen(mask,val) sb_gpioouten(sbh, mask, val, 0) 
     24#define gpio_out(mask,val) sb_gpioout(sbh, mask, val, 0) 
     25 
     26#elif defined(BCMGPIO) 
     27 
     28#define sbh bcm947xx_sbh 
     29extern void *bcm947xx_sbh; 
     30extern __u32 sb_gpioin(void *sbh); 
     31extern __u32 sb_gpiointpolarity(void *sbh, __u32 mask, __u32 val); 
     32extern __u32 sb_gpiointmask(void *sbh, __u32 mask, __u32 val); 
     33extern __u32 sb_gpioouten(void *sbh, __u32 mask, __u32 val); 
     34extern __u32 sb_gpioout(void *sbh, __u32 mask, __u32 val); 
     35 
     36#define gpio_in() sb_gpioin(sbh) 
     37#define gpio_intpolarity(mask,val) sb_gpiointpolarity(sbh, mask, val) 
     38#define gpio_intmask(mask,val) sb_gpiointmask(sbh, mask, val) 
     39#define gpio_outen(mask,val) sb_gpioouten(sbh, mask, val) 
     40#define gpio_out(mask,val) sb_gpioout(sbh, mask, val) 
     41 
     42#else 
     43#error Unsupported/unknown GPIO configuration 
     44#endif 
    1345 
    1446 
    15 static inline u32 gpio_in(void) 
    16 { 
    17         return ssb_gpio_in(&ssb, ~0); 
    18 } 
    19  
    20 static inline u32 gpio_out(u32 mask, u32 value) 
    21 { 
    22         return ssb_gpio_out(&ssb, mask, value); 
    23 } 
    24  
    25 static inline u32 gpio_outen(u32 mask, u32 value) 
    26 { 
    27         return ssb_gpio_outen(&ssb, mask, value); 
    28 } 
    29  
    30 static inline u32 gpio_control(u32 mask, u32 value) 
    31 { 
    32         return ssb_gpio_control(&ssb, mask, value); 
    33 } 
    34  
    35 static inline u32 gpio_intmask(u32 mask, u32 value) 
    36 { 
    37         return ssb_gpio_intmask(&ssb, mask, value); 
    38 } 
    39  
    40 static inline u32 gpio_intpolarity(u32 mask, u32 value) 
    41 { 
    42         return ssb_gpio_polarity(&ssb, mask, value); 
    43 } 
    44  
    45 #else 
    46  
    47 #include <typedefs.h> 
    48 #include <osl.h> 
    49 #include <bcmdevs.h> 
    50 #include <sbutils.h> 
    51 #include <sbconfig.h> 
    52 #include <sbchipc.h> 
    53 #include <hndchipc.h> 
    54 #include <hndcpu.h> 
    55  
    56 #define sbh bcm947xx_sih 
    57 #define sbh_lock bcm947xx_sbh_lock 
    58  
    59 extern void *sbh; 
    60 extern spinlock_t sbh_lock; 
    61  
    62 #define gpio_in()       sbh_gpioin(sbh) 
    63 #define gpio_out(mask, value)   sbh_gpioout(sbh, mask, ((value) & (mask)), GPIO_DRV_PRIORITY) 
    64 #define gpio_outen(mask, value)         sbh_gpioouten(sbh, mask, value, GPIO_DRV_PRIORITY) 
    65 #define gpio_control(mask, value)       sbh_gpiocontrol(sbh, mask, value, GPIO_DRV_PRIORITY) 
    66 #define gpio_intmask(mask, value)       sbh_gpiointmask(sbh, mask, value, GPIO_DRV_PRIORITY) 
    67 #define gpio_intpolarity(mask, value)   sbh_gpiointpolarity(sbh, mask, value, GPIO_DRV_PRIORITY) 
    68  
    69 #endif /* BCMDRIVER */ 
    7047#endif /* __SWITCH_GPIO_H */ 
  • src/linux/brcm/linux.v24_2/drivers/net/switch/switch-adm.c

    r16812 r17066  
    7676#define atoi(str) simple_strtoul(((str != NULL) ? str : ""), NULL, 0) 
    7777 
    78 #ifdef BROADCOM 
     78 
    7979extern char *nvram_get(char *name); 
    8080 
     
    102102        return def_pin; 
    103103} 
    104 #endif 
     104 
    105105 
    106106 
     
    501501        int ret = 0; 
    502502 
    503 #ifdef BROADCOM 
     503 
    504504        int boardflags = atoi(nvram_get("boardflags")); 
    505505        int boardnum = atoi(nvram_get("boardnum")); 
     
    539539        if (eerc) 
    540540                eerc = (1 << eerc); 
    541 #else 
    542         ret = 1; 
    543 #endif 
     541 
    544542 
    545543        return ret; 
Note: See TracChangeset for help on using the changeset viewer.