02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2<br />

<strong>BSP</strong> Organization<br />

The entry point of the VxWorks image, _sysInit, is located in sysALib.s. It is the<br />

first code executed after booting (see sysALib.s: sysInit( ), p.34). It is usual here to<br />

perform all the functions performed by romInit.s, except for system memory<br />

setup. The memory system should be initialized at this stage of the startup<br />

procedure.<br />

Unlike romInit.s, code in sysALib.s does not need to be written as PIC or to use<br />

the ROM_ADRS macro to remap absolute addresses. It can call out to other<br />

modules and routines.<br />

2<br />

sysLib.c<br />

sysSerial.c<br />

sysScsi.c<br />

This file contains the C source of target-specific, system-dependent sysLib<br />

routines. These routines provide the board-level interface on which VxWorks and<br />

application code can be built in a system-independent way. Note that sysLib.c can<br />

include drivers from the src/drv directory and that these drivers can include some<br />

of the routines listed below. For more information, see 5. Driver <strong>Guide</strong>lines and<br />

F. Generic Drivers.<br />

Driver setup and initialization is usually done in a subfile, which is included in<br />

sysLib.c. Common subfiles are named: sysSerial.c, sysScsi.c, sysNet.c, and so on.<br />

The purpose of using subfiles is keeping the setup and initialization of a particular<br />

device constant across all architectures. The setup file for one board using a<br />

particular device should be the same for any other board using that same device.<br />

Not every feature of a particular board is necessarily supported by this <strong>BSP</strong><br />

abstraction. Some boards provide functions with jumpers or PALs instead of<br />

software controllable/readable registers. Other hardware configurations might<br />

not support some normally expected basic features.<br />

When features are missing, it is usually safe to code an empty stub that returns<br />

ERROR or NULL (whichever is appropriate), if any return value is required.<br />

This optional file contains all the serial I/O setup and initialization for the SIO<br />

device drivers. It is not separately compiled, but is included from sysLib.c. The<br />

purpose of separating serial initialization from sysLib.o is to modularize the code<br />

and allow reuse of code between <strong>BSP</strong>s.<br />

This optional file contains the SCSI-2 setup and initialization for the <strong>BSP</strong>. Like<br />

sysSerial.c, it is included in sysLib.c.<br />

25

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

Saved successfully!

Ooh no, something went wrong!