From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Wed, 16 Oct 2013 09:27:27 +0200 Subject: [PATCH v10 2/7] ARM: hi3xxx: add board support with device tree In-Reply-To: References: <1381828577-27998-1-git-send-email-haojian.zhuang@linaro.org> Message-ID: <201310160927.27412.arnd@arndb.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wednesday 16 October 2013, Haojian Zhuang wrote: > Oh, no. I shouldn't extend the static mapping table to the entire range. > > Most of the registers only need to map once in the probe() function > of the driver. Whether it's using static mapping or dynamic mapping, > there's no difference. There is a small difference in that having a megabyte-sized mapping will reduce the number of TLB entries required for I/O access, which can improve performance slightly. Other platforms do it for this reason. > The sysctrl register bank is used in both clock & platform > driver. Each clock node contains reg property, it needs to be parsed > by of_iomap(). Hotplug & SMP platform driver needs to parse sysctrl > register bank also. If I don't choose the static IO mapping for sysctrl > register bank, I have to define some global variable to store the > virtual address mapping. Or I have to cost lots of redundant virtual > address space for the same IO mapping. It's a small cost, but your approach makes sense, just make sure you have a comment in the map_io code explaining it. > So I'll only keep the static IO mapping for sysctrl. I'd still choose the larger mapping, but I'll leave the decision to you. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v10 2/7] ARM: hi3xxx: add board support with device tree Date: Wed, 16 Oct 2013 09:27:27 +0200 Message-ID: <201310160927.27412.arnd@arndb.de> References: <1381828577-27998-1-git-send-email-haojian.zhuang@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Haojian Zhuang Cc: Mark Rutland , devicetree@vger.kernel.org, Kevin Hilman , Russell King - ARM Linux , Shaojie Sun , Stephen Warren , Linus Walleij , Patch Tracking , Rob Herring , Grant Likely , John Stultz , Olof Johansson , Mike Turquette , "tglx@linutronix.de" , "linux-arm-kernel@lists.infradead.org" List-Id: devicetree@vger.kernel.org On Wednesday 16 October 2013, Haojian Zhuang wrote: > Oh, no. I shouldn't extend the static mapping table to the entire range. > > Most of the registers only need to map once in the probe() function > of the driver. Whether it's using static mapping or dynamic mapping, > there's no difference. There is a small difference in that having a megabyte-sized mapping will reduce the number of TLB entries required for I/O access, which can improve performance slightly. Other platforms do it for this reason. > The sysctrl register bank is used in both clock & platform > driver. Each clock node contains reg property, it needs to be parsed > by of_iomap(). Hotplug & SMP platform driver needs to parse sysctrl > register bank also. If I don't choose the static IO mapping for sysctrl > register bank, I have to define some global variable to store the > virtual address mapping. Or I have to cost lots of redundant virtual > address space for the same IO mapping. It's a small cost, but your approach makes sense, just make sure you have a comment in the map_io code explaining it. > So I'll only keep the static IO mapping for sysctrl. I'd still choose the larger mapping, but I'll leave the decision to you. Arnd