qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH]: add leon target


From: Tristan Gingold
Subject: Re: [Qemu-devel] [PATCH]: add leon target
Date: Thu, 8 Jan 2009 09:53:01 +0100


On Jan 7, 2009, at 6:03 PM, Blue Swirl wrote:

On 1/7/09, Tristan Gingold <address@hidden> wrote:
Hi,

this patch adds a new target: leon which is an open source sparc v8 variant.

Thanks for the patch. Is there any way to test the system, rom images
etc? Any system level docs?

I can send an image if you need one. I can also send the sources but I suppose it would be useless to you
as this is Ada code.

For docs, see:
http://www.atmel.com/dyn/products/product_card.asp?part_id=3178

or www.gaisler.com

(Don't forget leon is open-source.  You can get VHDL files if you need).

Do you think it would be useful to port OpenBIOS to the system?

Usually this chip is used in space engine: no disk and no ethernet. I doubt OpenBIOS would be useful. Gaisler Research provides a monitor but I didn't test it on qemu (and I am not sure it is freely available). Also there is a port of Linux. I once made it running on qemu (maybe 4 years ago). It should be the
easiest way to test the system.

The cpu itself implements the v8 architecture so there is nothing to change. However the devices are different and in particular the interrupt controller.

To handle different interrupt controllers, I added a new field in
CPUSPARCState like it is done on PowerPC.

I have a feeling that this should be handled some other way but I
don't know how yet. CPU emulation should not know about boards.

I have the same feeling too. I am ready to improve the code but I need a few advices. As currently implemented CPU emulation know about interrupt controller. Wether interrupt controller
belongs to CPU or to the board is an open question :-)
Do you simply prefer to have hooks in CPUSPARCState ?

The same question applies to the MMU. Most of early SPARC models do not have an integrated MMU.
Leon2 MMU is optional too.

Comments are welcome,
Tristan.

Maybe the leon.c should be split, each device in a separate file.
Though I guess the devices are so unique that they won't be used
elsewhere.

Yes, they are so unique that it would create a lot of small files. I am not sure we want to go that way.

+
+    switch (env->intctl) {
+    case intctl_sun4c:
+    case intctl_sun4m:
+#if !defined(CONFIG_USER_ONLY)
+      cpu_check_irqs(env);
+#endif
+      break;
+    case intctl_leon2:
+      if ((intno & ~15) == TT_EXTINT)
+       leon2_intctl_ack (env, intno);

This breaks linux-user compilation, the whole switch should be enclosed in
#if !defined(CONFIG_USER_ONLY)
#endif

Oops, sorry.  I will fix that.

For extra bonus, you could implement the following:
- register device reset methods
- savevm/loadvm support
- pic_info, irq_info support

Ok.

Tristan.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]