Revision 8da3ff18 hw/omap_dss.c

b/hw/omap_dss.c
24 24
#include "omap.h"
25 25

  
26 26
struct omap_dss_s {
27
    target_phys_addr_t diss_base;
28
    target_phys_addr_t disc_base;
29
    target_phys_addr_t rfbi_base;
30
    target_phys_addr_t venc_base;
31
    target_phys_addr_t im3_base;
32 27
    qemu_irq irq;
33 28
    qemu_irq drq;
34 29
    DisplayState *state;
......
177 172
static uint32_t omap_diss_read(void *opaque, target_phys_addr_t addr)
178 173
{
179 174
    struct omap_dss_s *s = (struct omap_dss_s *) opaque;
180
    int offset = addr - s->diss_base;
181 175

  
182
    switch (offset) {
176
    switch (addr) {
183 177
    case 0x00:	/* DSS_REVISIONNUMBER */
184 178
        return 0x20;
185 179

  
......
212 206
                uint32_t value)
213 207
{
214 208
    struct omap_dss_s *s = (struct omap_dss_s *) opaque;
215
    int offset = addr - s->diss_base;
216 209

  
217
    switch (offset) {
210
    switch (addr) {
218 211
    case 0x00:	/* DSS_REVISIONNUMBER */
219 212
    case 0x14:	/* DSS_SYSSTATUS */
220 213
    case 0x50:	/* DSS_PSA_LCD_REG_1 */
......
254 247
static uint32_t omap_disc_read(void *opaque, target_phys_addr_t addr)
255 248
{
256 249
    struct omap_dss_s *s = (struct omap_dss_s *) opaque;
257
    int offset = addr - s->disc_base;
258 250

  
259
    switch (offset) {
251
    switch (addr) {
260 252
    case 0x000:	/* DISPC_REVISION */
261 253
        return 0x20;
262 254

  
......
376 368
                uint32_t value)
377 369
{
378 370
    struct omap_dss_s *s = (struct omap_dss_s *) opaque;
379
    int offset = addr - s->disc_base;
380 371

  
381
    switch (offset) {
372
    switch (addr) {
382 373
    case 0x010:	/* DISPC_SYSCONFIG */
383 374
        if (value & 2)						/* SOFTRESET */
384 375
            omap_dss_reset(s);
......
667 658
static uint32_t omap_rfbi_read(void *opaque, target_phys_addr_t addr)
668 659
{
669 660
    struct omap_dss_s *s = (struct omap_dss_s *) opaque;
670
    int offset = addr - s->rfbi_base;
671 661

  
672
    switch (offset) {
662
    switch (addr) {
673 663
    case 0x00:	/* RFBI_REVISION */
674 664
        return 0x10;
675 665

  
......
731 721
                uint32_t value)
732 722
{
733 723
    struct omap_dss_s *s = (struct omap_dss_s *) opaque;
734
    int offset = addr - s->rfbi_base;
735 724

  
736
    switch (offset) {
725
    switch (addr) {
737 726
    case 0x10:	/* RFBI_SYSCONFIG */
738 727
        if (value & 2)						/* SOFTRESET */
739 728
            omap_rfbi_reset(s);
......
866 855

  
867 856
static uint32_t omap_venc_read(void *opaque, target_phys_addr_t addr)
868 857
{
869
    struct omap_dss_s *s = (struct omap_dss_s *) opaque;
870
    int offset = addr - s->venc_base;
871

  
872
    switch (offset) {
858
    switch (addr) {
873 859
    case 0x00:	/* REV_ID */
874 860
    case 0x04:	/* STATUS */
875 861
    case 0x08:	/* F_CONTROL */
......
925 911
static void omap_venc_write(void *opaque, target_phys_addr_t addr,
926 912
                uint32_t value)
927 913
{
928
    struct omap_dss_s *s = (struct omap_dss_s *) opaque;
929
    int offset = addr - s->venc_base;
930

  
931
    switch (offset) {
914
    switch (addr) {
932 915
    case 0x08:	/* F_CONTROL */
933 916
    case 0x10:	/* VIDOUT_CTRL */
934 917
    case 0x14:	/* SYNC_CTRL */
......
991 974

  
992 975
static uint32_t omap_im3_read(void *opaque, target_phys_addr_t addr)
993 976
{
994
    struct omap_dss_s *s = (struct omap_dss_s *) opaque;
995
    int offset = addr - s->im3_base;
996

  
997
    switch (offset) {
977
    switch (addr) {
998 978
    case 0x0a8:	/* SBIMERRLOGA */
999 979
    case 0x0b0:	/* SBIMERRLOG */
1000 980
    case 0x190:	/* SBIMSTATE */
......
1016 996
static void omap_im3_write(void *opaque, target_phys_addr_t addr,
1017 997
                uint32_t value)
1018 998
{
1019
    struct omap_dss_s *s = (struct omap_dss_s *) opaque;
1020
    int offset = addr - s->im3_base;
1021

  
1022
    switch (offset) {
999
    switch (addr) {
1023 1000
    case 0x0b0:	/* SBIMERRLOG */
1024 1001
    case 0x190:	/* SBIMSTATE */
1025 1002
    case 0x198:	/* SBTMSTATE_L */
......
1070 1047
                    omap_venc1_writefn, s);
1071 1048
    iomemtype[4] = cpu_register_io_memory(0, omap_im3_readfn,
1072 1049
                    omap_im3_writefn, s);
1073
    s->diss_base = omap_l4_attach(ta, 0, iomemtype[0]);
1074
    s->disc_base = omap_l4_attach(ta, 1, iomemtype[1]);
1075
    s->rfbi_base = omap_l4_attach(ta, 2, iomemtype[2]);
1076
    s->venc_base = omap_l4_attach(ta, 3, iomemtype[3]);
1077
    s->im3_base = l3_base;
1078
    cpu_register_physical_memory(s->im3_base, 0x1000, iomemtype[4]);
1050
    omap_l4_attach(ta, 0, iomemtype[0]);
1051
    omap_l4_attach(ta, 1, iomemtype[1]);
1052
    omap_l4_attach(ta, 3, iomemtype[3]);
1053
    cpu_register_physical_memory(l3_base, 0x1000, iomemtype[4]);
1079 1054

  
1080 1055
#if 0
1081 1056
    if (ds)

Also available in: Unified diff