1
On behalve of Zoltan BALATON:
2
3
Hello,
1
Hello,
4
2
5
This is marked v3 to avoid confusion with previously separate patches
3
This is marked v5 to avoid confusion with previously posted
6
that already had v2, even if the series had no v2 yet.
4
alternative versions. This series is now based on master and contains
5
all patches needed to get AmigaOS and MorphOS work on pegasos2 with
6
sound and I'd like this to be merged for 8.0.
7
7
8
This series now includes all patches needed to get AmigaOS 4.1 run
8
Patch 1 is independent of the rest so could be merged separately but
9
well on pegasos2 and add audio output to this board. It has 3 parts:
9
further patches are needed to fix interrupts which is needed for the
10
patches 1-3 improve hw/display/sm501 model to avoid graphics problems
10
last patc implementing the via-ac97 sound part of the south bridge
11
that were present with AmigaOS; patches 4-6 fix PCI interrupt routing
11
chip used on pegasos2 so those patches depend on each other.
12
in VIA VT8231 model and in pegasos2 board that fixes PCI cards such as
13
network or sound card not working before; finally patches 7-8 add
14
basic implementation of the via-ac97 audio part of VT8231 (also used
15
on VT82C686B) for output that is the default audio device on pegasos2.
16
12
17
This version was re-tested by Rene Engel with latest AmigaOS version
13
Please review and somebody take care of merging this for 8.0 please. I
18
and runs as well as my original series did (posted a video with that
14
try to address review comments but it's likely too late to restart
19
before). This works now on an M1 MacStudio on macOS where it was
15
from scratch so keep it reasonable, it could always be improved later
20
unusable before. I've also tested it on Linux x86_64 with older
16
or fixed during the freeze if some issues are found.
21
AmigaOS version that also boots and makes sound and verified MorphOS
22
still boots and also has sound now.
23
24
One known problem with this version that includes Berhard's
25
alternative vt82c686 patches is with MorphOS which uses level
26
sensitive mode of the i8259 PIC that QEMU does not support so it hangs
27
when multiple devices try to raise a shared IRQ. I could work around
28
that in my otiginal series (see here:
29
https://lists.nongnu.org/archive/html/qemu-ppc/2023-02/msg00403.html )
30
where this works and was also tested, that version is available here:
31
https://osdn.net/projects/qmiga/scm/git/qemu/tree/pegasos2/
32
but I could not convince Bernhard so I now expect him to provide a
33
work around for that. This isn't a blocker though as MorphOS already
34
runs on mac99 and sam460ex and only available as a time limited demo
35
(they only sell licenses for real hardware) so not really usable apart
36
from testing anyway so getting it running on pegasos2 would be nice
37
but not a prioriey, more important is that AmigaOS runs for which this
38
is the only viable machine as sam460ex version runs much slower. So
39
I'd like this to be merged for 8.0 as it is now or only minor chnages
40
(or alternatively we can return to my series which was also tested the
41
same way and apart from different VIA IRQ router modelling contains
42
the same patches).
43
44
Please review and let me know who will take care of merging this for 8.0.
45
17
46
Regards,
18
Regards,
47
BALATON Zoltan
19
BALATON Zoltan
48
20
49
v4:
50
* Rebased onto "[PATCH v3 0/3] VT82xx PCI IRQ routing fixes"
51
52
Based-on: <20230227123316.18719-1-shentey@gmail.com>
53
"[PATCH v3 0/3] VT82xx PCI IRQ routing fixes"
54
55
BALATON Zoltan (7):
21
BALATON Zoltan (7):
56
hw/display/sm501: Implement more 2D raster operations
57
hw/display/sm501: Add fallbacks to pixman routines
58
hw/display/sm501: Add debug property to control pixman usage
22
hw/display/sm501: Add debug property to control pixman usage
59
hw/isa/vt82c686: Declare gpio inputs so it can be connected in board
23
Revert "hw/isa/vt82c686: Remove intermediate IRQ forwarder"
60
code
24
hw/isa/vt82c686: Implement PCI IRQ routing
61
hw/ppc/pegasos2: Fix PCI interrupt routing
25
hw/ppc/pegasos2: Fix PCI interrupt routing
62
hw/audio/ac97: Split off some definitions to a header
26
hw/isa/vt82c686: Work around missing level sensitive irq in i8259
27
model
28
hw/usb/vt82c686-uhci-pci: Use PCI IRQ routing
63
hw/audio/via-ac97: Basic implementation of audio playback
29
hw/audio/via-ac97: Basic implementation of audio playback
64
30
65
hw/audio/ac97.h | 65 ++++++
31
hw/audio/trace-events | 6 +
66
include/hw/isa/vt82c686.h | 25 +++
32
hw/audio/via-ac97.c | 455 ++++++++++++++++++++++++++++++++++++-
67
hw/audio/ac97.c | 43 +---
33
hw/display/sm501.c | 18 +-
68
hw/audio/via-ac97.c | 455 +++++++++++++++++++++++++++++++++++++-
34
hw/isa/trace-events | 1 +
69
hw/display/sm501.c | 119 +++++++---
35
hw/isa/vt82c686.c | 59 ++++-
70
hw/isa/vt82c686.c | 3 +-
36
hw/pci-host/mv64361.c | 4 -
71
hw/pci-host/mv64361.c | 4 -
37
hw/ppc/pegasos2.c | 26 ++-
72
hw/ppc/pegasos2.c | 20 +-
38
hw/usb/vt82c686-uhci-pci.c | 12 -
73
hw/audio/trace-events | 6 +
39
include/hw/isa/vt82c686.h | 25 ++
74
hw/isa/trace-events | 1 +
40
9 files changed, 577 insertions(+), 29 deletions(-)
75
10 files changed, 662 insertions(+), 79 deletions(-)
76
create mode 100644 hw/audio/ac97.h
77
41
78
--
42
--
79
2.39.2
43
2.30.8
80
diff view generated by jsdifflib
1
From: BALATON Zoltan <balaton@eik.bme.hu>
2
3
Add a property to allow disabling pixman and always use the fallbacks
1
Add a property to allow disabling pixman and always use the fallbacks
4
for different operations which is useful for testing different drawing
2
for different operations which is useful for testing different drawing
5
methods or debugging pixman related issues.
3
methods or debugging pixman related issues.
6
4
7
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
5
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
8
Message-Id: <dfd40c3c45fa606e64c22d9010d43d3cf8bd32f8.1677445307.git.balaton@eik.bme.hu>
9
---
6
---
10
hw/display/sm501.c | 18 +++++++++++++++---
7
hw/display/sm501.c | 18 +++++++++++++++---
11
1 file changed, 15 insertions(+), 3 deletions(-)
8
1 file changed, 15 insertions(+), 3 deletions(-)
12
9
13
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
10
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
...
...
56
+ if (!(s->use_pixman & BIT(0)) || (width == 1 && height == 1) ||
53
+ if (!(s->use_pixman & BIT(0)) || (width == 1 && height == 1) ||
57
!pixman_fill((uint32_t *)&s->local_mem[dst_base],
54
!pixman_fill((uint32_t *)&s->local_mem[dst_base],
58
dst_pitch * bypp / sizeof(uint32_t), 8 * bypp,
55
dst_pitch * bypp / sizeof(uint32_t), 8 * bypp,
59
dst_x, dst_y, width, height, color)) {
56
dst_x, dst_y, width, height, color)) {
60
@@ -XXX,XX +XXX,XX @@ static void sm501_realize_sysbus(DeviceState *dev, Error **errp)
57
@@ -XXX,XX +XXX,XX @@ static void sm501_realize_sysbus(DeviceState *dev, Error **errp)
58
61
static Property sm501_sysbus_properties[] = {
59
static Property sm501_sysbus_properties[] = {
62
DEFINE_PROP_UINT32("vram-size", SM501SysBusState, vram_size, 0),
60
DEFINE_PROP_UINT32("vram-size", SM501SysBusState, vram_size, 0),
63
DEFINE_PROP_UINT32("base", SM501SysBusState, base, 0),
64
+ DEFINE_PROP_UINT8("x-pixman", SM501SysBusState, state.use_pixman, 7),
61
+ DEFINE_PROP_UINT8("x-pixman", SM501SysBusState, state.use_pixman, 7),
65
DEFINE_PROP_END_OF_LIST(),
62
DEFINE_PROP_END_OF_LIST(),
66
};
63
};
67
64
68
@@ -XXX,XX +XXX,XX @@ static void sm501_realize_pci(PCIDevice *dev, Error **errp)
65
@@ -XXX,XX +XXX,XX @@ static void sm501_realize_pci(PCIDevice *dev, Error **errp)
...
...
91
+ .instance_init = sm501_pci_init,
88
+ .instance_init = sm501_pci_init,
92
.interfaces = (InterfaceInfo[]) {
89
.interfaces = (InterfaceInfo[]) {
93
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
90
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
94
{ },
91
{ },
95
--
92
--
96
2.39.2
93
2.30.8
diff view generated by jsdifflib
1
From: BALATON Zoltan <balaton@eik.bme.hu>
1
This partially reverts commit bb98e0f59cde846666d9fddc60ae74ef7ddfca17
2
keeping the rename of a state field but reverting other cahanges which
3
break interrupts on pegasos2.
2
4
3
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
5
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
4
Tested-by: Rene Engel <ReneEngel80@emailn.de>
5
---
6
---
6
hw/isa/vt82c686.c | 1 +
7
hw/isa/vt82c686.c | 10 +++++++++-
7
1 file changed, 1 insertion(+)
8
1 file changed, 9 insertions(+), 1 deletion(-)
8
9
9
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
10
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
10
index XXXXXXX..XXXXXXX 100644
11
index XXXXXXX..XXXXXXX 100644
11
--- a/hw/isa/vt82c686.c
12
--- a/hw/isa/vt82c686.c
12
+++ b/hw/isa/vt82c686.c
13
+++ b/hw/isa/vt82c686.c
13
@@ -XXX,XX +XXX,XX @@ static void via_isa_realize(PCIDevice *d, Error **errp)
14
@@ -XXX,XX +XXX,XX @@ void via_isa_set_irq(PCIDevice *d, int n, int level)
15
qemu_set_irq(s->isa_irqs_in[n], level);
16
}
17
18
+static void via_isa_request_i8259_irq(void *opaque, int irq, int level)
19
+{
20
+ ViaISAState *s = opaque;
21
+ qemu_set_irq(s->cpu_intr, level);
22
+}
23
+
24
static void via_isa_realize(PCIDevice *d, Error **errp)
25
{
26
ViaISAState *s = VIA_ISA(d);
27
DeviceState *dev = DEVICE(d);
28
PCIBus *pci_bus = pci_get_bus(d);
29
+ qemu_irq *isa_irq;
30
ISABus *isa_bus;
14
int i;
31
int i;
15
32
16
qdev_init_gpio_out(dev, &s->cpu_intr, 1);
33
qdev_init_gpio_out(dev, &s->cpu_intr, 1);
17
+ qdev_init_gpio_in_named(dev, via_isa_set_pci_irq, "pirq", PCI_NUM_PINS);
34
+ isa_irq = qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1);
18
isa_irq = qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1);
19
isa_bus = isa_bus_new(dev, pci_address_space(d), pci_address_space_io(d),
35
isa_bus = isa_bus_new(dev, pci_address_space(d), pci_address_space_io(d),
20
errp);
36
errp);
37
38
@@ -XXX,XX +XXX,XX @@ static void via_isa_realize(PCIDevice *d, Error **errp)
39
return;
40
}
41
42
- s->isa_irqs_in = i8259_init(isa_bus, s->cpu_intr);
43
+ s->isa_irqs_in = i8259_init(isa_bus, *isa_irq);
44
isa_bus_register_input_irqs(isa_bus, s->isa_irqs_in);
45
i8254_pit_init(isa_bus, 0x40, 0, NULL);
46
i8257_dma_init(isa_bus, 0);
21
--
47
--
22
2.39.2
48
2.30.8
diff view generated by jsdifflib
1
From: BALATON Zoltan <balaton@eik.bme.hu>
1
The real VIA south bridges implement a PCI IRQ router which is configured
2
by the BIOS or the OS. In order to respect these configurations, QEMU
3
needs to implement it as well. The real chip may allow routing IRQs from
4
internal functions independently of PCI interrupts but since guests
5
usually configute it to a single shared interrupt we don't model that
6
here for simplicity.
2
7
3
Pixman may return false if it does not have a suitable implementation.
8
Note: The implementation was taken from piix4_set_irq() in hw/isa/piix4.
4
Add fallbacks to handle such cases.
5
9
10
Suggested-by: Bernhard Beschow <shentey@gmail.com>
6
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
11
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
7
Reported-by: Rene Engel <ReneEngel80@emailn.de>
8
Tested-by: Rene Engel <ReneEngel80@emailn.de>
9
Message-Id: <20ed9442a0146238254ccc340c0d1efa226c6356.1677445307.git.balaton@eik.bme.hu>
10
---
12
---
11
hw/display/sm501.c | 75 ++++++++++++++++++++++++++++++++--------------
13
hw/isa/vt82c686.c | 38 +++++++++++++++++++++++++++++++++++++-
12
1 file changed, 52 insertions(+), 23 deletions(-)
14
1 file changed, 37 insertions(+), 1 deletion(-)
13
15
14
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
16
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
15
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
16
--- a/hw/display/sm501.c
18
--- a/hw/isa/vt82c686.c
17
+++ b/hw/display/sm501.c
19
+++ b/hw/isa/vt82c686.c
18
@@ -XXX,XX +XXX,XX @@ static void sm501_2d_operation(SM501State *s)
20
@@ -XXX,XX +XXX,XX @@ static void via_isa_request_i8259_irq(void *opaque, int irq, int level)
19
unsigned int dst_pitch = (s->twoD_pitch >> 16) & 0x1FFF;
21
qemu_set_irq(s->cpu_intr, level);
20
int crt = (s->dc_crt_control & SM501_DC_CRT_CONTROL_SEL) ? 1 : 0;
22
}
21
int fb_len = get_width(s, crt) * get_height(s, crt) * get_bpp(s, crt);
23
22
- bool overlap = false;
24
+static int via_isa_get_pci_irq(const ViaISAState *s, int irq_num)
23
+ bool overlap = false, fallback = false;
25
+{
24
26
+ switch (irq_num) {
25
if ((s->twoD_stretch >> 16) & 0xF) {
27
+ case 0:
26
qemu_log_mask(LOG_UNIMP, "sm501: only XY addressing is supported.\n");
28
+ return s->dev.config[0x55] >> 4;
27
@@ -XXX,XX +XXX,XX @@ static void sm501_2d_operation(SM501State *s)
29
+ case 1:
28
if (tmp_stride * sizeof(uint32_t) * height > sizeof(tmp_buf)) {
30
+ return s->dev.config[0x56] & 0xf;
29
tmp = g_malloc(tmp_stride * sizeof(uint32_t) * height);
31
+ case 2:
30
}
32
+ return s->dev.config[0x56] >> 4;
31
- pixman_blt((uint32_t *)&s->local_mem[src_base], tmp,
33
+ case 3:
32
- src_pitch * bypp / sizeof(uint32_t),
34
+ return s->dev.config[0x57] >> 4;
33
- tmp_stride, 8 * bypp, 8 * bypp,
35
+ }
34
- src_x, src_y, 0, 0, width, height);
36
+ return 0;
35
- pixman_blt(tmp, (uint32_t *)&s->local_mem[dst_base],
37
+}
36
- tmp_stride,
38
+
37
- dst_pitch * bypp / sizeof(uint32_t),
39
+static void via_isa_set_pci_irq(void *opaque, int irq_num, int level)
38
- 8 * bypp, 8 * bypp,
40
+{
39
- 0, 0, dst_x, dst_y, width, height);
41
+ ViaISAState *s = opaque;
40
+ fallback = !pixman_blt((uint32_t *)&s->local_mem[src_base],
42
+ PCIBus *bus = pci_get_bus(&s->dev);
41
+ tmp,
43
+ int i, pic_level, pic_irq = via_isa_get_pci_irq(s, irq_num);
42
+ src_pitch * bypp / sizeof(uint32_t),
44
+
43
+ tmp_stride,
45
+ if (unlikely(pic_irq == 0 || pic_irq == 2 || pic_irq > 14)) {
44
+ 8 * bypp, 8 * bypp,
46
+ return;
45
+ src_x, src_y, 0, 0, width, height);
47
+ }
46
+ if (!fallback) {
48
+
47
+ fallback = !pixman_blt(tmp,
49
+ /* The pic level is the logical OR of all the PCI irqs mapped to it. */
48
+ (uint32_t *)&s->local_mem[dst_base],
50
+ pic_level = 0;
49
+ tmp_stride,
51
+ for (i = 0; i < PCI_NUM_PINS; i++) {
50
+ dst_pitch * bypp / sizeof(uint32_t),
52
+ if (pic_irq == via_isa_get_pci_irq(s, i)) {
51
+ 8 * bypp, 8 * bypp,
53
+ pic_level |= pci_bus_get_irq_level(bus, i);
52
+ 0, 0, dst_x, dst_y, width, height);
54
+ }
53
+ }
55
+ }
54
if (tmp != tmp_buf) {
56
+ /* Now we change the pic irq level according to the via irq mappings. */
55
g_free(tmp);
57
+ qemu_set_irq(s->isa_irqs_in[pic_irq], pic_level);
56
}
58
+}
57
} else {
59
+
58
- pixman_blt((uint32_t *)&s->local_mem[src_base],
60
static void via_isa_realize(PCIDevice *d, Error **errp)
59
- (uint32_t *)&s->local_mem[dst_base],
61
{
60
- src_pitch * bypp / sizeof(uint32_t),
62
ViaISAState *s = VIA_ISA(d);
61
- dst_pitch * bypp / sizeof(uint32_t),
63
@@ -XXX,XX +XXX,XX @@ static void via_isa_realize(PCIDevice *d, Error **errp)
62
- 8 * bypp, 8 * bypp,
64
63
- src_x, src_y, dst_x, dst_y, width, height);
65
qdev_init_gpio_out(dev, &s->cpu_intr, 1);
64
+ fallback = !pixman_blt((uint32_t *)&s->local_mem[src_base],
66
isa_irq = qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1);
65
+ (uint32_t *)&s->local_mem[dst_base],
67
+ qdev_init_gpio_in_named(dev, via_isa_set_pci_irq, "pirq", PCI_NUM_PINS);
66
+ src_pitch * bypp / sizeof(uint32_t),
68
isa_bus = isa_bus_new(dev, pci_address_space(d), pci_address_space_io(d),
67
+ dst_pitch * bypp / sizeof(uint32_t),
69
errp);
68
+ 8 * bypp, 8 * bypp, src_x, src_y,
70
-
69
+ dst_x, dst_y, width, height);
71
if (!isa_bus) {
70
+ }
72
return;
71
+ if (fallback) {
72
+ uint8_t *sp = s->local_mem + src_base;
73
+ uint8_t *d = s->local_mem + dst_base;
74
+ unsigned int y, i, j;
75
+ for (y = 0; y < height; y++) {
76
+ if (overlap) { /* overlap also means rtl */
77
+ i = (dst_y + height - 1 - y) * dst_pitch;
78
+ i = (dst_x + i) * bypp;
79
+ j = (src_y + height - 1 - y) * src_pitch;
80
+ j = (src_x + j) * bypp;
81
+ memmove(&d[i], &sp[j], width * bypp);
82
+ } else {
83
+ i = (dst_x + (dst_y + y) * dst_pitch) * bypp;
84
+ j = (src_x + (src_y + y) * src_pitch) * bypp;
85
+ memcpy(&d[i], &sp[j], width * bypp);
86
+ }
87
+ }
88
}
89
}
90
break;
91
@@ -XXX,XX +XXX,XX @@ static void sm501_2d_operation(SM501State *s)
92
color = cpu_to_le16(color);
93
}
94
95
- if (width == 1 && height == 1) {
96
- unsigned int i = (dst_x + dst_y * dst_pitch) * bypp;
97
- stn_he_p(&s->local_mem[dst_base + i], bypp, color);
98
- } else {
99
- pixman_fill((uint32_t *)&s->local_mem[dst_base],
100
- dst_pitch * bypp / sizeof(uint32_t),
101
- 8 * bypp, dst_x, dst_y, width, height, color);
102
+ if ((width == 1 && height == 1) ||
103
+ !pixman_fill((uint32_t *)&s->local_mem[dst_base],
104
+ dst_pitch * bypp / sizeof(uint32_t), 8 * bypp,
105
+ dst_x, dst_y, width, height, color)) {
106
+ /* fallback when pixman failed or we don't want to call it */
107
+ uint8_t *d = s->local_mem + dst_base;
108
+ unsigned int x, y, i;
109
+ for (y = 0; y < height; y++, i += dst_pitch * bypp) {
110
+ i = (dst_x + (dst_y + y) * dst_pitch) * bypp;
111
+ for (x = 0; x < width; x++, i += bypp) {
112
+ stn_he_p(&d[i], bypp, color);
113
+ }
114
+ }
115
}
116
break;
117
}
73
}
118
--
74
--
119
2.39.2
75
2.30.8
diff view generated by jsdifflib
1
From: BALATON Zoltan <balaton@eik.bme.hu>
2
3
According to the PegasosII schematics the PCI interrupt lines are
1
According to the PegasosII schematics the PCI interrupt lines are
4
connected to both the gpp pins of the Mv64361 north bridge and the
2
connected to both the gpp pins of the Mv64361 north bridge and the
5
PINT pins of the VT8231 south bridge so guests can get interrupts from
3
PINT pins of the VT8231 south bridge so guests can get interrupts from
6
either of these. So far we only had the MV64361 connections which
4
either of these. So far we only had the MV64361 connections which
7
worked for on board devices but for additional PCI devices (such as
5
worked for on board devices but for additional PCI devices (such as
...
...
13
match board firmware for guests that expect this.
11
match board firmware for guests that expect this.
14
12
15
This fixes PCI interrupts on pegasos2 under Linux, MorphOS and AmigaOS.
13
This fixes PCI interrupts on pegasos2 under Linux, MorphOS and AmigaOS.
16
14
17
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
15
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
18
Tested-by: Rene Engel <ReneEngel80@emailn.de>
19
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
16
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
20
Message-Id: <eca1ecce0b814ece8d285cb869ff839130a37b70.1677445307.git.balaton@eik.bme.hu>
21
---
17
---
22
hw/pci-host/mv64361.c | 4 ----
18
hw/pci-host/mv64361.c | 4 ----
23
hw/ppc/pegasos2.c | 20 +++++++++++++++++++-
19
hw/ppc/pegasos2.c | 26 +++++++++++++++++++++++++-
24
2 files changed, 19 insertions(+), 5 deletions(-)
20
2 files changed, 25 insertions(+), 5 deletions(-)
25
21
26
diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
22
diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
27
index XXXXXXX..XXXXXXX 100644
23
index XXXXXXX..XXXXXXX 100644
28
--- a/hw/pci-host/mv64361.c
24
--- a/hw/pci-host/mv64361.c
29
+++ b/hw/pci-host/mv64361.c
25
+++ b/hw/pci-host/mv64361.c
...
...
93
+ pm->via_pirq[i] = qdev_get_gpio_in_named(DEVICE(via), "pirq", i);
89
+ pm->via_pirq[i] = qdev_get_gpio_in_named(DEVICE(via), "pirq", i);
94
+ }
90
+ }
95
object_property_add_alias(OBJECT(machine), "rtc-time",
91
object_property_add_alias(OBJECT(machine), "rtc-time",
96
object_resolve_path_component(via, "rtc"),
92
object_resolve_path_component(via, "rtc"),
97
"date");
93
"date");
94
@@ -XXX,XX +XXX,XX @@ static void pegasos2_machine_reset(MachineState *machine, ShutdownCause reason)
95
PCI_INTERRUPT_LINE, 2, 0x9);
96
pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) |
97
0x50, 1, 0x2);
98
+ pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) |
99
+ 0x55, 1, 0x90);
100
+ pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) |
101
+ 0x56, 1, 0x99);
102
+ pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) |
103
+ 0x57, 1, 0x90);
104
105
pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 1) << 8) |
106
PCI_INTERRUPT_LINE, 2, 0x109);
98
--
107
--
99
2.39.2
108
2.30.8
diff view generated by jsdifflib
1
From: BALATON Zoltan <balaton@eik.bme.hu>
1
MorphOS sets the ISA PIC to level sensitive mode but QEMU does not
2
2
support that so this causes a freeze if multiple devices try to raise
3
These can be shared with other AC97 implementations.
3
a shared interrupt. Work around it by lowering the interrupt before
4
raising it again if it is already raised. This could be reverted when
5
the i8259 model is fixed.
4
6
5
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
7
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
6
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
7
Message-Id: <6f0980fdc3753624be6f3935a6ab0a2dc1df4b30.1677445307.git.balaton@eik.bme.hu>
8
---
8
---
9
hw/audio/ac97.h | 65 +++++++++++++++++++++++++++++++++++++++++++++++++
9
hw/isa/vt82c686.c | 9 +++++++++
10
hw/audio/ac97.c | 43 +-------------------------------
10
1 file changed, 9 insertions(+)
11
2 files changed, 66 insertions(+), 42 deletions(-)
12
create mode 100644 hw/audio/ac97.h
13
11
14
diff --git a/hw/audio/ac97.h b/hw/audio/ac97.h
12
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
15
new file mode 100644
16
index XXXXXXX..XXXXXXX
17
--- /dev/null
18
+++ b/hw/audio/ac97.h
19
@@ -XXX,XX +XXX,XX @@
20
+/*
21
+ * Copyright (C) 2006 InnoTek Systemberatung GmbH
22
+ *
23
+ * This file is part of VirtualBox Open Source Edition (OSE), as
24
+ * available from http://www.virtualbox.org. This file is free software;
25
+ * you can redistribute it and/or modify it under the terms of the GNU
26
+ * General Public License as published by the Free Software Foundation,
27
+ * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
28
+ * distribution. VirtualBox OSE is distributed in the hope that it will
29
+ * be useful, but WITHOUT ANY WARRANTY of any kind.
30
+ *
31
+ * If you received this file as part of a commercial VirtualBox
32
+ * distribution, then only the terms of your commercial VirtualBox
33
+ * license agreement apply instead of the previous paragraph.
34
+ *
35
+ * Contributions after 2012-01-13 are licensed under the terms of the
36
+ * GNU GPL, version 2 or (at your option) any later version.
37
+ */
38
+
39
+#ifndef AC97_H
40
+#define AC97_H
41
+
42
+enum {
43
+ AC97_Reset = 0x00,
44
+ AC97_Master_Volume_Mute = 0x02,
45
+ AC97_Headphone_Volume_Mute = 0x04,
46
+ AC97_Master_Volume_Mono_Mute = 0x06,
47
+ AC97_Master_Tone_RL = 0x08,
48
+ AC97_PC_BEEP_Volume_Mute = 0x0A,
49
+ AC97_Phone_Volume_Mute = 0x0C,
50
+ AC97_Mic_Volume_Mute = 0x0E,
51
+ AC97_Line_In_Volume_Mute = 0x10,
52
+ AC97_CD_Volume_Mute = 0x12,
53
+ AC97_Video_Volume_Mute = 0x14,
54
+ AC97_Aux_Volume_Mute = 0x16,
55
+ AC97_PCM_Out_Volume_Mute = 0x18,
56
+ AC97_Record_Select = 0x1A,
57
+ AC97_Record_Gain_Mute = 0x1C,
58
+ AC97_Record_Gain_Mic_Mute = 0x1E,
59
+ AC97_General_Purpose = 0x20,
60
+ AC97_3D_Control = 0x22,
61
+ AC97_AC_97_RESERVED = 0x24,
62
+ AC97_Powerdown_Ctrl_Stat = 0x26,
63
+ AC97_Extended_Audio_ID = 0x28,
64
+ AC97_Extended_Audio_Ctrl_Stat = 0x2A,
65
+ AC97_PCM_Front_DAC_Rate = 0x2C,
66
+ AC97_PCM_Surround_DAC_Rate = 0x2E,
67
+ AC97_PCM_LFE_DAC_Rate = 0x30,
68
+ AC97_PCM_LR_ADC_Rate = 0x32,
69
+ AC97_MIC_ADC_Rate = 0x34,
70
+ AC97_6Ch_Vol_C_LFE_Mute = 0x36,
71
+ AC97_6Ch_Vol_L_R_Surround_Mute = 0x38,
72
+ AC97_Vendor_Reserved = 0x58,
73
+ AC97_Sigmatel_Analog = 0x6c, /* We emulate a Sigmatel codec */
74
+ AC97_Sigmatel_Dac2Invert = 0x6e, /* We emulate a Sigmatel codec */
75
+ AC97_Vendor_ID1 = 0x7c,
76
+ AC97_Vendor_ID2 = 0x7e
77
+};
78
+
79
+#define EACS_VRA 1
80
+#define EACS_VRM 8
81
+
82
+#define MUTE_SHIFT 15
83
+
84
+#endif /* AC97_H */
85
diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
86
index XXXXXXX..XXXXXXX 100644
13
index XXXXXXX..XXXXXXX 100644
87
--- a/hw/audio/ac97.c
14
--- a/hw/isa/vt82c686.c
88
+++ b/hw/audio/ac97.c
15
+++ b/hw/isa/vt82c686.c
89
@@ -XXX,XX +XXX,XX @@
16
@@ -XXX,XX +XXX,XX @@ struct ViaISAState {
90
#include "qemu/module.h"
17
PCIDevice dev;
91
#include "sysemu/dma.h"
18
qemu_irq cpu_intr;
92
#include "qom/object.h"
19
qemu_irq *isa_irqs_in;
93
-
20
+ uint16_t isa_irqs_state;
94
-enum {
21
ViaSuperIOState via_sio;
95
- AC97_Reset = 0x00,
22
MC146818RtcState rtc;
96
- AC97_Master_Volume_Mute = 0x02,
23
PCIIDEState ide;
97
- AC97_Headphone_Volume_Mute = 0x04,
24
@@ -XXX,XX +XXX,XX @@ static void via_isa_set_pci_irq(void *opaque, int irq_num, int level)
98
- AC97_Master_Volume_Mono_Mute = 0x06,
25
pic_level |= pci_bus_get_irq_level(bus, i);
99
- AC97_Master_Tone_RL = 0x08,
26
}
100
- AC97_PC_BEEP_Volume_Mute = 0x0A,
27
}
101
- AC97_Phone_Volume_Mute = 0x0C,
28
+ /* FIXME: workaround for i8259: level sensitive irq not supported */
102
- AC97_Mic_Volume_Mute = 0x0E,
29
+ if ((s->isa_irqs_state & BIT(pic_irq)) && pic_level) {
103
- AC97_Line_In_Volume_Mute = 0x10,
30
+ qemu_irq_lower(s->isa_irqs_in[pic_irq]);
104
- AC97_CD_Volume_Mute = 0x12,
31
+ } else if (pic_level) {
105
- AC97_Video_Volume_Mute = 0x14,
32
+ s->isa_irqs_state |= BIT(pic_irq);
106
- AC97_Aux_Volume_Mute = 0x16,
33
+ } else {
107
- AC97_PCM_Out_Volume_Mute = 0x18,
34
+ s->isa_irqs_state &= ~BIT(pic_irq);
108
- AC97_Record_Select = 0x1A,
35
+ }
109
- AC97_Record_Gain_Mute = 0x1C,
36
/* Now we change the pic irq level according to the via irq mappings. */
110
- AC97_Record_Gain_Mic_Mute = 0x1E,
37
qemu_set_irq(s->isa_irqs_in[pic_irq], pic_level);
111
- AC97_General_Purpose = 0x20,
38
}
112
- AC97_3D_Control = 0x22,
113
- AC97_AC_97_RESERVED = 0x24,
114
- AC97_Powerdown_Ctrl_Stat = 0x26,
115
- AC97_Extended_Audio_ID = 0x28,
116
- AC97_Extended_Audio_Ctrl_Stat = 0x2A,
117
- AC97_PCM_Front_DAC_Rate = 0x2C,
118
- AC97_PCM_Surround_DAC_Rate = 0x2E,
119
- AC97_PCM_LFE_DAC_Rate = 0x30,
120
- AC97_PCM_LR_ADC_Rate = 0x32,
121
- AC97_MIC_ADC_Rate = 0x34,
122
- AC97_6Ch_Vol_C_LFE_Mute = 0x36,
123
- AC97_6Ch_Vol_L_R_Surround_Mute = 0x38,
124
- AC97_Vendor_Reserved = 0x58,
125
- AC97_Sigmatel_Analog = 0x6c, /* We emulate a Sigmatel codec */
126
- AC97_Sigmatel_Dac2Invert = 0x6e, /* We emulate a Sigmatel codec */
127
- AC97_Vendor_ID1 = 0x7c,
128
- AC97_Vendor_ID2 = 0x7e
129
-};
130
+#include "ac97.h"
131
132
#define SOFT_VOLUME
133
#define SR_FIFOE 16 /* rwc */
134
@@ -XXX,XX +XXX,XX @@ enum {
135
#define BD_IOC (1 << 31)
136
#define BD_BUP (1 << 30)
137
138
-#define EACS_VRA 1
139
-#define EACS_VRM 8
140
-
141
-#define MUTE_SHIFT 15
142
-
143
#define TYPE_AC97 "AC97"
144
OBJECT_DECLARE_SIMPLE_TYPE(AC97LinkState, AC97)
145
146
--
39
--
147
2.39.2
40
2.30.8
148
149
diff view generated by jsdifflib
1
From: BALATON Zoltan <balaton@eik.bme.hu>
1
From: Bernhard Beschow <shentey@gmail.com>
2
2
3
Add simple implementation for two raster operations that are used by
3
According to the PCI specification, PCI_INTERRUPT_LINE shall have no
4
AmigaOS which fixes graphics problems in some programs using these.
4
effect on hardware operations. Now that the VIA south bridges implement
5
the internal PCI interrupt router let's be more conformant to the PCI
6
specification.
5
7
8
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
6
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
9
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
7
Reported-by: Rene Engel <ReneEngel80@emailn.de>
8
Tested-by: Rene Engel <ReneEngel80@emailn.de>
9
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
10
Message-Id: <17ef3c59dc7868f75034e9ebe21e2999c8f718d4.1677445307.git.balaton@eik.bme.hu>
11
---
10
---
12
hw/display/sm501.c | 30 +++++++++++++++++++++++++++++-
11
hw/usb/vt82c686-uhci-pci.c | 12 ------------
13
1 file changed, 29 insertions(+), 1 deletion(-)
12
1 file changed, 12 deletions(-)
14
13
15
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
14
diff --git a/hw/usb/vt82c686-uhci-pci.c b/hw/usb/vt82c686-uhci-pci.c
16
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
17
--- a/hw/display/sm501.c
16
--- a/hw/usb/vt82c686-uhci-pci.c
18
+++ b/hw/display/sm501.c
17
+++ b/hw/usb/vt82c686-uhci-pci.c
19
@@ -XXX,XX +XXX,XX @@ static void sm501_2d_operation(SM501State *s)
18
@@ -XXX,XX +XXX,XX @@
20
}
19
#include "qemu/osdep.h"
21
20
-#include "hw/irq.h"
22
if ((rop_mode && rop == 0x5) || (!rop_mode && rop == 0x55)) {
21
#include "hw/isa/vt82c686.h"
23
- /* Invert dest, is there a way to do this with pixman? */
22
#include "hcd-uhci.h"
24
+ /* DSTINVERT, is there a way to do this with pixman? */
23
25
unsigned int x, y, i;
24
-static void uhci_isa_set_irq(void *opaque, int irq_num, int level)
26
uint8_t *d = s->local_mem + dst_base;
25
-{
27
26
- UHCIState *s = opaque;
28
@@ -XXX,XX +XXX,XX @@ static void sm501_2d_operation(SM501State *s)
27
- uint8_t irq = pci_get_byte(s->dev.config + PCI_INTERRUPT_LINE);
29
stn_he_p(&d[i], bypp, ~ldn_he_p(&d[i], bypp));
28
- if (irq > 0 && irq < 15) {
30
}
29
- via_isa_set_irq(pci_get_function_0(&s->dev), irq, level);
31
}
30
- }
32
+ } else if (!rop_mode && rop == 0x99) {
31
-}
33
+ /* DSxn, is there a way to do this with pixman? */
32
-
34
+ unsigned int x, y, i, j;
33
static void usb_uhci_vt82c686b_realize(PCIDevice *dev, Error **errp)
35
+ uint8_t *sp = s->local_mem + src_base;
34
{
36
+ uint8_t *d = s->local_mem + dst_base;
35
UHCIState *s = UHCI(dev);
37
+
36
@@ -XXX,XX +XXX,XX @@ static void usb_uhci_vt82c686b_realize(PCIDevice *dev, Error **errp)
38
+ for (y = 0; y < height; y++) {
37
pci_set_long(pci_conf + 0xc0, 0x00002000);
39
+ i = (dst_x + (dst_y + y) * dst_pitch) * bypp;
38
40
+ j = (src_x + (src_y + y) * src_pitch) * bypp;
39
usb_uhci_common_realize(dev, errp);
41
+ for (x = 0; x < width; x++, i += bypp, j += bypp) {
40
- object_unref(s->irq);
42
+ stn_he_p(&d[i], bypp,
41
- s->irq = qemu_allocate_irq(uhci_isa_set_irq, s, 0);
43
+ ~(ldn_he_p(&sp[j], bypp) ^ ldn_he_p(&d[i], bypp)));
42
}
44
+ }
43
45
+ }
44
static UHCIInfo uhci_info[] = {
46
+ } else if (!rop_mode && rop == 0xee) {
47
+ /* SRCPAINT, is there a way to do this with pixman? */
48
+ unsigned int x, y, i, j;
49
+ uint8_t *sp = s->local_mem + src_base;
50
+ uint8_t *d = s->local_mem + dst_base;
51
+
52
+ for (y = 0; y < height; y++) {
53
+ i = (dst_x + (dst_y + y) * dst_pitch) * bypp;
54
+ j = (src_x + (src_y + y) * src_pitch) * bypp;
55
+ for (x = 0; x < width; x++, i += bypp, j += bypp) {
56
+ stn_he_p(&d[i], bypp,
57
+ ldn_he_p(&sp[j], bypp) | ldn_he_p(&d[i], bypp));
58
+ }
59
+ }
60
} else {
61
/* Do copy src for unimplemented ops, better than unpainted area */
62
if ((rop_mode && (rop != 0xc || rop2_source_is_pattern)) ||
63
--
45
--
64
2.39.2
46
2.30.8
diff view generated by jsdifflib
1
From: BALATON Zoltan <balaton@eik.bme.hu>
2
3
Add basic implementation of the AC'97 sound part used in VIA south
1
Add basic implementation of the AC'97 sound part used in VIA south
4
bridge chips. Not all features of the device is emulated, only one
2
bridge chips. Not all features of the device is emulated, only one
5
playback channel is supported for now but this is enough to get sound
3
playback channel is supported for now but this is enough to get sound
6
output from some guests using this device on pegasos2.
4
output from some guests using this device on pegasos2.
7
5
8
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
6
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
9
Tested-by: Rene Engel <ReneEngel80@emailn.de>
10
Message-Id: <0f210fb86b832649821fe142d58634319c091874.1677445307.git.balaton@eik.bme.hu>
11
---
7
---
8
v5: rebased on master
9
v3: Fixed CLEN_LEN mask, add check to avoid runaway DMA and some
10
tweaks to PCI config regs which now make it work with AmigaOS too.
11
This is probably as good as it gets for QEMU 8.0
12
13
hw/audio/trace-events | 6 +
14
hw/audio/via-ac97.c | 455 +++++++++++++++++++++++++++++++++++++-
15
hw/isa/trace-events | 1 +
16
hw/isa/vt82c686.c | 2 +-
12
include/hw/isa/vt82c686.h | 25 +++
17
include/hw/isa/vt82c686.h | 25 +++
13
hw/audio/via-ac97.c | 455 +++++++++++++++++++++++++++++++++++++-
14
hw/isa/vt82c686.c | 2 +-
15
hw/audio/trace-events | 6 +
16
hw/isa/trace-events | 1 +
17
5 files changed, 482 insertions(+), 7 deletions(-)
18
5 files changed, 482 insertions(+), 7 deletions(-)
18
19
19
diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h
20
diff --git a/hw/audio/trace-events b/hw/audio/trace-events
20
index XXXXXXX..XXXXXXX 100644
21
index XXXXXXX..XXXXXXX 100644
21
--- a/include/hw/isa/vt82c686.h
22
--- a/hw/audio/trace-events
22
+++ b/include/hw/isa/vt82c686.h
23
+++ b/hw/audio/trace-events
23
@@ -XXX,XX +XXX,XX @@
24
@@ -XXX,XX +XXX,XX @@ hda_audio_running(const char *stream, int nr, bool running) "st %s, nr %d, run %
24
#ifndef HW_VT82C686_H
25
hda_audio_format(const char *stream, int chan, const char *fmt, int freq) "st %s, %d x %s @ %d Hz"
25
#define HW_VT82C686_H
26
hda_audio_adjust(const char *stream, int pos) "st %s, pos %d"
26
27
hda_audio_overrun(const char *stream) "st %s"
27
+#include "hw/pci/pci_device.h"
28
+
28
+#include "audio/audio.h"
29
+#via-ac97.c
29
30
+via_ac97_codec_write(uint8_t addr, uint16_t val) "0x%x <- 0x%x"
30
#define TYPE_VT82C686B_ISA "vt82c686b-isa"
31
+via_ac97_sgd_fetch(uint32_t curr, uint32_t addr, char stop, char eol, char flag, uint32_t len) "curr=0x%x addr=0x%x %c%c%c len=%d"
31
#define TYPE_VT82C686B_USB_UHCI "vt82c686b-usb-uhci"
32
+via_ac97_sgd_read(uint64_t addr, unsigned size, uint64_t val) "0x%"PRIx64" %d -> 0x%"PRIx64
32
@@ -XXX,XX +XXX,XX @@
33
+via_ac97_sgd_write(uint64_t addr, unsigned size, uint64_t val) "0x%"PRIx64" %d <- 0x%"PRIx64
33
#define TYPE_VIA_IDE "via-ide"
34
#define TYPE_VIA_MC97 "via-mc97"
35
36
+typedef struct {
37
+ uint8_t stat;
38
+ uint8_t type;
39
+ uint32_t base;
40
+ uint32_t curr;
41
+ uint32_t addr;
42
+ uint32_t clen;
43
+} ViaAC97SGDChannel;
44
+
45
+OBJECT_DECLARE_SIMPLE_TYPE(ViaAC97State, VIA_AC97);
46
+
47
+struct ViaAC97State {
48
+ PCIDevice dev;
49
+ QEMUSoundCard card;
50
+ MemoryRegion sgd;
51
+ MemoryRegion fm;
52
+ MemoryRegion midi;
53
+ SWVoiceOut *vo;
54
+ ViaAC97SGDChannel aur;
55
+ uint16_t codec_regs[128];
56
+ uint32_t ac97_cmd;
57
+};
58
+
59
void via_isa_set_irq(PCIDevice *d, int n, int level);
60
61
#endif
62
diff --git a/hw/audio/via-ac97.c b/hw/audio/via-ac97.c
34
diff --git a/hw/audio/via-ac97.c b/hw/audio/via-ac97.c
63
index XXXXXXX..XXXXXXX 100644
35
index XXXXXXX..XXXXXXX 100644
64
--- a/hw/audio/via-ac97.c
36
--- a/hw/audio/via-ac97.c
65
+++ b/hw/audio/via-ac97.c
37
+++ b/hw/audio/via-ac97.c
66
@@ -XXX,XX +XXX,XX @@
38
@@ -XXX,XX +XXX,XX @@
...
...
558
- .instance_size = sizeof(PCIDevice),
530
- .instance_size = sizeof(PCIDevice),
559
+ .instance_size = sizeof(ViaAC97State),
531
+ .instance_size = sizeof(ViaAC97State),
560
.class_init = via_ac97_class_init,
532
.class_init = via_ac97_class_init,
561
.interfaces = (InterfaceInfo[]) {
533
.interfaces = (InterfaceInfo[]) {
562
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
534
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
535
diff --git a/hw/isa/trace-events b/hw/isa/trace-events
536
index XXXXXXX..XXXXXXX 100644
537
--- a/hw/isa/trace-events
538
+++ b/hw/isa/trace-events
539
@@ -XXX,XX +XXX,XX @@ apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x"
540
541
# vt82c686.c
542
via_isa_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
543
+via_pm_read(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
544
via_pm_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
545
via_pm_io_read(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
546
via_pm_io_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
563
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
547
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
564
index XXXXXXX..XXXXXXX 100644
548
index XXXXXXX..XXXXXXX 100644
565
--- a/hw/isa/vt82c686.c
549
--- a/hw/isa/vt82c686.c
566
+++ b/hw/isa/vt82c686.c
550
+++ b/hw/isa/vt82c686.c
567
@@ -XXX,XX +XXX,XX @@ struct ViaISAState {
551
@@ -XXX,XX +XXX,XX @@ struct ViaISAState {
...
...
571
- PCIDevice ac97;
555
- PCIDevice ac97;
572
+ ViaAC97State ac97;
556
+ ViaAC97State ac97;
573
PCIDevice mc97;
557
PCIDevice mc97;
574
};
558
};
575
559
576
diff --git a/hw/audio/trace-events b/hw/audio/trace-events
560
diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h
577
index XXXXXXX..XXXXXXX 100644
561
index XXXXXXX..XXXXXXX 100644
578
--- a/hw/audio/trace-events
562
--- a/include/hw/isa/vt82c686.h
579
+++ b/hw/audio/trace-events
563
+++ b/include/hw/isa/vt82c686.h
580
@@ -XXX,XX +XXX,XX @@ hda_audio_running(const char *stream, int nr, bool running) "st %s, nr %d, run %
564
@@ -XXX,XX +XXX,XX @@
581
hda_audio_format(const char *stream, int chan, const char *fmt, int freq) "st %s, %d x %s @ %d Hz"
565
#ifndef HW_VT82C686_H
582
hda_audio_adjust(const char *stream, int pos) "st %s, pos %d"
566
#define HW_VT82C686_H
583
hda_audio_overrun(const char *stream) "st %s"
567
584
+
568
+#include "hw/pci/pci_device.h"
585
+#via-ac97.c
569
+#include "audio/audio.h"
586
+via_ac97_codec_write(uint8_t addr, uint16_t val) "0x%x <- 0x%x"
570
587
+via_ac97_sgd_fetch(uint32_t curr, uint32_t addr, char stop, char eol, char flag, uint32_t len) "curr=0x%x addr=0x%x %c%c%c len=%d"
571
#define TYPE_VT82C686B_ISA "vt82c686b-isa"
588
+via_ac97_sgd_read(uint64_t addr, unsigned size, uint64_t val) "0x%"PRIx64" %d -> 0x%"PRIx64
572
#define TYPE_VT82C686B_USB_UHCI "vt82c686b-usb-uhci"
589
+via_ac97_sgd_write(uint64_t addr, unsigned size, uint64_t val) "0x%"PRIx64" %d <- 0x%"PRIx64
573
@@ -XXX,XX +XXX,XX @@
590
diff --git a/hw/isa/trace-events b/hw/isa/trace-events
574
#define TYPE_VIA_IDE "via-ide"
591
index XXXXXXX..XXXXXXX 100644
575
#define TYPE_VIA_MC97 "via-mc97"
592
--- a/hw/isa/trace-events
576
593
+++ b/hw/isa/trace-events
577
+typedef struct {
594
@@ -XXX,XX +XXX,XX @@ apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x"
578
+ uint8_t stat;
595
579
+ uint8_t type;
596
# vt82c686.c
580
+ uint32_t base;
597
via_isa_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
581
+ uint32_t curr;
598
+via_pm_read(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
582
+ uint32_t addr;
599
via_pm_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
583
+ uint32_t clen;
600
via_pm_io_read(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
584
+} ViaAC97SGDChannel;
601
via_pm_io_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
585
+
586
+OBJECT_DECLARE_SIMPLE_TYPE(ViaAC97State, VIA_AC97);
587
+
588
+struct ViaAC97State {
589
+ PCIDevice dev;
590
+ QEMUSoundCard card;
591
+ MemoryRegion sgd;
592
+ MemoryRegion fm;
593
+ MemoryRegion midi;
594
+ SWVoiceOut *vo;
595
+ ViaAC97SGDChannel aur;
596
+ uint16_t codec_regs[128];
597
+ uint32_t ac97_cmd;
598
+};
599
+
600
void via_isa_set_irq(PCIDevice *d, int n, int level);
601
602
#endif
602
--
603
--
603
2.39.2
604
2.30.8
diff view generated by jsdifflib