| |||
| Home > AHB Components > Interrupt controller > Programmer’s model | |||
Table 3.14 lists how, by convention, the IRQ interrupt bits [5:1] must be used. Bit 0 and bit 6 upwards are available for use as required. For the FIQ interrupt, the bits can be used as required.
Table 3.14. Interrupt standard configuration
Bit | Interrupt source |
|---|---|
1 | Software interrupt |
2 | Comms Rx |
3 | Comms Tx |
4 | Timer 1 |
5 | Timer 2 |
The software can control the source interrupt lines to generate software interrupts. These interrupts are generated before interrupt masking, in the same way as external source interrupts. Software interrupts are cleared by writing to the software interrupt clear register, ICSoftIntClear. See Software Interrupt Clear Register. This is normally done at the end of the interrupt service routine.
The following procedure shows the sequence for the vectored interrupt flow:
An interrupt occurs.
The ARM processor branches to either the IRQ or FIQ exception vector.
If the interrupt is an IRQ, read the ICVectAddr register and branch to the interrupt service routine. This can be done using an LDR PC instruction. Reading the ICVectorAddr register updates the interrupt controllers hardware priority register.
Stack the workspace so that IRQ interrupts can be re-enabled.
Enable the IRQ interrupts so that a higher priority can be serviced.
Execute the Interrupt Service Routine (ISR).
Clear the requesting interrupt in the peripheral, or write to the ICSoftIntClear register if the request was generated by a software interrupt.
Disable the interrupts and restore the workspace.
Write to the ICVectAddr register. This clears the respective interrupt in the internal interrupt priority hardware.
Return from the interrupt. This re-enables the interrupts.
The following procedure shows how you can use the interrupt controller without using vectored interrupts or the interrupt priority hardware. For example, you can use it for debugging.
An interrupt occurs.
Branch to IRQ or FIQ exception vector.
Branch to the interrupt handler.
Interrogate the ICIRQStatus register to determine the source that generated the interrupt, and prioritize the interrupts if there are multiple active interrupt sources. This takes a number of instructions to compute.
Branch to the correct ISR.
Execute the ISR.
Clear the interrupt. If the request was generated by a software interrupt, the ICSoftIntClear register must be written to.
Check the ICIRQStatus register to ensure that no other interrupt is active. If there is an active request go to Step 4.
Return from the interrupt.
If the above flow is used, you must not read or write to the ICVectorAddr register.
To ensure that the vector address register can be read in
a single instruction, the IC base address must be 0xFFFFF000,
the upper 4K of memory. See Vector Address Register. Placing the IC anywhere else in memory
increases interrupt latency as the ARM processor is unable to access
the ICVectorAddr register using a single instruction. The offset
of any particular register from the base address is fixed.
Table 3.15 lists the registers in base offset order.
Table 3.15. Interrupt controller registers
Name | Base offset | Type | Width | Reset value | Description |
|---|---|---|---|---|---|
ICIRQSTATUS |
| Read | 32 |
| See IRQ Status Register |
ICFIQSTATUS |
| Read | 32 |
| See FIQ Status Register |
ICRAWINTR |
| Read | 32 |
| See Raw Interrupt Status Register |
ICINTSELECT |
| Read/ write | 32 |
| See Interrupt Select Register |
ICINTENABLE |
| Read/ write | 32 |
| See Interrupt Enable Register |
ICINTENCLEAR |
| Write | 32 |
| See Interrupt Enable Clear Register |
ICSOFTINT |
| Read/ write | 32 |
| See Software Interrupt Register |
ICSOFTINTCLEAR |
| Write | 32 |
| See Software Interrupt Clear Register |
ICPROTECTION |
| Read/ write | 1 |
| See Protection Enable Register |
ICVECTADDR |
| Read/ write | 32 |
| See Vector Address Register |
ICDEFVECTADDR | I | Read/ write | 32 |
| See Default Vector Address Register |
ICITCR |
| Read/ write | 1 |
| See Test Control Register |
ICITIP1 | I | Read | 2 |
| See Test Input Register 1 |
ICITIP2 |
| Read | 32 |
| See Test Input Register 2 |
ICITOP1 |
| Read | 2 |
| See Test Output Register 1 |
ICITOP2 |
| Read | 32 |
| See Test Output Register 2 |
ICPERIPHID0 |
| Read | 8 |
| See Peripheral Identification Registers |
ICPERIPHID1 |
| Read | 8 |
| See Peripheral Identification Registers |
ICPERIPHID2 |
| Read | 8 |
| See Peripheral Identification Registers |
ICPERIPHID3 |
| Read | 8 |
| See Peripheral Identification Registers |
ICPCELLID0 |
| Read | 8 |
| See PrimeCell Identification Registers |
ICPCELLID1 |
| Read | 8 |
| See PrimeCell Identification Registers |
ICPCELLID2 |
| Read | 8 |
| See PrimeCell Identification Registers |
ICPCELLID3 |
| Read | 8 |
| See PrimeCell Identification Registers |
The ICIRQSTATUS register is read-only. It provides the status of interrupts [31:0] after IRQ masking. Table 3.16 lists the register bit assignments.
The ICFIQSTATUS register is read-only. It provides the status of the interrupts after FIQ masking. Table 3.17 lists the register bit assignments.
The ICRAWINTR register is read-only. It provides the status of the source interrupts, and software interrupts, to the interrupt controller. Table 3.18 lists the register bit assignments.
The ICINTSELECT register is read/write. It selects whether the corresponding interrupt source generates an FIQ or an IRQ interrupt. Table 3.19 lists the register bit assignments.
The ICINTENABLE register is read/write. It enables the interrupt request lines, by masking the interrupt sources for the IRQ interrupt. Table 3.20 lists the register bit assignments.
Table 3.20. ICINTENABLE Register bit assignments
Bits | Name | Function |
|---|---|---|
[31:0] | IntEnable | Enables the interrupt request lines: 0 = Interrupt disabled. 1 = Interrupt enabled. Enables interrupt request to processor. On reset, all interrupts are disabled. A HIGH bit sets the corresponding bit in the ICIntEnable register. A LOW bit has no effect. |
The ICINTENCLEAR register is write-only. It clears bits in the ICIntEnable register. Table 3.21 lists the register bit assignments.
The ICSOFTINT register is read/write. It generates software interrupts. Table 3.22 lists the register bit assignments.
The ICSOFTINTCLEAR register is write-only. It clears bits in the ICSoftInt register. Table 3.23 lists the register bit assignments.
The ICPROTECTION register is read/write. It enables or disables protected register access. Figure 3.34 shows the register bit assignments.
Table 3.24 lists the register bit assignments.
Table 3.24. ICPROTECTION Register bit assignments
Bits | Name | Function |
|---|---|---|
[31:1] | Reserved | - |
[0] | Protection | Enables or disables protected register access. When enabled, only privileged mode accesses, reads and writes, can access the interrupt controller registers. When disabled, both User mode and privileged mode can access the registers. This register is cleared on reset, and can only be accessed in privileged mode. |
If the bus master cannot generate accurate protection information, leave this register in its reset state to enable User mode access.
The ICVECTADDR register is read/write. It contains the Interrupt Service Routine (ISR) address of the currently active interrupt. Table 3.25 lists the register bit assignments.
Table 3.25. ICVECTADDR Register bit assignments
Bits | Name | Function |
|---|---|---|
[31:0] | VectorAddr | Contains the address of the currently active ISR. Any writes to this register clear the interrupt. |
Reading from this register provides the address of the ISR, and indicates to the priority hardware that the interrupt is being serviced. Writing to this register indicates to the priority hardware that the interrupt has been serviced. You must use the register as follows:
the ISR reads the ICVectAddr register when an IRQ interrupt is generated
at the end of the ISR, the ICVectAddr register is written to, to update the priority hardware.
Reading or writing to the register at other times can cause incorrect operation.
The ICDEFVECTADDR register is read/write. It contains the default ISR address. Table 3.26 lists the register bit assignments.
The ICITCR register is read/write. It selects test mode, and is cleared on reset. Figure 3.35 shows the register bit assignments.
Table 3.27 lists the register bit assignments.
The ICITIP1 register is read-only. It indicates the status of the nICIRQIN and nICFIQIN daisy chain input lines. Figure 3.36 shows the register bit assignments.
Table 3.28 lists the register bit assignments.
The ICITIP2 register is read-only. It indicates the status of the ICVECTADDRIN daisy chain input lines. Table 3.29 lists the register bit assignments.
The ICITOP1 register is read-only. It indicates the status of the nICIRQ and nICFIQ interrupt request lines to the processor. Figure 3.37 shows the register bit assignments.
Table 3.30 lists the bit assignments for the ICITOP1 register.
The ICITOP2 register is read-only. It indicates the status of the ICVECTADDROUT lines from the interrupt controller. Table 3.31 lists the register bit assignments.
The ICPERIPHID0-3 registers are four 8-bit registers, that
span address locations 0xFE0-0xFEC. The registers
can conceptually be treated as a single 32-bit register. The read-only
registers provide the following options of the peripheral:
This identifies the peripheral. The three digit
product code 0x90 is used for the interrupt controller.
This is the identification of the designer. ARM Ltd is 0x41 (ASCII
A).
This is the revision number of the peripheral. The revision number starts from 0.
This is the configuration option of the peripheral. The configuration value is 0.
Figure 3.38 shows the register bit assignments.
The four 8-bit peripheral identification registers are described in the following sections:
The ICPERIPHID0 register is read-only. It is hard-coded and the fields within the register determine the reset value. Table 3.32 lists the register bit assignments.
The ICPERIPHID1 register is read-only. It is hard-coded and the fields within the register determine the reset value. Table 3.33 lists the register bit assignments.
The ICPERIPHID2 register is read-only. It is hard-coded and the fields within the register determine the reset value. Table 3.34 lists the register bit assignments.
The ICPERIPHID3 register is read-only. It is hard-coded and the fields within the register determine the reset value. Table 3.35 lists the register bit assignments.
The ICPCELLID0-3 registers are four 8-bit registers, that
span address locations 0xFF0-0xFFC. The read-only
register can conceptually be treated as a single 32-bit register.
The register is used as a standard cross-peripheral identification
system. Figure 3.39 shows
the register bit assignments.
The four 8-bit registers are described in the following subsections:
The ICPCELLID0 register is read-only. It is hard-coded and the fields within the register determine the reset value. Table 3.36 lists the register bit assignments.
The ICPCELLID1 register is read-only. It is hard-coded and the fields within the register determine the reset value. Table 3.37 lists the register bit assignments.
The ICPCELLID2 register is read-only. It is hard-coded and the fields within the register determine the reset value. Table 3.38 lists the register bit assignments.
The ICPCELLID3 register is read-only. It is hard-coded and the fields within the register determine the reset value. Table 3.39 lists the register bit assignments.