Pegasos2 fixes and audio output support
v8 cover Pegasos2 fixes and audio output support
Changes in this version:
v8:
- Last change to logging in patch 3 as asked by Bernhard v7:
- Added a comment and log to patch 3 as asked by Bernhard
- Added missed R-b tag to patch 5
- Patch 4 in this version is
Based-on: <[email protected]>
(hw/isa/vt82c686: Fix wiring of PIC -> CPU interrupt)
so whatever fix for that will be taken this should apply (revert and corresponding patch for fixing same problem was in v6 which can still be mixed and matched in this series if needed)
Only patches 1-3 don't yet have review, patch 1 and 2 are optional (patch 1 adds debug property useful for testing, should be easy to review; patch 2 fixes MorphOS on pegasos2 with PCI and USB devices) patch 3 is needed for the rest of the series and has been beaten to death already so it's about time to come to a conclusion with it at last.
BALATON Zoltan (4):
hw/display/sm501: Add debug property to control pixman usage hw/isa/vt82c686: Implement PCI IRQ routing hw/ppc/pegasos2: Fix PCI interrupt routing hw/audio/via-ac97: Basic implementation of audio playback
Bernhard Beschow (1):
hw/usb/vt82c686-uhci-pci: Use PCI IRQ routing
David Woodhouse (1):
hw/intc/i8259: Implement legacy LTIM Edge/Level Bank Select
hw/audio/trace-events | 6 + hw/audio/via-ac97.c | 455 +++++++++++++++++++++++++++++++- hw/display/sm501.c | 18 +- hw/intc/i8259.c | 10 +- hw/intc/i8259_common.c | 24 +- hw/isa/trace-events | 1 + hw/isa/vt82c686.c | 44 ++- hw/pci-host/mv64361.c | 4 - hw/ppc/pegasos2.c | 26 +- hw/usb/vt82c686-uhci-pci.c | 12 - include/hw/isa/i8259_internal.h | 1 + include/hw/isa/vt82c686.h | 25 ++ 12 files changed, 592 insertions(+), 34 deletions(-)
Signature · 1 line
2.30.8
PATCH v8 1/6 hw/display/sm501: Add debug property to control pixman usage
Add a property to allow disabling pixman and always use the fallbacks for different operations which is useful for testing different drawing methods or debugging pixman related issues.
--- hw/display/sm501.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
hw/display/sm501.c +15 -3
@@ -465,6 +465,7 @@ typedef struct SM501State {uint32_t last_width;uint32_t last_height;bool do_full_update;/* perform a full update next time */ +uint8_t use_pixman;I2CBus *i2c_bus;/* mmio registers */
@@ -827,7 +828,7 @@ static void sm501_2d_operation(SM501State *s) de = db + (width + (height -1 ) * dst_pitch) * bypp; overlap = (db < se && sb < de); } -if (overlap) { +if (overlap && (s->use_pixman &BIT (2 ))) {/* pixman can't do reverse blit: copy via temporary */ int tmp_stride =DIV_ROUND_UP (width * bypp,sizeof (uint32_t ));uint32_t *tmp = tmp_buf;
@@ -852,13 +853,15 @@ static void sm501_2d_operation(SM501State *s)if (tmp != tmp_buf) {g_free (tmp); } - }else { + }else if (!overlap && (s->use_pixman &BIT (1 ))) { fallback = !pixman_blt ((uint32_t *)&s->local_mem[src_base], (uint32_t *)&s->local_mem[dst_base], src_pitch * bypp /sizeof (uint32_t ), dst_pitch * bypp /sizeof (uint32_t ),8 * bypp,8 * bypp, src_x, src_y, dst_x, dst_y, width, height); + }else { + fallback = true; }if (fallback) {uint8_t *sp = s->local_mem + src_base;
@@ -891,7 +894,7 @@ static void sm501_2d_operation(SM501State *s) color =cpu_to_le16 (color); } -if ((width ==1 && height ==1 ) || +if (!(s->use_pixman &BIT (0 )) || (width ==1 && height ==1 ) || !pixman_fill ((uint32_t *)&s->local_mem[dst_base], dst_pitch * bypp /sizeof (uint32_t ),8 * bypp, dst_x, dst_y, width, height, color)) {
@@ -2035,6 +2038,7 @@ static void sm501_realize_sysbus(DeviceState *dev, Error **errp)static Property sm501_sysbus_properties[] = {DEFINE_PROP_UINT32 ("vram-size" , SM501SysBusState, vram_size,0 ), +DEFINE_PROP_UINT8 ("x-pixman" , SM501SysBusState, state.use_pixman,7 ),DEFINE_PROP_END_OF_LIST (), };
@@ -2122,6 +2126,7 @@ static void sm501_realize_pci(PCIDevice *dev, Error **errp)static Property sm501_pci_properties[] = {DEFINE_PROP_UINT32 ("vram-size" , SM501PCIState, vram_size,64 * MiB), +DEFINE_PROP_UINT8 ("x-pixman" , SM501PCIState, state.use_pixman,7 ),DEFINE_PROP_END_OF_LIST (), };
@@ -2162,11 +2167,18 @@ static void sm501_pci_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_sm501_pci; } +static void sm501_pci_init (Object *o) +{ +object_property_set_description (o,"x-pixman" ,"Use pixman for: " +"1: fill, 2: blit, 4: overlap blit" ); +} +static const TypeInfo sm501_pci_info = { .name =TYPE_PCI_SM501 , .parent =TYPE_PCI_DEVICE , .instance_size =sizeof (SM501PCIState), .class_init = sm501_pci_class_init, + .instance_init = sm501_pci_init, .interfaces = (InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
Signature · 1 line
2.30.8
PATCH v8 2/6 hw/intc/i8259: Implement legacy LTIM Edge/Level Bank Select
In reply to BALATON ZoltanFrom: David Woodhouse <[email protected]>
Back in the mists of time, before EISA came along and required per-pin level control in the ELCR register, the i8259 had a single chip-wide level-mode control in bit 3 of ICW1.
Even in the PIIX3 datasheet from 1996 this is documented as 'This bit is disabled', but apparently MorphOS is using it in the version of the i8259 which is in the Pegasos2 board as part of the VT8231 chipset.
It's easy enough to implement, and I think it's harmless enough to do so unconditionally.
--- hw/intc/i8259.c | 10 ++++------ hw/intc/i8259_common.c | 24 +++++++++++++++++++++++- include/hw/isa/i8259_internal.h | 1 + 3 files changed, 28 insertions(+), 7 deletions(-)
hw/intc/i8259.c +4 -6
@@ -133,7 +133,7 @@ static void pic_set_irq(void *opaque, int irq, int level) }#endif -if (s->elcr & mask) { +if (s->ltim || (s->elcr & mask)) {/* level triggered */ if (level) { s->irr |= mask;
@@ -167,7 +167,7 @@ static void pic_intack(PICCommonState *s, int irq) s->isr |= (1 << irq); }/* We don't clear a level sensitive interrupt here */ -if (!(s->elcr & (1 << irq))) { +if (!s->ltim && !(s->elcr & (1 << irq))) { s->irr &= ~(1 << irq); }pic_update_irq (s);
@@ -224,6 +224,7 @@ static void pic_reset(DeviceState *dev)PICCommonState *s =PIC_COMMON (dev); s->elcr =0 ; + s->ltim =0 ;pic_init_reset (s); }
@@ -243,10 +244,7 @@ static void pic_ioport_write(void *opaque, hwaddr addr64, s->init_state =1 ; s->init4 = val &1 ; s->single_mode = val &2 ; -if (val &0x08 ) { -qemu_log_mask (LOG_UNIMP , -"i8259: level sensitive irq not supported\n" ); - } + s->ltim = val &8 ; }else if (val &0x08 ) {if (val &0x04 ) { s->poll =1 ;
hw/intc/i8259_common.c +23 -1
@@ -51,7 +51,7 @@ void pic_reset_common(PICCommonState *s) s->special_fully_nested_mode =0 ; s->init4 =0 ; s->single_mode =0 ; -/* Note: ELCR is not reset */ +/* Note: ELCR and LTIM are not reset */ }static int pic_dispatch_pre_save (void *opaque)
@@ -144,6 +144,24 @@ static void pic_print_info(InterruptStatsProvider *obj, Monitor *mon) s->special_fully_nested_mode); } +static bool ltim_state_needed (void *opaque) +{ +PICCommonState *s =PIC_COMMON (opaque); + +return !!s->ltim; +} + +static const VMStateDescription vmstate_pic_ltim = { + .name ="i8259/ltim" , + .version_id =1 , + .minimum_version_id =1 , + .needed = ltim_state_needed, + .fields = (VMStateField []) { +VMSTATE_UINT8 (ltim, PICCommonState), +VMSTATE_END_OF_LIST () + } +}; +static const VMStateDescription vmstate_pic_common = { .name ="i8259" , .version_id =1 ,
@@ -168,6 +186,10 @@ static const VMStateDescription vmstate_pic_common = { VMSTATE_UINT8(single_mode, PICCommonState), VMSTATE_UINT8(elcr, PICCommonState),VMSTATE_END_OF_LIST () + }, + .subsections = (const VMStateDescription *[]) { + &vmstate_pic_ltim, +NULL } };
include/hw/isa/i8259_internal.h +1 -0
@@ -61,6 +61,7 @@ struct PICCommonState {uint8_t single_mode;/* true if slave pic is not initialized */ uint8_t elcr;/* PIIX edge/trigger selection*/ uint8_t elcr_mask; +uint8_t ltim;/* Edge/Level Bank Select (pre-PIIX, chip-wide) */ qemu_irq int_out[1 ];uint32_t master;/* reflects /SP input pin */ uint32_t iobase;
Signature · 1 line
2.30.8
PATCH v8 3/6 hw/isa/vt82c686: Implement PCI IRQ routing
In reply to BALATON ZoltanThe real VIA south bridges implement a PCI IRQ router which is configured by the BIOS or the OS. In order to respect these configurations, QEMU needs to implement it as well. The real chip may allow routing IRQs from internal functions independently of PCI interrupts but since guests usually configute it to a single shared interrupt we don't model that here for simplicity.
Note: The implementation was taken from piix4_set_irq() in hw/isa/piix4.
--- hw/isa/vt82c686.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
hw/isa/vt82c686.c +42 -0
@@ -600,6 +600,46 @@ void via_isa_set_irq(PCIDevice *d, int n, int level)qemu_set_irq (s->isa_irqs_in[n], level); } +static int via_isa_get_pci_irq (const ViaISAState *s,int irq_num) +{ +switch (irq_num) { +case 0 : +return s->dev.config[0x55 ] >>4 ; +case 1 : +return s->dev.config[0x56 ] &0xf ; +case 2 : +return s->dev.config[0x56 ] >>4 ; +case 3 : +return s->dev.config[0x57 ] >>4 ; + } +return 0 ; +} + +static void via_isa_set_pci_irq (void *opaque,int irq_num,int level) +{ +ViaISAState *s = opaque; +PCIBus *bus =pci_get_bus (&s->dev); +int i, pic_level, pic_irq =via_isa_get_pci_irq (s, irq_num); + +/* IRQ 0: disabled, IRQ 2,8,13: reserved */ +if (!pic_irq) { +return ; + } +if (unlikely (pic_irq ==2 || pic_irq ==8 || pic_irq ==13 )) { +qemu_log_mask (LOG_GUEST_ERROR ,"Invalid ISA IRQ routing" ); + } + +/* The pic level is the logical OR of all the PCI irqs mapped to it. */ + pic_level =0 ; +for (i =0 ; i <PCI_NUM_PINS ; i++) { +if (pic_irq ==via_isa_get_pci_irq (s, i)) { + pic_level |=pci_bus_get_irq_level (bus, i); + } + } +/* Now we change the pic irq level according to the via irq mappings. */ +qemu_set_irq (s->isa_irqs_in[pic_irq], pic_level); +} +static void via_isa_realize (PCIDevice *d,Error **errp) {ViaISAState *s =VIA_ISA (d);
@@ -620,6 +660,8 @@ static void via_isa_realize(PCIDevice *d, Error **errp)i8254_pit_init (isa_bus,0x40 ,0 ,NULL );i8257_dma_init (isa_bus,0 ); +qdev_init_gpio_in_named (dev, via_isa_set_pci_irq,"pirq" ,PCI_NUM_PINS ); +/* RTC */ qdev_prop_set_int32 (DEVICE (&s->rtc),"base_year" ,2000 );if (!qdev_realize (DEVICE (&s->rtc),BUS (isa_bus), errp)) {
Signature · 1 line
2.30.8
Re: [PATCH v8 3/6] hw/isa/vt82c686: Implement PCI IRQ routing
Quoted 68 lines · BALATON Zoltan
The real VIA south bridges implement a PCI IRQ router which is configured by the BIOS or the OS. In order to respect these configurations, QEMU needs to implement it as well. The real chip may allow routing IRQs from internal functions independently of PCI interrupts but since guests usually configute it to a single shared interrupt we don't model that here for simplicity.
Note: The implementation was taken from
piix4_set_irq()in hw/isa/piix4.Suggested-by Bernhard Beschow <[email protected]>Signed-off-by BALATON Zoltan <[email protected]>Tested-by Rene Engel <[email protected]>--- hw/isa/vt82c686.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)hw/isa/vt82c686.c +40
-0@@ -600,6 +600,46 @@ void via_isa_set_irq(PCIDevice *d, int n, int level)qemu_set_irq (s->isa_irqs_in[n], level); } +static int via_isa_get_pci_irq (const ViaISAState *s,int irq_num) +{ +switch (irq_num) { +case 0 : +return s->dev.config[0x55 ] >>4 ; +case 1 : +return s->dev.config[0x56 ] &0xf ; +case 2 : +return s->dev.config[0x56 ] >>4 ; +case 3 : +return s->dev.config[0x57 ] >>4 ; + } +return 0 ; +} + +static void via_isa_set_pci_irq (void *opaque,int irq_num,int level) +{ +ViaISAState *s = opaque; +PCIBus *bus =pci_get_bus (&s->dev); +int i, pic_level, pic_irq =via_isa_get_pci_irq (s, irq_num); + +/* IRQ 0: disabled, IRQ 2,8,13: reserved */ +if (!pic_irq) { +return ; + } +if (unlikely (pic_irq ==2 || pic_irq ==8 || pic_irq ==13 )) { +qemu_log_mask (LOG_GUEST_ERROR ,"Invalid ISA IRQ routing" ); + } + +/* The pic level is the logical OR of all the PCI irqs mapped to it. */ + pic_level =0 ; +for (i =0 ; i <PCI_NUM_PINS ; i++) { +if (pic_irq ==via_isa_get_pci_irq (s, i)) { + pic_level |=pci_bus_get_irq_level (bus, i); + } + } +/* Now we change the pic irq level according to the via irq mappings. */ +qemu_set_irq (s->isa_irqs_in[pic_irq], pic_level); +} +static void via_isa_realize (PCIDevice *d,Error **errp) {ViaISAState *s =VIA_ISA (d);
hw/isa/vt82c686.c static void via_isa_realize(PCIDevice *d, Error **errp) · line 667
Quoted 8 lines
hw/isa/vt82c686.c +2
-0@@ -620,6 +660,8 @@ static void via_isa_realize(PCIDevice *d, Error **errp)i8254_pit_init (isa_bus,0x40 ,0 ,NULL );i8257_dma_init (isa_bus,0 ); +qdev_init_gpio_in_named (dev, via_isa_set_pci_irq,"pirq" ,PCI_NUM_PINS ); +/* RTC */ qdev_prop_set_int32 (DEVICE (&s->rtc),"base_year" ,2000 );if (!qdev_realize (DEVICE (&s->rtc),BUS (isa_bus), errp)) {
Writing my previous response where I asked about the additional PCI interrupt connections to the MV64361, I realised that if you forget about the Northbridge component for a moment then things start to make a bit more sense.
At the moment we have 3 different scenarios:
1) ISA IRQ -> 8259 for all ISA devices
2) ISA IRQ -> 8259 *OR*
PCI IRQ -> PCI IRQ router -> 8259 for the PCI-IDE device
3) PCI IRQ -> PCI IRQ router -> 8259 for PCI devices
When you look at it this way it is easy to see for case 3 that the PCI IRQ routing mechanism is handled by *_set_irq() and *_map_irq() callbacks. And so with that in mind, re-reading the VIA datasheet I came up with the following PoC for discussion: https://github.com/mcayland/qemu/commits/via-poc.
It needs a bit of work, but at first glance it ticks all the boxes in that the PCI bus IRQs are all internal to the VIA southbridge (no global via_isa_set_irq() function and no overriding of PCI bus IRQs), there are separate legacy and PCI IRQs for the via-ide device, and the PCI IRQ routing bears at least a passing resemblance to the datasheet.
ATB,
Mark.
Re: [PATCH v8 3/6] hw/isa/vt82c686: Implement PCI IRQ routing
Quoted 83 lines · Mark Cave-Ayland
Quoted 69 lines · BALATON Zoltan
The real VIA south bridges implement a PCI IRQ router which is configured by the BIOS or the OS. In order to respect these configurations, QEMU needs to implement it as well. The real chip may allow routing IRQs from internal functions independently of PCI interrupts but since guests usually configute it to a single shared interrupt we don't model that here for simplicity.
Note: The implementation was taken from
piix4_set_irq()in hw/isa/piix4.Suggested-by Bernhard Beschow <[email protected]>Signed-off-by BALATON Zoltan <[email protected]>Tested-by Rene Engel <[email protected]>--- hw/isa/vt82c686.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)hw/isa/vt82c686.c +39
-0@@ -600,6 +600,46 @@ void via_isa_set_irq(PCIDevice *d, int n, int level)qemu_set_irq (s->isa_irqs_in[n], level); } +static int via_isa_get_pci_irq(const ViaISAState *s, int irq_num) +{ +switch (irq_num) { +case 0 : +return s->dev.config[0x55 ] >>4 ; +case 1 : +return s->dev.config[0x56 ] &0xf ; +case 2 : +return s->dev.config[0x56 ] >>4 ; +case 3 : +return s->dev.config[0x57 ] >>4 ; + } +return 0 ; +} + +static void via_isa_set_pci_irq (void *opaque,int irq_num,int level) +{ +ViaISAState *s = opaque; +PCIBus *bus =pci_get_bus (&s->dev); +int i, pic_level, pic_irq =via_isa_get_pci_irq (s, irq_num); + +/* IRQ 0: disabled, IRQ 2,8,13: reserved */ +if (!pic_irq) { +return ; + } +if (unlikely (pic_irq ==2 || pic_irq ==8 || pic_irq ==13 )) { +qemu_log_mask (LOG_GUEST_ERROR ,"Invalid ISA IRQ routing" ); + } + +/* The pic level is the logical OR of all the PCI irqs mapped to it. */ + pic_level =0 ; +for (i =0 ; i <PCI_NUM_PINS ; i++) { +if (pic_irq ==via_isa_get_pci_irq (s, i)) { + pic_level |=pci_bus_get_irq_level (bus, i); + } + } +/* Now we change the pic irq level according to the via irq mappings. */ +qemu_set_irq (s->isa_irqs_in[pic_irq], pic_level); +} +static void via_isa_realize (PCIDevice *d,Error **errp) {ViaISAState *s =VIA_ISA (d);hw/isa/vt82c686.c static void via_isa_realize(PCIDevice *d, Error **errp) · line 667
Quoted 8 lines
hw/isa/vt82c686.c +1
-0@@ -620,6 +660,8 @@ static void via_isa_realize(PCIDevice *d, Error **errp)i8254_pit_init (isa_bus,0x40 ,0 ,NULL );i8257_dma_init (isa_bus,0 ); +qdev_init_gpio_in_named (dev, via_isa_set_pci_irq,"pirq" ,PCI_NUM_PINS ); +/* RTC */ qdev_prop_set_int32 (DEVICE (&s->rtc),"base_year" ,2000 );if (!qdev_realize (DEVICE (&s->rtc),BUS (isa_bus), errp)) {Writing my previous response where I asked about the additional PCI interrupt connections to the MV64361, I realised that if you forget about the Northbridge component for a moment then things start to make a bit more sense.
At the moment we have 3 different scenarios:
Quoted 8 lines
1) ISA IRQ -> 8259 for all ISA devices
2) ISA IRQ -> 8259 *OR*
PCI IRQ -> PCI IRQ router -> 8259 for the PCI-IDE device3) PCI IRQ -> PCI IRQ router -> 8259 for PCI devices
When you look at it this way it is easy to see for case 3 that the PCI IRQ routing mechanism is handled by
*_set_irq()and*_map_irq()callbacks. And so with that in mind, re-reading the VIA datasheet I came up with the following PoC for discussion: https://github.com/mcayland/qemu/commits/via-poc.
At first glance this is basically what I had in v1 of this series just using PCI function numbers instead of an enum to find the IRQ source.
Quoted 1 line
It needs a bit of work, but at first glance it ticks all the boxes in that the PCI bus IRQs are all internal to the VIA southbridge (no global
via_isa_set_irq()function and no overriding of PCI bus IRQs), there are separate legacy and PCI IRQs for the via-ide device, and the PCI IRQ routing bears at least a passing resemblance to the datasheet.
Given that we only have a few hours left until the freeze I hope you're not proposing to drop this series and postpone all this to the next release, only that we do this clean up in the next devel cycle. You were away when this series were on the list for review so this is a bit late now for a big rewrite. (Especially that what you propose is a variant of the original I've submitted that I had to change due to other review comments.)
Since this version was tested and works please accept this for QEMU 8.0 now then we can work out your idea in the next devel cycle but until then this version allows people to run AmigaOS on pegasos2 with sound which is the goal I want to achieve for QEMU 8.0 and does not introduce any change to via-ide which was good enough for the last two years so it should be good enough for a few more months.
Regards,
BALATON Zoltan
Re: [PATCH v8 3/6] hw/isa/vt82c686: Implement PCI IRQ routing
Quoted 83 lines · BALATON Zoltan
Quoted 82 lines · Mark Cave-Ayland
Quoted 67 lines · BALATON Zoltan
The real VIA south bridges implement a PCI IRQ router which is configured by the BIOS or the OS. In order to respect these configurations, QEMU needs to implement it as well. The real chip may allow routing IRQs from internal functions independently of PCI interrupts but since guests usually configute it to a single shared interrupt we don't model that here for simplicity.
Note: The implementation was taken from
piix4_set_irq()in hw/isa/piix4.Suggested-by Bernhard Beschow <[email protected]>Signed-off-by BALATON Zoltan <[email protected]>Tested-by Rene Engel <[email protected]>---
hw/isa/vt82c686.c| 42 ++++++++++++++++++++++++++++++++++++++++++1 file changed, 42 insertions(+)hw/isa/vt82c686.c +39
-0@@ -600,6 +600,46 @@ void via_isa_set_irq(PCIDevice *d, int n, int level) qemu_set_irq(s->isa_irqs_in[n], level); } +static int via_isa_get_pci_irq(const ViaISAState *s, int irq_num) +{ + switch (irq_num) { + case 0: + return s->dev.config[0x55] >> 4; + case 1: + return s->dev.config[0x56] & 0xf; + case 2: + return s->dev.config[0x56] >> 4; + case 3: + return s->dev.config[0x57] >> 4; + } + return 0; +} + +static void via_isa_set_pci_irq (void *opaque,int irq_num,int level) +{ + ViaISAState *s = opaque; + PCIBus *bus = pci_get_bus(&s->dev); + int i, pic_level, pic_irq = via_isa_get_pci_irq(s, irq_num); + + /* IRQ 0: disabled, IRQ 2,8,13: reserved */ + if (!pic_irq) { + return; + } + if (unlikely(pic_irq == 2 || pic_irq == 8 || pic_irq == 13)) { + qemu_log_mask(LOG_GUEST_ERROR, "Invalid ISA IRQ routing"); + } + + /* The pic level is the logical OR of all the PCI irqs mapped to it. */ + pic_level = 0; + for (i = 0; i < PCI_NUM_PINS; i++) { + if (pic_irq == via_isa_get_pci_irq(s, i)) { + pic_level |= pci_bus_get_irq_level(bus, i); + } + } + /* Now we change the pic irq level according to the via irq mappings. */ + qemu_set_irq(s->isa_irqs_in[pic_irq], pic_level); +} + static void via_isa_realize(PCIDevice *d, Error **errp) { ViaISAState *s = VIA_ISA(d);hw/isa/vt82c686.c static void via_isa_realize(PCIDevice *d, Error **errp) · line 666
Quoted 7 lines
hw/isa/vt82c686.c +1
-0@@ -620,6 +660,8 @@ static void via_isa_realize(PCIDevice *d, Error **errp) i8254_pit_init(isa_bus, 0x40, 0, NULL); i8257_dma_init(isa_bus, 0); + qdev_init_gpio_in_named(dev, via_isa_set_pci_irq, "pirq", PCI_NUM_PINS); + /* RTC */ qdev_prop_set_int32(DEVICE(&s->rtc), "base_year", 2000); if (!qdev_realize(DEVICE(&s->rtc), BUS(isa_bus), errp)) {Writing my previous response where I asked about the additional PCI interrupt connections to the MV64361, I realised that if you forget about the Northbridge component for a moment then things start to make a bit more sense.
At the moment we have 3 different scenarios:
1) ISA IRQ -> 8259 for all ISA devices
Quoted 8 lines
Quoted 6 lines
2) ISA IRQ -> 8259 *OR*
PCI IRQ -> PCI IRQ router -> 8259 for the PCI-IDE device3) PCI IRQ -> PCI IRQ router -> 8259 for PCI devices
When you look at it this way it is easy to see for case 3 that the PCI IRQ routing mechanism is handled by
*_set_irq()and*_map_irq()callbacks. And so with that in mind, re-reading the VIA datasheet I came up with the following PoC for discussion: https://github.com/mcayland/qemu/commits/via-poc.At first glance this is basically what I had in v1 of this series just using PCI function numbers instead of an enum to find the IRQ source.
I can see the similarity however the difference here is that the PCI routing is done using the existing PCI routing functions in QEMU, rather than requiring an external function call specific to VIA devices.
Quoted 5 lines
Quoted 1 line
It needs a bit of work, but at first glance it ticks all the boxes in that the PCI bus IRQs are all internal to the VIA southbridge (no global
via_isa_set_irq()function and no overriding of PCI bus IRQs), there are separate legacy and PCI IRQs for the via-ide device, and the PCI IRQ routing bears at least a passing resemblance to the datasheet.Given that we only have a few hours left until the freeze I hope you're not proposing to drop this series and postpone all this to the next release, only that we do this clean up in the next devel cycle. You were away when this series were on the list for review so this is a bit late now for a big rewrite. (Especially that what you propose is a variant of the original I've submitted that I had to change due to other review comments.)
Since this version was tested and works please accept this for QEMU 8.0 now then we can work out your idea in the next devel cycle but until then this version allows people to run AmigaOS on pegasos2 with sound which is the goal I want to achieve for QEMU 8.0 and does not introduce any change to via-ide which was good enough for the last two years so it should be good enough for a few more months.
My understanding from the thread was that testing shows there are still hangs when using sound/USB/IDE simultaneously with this series, no? Or has that now been fixed?
I completely understand it can be frustrating not getting patches merged, but often as developers on less popular machines it can take a long time. My perspective here is that both you and Bernhard have out-of-tree patches for using the VIA southbridges, and during review Bernhard has raised legitimate review questions based upon his experience.
To me it makes sense to resolve these outstanding issues first to provide a solution that works for everyone, rather than pushing to merge a series that still has reliability issues and where there is lack of consensus between developers. The worst case scenario to me is that these patches get merged, people report that QEMU is unreliable for AmigaOS, and then we end up repeating this entire process yet again several months down the line when Bernhard submits his series for upstream.
ATB,
Mark.
Re: [PATCH v8 3/6] hw/isa/vt82c686: Implement PCI IRQ routing
Quoted 98 lines · Mark Cave-Ayland
Quoted 86 lines · BALATON Zoltan
Quoted 85 lines · Mark Cave-Ayland
Quoted 76 lines · BALATON Zoltan
The real VIA south bridges implement a PCI IRQ router which is configured by the BIOS or the OS. In order to respect these configurations, QEMU needs to implement it as well. The real chip may allow routing IRQs from internal functions independently of PCI interrupts but since guests usually configute it to a single shared interrupt we don't model that here for simplicity.
Note: The implementation was taken from
piix4_set_irq()in hw/isa/piix4.Suggested-by Bernhard Beschow <[email protected]>Signed-off-by BALATON Zoltan <[email protected]>Tested-by Rene Engel <[email protected]>---
hw/isa/vt82c686.c| 42 ++++++++++++++++++++++++++++++++++++++++++1 file changed, 42 insertions(+)hw/isa/vt82c686.c +36
-0@@ -600,6 +600,46 @@ void via_isa_set_irq(PCIDevice *d, int n, int level) qemu_set_irq(s->isa_irqs_in[n], level); } +static int via_isa_get_pci_irq(const ViaISAState *s, int irq_num) +{ + switch (irq_num) { + case 0: + return s->dev.config[0x55] >> 4; + case 1: + return s->dev.config[0x56] & 0xf; + case 2: + return s->dev.config[0x56] >> 4; + case 3: + return s->dev.config[0x57] >> 4; + } + return 0; +} + +static void via_isa_set_pci_irq (void *opaque,int irq_num,int level) +{ + ViaISAState *s = opaque; + PCIBus *bus = pci_get_bus(&s->dev); + int i, pic_level, pic_irq = via_isa_get_pci_irq(s, irq_num); + + /* IRQ 0: disabled, IRQ 2,8,13: reserved */ + if (!pic_irq) { + return; + } + if (unlikely(pic_irq == 2 || pic_irq == 8 || pic_irq == 13)) { + qemu_log_mask(LOG_GUEST_ERROR, "Invalid ISA IRQ routing"); + } + + /* The pic level is the logical OR of all the PCI irqs mapped to it. */ + pic_level = 0; + for (i = 0; i < PCI_NUM_PINS; i++) { + if (pic_irq == via_isa_get_pci_irq(s, i)) { + pic_level |= pci_bus_get_irq_level(bus, i); + } + } + /* Now we change the pic irq level according to the via irqmappings. */
+qemu_set_irq(s->isa_irqs_in[pic_irq], pic_level);hw/isa/vt82c686.c +2
-0+} +static void
via_isa_realize(PCIDevice *d, Error **errp){
ViaISAState *s =VIA_ISA(d);hw/isa/vt82c686.c +1
-0@@ -620,6 +660,8 @@ static void via_isa_realize(PCIDevice *d, Error **errp) i8254_pit_init(isa_bus, 0x40, 0, NULL); i8257_dma_init(isa_bus, 0); + qdev_init_gpio_in_named(dev, via_isa_set_pci_irq, "pirq", PCI_NUM_PINS); + /* RTC */ qdev_prop_set_int32(DEVICE(&s->rtc), "base_year", 2000);Quoted 1 line
if (!qdev_realize(DEVICE(&s->rtc),
BUS(isa_bus), errp)) {Writing my previous response where I asked about the additional PCI interrupt connections to the MV64361, I realised that if you forget about the Northbridge component for a moment then things start to make a bit more sense.
At the moment we have 3 different scenarios:
1) ISA IRQ -> 8259 for all ISA devices
Quoted 8 lines
Quoted 6 lines
2) ISA IRQ -> 8259 *OR*
PCI IRQ -> PCI IRQ router -> 8259 for the PCI-IDE device3) PCI IRQ -> PCI IRQ router -> 8259 for PCI devices
When you look at it this way it is easy to see for case 3 that the PCI IRQ routing mechanism is handled by
*_set_irq()and*_map_irq()callbacks. And so with that in mind, re-reading the VIA datasheet I came up with the following PoC for discussion: https://github.com/mcayland/qemu/commits/via-poc.At first glance this is basically what I had in v1 of this series just using PCI function numbers instead of an enum to find the IRQ source.
I can see the similarity however the difference here is that the PCI routing is done using the existing PCI routing functions in QEMU, rather than requiring an external function call specific to VIA devices.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
It needs a bit of work, but at first glance it ticks all the boxes in that the PCI bus IRQs are all internal to the VIA southbridge (no global
via_isa_set_irq()function and no overriding of PCI bus IRQs), there are separate legacy and PCI IRQs for the via-ide device, and the PCI IRQ routing bears at least a passing resemblance to the datasheet.Given that we only have a few hours left until the freeze I hope you're not proposing to drop this series and postpone all this to the next release, only that we do this clean up in the next devel cycle. You were away when this series were on the list for review so this is a bit late now for a big rewrite. (Especially that what you propose is a variant of the original I've submitted that I had to change due to other review comments.)
Since this version was tested and works please accept this for QEMU 8.0 now then we can work out your idea in the next devel cycle but until then this version allows people to run AmigaOS on pegasos2 with sound which is the goal I want to achieve for QEMU 8.0 and does not introduce any change to via-ide which was good enough for the last two years so it should be good enough for a few more months.
My understanding from the thread was that testing shows there are still hangs when using
sound/USB/IDEsimultaneously with this series, no? Or has that now been fixed?
No. This series fiixes sound/USB/PCI interrupts which is needed to get AmigaOS work and be usable on pegasos2. The hang Bernhard found with usb-mouse was only affecting MorphOS with this series which uses level sensitive mode of i8259 which wasn't implemented. Patch 2 in this series thanks to David Woodhouse fixes that (so did my work around before that patch) and MorphOS on pegasos2 is not a priority as it already runs on mac99 so what I'd like to make work here is AmigaOS for which it's the only G4 CPU platform now. This is important as it's much faster than the PPC440 version and may be able to run with KVM eventually but to find that out this should get in first so people can start to test it. We can always improve it later including implementing a better model of IRQ routing in VT8231. What we have in this series now works for all guests and all important patches have been tested and now reviewed. So I hope Philippe can pick this up and then we have time for this discussion afterwards.
Quoted 1 line
I completely understand it can be frustrating not getting patches merged, but often as developers on less popular machines it can take a long time. My perspective here is that both you and Bernhard have out-of-tree patches for using the VIA southbridges, and during review Bernhard has raised legitimate review questions based upon his experience.
Those review questions have been addressed, I've accepted Bernhard's alternative patch even though I think it's not entirely correct and although the first series was already tested I've re-done that based on Bernhard's idea and asked Rene to test all of it again. That's when you came along a few days before the freeze and blocking this without even fully understanding what it's about. That is what's frustrating.
Quoted 1 line
To me it makes sense to resolve these outstanding issues first to provide a solution that works for everyone, rather than pushing to merge a series that
There are no issues to resolvc regatding functionality. All versions of this series that I have submitted were tested and are working and achieve the goal to make it possible to run AmigaOS on pegasos2 and get sound with MorphOS which are not yet possible currently. Nobody showed these patches would break anything (which would be surprising anyway as these are only used by pegasos2 and fuloong2e the latter of which has never been finished so only still around to have a way to test these components independent of pegasos2). A solution for everyone would be to merge this series now so they can use it in QEMU 8.0 then we have time to improve it and make the model conteptually more correct but there are no missing functionality that would prevent guests from running with this series so no reason to keep this out now.
Quoted 1 line
still has reliability issues and where there is lack of consensus between developers. The worst case scenario to me is that these patches get merged, people report that QEMU is unreliable for AmigaOS, and then we end up repeating this entire process yet again several months down the line when Bernhard submits his series for upstream.
I don't even know what to say to that. It already took me more time arguing with you about it than writing the whole series. We have pegasos2 in QEMU already which these really small patches that Bernhard now also agrees could be accepted for now would allow to run two more guests and reach usable state with them that is much better than what's possible now and there are several people who can't compile their QEMU from off-tree sources but would happily use it from their distro packages or binaries provided for release versions. But you just don't care about those people or my work and would hold this back indefinitely becuase maybe it could break some off-tree changes not even finished or submitted yet or maybe we will find a bug later. What's the freeze time for if not for finding bugs and fixing them. What's the development window for if not imrpving code already there?
Again this is now tested, reviewed and isn't known to break anything that's already there or even make it less clean, in fact it does make existing code a bit cleaner and fixes some issues so the only problem is that you think there must be a better way doing it or do it more fully than this series does it but you've failed to say that during review because you were away.
Philippe, Peter or any other maintainer please put an end on this suffering and submit a pull request with any version of this series (as I've said all versions I've sent are tested and working) now so we have it working and then we can rewrite it later however Mark wants in the future but let not make people who want to use it wait because of unreasonable concerns. Putting this off to wait until some other unfinished and unrelated machine is written just makes no sense.
Regards,
BALATON Zoltan
Re: [PATCH v8 3/6] hw/isa/vt82c686: Implement PCI IRQ routing
Quoted 4 lines · BALATON Zoltan
Quoted 3 lines · Mark Cave-Ayland
Quoted 2 lines · BALATON Zoltan
Quoted 1 line · Mark Cave-Ayland
On 06/03/2023 12:33, BALATON Zoltan wrote:
<snip>
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Given that we only have a few hours left until the freeze I hope you're not proposing to drop this series and postpone all this to the next release,
This sort of passive aggressive framing isn't helpful or conducive to collaboration. We should be striving to merge code based on the merits of the patches not on how close we are to a given release.
Quoted 17 lines
Quoted 13 lines
Quoted 4 lines
only that we do this clean up in the next devel
cycle. You were away when this series were on the list for review so this is a bit late now for a big rewrite. (Especially that what you propose is a variant of the original I've submitted that I hadQuoted 8 lines
to change due to other review comments.)
Since this version was tested and works please accept this for QEMU 8.0 now then we can work out your idea in the next devel cycle but until then this version allows people to run AmigaOS on pegasos2 with sound which is the goal I want to achieve for QEMU 8.0 and does not introduce any change to via-ide which was good enough for the last two years so it should be good enough for a few more months.Quoted 3 lines
My understanding from the thread was that testing shows there are still hangs when using
sound/USB/IDEsimultaneously with this series, no? Or has that now been fixed?
Quoted 15 lines
No. This series fiixes
sound/USB/PCIinterrupts which is needed to get AmigaOS work and be usable on pegasos2. The hang Bernhard found with usb-mouse was only affecting MorphOS with this series which uses level sensitive mode of i8259 which wasn't implemented. Patch 2 in this series thanks to David Woodhouse fixes that (so did my work around before that patch) and MorphOS on pegasos2 is not a priority as it already runs on mac99 so what I'd like to make work here is AmigaOS for which it's the only G4 CPU platform now. This is important as it's much faster than the PPC440 version and may be able to run with KVM eventually but to find that out this should get in first so people can start to test it. We can always improve it later including implementing a better model of IRQ routing in VT8231. What we have in this series now works for all guests and all important patches have been tested and now reviewed. So I hope Philippe can pick this up and then we have time for this discussion afterwards.
We shouldn't make perfect the enemy of the good. If the changes are well localised, reviewed and tested and importantly don't introduce regressions then we shouldn't hold things up purely on the basis of a not meeting a preferred style* of an individual maintainer. Obviously the barrier for entry rises as the impact on the rest of the code base increases. We have more than enough experience of introducing new APIs and regretting it later to be understandably cautious in this regard.
(* as opposed to documented coding style which is a valid reason to reject patches)
Quoted 7 lines
Quoted 6 lines
I completely understand it can be frustrating not getting patches merged, but often as developers on less popular machines it can take a long time. My perspective here is that both you and Bernhard have out-of-tree patches for using the VIA southbridges, and during review Bernhard has raised legitimate review questions based upon his experience.
Quoted 6 lines
Those review questions have been addressed, I've accepted Bernhard's alternative patch even though I think it's not entirely correct and although the first series was already tested I've re-done that based on Bernhard's idea and asked Rene to test all of it again. That's when you came along a few days before the freeze and blocking this without even fully understanding what it's about. That is what's frustrating.
While using Based-on gives enough information to reconstruct a final tree perhaps it would be simpler to post a full series relative to master to make for easier review and merging?
Quoted 4 lines
Quoted 3 lines
To me it makes sense to resolve these outstanding issues first to provide a solution that works for everyone, rather than pushing to merge a series that
Quoted 13 lines
There are no issues to resolvc regatding functionality. All versions of this series that I have submitted were tested and are working and achieve the goal to make it possible to run AmigaOS on pegasos2 and get sound with MorphOS which are not yet possible currently. Nobody showed these patches would break anything (which would be surprising anyway as these are only used by pegasos2 and fuloong2e the latter of which has never been finished so only still around to have a way to test these components independent of pegasos2). A solution for everyone would be to merge this series now so they can use it in QEMU 8.0 then we have time to improve it and make the model conteptually more correct but there are no missing functionality that would prevent guests from running with this series so no reason to keep this out now.
Regressions would be a good reason to avoid premature merging.
Quoted 6 lines
Quoted 6 lines
still has reliability issues and where there is lack of consensus between developers. The worst case scenario to me is that these patches get merged, people report that QEMU is unreliable for AmigaOS, and then we end up repeating this entire process yet again several months down the line when Bernhard submits his series for upstream.
Do we have any indication that AmigaOS (I assume as a guest) is less reliable on this series? Is this an area where it can only be confirmed by manual testing?
I'm not sure we can gate things on a manual test only a few people can run. This is an argument for improving our testing coverage.
Quoted 11 lines
I don't even know what to say to that. It already took me more time arguing with you about it than writing the whole series. We have pegasos2 in QEMU already which these really small patches that Bernhard now also agrees could be accepted for now would allow to run two more guests and reach usable state with them that is much better than what's possible now and there are several people who can't compile their QEMU from off-tree sources but would happily use it from their distro packages or binaries provided for release versions. But you just don't care about those people or my work and would hold this back indefinitely becuase maybe it could break some off-tree changes not even finished or submitted yet or maybe we will find a bug later.
Please don't assume peoples motivation in their feedback - its not helpful. We should proceed with the default assumption that everyone wants to improve the project even if opinions on how to do so differ.
Quoted 2 lines
What's the freeze time for if not for finding bugs and fixing them. What's the development window for if not imrpving code already there?
We fix bugs that might of slipped in during development - we don't knowingly introduce a bug with a promise to fix it during freeze.
Quoted 7 lines
Again this is now tested, reviewed and isn't known to break anything that's already there or even make it less clean, in fact it does make existing code a bit cleaner and fixes some issues so the only problem is that you think there must be a better way doing it or do it more fully than this series does it but you've failed to say that during review because you were away.
Quoted 7 lines
Philippe, Peter or any other maintainer please put an end on this suffering and submit a pull request with any version of this series (as I've said all versions I've sent are tested and working) now so we have it working and then we can rewrite it later however Mark wants in the future but let not make people who want to use it wait because of unreasonable concerns. Putting this off to wait until some other unfinished and unrelated machine is written just makes no sense.
I've added the PC machine maintainers to the CC because AFAICT they are also maintainers for the systems touched here. From my point of view if the maintainers of the affected subsystems are happy, code is reviewed and there are no known regressions then there isn't a barrier to getting this code merged.
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro
Re: [PATCH v8 3/6] hw/isa/vt82c686: Implement PCI IRQ routing
Quoted 72 lines · Alex Bennée
Quoted 4 lines · BALATON Zoltan
Quoted 3 lines · Mark Cave-Ayland
Quoted 2 lines · BALATON Zoltan
Quoted 1 line · Mark Cave-Ayland
On 06/03/2023 12:33, BALATON Zoltan wrote:
<snip>
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Given that we only have a few hours left until the freeze I hope you're not proposing to drop this series and postpone all this to the next release,
This sort of passive aggressive framing isn't helpful or conducive to collaboration. We should be striving to merge code based on the merits of the patches not on how close we are to a given release.
Quoted 17 lines
Quoted 13 lines
Quoted 4 lines
only that we do this clean up in the next devel
cycle. You were away when this series were on the list for review so this is a bit late now for a big rewrite. (Especially that what you propose is a variant of the original I've submitted that I hadQuoted 8 lines
to change due to other review comments.)
Since this version was tested and works please accept this for QEMU 8.0 now then we can work out your idea in the next devel cycle but until then this version allows people to run AmigaOS on pegasos2 with sound which is the goal I want to achieve for QEMU 8.0 and does not introduce any change to via-ide which was good enough for the last two years so it should be good enough for a few more months.Quoted 3 lines
My understanding from the thread was that testing shows there are still hangs when using
sound/USB/IDEsimultaneously with this series, no? Or has that now been fixed?Quoted 15 lines
No. This series fiixes
sound/USB/PCIinterrupts which is needed to get AmigaOS work and be usable on pegasos2. The hang Bernhard found with usb-mouse was only affecting MorphOS with this series which uses level sensitive mode of i8259 which wasn't implemented. Patch 2 in this series thanks to David Woodhouse fixes that (so did my work around before that patch) and MorphOS on pegasos2 is not a priority as it already runs on mac99 so what I'd like to make work here is AmigaOS for which it's the only G4 CPU platform now. This is important as it's much faster than the PPC440 version and may be able to run with KVM eventually but to find that out this should get in first so people can start to test it. We can always improve it later including implementing a better model of IRQ routing in VT8231. What we have in this series now works for all guests and all important patches have been tested and now reviewed. So I hope Philippe can pick this up and then we have time for this discussion afterwards.We shouldn't make perfect the enemy of the good. If the changes are well localised, reviewed and tested and importantly don't introduce regressions then we shouldn't hold things up purely on the basis of a not meeting a preferred style* of an individual maintainer. Obviously the barrier for entry rises as the impact on the rest of the code base increases. We have more than enough experience of introducing new APIs and regretting it later to be understandably cautious in this regard.
(* as opposed to documented coding style which is a valid reason to reject patches)
Quoted 7 lines
Quoted 6 lines
I completely understand it can be frustrating not getting patches merged, but often as developers on less popular machines it can take a long time. My perspective here is that both you and Bernhard have out-of-tree patches for using the VIA southbridges, and during review Bernhard has raised legitimate review questions based upon his experience.
Quoted 6 lines
Those review questions have been addressed, I've accepted Bernhard's alternative patch even though I think it's not entirely correct and although the first series was already tested I've re-done that based on Bernhard's idea and asked Rene to test all of it again. That's when you came along a few days before the freeze and blocking this without even fully understanding what it's about. That is what's frustrating.
Quoted 3 lines
While using Based-on gives enough information to reconstruct a final tree perhaps it would be simpler to post a full series relative to master to make for easier review and merging?
The last version v9 I've sent today is based on master without any other dependency but it wasn't decided until today what fix will be taken for an issue in master that was introduced independntly of this series a week ago and I had to rebase this on all propsed fixes for that change until it finally turned out I should not target the fix I was prevously was told to do.
Quoted 27 lines
Quoted 4 lines
Quoted 3 lines
To me it makes sense to resolve these outstanding issues first to provide a solution that works for everyone, rather than pushing to merge a series that
Quoted 13 lines
There are no issues to resolvc regatding functionality. All versions of this series that I have submitted were tested and are working and achieve the goal to make it possible to run AmigaOS on pegasos2 and get sound with MorphOS which are not yet possible currently. Nobody showed these patches would break anything (which would be surprising anyway as these are only used by pegasos2 and fuloong2e the latter of which has never been finished so only still around to have a way to test these components independent of pegasos2). A solution for everyone would be to merge this series now so they can use it in QEMU 8.0 then we have time to improve it and make the model conteptually more correct but there are no missing functionality that would prevent guests from running with this series so no reason to keep this out now.
Regressions would be a good reason to avoid premature merging.
Quoted 6 lines
Quoted 6 lines
still has reliability issues and where there is lack of consensus between developers. The worst case scenario to me is that these patches get merged, people report that QEMU is unreliable for AmigaOS, and then we end up repeating this entire process yet again several months down the line when Bernhard submits his series for upstream.
Quoted 3 lines
Do we have any indication that AmigaOS (I assume as a guest) is less reliable on this series? Is this an area where it can only be confirmed by manual testing?
AmigaOS runs well on this series and can use PCI cards which it cannot on current master. The goal of this series is to allow that because otherwise it cannot use network and sound without which it's not really usable. With this series it finally can be used as shown on the video by Rene who tested it and I posted before.
Quoted 2 lines
I'm not sure we can gate things on a manual test only a few people can run. This is an argument for improving our testing coverage.
It needs a license for AmigaOS Pegasos 2 version to test with that but this series also fixes PCI IRQs for Linux so the same could be tested by adding a network card to a Linux guest. But Mark did not run any tests just ctiticised based on looking at the patches so not sure it's a question of patch coverage in this case.
Quoted 16 lines
Quoted 11 lines
I don't even know what to say to that. It already took me more time arguing with you about it than writing the whole series. We have pegasos2 in QEMU already which these really small patches that Bernhard now also agrees could be accepted for now would allow to run two more guests and reach usable state with them that is much better than what's possible now and there are several people who can't compile their QEMU from off-tree sources but would happily use it from their distro packages or binaries provided for release versions. But you just don't care about those people or my work and would hold this back indefinitely becuase maybe it could break some off-tree changes not even finished or submitted yet or maybe we will find a bug later.
Please don't assume peoples motivation in their feedback - its not helpful. We should proceed with the default assumption that everyone wants to improve the project even if opinions on how to do so differ.
Quoted 5 lines
Quoted 2 lines
What's the freeze time for if not for finding bugs and fixing them. What's the development window for if not imrpving code already there?
We fix bugs that might of slipped in during development - we don't knowingly introduce a bug with a promise to fix it during freeze.
This series does not introduce any bugs that we know about. All versions I've submitted work equally well without introducing regressions so all the different versions were only necessary to implement the same in different ways not to fix any regressions but to satisfy different views of different people. The regression we now have in master was introduced by a different series that wasn't sufficiently tested before merging. This series now also has a patch to fix that.
Quoted 15 lines
Quoted 7 lines
Again this is now tested, reviewed and isn't known to break anything that's already there or even make it less clean, in fact it does make existing code a bit cleaner and fixes some issues so the only problem is that you think there must be a better way doing it or do it more fully than this series does it but you've failed to say that during review because you were away.
Quoted 7 lines
Philippe, Peter or any other maintainer please put an end on this suffering and submit a pull request with any version of this series (as I've said all versions I've sent are tested and working) now so we have it working and then we can rewrite it later however Mark wants in the future but let not make people who want to use it wait because of unreasonable concerns. Putting this off to wait until some other unfinished and unrelated machine is written just makes no sense.
Quoted 5 lines
I've added the PC machine maintainers to the CC because AFAICT they are also maintainers for the systems touched here. From my point of view if the maintainers of the affected subsystems are happy, code is reviewed and there are no known regressions then there isn't a barrier to getting this code merged.
The only patch that touches pc machine is the i8259 LTIM patch from David which is only needed for MorphOS as nothing else uses that mode of the i8259 PIC so if you can't decide on that one patch then just drop it and merge the rest of the series which is enough for AmigaOS to work. That patch being a bug fix could also wait a bit more, no reason to delay the whole series because of this patch.
I've said it before but here it is again to make it clearer:
v9-0001-hw-display-sm501-Add-debug-property-to-control-pi.patch v9-0002-hw-intc-i8259-Implement-legacy-LTIM-Edge-Level-Ba.patch
The above two are optional but would be nice to have. Patch 1 adds a debug aid for testing sm501 emulation, patch 2 is only needed for MorphOS on pegasos2 which is less important than getting AmigaOS to work.
v9-0003-Revert-hw-isa-vt82c686-Remove-intermediate-IRQ-fo.patch
This fixes up Philippe's series which caused me to need to rebase the series several times.
v9-0004-hw-isa-vt82c686-Implement-PCI-IRQ-routing.patch v9-0005-hw-ppc-pegasos2-Fix-PCI-interrupt-routing.patch v9-0006-hw-usb-vt82c686-uhci-pci-Use-PCI-IRQ-routing.patch
These three are needed to fix PCI interrupts on pegasos2 and is the minimum we need for AmigaOS (with some fix for current breakage like the revert above).
v9-0007-hw-audio-via-ac97-Basic-implementation-of-audio-p.patch
This one implements audio output for pegasos2 but AmigaOS can use a sound card instead with the above PCI IRQ patches so this could be optional but since it's reviewed and tested no reason to not merge it but it depends on the other patches before.
Are there any more questions or concerns that I shuold answer about these?
Regards,
BALATON Zoltan
Re: [PATCH v8 3/6] hw/isa/vt82c686: Implement PCI IRQ routing
In reply to BALATON ZoltanAm 6. März 2023 12:33:31 UTC schrieb BALATON Zoltan <[email protected]>:
Quoted 41 lines
The real VIA south bridges implement a PCI IRQ router which is configured by the BIOS or the OS. In order to respect these configurations, QEMU needs to implement it as well. The real chip may allow routing IRQs from internal functions independently of PCI interrupts but since guests usually configute it to a single shared interrupt we don't model that here for simplicity.
Note: The implementation was taken from
piix4_set_irq()in hw/isa/piix4.Suggested-by Bernhard Beschow <[email protected]>Signed-off-by BALATON Zoltan <[email protected]>Tested-by Rene Engel <[email protected]>---
hw/isa/vt82c686.c| 42 ++++++++++++++++++++++++++++++++++++++++++1 file changed, 42 insertions(+)hw/isa/vt82c686.c +17
-0@@ -600,6 +600,46 @@ void via_isa_set_irq(PCIDevice *d, int n, int level)qemu_set_irq (s->isa_irqs_in[n], level); } +static int via_isa_get_pci_irq (const ViaISAState *s,int irq_num) +{ +switch (irq_num) { +case 0 : +return s->dev.config[0x55 ] >>4 ; +case 1 : +return s->dev.config[0x56 ] &0xf ; +case 2 : +return s->dev.config[0x56 ] >>4 ; +case 3 : +return s->dev.config[0x57 ] >>4 ; + } +return 0 ; +} + +static void via_isa_set_pci_irq (void *opaque,int irq_num,int level) +{
hw/isa/vt82c686.c void via_isa_set_irq(PCIDevice *d, int n, int level) · line 629
Quoted 10 lines
hw/isa/vt82c686.c +10
-0+ViaISAState *s = opaque; +PCIBus *bus =pci_get_bus (&s->dev); +int i, pic_level, pic_irq =via_isa_get_pci_irq (s, irq_num); + +/* IRQ 0: disabled, IRQ 2,8,13: reserved */ +if (!pic_irq) { +return ; + } +if (unlikely (pic_irq ==2 || pic_irq ==8 || pic_irq ==13 )) { +qemu_log_mask (LOG_GUEST_ERROR ,"Invalid ISA IRQ routing" );
I wonder whether we should return here or not. But well, that's probably why it's reserved. Let's see how it goes and revist in case we learn more...
Quoted 25 lines
hw/isa/vt82c686.c +15
-0+ } + +/* The pic level is the logical OR of all the PCI irqs mapped to it. */ + pic_level =0 ; +for (i =0 ; i <PCI_NUM_PINS ; i++) { +if (pic_irq ==via_isa_get_pci_irq (s, i)) { + pic_level |=pci_bus_get_irq_level (bus, i); + } + } +/* Now we change the pic irq level according to the via irq mappings. */ +qemu_set_irq (s->isa_irqs_in[pic_irq], pic_level); +} +static void via_isa_realize (PCIDevice *d,Error **errp) {ViaISAState *s =VIA_ISA (d);@@ -620,6 +660,8 @@ static void via_isa_realize(PCIDevice *d, Error **errp)i8254_pit_init (isa_bus,0x40 ,0 ,NULL );i8257_dma_init (isa_bus,0 ); +qdev_init_gpio_in_named (dev, via_isa_set_pci_irq,"pirq" ,PCI_NUM_PINS ); +/* RTC */ qdev_prop_set_int32 (DEVICE (&s->rtc),"base_year" ,2000 );if (!qdev_realize (DEVICE (&s->rtc),BUS (isa_bus), errp)) {
PATCH v8 4/6 hw/ppc/pegasos2: Fix PCI interrupt routing
In reply to BALATON ZoltanAccording to the PegasosII schematics the PCI interrupt lines are connected to both the gpp pins of the Mv64361 north bridge and the PINT pins of the VT8231 south bridge so guests can get interrupts from either of these. So far we only had the MV64361 connections which worked for on board devices but for additional PCI devices (such as network or sound card added with -device) guest OSes expect interrupt from the ISA IRQ 9 where the firmware routes these PCI interrupts in VT8231 ISA bridge. After the previous patches we can now model this and also remove the board specific connection from mv64361. Also configure routing of these lines when using Virtual Open Firmware to match board firmware for guests that expect this.
This fixes PCI interrupts on pegasos2 under Linux, MorphOS and AmigaOS.
--- hw/pci-host/mv64361.c | 4 ---- hw/ppc/pegasos2.c | 26 +++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 5 deletions(-)
hw/pci-host/mv64361.c +0 -4
@@ -873,10 +873,6 @@ static void mv64361_realize(DeviceState *dev, Error **errp) }sysbus_init_irq (SYS_BUS_DEVICE (dev), &s->cpu_irq);qdev_init_gpio_in_named (dev, mv64361_gpp_irq,"gpp" ,32 ); -/* FIXME: PCI IRQ connections may be board specific */ -for (i =0 ; i <PCI_NUM_PINS ; i++) { - s->pci[1 ].irq[i] =qdev_get_gpio_in_named (dev,"gpp" ,12 + i); - } }static void mv64361_reset (DeviceState *dev)
hw/ppc/pegasos2.c +25 -1
@@ -73,6 +73,8 @@ struct Pegasos2MachineState {MachineState parent_obj;PowerPCCPU *cpu;DeviceState *mv; +qemu_irq mv_pirq[PCI_NUM_PINS ]; +qemu_irq via_pirq[PCI_NUM_PINS ];Vof *vof;void *fdt_blob;uint64_t kernel_addr;
@@ -95,6 +97,15 @@ static void pegasos2_cpu_reset(void *opaque) } } +static void pegasos2_pci_irq (void *opaque,int n,int level) +{ +Pegasos2MachineState *pm = opaque; + +/* PCI interrupt lines are connected to both MV64361 and VT8231 */ +qemu_set_irq (pm->mv_pirq[n], level); +qemu_set_irq (pm->via_pirq[n], level); +} +static void pegasos2_init (MachineState *machine) {Pegasos2MachineState *pm =PEGASOS2_MACHINE (machine);
@@ -106,7 +117,7 @@ static void pegasos2_init(MachineState *machine)I2CBus *i2c_bus;const char *fwname = machine->firmware ?:PROM_FILENAME ;char *filename; -int sz; +int i, sz;uint8_t *spd_data;/* init CPU */
@@ -156,7 +167,11 @@ static void pegasos2_init(MachineState *machine)/* Marvell Discovery II system controller */ pm->mv =DEVICE (sysbus_create_simple (TYPE_MV64361 ,-1 ,qdev_get_gpio_in (DEVICE (pm->cpu), PPC6xx_INPUT_INT))); +for (i =0 ; i <PCI_NUM_PINS ; i++) { + pm->mv_pirq[i] =qdev_get_gpio_in_named (pm->mv,"gpp" ,12 + i); + } pci_bus =mv64361_get_pci_bus (pm->mv,1 ); +pci_bus_irqs (pci_bus, pegasos2_pci_irq, pm,PCI_NUM_PINS );/* VIA VT8231 South Bridge (multifunction PCI device) */ via = OBJECT(pci_new_multifunction(PCI_DEVFN(12, 0), true,
@@ -164,6 +179,9 @@ static void pegasos2_init(MachineState *machine)qdev_connect_gpio_out (DEVICE (via),0 ,qdev_get_gpio_in_named (pm->mv,"gpp" ,31 ));pci_realize_and_unref (PCI_DEVICE (via), pci_bus, &error_fatal); +for (i =0 ; i <PCI_NUM_PINS ; i++) { + pm->via_pirq[i] =qdev_get_gpio_in_named (DEVICE (via),"pirq" , i); + } object_property_add_alias(OBJECT(machine), "rtc-time", object_resolve_path_component(via, "rtc"),
@@ -269,6 +287,12 @@ static void pegasos2_machine_reset(MachineState *machine, ShutdownCause reason) PCI_INTERRUPT_LINE, 2, 0x9);pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) |0x50 ,1 ,0x2 ); +pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) | +0x55 ,1 ,0x90 ); +pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) | +0x56 ,1 ,0x99 ); +pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) | +0x57 ,1 ,0x90 );pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,1 ) <<8 ) |PCI_INTERRUPT_LINE ,2 ,0x109 );
Signature · 1 line
2.30.8
Re: [PATCH v8 4/6] hw/ppc/pegasos2: Fix PCI interrupt routing
Quoted 53 lines · BALATON Zoltan
According to the PegasosII schematics the PCI interrupt lines are connected to both the gpp pins of the Mv64361 north bridge and the PINT pins of the VT8231 south bridge so guests can get interrupts from either of these. So far we only had the MV64361 connections which worked for on board devices but for additional PCI devices (such as network or sound card added with -device) guest OSes expect interrupt from the ISA IRQ 9 where the firmware routes these PCI interrupts in VT8231 ISA bridge. After the previous patches we can now model this and also remove the board specific connection from mv64361. Also configure routing of these lines when using Virtual Open Firmware to match board firmware for guests that expect this.
This fixes PCI interrupts on pegasos2 under Linux, MorphOS and AmigaOS.
Signed-off-by BALATON Zoltan <[email protected]>Reviewed-by Daniel Henrique Barboza <[email protected]>Tested-by Rene Engel <[email protected]>--- hw/pci-host/mv64361.c | 4 ---- hw/ppc/pegasos2.c | 26 +++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 5 deletions(-)hw/pci-host/mv64361.c +0
-4@@ -873,10 +873,6 @@ static void mv64361_realize(DeviceState *dev, Error **errp) }sysbus_init_irq (SYS_BUS_DEVICE (dev), &s->cpu_irq);qdev_init_gpio_in_named (dev, mv64361_gpp_irq,"gpp" ,32 ); -/* FIXME: PCI IRQ connections may be board specific */ -for (i =0 ; i <PCI_NUM_PINS ; i++) { - s->pci[1 ].irq[i] =qdev_get_gpio_in_named (dev,"gpp" ,12 + i); - } }static void mv64361_reset (DeviceState *dev)hw/ppc/pegasos2.c +2
-0@@ -73,6 +73,8 @@ struct Pegasos2MachineState {MachineState parent_obj;PowerPCCPU *cpu;DeviceState *mv; +qemu_irq mv_pirq[PCI_NUM_PINS ]; +qemu_irq via_pirq[PCI_NUM_PINS ];Vof *vof;void *fdt_blob;uint64_t kernel_addr;@@ -95,6 +97,15 @@ static void pegasos2_cpu_reset(void *opaque) } }
hw/ppc/pegasos2.c static void pegasos2_cpu_reset(void *opaque) · line 108
Quoted 10 lines
hw/ppc/pegasos2.c +9
-0+static void pegasos2_pci_irq (void *opaque,int n,int level) +{ +Pegasos2MachineState *pm = opaque; + +/* PCI interrupt lines are connected to both MV64361 and VT8231 */ +qemu_set_irq (pm->mv_pirq[n], level); +qemu_set_irq (pm->via_pirq[n], level); +} +
Can you explain a bit more about how the PCI interrupt lines are connected to both the MV64361 and VT8231? The reason for asking is that I see a similar pattern in the bonito board, but there I can't see how those lines would be used because they can also raise a CPU interrupt, yet it is a different one compared to the 8259.
Given that we know from Bernhard's tests that the fuloong2e board works with pci_bus_irqs() included in via_isa_realize() which overwrites the bonito equivalent, I'm wondering if the mv_pirq array is actually needed at all and whether it may just be a debugging aid? Certainly it makes things simpler to just route everything to the VIA device.
Quoted 13 lines
hw/ppc/pegasos2.c +1
-1static void pegasos2_init (MachineState *machine) {Pegasos2MachineState *pm =PEGASOS2_MACHINE (machine);@@ -106,7 +117,7 @@ static void pegasos2_init(MachineState *machine)I2CBus *i2c_bus;const char *fwname = machine->firmware ?:PROM_FILENAME ;char *filename; -int sz; +int i, sz;uint8_t *spd_data;/* init CPU */
hw/ppc/pegasos2.c static void pegasos2_init(MachineState *machine) · line 174
Quoted 8 lines
hw/ppc/pegasos2.c +4
-0@@ -156,7 +167,11 @@ static void pegasos2_init(MachineState *machine)/* Marvell Discovery II system controller */ pm->mv =DEVICE (sysbus_create_simple (TYPE_MV64361 ,-1 ,qdev_get_gpio_in (DEVICE (pm->cpu), PPC6xx_INPUT_INT))); +for (i =0 ; i <PCI_NUM_PINS ; i++) { + pm->mv_pirq[i] =qdev_get_gpio_in_named (pm->mv,"gpp" ,12 + i); + } pci_bus =mv64361_get_pci_bus (pm->mv,1 ); +pci_bus_irqs (pci_bus, pegasos2_pci_irq, pm,PCI_NUM_PINS );
This doesn't make sense to me either, since the PCI bus IRQs should be owned by the device that contains the PCI bus and not the board.
Quoted 15 lines
hw/ppc/pegasos2.c +3
-0/* VIA VT8231 South Bridge (multifunction PCI device) */ via = OBJECT(pci_new_multifunction(PCI_DEVFN(12, 0), true,@@ -164,6 +179,9 @@ static void pegasos2_init(MachineState *machine)qdev_connect_gpio_out (DEVICE (via),0 ,qdev_get_gpio_in_named (pm->mv,"gpp" ,31 ));pci_realize_and_unref (PCI_DEVICE (via), pci_bus, &error_fatal); +for (i =0 ; i <PCI_NUM_PINS ; i++) { + pm->via_pirq[i] =qdev_get_gpio_in_named (DEVICE (via),"pirq" , i); + } object_property_add_alias(OBJECT(machine), "rtc-time", object_resolve_path_component(via, "rtc"),@@ -269,6 +287,12 @@ static void pegasos2_machine_reset(MachineState *machine, ShutdownCause reason) PCI_INTERRUPT_LINE, 2, 0x9); pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) |
hw/ppc/pegasos2.c static void pegasos2_machine_reset(MachineState *machine, ShutdownCause reason) · line 298
Quoted 10 lines
hw/ppc/pegasos2.c +6
-00x50, 1, 0x2); +pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) | +0x55 ,1 ,0x90 ); +pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) | +0x56 ,1 ,0x99 ); +pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) | +0x57 ,1 ,0x90 );pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,1 ) <<8 ) |PCI_INTERRUPT_LINE ,2 ,0x109 );
This should be a separate commit because it's not part of the PCI interrupt routing as per my comment at https://lists.gnu.org/archive/html/qemu-devel/2023-03/msg00193.html.
ATB,
Mark.
Re: [PATCH v8 4/6] hw/ppc/pegasos2: Fix PCI interrupt routing
Quoted 57 lines · Mark Cave-Ayland
Quoted 56 lines · BALATON Zoltan
According to the PegasosII schematics the PCI interrupt lines are connected to both the gpp pins of the Mv64361 north bridge and the PINT pins of the VT8231 south bridge so guests can get interrupts from either of these. So far we only had the MV64361 connections which worked for on board devices but for additional PCI devices (such as network or sound card added with -device) guest OSes expect interrupt from the ISA IRQ 9 where the firmware routes these PCI interrupts in VT8231 ISA bridge. After the previous patches we can now model this and also remove the board specific connection from mv64361. Also configure routing of these lines when using Virtual Open Firmware to match board firmware for guests that expect this.
This fixes PCI interrupts on pegasos2 under Linux, MorphOS and AmigaOS.
Signed-off-by BALATON Zoltan <[email protected]>Reviewed-by Daniel Henrique Barboza <[email protected]>Tested-by Rene Engel <[email protected]>--- hw/pci-host/mv64361.c | 4 ---- hw/ppc/pegasos2.c | 26 +++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 5 deletions(-)hw/pci-host/mv64361.c +0
-4@@ -873,10 +873,6 @@ static void mv64361_realize(DeviceState *dev, Error **errp) }sysbus_init_irq (SYS_BUS_DEVICE (dev), &s->cpu_irq);qdev_init_gpio_in_named (dev, mv64361_gpp_irq,"gpp" ,32 ); -/* FIXME: PCI IRQ connections may be board specific */ -for (i =0 ; i <PCI_NUM_PINS ; i++) { - s->pci[1 ].irq[i] =qdev_get_gpio_in_named (dev,"gpp" ,12 + i); - } }static void mv64361_reset (DeviceState *dev)hw/ppc/pegasos2.c +4
-0@@ -73,6 +73,8 @@ struct Pegasos2MachineState {MachineState parent_obj;PowerPCCPU *cpu;DeviceState *mv; +qemu_irq mv_pirq[PCI_NUM_PINS ]; +qemu_irq via_pirq[PCI_NUM_PINS ];Vof *vof;void *fdt_blob;uint64_t kernel_addr;@@ -95,6 +97,15 @@ static void pegasos2_cpu_reset(void *opaque) } } +static void pegasos2_pci_irq(void *opaque, int n, int level) +{ +Pegasos2MachineState *pm = opaque;
Quoted 8 lines
hw/ppc/pegasos2.c static void pegasos2_cpu_reset(void *opaque) · line 108
Quoted 6 lines
hw/ppc/pegasos2.c +6
-0+ +/* PCI interrupt lines are connected to both MV64361 and VT8231 */ +qemu_set_irq (pm->mv_pirq[n], level); +qemu_set_irq (pm->via_pirq[n], level); +} +Can you explain a bit more about how the PCI interrupt lines are connected to both the MV64361 and VT8231? The reason for asking is that I see a similar
I think I already did that in previous replies but I try again. In pagasosII schematics at https://www.powerdeveloper.org/platforms/pegasos/schematics
Sheet 2 Marvell System Controller shows PINTA-D are connected to MV64361 MPP12-15 pins that are also called GPP in the docs (I think these are referred to as either Multi Purpose or General Purpose Pins).
Sheet 18 VIA VT8231 Southbridge shows INTR_A-D connected to VT8231 PINTA-D pins, which are connected to INTA-D on sheet 13 PCI Top Level. Sheet 1 Top Level Pegasos shows that Sheet 13 INTA-D are connected to Sheet 2 PINTA-D.
Quoted 1 line
pattern in the bonito board, but there I can't see how those lines would be used because they can also raise a CPU interrupt, yet it is a different one compared to the 8259.
Both the MV64361 and VT8231 have interrupt mask registers which allow the guest to choose where it wants an interrupt from. I guess different guests could use one or the other, unlikely they would use both but they could even do that if they wanted. I guess in bonito it's also maskable so the guest could set up irqs by programing the apprpriate north and south bridge registers. A guest which has ISA drivers (probably most) may likely want to route them to ISA IRQs in the VIA chip. Maybe this strange behaviour has to do with Windows compatibility and standards back then which never really took off like CHRP for PPC.
Quoted 1 line
Given that we know from Bernhard's tests that the fuloong2e board works with
pci_bus_irqs()included invia_isa_realize()which overwrites the bonito equivalent, I'm wondering if themv_pirqarray is actually needed at all and whether it may just be a debugging aid? Certainly it makes things simpler to just route everything to the VIA device.
In any case calling pci_bus_irqs in the VIA device would be wrong and connections should be made here by the board as that correctly models the hardware separating components and allows different boards to use the chip model in the future. I remember that I've implemenred connections to MV64361 for something but I don't remember which guest so as this already works and models what the schematics say I see no reason not to have it or remove it.
Regards,
BALATON Zoltan
Quoted 57 lines
Quoted 12 lines
hw/ppc/pegasos2.c +1
-1static void pegasos2_init (MachineState *machine) {Pegasos2MachineState *pm =PEGASOS2_MACHINE (machine);@@ -106,7 +117,7 @@ static void pegasos2_init(MachineState *machine)I2CBus *i2c_bus;const char *fwname = machine->firmware ?:PROM_FILENAME ;char *filename; -int sz; +int i, sz;uint8_t *spd_data;/* init CPU */ hw/ppc/pegasos2.c static void pegasos2_init(MachineState *machine) · line 175
Quoted 9 lines
hw/ppc/pegasos2.c +4
-0@@ -156,7 +167,11 @@ static void pegasos2_init(MachineState *machine)/* Marvell Discovery II system controller */ pm->mv =DEVICE (sysbus_create_simple (TYPE_MV64361 ,-1 ,qdev_get_gpio_in (DEVICE (pm->cpu), PPC6xx_INPUT_INT))); +for (i =0 ; i <PCI_NUM_PINS ; i++) { + pm->mv_pirq[i] =qdev_get_gpio_in_named (pm->mv,"gpp" ,12 + i); + } pci_bus =mv64361_get_pci_bus (pm->mv,1 ); +pci_bus_irqs (pci_bus, pegasos2_pci_irq, pm,PCI_NUM_PINS );This doesn't make sense to me either, since the PCI bus IRQs should be owned by the device that contains the PCI bus and not the board.
Quoted 14 lines
hw/ppc/pegasos2.c +3
-0/* VIA VT8231 South Bridge (multifunction PCI device) */ via = OBJECT(pci_new_multifunction(PCI_DEVFN(12, 0), true,@@ -164,6 +179,9 @@ static void pegasos2_init(MachineState *machine)qdev_connect_gpio_out (DEVICE (via),0 ,qdev_get_gpio_in_named (pm->mv,"gpp" ,31 ));pci_realize_and_unref (PCI_DEVICE (via), pci_bus, &error_fatal); +for (i =0 ; i <PCI_NUM_PINS ; i++) { + pm->via_pirq[i] =qdev_get_gpio_in_named (DEVICE (via),"pirq" , i); + } object_property_add_alias(OBJECT(machine), "rtc-time", object_resolve_path_component(via, "rtc"),@@ -269,6 +287,12 @@ static void pegasos2_machine_reset(MachineState *machine, ShutdownCause reason) PCI_INTERRUPT_LINE, 2, 0x9);hw/ppc/pegasos2.c static void pegasos2_machine_reset(MachineState · line 298
Quoted 10 lines
hw/ppc/pegasos2.c +6
-0pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) |0x50 ,1 ,0x2 ); +pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) | +0x55 ,1 ,0x90 ); +pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) | +0x56 ,1 ,0x99 ); +pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,0 ) <<8 ) | +0x57 ,1 ,0x90 );pegasos2_pci_config_write (pm,1 , (PCI_DEVFN (12 ,1 ) <<8 ) |PCI_INTERRUPT_LINE ,2 ,0x109 );This should be a separate commit because it's not part of the PCI interrupt routing as per my comment at https://lists.gnu.org/archive/html/qemu-devel/2023-03/msg00193.html.
ATB,
Mark.
Re: [PATCH v8 4/6] hw/ppc/pegasos2: Fix PCI interrupt routing
Quoted 72 lines · BALATON Zoltan
Quoted 56 lines · Mark Cave-Ayland
Quoted 55 lines · BALATON Zoltan
According to the PegasosII schematics the PCI interrupt lines are connected to both the gpp pins of the Mv64361 north bridge and the PINT pins of the VT8231 south bridge so guests can get interrupts from either of these. So far we only had the MV64361 connections which worked for on board devices but for additional PCI devices (such as network or sound card added with -device) guest OSes expect interrupt from the ISA IRQ 9 where the firmware routes these PCI interrupts in VT8231 ISA bridge. After the previous patches we can now model this and also remove the board specific connection from mv64361. Also configure routing of these lines when using Virtual Open Firmware to match board firmware for guests that expect this.
This fixes PCI interrupts on pegasos2 under Linux, MorphOS and AmigaOS.
Signed-off-by BALATON Zoltan <[email protected]>Reviewed-by Daniel Henrique Barboza <[email protected]>Tested-by Rene Engel <[email protected]>---
hw/pci-host/mv64361.c| 4 ---- hw/ppc/pegasos2.c | 26 +++++++++++++++++++++++++-2 files changed, 25 insertions(+), 5 deletions(-)hw/pci-host/mv64361.c +0
-4@@ -873,10 +873,6 @@ static void mv64361_realize(DeviceState *dev, Error **errp) } sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->cpu_irq); qdev_init_gpio_in_named(dev, mv64361_gpp_irq, "gpp", 32); - /* FIXME: PCI IRQ connections may be board specific */ - for (i = 0; i < PCI_NUM_PINS; i++) { - s->pci[1].irq[i] = qdev_get_gpio_in_named(dev, "gpp", 12 + i); - } } static void mv64361_reset(DeviceState *dev)hw/ppc/pegasos2.c +4
-0@@ -73,6 +73,8 @@ struct Pegasos2MachineState { MachineState parent_obj; PowerPCCPU *cpu; DeviceState *mv; + qemu_irq mv_pirq[PCI_NUM_PINS]; + qemu_irq via_pirq[PCI_NUM_PINS]; Vof *vof; void *fdt_blob; uint64_t kernel_addr;@@ -95,6 +97,15 @@ static void pegasos2_cpu_reset(void *opaque) } } +static void pegasos2_pci_irq(void *opaque, int n, int level) +{ + Pegasos2MachineState *pm = opaque;Quoted 8 lines
hw/ppc/pegasos2.c static void pegasos2_cpu_reset(void *opaque) · line 108
Quoted 6 lines
hw/ppc/pegasos2.c +6
-0+ + /* PCI interrupt lines are connected to both MV64361 and VT8231 */ + qemu_set_irq(pm->mv_pirq[n], level); + qemu_set_irq(pm->via_pirq[n], level); +} +Can you explain a bit more about how the PCI interrupt lines are connected to both the MV64361 and VT8231? The reason for asking is that I see a similar
I think I already did that in previous replies but I try again. In pagasosII schematics at https://www.powerdeveloper.org/platforms/pegasos/schematics
Sheet 2 Marvell System Controller shows PINTA-D are connected to MV64361 MPP12-15 pins that are also called GPP in the docs (I think these are referred to as either Multi Purpose or General Purpose Pins).
Sheet 18 VIA VT8231 Southbridge shows INTR_A-D connected to VT8231 PINTA-D pins, which are connected to INTA-D on sheet 13 PCI Top Level. Sheet 1 Top Level Pegasos shows that Sheet 13 INTA-D are connected to Sheet 2 PINTA-D.
Quoted 7 lines
Quoted 1 line
pattern in the bonito board, but there I can't see how those lines would be used because they can also raise a CPU interrupt, yet it is a different one compared to the 8259.
Both the MV64361 and VT8231 have interrupt mask registers which allow the guest to choose where it wants an interrupt from. I guess different guests could use one or the other, unlikely they would use both but they could even do that if they wanted. I guess in bonito it's also maskable so the guest could set up irqs by programing the apprpriate north and south bridge registers. A guest which has ISA drivers (probably most) may likely want to route them to ISA IRQs in the VIA chip. Maybe this strange behaviour has to do with Windows compatibility and standards back then which never really took off like CHRP for PP
Quoted 1 line
Given that we know from Bernhard's tests that the fuloong2e board works with
pci_bus_irqs()included invia_isa_realize()which overwrites the bonito equivalent, I'm wondering if themv_pirqarray is actually needed at all and whether it may just be a debugging aid? Certainly it makes things simpler to just route everything to the VIA device.In any case calling
pci_bus_irqsin the VIA device would be wrong and connections
Why? In general the PCI bus should be managed completely internally and not exposed to the board. This should certainly be the case for the VIA chipsets which can be used across multiple QEMU machines.
Quoted 1 line
should be made here by the board as that correctly models the hardware separating components and allows different boards to use the chip model in the future. I remember that I've implemenred connections to MV64361 for something but I don't remember which guest so as this already works and models what the schematics say I see no reason not to have it or remove it.
That doesn't really help much I'm afraid - are the extra pirq lines required or not? If so, which guest OS are they being used for? This information should be included in the commit message and a code comment, as if you don't document things like this you risk someone attempting a tidy-up refactoring which will break your guest OS.
ATB,
Mark.
Re: [PATCH v8 4/6] hw/ppc/pegasos2: Fix PCI interrupt routing
Quoted 76 lines · Mark Cave-Ayland
Quoted 75 lines · BALATON Zoltan
Quoted 57 lines · Mark Cave-Ayland
Quoted 56 lines · BALATON Zoltan
According to the PegasosII schematics the PCI interrupt lines are connected to both the gpp pins of the Mv64361 north bridge and the PINT pins of the VT8231 south bridge so guests can get interrupts from either of these. So far we only had the MV64361 connections which worked for on board devices but for additional PCI devices (such as network or sound card added with -device) guest OSes expect interrupt from the ISA IRQ 9 where the firmware routes these PCI interrupts in VT8231 ISA bridge. After the previous patches we can now model this and also remove the board specific connection from mv64361. Also configure routing of these lines when using Virtual Open Firmware to match board firmware for guests that expect this.
This fixes PCI interrupts on pegasos2 under Linux, MorphOS and AmigaOS.
Signed-off-by BALATON Zoltan <[email protected]>Reviewed-by Daniel Henrique Barboza <[email protected]>Tested-by Rene Engel <[email protected]>---
hw/pci-host/mv64361.c| 4 ---- hw/ppc/pegasos2.c | 26 +++++++++++++++++++++++++-2 files changed, 25 insertions(+), 5 deletions(-)hw/pci-host/mv64361.c +0
-4@@ -873,10 +873,6 @@ static void mv64361_realize(DeviceState *dev, Error **errp) } sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->cpu_irq); qdev_init_gpio_in_named(dev, mv64361_gpp_irq, "gpp", 32); - /* FIXME: PCI IRQ connections may be board specific */ - for (i = 0; i < PCI_NUM_PINS; i++) { - s->pci[1].irq[i] = qdev_get_gpio_in_named(dev, "gpp", 12 + i); - } } static void mv64361_reset(DeviceState *dev)hw/ppc/pegasos2.c +4
-0@@ -73,6 +73,8 @@ struct Pegasos2MachineState { MachineState parent_obj; PowerPCCPU *cpu; DeviceState *mv; + qemu_irq mv_pirq[PCI_NUM_PINS]; + qemu_irq via_pirq[PCI_NUM_PINS]; Vof *vof; void *fdt_blob; uint64_t kernel_addr;@@ -95,6 +97,15 @@ static void pegasos2_cpu_reset(void *opaque) } } +static void pegasos2_pci_irq(void *opaque, int n, int level) +{ + Pegasos2MachineState *pm = opaque;Quoted 8 lines
hw/ppc/pegasos2.c static void pegasos2_cpu_reset(void *opaque) · line 108
Quoted 6 lines
hw/ppc/pegasos2.c +6
-0+ + /* PCI interrupt lines are connected to both MV64361 and VT8231 */ + qemu_set_irq(pm->mv_pirq[n], level); + qemu_set_irq(pm->via_pirq[n], level); +} +Can you explain a bit more about how the PCI interrupt lines are connected to both the MV64361 and VT8231? The reason for asking is that I see a similar
I think I already did that in previous replies but I try again. In pagasosII schematics at https://www.powerdeveloper.org/platforms/pegasos/schematics
Sheet 2 Marvell System Controller shows PINTA-D are connected to MV64361 MPP12-15 pins that are also called GPP in the docs (I think these are referred to as either Multi Purpose or General Purpose Pins).
Sheet 18 VIA VT8231 Southbridge shows INTR_A-D connected to VT8231 PINTA-D pins, which are connected to INTA-D on sheet 13 PCI Top Level. Sheet 1 Top Level Pegasos shows that Sheet 13 INTA-D are connected to Sheet 2 PINTA-D.
Quoted 1 line
pattern in the bonito board, but there I can't see how those lines would be used because they can also raise a CPU interrupt, yet it is a different one compared to the 8259.
Quoted 7 lines
Quoted 5 lines
Both the MV64361 and VT8231 have interrupt mask registers which allow the guest to choose where it wants an interrupt from. I guess different guests could use one or the other, unlikely they would use both but they could even do that if they wanted. I guess in bonito it's also maskable so the guest could set up irqs by programing the apprpriate north and south bridge registers. A guest which has ISA drivers (probably most) may likely want to route them to ISA IRQs in the VIA chip. Maybe this strange behaviour has to do with Windows compatibility and standards back then which never really took off like CHRP for PP
Quoted 1 line
Given that we know from Bernhard's tests that the fuloong2e board works with
pci_bus_irqs()included invia_isa_realize()which overwrites the bonito equivalent, I'm wondering if themv_pirqarray is actually needed at all and whether it may just be a debugging aid? Certainly it makes things simpler to just route everything to the VIA device.In any case calling
pci_bus_irqsin the VIA device would be wrong and connectionsWhy? In general the PCI bus should be managed completely internally and not exposed to the board. This should certainly be the case for the VIA chipsets which can be used across multiple QEMU machines.
The PCI bus belongs to the Mv64361 so can't be managed by VT8231 internally which is a south bridge and a PCI device. The datasheet clearly says it has pins for PCI interrupts that it can route to ISA interrupts which is what I've modelled. Other times you want me to model every unnecessary detail of a chip with QDev but in this case you'd be OK to break things by replacing IRQs of a bus this device is connected to and not even owning? I can't follow what you think.
Quoted 3 lines
Quoted 1 line
should be made here by the board as that correctly models the hardware separating components and allows different boards to use the chip model in the future. I remember that I've implemenred connections to MV64361 for something but I don't remember which guest so as this already works and models what the schematics say I see no reason not to have it or remove it.
That doesn't really help much I'm afraid - are the extra pirq lines required or not? If so, which guest OS are they being used for? This information should be included in the commit message and a code comment, as if you don't document things like this you risk someone attempting a tidy-up refactoring which will break your guest OS.
My understanding of the schematics is what I've written and it matches the code now so I'm happy with that. I'll make sure that no refactoring will break guests I care about and removing this could break something while leaving doesn't.
Regards,
BALATON Zoltan
Re: [PATCH v8 4/6] hw/ppc/pegasos2: Fix PCI interrupt routing
In reply to Mark Cave-AylandQuoted 66 lines · Mark Cave-Ayland
Quoted 52 lines · BALATON Zoltan
According to the PegasosII schematics the PCI interrupt lines are connected to both the gpp pins of the Mv64361 north bridge and the PINT pins of the VT8231 south bridge so guests can get interrupts from either of these. So far we only had the MV64361 connections which worked for on board devices but for additional PCI devices (such as network or sound card added with -device) guest OSes expect interrupt from the ISA IRQ 9 where the firmware routes these PCI interrupts in VT8231 ISA bridge. After the previous patches we can now model this and also remove the board specific connection from mv64361. Also configure routing of these lines when using Virtual Open Firmware to match board firmware for guests that expect this.
This fixes PCI interrupts on pegasos2 under Linux, MorphOS and AmigaOS.
Signed-off-by BALATON Zoltan <[email protected]>Reviewed-by Daniel Henrique Barboza <[email protected]>Tested-by Rene Engel <[email protected]>--- hw/pci-host/mv64361.c | 4 ---- hw/ppc/pegasos2.c | 26 +++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 5 deletions(-)hw/pci-host/mv64361.c +0
-4@@ -873,10 +873,6 @@ static void mv64361_realize(DeviceState *dev, Error **errp) }sysbus_init_irq (SYS_BUS_DEVICE (dev), &s->cpu_irq);qdev_init_gpio_in_named (dev, mv64361_gpp_irq,"gpp" ,32 ); -/* FIXME: PCI IRQ connections may be board specific */ -for (i =0 ; i <PCI_NUM_PINS ; i++) { - s->pci[1 ].irq[i] =qdev_get_gpio_in_named (dev,"gpp" ,12 + i); - } }static void mv64361_reset (DeviceState *dev)hw/ppc/pegasos2.c +2
-0@@ -73,6 +73,8 @@ struct Pegasos2MachineState {MachineState parent_obj;PowerPCCPU *cpu;DeviceState *mv; +qemu_irq mv_pirq[PCI_NUM_PINS ]; +qemu_irq via_pirq[PCI_NUM_PINS ];Vof *vof;void *fdt_blob;uint64_t kernel_addr;@@ -95,6 +97,15 @@ static void pegasos2_cpu_reset(void *opaque) }hw/ppc/pegasos2.c static void pegasos2_cpu_reset(void *opaque) · line 107
Quoted 10 lines
hw/ppc/pegasos2.c +8
-0} +static void pegasos2_pci_irq(void *opaque, int n, int level) +{ +Pegasos2MachineState *pm = opaque; + +/* PCI interrupt lines are connected to both MV64361 and VT8231 */ +qemu_set_irq (pm->mv_pirq[n], level); +qemu_set_irq (pm->via_pirq[n], level); +} +Can you explain a bit more about how the PCI interrupt lines are connected to both the MV64361 and VT8231? The reason for asking is that I see a similar pattern in the bonito board, but there I can't see how those lines would be used because they can also raise a CPU interrupt, yet it is a different one compared to the 8259.
Quoted 1 line
Given that we know from Bernhard's tests that the fuloong2e board works with
pci_bus_irqs()included invia_isa_realize()which overwrites the bonito equivalent, I'm wondering if themv_pirqarray is actually needed at all and
Also I'd be cautious of tests on fuloong2e unless it was done with binary known to work on real machine as we have found before that those binaries for the real machine expect IDE to use IRQ 14/15 like pegasos2 guests but the e.g. the default config in Linux would also work with native IRQs as documented in the datasheet but that's apparently not how it really works on real hardware (proven by binaries written for and tested on real hardware did not work with the model which followed the datasheet) so we had to change that later to match hardware. You may remember this, it was found around the time when we tested via-ide with different guests and some worked some didn't with the native mode IRQs. This suggests that datasheets and tests with code not verified to work on real hardware is unreliable (so are PCI standards that the VIA chip apparently does not follow). So I'd only trust guests that were running on the real machine.
Regards,
BALATON Zoltan
Re: [PATCH v8 4/6] hw/ppc/pegasos2: Fix PCI interrupt routing
Quoted 5 lines · BALATON Zoltan
Quoted 3 lines
Can you explain a bit more about how the PCI interrupt lines are connected to both the MV64361 and VT8231? The reason for asking is that I see a similar pattern in the bonito board, but there I can't see how those lines would be used because they can also raise a CPU interrupt, yet it is a different one compared to the 8259.
Given that we know from Bernhard's tests that the fuloong2e board works with
pci_bus_irqs()included invia_isa_realize()which overwrites the bonito equivalent, I'm wondering if themv_pirqarray is actually needed at all andAlso I'd be cautious of tests on fuloong2e unless it was done with binary known to work on real machine as we have found before that those binaries for the real machine expect IDE to use IRQ 14/15 like pegasos2 guests but the e.g. the default config in Linux would also work with native IRQs as documented in the datasheet but that's apparently not how it really works on real hardware (proven by binaries written for and tested on real hardware did not work with the model which followed the datasheet) so we had to change that later to match hardware. You may remember this, it was found around the time when we tested via-ide with different guests and some worked some didn't with the native mode IRQs. This suggests that datasheets and tests with code not verified to work on real hardware is unreliable (so are PCI standards that the VIA chip apparently does not follow). So I'd only trust guests that were running on the real machine.
This may have been true when these discussions occurred a couple of years ago, but things are different now. I'm now confident that there is no such thing as a "half native" mode, and in fact the confusing behaviour being exhibited was because the code was trying to work around the fact that the VIA device was missing PCI IRQ routing.
Can you provide details of the kernel, initrd and rootfs that you use to test the fuloong2e board?
ATB,
Mark.
PATCH v8 5/6 hw/usb/vt82c686-uhci-pci: Use PCI IRQ routing
In reply to BALATON ZoltanFrom: Bernhard Beschow <[email protected]>
According to the PCI specification, PCI_INTERRUPT_LINE shall have no effect on hardware operations. Now that the VIA south bridges implement the internal PCI interrupt router let's be more conformant to the PCI specification.
--- hw/usb/vt82c686-uhci-pci.c | 12 ------------ 1 file changed, 12 deletions(-)
hw/usb/vt82c686-uhci-pci.c +0 -12
@@ -1,17 +1,7 @@#include "qemu/osdep.h" -#include "hw/irq.h" #include "hw/isa/vt82c686.h" #include "hcd-uhci.h" -static void uhci_isa_set_irq (void *opaque,int irq_num,int level) -{ -UHCIState *s = opaque; -uint8_t irq =pci_get_byte (s->dev.config +PCI_INTERRUPT_LINE ); -if (irq >0 && irq <15 ) { -via_isa_set_irq (pci_get_function_0 (&s->dev), irq, level); - } -} -static void usb_uhci_vt82c686b_realize (PCIDevice *dev,Error **errp) {UHCIState *s =UHCI (dev);
@@ -25,8 +15,6 @@ static void usb_uhci_vt82c686b_realize(PCIDevice *dev, Error **errp)pci_set_long (pci_conf +0xc0 ,0x00002000 );usb_uhci_common_realize (dev, errp); -object_unref (s->irq); - s->irq =qemu_allocate_irq (uhci_isa_set_irq, s,0 ); }static UHCIInfo uhci_info[] = {
Signature · 1 line
2.30.8
PATCH v8 6/6 hw/audio/via-ac97: Basic implementation of audio playback
In reply to BALATON ZoltanAdd basic implementation of the AC'97 sound part used in VIA south bridge chips. Not all features of the device is emulated, only one playback channel is supported for now but this is enough to get sound output from some guests using this device on pegasos2.
--- hw/audio/trace-events | 6 + hw/audio/via-ac97.c | 455 +++++++++++++++++++++++++++++++++++++- hw/isa/trace-events | 1 + hw/isa/vt82c686.c | 2 +- include/hw/isa/vt82c686.h | 25 +++ 5 files changed, 482 insertions(+), 7 deletions(-)
hw/audio/trace-events +6 -0
@@ -11,3 +11,9 @@ hda_audio_running(const char *stream, int nr, bool running) "st %s, nr %d, run % hda_audio_format(const char *stream, int chan, const char *fmt, int freq) "st %s, %d x %s @ %d Hz" hda_audio_adjust(const char *stream, int pos) "st %s, pos %d" hda_audio_overrun(const char *stream) "st %s" + +#via-ac97.c +via_ac97_codec_write(uint8_t addr, uint16_t val) "0x%x <- 0x%x" +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" +via_ac97_sgd_read(uint64_t addr, unsigned size, uint64_t val) "0x%"PRIx64" %d -> 0x%"PRIx64 +via_ac97_sgd_write(uint64_t addr, unsigned size, uint64_t val) "0x%"PRIx64" %d <- 0x%"PRIx64
hw/audio/via-ac97.c +449 -6
495 lines not on this page · raw message
hw/isa/trace-events +1 -0
@@ -16,6 +16,7 @@ apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x" # vt82c686.c via_isa_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x" +via_pm_read(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x" via_pm_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x" via_pm_io_read(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x" via_pm_io_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x"
hw/isa/vt82c686.c +1 -1
@@ -554,7 +554,7 @@ struct ViaISAState {PCIIDEState ide;UHCIState uhci[2 ];ViaPMState pm; -PCIDevice ac97; +ViaAC97State ac97;PCIDevice mc97; };
include/hw/isa/vt82c686.h +25 -0
@@ -1,6 +1,8 @@#ifndef HW_VT82C686_H #define HW_VT82C686_H +#include "hw/pci/pci_device.h" +#include "audio/audio.h" #define TYPE_VT82C686B_ISA "vt82c686b-isa"#define TYPE_VT82C686B_USB_UHCI "vt82c686b-usb-uhci"
@@ -9,6 +11,29 @@#define TYPE_VIA_IDE "via-ide"#define TYPE_VIA_MC97 "via-mc97" +typedef struct { +uint8_t stat; +uint8_t type; +uint32_t base; +uint32_t curr; +uint32_t addr; +uint32_t clen; +}ViaAC97SGDChannel ; + +OBJECT_DECLARE_SIMPLE_TYPE (ViaAC97State,VIA_AC97 ); + +struct ViaAC97State { +PCIDevice dev; +QEMUSoundCard card; +MemoryRegion sgd; +MemoryRegion fm; +MemoryRegion midi; +SWVoiceOut *vo; +ViaAC97SGDChannel aur; +uint16_t codec_regs[128 ]; +uint32_t ac97_cmd; +}; +void via_isa_set_irq (PCIDevice *d,int n,int level);#endif
Signature · 1 line
2.30.8