📄 omap.h
字号:
void omap_rfbi_attach(struct omap_dss_s *s, int cs, struct rfbi_chip_s *chip);/* omap_mmc.c */struct omap_mmc_s;struct omap_mmc_s *omap_mmc_init(target_phys_addr_t base, BlockDriverState *bd, qemu_irq irq, qemu_irq dma[], omap_clk clk);struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta, BlockDriverState *bd, qemu_irq irq, qemu_irq dma[], omap_clk fclk, omap_clk iclk);void omap_mmc_reset(struct omap_mmc_s *s);void omap_mmc_handlers(struct omap_mmc_s *s, qemu_irq ro, qemu_irq cover);void omap_mmc_enable(struct omap_mmc_s *s, int enable);/* omap_i2c.c */struct omap_i2c_s;struct omap_i2c_s *omap_i2c_init(target_phys_addr_t base, qemu_irq irq, qemu_irq *dma, omap_clk clk);struct omap_i2c_s *omap2_i2c_init(struct omap_target_agent_s *ta, qemu_irq irq, qemu_irq *dma, omap_clk fclk, omap_clk iclk);void omap_i2c_reset(struct omap_i2c_s *s);i2c_bus *omap_i2c_bus(struct omap_i2c_s *s);# define cpu_is_omap310(cpu) (cpu->mpu_model == omap310)# define cpu_is_omap1510(cpu) (cpu->mpu_model == omap1510)# define cpu_is_omap1610(cpu) (cpu->mpu_model == omap1610)# define cpu_is_omap1710(cpu) (cpu->mpu_model == omap1710)# define cpu_is_omap2410(cpu) (cpu->mpu_model == omap2410)# define cpu_is_omap2420(cpu) (cpu->mpu_model == omap2420)# define cpu_is_omap2430(cpu) (cpu->mpu_model == omap2430)# define cpu_is_omap3430(cpu) (cpu->mpu_model == omap3430)# define cpu_is_omap15xx(cpu) \ (cpu_is_omap310(cpu) || cpu_is_omap1510(cpu))# define cpu_is_omap16xx(cpu) \ (cpu_is_omap1610(cpu) || cpu_is_omap1710(cpu))# define cpu_is_omap24xx(cpu) \ (cpu_is_omap2410(cpu) || cpu_is_omap2420(cpu) || cpu_is_omap2430(cpu))# define cpu_class_omap1(cpu) \ (cpu_is_omap15xx(cpu) || cpu_is_omap16xx(cpu))# define cpu_class_omap2(cpu) cpu_is_omap24xx(cpu)# define cpu_class_omap3(cpu) cpu_is_omap3430(cpu)struct omap_mpu_state_s { enum omap_mpu_model { omap310, omap1510, omap1610, omap1710, omap2410, omap2420, omap2422, omap2423, omap2430, omap3430, } mpu_model; CPUState *env; qemu_irq *irq[2]; qemu_irq *drq; qemu_irq wakeup; struct omap_dma_port_if_s { uint32_t (*read[3])(struct omap_mpu_state_s *s, target_phys_addr_t offset); void (*write[3])(struct omap_mpu_state_s *s, target_phys_addr_t offset, uint32_t value); int (*addr_valid)(struct omap_mpu_state_s *s, target_phys_addr_t addr); } port[__omap_dma_port_last]; unsigned long sdram_size; unsigned long sram_size; /* MPUI-TIPB peripherals */ struct omap_uart_s *uart[3]; struct omap_gpio_s *gpio; struct omap_mcbsp_s *mcbsp1; struct omap_mcbsp_s *mcbsp3; /* MPU public TIPB peripherals */ struct omap_32khz_timer_s *os_timer; struct omap_mmc_s *mmc; struct omap_mpuio_s *mpuio; struct omap_uwire_s *microwire; struct { uint8_t output; uint8_t level; uint8_t enable; int clk; } pwl; struct { uint8_t frc; uint8_t vrc; uint8_t gcr; omap_clk clk; } pwt; struct omap_i2c_s *i2c[2]; struct omap_rtc_s *rtc; struct omap_mcbsp_s *mcbsp2; struct omap_lpg_s *led[2]; /* MPU private TIPB peripherals */ struct omap_intr_handler_s *ih[2]; struct omap_dma_s *dma; struct omap_mpu_timer_s *timer[3]; struct omap_watchdog_timer_s *wdt; struct omap_lcd_panel_s *lcd; target_phys_addr_t ulpd_pm_base; uint32_t ulpd_pm_regs[21]; int64_t ulpd_gauge_start; target_phys_addr_t pin_cfg_base; uint32_t func_mux_ctrl[14]; uint32_t comp_mode_ctrl[1]; uint32_t pull_dwn_ctrl[4]; uint32_t gate_inh_ctrl[1]; uint32_t voltage_ctrl[1]; uint32_t test_dbg_ctrl[1]; uint32_t mod_conf_ctrl[1]; int compat1509; uint32_t mpui_ctrl; target_phys_addr_t mpui_base; struct omap_tipb_bridge_s *private_tipb; struct omap_tipb_bridge_s *public_tipb; target_phys_addr_t tcmi_base; uint32_t tcmi_regs[17]; struct dpll_ctl_s { target_phys_addr_t base; uint16_t mode; omap_clk dpll; } dpll[3]; omap_clk clks; struct { target_phys_addr_t mpu_base; target_phys_addr_t dsp_base; int cold_start; int clocking_scheme; uint16_t arm_ckctl; uint16_t arm_idlect1; uint16_t arm_idlect2; uint16_t arm_ewupct; uint16_t arm_rstct1; uint16_t arm_rstct2; uint16_t arm_ckout1; int dpll1_mode; uint16_t dsp_idlect1; uint16_t dsp_idlect2; uint16_t dsp_rstct2; } clkm; /* OMAP2-only peripherals */ struct omap_l4_s *l4; struct omap_gp_timer_s *gptimer[12]; target_phys_addr_t tap_base; struct omap_synctimer_s { target_phys_addr_t base; uint32_t val; uint16_t readh; } synctimer; struct omap_prcm_s *prcm; struct omap_sdrc_s *sdrc; struct omap_gpmc_s *gpmc; struct omap_sysctl_s *sysc; struct omap_gpif_s *gpif; struct omap_mcspi_s *mcspi[2]; struct omap_dss_s *dss;};/* omap1.c */struct omap_mpu_state_s *omap310_mpu_init(unsigned long sdram_size, DisplayState *ds, const char *core);/* omap2.c */struct omap_mpu_state_s *omap2420_mpu_init(unsigned long sdram_size, DisplayState *ds, const char *core);# if TARGET_PHYS_ADDR_BITS == 32# define OMAP_FMT_plx "%#08x"# elif TARGET_PHYS_ADDR_BITS == 64# define OMAP_FMT_plx "%#08" PRIx64# else# error TARGET_PHYS_ADDR_BITS undefined# endifuint32_t omap_badwidth_read8(void *opaque, target_phys_addr_t addr);void omap_badwidth_write8(void *opaque, target_phys_addr_t addr, uint32_t value);uint32_t omap_badwidth_read16(void *opaque, target_phys_addr_t addr);void omap_badwidth_write16(void *opaque, target_phys_addr_t addr, uint32_t value);uint32_t omap_badwidth_read32(void *opaque, target_phys_addr_t addr);void omap_badwidth_write32(void *opaque, target_phys_addr_t addr, uint32_t value);void omap_mpu_wakeup(void *opaque, int irq, int req);# define OMAP_BAD_REG(paddr) \ fprintf(stderr, "%s: Bad register " OMAP_FMT_plx "\n", \ __FUNCTION__, paddr)# define OMAP_RO_REG(paddr) \ fprintf(stderr, "%s: Read-only register " OMAP_FMT_plx "\n", \ __FUNCTION__, paddr)/* OMAP-specific Linux bootloader tags for the ATAG_BOARD area (Board-specifc tags are not here) */#define OMAP_TAG_CLOCK 0x4f01#define OMAP_TAG_MMC 0x4f02#define OMAP_TAG_SERIAL_CONSOLE 0x4f03#define OMAP_TAG_USB 0x4f04#define OMAP_TAG_LCD 0x4f05#define OMAP_TAG_GPIO_SWITCH 0x4f06#define OMAP_TAG_UART 0x4f07#define OMAP_TAG_FBMEM 0x4f08#define OMAP_TAG_STI_CONSOLE 0x4f09#define OMAP_TAG_CAMERA_SENSOR 0x4f0a#define OMAP_TAG_PARTITION 0x4f0b#define OMAP_TAG_TEA5761 0x4f10#define OMAP_TAG_TMP105 0x4f11#define OMAP_TAG_BOOT_REASON 0x4f80#define OMAP_TAG_FLASH_PART_STR 0x4f81#define OMAP_TAG_VERSION_STR 0x4f82enum { OMAP_GPIOSW_TYPE_COVER = 0 << 4, OMAP_GPIOSW_TYPE_CONNECTION = 1 << 4, OMAP_GPIOSW_TYPE_ACTIVITY = 2 << 4,};#define OMAP_GPIOSW_INVERTED 0x0001#define OMAP_GPIOSW_OUTPUT 0x0002# define TCMI_VERBOSE 1//# define MEM_VERBOSE 1# ifdef TCMI_VERBOSE# define OMAP_8B_REG(paddr) \ fprintf(stderr, "%s: 8-bit register " OMAP_FMT_plx "\n", \ __FUNCTION__, paddr)# define OMAP_16B_REG(paddr) \ fprintf(stderr, "%s: 16-bit register " OMAP_FMT_plx "\n", \ __FUNCTION__, paddr)# define OMAP_32B_REG(paddr) \ fprintf(stderr, "%s: 32-bit register " OMAP_FMT_plx "\n", \ __FUNCTION__, paddr)# else# define OMAP_8B_REG(paddr)# define OMAP_16B_REG(paddr)# define OMAP_32B_REG(paddr)# endif# define OMAP_MPUI_REG_MASK 0x000007ff# ifdef MEM_VERBOSEstruct io_fn { CPUReadMemoryFunc **mem_read; CPUWriteMemoryFunc **mem_write; void *opaque; int in;};static uint32_t io_readb(void *opaque, target_phys_addr_t addr){ struct io_fn *s = opaque; uint32_t ret; s->in ++; ret = s->mem_read[0](s->opaque, addr); s->in --; if (!s->in) fprintf(stderr, "%08x ---> %02x\n", (uint32_t) addr, ret); return ret;}static uint32_t io_readh(void *opaque, target_phys_addr_t addr){ struct io_fn *s = opaque; uint32_t ret; s->in ++; ret = s->mem_read[1](s->opaque, addr); s->in --; if (!s->in) fprintf(stderr, "%08x ---> %04x\n", (uint32_t) addr, ret); return ret;}static uint32_t io_readw(void *opaque, target_phys_addr_t addr){ struct io_fn *s = opaque; uint32_t ret; s->in ++; ret = s->mem_read[2](s->opaque, addr); s->in --; if (!s->in) fprintf(stderr, "%08x ---> %08x\n", (uint32_t) addr, ret); return ret;}static void io_writeb(void *opaque, target_phys_addr_t addr, uint32_t value){ struct io_fn *s = opaque; if (!s->in) fprintf(stderr, "%08x <--- %02x\n", (uint32_t) addr, value); s->in ++; s->mem_write[0](s->opaque, addr, value); s->in --;}static void io_writeh(void *opaque, target_phys_addr_t addr, uint32_t value){ struct io_fn *s = opaque; if (!s->in) fprintf(stderr, "%08x <--- %04x\n", (uint32_t) addr, value); s->in ++; s->mem_write[1](s->opaque, addr, value); s->in --;}static void io_writew(void *opaque, target_phys_addr_t addr, uint32_t value){ struct io_fn *s = opaque; if (!s->in) fprintf(stderr, "%08x <--- %08x\n", (uint32_t) addr, value); s->in ++; s->mem_write[2](s->opaque, addr, value); s->in --;}static CPUReadMemoryFunc *io_readfn[] = { io_readb, io_readh, io_readw, };static CPUWriteMemoryFunc *io_writefn[] = { io_writeb, io_writeh, io_writew, };inline static int debug_register_io_memory(int io_index, CPUReadMemoryFunc **mem_read, CPUWriteMemoryFunc **mem_write, void *opaque){ struct io_fn *s = qemu_malloc(sizeof(struct io_fn)); s->mem_read = mem_read; s->mem_write = mem_write; s->opaque = opaque; s->in = 0; return cpu_register_io_memory(io_index, io_readfn, io_writefn, s);}# define cpu_register_io_memory debug_register_io_memory# endif#endif /* hw_omap_h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -