25 |
25 |
qemu_irq irq;
|
26 |
26 |
qemu_irq drq;
|
27 |
27 |
DisplayState *state;
|
|
28 |
MemoryRegion iomem_diss1, iomem_disc1, iomem_rfbi1, iomem_venc1, iomem_im3;
|
28 |
29 |
|
29 |
30 |
int autoidle;
|
30 |
31 |
int control;
|
... | ... | |
167 |
168 |
omap_dispc_interrupt_update(s);
|
168 |
169 |
}
|
169 |
170 |
|
170 |
|
static uint32_t omap_diss_read(void *opaque, target_phys_addr_t addr)
|
|
171 |
static uint64_t omap_diss_read(void *opaque, target_phys_addr_t addr,
|
|
172 |
unsigned size)
|
171 |
173 |
{
|
172 |
174 |
struct omap_dss_s *s = (struct omap_dss_s *) opaque;
|
173 |
175 |
|
|
176 |
if (size != 4) {
|
|
177 |
return omap_badwidth_read32(opaque, addr);
|
|
178 |
}
|
|
179 |
|
174 |
180 |
switch (addr) {
|
175 |
181 |
case 0x00: /* DSS_REVISIONNUMBER */
|
176 |
182 |
return 0x20;
|
... | ... | |
201 |
207 |
}
|
202 |
208 |
|
203 |
209 |
static void omap_diss_write(void *opaque, target_phys_addr_t addr,
|
204 |
|
uint32_t value)
|
|
210 |
uint64_t value, unsigned size)
|
205 |
211 |
{
|
206 |
212 |
struct omap_dss_s *s = (struct omap_dss_s *) opaque;
|
207 |
213 |
|
|
214 |
if (size != 4) {
|
|
215 |
return omap_badwidth_write32(opaque, addr, value);
|
|
216 |
}
|
|
217 |
|
208 |
218 |
switch (addr) {
|
209 |
219 |
case 0x00: /* DSS_REVISIONNUMBER */
|
210 |
220 |
case 0x14: /* DSS_SYSSTATUS */
|
... | ... | |
230 |
240 |
}
|
231 |
241 |
}
|
232 |
242 |
|
233 |
|
static CPUReadMemoryFunc * const omap_diss1_readfn[] = {
|
234 |
|
omap_badwidth_read32,
|
235 |
|
omap_badwidth_read32,
|
236 |
|
omap_diss_read,
|
|
243 |
static const MemoryRegionOps omap_diss_ops = {
|
|
244 |
.read = omap_diss_read,
|
|
245 |
.write = omap_diss_write,
|
|
246 |
.endianness = DEVICE_NATIVE_ENDIAN,
|
237 |
247 |
};
|
238 |
248 |
|
239 |
|
static CPUWriteMemoryFunc * const omap_diss1_writefn[] = {
|
240 |
|
omap_badwidth_write32,
|
241 |
|
omap_badwidth_write32,
|
242 |
|
omap_diss_write,
|
243 |
|
};
|
244 |
|
|
245 |
|
static uint32_t omap_disc_read(void *opaque, target_phys_addr_t addr)
|
|
249 |
static uint64_t omap_disc_read(void *opaque, target_phys_addr_t addr,
|
|
250 |
unsigned size)
|
246 |
251 |
{
|
247 |
252 |
struct omap_dss_s *s = (struct omap_dss_s *) opaque;
|
248 |
253 |
|
|
254 |
if (size != 4) {
|
|
255 |
return omap_badwidth_read32(opaque, addr);
|
|
256 |
}
|
|
257 |
|
249 |
258 |
switch (addr) {
|
250 |
259 |
case 0x000: /* DISPC_REVISION */
|
251 |
260 |
return 0x20;
|
... | ... | |
363 |
372 |
}
|
364 |
373 |
|
365 |
374 |
static void omap_disc_write(void *opaque, target_phys_addr_t addr,
|
366 |
|
uint32_t value)
|
|
375 |
uint64_t value, unsigned size)
|
367 |
376 |
{
|
368 |
377 |
struct omap_dss_s *s = (struct omap_dss_s *) opaque;
|
369 |
378 |
|
|
379 |
if (size != 4) {
|
|
380 |
return omap_badwidth_write32(opaque, addr, value);
|
|
381 |
}
|
|
382 |
|
370 |
383 |
switch (addr) {
|
371 |
384 |
case 0x010: /* DISPC_SYSCONFIG */
|
372 |
385 |
if (value & 2) /* SOFTRESET */
|
... | ... | |
570 |
583 |
}
|
571 |
584 |
}
|
572 |
585 |
|
573 |
|
static CPUReadMemoryFunc * const omap_disc1_readfn[] = {
|
574 |
|
omap_badwidth_read32,
|
575 |
|
omap_badwidth_read32,
|
576 |
|
omap_disc_read,
|
577 |
|
};
|
578 |
|
|
579 |
|
static CPUWriteMemoryFunc * const omap_disc1_writefn[] = {
|
580 |
|
omap_badwidth_write32,
|
581 |
|
omap_badwidth_write32,
|
582 |
|
omap_disc_write,
|
|
586 |
static const MemoryRegionOps omap_disc_ops = {
|
|
587 |
.read = omap_disc_read,
|
|
588 |
.write = omap_disc_write,
|
|
589 |
.endianness = DEVICE_NATIVE_ENDIAN,
|
583 |
590 |
};
|
584 |
591 |
|
585 |
592 |
static void omap_rfbi_transfer_stop(struct omap_dss_s *s)
|
... | ... | |
656 |
663 |
omap_dispc_interrupt_update(s);
|
657 |
664 |
}
|
658 |
665 |
|
659 |
|
static uint32_t omap_rfbi_read(void *opaque, target_phys_addr_t addr)
|
|
666 |
static uint64_t omap_rfbi_read(void *opaque, target_phys_addr_t addr,
|
|
667 |
unsigned size)
|
660 |
668 |
{
|
661 |
669 |
struct omap_dss_s *s = (struct omap_dss_s *) opaque;
|
662 |
670 |
|
|
671 |
if (size != 4) {
|
|
672 |
return omap_badwidth_read32(opaque, addr);
|
|
673 |
}
|
|
674 |
|
663 |
675 |
switch (addr) {
|
664 |
676 |
case 0x00: /* RFBI_REVISION */
|
665 |
677 |
return 0x10;
|
... | ... | |
719 |
731 |
}
|
720 |
732 |
|
721 |
733 |
static void omap_rfbi_write(void *opaque, target_phys_addr_t addr,
|
722 |
|
uint32_t value)
|
|
734 |
uint64_t value, unsigned size)
|
723 |
735 |
{
|
724 |
736 |
struct omap_dss_s *s = (struct omap_dss_s *) opaque;
|
725 |
737 |
|
|
738 |
if (size != 4) {
|
|
739 |
return omap_badwidth_write32(opaque, addr, value);
|
|
740 |
}
|
|
741 |
|
726 |
742 |
switch (addr) {
|
727 |
743 |
case 0x10: /* RFBI_SYSCONFIG */
|
728 |
744 |
if (value & 2) /* SOFTRESET */
|
... | ... | |
842 |
858 |
}
|
843 |
859 |
}
|
844 |
860 |
|
845 |
|
static CPUReadMemoryFunc * const omap_rfbi1_readfn[] = {
|
846 |
|
omap_badwidth_read32,
|
847 |
|
omap_badwidth_read32,
|
848 |
|
omap_rfbi_read,
|
849 |
|
};
|
850 |
|
|
851 |
|
static CPUWriteMemoryFunc * const omap_rfbi1_writefn[] = {
|
852 |
|
omap_badwidth_write32,
|
853 |
|
omap_badwidth_write32,
|
854 |
|
omap_rfbi_write,
|
|
861 |
static const MemoryRegionOps omap_rfbi_ops = {
|
|
862 |
.read = omap_rfbi_read,
|
|
863 |
.write = omap_rfbi_write,
|
|
864 |
.endianness = DEVICE_NATIVE_ENDIAN,
|
855 |
865 |
};
|
856 |
866 |
|
857 |
|
static uint32_t omap_venc_read(void *opaque, target_phys_addr_t addr)
|
|
867 |
static uint64_t omap_venc_read(void *opaque, target_phys_addr_t addr,
|
|
868 |
unsigned size)
|
858 |
869 |
{
|
|
870 |
if (size != 4) {
|
|
871 |
return omap_badwidth_read32(opaque, addr);
|
|
872 |
}
|
|
873 |
|
859 |
874 |
switch (addr) {
|
860 |
875 |
case 0x00: /* REV_ID */
|
861 |
876 |
case 0x04: /* STATUS */
|
... | ... | |
910 |
925 |
}
|
911 |
926 |
|
912 |
927 |
static void omap_venc_write(void *opaque, target_phys_addr_t addr,
|
913 |
|
uint32_t value)
|
|
928 |
uint64_t value, unsigned size)
|
914 |
929 |
{
|
|
930 |
if (size != 4) {
|
|
931 |
return omap_badwidth_write32(opaque, addr, size);
|
|
932 |
}
|
|
933 |
|
915 |
934 |
switch (addr) {
|
916 |
935 |
case 0x08: /* F_CONTROL */
|
917 |
936 |
case 0x10: /* VIDOUT_CTRL */
|
... | ... | |
961 |
980 |
}
|
962 |
981 |
}
|
963 |
982 |
|
964 |
|
static CPUReadMemoryFunc * const omap_venc1_readfn[] = {
|
965 |
|
omap_badwidth_read32,
|
966 |
|
omap_badwidth_read32,
|
967 |
|
omap_venc_read,
|
|
983 |
static const MemoryRegionOps omap_venc_ops = {
|
|
984 |
.read = omap_venc_read,
|
|
985 |
.write = omap_venc_write,
|
|
986 |
.endianness = DEVICE_NATIVE_ENDIAN,
|
968 |
987 |
};
|
969 |
988 |
|
970 |
|
static CPUWriteMemoryFunc * const omap_venc1_writefn[] = {
|
971 |
|
omap_badwidth_write32,
|
972 |
|
omap_badwidth_write32,
|
973 |
|
omap_venc_write,
|
974 |
|
};
|
975 |
|
|
976 |
|
static uint32_t omap_im3_read(void *opaque, target_phys_addr_t addr)
|
|
989 |
static uint64_t omap_im3_read(void *opaque, target_phys_addr_t addr,
|
|
990 |
unsigned size)
|
977 |
991 |
{
|
|
992 |
if (size != 4) {
|
|
993 |
return omap_badwidth_read32(opaque, addr);
|
|
994 |
}
|
|
995 |
|
978 |
996 |
switch (addr) {
|
979 |
997 |
case 0x0a8: /* SBIMERRLOGA */
|
980 |
998 |
case 0x0b0: /* SBIMERRLOG */
|
... | ... | |
995 |
1013 |
}
|
996 |
1014 |
|
997 |
1015 |
static void omap_im3_write(void *opaque, target_phys_addr_t addr,
|
998 |
|
uint32_t value)
|
|
1016 |
uint64_t value, unsigned size)
|
999 |
1017 |
{
|
|
1018 |
if (size != 4) {
|
|
1019 |
return omap_badwidth_write32(opaque, addr, value);
|
|
1020 |
}
|
|
1021 |
|
1000 |
1022 |
switch (addr) {
|
1001 |
1023 |
case 0x0b0: /* SBIMERRLOG */
|
1002 |
1024 |
case 0x190: /* SBIMSTATE */
|
... | ... | |
1011 |
1033 |
}
|
1012 |
1034 |
}
|
1013 |
1035 |
|
1014 |
|
static CPUReadMemoryFunc * const omap_im3_readfn[] = {
|
1015 |
|
omap_badwidth_read32,
|
1016 |
|
omap_badwidth_read32,
|
1017 |
|
omap_im3_read,
|
1018 |
|
};
|
1019 |
|
|
1020 |
|
static CPUWriteMemoryFunc * const omap_im3_writefn[] = {
|
1021 |
|
omap_badwidth_write32,
|
1022 |
|
omap_badwidth_write32,
|
1023 |
|
omap_im3_write,
|
|
1036 |
static const MemoryRegionOps omap_im3_ops = {
|
|
1037 |
.read = omap_im3_read,
|
|
1038 |
.write = omap_im3_write,
|
|
1039 |
.endianness = DEVICE_NATIVE_ENDIAN,
|
1024 |
1040 |
};
|
1025 |
1041 |
|
1026 |
1042 |
struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta,
|
|
1043 |
MemoryRegion *sysmem,
|
1027 |
1044 |
target_phys_addr_t l3_base,
|
1028 |
1045 |
qemu_irq irq, qemu_irq drq,
|
1029 |
1046 |
omap_clk fck1, omap_clk fck2, omap_clk ck54m,
|
1030 |
1047 |
omap_clk ick1, omap_clk ick2)
|
1031 |
1048 |
{
|
1032 |
|
int iomemtype[5];
|
1033 |
1049 |
struct omap_dss_s *s = (struct omap_dss_s *)
|
1034 |
1050 |
g_malloc0(sizeof(struct omap_dss_s));
|
1035 |
1051 |
|
... | ... | |
1037 |
1053 |
s->drq = drq;
|
1038 |
1054 |
omap_dss_reset(s);
|
1039 |
1055 |
|
1040 |
|
iomemtype[0] = cpu_register_io_memory(omap_diss1_readfn,
|
1041 |
|
omap_diss1_writefn, s, DEVICE_NATIVE_ENDIAN);
|
1042 |
|
iomemtype[1] = cpu_register_io_memory(omap_disc1_readfn,
|
1043 |
|
omap_disc1_writefn, s, DEVICE_NATIVE_ENDIAN);
|
1044 |
|
iomemtype[2] = cpu_register_io_memory(omap_rfbi1_readfn,
|
1045 |
|
omap_rfbi1_writefn, s, DEVICE_NATIVE_ENDIAN);
|
1046 |
|
iomemtype[3] = cpu_register_io_memory(omap_venc1_readfn,
|
1047 |
|
omap_venc1_writefn, s, DEVICE_NATIVE_ENDIAN);
|
1048 |
|
iomemtype[4] = cpu_register_io_memory(omap_im3_readfn,
|
1049 |
|
omap_im3_writefn, s, DEVICE_NATIVE_ENDIAN);
|
1050 |
|
omap_l4_attach(ta, 0, iomemtype[0]);
|
1051 |
|
omap_l4_attach(ta, 1, iomemtype[1]);
|
1052 |
|
omap_l4_attach(ta, 2, iomemtype[2]);
|
1053 |
|
omap_l4_attach(ta, 3, iomemtype[3]);
|
1054 |
|
cpu_register_physical_memory(l3_base, 0x1000, iomemtype[4]);
|
|
1056 |
memory_region_init_io(&s->iomem_diss1, &omap_diss_ops, s, "omap.diss1",
|
|
1057 |
omap_l4_region_size(ta, 0));
|
|
1058 |
memory_region_init_io(&s->iomem_disc1, &omap_disc_ops, s, "omap.disc1",
|
|
1059 |
omap_l4_region_size(ta, 1));
|
|
1060 |
memory_region_init_io(&s->iomem_rfbi1, &omap_rfbi_ops, s, "omap.rfbi1",
|
|
1061 |
omap_l4_region_size(ta, 2));
|
|
1062 |
memory_region_init_io(&s->iomem_venc1, &omap_venc_ops, s, "omap.venc1",
|
|
1063 |
omap_l4_region_size(ta, 3));
|
|
1064 |
memory_region_init_io(&s->iomem_im3, &omap_im3_ops, s,
|
|
1065 |
"omap.im3", 0x1000);
|
|
1066 |
|
|
1067 |
omap_l4_attach_region(ta, 0, &s->iomem_diss1);
|
|
1068 |
omap_l4_attach_region(ta, 1, &s->iomem_disc1);
|
|
1069 |
omap_l4_attach_region(ta, 2, &s->iomem_rfbi1);
|
|
1070 |
omap_l4_attach_region(ta, 3, &s->iomem_venc1);
|
|
1071 |
memory_region_add_subregion(sysmem, l3_base, &s->iomem_im3);
|
1055 |
1072 |
|
1056 |
1073 |
#if 0
|
1057 |
1074 |
s->state = graphic_console_init(omap_update_display,
|