MOTOROLA
Appendix E. MPC8240 Drivers
E-29
is interesting to note that the observed behavior of the Kahlua chip with regard to message
unit registers is not dependant on the ODIM and IDIM bit settings Even if the ODIM or
IDIM mask bits are set, writes to the affected doorbell are not blocked and the appropriate
bit is set in the message unit’s status register. It is up to software to apply the mask to the
status register to determine whether or not to take any action. The interrupt should not occur
if the mask bit is set, but this has not yet been tested.
E.3.1.4
Writing and Reading Doorbell Registers
The functions I2ODBPost() and I2ODBGet() are defined in .../drivers/i2o/i2o1.c to write a
bit pattern to or return the contents of the agent’s inbound and outbound doorbell registers.
Note that the agent application accesses both inbound and outbound doorbell registers via
its own EUMB and the host application accesses these same doorbell registers via the
agent’s PCSR. See the code in test_i2o() for usage examples.
E.3.1.4.1
Host Rings an Agent via Agent’s Inbound Doorbell
The host application calls the I2O library function I2ODBPost() to write the bit pattern to
the agent’s Inbound Door Bell Register (IDBR). If the inbound doorbell is enabled, this
generates a Message Unit interrupt to the agent processor and the agent’s EPIC unit will
execute the I2O_ISR_agent function to determine the cause of the message unit interrupt
and handle it appropriately. If the inbound doorbell is not enabled, no interrupt is generated;
but the doorbell and the status register bit are still set. The agent application reads the IDBR
by calling the I2O library function I2ODBGet(). This clears the IDBR.
E.3.1.4.2
Agent Rings a Host via Agent’s Outbound Doorbell
The agent application calls the I2O library function I2ODBPost() to write the bit pattern to
the agent’s Outbound Door Bell Register (ODBR). If the outbound doorbell is enabled, this
causes the outbound interrupt signal INTA_ to go active which interrupts the host
processor. After the ISR is integrated into the EPIC unit, this mechanism will be
documented here. If the outbound doorbell is not enabled, no interrupt is generated; but the
doorbell and the status register bit are still set. The host application reads the ODBR by
calling the I2O library function I2ODBGet(). This clears the ODBR.
Sample application code. Here is some sample code from the DINK32 function test_i2o()
in device.c that provides examples of how the I2O library functions can be used by an
application. When this section of code is entered, the DINK32 user interface has already set
the local variables “mode” and “bit”. Mode reflects the user request. Bit is the doorbell bit
number to set. Mode = 4 to manually run the ISR’s for testing prior to integration with
EPIC.
/* different depending on if DINK = is running on host or agent */
if (target_mode 0)
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.