sbutils.h
资源名称:bcm4702.rar [点击查看]
上传用户:yuanda199
上传日期:2022-06-26
资源大小:412k
文件大小:3k
源码类别:
VxWorks
开发平台:
C/C++
- /*
- * Misc utility routines for accessing chip-specific features
- * of Broadcom HNBU SiliconBackplane-based chips.
- *
- * Copyright(c) 2001 Broadcom Corporation
- * $Id: sbutils.h,v 1.1 Broadcom SDK $
- */
- #ifndef _sbutils_h_
- #define _sbutils_h_
- /* Bus types */
- #define SB_BUS 0 /* Silicon Backplane */
- #define PCI_BUS 1 /* PCI target */
- #define PCMCIA_BUS 2 /* PCMCIA target */
- /* Board types (form factor) */
- #define BOARDTYPE_SOC 0 /* Silicon Backplane */
- #define BOARDTYPE_PCI 1 /* PCI/MiniPCI board */
- #define BOARDTYPE_PCMCIA 2 /* PCMCIA board */
- #define BOARDTYPE_CARDBUS 3 /* Cardbus board */
- /*
- * Many of the routines below take an 'sbh' handle as their first arg.
- * Allocate this by calling sb_attach(). Free it by calling sb_detach().
- * At any one time, the sbh is logically focused on one particular sb core
- * (the "current core").
- * Use sb_setcore() or sb_setcoreidx() to change the association to another core.
- */
- extern int gSPIEnable;
- /* exported externs */
- extern void *sb_attach(uint pcidev, void *osh, void *regs, char **vars, int *varsz);
- extern void *sb_kattach(uint chip, uint chiprev);
- extern void sb_detach(void *sbh);
- extern uint sb_chip(void *sbh);
- extern uint sb_chiprev(void *sbh);
- extern uint16 sb_boardvendor(void *sbh);
- extern uint16 sb_board(void *sbh);
- extern uint sb_boardtype(void *sbh);
- extern uint sb_bus(void *sbh);
- extern uint sb_corelist(void *sbh, uint coreid[]);
- extern uint sb_coreid(void *sbh);
- extern uint sb_coreidx(void *sbh);
- extern uint sb_coreunit(void *sbh);
- extern uint sb_corevendor(void *sbh);
- extern uint sb_corerev(void *sbh);
- extern uint32 sb_coreflags(void *sbh, uint32 mask, uint32 val);
- extern bool sb_iscoreup(void *sbh);
- extern void *sb_setcoreidx(void *sbh, uint coreidx);
- extern void *sb_setcore(void *sbh, uint coreid, uint coreunit);
- extern void sb_commit(void *sbh);
- extern uint32 sb_base(uint32 admatch);
- extern uint32 sb_size(uint32 admatch);
- extern void sb_core_reset(void *sbh, uint32 bits);
- extern void sb_core_tofixup(void *sbh);
- extern void sb_core_disable(void *sbh, uint32 bits);
- extern uint32 sb_clock_rate(uint32 n, uint32 m);
- extern uint32 sb_clock(void *sbh);
- extern bool sb_setclock(void *sbh, uint32 sb, uint32 pci);
- extern void sb_pci_setup(void *sbh, uint32 *dmaoffset, uint coremask);
- extern void sb_pcmcia_init(void *sbh);
- extern void sb_chip_reset(void *sbh);
- extern void *sb_gpiosetcore(void *sbh);
- extern uint32 sb_gpiocontrol(void *sbh, uint32 mask, uint32 val);
- extern uint32 sb_gpioouten(void *sbh, uint32 mask, uint32 val);
- extern uint32 sb_gpioout(void *sbh, uint32 mask, uint32 val);
- extern uint32 sb_gpioin(void *sbh);
- extern void sb_dump(void *sbh, char *buf);
- extern bool sb_taclear(void *sbh);
- /* nvram related */
- extern char *getvar(char *vars, char *name);
- extern int getintvar(char *vars, char *name);
- extern int sromread(void *sbh, uint byteoff, uint nbytes, uint16 *buf);
- extern int sromwrite(void *sbh, uint byteoff, uint nbytes, uint16 *buf);
- extern int parsecis(uint8 *cis, char **vars, int *count);
- extern void robo_mdio_reset(void);
- #endif /* _sbutils_h_ */