2 * Texas Instruments OMAP processors.
4 * Copyright (C) 2006-2008 Andrzej Zaborowski <balrog@zabor.org>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 or
9 * (at your option) version 3 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, see <http://www.gnu.org/licenses/>.
23 #include "exec/memory.h"
24 #include "target/arm/cpu-qom.h"
26 #include "qom/object.h"
28 # define OMAP_EMIFS_BASE 0x00000000
29 # define OMAP_CS0_BASE 0x00000000
30 # define OMAP_CS1_BASE 0x04000000
31 # define OMAP_CS2_BASE 0x08000000
32 # define OMAP_CS3_BASE 0x0c000000
33 # define OMAP_EMIFF_BASE 0x10000000
34 # define OMAP_IMIF_BASE 0x20000000
35 # define OMAP_LOCALBUS_BASE 0x30000000
36 # define OMAP_MPUI_BASE 0xe1000000
38 # define OMAP730_SRAM_SIZE 0x00032000
39 # define OMAP15XX_SRAM_SIZE 0x00030000
40 # define OMAP16XX_SRAM_SIZE 0x00004000
41 # define OMAP1611_SRAM_SIZE 0x0003e800
42 # define OMAP_CS0_SIZE 0x04000000
43 # define OMAP_CS1_SIZE 0x04000000
44 # define OMAP_CS2_SIZE 0x04000000
45 # define OMAP_CS3_SIZE 0x04000000
48 struct omap_mpu_state_s
;
49 typedef struct clk
*omap_clk
;
50 omap_clk
omap_findclk(struct omap_mpu_state_s
*mpu
, const char *name
);
51 void omap_clk_init(struct omap_mpu_state_s
*mpu
);
52 void omap_clk_adduser(struct clk
*clk
, qemu_irq user
);
53 void omap_clk_get(omap_clk clk
);
54 void omap_clk_put(omap_clk clk
);
55 void omap_clk_onoff(omap_clk clk
, int on
);
56 void omap_clk_canidle(omap_clk clk
, int can
);
57 void omap_clk_setrate(omap_clk clk
, int divide
, int multiply
);
58 int64_t omap_clk_getrate(omap_clk clk
);
59 void omap_clk_reparent(omap_clk clk
, omap_clk parent
);
62 #define TYPE_OMAP_INTC "omap-intc"
63 typedef struct OMAPIntcState OMAPIntcState
;
64 DECLARE_INSTANCE_CHECKER(OMAPIntcState
, OMAP_INTC
, TYPE_OMAP_INTC
)
68 * TODO: Ideally we should have a clock framework that
69 * let us wire these clocks up with QOM properties or links.
71 * qdev should support a generic means of defining a 'port' with
72 * an arbitrary interface for connecting two devices. Then we
73 * could reframe the omap clock API in terms of clock ports,
74 * and get some type safety. For now the best qdev provides is
75 * passing an arbitrary pointer.
76 * (It's not possible to pass in the string which is the clock
77 * name, because this device does not have the necessary information
78 * (ie the struct omap_mpu_state_s*) to do the clockname to pointer
81 void omap_intc_set_iclk(OMAPIntcState
*intc
, omap_clk clk
);
82 void omap_intc_set_fclk(OMAPIntcState
*intc
, omap_clk clk
);
85 #define TYPE_OMAP_I2C "omap_i2c"
86 OBJECT_DECLARE_SIMPLE_TYPE(OMAPI2CState
, OMAP_I2C
)
89 /* TODO: clock framework (see above) */
90 void omap_i2c_set_iclk(OMAPI2CState
*i2c
, omap_clk clk
);
91 void omap_i2c_set_fclk(OMAPI2CState
*i2c
, omap_clk clk
);
94 #define TYPE_OMAP1_GPIO "omap-gpio"
95 typedef struct Omap1GpioState Omap1GpioState
;
96 DECLARE_INSTANCE_CHECKER(Omap1GpioState
, OMAP1_GPIO
,
99 /* TODO: clock framework (see above) */
100 void omap_gpio_set_clk(Omap1GpioState
*gpio
, omap_clk clk
);
103 * Common IRQ numbers for level 1 interrupt handler
104 * See /usr/include/asm-arm/arch-omap/irqs.h in Linux.
106 # define OMAP_INT_CAMERA 1
107 # define OMAP_INT_FIQ 3
108 # define OMAP_INT_RTDX 6
109 # define OMAP_INT_DSP_MMU_ABORT 7
110 # define OMAP_INT_HOST 8
111 # define OMAP_INT_ABORT 9
112 # define OMAP_INT_BRIDGE_PRIV 13
113 # define OMAP_INT_GPIO_BANK1 14
114 # define OMAP_INT_UART3 15
115 # define OMAP_INT_TIMER3 16
116 # define OMAP_INT_DMA_CH0_6 19
117 # define OMAP_INT_DMA_CH1_7 20
118 # define OMAP_INT_DMA_CH2_8 21
119 # define OMAP_INT_DMA_CH3 22
120 # define OMAP_INT_DMA_CH4 23
121 # define OMAP_INT_DMA_CH5 24
122 # define OMAP_INT_DMA_LCD 25
123 # define OMAP_INT_TIMER1 26
124 # define OMAP_INT_WD_TIMER 27
125 # define OMAP_INT_BRIDGE_PUB 28
126 # define OMAP_INT_TIMER2 30
127 # define OMAP_INT_LCD_CTRL 31
130 * Common OMAP-15xx IRQ numbers for level 1 interrupt handler
132 # define OMAP_INT_15XX_IH2_IRQ 0
133 # define OMAP_INT_15XX_LB_MMU 17
134 # define OMAP_INT_15XX_LOCAL_BUS 29
137 * OMAP-1510 specific IRQ numbers for level 1 interrupt handler
139 # define OMAP_INT_1510_SPI_TX 4
140 # define OMAP_INT_1510_SPI_RX 5
141 # define OMAP_INT_1510_DSP_MAILBOX1 10
142 # define OMAP_INT_1510_DSP_MAILBOX2 11
145 * OMAP-310 specific IRQ numbers for level 1 interrupt handler
147 # define OMAP_INT_310_McBSP2_TX 4
148 # define OMAP_INT_310_McBSP2_RX 5
149 # define OMAP_INT_310_HSB_MAILBOX1 12
150 # define OMAP_INT_310_HSAB_MMU 18
153 * OMAP-1610 specific IRQ numbers for level 1 interrupt handler
155 # define OMAP_INT_1610_IH2_IRQ 0
156 # define OMAP_INT_1610_IH2_FIQ 2
157 # define OMAP_INT_1610_McBSP2_TX 4
158 # define OMAP_INT_1610_McBSP2_RX 5
159 # define OMAP_INT_1610_DSP_MAILBOX1 10
160 # define OMAP_INT_1610_DSP_MAILBOX2 11
161 # define OMAP_INT_1610_LCD_LINE 12
162 # define OMAP_INT_1610_GPTIMER1 17
163 # define OMAP_INT_1610_GPTIMER2 18
164 # define OMAP_INT_1610_SSR_FIFO_0 29
167 * OMAP-730 specific IRQ numbers for level 1 interrupt handler
169 # define OMAP_INT_730_IH2_FIQ 0
170 # define OMAP_INT_730_IH2_IRQ 1
171 # define OMAP_INT_730_USB_NON_ISO 2
172 # define OMAP_INT_730_USB_ISO 3
173 # define OMAP_INT_730_ICR 4
174 # define OMAP_INT_730_EAC 5
175 # define OMAP_INT_730_GPIO_BANK1 6
176 # define OMAP_INT_730_GPIO_BANK2 7
177 # define OMAP_INT_730_GPIO_BANK3 8
178 # define OMAP_INT_730_McBSP2TX 10
179 # define OMAP_INT_730_McBSP2RX 11
180 # define OMAP_INT_730_McBSP2RX_OVF 12
181 # define OMAP_INT_730_LCD_LINE 14
182 # define OMAP_INT_730_GSM_PROTECT 15
183 # define OMAP_INT_730_TIMER3 16
184 # define OMAP_INT_730_GPIO_BANK5 17
185 # define OMAP_INT_730_GPIO_BANK6 18
186 # define OMAP_INT_730_SPGIO_WR 29
189 * Common IRQ numbers for level 2 interrupt handler
191 # define OMAP_INT_KEYBOARD 1
192 # define OMAP_INT_uWireTX 2
193 # define OMAP_INT_uWireRX 3
194 # define OMAP_INT_I2C 4
195 # define OMAP_INT_MPUIO 5
196 # define OMAP_INT_USB_HHC_1 6
197 # define OMAP_INT_McBSP3TX 10
198 # define OMAP_INT_McBSP3RX 11
199 # define OMAP_INT_McBSP1TX 12
200 # define OMAP_INT_McBSP1RX 13
201 # define OMAP_INT_UART1 14
202 # define OMAP_INT_UART2 15
203 # define OMAP_INT_USB_W2FC 20
204 # define OMAP_INT_1WIRE 21
205 # define OMAP_INT_OS_TIMER 22
206 # define OMAP_INT_OQN 23
207 # define OMAP_INT_GAUGE_32K 24
208 # define OMAP_INT_RTC_TIMER 25
209 # define OMAP_INT_RTC_ALARM 26
210 # define OMAP_INT_DSP_MMU 28
213 * OMAP-1510 specific IRQ numbers for level 2 interrupt handler
215 # define OMAP_INT_1510_BT_MCSI1TX 16
216 # define OMAP_INT_1510_BT_MCSI1RX 17
217 # define OMAP_INT_1510_SoSSI_MATCH 19
218 # define OMAP_INT_1510_MEM_STICK 27
219 # define OMAP_INT_1510_COM_SPI_RO 31
222 * OMAP-310 specific IRQ numbers for level 2 interrupt handler
224 # define OMAP_INT_310_FAC 0
225 # define OMAP_INT_310_USB_HHC_2 7
226 # define OMAP_INT_310_MCSI1_FE 16
227 # define OMAP_INT_310_MCSI2_FE 17
228 # define OMAP_INT_310_USB_W2FC_ISO 29
229 # define OMAP_INT_310_USB_W2FC_NON_ISO 30
230 # define OMAP_INT_310_McBSP2RX_OF 31
233 * OMAP-1610 specific IRQ numbers for level 2 interrupt handler
235 # define OMAP_INT_1610_FAC 0
236 # define OMAP_INT_1610_USB_HHC_2 7
237 # define OMAP_INT_1610_USB_OTG 8
238 # define OMAP_INT_1610_SoSSI 9
239 # define OMAP_INT_1610_BT_MCSI1TX 16
240 # define OMAP_INT_1610_BT_MCSI1RX 17
241 # define OMAP_INT_1610_SoSSI_MATCH 19
242 # define OMAP_INT_1610_MEM_STICK 27
243 # define OMAP_INT_1610_McBSP2RX_OF 31
244 # define OMAP_INT_1610_STI 32
245 # define OMAP_INT_1610_STI_WAKEUP 33
246 # define OMAP_INT_1610_GPTIMER3 34
247 # define OMAP_INT_1610_GPTIMER4 35
248 # define OMAP_INT_1610_GPTIMER5 36
249 # define OMAP_INT_1610_GPTIMER6 37
250 # define OMAP_INT_1610_GPTIMER7 38
251 # define OMAP_INT_1610_GPTIMER8 39
252 # define OMAP_INT_1610_GPIO_BANK2 40
253 # define OMAP_INT_1610_GPIO_BANK3 41
254 # define OMAP_INT_1610_MMC2 42
255 # define OMAP_INT_1610_CF 43
256 # define OMAP_INT_1610_WAKE_UP_REQ 46
257 # define OMAP_INT_1610_GPIO_BANK4 48
258 # define OMAP_INT_1610_SPI 49
259 # define OMAP_INT_1610_DMA_CH6 53
260 # define OMAP_INT_1610_DMA_CH7 54
261 # define OMAP_INT_1610_DMA_CH8 55
262 # define OMAP_INT_1610_DMA_CH9 56
263 # define OMAP_INT_1610_DMA_CH10 57
264 # define OMAP_INT_1610_DMA_CH11 58
265 # define OMAP_INT_1610_DMA_CH12 59
266 # define OMAP_INT_1610_DMA_CH13 60
267 # define OMAP_INT_1610_DMA_CH14 61
268 # define OMAP_INT_1610_DMA_CH15 62
269 # define OMAP_INT_1610_NAND 63
272 * OMAP-730 specific IRQ numbers for level 2 interrupt handler
274 # define OMAP_INT_730_HW_ERRORS 0
275 # define OMAP_INT_730_NFIQ_PWR_FAIL 1
276 # define OMAP_INT_730_CFCD 2
277 # define OMAP_INT_730_CFIREQ 3
278 # define OMAP_INT_730_I2C 4
279 # define OMAP_INT_730_PCC 5
280 # define OMAP_INT_730_MPU_EXT_NIRQ 6
281 # define OMAP_INT_730_SPI_100K_1 7
282 # define OMAP_INT_730_SYREN_SPI 8
283 # define OMAP_INT_730_VLYNQ 9
284 # define OMAP_INT_730_GPIO_BANK4 10
285 # define OMAP_INT_730_McBSP1TX 11
286 # define OMAP_INT_730_McBSP1RX 12
287 # define OMAP_INT_730_McBSP1RX_OF 13
288 # define OMAP_INT_730_UART_MODEM_IRDA_2 14
289 # define OMAP_INT_730_UART_MODEM_1 15
290 # define OMAP_INT_730_MCSI 16
291 # define OMAP_INT_730_uWireTX 17
292 # define OMAP_INT_730_uWireRX 18
293 # define OMAP_INT_730_SMC_CD 19
294 # define OMAP_INT_730_SMC_IREQ 20
295 # define OMAP_INT_730_HDQ_1WIRE 21
296 # define OMAP_INT_730_TIMER32K 22
297 # define OMAP_INT_730_MMC_SDIO 23
298 # define OMAP_INT_730_UPLD 24
299 # define OMAP_INT_730_USB_HHC_1 27
300 # define OMAP_INT_730_USB_HHC_2 28
301 # define OMAP_INT_730_USB_GENI 29
302 # define OMAP_INT_730_USB_OTG 30
303 # define OMAP_INT_730_CAMERA_IF 31
304 # define OMAP_INT_730_RNG 32
305 # define OMAP_INT_730_DUAL_MODE_TIMER 33
306 # define OMAP_INT_730_DBB_RF_EN 34
307 # define OMAP_INT_730_MPUIO_KEYPAD 35
308 # define OMAP_INT_730_SHA1_MD5 36
309 # define OMAP_INT_730_SPI_100K_2 37
310 # define OMAP_INT_730_RNG_IDLE 38
311 # define OMAP_INT_730_MPUIO 39
312 # define OMAP_INT_730_LLPC_LCD_CTRL_OFF 40
313 # define OMAP_INT_730_LLPC_OE_FALLING 41
314 # define OMAP_INT_730_LLPC_OE_RISING 42
315 # define OMAP_INT_730_LLPC_VSYNC 43
316 # define OMAP_INT_730_WAKE_UP_REQ 46
317 # define OMAP_INT_730_DMA_CH6 53
318 # define OMAP_INT_730_DMA_CH7 54
319 # define OMAP_INT_730_DMA_CH8 55
320 # define OMAP_INT_730_DMA_CH9 56
321 # define OMAP_INT_730_DMA_CH10 57
322 # define OMAP_INT_730_DMA_CH11 58
323 # define OMAP_INT_730_DMA_CH12 59
324 # define OMAP_INT_730_DMA_CH13 60
325 # define OMAP_INT_730_DMA_CH14 61
326 # define OMAP_INT_730_DMA_CH15 62
327 # define OMAP_INT_730_NAND 63
330 enum omap_dma_model
{
337 struct soc_dma_s
*omap_dma_init(hwaddr base
, qemu_irq
*irqs
,
338 MemoryRegion
*sysmem
,
339 qemu_irq lcd_irq
, struct omap_mpu_state_s
*mpu
, omap_clk clk
,
340 enum omap_dma_model model
);
341 struct soc_dma_s
*omap_dma4_init(hwaddr base
, qemu_irq
*irqs
,
342 MemoryRegion
*sysmem
,
343 struct omap_mpu_state_s
*mpu
, int fifo
,
344 int chans
, omap_clk iclk
, omap_clk fclk
);
345 void omap_dma_reset(struct soc_dma_s
*s
);
352 /* Only used in OMAP DMA 3.x gigacells */
356 imif
, /* omap16xx: ocp_t1 */
358 local
, /* omap16xx: ocp_t2 */
360 __omap_dma_port_last
,
368 } omap_dma_addressing_t
;
370 /* Only used in OMAP DMA 3.x gigacells */
371 struct omap_dma_lcd_channel_s
{
372 enum omap_dma_port src
;
374 hwaddr src_f1_bottom
;
376 hwaddr src_f2_bottom
;
378 /* Used in OMAP DMA 3.2 gigacell */
379 unsigned char brust_f1
;
380 unsigned char pack_f1
;
381 unsigned char data_type_f1
;
382 unsigned char brust_f2
;
383 unsigned char pack_f2
;
384 unsigned char data_type_f2
;
385 unsigned char end_prog
;
386 unsigned char repeat
;
387 unsigned char auto_init
;
388 unsigned char priority
;
390 unsigned char running
;
392 unsigned char omap_3_1_compatible_disable
;
394 unsigned char lch_type
;
395 int16_t element_index_f1
;
396 int16_t element_index_f2
;
397 int32_t frame_index_f1
;
398 int32_t frame_index_f2
;
399 uint16_t elements_f1
;
401 uint16_t elements_f2
;
403 omap_dma_addressing_t mode_f1
;
404 omap_dma_addressing_t mode_f2
;
406 /* Destination port is fixed. */
412 hwaddr phys_framebuffer
[2];
414 struct omap_mpu_state_s
*mpu
;
415 } *omap_dma_get_lcdch(struct soc_dma_s
*s
);
418 * DMA request numbers for OMAP1
419 * See /usr/include/asm-arm/arch-omap/dma.h in Linux.
421 # define OMAP_DMA_NO_DEVICE 0
422 # define OMAP_DMA_MCSI1_TX 1
423 # define OMAP_DMA_MCSI1_RX 2
424 # define OMAP_DMA_I2C_RX 3
425 # define OMAP_DMA_I2C_TX 4
426 # define OMAP_DMA_EXT_NDMA_REQ0 5
427 # define OMAP_DMA_EXT_NDMA_REQ1 6
428 # define OMAP_DMA_UWIRE_TX 7
429 # define OMAP_DMA_MCBSP1_TX 8
430 # define OMAP_DMA_MCBSP1_RX 9
431 # define OMAP_DMA_MCBSP3_TX 10
432 # define OMAP_DMA_MCBSP3_RX 11
433 # define OMAP_DMA_UART1_TX 12
434 # define OMAP_DMA_UART1_RX 13
435 # define OMAP_DMA_UART2_TX 14
436 # define OMAP_DMA_UART2_RX 15
437 # define OMAP_DMA_MCBSP2_TX 16
438 # define OMAP_DMA_MCBSP2_RX 17
439 # define OMAP_DMA_UART3_TX 18
440 # define OMAP_DMA_UART3_RX 19
441 # define OMAP_DMA_CAMERA_IF_RX 20
442 # define OMAP_DMA_MMC_TX 21
443 # define OMAP_DMA_MMC_RX 22
444 # define OMAP_DMA_NAND 23 /* Not in OMAP310 */
445 # define OMAP_DMA_IRQ_LCD_LINE 24 /* Not in OMAP310 */
446 # define OMAP_DMA_MEMORY_STICK 25 /* Not in OMAP310 */
447 # define OMAP_DMA_USB_W2FC_RX0 26
448 # define OMAP_DMA_USB_W2FC_RX1 27
449 # define OMAP_DMA_USB_W2FC_RX2 28
450 # define OMAP_DMA_USB_W2FC_TX0 29
451 # define OMAP_DMA_USB_W2FC_TX1 30
452 # define OMAP_DMA_USB_W2FC_TX2 31
454 /* These are only for 1610 */
455 # define OMAP_DMA_CRYPTO_DES_IN 32
456 # define OMAP_DMA_SPI_TX 33
457 # define OMAP_DMA_SPI_RX 34
458 # define OMAP_DMA_CRYPTO_HASH 35
459 # define OMAP_DMA_CCP_ATTN 36
460 # define OMAP_DMA_CCP_FIFO_NOT_EMPTY 37
461 # define OMAP_DMA_CMT_APE_TX_CHAN_0 38
462 # define OMAP_DMA_CMT_APE_RV_CHAN_0 39
463 # define OMAP_DMA_CMT_APE_TX_CHAN_1 40
464 # define OMAP_DMA_CMT_APE_RV_CHAN_1 41
465 # define OMAP_DMA_CMT_APE_TX_CHAN_2 42
466 # define OMAP_DMA_CMT_APE_RV_CHAN_2 43
467 # define OMAP_DMA_CMT_APE_TX_CHAN_3 44
468 # define OMAP_DMA_CMT_APE_RV_CHAN_3 45
469 # define OMAP_DMA_CMT_APE_TX_CHAN_4 46
470 # define OMAP_DMA_CMT_APE_RV_CHAN_4 47
471 # define OMAP_DMA_CMT_APE_TX_CHAN_5 48
472 # define OMAP_DMA_CMT_APE_RV_CHAN_5 49
473 # define OMAP_DMA_CMT_APE_TX_CHAN_6 50
474 # define OMAP_DMA_CMT_APE_RV_CHAN_6 51
475 # define OMAP_DMA_CMT_APE_TX_CHAN_7 52
476 # define OMAP_DMA_CMT_APE_RV_CHAN_7 53
477 # define OMAP_DMA_MMC2_TX 54
478 # define OMAP_DMA_MMC2_RX 55
479 # define OMAP_DMA_CRYPTO_DES_OUT 56
482 struct omap_uart_s
*omap_uart_init(hwaddr base
,
483 qemu_irq irq
, omap_clk fclk
, omap_clk iclk
,
484 qemu_irq txdma
, qemu_irq rxdma
,
485 const char *label
, Chardev
*chr
);
486 void omap_uart_reset(struct omap_uart_s
*s
);
489 qemu_irq
*omap_mpuio_in_get(struct omap_mpuio_s
*s
);
490 void omap_mpuio_out_set(struct omap_mpuio_s
*s
, int line
, qemu_irq handler
);
491 void omap_mpuio_key(struct omap_mpuio_s
*s
, int row
, int col
, int down
);
498 /* The CPU can call this if it is generating the clock signal on the
499 * i2s port. The CODEC can ignore it if it is set up as a clock
500 * master and generates its own clock. */
501 void (*set_rate
)(void *opaque
, int in
, int out
);
503 void (*tx_swallow
)(void *opaque
);
520 void omap_mcbsp_i2s_attach(struct omap_mcbsp_s
*s
, I2SCodec
*slave
);
523 struct omap_lcd_panel_s
;
524 void omap_lcdc_reset(struct omap_lcd_panel_s
*s
);
525 struct omap_lcd_panel_s
*omap_lcdc_init(MemoryRegion
*sysmem
,
528 struct omap_dma_lcd_channel_s
*dma
,
533 struct omap_mmc_s
*omap_mmc_init(hwaddr base
,
534 MemoryRegion
*sysmem
,
536 qemu_irq irq
, qemu_irq dma
[], omap_clk clk
);
537 void omap_mmc_reset(struct omap_mmc_s
*s
);
540 I2CBus
*omap_i2c_bus(DeviceState
*omap_i2c
);
542 # define cpu_is_omap310(cpu) (cpu->mpu_model == omap310)
543 # define cpu_is_omap1510(cpu) (cpu->mpu_model == omap1510)
544 # define cpu_is_omap1610(cpu) (cpu->mpu_model == omap1610)
545 # define cpu_is_omap1710(cpu) (cpu->mpu_model == omap1710)
547 # define cpu_is_omap15xx(cpu) \
548 (cpu_is_omap310(cpu) || cpu_is_omap1510(cpu))
549 # define cpu_is_omap16xx(cpu) \
550 (cpu_is_omap1610(cpu) || cpu_is_omap1710(cpu))
552 struct omap_mpu_state_s
{
553 enum omap_mpu_model
{
566 MemoryRegion ulpd_pm_iomem
;
567 MemoryRegion pin_cfg_iomem
;
568 MemoryRegion id_iomem
;
569 MemoryRegion id_iomem_e18
;
570 MemoryRegion id_iomem_ed4
;
571 MemoryRegion id_iomem_e20
;
572 MemoryRegion mpui_iomem
;
573 MemoryRegion tcmi_iomem
;
574 MemoryRegion clkm_iomem
;
575 MemoryRegion clkdsp_iomem
;
576 MemoryRegion mpui_io_iomem
;
577 MemoryRegion tap_iomem
;
578 MemoryRegion imif_ram
;
581 struct omap_dma_port_if_s
{
582 uint32_t (*read
[3])(struct omap_mpu_state_s
*s
,
584 void (*write
[3])(struct omap_mpu_state_s
*s
,
585 hwaddr offset
, uint32_t value
);
586 int (*addr_valid
)(struct omap_mpu_state_s
*s
,
588 } port
[__omap_dma_port_last
];
591 unsigned long sram_size
;
593 /* MPUI-TIPB peripherals */
594 struct omap_uart_s
*uart
[3];
598 struct omap_mcbsp_s
*mcbsp1
;
599 struct omap_mcbsp_s
*mcbsp3
;
601 /* MPU public TIPB peripherals */
602 struct omap_32khz_timer_s
*os_timer
;
604 struct omap_mmc_s
*mmc
;
606 struct omap_mpuio_s
*mpuio
;
608 struct omap_uwire_s
*microwire
;
610 struct omap_pwl_s
*pwl
;
611 struct omap_pwt_s
*pwt
;
614 struct omap_rtc_s
*rtc
;
616 struct omap_mcbsp_s
*mcbsp2
;
618 struct omap_lpg_s
*led
[2];
620 /* MPU private TIPB peripherals */
623 struct soc_dma_s
*dma
;
625 struct omap_mpu_timer_s
*timer
[3];
626 struct omap_watchdog_timer_s
*wdt
;
628 struct omap_lcd_panel_s
*lcd
;
630 uint32_t ulpd_pm_regs
[21];
631 int64_t ulpd_gauge_start
;
633 uint32_t func_mux_ctrl
[14];
634 uint32_t comp_mode_ctrl
[1];
635 uint32_t pull_dwn_ctrl
[4];
636 uint32_t gate_inh_ctrl
[1];
637 uint32_t voltage_ctrl
[1];
638 uint32_t test_dbg_ctrl
[1];
639 uint32_t mod_conf_ctrl
[1];
644 struct omap_tipb_bridge_s
*private_tipb
;
645 struct omap_tipb_bridge_s
*public_tipb
;
647 uint32_t tcmi_regs
[17];
649 struct dpll_ctl_s
*dpll
[3];
656 uint16_t arm_idlect1
;
657 uint16_t arm_idlect2
;
663 uint16_t dsp_idlect1
;
664 uint16_t dsp_idlect2
;
670 struct omap_mpu_state_s
*omap310_mpu_init(MemoryRegion
*sdram
,
673 uint32_t omap_badwidth_read8(void *opaque
, hwaddr addr
);
674 void omap_badwidth_write8(void *opaque
, hwaddr addr
,
676 uint32_t omap_badwidth_read16(void *opaque
, hwaddr addr
);
677 void omap_badwidth_write16(void *opaque
, hwaddr addr
,
679 uint32_t omap_badwidth_read32(void *opaque
, hwaddr addr
);
680 void omap_badwidth_write32(void *opaque
, hwaddr addr
,
683 void omap_mpu_wakeup(void *opaque
, int irq
, int req
);
685 # define OMAP_BAD_REG(paddr) \
686 qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad register %#08"HWADDR_PRIx"\n", \
688 # define OMAP_RO_REG(paddr) \
689 qemu_log_mask(LOG_GUEST_ERROR, "%s: Read-only register %#08" \
693 # define OMAP_MPUI_REG_MASK 0x000007ff