
TPMC821-SW-42 - VxWorks Device Driver Page 7 of 37
2.4 Special installation for Intel x86 based targets
The TPMC821 device driver is fully adapted for Intel x86 based targets. This is done by conditional
compilation directives inside the source code and controlled by the VxWorks global defined macro
CPU. If the contents of this macro are equal to I80386, I80386 or PENTIUM special Intel x86
conforming code and function calls will be included.
The second problem for Intel x86 based platforms can’t be solved by conditional compilation
directives. Due to the fact that some Intel x86 BSP’s doesn’t map PCI memory spaces of devices
which are not used by the BSP, the required CAN controller device registers can’t be accessed.
To solve this problem a MMU mapping entry has to be added for the required TPMC821 PCI memory
spaces prior the MMU initialization (usrMmuInit()) is done.
Please examine the BSP documentation or contact the BSP Vendor whether the BSP perform
automatic PCI and MMU configuration or not. If the PCI and MMU initialization is done by the BSP the
function tp821PciInit() won’t be included and the user can skip to the following steps.
The C source file tp821pci.c contains the function tp821PciInit(). This routine finds out all TPMC821
devices and adds MMU mapping entries for all used PCI memory spaces. Please insert a call to this
function after the PCI initialization is done and prior to MMU initialization (usrMmuInit()).
If the Tornado 2.0 project facility is used, the right place to call the function tp821PciInit() is at the end
of the function sysHwInit() in sysLib.c (can be opened from the project Files window).
If Tornado 1.0.1 compatibility tools are used insert the call to tp821PciInit() at the beginning of the root
task (usrRoot()) in usrConfig.c.
Be sure that the function is called prior to MMU initialization otherwise the TPCM821 PCI spaces
remains unmapped and an access fault occurs during driver initialization.
Please insert the following call at a suitable place in either sysLib.c or usrConfig.c:
tp821PciInit();
To link the driver object modules to VxWorks, simply add all necessary driver files to the project. If
Tornado 1.0.1 Standard BSP Builds... is used add the object modules to the macro MACH_EXTRA
inside the BSP Makefile (MACH_EXTRA = tp821drv.o tp821pci.o ...).
The function tp821PciInit() was designed for and tested on generic Pentium targets. If another
BSP is used, please refer to BSP documentation or contact the technical support for required
adaptation.
If strange errors appeared after system startup with the new build system please carrying out a
VxWorks build clean and build all.