bdi
Wind
for Tornado™, BDI2000 (MPC8xx/MPC5xx)
User Manual
38
© Copyright 1997-2007 by ABATRON AG Switzerland
V 1.38
3.3.5 bdiWind UDP-lite packet driver
The bdiWind UDP-lite packet driver communicates with the BDI over the debug interface. Communi-
cation is established through buffers in the target memory. One for receiving packets and one for out-
going packets.
When a target server sends a request to the target agent, this request is sent to the BDI. When it
receives this request, the BDI places it in the receive buffer of the target an sets the rx count field
accordingly. A VxWorks tasks polls the rx count field to retrieve such requests, and passes them on
to the agent.
When the agent has data to send, the data is copied into the transmit buffer and the tx count field is
set. Then the target CPU changes to debug mode by executing a system call instruction (sc). The
BDI detects this change to debug mode, reads the data from the transmit buffer and sends the packet
to the requesting target server.
Important note:
Communication between the BDI and the target CPU is only possible while the target CPU is frozen.
In this state, no interrupts are processed. To transfer a complete IP frame the target CPU is frozen
during a time of up to 5ms.
3.3.5.1. Transferring the communciation base address
The address of the communication structure is not fixed in memory and may change after every new
build of the VxWorks core. On the other side, the BDI has to know where this structure lies in memory.
To transfer this information to the BDI, the initializing routine (wdbBdiPktDevInit) copies the address
of the communication structure into register GPR3 and enters debug mode by executing a SC as-
sembler instruction. The BDI detects this change to debug mode and reads the register GPR3. To
support this transfer, an assembly routine is added to the module sysALib.c.
bdiInit:
sc /* enter debug mode */
blr
rx count
tx count
rx buffer pointer
tx buffer pointer
data
IP header
UDP header
data
UDP/IP
Transmit Buffer
UDP/IP
Receive Buffer
communication
base address
The count fields are use
to indicate if a new packet
is ready for processing.
When a packet is pro-
cessed, the consumer
sets this field to zero. The
producer sets this field
after the packet data is
ready to process.