From: Bernhard Beschow <shentey@gmail.com>
To: BALATON Zoltan <balaton@eik.bme.hu>, qemu-devel@nongnu.org
Cc: philmd@linaro.org, smarkusg@gmail.com
Subject: Re: Using parallel port on the Pegasos 2
Date: Mon, 26 May 2025 09:59:30 +0000 [thread overview]
Message-ID: <9F18409A-D9E4-45B3-8A82-BF605F9C56CE@gmail.com> (raw)
In-Reply-To: <1d4bc5e4-54ee-84d4-6f5c-50e2d5dd2850@eik.bme.hu>
Am 25. Mai 2025 00:03:15 UTC schrieb BALATON Zoltan <balaton@eik.bme.hu>:
>On Sun, 28 Jul 2024, BALATON Zoltan wrote:
>> On Sun, 28 Jul 2024, quan wrote:
>>> I am playing around with the parallel port on the pegasos 2 and I noticed
>>> the following issue:
>>> The parallel port on startup is set to iobase 0x378, then later it gets
>>> remapped to iobase 0x3bc.
>>> When I tried writing to the 0x3bc location with
>>> trace:memory_region_ops_write on, I get logs about writing to the location
>>> 'parallel', so far so good, but the writes don't make it through (it never
>>> calls parallel_ioport_write* functions)
>>>
>>> I traced it through where it calls portio_write, and inside the
>>> portio_write code:
>>> This line always fails for me:
>>> const MemoryRegionPortio *mrp = find_portio(mrpio, addr, size, true);
>>> This is due to the mrpio has the offset of 0x44 (0x3bc-0x378) in the list,
>>> and the 'addr' in the code ranges from (0-15) (address relative to 0x3bc),
>>> so it can never match the parallel io function to execute.
>>>
>>> This seems like a bug to me. I think there is some issue where the
>>> portio_list is not getting updated properly after the remapping to 0x3bc.
>>>
>>> The other devices (Serial, RTC, PM, VGA) responds properly for me, so it is
>>> only the parallel port that has this issue.
>>
>> Is this something that broke recently or can the same be reproduced with QEMU v8.2.0. The relocation of these devices was implemented around commit 35a6380b4ed27f (and the ones before that). Adding Bernhard to cc as well.
>
>This commit also seems to break display with some VGA ROMs as can be reproduced with:
>
>qemu-system-ppc -machine pegasos2 -bios pegasos2.rom -serial stdio -vga none -device ati-vga,romfile=ati-rage128progl16mb.VBI
>
>where the romfile is something from http://vgamuseum.info/index.php/companies/item/111-ati-rage-128-pro for example). Until commit 35a6380b4ed27f^ you get picture on emulated VGA but not after (although I have no idea what a VGA BIOS has to do with the parallel port). Any idea how to fix this?
Here an observation: Executing `info mtree` reveals that the parallel port gets mapped to 0x3bc - 0x3c3 which overlaps with some vga region (0x3c0 - 0x3cf). So the commit seems to expose a firmware bug in pegasos2.rom or in its default configuration. On real hardware both devices might respond such that the bug might not materialize there like in QEMU, but that's just a guess. Maybe one could work around that by decreasing the priority of the parallel io ports.
Best regards,
Bernhard
>
>Regards,
>BALATON Zoltan
next prev parent reply other threads:[~2025-05-26 10:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-28 14:59 Using parallel port on the Pegasos 2 quan
2024-07-28 19:17 ` BALATON Zoltan
2024-07-28 20:59 ` quan
2024-07-28 22:33 ` BALATON Zoltan
2024-07-28 22:43 ` quan
2025-05-25 0:03 ` BALATON Zoltan
2025-05-26 9:59 ` Bernhard Beschow [this message]
2025-05-26 11:47 ` BALATON Zoltan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9F18409A-D9E4-45B3-8A82-BF605F9C56CE@gmail.com \
--to=shentey@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=smarkusg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).