Changeset 21aab25 in mainline
- Timestamp:
- 2012-09-23T21:41:22Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a829a5b
- Parents:
- d085df10
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified kernel/genarch/include/drivers/am335x_irc/am335x_irc.h ¶
rd085df10 r21aab25 51 51 const uint8_t padd0[12]; 52 52 53 /* This register controls the various parameters 54 * of the OCP interface. 55 */ 53 56 ioport32_t sysconfig; 54 57 #define AM335x_IRC_SYSCONFIG_AUTOIDLE_FLAG (1 << 0) 55 58 #define AM335x_IRC_SYSCONFIG_SOFTRESET_FLAG (1 << 1) 56 59 60 /* This register provides status information about the module */ 57 61 const ioport32_t sysstatus; 58 62 #define AM335x_IRC_SYSSTATUS_RESET_DONE_FLAG (1 << 0) … … 60 64 const uint8_t padd1[40]; 61 65 66 /* This register supplies the currently active IRQ interrupt number */ 62 67 ioport32_t sir_irq; 63 68 #define AM335x_IRC_SIR_IRQ_ACTIVEIRQ_MASK 0x7F 64 69 #define AM335x_IRC_SIR_IRQ_SPURIOUSIRQFLAG_MASK 0xFFFFFFF8 65 70 71 /* This register supplies the currently active FIQ interrupt number */ 66 72 const ioport32_t sir_fiq; 67 73 #define AM335x_IRC_FIQ_IRQ_ACTIVEFIQ_MASK 0x7F 68 74 #define AM335x_IRC_FIQ_IRQ_SPURIOUSFIQFLAG_MASK 0xFFFFFFF8 69 75 70 ioport32_t control; /* New IRQ/FIQ agreement */ 76 /* This register contains the new interrupt agreement bits */ 77 ioport32_t control; 71 78 #define AM335x_IRC_CONTROL_NEWIRQAGR_FLAG (1 << 0) 72 79 #define AM335x_IRC_CONTROL_NEWFIQAGR_FLAG (1 << 1) 73 80 81 /* This register controls protection of the other registers. 82 * This register can only be accessed in priviledged mode, regardless 83 * of the current value of the protection bit. 84 */ 74 85 ioport32_t protection; 75 86 #define AM335x_IRC_PROTECTION_FLAG (1 << 0) 76 87 88 /* This register controls the clock auto-idle for the functional 89 * clock and the input synchronizers. 90 */ 77 91 ioport32_t idle; 78 92 #define AM335x_IRC_IDLE_FUNCIDLE_FLAG (1 << 0) … … 81 95 const uint8_t padd2[12]; 82 96 97 /* This register supplies the currently active IRQ priority level */ 83 98 const ioport32_t irq_priority; 84 99 #define AM335x_IRC_IRQ_PRIORITY_IRQPRIORITY_MASK 0x7F 85 100 #define AM335x_IRC_IRQ_PRIORITY_SPURIOUSIRQFLAG_MASK 0xFFFFFFF8 86 101 102 /* This register supplies the currently active FIQ priority level */ 87 103 const ioport32_t fiq_priority; 88 104 #define AM335x_IRC_FIQ_PRIORITY_FIQPRIORITY_MASK 0x7F 89 105 #define AM335x_IRC_FIQ_PRIORITY_SPURIOUSIRQFLAG_MASK 0xFFFFFFF8 90 106 107 /* This register sets the priority threshold */ 91 108 ioport32_t threshold; 92 109 #define AM335x_IRC_THRESHOLD_PRIORITYTHRESHOLD_MASK 0xFF … … 177 194 } 178 195 196 /** Get the currently active IRQ interrupt number 197 * 198 * @param regs Pointer to the irc memory mapped registers 199 * 200 * @return The active IRQ interrupt number 201 */ 202 static inline unsigned am335x_irc_inum_get(am335x_irc_regs_t *regs) 203 { 204 return regs->sir_irq & AM335x_IRC_SIR_IRQ_ACTIVEIRQ_MASK; 205 } 206 207 /** Reset IRQ output and enable new IRQ generation 208 * 209 * @param regs Pointer to the irc memory mapped registers 210 */ 211 static inline void am335x_irc_irq_ack(am335x_irc_regs_t *regs) 212 { 213 regs->control = AM335x_IRC_CONTROL_NEWIRQAGR_FLAG; 214 } 215 216 /** Reset FIQ output and enable new FIQ generation 217 * 218 * @param regs Pointer to the irc memory mapped registers 219 */ 220 static inline void am335x_irc_fiq_ack(am335x_irc_regs_t *regs) 221 { 222 regs->control = AM335x_IRC_CONTROL_NEWFIQAGR_FLAG; 223 } 224 225 /** Clear an interrupt mask bit 226 * 227 * @param regs Pointer to the irc memory mapped registers 228 * @param inum The interrupt to be enabled 229 */ 230 static inline void am335x_irc_enable(am335x_irc_regs_t *regs, unsigned inum) 231 { 232 ASSERT(inum < AM335x_IRC_IRQ_COUNT); 233 const unsigned set = inum / 32; 234 const unsigned pos = inum % 32; 235 regs->interrupts[set].mir_clear = (1 << pos); 236 } 237 238 /** Set an interrupt mask bit 239 * 240 * @param regs Pointer to the irc memory mapped registers 241 * @param inum The interrupt to be disabled 242 */ 243 static inline void am335x_irc_disable(am335x_irc_regs_t *regs, unsigned inum) 244 { 245 ASSERT(inum < AM335x_IRC_IRQ_COUNT); 246 const unsigned set = inum / 32; 247 const unsigned pos = inum % 32; 248 regs->interrupts[set].mir_set = (1 << pos); 249 } 250 179 251 #endif 180 252
Note:
See TracChangeset
for help on using the changeset viewer.