Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-03 Thread Avi Kivity
On 08/03/2011 12:10 PM, Peter Maydell wrote: [*] I did convince myself that you do want a sysbus bus on each chip select, because in theory in the hardware you could put an external address decoder on the gpmc_a[] bus and hang multiple devices off one chipselect. So that's a sysbus, really. No,

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-03 Thread Peter Maydell
On 3 August 2011 03:25, Anthony Liguori wrote: > On 08/02/2011 04:28 PM, Peter Maydell wrote: >> Typically in the latter case the device we're talking to will >> also provide some gpio or irq signals, which will be routed in >> a totally different direction having nothing to do with the GPMC. >> S

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Avi Kivity
On 08/03/2011 05:33 AM, Anthony Liguori wrote: On 08/02/2011 04:29 PM, Avi Kivity wrote: On 08/03/2011 12:06 AM, Anthony Liguori wrote: The qdev level should be the common base that makes sense for *all* qdev devices. IRQ management does not belong in DeviceState because what you do for a simp

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Avi Kivity
On 08/03/2011 05:26 AM, Anthony Liguori wrote: On 08/02/2011 04:48 PM, Avi Kivity wrote: On 08/03/2011 12:28 AM, Peter Maydell wrote: On 2 August 2011 21:56, Anthony Liguori wrote: > Hrm, this looks like badness to me. > > You're effectively using MemoryRegions to implement an ad-hoc interface.

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Anthony Liguori
On 08/02/2011 04:29 PM, Avi Kivity wrote: On 08/03/2011 12:06 AM, Anthony Liguori wrote: The qdev level should be the common base that makes sense for *all* qdev devices. IRQ management does not belong in DeviceState because what you do for a simple LCD is not what you do for an MSI-X capable P

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Anthony Liguori
On 08/02/2011 04:48 PM, Avi Kivity wrote: On 08/03/2011 12:28 AM, Peter Maydell wrote: On 2 August 2011 21:56, Anthony Liguori wrote: > Hrm, this looks like badness to me. > > You're effectively using MemoryRegions to implement an ad-hoc interface. As you'll see below, the hardware intreface is

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Anthony Liguori
On 08/02/2011 04:28 PM, Peter Maydell wrote: On 2 August 2011 21:56, Anthony Liguori wrote: Hrm, this looks like badness to me. You're effectively using MemoryRegions to implement an ad-hoc interface. As you'll see below, the hardware intreface is somewhat ad-hoc :-) This is not what Mem

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Peter Maydell
On 2 August 2011 22:48, Avi Kivity wrote: > On 08/03/2011 12:28 AM, Peter Maydell wrote: >> As you'll see below, the hardware intreface is somewhat ad-hoc :-) > > IMO it fits perfectly into a qdev which contains 8 qbuses, each of which is > connected to another qdev. Yeah. I don't much like the w

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Avi Kivity
On 08/03/2011 12:28 AM, Peter Maydell wrote: On 2 August 2011 21:56, Anthony Liguori wrote: > Hrm, this looks like badness to me. > > You're effectively using MemoryRegions to implement an ad-hoc interface. As you'll see below, the hardware intreface is somewhat ad-hoc :-) IMO it fits perf

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Avi Kivity
On 08/03/2011 12:06 AM, Anthony Liguori wrote: The qdev level should be the common base that makes sense for *all* qdev devices. IRQ management does not belong in DeviceState because what you do for a simple LCD is not what you do for an MSI-X capable PCI device. This is what QOM propertie

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Peter Maydell
On 2 August 2011 21:56, Anthony Liguori wrote: > Hrm, this looks like badness to me. > > You're effectively using MemoryRegions to implement an ad-hoc interface. As you'll see below, the hardware intreface is somewhat ad-hoc :-) >  This is not what MemoryRegions are meant to do though.  You want

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Avi Kivity
On 08/02/2011 10:38 PM, Peter Maydell wrote: On 2 August 2011 20:11, Avi Kivity wrote: > On 08/02/2011 09:21 PM, Peter Maydell wrote: >> >> On 2 August 2011 19:05, Avi Kivitywrote: >> >On 08/02/2011 08:21 PM, Peter Maydell wrote: >> >>So I think we just need a sysbus_mmio_get_mem

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Anthony Liguori
On 08/02/2011 01:07 PM, Jan Kiszka wrote: On 2011-08-02 19:21, Peter Maydell wrote: On 2 August 2011 16:58, Avi Kivity wrote: On 08/02/2011 06:47 PM, Peter Maydell wrote: This kind of "I want to manage the memory layout of a pile of other things" seems like what the hierarchical memory API sh

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Anthony Liguori
On 08/02/2011 02:38 PM, Peter Maydell wrote: On 2 August 2011 20:11, Avi Kivity wrote: On 08/02/2011 09:21 PM, Peter Maydell wrote: On 2 August 2011 19:05, Avi Kivitywrote: On 08/02/2011 08:21 PM, Peter Maydell wrote: So I think we just need a sysbus_mmio_get_memoryregion() (and c

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Anthony Liguori
On 08/02/2011 01:21 PM, Peter Maydell wrote: On 2 August 2011 19:05, Avi Kivity wrote: On 08/02/2011 08:21 PM, Peter Maydell wrote: So I think we just need a sysbus_mmio_get_memoryregion() (and convert the devices I need to attach to use memory regions, and live with not being able to attach u

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Peter Maydell
On 2 August 2011 20:11, Avi Kivity wrote: > On 08/02/2011 09:21 PM, Peter Maydell wrote: >> >> On 2 August 2011 19:05, Avi Kivity  wrote: >> >  On 08/02/2011 08:21 PM, Peter Maydell wrote: >> >>  So I think we just need a sysbus_mmio_get_memoryregion() >> >>  (and convert the devices I need to att

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Avi Kivity
On 08/02/2011 09:07 PM, Jan Kiszka wrote: >> >> >> system_memory >> | >> +--- cs_region-0 >> | >> +--- device-connected-to-that-region >> >> cs-region-0 will clip anything under it. > > OK, and when we change the size of CS0 we delete the container > regio

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Avi Kivity
On 08/02/2011 09:21 PM, Peter Maydell wrote: On 2 August 2011 19:05, Avi Kivity wrote: > On 08/02/2011 08:21 PM, Peter Maydell wrote: >> So I think we just need a sysbus_mmio_get_memoryregion() >> (and convert the devices I need to attach to use memory >> regions, and live with not being abl

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Peter Maydell
On 2 August 2011 19:05, Avi Kivity wrote: > On 08/02/2011 08:21 PM, Peter Maydell wrote: >> So I think we just need a sysbus_mmio_get_memoryregion() >> (and convert the devices I need to attach to use memory >> regions, and live with not being able to attach unconverted >> devices). > > I don't fo

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Jan Kiszka
On 2011-08-02 19:21, Peter Maydell wrote: > On 2 August 2011 16:58, Avi Kivity wrote: >> On 08/02/2011 06:47 PM, Peter Maydell wrote: >>> This kind of "I want to manage the memory layout of a pile of other >>> things" seems like what the hierarchical memory API should provide, >>> but there's a bi

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Avi Kivity
On 08/02/2011 08:21 PM, Peter Maydell wrote: On 2 August 2011 16:58, Avi Kivity wrote: > On 08/02/2011 06:47 PM, Peter Maydell wrote: >> This kind of "I want to manage the memory layout of a pile of other >> things" seems like what the hierarchical memory API should provide, >> but there's a

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Peter Maydell
On 2 August 2011 16:58, Avi Kivity wrote: > On 08/02/2011 06:47 PM, Peter Maydell wrote: >> This kind of "I want to manage the memory layout of a pile of other >> things" seems like what the hierarchical memory API should provide, >> but there's a bit of a difficulty here in that sysbus MMIOs aren

Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Avi Kivity
On 08/02/2011 06:47 PM, Peter Maydell wrote: I'm trying to update omap_gpmc to (a) support OMAP3/Beagle features and (b) use sysbus/qdev rather than ad-hocery, and I'm having difficulty figuring out how it fits into the new memory API. Specifically, omap_gpmc lets you attach up to 8 devices to i

[Qemu-devel] modelling omap_gpmc with the hierarchical memory API

2011-08-02 Thread Peter Maydell
I'm trying to update omap_gpmc to (a) support OMAP3/Beagle features and (b) use sysbus/qdev rather than ad-hocery, and I'm having difficulty figuring out how it fits into the new memory API. Specifically, omap_gpmc lets you attach up to 8 devices to its chip selects, and has registers which specif