~ubuntu-branches/ubuntu/raring/qemu-kvm/raring

« back to all changes in this revision

Viewing changes to hw/omap.h

  • Committer: Serge Hallyn
  • Date: 2011-12-06 22:40:24 UTC
  • mfrom: (1.2.8)
  • Revision ID: serge.hallyn@ubuntu.com-20111206224024-x6bw4wnn65pgf55v
Tags: 1.0+noroms-0ubuntu1
* New upstream release
* Remaining changes from upstream:
  - removed all binary roms and tests/pi_10.com
* debian/qemu-kvm.links: qemu is now called qemu-system-i386, don't symlink
  it
* remove patches applied upstream:
  - debian/patches/vpc.patch
  - debian/patches/e1000-Dont-set-the-Capabilities-List-bit.patch
  - debian/patches/CVE-2011-4111.patch
* replace default-to-tcg.patch with simpler fallback-to-tcg.patch
* keep remaining patches:
  - larger_default_ram_size.patch
  - CVE-2011-2212-virtqueue-indirect-overflow.patch
  - qemuifup-fix-paths.patch
  - dont-try-to-hotplug-cpu.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * with this program; if not, see <http://www.gnu.org/licenses/>.
18
18
 */
19
19
#ifndef hw_omap_h
 
20
#include "memory.h"
20
21
# define hw_omap_h              "omap.h"
21
22
 
22
23
# define OMAP_EMIFS_BASE        0x00000000
93
94
    int cs);
94
95
target_phys_addr_t omap_l4_attach(struct omap_target_agent_s *ta, int region,
95
96
                int iotype);
 
97
target_phys_addr_t omap_l4_region_base(struct omap_target_agent_s *ta,
 
98
                                       int region);
96
99
int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read,
97
100
                CPUWriteMemoryFunc * const *mem_write, void *opaque);
98
101
 
99
 
/* OMAP interrupt controller */
100
 
struct omap_intr_handler_s;
101
 
struct omap_intr_handler_s *omap_inth_init(target_phys_addr_t base,
102
 
                unsigned long size, unsigned char nbanks, qemu_irq **pins,
103
 
                qemu_irq parent_irq, qemu_irq parent_fiq, omap_clk clk);
104
 
struct omap_intr_handler_s *omap2_inth_init(target_phys_addr_t base,
105
 
                int size, int nbanks, qemu_irq **pins,
106
 
                qemu_irq parent_irq, qemu_irq parent_fiq,
107
 
                omap_clk fclk, omap_clk iclk);
108
 
void omap_inth_reset(struct omap_intr_handler_s *s);
109
 
qemu_irq omap_inth_get_pin(struct omap_intr_handler_s *s, int n);
110
 
 
111
102
/* OMAP2 SDRAM controller */
112
103
struct omap_sdrc_s;
113
104
struct omap_sdrc_s *omap_sdrc_init(target_phys_addr_t base);
115
106
 
116
107
/* OMAP2 general purpose memory controller */
117
108
struct omap_gpmc_s;
118
 
struct omap_gpmc_s *omap_gpmc_init(target_phys_addr_t base, qemu_irq irq);
 
109
struct omap_gpmc_s *omap_gpmc_init(struct omap_mpu_state_s *mpu,
 
110
                                   target_phys_addr_t base,
 
111
                                   qemu_irq irq, qemu_irq drq);
119
112
void omap_gpmc_reset(struct omap_gpmc_s *s);
120
 
void omap_gpmc_attach(struct omap_gpmc_s *s, int cs, int iomemtype,
121
 
                void (*base_upd)(void *opaque, target_phys_addr_t new),
122
 
                void (*unmap)(void *opaque), void *opaque);
 
113
void omap_gpmc_attach(struct omap_gpmc_s *s, int cs, MemoryRegion *iomem);
 
114
void omap_gpmc_attach_nand(struct omap_gpmc_s *s, int cs, DeviceState *nand);
123
115
 
124
116
/*
125
117
 * Common IRQ numbers for level 1 interrupt handler
674
666
void omap_uart_attach(struct omap_uart_s *s, CharDriverState *chr);
675
667
 
676
668
struct omap_mpuio_s;
677
 
struct omap_mpuio_s *omap_mpuio_init(target_phys_addr_t base,
 
669
struct omap_mpuio_s *omap_mpuio_init(MemoryRegion *system_memory,
 
670
                target_phys_addr_t base,
678
671
                qemu_irq kbd_int, qemu_irq gpio_int, qemu_irq wakeup,
679
672
                omap_clk clk);
680
673
qemu_irq *omap_mpuio_in_get(struct omap_mpuio_s *s);
681
674
void omap_mpuio_out_set(struct omap_mpuio_s *s, int line, qemu_irq handler);
682
675
void omap_mpuio_key(struct omap_mpuio_s *s, int row, int col, int down);
683
676
 
684
 
/* omap1 gpio module interface */
685
 
struct omap_gpio_s;
686
 
struct omap_gpio_s *omap_gpio_init(target_phys_addr_t base,
687
 
                qemu_irq irq, omap_clk clk);
688
 
void omap_gpio_reset(struct omap_gpio_s *s);
689
 
qemu_irq *omap_gpio_in_get(struct omap_gpio_s *s);
690
 
void omap_gpio_out_set(struct omap_gpio_s *s, int line, qemu_irq handler);
691
 
 
692
 
/* omap2 gpio interface */
693
 
struct omap_gpif_s;
694
 
struct omap_gpif_s *omap2_gpio_init(struct omap_target_agent_s *ta,
695
 
                qemu_irq *irq, omap_clk *fclk, omap_clk iclk, int modules);
696
 
void omap_gpif_reset(struct omap_gpif_s *s);
697
 
qemu_irq *omap2_gpio_in_get(struct omap_gpif_s *s, int start);
698
 
void omap2_gpio_out_set(struct omap_gpif_s *s, int line, qemu_irq handler);
699
 
 
700
677
struct uWireSlave {
701
678
    uint16_t (*receive)(void *opaque);
702
679
    void (*send)(void *opaque, uint16_t data);
703
680
    void *opaque;
704
681
};
705
682
struct omap_uwire_s;
706
 
struct omap_uwire_s *omap_uwire_init(target_phys_addr_t base,
707
 
                qemu_irq *irq, qemu_irq dma, omap_clk clk);
708
683
void omap_uwire_attach(struct omap_uwire_s *s,
709
684
                uWireSlave *slave, int chipselect);
710
685
 
742
717
    } in, out;
743
718
};
744
719
struct omap_mcbsp_s;
745
 
struct omap_mcbsp_s *omap_mcbsp_init(target_phys_addr_t base,
746
 
                qemu_irq *irq, qemu_irq *dma, omap_clk clk);
747
720
void omap_mcbsp_i2s_attach(struct omap_mcbsp_s *s, I2SCodec *slave);
748
721
 
749
722
void omap_tap_init(struct omap_target_agent_s *ta,
753
726
struct omap_lcd_panel_s;
754
727
void omap_lcdc_reset(struct omap_lcd_panel_s *s);
755
728
struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq,
756
 
                struct omap_dma_lcd_channel_s *dma,
757
 
                ram_addr_t imif_base, ram_addr_t emiff_base, omap_clk clk);
 
729
                struct omap_dma_lcd_channel_s *dma, omap_clk clk);
758
730
 
759
731
/* omap_dss.c */
760
732
struct rfbi_chip_s {
801
773
# define cpu_is_omap2420(cpu)           (cpu->mpu_model == omap2420)
802
774
# define cpu_is_omap2430(cpu)           (cpu->mpu_model == omap2430)
803
775
# define cpu_is_omap3430(cpu)           (cpu->mpu_model == omap3430)
 
776
# define cpu_is_omap3630(cpu)           (cpu->mpu_model == omap3630)
804
777
 
805
778
# define cpu_is_omap15xx(cpu)           \
806
779
        (cpu_is_omap310(cpu) || cpu_is_omap1510(cpu))
812
785
# define cpu_class_omap1(cpu)           \
813
786
        (cpu_is_omap15xx(cpu) || cpu_is_omap16xx(cpu))
814
787
# define cpu_class_omap2(cpu)           cpu_is_omap24xx(cpu)
815
 
# define cpu_class_omap3(cpu)           cpu_is_omap3430(cpu)
 
788
# define cpu_class_omap3(cpu) \
 
789
        (cpu_is_omap3430(cpu) || cpu_is_omap3630(cpu))
816
790
 
817
791
struct omap_mpu_state_s {
818
792
    enum omap_mpu_model {
826
800
        omap2423,
827
801
        omap2430,
828
802
        omap3430,
 
803
        omap3630,
829
804
    } mpu_model;
830
805
 
831
806
    CPUState *env;
832
807
 
833
 
    qemu_irq *irq[2];
834
808
    qemu_irq *drq;
835
809
 
836
810
    qemu_irq wakeup;
837
811
 
 
812
    MemoryRegion ulpd_pm_iomem;
 
813
    MemoryRegion pin_cfg_iomem;
 
814
    MemoryRegion id_iomem;
 
815
    MemoryRegion id_iomem_e18;
 
816
    MemoryRegion id_iomem_ed4;
 
817
    MemoryRegion id_iomem_e20;
 
818
    MemoryRegion mpui_iomem;
 
819
    MemoryRegion tcmi_iomem;
 
820
    MemoryRegion clkm_iomem;
 
821
    MemoryRegion clkdsp_iomem;
 
822
    MemoryRegion pwl_iomem;
 
823
    MemoryRegion pwt_iomem;
 
824
    MemoryRegion mpui_io_iomem;
 
825
    MemoryRegion imif_ram;
 
826
    MemoryRegion emiff_ram;
 
827
 
838
828
    struct omap_dma_port_if_s {
839
829
        uint32_t (*read[3])(struct omap_mpu_state_s *s,
840
830
                        target_phys_addr_t offset);
850
840
    /* MPUI-TIPB peripherals */
851
841
    struct omap_uart_s *uart[3];
852
842
 
853
 
    struct omap_gpio_s *gpio;
 
843
    DeviceState *gpio;
854
844
 
855
845
    struct omap_mcbsp_s *mcbsp1;
856
846
    struct omap_mcbsp_s *mcbsp3;
887
877
    struct omap_lpg_s *led[2];
888
878
 
889
879
    /* MPU private TIPB peripherals */
890
 
    struct omap_intr_handler_s *ih[2];
 
880
    DeviceState *ih[2];
891
881
 
892
882
    struct soc_dma_s *dma;
893
883
 
916
906
    uint32_t tcmi_regs[17];
917
907
 
918
908
    struct dpll_ctl_s {
 
909
        MemoryRegion iomem;
919
910
        uint16_t mode;
920
911
        omap_clk dpll;
921
912
    } dpll[3];
948
939
    struct omap_gpmc_s *gpmc;
949
940
    struct omap_sysctl_s *sysc;
950
941
 
951
 
    struct omap_gpif_s *gpif;
952
 
 
953
942
    struct omap_mcspi_s *mcspi[2];
954
943
 
955
944
    struct omap_dss_s *dss;
958
947
};
959
948
 
960
949
/* omap1.c */
961
 
struct omap_mpu_state_s *omap310_mpu_init(unsigned long sdram_size,
 
950
struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory,
 
951
                unsigned long sdram_size,
962
952
                const char *core);
963
953
 
964
954
/* omap2.c */
1123
1113
                                           CPUWriteMemoryFunc * const *mem_write,
1124
1114
                                           void *opaque)
1125
1115
{
1126
 
    struct io_fn *s = qemu_malloc(sizeof(struct io_fn));
 
1116
    struct io_fn *s = g_malloc(sizeof(struct io_fn));
1127
1117
 
1128
1118
    s->mem_read = mem_read;
1129
1119
    s->mem_write = mem_write;