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 11:09:45 +0100



Hi,


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.

(What about LAPIC/LSAPIC ?)

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.

No.  You have missed (p19):

When the IU acknowledges the interrupt, the corresponding pending bit will
automatically be cleared.

This is the only reason why the CPU must inform the interrupt controller.

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.

It is ;-)

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.

Ok.

Tristan.





reply via email to

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