diff mbox series

[3/3] hw/isa/piix4: Correct IRQRC[A:D] reset values

Message ID 20221026194619.28880-4-philmd@linaro.org
State Superseded
Headers show
Series hw/isa/piix4: Remove MIPS Malta specific bits | expand

Commit Message

Philippe Mathieu-Daudé Oct. 26, 2022, 7:46 p.m. UTC
IRQRC[A:D] registers reset value is 0x80. We were forcing
the MIPS Malta machine routing to be able to boot a Linux
kernel without any bootloader.
We now have these registers initialized in the Malta machine
write_bootloader(), so we can use the correct reset values.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/isa/piix4.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Bernhard Beschow Oct. 26, 2022, 9:32 p.m. UTC | #1
On Wed, Oct 26, 2022 at 9:46 PM Philippe Mathieu-Daudé <philmd@linaro.org>
wrote:

> IRQRC[A:D] registers reset value is 0x80. We were forcing
> the MIPS Malta machine routing to be able to boot a Linux
> kernel without any bootloader.
> We now have these registers initialized in the Malta machine
> write_bootloader(), so we can use the correct reset values.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/isa/piix4.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
> index 15f344dbb7..a2165c6a49 100644
> --- a/hw/isa/piix4.c
> +++ b/hw/isa/piix4.c
> @@ -115,10 +115,10 @@ static void piix4_isa_reset(DeviceState *dev)
>      pci_conf[0x4c] = 0x4d;
>      pci_conf[0x4e] = 0x03;
>      pci_conf[0x4f] = 0x00;
> -    pci_conf[0x60] = 0x0a; // PCI A -> IRQ 10
> -    pci_conf[0x61] = 0x0a; // PCI B -> IRQ 10
> -    pci_conf[0x62] = 0x0b; // PCI C -> IRQ 11
> -    pci_conf[0x63] = 0x0b; // PCI D -> IRQ 11
> +    pci_conf[0x60] = 0x80;
> +    pci_conf[0x61] = 0x80;
> +    pci_conf[0x62] = 0x80;
> +    pci_conf[0x63] = 0x80;
>

Running `qemu-system-mips64el -M malta -kernel vmlinux-3.2.0-4-5kc-malta
-hda debian_wheezy_mipsel_standard.qcow2 -append "root=/dev/sda1
console=ttyS0"` with this patch Linux outputs:

[    7.944000] uhci_hcd: USB Universal Host Controller Interface driver
[    7.944000] uhci_hcd 0000:00:0a.2: Found HC with no IRQ. Check BIOS/PCI
0000:00:0a.2 setup!
[    7.944000] uhci_hcd 0000:00:0a.2: init 0000:00:0a.2 fail, -19

Omitting this patch from the series the USB host is found.

Best regards,
Bernhard


>      pci_conf[0x69] = 0x02;
>      pci_conf[0x70] = 0x80;
>      pci_conf[0x76] = 0x0c;
> --
> 2.37.3
>
>
Philippe Mathieu-Daudé Oct. 27, 2022, 8:45 p.m. UTC | #2
On 26/10/22 23:32, Bernhard Beschow wrote:
> On Wed, Oct 26, 2022 at 9:46 PM Philippe Mathieu-Daudé 
> <philmd@linaro.org <mailto:philmd@linaro.org>> wrote:
> 
>     IRQRC[A:D] registers reset value is 0x80. We were forcing
>     the MIPS Malta machine routing to be able to boot a Linux
>     kernel without any bootloader.
>     We now have these registers initialized in the Malta machine
>     write_bootloader(), so we can use the correct reset values.
> 
>     Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org
>     <mailto:philmd@linaro.org>>
>     ---
>       hw/isa/piix4.c | 8 ++++----
>       1 file changed, 4 insertions(+), 4 deletions(-)
> 
>     diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
>     index 15f344dbb7..a2165c6a49 100644
>     --- a/hw/isa/piix4.c
>     +++ b/hw/isa/piix4.c
>     @@ -115,10 +115,10 @@ static void piix4_isa_reset(DeviceState *dev)
>           pci_conf[0x4c] = 0x4d;
>           pci_conf[0x4e] = 0x03;
>           pci_conf[0x4f] = 0x00;
>     -    pci_conf[0x60] = 0x0a; // PCI A -> IRQ 10
>     -    pci_conf[0x61] = 0x0a; // PCI B -> IRQ 10
>     -    pci_conf[0x62] = 0x0b; // PCI C -> IRQ 11
>     -    pci_conf[0x63] = 0x0b; // PCI D -> IRQ 11
>     +    pci_conf[0x60] = 0x80;
>     +    pci_conf[0x61] = 0x80;
>     +    pci_conf[0x62] = 0x80;
>     +    pci_conf[0x63] = 0x80;
> 
> 
> Running `qemu-system-mips64el -M malta -kernel vmlinux-3.2.0-4-5kc-malta 
> -hda debian_wheezy_mipsel_standard.qcow2 -append "root=/dev/sda1 
> console=ttyS0"` with this patch Linux outputs:
> 
> [    7.944000] uhci_hcd: USB Universal Host Controller Interface driver
> [    7.944000] uhci_hcd 0000:00:0a.2: Found HC with no IRQ. Check 
> BIOS/PCI 0000:00:0a.2 setup!
> [    7.944000] uhci_hcd 0000:00:0a.2: init 0000:00:0a.2 fail, -19
> 
> Omitting this patch from the series the USB host is found.

Oh, I should have used tswap() instead of bswap()! I have been moving
and my test suite is on an offline backup, I'm not yet set up. As you
see my testing is poor :/
diff mbox series

Patch

diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
index 15f344dbb7..a2165c6a49 100644
--- a/hw/isa/piix4.c
+++ b/hw/isa/piix4.c
@@ -115,10 +115,10 @@  static void piix4_isa_reset(DeviceState *dev)
     pci_conf[0x4c] = 0x4d;
     pci_conf[0x4e] = 0x03;
     pci_conf[0x4f] = 0x00;
-    pci_conf[0x60] = 0x0a; // PCI A -> IRQ 10
-    pci_conf[0x61] = 0x0a; // PCI B -> IRQ 10
-    pci_conf[0x62] = 0x0b; // PCI C -> IRQ 11
-    pci_conf[0x63] = 0x0b; // PCI D -> IRQ 11
+    pci_conf[0x60] = 0x80;
+    pci_conf[0x61] = 0x80;
+    pci_conf[0x62] = 0x80;
+    pci_conf[0x63] = 0x80;
     pci_conf[0x69] = 0x02;
     pci_conf[0x70] = 0x80;
     pci_conf[0x76] = 0x0c;