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: Edgar E. Iglesias
Subject: Re: [Qemu-devel] [PATCH]: add leon target
Date: Thu, 8 Jan 2009 11:01:56 +0100
User-agent: Mutt/1.5.16 (2007-06-09)

On Thu, Jan 08, 2009 at 09:53:01AM +0100, Tristan Gingold wrote:
>
> On Jan 7, 2009, at 6:03 PM, Blue Swirl wrote:
>
>> On 1/7/09, Tristan Gingold <address@hidden> wrote:
>>> Hi,

Thanks for the patch Tristian,

I've got a couple of comments:

>>>
>>> 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 ?

>From my experience, interrupt controllers are usually not considered to
be part of the CPU.

Regarding the leon interrupt controller, I had a quick look at the vhdl and
AFAICT there is no need for any special tricks in the sparc cpu model.
What you need is to handle accesses to the interrupt clear register, in your
code you seem to call it ITC and your io_writel does not handle it.
This is the place to hook in calls to mask off bits from the pending
interrupt reg.

Your leon software should be writing to this register when acking
interrupts.

What you are doing know is providing a magic automatic ACK from the core as
soon as the interrupt is taken, IIUC this is not what leon does.

>
> 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.

IMO you should be splitting the different blocks into separate files as
already suggested. You should also register separate IO regions for every
block. This is important in order to be able to reuse the blocks
for different leon based socs/boards that may have different memory maps.

Cheers




reply via email to

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