Home Category Blog VxBus Initialisation
VxBus Initialisation

To get the best from VxBus, it's worth knowing about how the driver model fits into VxWorks, and how VxWorks initialises it. This article aims to shed light on the initialisation VxBus that will allow developers to understand it better.

Driver Particulars

Structures

Every VxBus driver contains multiple initialisation functions. These are typically named driverNameInstInit, driverNameInstInit2 and driverNameInstConnect, and collectively are wrapped into a drvBusFuncs structure called driverNameFuncs.VxWorks VxBus Initialisation Sequence

A vxbPlbRegister structure contains the VxBus registration details for the Processor Local Bus (PLB) (and another for PCI vxbPciRegister if PCI used, although not all targets have PCI). The structure contains:

  • the address of another registration structure (can be NULL)
  • a device identifier
  • a bus identifier
  • the vxBus version the driver was written for
  • the driver name
  • the address of the initialisation functions structure
  • the address of the methods
  • a probe function

Initialisation

The 5 phases for VxBus driver initialisation are:

  1. Within the driverNameRegister function, the vxbPlbRegister structure is used as a parameter to vxbDevRegister.
  2. The optional driverNameprobe function is used to talk with the hardware and determine if the instance actually exists. It returns a boolean value. (not included in the diagram).
  3. The driverNameInstInit function is called early during system initialisation (pre-kernel), and therefore it can only use limited OS functionality.
  4. The driverNameInstInit2 function is called later during system initialisation (post-kernel), when there is more OS functionality available.
  5. The driverNameInstConnect function is called to perform asynchronous initialisation.

Each phase of initialisation is executed for all VxBus devices before moving onto the next phase. The execution order between devices is not specified, and therefore no driver should assume that another driver will or wont have already processed that stage. The exception to this is for parent bus controllers that are required to be initialised before other drivers can access the hardware.

Methods

Once the driver has been initialised, the VxWorks kernel will access the internal functions of the driver via a list of registered function calls. These function calls are searched when some part of the kernel calls vxbDevIterate to perform a specific action for each device. 

It is possible to dynamically add and remove drivers from VxBus. Please contact us if you would like to discuss this functionality.