49 unsigned char dev_type;
55 #define AMBAPP_FLAG_FFACT_DIR 0x100 56 #define AMBAPP_FLAG_FFACT 0x0f0 57 #define AMBAPP_FLAG_MBUS 0x00c 58 #define AMBAPP_FLAG_SBUS 0x003 61 #define DEV_TO_APB(adev) ((struct ambapp_apb_info *)((adev)->devinfo)) 62 #define DEV_TO_AHB(adev) ((struct ambapp_ahb_info *)((adev)->devinfo)) 63 #define DEV_TO_COMMON(adev) ((struct ambapp_common_info *)((adev)->devinfo)) 65 #define APB_TO_DEV(apb_info) ((struct ambapp_dev *)(unsigned int(apb_info) - \ 66 offsetof(struct ambapp_dev, devinfo))) 67 #define AHB_TO_DEV(ahb_info) ((struct ambapp_dev *)(unsigned int(ahb_info) - \ 68 offsetof(struct ambapp_dev, devinfo))) 94 unsigned int start[4];
98 unsigned int custom[3];
104 unsigned char vendor;
114 unsigned int freq_hz;
121 unsigned int local_adr;
122 unsigned int remote_adr;
137 typedef int (*ambapp_func_t)(
struct ambapp_dev *dev,
int index,
void *arg);
139 #define DEV_IS_FREE(dev) (dev->owner == NULL) 140 #define DEV_IS_ALLOCATED(dev) (dev->owner != NULL) 143 #define OPTIONS_AHB_MSTS 0x00000001 144 #define OPTIONS_AHB_SLVS 0x00000002 145 #define OPTIONS_APB_SLVS 0x00000004 146 #define OPTIONS_ALL_DEVS (OPTIONS_AHB_MSTS|OPTIONS_AHB_SLVS|OPTIONS_APB_SLVS) 148 #define OPTIONS_FREE 0x00000010 149 #define OPTIONS_ALLOCATED 0x00000020 150 #define OPTIONS_ALL (OPTIONS_FREE|OPTIONS_ALLOCATED) 153 #define OPTIONS_DEPTH_FIRST 0x00000100 155 #define DEV_AHB_NONE 0 156 #define DEV_AHB_MST 1 157 #define DEV_AHB_SLV 2 158 #define DEV_APB_SLV 3 162 const unsigned int id;
163 const unsigned int custom[3];
164 const unsigned int mbar[4];
168 const unsigned int id;
169 const unsigned int iobar;
172 #define ambapp_pnp_vendor(id) (((id) >> 24) & 0xff) 173 #define ambapp_pnp_device(id) (((id) >> 12) & 0xfff) 174 #define ambapp_pnp_ver(id) (((id)>>5) & 0x1f) 175 #define ambapp_pnp_irq(id) ((id) & 0x1f) 177 #define ambapp_pnp_start(mbar) (((mbar) & 0xfff00000) & (((mbar) & 0xfff0) << 16)) 178 #define ambapp_pnp_mbar_mask(mbar) (((mbar)>>4) & 0xfff) 179 #define ambapp_pnp_mbar_type(mbar) ((mbar) & 0xf) 181 #define ambapp_pnp_apb_start(iobar, base) ((base) | ((((iobar) & 0xfff00000)>>12) & (((iobar) & 0xfff0)<<4)) ) 182 #define ambapp_pnp_apb_mask(iobar) ((~(ambapp_pnp_mbar_mask(iobar)<<8) & 0x000fffff) + 1) 184 #define AMBA_TYPE_AHBIO_ADDR(addr,base_ioarea) ((unsigned int)(base_ioarea) | ((addr) >> 12)) 186 #define AMBA_TYPE_APBIO 0x1 187 #define AMBA_TYPE_MEM 0x2 188 #define AMBA_TYPE_AHBIO 0x3 191 typedef void *(*ambapp_memcpy_t)(
211 extern int ambapp_scan(
214 ambapp_memcpy_t memfunc,
221 extern void ambapp_freq_init(
227 extern unsigned int ambapp_freq_get(
257 extern int ambapp_for_each(
259 unsigned int options,
274 extern int ambapp_find_by_idx(
struct ambapp_dev *dev,
int index,
void *pcount);
279 extern int ambapp_dev_count(
struct ambapp_bus *abus,
unsigned int options,
280 int vendor,
int device);
283 extern void ambapp_print(
struct ambapp_bus *abus,
int show_depth);
288 extern int ambapp_alloc_dev(
struct ambapp_dev *dev,
void *owner);
291 extern void ambapp_free_dev(
struct ambapp_dev *dev);
297 extern int ambapp_depth(
struct ambapp_dev *dev);
300 extern char *ambapp_device_id2str(
int vendor,
int id);
303 extern char *ambapp_vendor_id2str(
int vendor);
308 extern int ambapp_vendev_id2str(
int vendor,
int id,
char *buf);
312 extern int ambapp_find_apbslv(
318 extern int ambapp_find_apbslv_next(
325 extern int ambapp_find_apbslvs_next(
333 extern int ambapp_find_apbslvs(
340 extern int ambapp_find_ahbslv(
346 extern int ambapp_find_ahbslv_next(
353 extern int ambapp_find_ahbslvs_next(
361 extern int ambapp_find_ahbslvs(
369 extern int ambapp_get_number_ahbslv_devices(
374 extern int ambapp_get_number_apbslv_devices(
Definition: rtemscompat1.h:15
unsigned size
Definition: tte.h:74
AMBA Plug & Play Bus Vendor and Device IDs.