* Re: [Qemu-devel] Qemu and Linux 2.4
@ 2007-09-26 16:25 ` Alexander Voropay
0 siblings, 0 replies; 18+ messages in thread
From: Alexander Voropay @ 2007-09-26 16:25 UTC (permalink / raw)
To: qemu-devel, Thiemo Seufer; +Cc: linux-mips, vlad
<vlad@comsys.ro> wrote:
>>> - QEMU malta emulation is not really complete, to put it mildly
>> Out of curiosity, what parts did you miss?
> Like, for example, the PCI stuff. So I can use the network card.
PCI stuff in the QEMU/Malta works fine, but pseudo-bootrom
does not perform PCI enumeration and leaves uninitialized PCI BARs.
Linux MIPS/Malta 2.4 can not perform PCI enumeration too. The LANCE
Ethernet driver *requres* a pre-initialized BARs. The situation even worse,
since current Linux 2.4 can't be even built with NEW_PCI and PCI_AUTO
options at all (due to linkage error).
http://www.linux-mips.org/wiki/PCI_Subsystem
There is the same PCI problem with NetBSD/evbmips and seems VxWorks/Malta.
> And yes, I am aware of YAMON.
AFAIK, YAMON may runs on the MIPS hardware only, and may not
be redistribuded in the source or binary form.
Anyway, YAMON binary does not work on the Qemu/Malta. The Galileo
chip is far more complicated then Qemu emulation. It contains four DMA
channels, four timers e.t.c. e.t.c.
>> I recommend to improve the Qemu Malta emulation, and make it work with
>> 2.4 Malta kernels. (ISTR it used to work, so it shouldn't need a lot to
>> get there.)
>
> I'm sure that improving the Qemu Malta emulation is a very noble goal,
> but for people that need a working 2.4 kernel NOW, my patch could be
> useful. Having the QEMU target in 2.6 surely helped me.
The only thing we need is a good bootrom (BIOS) for the MIPS/Malta
(Free-YAMON ;)
As a quick'n'disty solution you could initialize PCI BARs of the
device number 12 (0x0b, LANCE) with GDB:
(gdb) set variable {int}0xbbe00cf8=0x80005810 <--- I/O address
(gdb) set variable {int}0xbbe00cfc=0x00002001
(gdb) set variable {int}0xbbe00cf8=0x80005814 <--- Mem address
(gdb) set variable {int}0xbbe00cfc=0xfc200000
(gdb) set variable {int}0xbbe00cf8=0x80005804 <--- Enable Mem and I/O
(gdb) set variable {int}0xbbe00cfc=0x00000003
(gdb) set variable {int}0xbbe00cf8=0x8000583c <---- IRQ=10 tied to Pin A
(gdb) set variable {int}0xbbe00cfc=0xff06010a
(gdb) cont
Continuing.
...
Linux version 2.4.35.3 (alec@ilias.nwpi.ru) (gcc version 3.3.6) #2 Tue Sep 25 18:59:10 MSD 2007
...
pcnet32.c:v1.30h 06.24.2004 tsbogend@alpha.franken.de
pcnet32: PCnet/PCI II 79C970A at 0x2000, 52 54 00 12 34 56 assigned IRQ 10.
eth0: registered as PCnet/PCI II 79C970A
pcnet32: 1 cards_found.
...
# lspci -v
....
00:0b.0 Class 0200: 1022:2000 (rev 10)
Flags: bus master, fast devsel, latency 64, IRQ 10
I/O ports at 2000 [size=32]
Memory at fc200000 (32-bit, non-prefetchable) [size=32]
# ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up
#
# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=4.2 ms
--
-=AV=-
*******************************************************************************************************
This message and any attachments (the "message") are confidential and intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
Messages are susceptible to alteration. Orange Business Services shall not be liable for the message if altered, changed or
falsified. If you are not the intended addressee of this message, please cancel it immediately and inform
the sender.
*******************************************************************************************************
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [Qemu-devel] Qemu and Linux 2.4
2007-09-26 16:25 ` Alexander Voropay
@ 2007-09-26 16:59 ` Ralf Baechle
-1 siblings, 0 replies; 18+ messages in thread
From: Ralf Baechle @ 2007-09-26 16:59 UTC (permalink / raw)
To: Alexander Voropay; +Cc: qemu-devel, Thiemo Seufer, linux-mips, vlad
On Wed, Sep 26, 2007 at 08:25:18PM +0400, Alexander Voropay wrote:
> >>>- QEMU malta emulation is not really complete, to put it mildly
> >>Out of curiosity, what parts did you miss?
> >Like, for example, the PCI stuff. So I can use the network card.
>
> PCI stuff in the QEMU/Malta works fine, but pseudo-bootrom
> does not perform PCI enumeration and leaves uninitialized PCI BARs.
>
> Linux MIPS/Malta 2.4 can not perform PCI enumeration too. The LANCE
> Ethernet driver *requres* a pre-initialized BARs. The situation even worse,
> since current Linux 2.4 can't be even built with NEW_PCI and PCI_AUTO
> options at all (due to linkage error).
>
> http://www.linux-mips.org/wiki/PCI_Subsystem
>
> There is the same PCI problem with NetBSD/evbmips and seems VxWorks/Malta.
Both CONFIG_PCI_NEW and PCI_AUTO were amazingly broken in both concept
and implementation. It is possible to get them to work well for particular
configurations but for the general case nothing else nothing but rewrite
can rescue things.
> >And yes, I am aware of YAMON.
>
> AFAIK, YAMON may runs on the MIPS hardware only, and may not
> be redistribuded in the source or binary form.
Alchemy boards run YAMON, too.
> *******************************************************************************************************
> This message and any attachments (the "message") are confidential and
> intended solely for the addressees. Any unauthorised use or dissemination
Soley for all the billion internet users, I assume ;-)
Ralf
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] Qemu and Linux 2.4
@ 2007-09-26 16:59 ` Ralf Baechle
0 siblings, 0 replies; 18+ messages in thread
From: Ralf Baechle @ 2007-09-26 16:59 UTC (permalink / raw)
To: Alexander Voropay; +Cc: linux-mips, qemu-devel, vlad
On Wed, Sep 26, 2007 at 08:25:18PM +0400, Alexander Voropay wrote:
> >>>- QEMU malta emulation is not really complete, to put it mildly
> >>Out of curiosity, what parts did you miss?
> >Like, for example, the PCI stuff. So I can use the network card.
>
> PCI stuff in the QEMU/Malta works fine, but pseudo-bootrom
> does not perform PCI enumeration and leaves uninitialized PCI BARs.
>
> Linux MIPS/Malta 2.4 can not perform PCI enumeration too. The LANCE
> Ethernet driver *requres* a pre-initialized BARs. The situation even worse,
> since current Linux 2.4 can't be even built with NEW_PCI and PCI_AUTO
> options at all (due to linkage error).
>
> http://www.linux-mips.org/wiki/PCI_Subsystem
>
> There is the same PCI problem with NetBSD/evbmips and seems VxWorks/Malta.
Both CONFIG_PCI_NEW and PCI_AUTO were amazingly broken in both concept
and implementation. It is possible to get them to work well for particular
configurations but for the general case nothing else nothing but rewrite
can rescue things.
> >And yes, I am aware of YAMON.
>
> AFAIK, YAMON may runs on the MIPS hardware only, and may not
> be redistribuded in the source or binary form.
Alchemy boards run YAMON, too.
> *******************************************************************************************************
> This message and any attachments (the "message") are confidential and
> intended solely for the addressees. Any unauthorised use or dissemination
Soley for all the billion internet users, I assume ;-)
Ralf
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] Qemu and Linux 2.4
2007-09-26 16:59 ` Ralf Baechle
(?)
@ 2007-09-27 10:06 ` Vlad Lungu
-1 siblings, 0 replies; 18+ messages in thread
From: Vlad Lungu @ 2007-09-27 10:06 UTC (permalink / raw)
To: qemu-devel
Ralf Baechle wrote:
>
> Both CONFIG_PCI_NEW and PCI_AUTO were amazingly broken in both concept
> and implementation. It is possible to get them to work well for particular
> configurations but for the general case nothing else nothing but rewrite
> can rescue things.
>
Hi Ralf,
I found this the hard way :-(
BTW, what's the status on the latest 2.4 patch I sent you?
Vlad
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] Qemu and Linux 2.4
2007-09-26 16:25 ` Alexander Voropay
@ 2007-09-26 17:12 ` Blue Swirl
-1 siblings, 0 replies; 18+ messages in thread
From: Blue Swirl @ 2007-09-26 17:12 UTC (permalink / raw)
To: Alexander Voropay, qemu-devel, openbios; +Cc: Thiemo Seufer, linux-mips, vlad
On 9/26/07, Alexander Voropay <alec@nwpi.ru> wrote:
> <vlad@comsys.ro> wrote:
>
> >>> - QEMU malta emulation is not really complete, to put it mildly
> >> Out of curiosity, what parts did you miss?
> > Like, for example, the PCI stuff. So I can use the network card.
>
> PCI stuff in the QEMU/Malta works fine, but pseudo-bootrom
> does not perform PCI enumeration and leaves uninitialized PCI BARs.
>
> Linux MIPS/Malta 2.4 can not perform PCI enumeration too. The LANCE
> Ethernet driver *requres* a pre-initialized BARs. The situation even worse,
> since current Linux 2.4 can't be even built with NEW_PCI and PCI_AUTO
> options at all (due to linkage error).
>
> http://www.linux-mips.org/wiki/PCI_Subsystem
>
> There is the same PCI problem with NetBSD/evbmips and seems VxWorks/Malta.
>
> > And yes, I am aware of YAMON.
>
> AFAIK, YAMON may runs on the MIPS hardware only, and may not
> be redistribuded in the source or binary form.
>
> Anyway, YAMON binary does not work on the Qemu/Malta. The Galileo
> chip is far more complicated then Qemu emulation. It contains four DMA
> channels, four timers e.t.c. e.t.c.
>
> >> I recommend to improve the Qemu Malta emulation, and make it work with
> >> 2.4 Malta kernels. (ISTR it used to work, so it shouldn't need a lot to
> >> get there.)
> >
> > I'm sure that improving the Qemu Malta emulation is a very noble goal,
> > but for people that need a working 2.4 kernel NOW, my patch could be
> > useful. Having the QEMU target in 2.6 surely helped me.
>
> The only thing we need is a good bootrom (BIOS) for the MIPS/Malta
> (Free-YAMON ;)
Someone could port OpenBIOS or LinuxBIOS to MIPS.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] Qemu and Linux 2.4
@ 2007-09-26 17:12 ` Blue Swirl
0 siblings, 0 replies; 18+ messages in thread
From: Blue Swirl @ 2007-09-26 17:12 UTC (permalink / raw)
To: Alexander Voropay, qemu-devel, openbios; +Cc: linux-mips, vlad
On 9/26/07, Alexander Voropay <alec@nwpi.ru> wrote:
> <vlad@comsys.ro> wrote:
>
> >>> - QEMU malta emulation is not really complete, to put it mildly
> >> Out of curiosity, what parts did you miss?
> > Like, for example, the PCI stuff. So I can use the network card.
>
> PCI stuff in the QEMU/Malta works fine, but pseudo-bootrom
> does not perform PCI enumeration and leaves uninitialized PCI BARs.
>
> Linux MIPS/Malta 2.4 can not perform PCI enumeration too. The LANCE
> Ethernet driver *requres* a pre-initialized BARs. The situation even worse,
> since current Linux 2.4 can't be even built with NEW_PCI and PCI_AUTO
> options at all (due to linkage error).
>
> http://www.linux-mips.org/wiki/PCI_Subsystem
>
> There is the same PCI problem with NetBSD/evbmips and seems VxWorks/Malta.
>
> > And yes, I am aware of YAMON.
>
> AFAIK, YAMON may runs on the MIPS hardware only, and may not
> be redistribuded in the source or binary form.
>
> Anyway, YAMON binary does not work on the Qemu/Malta. The Galileo
> chip is far more complicated then Qemu emulation. It contains four DMA
> channels, four timers e.t.c. e.t.c.
>
> >> I recommend to improve the Qemu Malta emulation, and make it work with
> >> 2.4 Malta kernels. (ISTR it used to work, so it shouldn't need a lot to
> >> get there.)
> >
> > I'm sure that improving the Qemu Malta emulation is a very noble goal,
> > but for people that need a working 2.4 kernel NOW, my patch could be
> > useful. Having the QEMU target in 2.6 surely helped me.
>
> The only thing we need is a good bootrom (BIOS) for the MIPS/Malta
> (Free-YAMON ;)
Someone could port OpenBIOS or LinuxBIOS to MIPS.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] Qemu and Linux 2.4
2007-09-26 17:12 ` Blue Swirl
(?)
@ 2007-09-27 9:59 ` Vlad Lungu
2007-09-29 8:44 ` [Qemu-devel] U-Boot Vlad Lungu
-1 siblings, 1 reply; 18+ messages in thread
From: Vlad Lungu @ 2007-09-27 9:59 UTC (permalink / raw)
To: qemu-devel
Blue Swirl wrote:
>
> Someone could port OpenBIOS or LinuxBIOS to MIPS.
>
Well, just FYI:
I sort-of-ported U-Boot to Qemu (-M mips). Network performance sucks for
some reason (hard enough that tftp-booting a kernel is impossible) and I
didn't have time to investigate this yet. But I guess that porting to
(-M malta) should not be that hard, and I think there is some PCI
support already in U-boot.
Vlad
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Qemu-devel] U-Boot
2007-09-27 9:59 ` Vlad Lungu
@ 2007-09-29 8:44 ` Vlad Lungu
0 siblings, 0 replies; 18+ messages in thread
From: Vlad Lungu @ 2007-09-29 8:44 UTC (permalink / raw)
To: qemu-devel
Vlad Lungu wrote:
lol, replying to myself
> Blue Swirl wrote:
>
>>
>> Someone could port OpenBIOS or LinuxBIOS to MIPS.
>>
>
> Well, just FYI:
>
> I sort-of-ported U-Boot to Qemu (-M mips). Network performance sucks for
> some reason (hard enough that tftp-booting a kernel is impossible) and I
> didn't have time to investigate this yet. But I guess that porting to
> (-M malta) should not be that hard, and I think there is some PCI
> support already in U-boot.
>
Reports of poor network performance have been greatly exagerated.
Apparently, what it happens is :
- qemu doesn't respond with a next-server or server-name in DHCP, apparently
- U-Boot uses broadcast in this case as the server address
- things don't quite work
Setting IP by hand or using tap for networking and configuring DHCP on
the host correctly allows loading bt TFTP (or even nfs-booting with
tap). I can boot a vmlinux with embedded ramdisk (a couple of Megs) in
maybe 10 seconds. Still getting RX timeouts, but it's no big deal.
I will polish the thing a little and post an update in 1-2 weeks max.
Maybe we can have a bootrom for MIPS shipping with Qemu, after all. Even
for malta.
Vlad
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] Qemu and Linux 2.4
2007-09-26 16:25 ` Alexander Voropay
` (2 preceding siblings ...)
(?)
@ 2007-09-27 9:53 ` Vlad Lungu
-1 siblings, 0 replies; 18+ messages in thread
From: Vlad Lungu @ 2007-09-27 9:53 UTC (permalink / raw)
To: Alexander Voropay, qemu-devel
Alexander Voropay wrote:
> <vlad@comsys.ro> wrote:
>
>>>> - QEMU malta emulation is not really complete, to put it mildly
>>> Out of curiosity, what parts did you miss?
>> Like, for example, the PCI stuff. So I can use the network card.
>
> PCI stuff in the QEMU/Malta works fine, but pseudo-bootrom
> does not perform PCI enumeration and leaves uninitialized PCI BARs.
>
> Linux MIPS/Malta 2.4 can not perform PCI enumeration too. The LANCE
> Ethernet driver *requres* a pre-initialized BARs. The situation even worse,
> since current Linux 2.4 can't be even built with NEW_PCI and PCI_AUTO
> options at all (due to linkage error).
>
> http://www.linux-mips.org/wiki/PCI_Subsystem
>
> There is the same PCI problem with NetBSD/evbmips and seems VxWorks/Malta.
Well, that's a pretty big showstopper, don't you think?
[snip]
> The only thing we need is a good bootrom (BIOS) for the MIPS/Malta
> (Free-YAMON ;)
>
> As a quick'n'disty solution you could initialize PCI BARs of the
> device number 12 (0x0b, LANCE) with GDB:
>
> (gdb) set variable {int}0xbbe00cf8=0x80005810 <--- I/O address
> (gdb) set variable {int}0xbbe00cfc=0x00002001
> (gdb) set variable {int}0xbbe00cf8=0x80005814 <--- Mem address
> (gdb) set variable {int}0xbbe00cfc=0xfc200000
> (gdb) set variable {int}0xbbe00cf8=0x80005804 <--- Enable Mem and I/O
> (gdb) set variable {int}0xbbe00cfc=0x00000003
> (gdb) set variable {int}0xbbe00cf8=0x8000583c <---- IRQ=10 tied to Pin A
> (gdb) set variable {int}0xbbe00cfc=0xff06010a
> (gdb) cont
> Continuing.
That's dirty alright, but not exactly quick. You kind of need gdb :-)
Vlad
^ permalink raw reply [flat|nested] 18+ messages in thread