Changeset 13be128d in mainline
- Timestamp:
- 2012-03-10T20:20:16Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c91fe327
- Parents:
- 590ce352
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/include/drivers/amdm37x_irc/amdm37x_irc.h
r590ce352 r13be128d 38 38 39 39 /* AMDM37x TRM p. 1079 */ 40 #define AMDM37x_IRC_BASE_ADDRESS 0x4820000 40 #define AMDM37x_IRC_BASE_ADDRESS 0x48200000 41 41 #define AMDM37x_IRC_SIZE 4096 42 42 … … 46 46 47 47 typedef struct { 48 ioport32_t revision; /**< Revision */48 const ioport32_t revision; /**< Revision */ 49 49 #define AMDM37x_IRC_REV_MASK (0xff) 50 51 uint8_t padd0_[12]; 50 52 51 53 ioport32_t sysconfig; /**< SYS config */ … … 53 55 #define AMDM37x_IRC_SYSCONFIG_SOFTRESET_FLAG (1 << 1) 54 56 55 ioport32_t sysstatus; /**< SYS status */57 const ioport32_t sysstatus; /**< SYS status */ 56 58 #define AMDM37x_IRC_SYSSTATUS_RESET_DONE_FLAG (1 << 0) 57 59 58 ioport32_t sir_irq; /**< Currently active irq number */ 60 uint8_t padd1_[40]; 61 62 const ioport32_t sir_irq; /**< Currently active irq number */ 59 63 #define AMDM37x_IRC_SIR_IRQ_ACTIVEIRQ_MASK (0x7f) 60 64 #define AMDM37x_IRC_SIR_IRQ_SPURIOUSIRQFLAG_MASK (0xfffffff8) 61 65 62 ioport32_t sir_fiq;66 const ioport32_t sir_fiq; 63 67 #define AMDM37x_IRC_SIR_FIQ_ACTIVEIRQ_MASK (0x7f) 64 68 #define AMDM37x_IRC_SIR_FIQ_SPURIOUSIRQFLAG_MASK (0xfffffff8) … … 74 78 #define AMDM37x_IRC_IDLE_FUNCIDLE_FLAG (1 << 0) 75 79 #define AMDM37x_IRC_IDLE_TURBO_FLAG (1 << 1) 80 81 uint8_t padd2_[12]; 76 82 77 83 ioport32_t irq_priority; /**< Active IRQ priority */ … … 88 94 #define AMDM37x_IRC_THRESHOLD_PRIORITYTHRESHOLD_DISABLED (0xff) 89 95 90 ioport32_t dummy_[5]; 96 uint8_t padd3__[20]; 97 91 98 struct { 92 ioport32_t itr; /**< Interrupt input status before masking */99 const ioport32_t itr; /**< Interrupt input status before masking */ 93 100 ioport32_t mir; /**< Interrupt mask */ 94 101 ioport32_t mir_clear; /**< Clear mir mask bits */ … … 96 103 ioport32_t isr_set; /**< Set software interrupt bits */ 97 104 ioport32_t isr_clear; /**< Clear software interrupt bits */ 98 ioport32_t pending_irq; /**< IRQ status after masking */99 ioport32_t pending_fiq; /**< FIQ status after masking */105 const ioport32_t pending_irq; /**< IRQ status after masking */ 106 const ioport32_t pending_fiq; /**< FIQ status after masking */ 100 107 } interrupts[3]; 108 109 uint8_t padd4_[32]; 110 101 111 ioport32_t ilr[96]; /**< FIQ/IRQ steering */ 102 112 #define AMDM37x_IRC_ILR_FIQNIRQ (1 << 0) … … 106 116 } amdm37x_irc_regs_t; 107 117 118 static inline void amdm37x_irc_dump(amdm37x_irc_regs_t *regs) 119 { 120 #define DUMP_REG(name) \ 121 printf("%s %p(%x).\n", #name, ®s->name, regs->name); 122 123 DUMP_REG(revision); 124 DUMP_REG(sysconfig); 125 DUMP_REG(sysstatus); 126 DUMP_REG(sir_irq); 127 DUMP_REG(sir_fiq); 128 DUMP_REG(control); 129 DUMP_REG(protection); 130 DUMP_REG(idle); 131 DUMP_REG(irq_priority); 132 DUMP_REG(fiq_priority); 133 DUMP_REG(threshold); 134 135 for (int i = 0; i < 3; ++i) { 136 DUMP_REG(interrupts[i].itr); 137 DUMP_REG(interrupts[i].mir); 138 DUMP_REG(interrupts[i].isr_set); 139 DUMP_REG(interrupts[i].pending_irq); 140 DUMP_REG(interrupts[i].pending_fiq); 141 } 142 for (int i = 0; i < AMDM37x_IRC_IRQ_COUNT; ++i) { 143 DUMP_REG(ilr[i]); 144 } 145 146 #undef DUMP_REG 147 } 148 108 149 109 150 static inline void amdm37x_irc_init(amdm37x_irc_regs_t *regs) 110 151 { 111 152 /* AMDM37x TRM sec 12.5.1 p. 2425 */ 112 113 153 /* Program system config register */ 114 154 //TODO enable this when you know the meaning
Note:
See TracChangeset
for help on using the changeset viewer.