2007-04-30 05:26:42 +04:00
|
|
|
/*
|
|
|
|
* Intel XScale PXA255/270 processor support.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2006 Openedhand Ltd.
|
|
|
|
* Written by Andrzej Zaborowski <balrog@zabor.org>
|
|
|
|
*
|
2011-06-26 06:21:35 +04:00
|
|
|
* This code is licensed under the GNU GPL v2.
|
2007-04-30 05:26:42 +04:00
|
|
|
*/
|
|
|
|
#ifndef PXA_H
|
|
|
|
# define PXA_H "pxa.h"
|
|
|
|
|
2012-12-17 21:19:49 +04:00
|
|
|
#include "exec/memory.h"
|
2011-08-12 03:07:19 +04:00
|
|
|
|
2007-04-30 05:26:42 +04:00
|
|
|
/* Interrupt numbers */
|
|
|
|
# define PXA2XX_PIC_SSP3 0
|
|
|
|
# define PXA2XX_PIC_USBH2 2
|
|
|
|
# define PXA2XX_PIC_USBH1 3
|
2007-12-16 15:13:51 +03:00
|
|
|
# define PXA2XX_PIC_KEYPAD 4
|
2007-04-30 05:26:42 +04:00
|
|
|
# define PXA2XX_PIC_PWRI2C 6
|
|
|
|
# define PXA25X_PIC_HWUART 7
|
|
|
|
# define PXA27X_PIC_OST_4_11 7
|
|
|
|
# define PXA2XX_PIC_GPIO_0 8
|
|
|
|
# define PXA2XX_PIC_GPIO_1 9
|
|
|
|
# define PXA2XX_PIC_GPIO_X 10
|
|
|
|
# define PXA2XX_PIC_I2S 13
|
|
|
|
# define PXA26X_PIC_ASSP 15
|
|
|
|
# define PXA25X_PIC_NSSP 16
|
|
|
|
# define PXA27X_PIC_SSP2 16
|
|
|
|
# define PXA2XX_PIC_LCD 17
|
|
|
|
# define PXA2XX_PIC_I2C 18
|
|
|
|
# define PXA2XX_PIC_ICP 19
|
|
|
|
# define PXA2XX_PIC_STUART 20
|
|
|
|
# define PXA2XX_PIC_BTUART 21
|
|
|
|
# define PXA2XX_PIC_FFUART 22
|
|
|
|
# define PXA2XX_PIC_MMC 23
|
|
|
|
# define PXA2XX_PIC_SSP 24
|
|
|
|
# define PXA2XX_PIC_DMA 25
|
|
|
|
# define PXA2XX_PIC_OST_0 26
|
|
|
|
# define PXA2XX_PIC_RTC1HZ 30
|
|
|
|
# define PXA2XX_PIC_RTCALARM 31
|
|
|
|
|
|
|
|
/* DMA requests */
|
|
|
|
# define PXA2XX_RX_RQ_I2S 2
|
|
|
|
# define PXA2XX_TX_RQ_I2S 3
|
|
|
|
# define PXA2XX_RX_RQ_BTUART 4
|
|
|
|
# define PXA2XX_TX_RQ_BTUART 5
|
|
|
|
# define PXA2XX_RX_RQ_FFUART 6
|
|
|
|
# define PXA2XX_TX_RQ_FFUART 7
|
|
|
|
# define PXA2XX_RX_RQ_SSP1 13
|
|
|
|
# define PXA2XX_TX_RQ_SSP1 14
|
|
|
|
# define PXA2XX_RX_RQ_SSP2 15
|
|
|
|
# define PXA2XX_TX_RQ_SSP2 16
|
|
|
|
# define PXA2XX_RX_RQ_ICP 17
|
|
|
|
# define PXA2XX_TX_RQ_ICP 18
|
|
|
|
# define PXA2XX_RX_RQ_STUART 19
|
|
|
|
# define PXA2XX_TX_RQ_STUART 20
|
|
|
|
# define PXA2XX_RX_RQ_MMCI 21
|
|
|
|
# define PXA2XX_TX_RQ_MMCI 22
|
|
|
|
# define PXA2XX_USB_RQ(x) ((x) + 24)
|
|
|
|
# define PXA2XX_RX_RQ_SSP3 66
|
|
|
|
# define PXA2XX_TX_RQ_SSP3 67
|
|
|
|
|
2007-05-08 23:03:12 +04:00
|
|
|
# define PXA2XX_SDRAM_BASE 0xa0000000
|
|
|
|
# define PXA2XX_INTERNAL_BASE 0x5c000000
|
2007-05-12 13:19:36 +04:00
|
|
|
# define PXA2XX_INTERNAL_SIZE 0x40000
|
2007-04-30 05:26:42 +04:00
|
|
|
|
|
|
|
/* pxa2xx_pic.c */
|
2012-10-23 14:30:10 +04:00
|
|
|
DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu);
|
2007-04-30 05:26:42 +04:00
|
|
|
|
|
|
|
/* pxa2xx_gpio.c */
|
2012-10-23 14:30:10 +04:00
|
|
|
DeviceState *pxa2xx_gpio_init(hwaddr base,
|
2012-12-17 09:18:02 +04:00
|
|
|
ARMCPU *cpu, DeviceState *pic, int lines);
|
2011-01-21 19:57:50 +03:00
|
|
|
void pxa2xx_gpio_read_notifier(DeviceState *dev, qemu_irq handler);
|
2007-04-30 05:26:42 +04:00
|
|
|
|
|
|
|
/* pxa2xx_dma.c */
|
2012-10-23 14:30:10 +04:00
|
|
|
DeviceState *pxa255_dma_init(hwaddr base, qemu_irq irq);
|
|
|
|
DeviceState *pxa27x_dma_init(hwaddr base, qemu_irq irq);
|
2007-04-30 05:26:42 +04:00
|
|
|
|
2007-04-30 05:48:07 +04:00
|
|
|
/* pxa2xx_lcd.c */
|
2009-05-10 04:44:56 +04:00
|
|
|
typedef struct PXA2xxLCDState PXA2xxLCDState;
|
2011-10-30 17:50:19 +04:00
|
|
|
PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem,
|
2012-10-23 14:30:10 +04:00
|
|
|
hwaddr base, qemu_irq irq);
|
2009-05-10 04:44:56 +04:00
|
|
|
void pxa2xx_lcd_vsync_notifier(PXA2xxLCDState *s, qemu_irq handler);
|
2007-04-30 05:48:07 +04:00
|
|
|
void pxa2xx_lcdc_oritentation(void *opaque, int angle);
|
|
|
|
|
|
|
|
/* pxa2xx_mmci.c */
|
2009-05-10 04:44:56 +04:00
|
|
|
typedef struct PXA2xxMMCIState PXA2xxMMCIState;
|
2011-10-30 17:50:18 +04:00
|
|
|
PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem,
|
2012-10-23 14:30:10 +04:00
|
|
|
hwaddr base,
|
2011-03-03 17:04:51 +03:00
|
|
|
BlockDriverState *bd, qemu_irq irq,
|
|
|
|
qemu_irq rx_dma, qemu_irq tx_dma);
|
2009-05-10 04:44:56 +04:00
|
|
|
void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq readonly,
|
2007-11-17 17:34:44 +03:00
|
|
|
qemu_irq coverswitch);
|
2007-04-30 05:48:07 +04:00
|
|
|
|
|
|
|
/* pxa2xx_pcmcia.c */
|
2009-05-10 04:44:56 +04:00
|
|
|
typedef struct PXA2xxPCMCIAState PXA2xxPCMCIAState;
|
2011-10-30 17:50:12 +04:00
|
|
|
PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem,
|
2012-10-23 14:30:10 +04:00
|
|
|
hwaddr base);
|
2009-05-10 04:44:56 +04:00
|
|
|
int pxa2xx_pcmcia_attach(void *opaque, PCMCIACardState *card);
|
2013-07-17 21:06:47 +04:00
|
|
|
int pxa2xx_pcmcia_detach(void *opaque);
|
2007-04-30 05:48:07 +04:00
|
|
|
void pxa2xx_pcmcia_set_irq_cb(void *opaque, qemu_irq irq, qemu_irq cd_irq);
|
|
|
|
|
2007-12-16 15:13:51 +03:00
|
|
|
/* pxa2xx_keypad.c */
|
|
|
|
struct keymap {
|
2013-12-22 18:32:29 +04:00
|
|
|
int8_t column;
|
|
|
|
int8_t row;
|
2007-12-16 15:13:51 +03:00
|
|
|
};
|
2009-05-10 04:44:56 +04:00
|
|
|
typedef struct PXA2xxKeyPadState PXA2xxKeyPadState;
|
2011-10-30 17:50:15 +04:00
|
|
|
PXA2xxKeyPadState *pxa27x_keypad_init(MemoryRegion *sysmem,
|
2012-10-23 14:30:10 +04:00
|
|
|
hwaddr base,
|
2011-10-30 17:50:15 +04:00
|
|
|
qemu_irq irq);
|
2013-12-22 18:22:57 +04:00
|
|
|
void pxa27x_register_keypad(PXA2xxKeyPadState *kp,
|
|
|
|
const struct keymap *map, int size);
|
2007-12-16 15:13:51 +03:00
|
|
|
|
2007-04-30 05:26:42 +04:00
|
|
|
/* pxa2xx.c */
|
2009-05-10 04:44:56 +04:00
|
|
|
typedef struct PXA2xxI2CState PXA2xxI2CState;
|
2012-10-23 14:30:10 +04:00
|
|
|
PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base,
|
2007-05-28 15:26:15 +04:00
|
|
|
qemu_irq irq, uint32_t page_size);
|
2013-08-03 02:18:51 +04:00
|
|
|
I2CBus *pxa2xx_i2c_bus(PXA2xxI2CState *s);
|
2007-05-24 01:47:51 +04:00
|
|
|
|
2009-05-10 04:44:56 +04:00
|
|
|
typedef struct PXA2xxI2SState PXA2xxI2SState;
|
|
|
|
typedef struct PXA2xxFIrState PXA2xxFIrState;
|
2007-04-30 05:26:42 +04:00
|
|
|
|
2009-05-10 04:44:56 +04:00
|
|
|
typedef struct {
|
2012-05-04 01:47:04 +04:00
|
|
|
ARMCPU *cpu;
|
2011-02-25 14:13:38 +03:00
|
|
|
DeviceState *pic;
|
2007-11-17 17:07:13 +03:00
|
|
|
qemu_irq reset;
|
2011-09-25 19:19:19 +04:00
|
|
|
MemoryRegion sdram;
|
|
|
|
MemoryRegion internal;
|
|
|
|
MemoryRegion cm_iomem;
|
|
|
|
MemoryRegion mm_iomem;
|
|
|
|
MemoryRegion pm_iomem;
|
2011-03-03 17:04:51 +03:00
|
|
|
DeviceState *dma;
|
2011-01-21 19:57:50 +03:00
|
|
|
DeviceState *gpio;
|
2009-05-10 04:44:56 +04:00
|
|
|
PXA2xxLCDState *lcd;
|
2009-05-15 01:35:09 +04:00
|
|
|
SSIBus **ssp;
|
2009-05-10 04:44:56 +04:00
|
|
|
PXA2xxI2CState *i2c[2];
|
|
|
|
PXA2xxMMCIState *mmc;
|
|
|
|
PXA2xxPCMCIAState *pcmcia[2];
|
|
|
|
PXA2xxI2SState *i2s;
|
|
|
|
PXA2xxFIrState *fir;
|
|
|
|
PXA2xxKeyPadState *kp;
|
2007-04-30 05:26:42 +04:00
|
|
|
|
|
|
|
/* Power management */
|
2012-10-23 14:30:10 +04:00
|
|
|
hwaddr pm_base;
|
2007-04-30 05:26:42 +04:00
|
|
|
uint32_t pm_regs[0x40];
|
|
|
|
|
|
|
|
/* Clock management */
|
2012-10-23 14:30:10 +04:00
|
|
|
hwaddr cm_base;
|
2007-04-30 05:26:42 +04:00
|
|
|
uint32_t cm_regs[4];
|
|
|
|
uint32_t clkcfg;
|
|
|
|
|
|
|
|
/* Memory management */
|
2012-10-23 14:30:10 +04:00
|
|
|
hwaddr mm_base;
|
2007-04-30 05:26:42 +04:00
|
|
|
uint32_t mm_regs[0x1a];
|
|
|
|
|
|
|
|
/* Performance monitoring */
|
|
|
|
uint32_t pmnc;
|
2009-05-10 04:44:56 +04:00
|
|
|
} PXA2xxState;
|
2007-04-30 05:26:42 +04:00
|
|
|
|
2009-05-10 04:44:56 +04:00
|
|
|
struct PXA2xxI2SState {
|
2011-09-25 19:19:19 +04:00
|
|
|
MemoryRegion iomem;
|
2007-04-30 05:26:42 +04:00
|
|
|
qemu_irq irq;
|
2011-03-03 17:04:51 +03:00
|
|
|
qemu_irq rx_dma;
|
|
|
|
qemu_irq tx_dma;
|
2007-04-30 05:26:42 +04:00
|
|
|
void (*data_req)(void *, int, int);
|
|
|
|
|
|
|
|
uint32_t control[2];
|
|
|
|
uint32_t status;
|
|
|
|
uint32_t mask;
|
|
|
|
uint32_t clk;
|
|
|
|
|
|
|
|
int enable;
|
|
|
|
int rx_len;
|
|
|
|
int tx_len;
|
|
|
|
void (*codec_out)(void *, uint32_t);
|
|
|
|
uint32_t (*codec_in)(void *);
|
|
|
|
void *opaque;
|
|
|
|
|
|
|
|
int fifo_len;
|
|
|
|
uint32_t fifo[16];
|
|
|
|
};
|
|
|
|
|
|
|
|
# define PA_FMT "0x%08lx"
|
2007-11-11 22:47:59 +03:00
|
|
|
# define REG_FMT "0x" TARGET_FMT_plx
|
2007-04-30 05:26:42 +04:00
|
|
|
|
2011-08-12 03:07:19 +04:00
|
|
|
PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_size,
|
|
|
|
const char *revision);
|
|
|
|
PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size);
|
2007-04-30 05:26:42 +04:00
|
|
|
|
|
|
|
#endif /* PXA_H */
|