source: trunk/target/linux/octeon/patches-2.6.30/009-more_chip_specific_feature_tests.patch @ 19513

Last change on this file since 19513 was 19513, checked in by florian, 7 years ago

[octeon] move generic config and patches directory to be 2.6.30 specific

File size: 1.7 KB
  • arch/mips/include/asm/octeon/octeon-feature.h

    The octeon-ethernet driver needs to check for additional chip specific
    features, we add them to the octeon_has_feature() framework.
    
    Signed-off-by: David Daney <ddaney@caviumnetworks.com>
    ---
     arch/mips/include/asm/octeon/octeon-feature.h |   27 +++++++++++++++++++++++++
     1 files changed, 27 insertions(+), 0 deletions(-)
    
    a b enum octeon_feature { 
    5757        OCTEON_FEATURE_RAID, 
    5858        /* Octeon has a builtin USB */ 
    5959        OCTEON_FEATURE_USB, 
     60        /* Octeon IPD can run without using work queue entries */ 
     61        OCTEON_FEATURE_NO_WPTR, 
     62        /* Octeon has DFA state machines */ 
     63        OCTEON_FEATURE_DFA, 
     64        /* Octeon MDIO block supports clause 45 transactions for 10 
     65         * Gig support */ 
     66        OCTEON_FEATURE_MDIO_CLAUSE_45, 
    6067}; 
    6168 
    6269static inline int cvmx_fuse_read(int fuse); 
    static inline int octeon_has_feature(enu 
    112119        case OCTEON_FEATURE_USB: 
    113120                return !(OCTEON_IS_MODEL(OCTEON_CN38XX) 
    114121                         || OCTEON_IS_MODEL(OCTEON_CN58XX)); 
     122        case OCTEON_FEATURE_NO_WPTR: 
     123                return (OCTEON_IS_MODEL(OCTEON_CN56XX) 
     124                         || OCTEON_IS_MODEL(OCTEON_CN52XX)) 
     125                        && !OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X) 
     126                        && !OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X); 
     127        case OCTEON_FEATURE_DFA: 
     128                if (!OCTEON_IS_MODEL(OCTEON_CN38XX) 
     129                    && !OCTEON_IS_MODEL(OCTEON_CN31XX) 
     130                    && !OCTEON_IS_MODEL(OCTEON_CN58XX)) 
     131                        return 0; 
     132                else if (OCTEON_IS_MODEL(OCTEON_CN3020)) 
     133                        return 0; 
     134                else if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1)) 
     135                        return 1; 
     136                else 
     137                        return !cvmx_fuse_read(120); 
     138        case OCTEON_FEATURE_MDIO_CLAUSE_45: 
     139                return !(OCTEON_IS_MODEL(OCTEON_CN3XXX) 
     140                         || OCTEON_IS_MODEL(OCTEON_CN58XX) 
     141                         || OCTEON_IS_MODEL(OCTEON_CN50XX)); 
    115142        } 
    116143        return 0; 
    117144} 
Note: See TracBrowser for help on using the repository browser.