Download RCC-1.2.18 drivers Manual

Transcript
GR-RTEMS-DRIVER
16
/* Iterates through all AMBA devices previously found, it calls func
* once for every device that match the search arguments.
*
* SEARCH OPTIONS
* All search options must be fulfilled, type of devices searched (options)
* and AMBA Plug&Play ID [VENDOR,DEVICE], before func() is called. The options
* can be use to search only for AMBA APB or AHB Slaves or AHB Masters for
* example. Note that when VENDOR=-1 or DEVICE=-1 it will match any vendor or
* device ID, this means setting both VENDOR and DEVICE to -1 will result in
* calling all devices matches the options argument.
*
* \param abus
AMBAPP Bus to search
* \param options Search options, see OPTIONS_* above
* \param vendor
AMBAPP VENDOR ID to search for
* \param device
AMBAPP DEVICE ID to search for
* \param func
Function called for every device matching search options
* \param arg
Optional argument passed on to func
*
* func return value affects the search, returning a non-zero value will
* stop the search and ambapp_for_each will return immediately returning the
* same non-zero value.
*
* Return Values
* 0 - all devices was scanned
* non-zero - stopped by user function returning the non-zero value
*/
int ambapp_for_each(
struct ambapp_bus *abus,
unsigned int options,
int vendor,
int device,
ambapp_func_t func,
void *arg);
2.5
ALLOCATING A DEVICE
A device can be marked allocated so that other parts of the code knows that the device has been
taken, this feature is not used by the LEON BSPs. The ambapp_dev.owner field is set to a nonzero value to mark that the device is allocated, use ambapp_alloc_dev() and ambapp_free_dev() to
set allocation mark.
2.6
NAME DATABASE
In ambapp_names.c AMBA Plug&Play vendor and device names are stored in a name database.
The names are taken from device.vhd in GRLIB distribution. Names can be requested by calling
appropriate function listed below.