User guide
4 MPC184/MPC185 Security Co-Processor Software User’s Guide MOTOROLA
PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE
Device Driver Components Device Driver Components
2 Device Driver Components
This section is provided to help users understand the internal structure of the device driver.
2.1 Device Driver Structure
Internally, the driver is structured in four basic parts:
• Initialization
•I/O request
• Interrupt service routine
• Processing complete
When executing, the main driver code will run in the end-user application context, the interrupt service
routine (ISR) will run in the interrupt context, and the processing complete will run in its own context.
Figure 1. Internal Driver Architecture
2.2 Driver Initialization Routine
The driver initialization routine includes both OS-specific (VxWorks and Linux) and hardware-specific
(MPC185 60x, MPC184 PCI, and MPC184 8xx) initialization.
The steps taken by the driver initialization routine are as follows:
• Find the security co-processor and save the device memory map starting address in
IOBaseAddress (based on the actual device)
• Initialize the security co-processor registers
— Controller registers
— Channel registers
—EU registers
•
Prepare Descriptors
• Queue Request when Channels are Unavailable
• Give the MPC184/MPC185 the GO Command
• Tracks Requests
Driver
Invoked
Callback Function
Prepare Request
(Non-Blocking)
ioctl ( )
Sleeps on Queue
Completes the User Request
Execute Callback Function**
Driver
Returns
End-User Application
ProcessingComplete Task
Operation
Starts
MPC184/MPC185
Operation Completed/
Interrupt Generated
ISR
IsrMsgQId
Writing a Message to the Queue Wakes
the ProcessingComplete Task
Driver runs under the context of the end-user task.
If no callback function is defined, no callback takes place.
*
**
Driver Code*










