README: Kontron KEAPI

This directory contains the Kontron KEAPI components such as 
KEAPI Library, KEAPI Server, vxBus driver for KEAPI Support.
 
--------------------------------------------------------------------------------

RELEASE 0.1 (prototype)

	Released from Kontron KGSC for Workbench 3.x, VxWorks 6.8.2

1. Contents of the KEAPI directory

 ./

 Makefile       - make file to build KEAPI support which will be
                  archived into libkontron.a library created at
                  ${WIND_BASE}/target/lib[_smp]/<arch>/<CPU>/common directory.

 40KEAPI.cdf    - KEAPI components definition file.

 KEAPI.dc      - driver registeration function prototype which is redirected
                  to ${WIND_BASE}/target/config/all/vxbUsrCmdLine.c.

 KEAPI.dr      - driver registeration function which is redirected to
                  ${WIND_BASE}/target/config/all/vxbUsrCmdLine.c and executed by
                  hardWareInterFaceBusInit() in the vxbUsrCmdLine.c

 keapi.c, vxbKEAPI.h   - VxBus driver providing initialization of Kontron KEAPI

 keapi.h       - KEAPI declarations

 keapi.h, keapi_types.h   - KEAPI declarations

 keapiBSP.c keapiBSPRtn.c keapiBSPRtn.h - KEAPI BSP implementation bindings

Note: The driver is not configurable at installation.  To make the driver
configurable, please build the driver object file and archive it to the
library. And copy the 40KEAPI.cdf file to
${WIND_BASE}/target/config/comps/vxWorks directory.

Go to ${WIND_BASE}/target/3rdparty/kontron/KEAPI.

 % cd ${WIND_BASE}/target/3rdparty/kontron/KEAPI

Build KEAPI 

for uniprocessor mode:

 % make CPU=PENTIUM4 TOOL=diab

for SMP mode:

 % make CPU=PENTIUM4 TOOL=diab VXBUILD=SMP 

Copy 40KEAPI.cdf file to ${WIND_BASE}/target/config/comps/vxWorks directory.

 % cp 40KEAPI.cdf ${WIND_BASE}/target/config/comps/vxWorks

(You might need to close the VxWorks Image Project on WorkBench once
if you already opened and then re-open it to be able to select
the sample driver from the Kernel Configuration tool in case WorkBench has
cached the VxWorks kernel library module information and the CDF files.)

2. Update your BSP

In order to register the driver on VxWorks image the following
configuration resource table needs to be added to the hwconf.c
in your BSP (if not done already).

#ifdef INCLUDE_KEAPI
    const struct hcfResource keapiResources[] = {
        { "regBase", HCF_RES_INT,  {(void *)0} },
    };

And add the resource table to the hcfDeviceList[] structure in the hwconf.c
with the driver name "wrsample" which should match to the
keapi->drvName 

#ifdef INCLUDE_KEAPI
        { "keapi", 0, VXB_BUSID_PLB, 0, NELEMENTS(keapiResources), keapiResources },
#endif

3. Create VxWorks Image Project (VIP) with the KEAPI support.

NOTE: The BSP the VIP will be based should be KEAPI enabled, otherwise KEAPI support will be unavailable.

Add INCLUDE_KEAPI and INCLUDE_VXBUS_SHOW components.
(The VxBus Show component will be used to verify the KEAPI driver is
successfully registered on VxWorks image later.)

Build the project.

Make sure the KEAPI driver gets linked to the VxWorks image.
You should see the vxbKEAPIRegister symbol in the image.

 % nmpentium default/vxWorks | grep vxbKEAPIRegister
 60122250 T vxbKEAPIRegister

4. Execute the VxWorks image and verify the KEAPI driver is registered.

----------
-> vxBusShow
Registered Bus Types:
  PLB_Bus @ 0x6018daa0

Registered Device Drivers:
  keapi at 0x60198320 on bus PLB_Bus, funcs @ 0x60198370
  plbCtlr at 0x6018dac8 on bus PLB_Bus, funcs @ 0x6018dabc
   ....

Busses and Devices Present:
  PLB_Bus @ 0x601a4fd8 with bridge @ 0x6018db08
    Device Instances:
        keapi unit 0 on PLB_Bus @ 0x601a5f98 with busInfo 0x00000000
        ....
    Orphan Devices:
  ....
value = 1 = 0x1
----------

5. Execute the sample application.

TBD
	  
	  
