59#define AMBAPP_FLAG_FFACT_DIR 0x100
60#define AMBAPP_FLAG_FFACT 0x0f0
61#define AMBAPP_FLAG_MBUS 0x00c
62#define AMBAPP_FLAG_SBUS 0x003
65#define DEV_TO_APB(adev) ((struct ambapp_apb_info *)((adev)->devinfo))
66#define DEV_TO_AHB(adev) ((struct ambapp_ahb_info *)((adev)->devinfo))
67#define DEV_TO_COMMON(adev) (((adev)->devinfo))
87 unsigned int start[4];
91 unsigned int custom[3];
100 unsigned char dev_type;
101 unsigned char vendor;
102 unsigned short device;
111 unsigned char vendor;
112 unsigned short device;
121 unsigned int freq_hz;
128 unsigned int local_adr;
129 unsigned int remote_adr;
144typedef int (*ambapp_func_t)(
struct ambapp_dev *dev,
int index,
void *arg);
146#define DEV_IS_FREE(dev) (dev->owner == NULL)
147#define DEV_IS_ALLOCATED(dev) (dev->owner != NULL)
150#define OPTIONS_AHB_MSTS 0x00000001
151#define OPTIONS_AHB_SLVS 0x00000002
152#define OPTIONS_APB_SLVS 0x00000004
153#define OPTIONS_ALL_DEVS (OPTIONS_AHB_MSTS|OPTIONS_AHB_SLVS|OPTIONS_APB_SLVS)
155#define OPTIONS_FREE 0x00000010
156#define OPTIONS_ALLOCATED 0x00000020
157#define OPTIONS_ALL (OPTIONS_FREE|OPTIONS_ALLOCATED)
160#define OPTIONS_DEPTH_FIRST 0x00000100
162#define DEV_AHB_NONE 0
169 const unsigned int id;
170 const unsigned int custom[3];
171 const unsigned int mbar[4];
175 const unsigned int id;
176 const unsigned int iobar;
179#define ambapp_pnp_vendor(id) (((id) >> 24) & 0xff)
180#define ambapp_pnp_device(id) (((id) >> 12) & 0xfff)
181#define ambapp_pnp_ver(id) (((id)>>5) & 0x1f)
182#define ambapp_pnp_irq(id) ((id) & 0x1f)
184#define ambapp_pnp_start(mbar) (((mbar) & 0xfff00000) & (((mbar) & 0xfff0) << 16))
185#define ambapp_pnp_mbar_mask(mbar) (((mbar)>>4) & 0xfff)
186#define ambapp_pnp_mbar_type(mbar) ((mbar) & 0xf)
188#define ambapp_pnp_apb_start(iobar, base) ((base) | ((((iobar) & 0xfff00000)>>12) & (((iobar) & 0xfff0)<<4)) )
189#define ambapp_pnp_apb_mask(iobar) ((~(ambapp_pnp_mbar_mask(iobar)<<8) & 0x000fffff) + 1)
191#define AMBA_TYPE_AHBIO_ADDR(addr,base_ioarea) ((unsigned int)(base_ioarea) | ((addr) >> 12))
193#define AMBA_TYPE_APBIO 0x1
194#define AMBA_TYPE_MEM 0x2
195#define AMBA_TYPE_AHBIO 0x3
198typedef void *(*ambapp_memcpy_t)(
206 ambapp_memcpy_t copy_from_device;
207 void *(*alloc)(size_t);
228extern int ambapp_scan(
238extern void ambapp_freq_init(
244extern unsigned int ambapp_freq_get(
274extern int ambapp_for_each(
276 unsigned int options,
291extern int ambapp_find_by_idx(
struct ambapp_dev *dev,
int index,
void *pcount);
296extern int ambapp_dev_count(
struct ambapp_bus *abus,
unsigned int options,
297 int vendor,
int device);
300extern void ambapp_print(
struct ambapp_bus *abus,
int show_depth);
305extern int ambapp_alloc_dev(
struct ambapp_dev *dev,
void *owner);
308extern void ambapp_free_dev(
struct ambapp_dev *dev);
314extern int ambapp_depth(
struct ambapp_dev *dev);
317extern char *ambapp_device_id2str(
int vendor,
int id);
320extern char *ambapp_vendor_id2str(
int vendor);
325extern int ambapp_vendev_id2str(
int vendor,
int id,
char *buf);
329extern int ambapp_find_apbslv(
335extern int ambapp_find_apbslv_next(
342extern int ambapp_find_apbslvs_next(
350extern int ambapp_find_apbslvs(
357extern int ambapp_find_ahbslv(
363extern int ambapp_find_ahbslv_next(
370extern int ambapp_find_ahbslvs_next(
378extern int ambapp_find_ahbslvs(
386extern int ambapp_get_number_ahbslv_devices(
391extern int ambapp_get_number_apbslv_devices(
AMBA Plug & Play Bus Vendor and Device IDs.
struct ambapp_bus * ambapp_plb(void)
Gets the fully scanned AMBA Plug & Play Processor Local Bus (PLB).
Definition: bspstart.c:58