From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYWLt-00035d-Uw for qemu-devel@nongnu.org; Mon, 29 Sep 2014 04:30:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYWLn-0000bc-BA for qemu-devel@nongnu.org; Mon, 29 Sep 2014 04:30:37 -0400 Message-ID: <54291899.9030906@redhat.com> Date: Mon, 29 Sep 2014 10:30:17 +0200 From: Paolo Bonzini 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> <54291756.8080901@suse.de> In-Reply-To: <54291756.8080901@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Alexander Graf , 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 Il 29/09/2014 10:24, Alexander Graf ha scritto: > > > 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? >> >> 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. >> >> 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 :). Thanks for the clarification. Series Reviewed-by: Paolo Bonzini