Rev 4651 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4651 | Rev 4669 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (c) 2009 Vineeth Pillai |
2 | * Copyright (c) 2009 Vineeth Pillai |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
8 | * |
8 | * |
9 | * - Redistributions of source code must retain the above copyright |
9 | * - Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * - Redistributions in binary form must reproduce the above copyright |
11 | * - Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
13 | * documentation and/or other materials provided with the distribution. |
14 | * - The name of the author may not be used to endorse or promote products |
14 | * - The name of the author may not be used to endorse or promote products |
15 | * derived from this software without specific prior written permission. |
15 | * derived from this software without specific prior written permission. |
16 | * |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup arm32integratorcp |
29 | /** @addtogroup arm32integratorcp |
30 | * @brief Integratorcp machine specific parts. |
30 | * @brief Integratorcp machine specific parts. |
31 | * @ingroup arm32 |
31 | * @ingroup arm32 |
32 | * @{ |
32 | * @{ |
33 | */ |
33 | */ |
34 | /** @file |
34 | /** @file |
35 | * @brief Integratorcp peripheries drivers declarations. |
35 | * @brief Integratorcp peripheries drivers declarations. |
36 | */ |
36 | */ |
37 | 37 | ||
38 | #ifndef KERN_arm32_ICP_H_ |
38 | #ifndef KERN_arm32_ICP_H_ |
39 | #define KERN_arm32_ICP_H_ |
39 | #define KERN_arm32_ICP_H_ |
40 | 40 | ||
41 | #include <arch/machine_func.h> |
41 | #include <arch/machine_func.h> |
42 | 42 | ||
43 | /** Last interrupt number (beginning from 0) whose status is probed |
43 | /** Last interrupt number (beginning from 0) whose status is probed |
44 | * from interrupt controller |
44 | * from interrupt controller |
45 | */ |
45 | */ |
46 | #define ICP_IRQC_MAX_IRQ 8 |
46 | #define ICP_IRQC_MAX_IRQ 8 |
47 | #define ICP_KBD_IRQ 3 |
47 | #define ICP_KBD_IRQ 3 |
48 | #define ICP_TIMER_IRQ 6 |
48 | #define ICP_TIMER_IRQ 6 |
49 | 49 | ||
50 | /** Timer frequency */ |
50 | /** Timer frequency */ |
51 | #define ICP_TIMER_FREQ 10000 |
51 | #define ICP_TIMER_FREQ 10000 |
52 | 52 | ||
53 | #define ICP_UART 0x16000000 |
53 | #define ICP_UART 0x16000000 |
54 | #define ICP_KBD 0x18000000 |
54 | #define ICP_KBD 0x18000000 |
55 | #define ICP_KBD_STAT 0x04 |
55 | #define ICP_KBD_STAT 0x04 |
56 | #define ICP_KBD_DATA 0x08 |
56 | #define ICP_KBD_DATA 0x08 |
57 | #define ICP_KBD_INTR_STAT 0x10 |
57 | #define ICP_KBD_INTR_STAT 0x10 |
58 | #define ICP_RTC 0x13000000 |
58 | #define ICP_RTC 0x13000000 |
59 | #define ICP_RTC1_LOAD_OFFSET 0x100 |
59 | #define ICP_RTC1_LOAD_OFFSET 0x100 |
60 | #define ICP_RTC1_READ_OFFSET 0x104 |
60 | #define ICP_RTC1_READ_OFFSET 0x104 |
61 | #define ICP_RTC1_CTL_OFFSET 0x108 |
61 | #define ICP_RTC1_CTL_OFFSET 0x108 |
62 | #define ICP_RTC1_INTRCLR_OFFSET 0x10C |
62 | #define ICP_RTC1_INTRCLR_OFFSET 0x10C |
63 | #define ICP_RTC1_INTRSTAT_OFFSET 0x114 |
63 | #define ICP_RTC1_INTRSTAT_OFFSET 0x114 |
64 | #define ICP_RTC1_BGLOAD_OFFSET 0x118 |
64 | #define ICP_RTC1_BGLOAD_OFFSET 0x118 |
65 | #define ICP_RTC_CTL_VALUE 0x00E2 |
65 | #define ICP_RTC_CTL_VALUE 0x00E2 |
66 | #define ICP_IRQC 0x14000000 |
66 | #define ICP_IRQC 0x14000000 |
67 | #define ICP_IRQC_MASK_OFFSET 0xC |
67 | #define ICP_IRQC_MASK_OFFSET 0xC |
68 | #define ICP_IRQC_UNMASK_OFFSET 0x8 |
68 | #define ICP_IRQC_UNMASK_OFFSET 0x8 |
69 | #define ICP_FB 0x00800000 |
69 | #define ICP_FB 0x00800000 |
70 | #define ICP_FB_FRAME (ICP_FB >> 12) |
70 | #define ICP_FB_FRAME (ICP_FB >> 12) |
71 | #define ICP_FB_NUM_FRAME 512 |
71 | #define ICP_FB_NUM_FRAME 512 |
72 | #define ICP_VGA 0xC0000000 |
72 | #define ICP_VGA 0xC0000000 |
73 | #define ICP_CMCR 0x10000000 |
73 | #define ICP_CMCR 0x10000000 |
74 | #define ICP_SDRAM_MASK 0x1C |
74 | #define ICP_SDRAM_MASK 0x1C |
75 | #define ICP_SDRAMCR_OFFSET 0x20 |
75 | #define ICP_SDRAMCR_OFFSET 0x20 |
76 | 76 | ||
77 | typedef struct { |
77 | typedef struct { |
78 | uintptr_t uart; |
78 | uintptr_t uart; |
79 | uintptr_t kbd_ctrl; |
79 | uintptr_t kbd_ctrl; |
80 | uintptr_t kbd_stat; |
80 | uintptr_t kbd_stat; |
81 | uintptr_t kbd_data; |
81 | uintptr_t kbd_data; |
82 | uintptr_t kbd_intstat; |
82 | uintptr_t kbd_intstat; |
83 | uintptr_t rtc; |
83 | uintptr_t rtc; |
84 | uintptr_t rtc1_load; |
84 | uintptr_t rtc1_load; |
85 | uintptr_t rtc1_read; |
85 | uintptr_t rtc1_read; |
86 | uintptr_t rtc1_ctl; |
86 | uintptr_t rtc1_ctl; |
87 | uintptr_t rtc1_intrclr; |
87 | uintptr_t rtc1_intrclr; |
88 | uintptr_t rtc1_intrstat; |
88 | uintptr_t rtc1_intrstat; |
89 | uintptr_t rtc1_bgload; |
89 | uintptr_t rtc1_bgload; |
90 | uintptr_t irqc; |
90 | uintptr_t irqc; |
91 | uintptr_t irqc_mask; |
91 | uintptr_t irqc_mask; |
92 | uintptr_t irqc_unmask; |
92 | uintptr_t irqc_unmask; |
93 | uintptr_t vga; |
93 | uintptr_t vga; |
94 | uintptr_t cmcr; |
94 | uintptr_t cmcr; |
95 | uintptr_t sdramcr; |
95 | uintptr_t sdramcr; |
96 | } icp_hw_map_t; |
96 | } icp_hw_map_t; |
97 | 97 | ||
98 | 98 | ||
99 | extern void icp_init(void); |
99 | extern void icp_init(void); |
100 | extern void icp_fb_init(void); |
100 | extern void icp_fb_init(void); |
101 | extern void icp_output_init(void); |
101 | extern void icp_output_init(void); |
102 | extern void icp_input_init(void); |
102 | extern void icp_input_init(void); |
103 | extern void icp_release_console(void); |
103 | extern void icp_release_console(void); |
104 | extern void icp_grab_console(void); |
104 | extern void icp_grab_console(void); |
105 | extern void icp_timer_irq_start(void); |
105 | extern void icp_timer_irq_start(void); |
106 | extern void icp_cpu_halt(void); |
106 | extern void icp_cpu_halt(void); |
107 | extern void icp_irq_exception(int exc_no, istate_t *istate); |
107 | extern void icp_irq_exception(int exc_no, istate_t *istate); |
108 | extern uintptr_t icp_get_memory_size(void); |
108 | extern uintptr_t icp_get_memory_size(void); |
109 | extern uintptr_t icp_get_fb_address(void); |
109 | extern uintptr_t icp_get_fb_address(void); |
110 | extern void icp_fb_init(void); |
110 | extern void icp_fb_init(void); |
111 | extern void icp_frame_init(void); |
111 | extern void icp_frame_init(void); |
112 | 112 | ||
113 | #endif |
113 | #endif |
114 | 114 | ||
115 | /** @} |
115 | /** @} |
116 | */ |
116 | */ |
117 | 117 |