From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYWGa-00009w-QJ for qemu-devel@nongnu.org; Mon, 29 Sep 2014 04:25:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYWGT-0007cN-Aj for qemu-devel@nongnu.org; Mon, 29 Sep 2014 04:25:08 -0400 Message-ID: <54291756.8080901@suse.de> Date: Mon, 29 Sep 2014 10:24:54 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1411572143-40345-1-git-send-email-agraf@suse.de> <1411572143-40345-6-git-send-email-agraf@suse.de> <54255698.8070709@redhat.com> <54255B8E.7020500@suse.de> <54255F9B.40800@redhat.com> In-Reply-To: <54255F9B.40800@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 5/7] sysbus: Add new platform bus helper device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-ppc@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, eric.auger@linaro.org, qemu-devel@nongnu.org, sean.stalley@intel.com, afaerber@suse.de On 26.09.14 14:44, Paolo Bonzini wrote: > Il 26/09/2014 14:26, Alexander Graf ha scritto: >> >> Are you sure? Imagine one sysbus device includes another. We only want >> to look at the region the lowest sysbus device exposes, no? >=20 > IIUC this function is used to build the device tree. Yes, it's used to figure out the map of "start of region x of my device" to "offset y in the platform bus mmio space". > Say you have 2 > consecutive memory regions and the device tree requires separate "reg" > entries for them. But because they are consecutive (or perhaps because > you have a PCI version of the same device that sticks them in a single > BAR) you use a single MMIO area at the sysbus level. >=20 > In that case, you will use platform_bus_get_mmio_addr on the two inner > regions, not the outer one. In that case, you will use platform_bus_get_mmio_addr on the outer region because that's what the device model exposes. The parameter to this function that tells us which region we want is the "mmio region number" that sysbus exposes. If in device tree there are 2 reg properties, the device tree assembling code has to do the conversion from sysbus granularity to device tree granularity :). >=20 > BTW, I think you will never have one sysbus device including another. > The contained device would be busless (similar to the "naked" 8250 > device in hw/char/serial.c, except perhaps QOMified). Yeah, I agree :). Alex