02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VxWorks 5.5<br />

<strong>BSP</strong> Developer’s <strong>Guide</strong><br />

Multiple Buses<br />

CPU Local Bus, VMEbus, VXI, QBus, SBus, PCI Local Bus: will it never end?<br />

Computers are getting more complex and it is reaching the embedded computer<br />

arena. Some buses define their own byte ordering differently from the local CPU<br />

byte ordering. You want your drivers to work on any bus with a minimum of<br />

configuration changes. Fortunately, the hardware access macros that were defined<br />

for flexibility come to the rescue once again. It is simple to define the macros to<br />

perform any byte swapping or other bus related operations.<br />

The most complex board system to date is the Motorola MVME-1600 board. The<br />

local bus is the PowerPC MPC bus. The MPC105 chip connects the MPC bus to a<br />

PCI bus. A PCI chip connects to an ISA Bus. A different PCI chip connects the PCI<br />

bus to a Motorola 68040 bus. From the 68040 Bus, there is a VME chip to interface<br />

to the VMEbus. One board, five different buses. VMEbus supports seven interrupt<br />

request levels and 256 possible vectors. PCI supports four interrupt levels. ISA<br />

supports 16 interrupt levels. PCI is little endian by definition. The 040 bus is big<br />

endian by definition. The MPC bus is ambidextrous (either ended).<br />

Interrupt Controllers<br />

Some hardware designs require special interrupt acknowledge steps. Sometimes<br />

interrupts are processed through cascaded chains of interrupt controllers requiring<br />

multiple steps with each interrupt just to reset or clear the interrupt controller<br />

hardware.<br />

With the rush to PCI bus devices, you must insure that all your interrupt service<br />

routines are compatible with chaining. This means that the driver code must<br />

determine if the device is actually asserting an interrupt request and if not then the<br />

code must exit immediately.<br />

Ideally, the device driver should not be concerned with connecting interrupt<br />

vectors. This is definitely an area of <strong>BSP</strong> responsibility. The driver interrupt service<br />

routine should be a global routine that the <strong>BSP</strong> connects to the vector as part of<br />

sysHwInit2( ). If a driver must be involved in the interrupt connect step, then this<br />

should be through a hardware abstraction macro. This needs to be a flexible<br />

interface so that different boards with different interrupt structures can be<br />

supported from the one driver.<br />

94

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!