root / hw / exynos4210.h @ 0cdd3d14
History | View | Annotate | Download (4.6 kB)
1 | 8e03cf1e | Evgeny Voevodin | /*
|
---|---|---|---|
2 | 8e03cf1e | Evgeny Voevodin | * Samsung exynos4210 SoC emulation
|
3 | 8e03cf1e | Evgeny Voevodin | *
|
4 | 8e03cf1e | Evgeny Voevodin | * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
|
5 | 8e03cf1e | Evgeny Voevodin | * Maksim Kozlov <m.kozlov@samsung.com>
|
6 | 8e03cf1e | Evgeny Voevodin | * Evgeny Voevodin <e.voevodin@samsung.com>
|
7 | 8e03cf1e | Evgeny Voevodin | * Igor Mitsyanko <i.mitsyanko@samsung.com>
|
8 | 8e03cf1e | Evgeny Voevodin | *
|
9 | 8e03cf1e | Evgeny Voevodin | *
|
10 | 8e03cf1e | Evgeny Voevodin | * This program is free software; you can redistribute it and/or modify it
|
11 | 8e03cf1e | Evgeny Voevodin | * under the terms of the GNU General Public License as published by the
|
12 | 8e03cf1e | Evgeny Voevodin | * Free Software Foundation; either version 2 of the License, or
|
13 | 8e03cf1e | Evgeny Voevodin | * (at your option) any later version.
|
14 | 8e03cf1e | Evgeny Voevodin | *
|
15 | 8e03cf1e | Evgeny Voevodin | * This program is distributed in the hope that it will be useful, but WITHOUT
|
16 | 8e03cf1e | Evgeny Voevodin | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
17 | 8e03cf1e | Evgeny Voevodin | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
18 | 8e03cf1e | Evgeny Voevodin | * for more details.
|
19 | 8e03cf1e | Evgeny Voevodin | *
|
20 | 8e03cf1e | Evgeny Voevodin | * You should have received a copy of the GNU General Public License along
|
21 | 8e03cf1e | Evgeny Voevodin | * with this program; if not, see <http://www.gnu.org/licenses/>.
|
22 | 8e03cf1e | Evgeny Voevodin | *
|
23 | 8e03cf1e | Evgeny Voevodin | */
|
24 | 8e03cf1e | Evgeny Voevodin | |
25 | 8e03cf1e | Evgeny Voevodin | |
26 | 8e03cf1e | Evgeny Voevodin | #ifndef EXYNOS4210_H_
|
27 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_H_
|
28 | 8e03cf1e | Evgeny Voevodin | |
29 | 8e03cf1e | Evgeny Voevodin | #include "qemu-common.h" |
30 | 8e03cf1e | Evgeny Voevodin | #include "memory.h" |
31 | 8e03cf1e | Evgeny Voevodin | |
32 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_NCPUS 2 |
33 | 8e03cf1e | Evgeny Voevodin | |
34 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_DRAM0_BASE_ADDR 0x40000000 |
35 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_DRAM1_BASE_ADDR 0xa0000000 |
36 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_DRAM_MAX_SIZE 0x60000000 /* 1.5 GB */ |
37 | 0caa7113 | Evgeny Voevodin | |
38 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_IROM_BASE_ADDR 0x00000000 |
39 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_IROM_SIZE 0x00010000 /* 64 KB */ |
40 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_IROM_MIRROR_BASE_ADDR 0x02000000 |
41 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_IROM_MIRROR_SIZE 0x00010000 /* 64 KB */ |
42 | 0caa7113 | Evgeny Voevodin | |
43 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_IRAM_BASE_ADDR 0x02020000 |
44 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_IRAM_SIZE 0x00020000 /* 128 KB */ |
45 | 0caa7113 | Evgeny Voevodin | |
46 | 0caa7113 | Evgeny Voevodin | /* Secondary CPU startup code is in IROM memory */
|
47 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_SMP_BOOT_ADDR EXYNOS4210_IROM_BASE_ADDR
|
48 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_SMP_BOOT_SIZE 0x1000 |
49 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_BASE_BOOT_ADDR EXYNOS4210_DRAM0_BASE_ADDR
|
50 | 0caa7113 | Evgeny Voevodin | /* Secondary CPU polling address to get loader start from */
|
51 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_SECOND_CPU_BOOTREG 0x10020814 |
52 | 0caa7113 | Evgeny Voevodin | |
53 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_SMP_PRIVATE_BASE_ADDR 0x10500000 |
54 | 0caa7113 | Evgeny Voevodin | #define EXYNOS4210_L2X0_BASE_ADDR 0x10502000 |
55 | 0caa7113 | Evgeny Voevodin | |
56 | 8e03cf1e | Evgeny Voevodin | /*
|
57 | 8e03cf1e | Evgeny Voevodin | * exynos4210 IRQ subsystem stub definitions.
|
58 | 8e03cf1e | Evgeny Voevodin | */
|
59 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_IRQ_GATE_NINPUTS 8 |
60 | 8e03cf1e | Evgeny Voevodin | |
61 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_MAX_INT_COMBINER_OUT_IRQ 64 |
62 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_MAX_EXT_COMBINER_OUT_IRQ 16 |
63 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_MAX_INT_COMBINER_IN_IRQ \
|
64 | 8e03cf1e | Evgeny Voevodin | (EXYNOS4210_MAX_INT_COMBINER_OUT_IRQ * 8)
|
65 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ \
|
66 | 8e03cf1e | Evgeny Voevodin | (EXYNOS4210_MAX_EXT_COMBINER_OUT_IRQ * 8)
|
67 | 8e03cf1e | Evgeny Voevodin | |
68 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_COMBINER_GET_IRQ_NUM(grp, bit) ((grp)*8 + (bit)) |
69 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_COMBINER_GET_GRP_NUM(irq) ((irq) / 8) |
70 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_COMBINER_GET_BIT_NUM(irq) \
|
71 | 8e03cf1e | Evgeny Voevodin | ((irq) - 8 * EXYNOS4210_COMBINER_GET_GRP_NUM(irq))
|
72 | 8e03cf1e | Evgeny Voevodin | |
73 | 8e03cf1e | Evgeny Voevodin | /* IRQs number for external and internal GIC */
|
74 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_EXT_GIC_NIRQ (160-32) |
75 | 8e03cf1e | Evgeny Voevodin | #define EXYNOS4210_INT_GIC_NIRQ 64 |
76 | 8e03cf1e | Evgeny Voevodin | |
77 | 8e03cf1e | Evgeny Voevodin | typedef struct Exynos4210Irq { |
78 | 8e03cf1e | Evgeny Voevodin | qemu_irq int_combiner_irq[EXYNOS4210_MAX_INT_COMBINER_IN_IRQ]; |
79 | 8e03cf1e | Evgeny Voevodin | qemu_irq ext_combiner_irq[EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ]; |
80 | 8e03cf1e | Evgeny Voevodin | qemu_irq int_gic_irq[EXYNOS4210_INT_GIC_NIRQ]; |
81 | 8e03cf1e | Evgeny Voevodin | qemu_irq ext_gic_irq[EXYNOS4210_EXT_GIC_NIRQ]; |
82 | 8e03cf1e | Evgeny Voevodin | qemu_irq board_irqs[EXYNOS4210_MAX_INT_COMBINER_IN_IRQ]; |
83 | 8e03cf1e | Evgeny Voevodin | } Exynos4210Irq; |
84 | 8e03cf1e | Evgeny Voevodin | |
85 | 0caa7113 | Evgeny Voevodin | typedef struct Exynos4210State { |
86 | 5ae93306 | Andreas Färber | CPUARMState * env[EXYNOS4210_NCPUS]; |
87 | 0caa7113 | Evgeny Voevodin | Exynos4210Irq irqs; |
88 | 0caa7113 | Evgeny Voevodin | qemu_irq *irq_table; |
89 | 0caa7113 | Evgeny Voevodin | |
90 | 0caa7113 | Evgeny Voevodin | MemoryRegion chipid_mem; |
91 | 0caa7113 | Evgeny Voevodin | MemoryRegion iram_mem; |
92 | 0caa7113 | Evgeny Voevodin | MemoryRegion irom_mem; |
93 | 0caa7113 | Evgeny Voevodin | MemoryRegion irom_alias_mem; |
94 | 0caa7113 | Evgeny Voevodin | MemoryRegion dram0_mem; |
95 | 0caa7113 | Evgeny Voevodin | MemoryRegion dram1_mem; |
96 | 0caa7113 | Evgeny Voevodin | MemoryRegion boot_secondary; |
97 | 0caa7113 | Evgeny Voevodin | MemoryRegion bootreg_mem; |
98 | 0caa7113 | Evgeny Voevodin | } Exynos4210State; |
99 | 0caa7113 | Evgeny Voevodin | |
100 | 3f088e36 | Evgeny Voevodin | void exynos4210_write_secondary(CPUARMState *env,
|
101 | 3f088e36 | Evgeny Voevodin | const struct arm_boot_info *info); |
102 | 3f088e36 | Evgeny Voevodin | |
103 | 0caa7113 | Evgeny Voevodin | Exynos4210State *exynos4210_init(MemoryRegion *system_mem, |
104 | 0caa7113 | Evgeny Voevodin | unsigned long ram_size); |
105 | 0caa7113 | Evgeny Voevodin | |
106 | 8e03cf1e | Evgeny Voevodin | /* Initialize exynos4210 IRQ subsystem stub */
|
107 | 8e03cf1e | Evgeny Voevodin | qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); |
108 | 8e03cf1e | Evgeny Voevodin | |
109 | 8e03cf1e | Evgeny Voevodin | /* Initialize board IRQs.
|
110 | 8e03cf1e | Evgeny Voevodin | * These IRQs contain splitted Int/External Combiner and External Gic IRQs */
|
111 | 8e03cf1e | Evgeny Voevodin | void exynos4210_init_board_irqs(Exynos4210Irq *s);
|
112 | 8e03cf1e | Evgeny Voevodin | |
113 | 8e03cf1e | Evgeny Voevodin | /* Get IRQ number from exynos4210 IRQ subsystem stub.
|
114 | 8e03cf1e | Evgeny Voevodin | * To identify IRQ source use internal combiner group and bit number
|
115 | 8e03cf1e | Evgeny Voevodin | * grp - group number
|
116 | 8e03cf1e | Evgeny Voevodin | * bit - bit number inside group */
|
117 | 8e03cf1e | Evgeny Voevodin | uint32_t exynos4210_get_irq(uint32_t grp, uint32_t bit); |
118 | 8e03cf1e | Evgeny Voevodin | |
119 | 8e03cf1e | Evgeny Voevodin | /*
|
120 | 8e03cf1e | Evgeny Voevodin | * Get Combiner input GPIO into irqs structure
|
121 | 8e03cf1e | Evgeny Voevodin | */
|
122 | 8e03cf1e | Evgeny Voevodin | void exynos4210_combiner_get_gpioin(Exynos4210Irq *irqs, DeviceState *dev,
|
123 | 8e03cf1e | Evgeny Voevodin | int ext);
|
124 | 8e03cf1e | Evgeny Voevodin | |
125 | e5a4914e | Maksim Kozlov | /*
|
126 | e5a4914e | Maksim Kozlov | * exynos4210 UART
|
127 | e5a4914e | Maksim Kozlov | */
|
128 | e5a4914e | Maksim Kozlov | DeviceState *exynos4210_uart_create(target_phys_addr_t addr, |
129 | e5a4914e | Maksim Kozlov | int fifo_size,
|
130 | e5a4914e | Maksim Kozlov | int channel,
|
131 | e5a4914e | Maksim Kozlov | CharDriverState *chr, |
132 | e5a4914e | Maksim Kozlov | qemu_irq irq); |
133 | e5a4914e | Maksim Kozlov | |
134 | 8e03cf1e | Evgeny Voevodin | #endif /* EXYNOS4210_H_ */ |