Rev 1909 | Rev 1946 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1909 | Rev 1910 | ||
---|---|---|---|
Line 52... | Line 52... | ||
52 | /** |
52 | /** |
53 | * I suspect this must be hardcoded in the FHC. |
53 | * I suspect this must be hardcoded in the FHC. |
54 | * If it is not, than we can read all IMAP registers |
54 | * If it is not, than we can read all IMAP registers |
55 | * and get the complete mapping. |
55 | * and get the complete mapping. |
56 | */ |
56 | */ |
57 | #define FHC_UART_INO 0x39 |
57 | #define FHC_UART_INR 0x39 |
58 | 58 | ||
59 | #define FHC_UART_IMAP 0x0 |
59 | #define FHC_UART_IMAP 0x0 |
60 | #define FHC_UART_ICLR 0x4 |
60 | #define FHC_UART_ICLR 0x4 |
61 | 61 | ||
62 | #define UART_IMAP_REG 4 |
62 | #define UART_IMAP_REG 4 |
Line 88... | Line 88... | ||
88 | fhc->uart_imap = (uint32_t *) hw_map(paddr, reg->size); |
88 | fhc->uart_imap = (uint32_t *) hw_map(paddr, reg->size); |
89 | 89 | ||
90 | return fhc; |
90 | return fhc; |
91 | } |
91 | } |
92 | 92 | ||
93 | void fhc_enable_interrupt(fhc_t *fhc, int ino) |
93 | void fhc_enable_interrupt(fhc_t *fhc, int inr) |
94 | { |
94 | { |
95 | switch (ino) { |
95 | switch (inr) { |
96 | case FHC_UART_INO: |
96 | case FHC_UART_INR: |
97 | fhc->uart_imap[FHC_UART_ICLR] = 0x0; |
97 | fhc->uart_imap[FHC_UART_ICLR] = 0x0; |
98 | fhc->uart_imap[FHC_UART_IMAP] = 0x80000000; |
98 | fhc->uart_imap[FHC_UART_IMAP] = 0x80000000; |
99 | break; |
99 | break; |
100 | default: |
100 | default: |
101 | panic("Unexpected INO (%d)\n", ino); |
101 | panic("Unexpected INR (%d)\n", inr); |
102 | break; |
102 | break; |
103 | } |
103 | } |
104 | } |
104 | } |
105 | 105 | ||
106 | void fhc_clear_interrupt(fhc_t *fhc, int ino) |
106 | void fhc_clear_interrupt(fhc_t *fhc, int inr) |
107 | { |
107 | { |
108 | ASSERT(fhc->uart_imap); |
108 | ASSERT(fhc->uart_imap); |
109 | 109 | ||
110 | switch (ino) { |
110 | switch (inr) { |
111 | case FHC_UART_INO: |
111 | case FHC_UART_INR: |
112 | fhc->uart_imap[FHC_UART_ICLR] = 0; |
112 | fhc->uart_imap[FHC_UART_ICLR] = 0; |
113 | break; |
113 | break; |
114 | default: |
114 | default: |
115 | panic("Unexpected INO (%d)\n", ino); |
115 | panic("Unexpected INR (%d)\n", inr); |
116 | break; |
116 | break; |
117 | } |
117 | } |
118 | } |
118 | } |
119 | 119 | ||
120 | /** @} |
120 | /** @} |