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

shbde_mdio.h (1175B)


      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 
      8 #ifndef __SHBDE_MDIO_H__
      9 #define __SHBDE_MDIO_H__
     10 
     11 #include <shbde.h>
     12 
     13 typedef struct shbde_mdio_ctrl_s {
     14 
     15     /* Primary HAL*/
     16     shbde_hal_t *shbde;
     17 
     18     /* Context for iProc MDIO register access */
     19     void *regs;
     20 
     21     /* Base address for MDIO registers */
     22     unsigned int base_addr;
     23 
     24     /* iProc MDIO register access */
     25     unsigned int (*io32_read)(shbde_hal_t *shbde, void *iproc_regs, 
     26                               unsigned int addr);
     27     void (*io32_write)(shbde_hal_t *shbde, void *iproc_regs, 
     28                        unsigned int addr, unsigned int data);
     29 
     30 } shbde_mdio_ctrl_t;
     31 
     32 
     33 extern int
     34 shbde_iproc_mdio_init(shbde_mdio_ctrl_t *smc);
     35 
     36 extern int
     37 shbde_iproc_mdio_read(shbde_mdio_ctrl_t *smc, unsigned int phy_addr,
     38                       unsigned int reg, unsigned int *val);
     39 
     40 extern int
     41 shbde_iproc_mdio_write(shbde_mdio_ctrl_t *smc, unsigned int phy_addr,
     42                        unsigned int reg, unsigned int val);
     43 
     44 #endif /* __SHBDE_MDIO_H__ */