openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

phy8806x_pe_api.c (17124B)


      1 /*
      2  * 
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      6  *
      7  * File:       phy8806x_pe_api.c
      8  */
      9 
     10 
     11 #include <soc/error.h>
     12 #include <phymod/phymod.h>
     13 #include <phymod/phymod_util.h>
     14 #include <soc/phy/phymod_ctrl.h>
     15 #include "phy8806x_xmod_api.h"
     16 
     17 
     18 extern int
     19 phy_8806x_xmod_command(int unit, int port, int mode_opcode,  uint32_t arg[], int arg_size, uint32_t result[], int result_size);
     20 
     21 #ifdef PHYMOD_PHY8806X_SUPPORT
     22 
     23 #define XMOD_CMD_MODE_CORE(cmd)  (cmd)
     24 #define XMOD_CMD_MODE_ETH(cmd)   (0x100 | cmd)
     25 #define XMOD_CMD_MODE_FC(cmd)    (0x200 | cmd)
     26 #define XMOD_CMD_MODE_CPRI(cmd)  (0x300 | cmd)
     27 
     28 
     29 /* ! Byte swap unsigned short */
     30 uint16_t swap_uint16( uint16_t val ) 
     31 {
     32     return (val << 8) | (val >> 8 );
     33 }
     34 
     35 /* ! Byte swap short */
     36 int16_t swap_int16( int16_t val ) 
     37 {
     38     return (val << 8) | ((val >> 8) & 0xFF);
     39 }
     40 
     41 /* ! Byte swap unsigned int */
     42 uint32_t swap_uint32( uint32_t val )
     43 {
     44 #ifdef BE_HOST
     45     val = ((val << 8) & 0xFF00FF00 ) | ((val >> 8) & 0xFF00FF ); 
     46     return (val << 16) | (val >> 16);
     47 #else
     48     return val;
     49 #endif
     50 }
     51 
     52 /* ! Byte swap int */
     53 int32_t swap_int32( int32_t val )
     54 {
     55     val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF ); 
     56     return (val << 16) | ((val >> 16) & 0xFFFF);
     57 }
     58 
     59 /* ! Byte swap unsigned int */
     60 uint64_t swap_uint64( uint64_t val )
     61 {
     62 #ifdef BE_HOST
     63     uint32_t val0 = COMPILER_64_HI(val);
     64     uint32_t val1 = COMPILER_64_LO(val);
     65     uint64_t ret_val;
     66     COMPILER_64_SET(ret_val, swap_uint32(val1), swap_uint32(val0));
     67     return (ret_val);
     68 #else
     69     return val;
     70 #endif
     71 }
     72 
     73 int pe_xmod_pe_init(int unit, int port, xmod_pe_config_t *config)
     74 {
     75 #ifdef INCLUDE_PHY_8806X
     76     xmod_pe_config_t x_config;
     77     uint32_t xmodtxbuff[XMOD_BUFFER_MAX_LEN/4];
     78     uint8_t *buftxptr;
     79     int xmodtxlen, rv, idx;
     80 
     81     LOG_CLI((BSL_META_U(0, "%s() enter; unit %d; port %d\n"), __FUNCTION__, unit, port));
     82 
     83     /* setting up xmod xmod_pe_init: */
     84     /* int xmod_pe_init(IN xmod_pe_config_t *config)  */
     85 
     86     LOG_CLI((BSL_META_U(0, "%s() mode %d\n"), __FUNCTION__, config->mode));
     87     LOG_CLI((BSL_META_U(0, "%s() tag %d\n"), __FUNCTION__, config->tag));
     88     LOG_CLI((BSL_META_U(0, "%s() pfc %d\n"), __FUNCTION__, config->pfc));
     89 
     90      /* Convert to Little endian */
     91     x_config.mode = config->mode;
     92     x_config.tag = config->tag;
     93     x_config.pfc = config->pfc;
     94     x_config.res = config->res;
     95     for (idx=0; idx<4; idx++) {
     96         x_config.pcid[idx] = swap_uint16(config->pcid[idx]);
     97     }
     98 
     99     /* write args to xmod buffer */
    100     buftxptr = (uint8_t *)xmodtxbuff;
    101     WRITE_XMOD_ARG_BUFF(buftxptr, &x_config, sizeof(xmod_pe_config_t));
    102     xmodtxlen = GET_XMOD_ETHERNET_CMD_IN_LEN(XMOD_PE_INIT);
    103     xmodtxlen = GET_XMOD_BUF_WORD_LEN(xmodtxlen);
    104 
    105     /* call xmod */
    106     rv = phy_8806x_xmod_command(unit, port, 
    107                                 XMOD_CMD_MODE_ETH(XMOD_PE_INIT),
    108                                 xmodtxbuff, xmodtxlen, NULL, 0);
    109     if (SOC_FAILURE(rv)) {
    110         LOG_CLI((BSL_META_U(0, "%s() phy_8806x_xmod_command() error %d\n"), __FUNCTION__, rv));
    111         return SOC_E_FAIL;
    112     }
    113 
    114     return rv;
    115 #else
    116     return PHYMOD_E_NONE;
    117 #endif
    118 }
    119 
    120 int pe_xmod_pe_status_get(int unit, int port, xmod_pe_status_t *status)
    121 {
    122 #ifdef INCLUDE_PHY_8806X
    123     uint32_t xmodrxbuff[XMOD_BUFFER_MAX_LEN/4];
    124     uint8_t *bufrxptr;
    125     int xmodrxlen, rv;
    126 
    127     LOG_CLI((BSL_META_U(0, "%s() enter; unit %d; port %d\n"), __FUNCTION__, unit, port));
    128 
    129     /* setting up xmod xmod_pe_status_get:      */
    130     /* int xmod_pe_status_get(OUT xmod_pe_status_t status) */
    131 
    132     /* setup out args */
    133     xmodrxlen = GET_XMOD_ETHERNET_CMD_OUT_LEN(XMOD_PE_STATUS_GET);
    134     xmodrxlen = GET_XMOD_BUF_WORD_LEN(xmodrxlen);
    135 
    136     /* call xmod */
    137     rv = phy_8806x_xmod_command(unit, port,
    138                                 XMOD_CMD_MODE_ETH(XMOD_PE_STATUS_GET),
    139                                 NULL, 0, xmodrxbuff, xmodrxlen);
    140     if (SOC_FAILURE(rv)) {
    141         LOG_CLI((BSL_META_U(0, "%s() phy_8806x_xmod_command() error %d\n"), __FUNCTION__, rv));
    142         return SOC_E_FAIL;
    143     }
    144 
    145     /* retrieve the argument from the xmod rx buffer */
    146     bufrxptr = (uint8_t *)xmodrxbuff;
    147     READ_XMOD_ARG_BUFF(bufrxptr, status, sizeof(xmod_pe_status_t));
    148 
    149     LOG_CLI((BSL_META_U(0, "%s() up_port:  res %d; link %d\n"), __FUNCTION__, status->up_port.res, status->up_port.link_up));
    150     LOG_CLI((BSL_META_U(0, "%s() pe_port0: res %d; link %d\n"), __FUNCTION__, status->pe_port0.res, status->pe_port0.link_up));
    151     LOG_CLI((BSL_META_U(0, "%s() pe_port1: res %d; link %d\n"), __FUNCTION__, status->pe_port1.res, status->pe_port1.link_up));
    152     LOG_CLI((BSL_META_U(0, "%s() pe_port2: res %d; link %d\n"), __FUNCTION__, status->pe_port2.res, status->pe_port2.link_up));
    153     LOG_CLI((BSL_META_U(0, "%s() pe_port3: res %d; link %d\n"), __FUNCTION__, status->pe_port3.res, status->pe_port3.link_up));
    154 
    155     return rv;
    156 #else
    157     return PHYMOD_E_NONE;
    158 #endif
    159 }
    160 
    161 int pe_xmod_pe_port_stats_get(int unit, int port, int pe_port, xmod_pe_port_stats_t *stats, int reset)
    162 {
    163 #ifdef INCLUDE_PHY_8806X
    164     uint8_t x_port = (uint8_t)pe_port;
    165     uint8_t x_reset = (uint8_t)reset;
    166     uint32_t xmodtxbuff[XMOD_BUFFER_MAX_LEN/4];
    167     uint8_t *buftxptr;
    168     int xmodtxlen;
    169     uint32_t xmodrxbuff[XMOD_BUFFER_MAX_LEN/4];
    170     uint8_t *bufrxptr;
    171     int xmodrxlen;
    172     int rv;
    173 
    174     LOG_CLI((BSL_META_U(0, "%s() enter; unit %d; port %d\n"), __FUNCTION__, unit, port));
    175 
    176     /* setting up xmod xmod_pe_port_stats_get:                              */
    177     /* int xmod_pe_port_stats_get(IN uint8_t port, OUT xmod_pe_port_stats_t stats) */
    178 
    179     /* setup in args - write args to xmod buffer */
    180     buftxptr = (uint8_t *)xmodtxbuff;
    181     WRITE_XMOD_ARG_BUFF(buftxptr, &x_port, sizeof(uint8_t));
    182     WRITE_XMOD_ARG_BUFF(buftxptr, &x_reset, sizeof(uint8_t));
    183     xmodtxlen = GET_XMOD_ETHERNET_CMD_IN_LEN(XMOD_PE_PORT_STATS_GET);
    184     xmodtxlen = GET_XMOD_BUF_WORD_LEN(xmodtxlen);
    185 
    186     /* setup out args */
    187     xmodrxlen = GET_XMOD_ETHERNET_CMD_OUT_LEN(XMOD_PE_PORT_STATS_GET);
    188     xmodrxlen = GET_XMOD_BUF_WORD_LEN(xmodrxlen);
    189 
    190     /* call xmod */
    191     rv = phy_8806x_xmod_command(unit, port,
    192                                 XMOD_CMD_MODE_ETH(XMOD_PE_PORT_STATS_GET),
    193                                 xmodtxbuff, xmodtxlen, xmodrxbuff, xmodrxlen);
    194     if (SOC_FAILURE(rv)) {
    195         LOG_CLI((BSL_META_U(0, "%s() phy_8806x_xmod_command() error %d\n"), __FUNCTION__, rv));
    196         return SOC_E_FAIL;
    197     }
    198 
    199     /* retrieve the argument from the xmod rx buffer */
    200     bufrxptr = (uint8_t *)xmodrxbuff;
    201     READ_XMOD_ARG_BUFF(bufrxptr, stats, sizeof(xmod_pe_port_stats_t));
    202     stats->port_dn_cnt = swap_uint32(stats->port_dn_cnt);
    203 
    204     stats->rpkt = swap_uint64(stats->rpkt);
    205     stats->rbyt = swap_uint64(stats->rbyt);
    206     stats->tpkt = swap_uint64(stats->tpkt);
    207     stats->tbyt = swap_uint64(stats->tbyt);
    208 
    209     stats->rfcs = swap_uint64(stats->rfcs);
    210     stats->rfrg = swap_uint64(stats->rfrg);
    211     stats->rjbr = swap_uint64(stats->rjbr);
    212     stats->rovr = swap_uint64(stats->rovr);
    213     stats->rrpkt = swap_uint64(stats->rrpkt);
    214     stats->raln = swap_uint64(stats->raln);
    215     stats->rerpkt = swap_uint64(stats->rerpkt);
    216     stats->rmtue = swap_uint64(stats->rmtue);
    217     stats->rprm = swap_uint64(stats->rprm);
    218     stats->rschcrc = swap_uint64(stats->rschcrc);
    219     stats->rtrfu = swap_uint64(stats->rtrfu);
    220     stats->rfcr = swap_uint64(stats->rfcr);
    221     stats->rxpf = swap_uint64(stats->rxpf);
    222     stats->rflr = swap_uint64(stats->rflr);
    223 
    224     stats->tfcs = swap_uint64(stats->tfcs);
    225     stats->tfrg = swap_uint64(stats->tfrg);
    226     stats->tjbr = swap_uint64(stats->tjbr);
    227     stats->tncl = swap_uint64(stats->tncl);
    228     stats->tovr = swap_uint64(stats->tovr);
    229     stats->trpkt = swap_uint64(stats->trpkt);
    230     stats->txpf = swap_uint64(stats->txpf);
    231 
    232     LOG_CLI((BSL_META_U(0, "%s(%d) port_dn_cnt %x\n"),
    233                 __FUNCTION__, x_port, stats->port_dn_cnt));
    234 
    235     LOG_CLI((BSL_META_U(0, "%s(%d) rpkt 0x%08x%08x\n"), __FUNCTION__, x_port,
    236                 COMPILER_64_HI(stats->rpkt), COMPILER_64_LO(stats->rpkt)));
    237     LOG_CLI((BSL_META_U(0, "%s(%d) rbyt 0x%08x%08x\n"), __FUNCTION__, x_port,
    238                 COMPILER_64_HI(stats->rbyt), COMPILER_64_LO(stats->rbyt)));
    239     LOG_CLI((BSL_META_U(0, "%s(%d) tpkt 0x%08x%08x\n"), __FUNCTION__, x_port,
    240                 COMPILER_64_HI(stats->tpkt), COMPILER_64_LO(stats->tpkt)));
    241     LOG_CLI((BSL_META_U(0, "%s(%d) tbyt 0x%08x%08x\n"), __FUNCTION__, x_port,
    242                 COMPILER_64_HI(stats->tbyt), COMPILER_64_LO(stats->tbyt)));
    243 
    244     LOG_CLI((BSL_META_U(0, "%s(%d) rfcs 0x%08x%08x\n"), __FUNCTION__, x_port,
    245                 COMPILER_64_HI(stats->rfcs), COMPILER_64_LO(stats->rfcs)));
    246     LOG_CLI((BSL_META_U(0, "%s(%d) rfrg 0x%08x%08x\n"), __FUNCTION__, x_port,
    247                 COMPILER_64_HI(stats->rfrg), COMPILER_64_LO(stats->rfrg)));
    248     LOG_CLI((BSL_META_U(0, "%s(%d) rjbr 0x%08x%08x\n"), __FUNCTION__, x_port,
    249                 COMPILER_64_HI(stats->rjbr), COMPILER_64_LO(stats->rjbr)));
    250     LOG_CLI((BSL_META_U(0, "%s(%d) rovr 0x%08x%08x\n"), __FUNCTION__, x_port,
    251                 COMPILER_64_HI(stats->rovr), COMPILER_64_LO(stats->rovr)));
    252     LOG_CLI((BSL_META_U(0, "%s(%d) rrpkt 0x%08x%08x\n"), __FUNCTION__, x_port,
    253                 COMPILER_64_HI(stats->rrpkt), COMPILER_64_LO(stats->rrpkt)));
    254     LOG_CLI((BSL_META_U(0, "%s(%d) raln 0x%08x%08x\n"), __FUNCTION__, x_port,
    255                 COMPILER_64_HI(stats->raln), COMPILER_64_LO(stats->raln)));
    256     LOG_CLI((BSL_META_U(0, "%s(%d) rerpkt 0x%08x%08x\n"), __FUNCTION__, x_port,
    257                 COMPILER_64_HI(stats->rerpkt), COMPILER_64_LO(stats->rerpkt)));
    258     LOG_CLI((BSL_META_U(0, "%s(%d) rmtue 0x%08x%08x\n"), __FUNCTION__, x_port,
    259                 COMPILER_64_HI(stats->rmtue), COMPILER_64_LO(stats->rmtue)));
    260     LOG_CLI((BSL_META_U(0, "%s(%d) rprm 0x%08x%08x\n"), __FUNCTION__, x_port,
    261                 COMPILER_64_HI(stats->rprm), COMPILER_64_LO(stats->rprm)));
    262     LOG_CLI((BSL_META_U(0, "%s(%d) rschcrc 0x%08x%08x\n"), __FUNCTION__, x_port,
    263                 COMPILER_64_HI(stats->rschcrc), COMPILER_64_LO(stats->rschcrc)));
    264     LOG_CLI((BSL_META_U(0, "%s(%d) rtrfu 0x%08x%08x\n"), __FUNCTION__, x_port,
    265                 COMPILER_64_HI(stats->rtrfu), COMPILER_64_LO(stats->rtrfu)));
    266     LOG_CLI((BSL_META_U(0, "%s(%d) rfcr 0x%08x%08x\n"), __FUNCTION__, x_port,
    267                 COMPILER_64_HI(stats->rfcr), COMPILER_64_LO(stats->rfcr)));
    268     LOG_CLI((BSL_META_U(0, "%s(%d) rxpf 0x%08x%08x\n"), __FUNCTION__, x_port,
    269                 COMPILER_64_HI(stats->rxpf), COMPILER_64_LO(stats->rxpf)));
    270     LOG_CLI((BSL_META_U(0, "%s(%d) rflr 0x%08x%08x\n"), __FUNCTION__, x_port,
    271                 COMPILER_64_HI(stats->rflr), COMPILER_64_LO(stats->rflr)));
    272 
    273     LOG_CLI((BSL_META_U(0, "%s(%d) tfcs 0x%08x%08x\n"), __FUNCTION__, x_port,
    274                 COMPILER_64_HI(stats->tfcs), COMPILER_64_LO(stats->tfcs)));
    275     LOG_CLI((BSL_META_U(0, "%s(%d) tfrg 0x%08x%08x\n"), __FUNCTION__, x_port,
    276                 COMPILER_64_HI(stats->tfrg), COMPILER_64_LO(stats->tfrg)));
    277     LOG_CLI((BSL_META_U(0, "%s(%d) tjbr 0x%08x%08x\n"), __FUNCTION__, x_port,
    278                 COMPILER_64_HI(stats->tjbr), COMPILER_64_LO(stats->tjbr)));
    279     LOG_CLI((BSL_META_U(0, "%s(%d) tncl 0x%08x%08x\n"), __FUNCTION__, x_port,
    280                 COMPILER_64_HI(stats->tncl), COMPILER_64_LO(stats->tncl)));
    281     LOG_CLI((BSL_META_U(0, "%s(%d) tovr 0x%08x%08x\n"), __FUNCTION__, x_port,
    282                 COMPILER_64_HI(stats->tovr), COMPILER_64_LO(stats->tovr)));
    283     LOG_CLI((BSL_META_U(0, "%s(%d) trpkt 0x%08x%08x\n"), __FUNCTION__, x_port,
    284                 COMPILER_64_HI(stats->trpkt), COMPILER_64_LO(stats->trpkt)));
    285     LOG_CLI((BSL_META_U(0, "%s(%d) txpf 0x%08x%08x\n"), __FUNCTION__, x_port,
    286                 COMPILER_64_HI(stats->txpf), COMPILER_64_LO(stats->txpf)));
    287 
    288     return rv;
    289 #else
    290     return PHYMOD_E_NONE;
    291 #endif
    292 }
    293 
    294 int pe_xmod_pe_pcid_set(int unit, int port, xmod_pe_pcid_t *pcids)
    295 {
    296 #ifdef INCLUDE_PHY_8806X
    297     xmod_pe_pcid_t x_pcids;
    298     uint32_t xmodtxbuff[XMOD_BUFFER_MAX_LEN/4];
    299     uint8_t *buftxptr;
    300     int xmodtxlen, rv;
    301 
    302     LOG_CLI((BSL_META_U(0, "%s() enter; unit %d; port %d\n"), __FUNCTION__, unit, port));
    303 
    304     /* setting up xmod xmod_pe_pcid_set: */
    305     /* int xmod_pe_pcid_set(IN xmod_pe_pcid_t pcid)   */
    306 
    307     LOG_CLI((BSL_META_U(0, "%s() pcid0 %d\n"), __FUNCTION__, pcids->pcid0));
    308     LOG_CLI((BSL_META_U(0, "%s() pcid1 %d\n"), __FUNCTION__, pcids->pcid1));
    309     LOG_CLI((BSL_META_U(0, "%s() pcid2 %d\n"), __FUNCTION__, pcids->pcid2));
    310     LOG_CLI((BSL_META_U(0, "%s() pcid3 %d\n"), __FUNCTION__, pcids->pcid3));
    311     x_pcids.pcid0 = swap_uint16(pcids->pcid0);
    312     x_pcids.pcid1 = swap_uint16(pcids->pcid1);
    313     x_pcids.pcid2 = swap_uint16(pcids->pcid2);
    314     x_pcids.pcid3 = swap_uint16(pcids->pcid3);
    315 
    316     /* write args to xmod buffer */
    317     buftxptr = (uint8_t *)xmodtxbuff;
    318     WRITE_XMOD_ARG_BUFF(buftxptr, &x_pcids, sizeof(xmod_pe_pcid_t));
    319     xmodtxlen = GET_XMOD_ETHERNET_CMD_IN_LEN(XMOD_PE_PCID_SET);
    320     xmodtxlen = GET_XMOD_BUF_WORD_LEN(xmodtxlen);
    321 
    322     /* call xmod */
    323     rv = phy_8806x_xmod_command(unit, port, 
    324                                 XMOD_CMD_MODE_ETH(XMOD_PE_PCID_SET),
    325                                 xmodtxbuff, xmodtxlen, NULL, 0);
    326     if (SOC_FAILURE(rv)) {
    327         LOG_CLI((BSL_META_U(0, "%s() phy_8806x_xmod_command() error %d\n"), __FUNCTION__, rv));
    328         return SOC_E_FAIL;
    329     }
    330 
    331     return rv;
    332 #else
    333     return PHYMOD_E_NONE;
    334 #endif
    335 }
    336 
    337 int pe_xmod_pe_fw_ver_get(int unit, int port, xmod_pe_fw_ver_t *ver)
    338 {
    339 #ifdef INCLUDE_PHY_8806X
    340     xmod_pe_fw_ver_t x_ver;
    341     uint32_t xmodrxbuff[XMOD_BUFFER_MAX_LEN/4];
    342     uint8_t *bufrxptr;
    343     int xmodrxlen, rv;
    344 
    345     LOG_CLI((BSL_META_U(0, "%s() enter; unit %d; port %d\n"), __FUNCTION__, unit, port));
    346 
    347     /* setting up xmod xmod_pe_fw_ver_get:      */
    348     /* int xmod_pe_fw_ver_get(OUT xmod_pe_fw_ver_t fw_ver) */
    349 
    350     /* setup out args */
    351     xmodrxlen = GET_XMOD_ETHERNET_CMD_OUT_LEN(XMOD_PE_FW_VER_GET);
    352     xmodrxlen = GET_XMOD_BUF_WORD_LEN(xmodrxlen);
    353 
    354     /* call xmod */
    355     rv = phy_8806x_xmod_command(unit, port,
    356                                 XMOD_CMD_MODE_ETH(XMOD_PE_FW_VER_GET),
    357                                 NULL, 0, xmodrxbuff, xmodrxlen);
    358     if (SOC_FAILURE(rv)) {
    359         LOG_CLI((BSL_META_U(0, "%s() phy_8806x_xmod_command() error %d\n"), __FUNCTION__, rv));
    360         return SOC_E_FAIL;
    361     }
    362 
    363     /* retrieve the argument from the xmod rx buffer */
    364     bufrxptr = (uint8_t *)xmodrxbuff;
    365     READ_XMOD_ARG_BUFF(bufrxptr, &x_ver, sizeof(xmod_pe_fw_ver_t));
    366     ver->major = swap_uint16(x_ver.major);
    367     ver->minor = swap_uint16(x_ver.minor);
    368     ver->build = swap_uint16(x_ver.build);
    369 
    370     LOG_CLI((BSL_META_U(0, "%s() major %d\n"), __FUNCTION__, ver->major));
    371     LOG_CLI((BSL_META_U(0, "%s() minor %d\n"), __FUNCTION__, ver->minor));
    372     LOG_CLI((BSL_META_U(0, "%s() build %d\n"), __FUNCTION__, ver->build));
    373 
    374     return rv;
    375 #else
    376     return PHYMOD_E_NONE;
    377 #endif
    378 }
    379 
    380 int pe_xmod_pe_test(int unit, int port)
    381 {
    382     xmod_pe_config_t    config;
    383     xmod_pe_status_t    status;
    384     xmod_pe_port_stats_t stats;
    385     xmod_pe_pcid_t      pcids;
    386     xmod_pe_fw_ver_t    ver;
    387     int                 pe_port;
    388     int                 rc;
    389 
    390     config.mode = XMOD_PE_MODE_4_PORTS;
    391     config.tag = XMOD_PE_TAG_BR;
    392     config.pfc = 1;
    393     config.res = 0;
    394     config.pcid[0] = 1;
    395     config.pcid[1] = 2;
    396     config.pcid[2] = 3;
    397     config.pcid[3] = 4;
    398     LOG_CLI((BSL_META_U(0, "%s() unit %d port %d\n"), __FUNCTION__, unit, port));
    399     LOG_CLI((BSL_META_U(0, "%s() calling pe_xmod_pe_init()\n"), __FUNCTION__));
    400     rc = pe_xmod_pe_init(unit, port, &config);
    401     if (SOC_FAILURE(rc)) {
    402         LOG_CLI((BSL_META_U(0, "%s() pe_xmod_pe_init() error %d\n"), __FUNCTION__, rc));
    403     }
    404         
    405     LOG_CLI((BSL_META_U(0, "%s() calling pe_xmod_pe_status_get()\n"), __FUNCTION__));
    406     rc = pe_xmod_pe_status_get(unit, port, &status);
    407     if (SOC_FAILURE(rc)) {
    408         LOG_CLI((BSL_META_U(0, "%s() pe_xmod_pe_status_get() error %d\n"), __FUNCTION__, rc));
    409     }
    410 
    411     for (pe_port=0; pe_port<=4; pe_port++) {
    412         LOG_CLI((BSL_META_U(0, "%s() calling pe_xmod_pe_port_stats_get()\n"), __FUNCTION__));
    413         rc = pe_xmod_pe_port_stats_get(unit, port, pe_port, &stats, 0);
    414         if (SOC_FAILURE(rc)) {
    415             LOG_CLI((BSL_META_U(0, "%s() pe_xmod_pe_status_get() error %d\n"), __FUNCTION__, rc));
    416         }
    417     }
    418 
    419     pcids.pcid0 = 0x0123;
    420     pcids.pcid1 = 0x4567;
    421     pcids.pcid2 = 0x89ab;
    422     pcids.pcid3 = 0xcdef;
    423     LOG_CLI((BSL_META_U(0, "%s() calling pe_xmod_pe_pcid_set()\n"), __FUNCTION__));
    424     rc = pe_xmod_pe_pcid_set(unit, port, &pcids);
    425     if (SOC_FAILURE(rc)) {
    426         LOG_CLI((BSL_META_U(0, "%s() pe_xmod_pe_pcid_set() error %d\n"), __FUNCTION__, rc));
    427     }
    428 
    429     LOG_CLI((BSL_META_U(0, "%s() calling pe_xmod_pe_fw_ver_get()\n"), __FUNCTION__));
    430     rc = pe_xmod_pe_fw_ver_get(unit, port, &ver);
    431     if (SOC_FAILURE(rc)) {
    432         LOG_CLI((BSL_META_U(0, "%s() pe_xmod_pe_fw_ver_get() error %d\n"), __FUNCTION__, rc));
    433     }
    434 
    435     return PHYMOD_E_NONE;
    436 }
    437 
    438 #endif /* PHYMOD_PHY8806X_SUPPORT */