E-28
DINK32 PowerPC ISA Debugger User’s Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
MPC8240 I2O Doorbell Driver
The I2O library function I2OInMsgStatGet() is used to read the IMISR. It returns the
content of the IMISR after applying the mask value in the Inbound Message Interrupt Mask
Register (IMIMR) and clears the status register. The I2O library function I2ODBGet() is
used to read the IDBR. It returns the content and clears the register. Similarly, the
I2O_ISR_host function checks the agent’s Outbound Message Interrupt Status Register
(OMISR) to determine if the cause of the interrupt was due to the agent’s outbound
doorbell. It is important to note that the I2O_ISR_host must be expanded to check for any
function I2OOutMsgStatGet() is used to read the OMISR. It returns the content of the
OMISR after applying the mask value in the Outbound Message Interrupt Mask Register
(OMIMR) and clears the status register. The I2O library function I2ODBGet() is used to
read the ODBR. It returns the content and clears the register.
The two functions I2O_ISR_host() and I2O_ISR_agent() are defined in the source file
.../drivers/i2o/i2o1.c and are linked into the libdriver.a library. For testing, they are
currently manually called when requested by the user in the function test_i2o(). Eventually,
the host and agent will register an interrupt service routine (ISR) with their respective
Embedded Programmable Interrupt Controller (EPIC) systems. Details about how to
register the ISRs with EPIC are not yet specified. It may take the form of a function call to
an EPIC-provided function that accepts a pointer to the ISR function. Alternately, it may be
integrated by the linker by placing a reference to the ISR functions in some configuration
table. When the integration takes place, this document will be updated to reflect the details.
The code for the entire I2O_ISR_host function follows. Note that the only type of interrupt
that is currently handled is doorbell interrupt from the message unit, but there are comments
in the code indicating where to check for other causes of interrupts. The code can be found
in i2o1.c.
E.3.1.3
Enable Doorbell Interrupts
Since the agent is servicing the inbound doorbell, the agent enables it by calling the I2O
library function I2ODBEnable(), which clears the Inbound Doorbell Interrupt Mask
(IDIM) bit in the Inbound Doorbell Interrupt Mask Register (IMIMR). The IMIMR is at
offset 0x104 in the agent’s Embedded Utilities Memory Block (EUMB), whose address is
in the agent’s EUMBBAR. Similarly, since the host is servicing the agent’s outbound
doorbell, the host enables it by calling the I2O library function I2ODBDisable(), which
clears the Outbound Doorbell Interrupt Mask (ODIM) bit in the agent’s Outbound Message
Interrupt Mask Register (OMIMR). The OMIMR is at offset 0x34 in the agent’s PCSR
block, whose address is in the agent’s PCSRBAR at offset 0x14 in the agent’s
Configuration Registers.
The address of the agent’s Configuration Registers are known by the host and are accessible
from the PCI bus. At present, the user interface in DINK32 allows the user to set or clear
the ODIM or IDIM bit. The functions I2ODBEnable() and I2ODBDisable() are defined in
.../drivers/i2o/i2o1.c to perform this task. See the code in test_i2o() for a usage example. It
F
n
.