61#define AMBAPP_FLAG_FFACT_DIR 0x100
62#define AMBAPP_FLAG_FFACT 0x0f0
63#define AMBAPP_FLAG_MBUS 0x00c
64#define AMBAPP_FLAG_SBUS 0x003
67#define DEV_TO_APB(adev) ((struct ambapp_apb_info *)((adev)->devinfo))
68#define DEV_TO_AHB(adev) ((struct ambapp_ahb_info *)((adev)->devinfo))
69#define DEV_TO_COMMON(adev) (((adev)->devinfo))
89 unsigned int start[4];
93 unsigned int custom[3];
102 unsigned char dev_type;
103 unsigned char vendor;
104 unsigned short device;
113 unsigned char vendor;
114 unsigned short device;
123 unsigned int freq_hz;
130 unsigned int local_adr;
131 unsigned int remote_adr;
146typedef int (*ambapp_func_t)(
struct ambapp_dev *dev,
int index,
void *arg);
148#define DEV_IS_FREE(dev) (dev->owner == NULL)
149#define DEV_IS_ALLOCATED(dev) (dev->owner != NULL)
152#define OPTIONS_AHB_MSTS 0x00000001
153#define OPTIONS_AHB_SLVS 0x00000002
154#define OPTIONS_APB_SLVS 0x00000004
155#define OPTIONS_ALL_DEVS (OPTIONS_AHB_MSTS|OPTIONS_AHB_SLVS|OPTIONS_APB_SLVS)
157#define OPTIONS_FREE 0x00000010
158#define OPTIONS_ALLOCATED 0x00000020
159#define OPTIONS_ALL (OPTIONS_FREE|OPTIONS_ALLOCATED)
162#define OPTIONS_DEPTH_FIRST 0x00000100
164#define DEV_AHB_NONE 0
171 const unsigned int id;
172 const unsigned int custom[3];
173 const unsigned int mbar[4];
177 const unsigned int id;
178 const unsigned int iobar;
181#define ambapp_pnp_vendor(id) (((id) >> 24) & 0xff)
182#define ambapp_pnp_device(id) (((id) >> 12) & 0xfff)
183#define ambapp_pnp_ver(id) (((id)>>5) & 0x1f)
184#define ambapp_pnp_irq(id) ((id) & 0x1f)
186#define ambapp_pnp_start(mbar) (((mbar) & 0xfff00000) & (((mbar) & 0xfff0) << 16))
187#define ambapp_pnp_mbar_mask(mbar) (((mbar)>>4) & 0xfff)
188#define ambapp_pnp_mbar_type(mbar) ((mbar) & 0xf)
190#define ambapp_pnp_apb_start(iobar, base) ((base) | ((((iobar) & 0xfff00000)>>12) & (((iobar) & 0xfff0)<<4)) )
191#define ambapp_pnp_apb_mask(iobar) ((~(ambapp_pnp_mbar_mask(iobar)<<8) & 0x000fffff) + 1)
193#define AMBA_TYPE_AHBIO_ADDR(addr,base_ioarea) ((unsigned int)(base_ioarea) | ((addr) >> 12))
195#define AMBA_TYPE_APBIO 0x1
196#define AMBA_TYPE_MEM 0x2
197#define AMBA_TYPE_AHBIO 0x3
200typedef void *(*ambapp_memcpy_t)(
208 ambapp_memcpy_t copy_from_device;
209 void *(*alloc)(size_t);
230extern int ambapp_scan(
240extern void ambapp_freq_init(
246extern unsigned int ambapp_freq_get(
276extern int ambapp_for_each(
278 unsigned int options,
293extern int ambapp_find_by_idx(
struct ambapp_dev *dev,
int index,
void *pcount);
298extern int ambapp_dev_count(
struct ambapp_bus *abus,
unsigned int options,
299 int vendor,
int device);
302extern void ambapp_print(
struct ambapp_bus *abus,
int show_depth);
307extern int ambapp_alloc_dev(
struct ambapp_dev *dev,
void *owner);
310extern void ambapp_free_dev(
struct ambapp_dev *dev);
316extern int ambapp_depth(
struct ambapp_dev *dev);
319extern char *ambapp_device_id2str(
unsigned int vendor,
int id);
322extern char *ambapp_vendor_id2str(
unsigned int vendor);
327extern int ambapp_vendev_id2str(
unsigned int vendor,
int id,
char *buf);
331extern int ambapp_find_apbslv(
337extern int ambapp_find_apbslv_next(
344extern int ambapp_find_apbslvs_next(
352extern int ambapp_find_apbslvs(
359extern int ambapp_find_ahbslv(
365extern int ambapp_find_ahbslv_next(
372extern int ambapp_find_ahbslvs_next(
380extern int ambapp_find_ahbslvs(
388extern int ambapp_get_number_ahbslv_devices(
393extern int ambapp_get_number_apbslv_devices(
AMBA Plug & Play Bus Vendor and Device IDs.
This header file provides basic definitions used by the API and the implementation.
#define RTEMS_ZERO_LENGTH_ARRAY
This constant represents the element count of a zero-length array.
Definition: basedefs.h:1057
struct ambapp_bus * ambapp_plb(void)
Gets the fully scanned AMBA Plug & Play Processor Local Bus (PLB).
Definition: bspstart.c:58