43 #ifndef _DISCOVERY_DEV_GTVAR_H_ 44 #define _DISCOVERY_DEV_GTVAR_H_ 46 #include <sys/systm.h> 51 bus_dma_tag_t gt_dmat;
52 bus_space_tag_t gt_memt;
53 bus_space_tag_t gt_pci0_memt;
54 bus_space_tag_t gt_pci0_iot;
55 boolean_t gt_pci0_host;
56 bus_space_tag_t gt_pci1_memt;
57 bus_space_tag_t gt_pci1_iot;
58 boolean_t gt_pci1_host;
60 bus_space_handle_t gt_memh;
67 #define GT_CHILDOK(gt, ga, cd, pos, max) \ 68 (((ga)->ga_unit) < (max) && \ 69 !((gt)->gt_childmask & (1 << (((ga)->ga_unit) + (pos)))) && \ 70 !strcmp((ga)->ga_name, (cd)->cd_name)) 72 #define GT_MPSCOK(gt, ga, cd) GT_CHILDOK((gt), (ga), (cd), 0, 2) 73 #define GT_PCIOK(gt, ga, cd) GT_CHILDOK((gt), (ga), (cd), 2, 2) 74 #define GT_ETHEROK(gt, ga, cd) GT_CHILDOK((gt), (ga), (cd), 4, 3) 75 #define GT_OBIOOK(gt, ga, cd) GT_CHILDOK((gt), (ga), (cd), 7, 5) 76 #define GT_I2COK(gt, ga, cd) GT_CHILDOK((gt), (ga), (cd), 12, 1) 78 #define GT_CHILDFOUND(gt, ga, pos) \ 79 ((void)(((gt)->gt_childmask |= (1 << (((ga)->ga_unit) + (pos)))))) 81 #define GT_MPSCFOUND(gt, ga) GT_CHILDFOUND((gt), (ga), 0) 82 #define GT_PCIFOUND(gt, ga) GT_CHILDFOUND((gt), (ga), 2) 83 #define GT_ETHERFOUND(gt, ga) GT_CHILDFOUND((gt), (ga), 4) 84 #define GT_OBIOFOUND(gt, ga) GT_CHILDFOUND((gt), (ga), 7) 85 #define GT_I2CFOUND(gt, ga) GT_CHILDFOUND((gt), (ga), 12) 90 bus_dma_tag_t ga_dmat;
91 bus_space_tag_t ga_memt;
92 bus_space_handle_t ga_memh;
98 bus_space_tag_t oa_memt;
107 #include "locators.h" 111 extern int gtpci_debug;
117 #define GT_UNK_UNIT GTCF_UNIT_DEFAULT 119 #define OBIO_UNK_OFFSET OBIOCF_OFFSET_DEFAULT 121 #define OBIO_UNK_SIZE OBIOCF_SIZE_DEFAULT 123 #define OBIO_UNK_IRQ OBIOCF_IRQ_DEFAULT 125 void gt_attach_common(
struct gt_softc *);
126 uint32_t gt_read_mpp(
void);
127 int gt_cfprint(
void *,
const char *);
131 int gt_mii_read(
struct device *,
struct device *,
int,
int);
132 void gt_mii_write(
struct device *,
struct device *,
int,
int,
int);
133 int gtget_macaddr(
struct gt_softc *,
int,
char *);
135 void gt_watchdog_service(
void);
136 bus_addr_t gt_dma_phys_to_bus_mem(bus_dma_tag_t, bus_addr_t);
137 bus_addr_t gt_dma_bus_mem_to_phys(bus_dma_tag_t, bus_addr_t);
139 #define gt_read(gt,o) \ 140 bus_space_read_4((gt)->gt_memt, (gt)->gt_memh, (o)) 141 #define gt_write(gt,o,v) \ 142 bus_space_write_4((gt)->gt_memt, (gt)->gt_memh, (o), (v)) 146 #if defined(__powerpc__) 147 static __inline
volatile int 148 atomic_add(
volatile int *
p,
int v)
159 :
"=&r"(rv),
"=&r"(rtmp),
"=m"(*
p)
160 :
"r"(
p),
"r"(
v),
"m"(*
p)
unsigned p
Definition: tte.h:90
Definition: rtemscompat1.h:15
unsigned v
Definition: tte.h:73