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.h (1820B)


      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_H__
      9 #define __SHBDE_H__
     10 
     11 typedef void (*shbde_log_func_t)(int level, const char *str, int param);
     12 
     13 #define SHBDE_ERR       0
     14 #define SHBDE_WARN      1
     15 #define SHBDE_DBG       2
     16 
     17 /* iProc configuration (primarily used for PCI-AXI bridge) */
     18 typedef struct shbde_iproc_config_s {
     19     unsigned int dev_id;
     20     unsigned int dev_rev;
     21     unsigned int use_msi;
     22     unsigned int iproc_ver;
     23     unsigned int cmic_ver;
     24     unsigned int cmic_rev;
     25     unsigned int dma_hi_bits;
     26     unsigned int mdio_base_addr;
     27     unsigned int pcie_phy_addr;
     28     unsigned int adjust_pcie_preemphasis;
     29 } shbde_iproc_config_t;
     30 
     31 /* Hardware abstraction functions */
     32 typedef struct shbde_hal_s {
     33 
     34     /* Optional log output interface */
     35     shbde_log_func_t log_func;
     36 
     37     /* PCI configuration access */
     38     unsigned char (*pcic8_read)(void *pci_dev, unsigned int reg);
     39     void (*pcic8_write)(void *pci_dev, unsigned int reg, unsigned char data);
     40     unsigned short (*pcic16_read)(void *pci_dev, unsigned int reg);
     41     void (*pcic16_write)(void *pci_dev, unsigned int reg, unsigned short data);
     42     unsigned int (*pcic32_read)(void *pci_dev, unsigned int reg);
     43     void (*pcic32_write)(void *pci_dev, unsigned int reg, unsigned int data);
     44 
     45     /* iProc register access */
     46     unsigned int (*io32_read)(void *addr);
     47     void (*io32_write)(void *addr, unsigned int);
     48 
     49     /* usleep function (optional) */
     50     void (*usleep)(int usec);
     51 
     52     /* PCI parent device access */
     53     void *(*pci_parent_device_get)(void *pci_dev);
     54 
     55     /* iProc configuration */
     56     shbde_iproc_config_t icfg;
     57 
     58 } shbde_hal_t;
     59 
     60 
     61 #endif /* __SHBDE_H__ */