From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756149AbbI2IzV (ORCPT ); Tue, 29 Sep 2015 04:55:21 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:34632 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755685AbbI2IzM (ORCPT ); Tue, 29 Sep 2015 04:55:12 -0400 Date: Tue, 29 Sep 2015 09:55:05 +0100 From: Lee Jones To: Barry Song <21cnbao@gmail.com> Cc: Mark Brown , Greg Kroah-Hartman , sameo , LKML , DL-SHA-WorkGroupLinux , Guo Zeng , Barry Song Subject: Re: [PATCH v2 3/3] mfd: add CSR SiRFSoC on-chip power management module driver Message-ID: <20150929085505.GW27197@x1> References: <1442467402-7605-1-git-send-email-21cnbao@gmail.com> <1442467402-7605-3-git-send-email-21cnbao@gmail.com> <20150920041544.GB3039@x1> <20150924181310.GF27197@x1> <20150929071636.GU27197@x1> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 Sep 2015, Barry Song wrote: > 2015-09-29 15:16 GMT+08:00 Lee Jones : > > On Tue, 29 Sep 2015, Barry Song wrote: > >> >> >> +static int sirfsoc_pwrc_probe(struct platform_device *pdev) > >> >> >> +{ > >> >> >> + struct device_node *np = pdev->dev.of_node; > >> >> >> + const struct of_device_id *match; > >> >> >> + struct sirfsoc_pwrc_info *pwrcinfo; > >> >> >> + struct regmap_irq_chip *regmap_irq_chip; > >> >> >> + struct sirfsoc_pwrc_register *pwrc_reg; > >> >> >> + struct regmap *map; > >> >> >> + int ret; > >> >> >> + u32 base; > >> >> >> + > >> >> >> + if (of_property_read_u32(np, "reg", &base)) > >> >> >> + panic("unable to find base address of pwrc node in dtb\n"); > >> >> > > >> >> > It looks like this driver should depend on OF. > >> >> > > >> >> > Why are you obtaining the base address manually? Use: > >> >> > > >> >> > res = platform_get_resource(); > >> >> > devm_ioremap_resource(res); > >> >> > > >> >> > ... instead. > >> >> > >> >> this was explained as they are not in memory space, they are behind a > >> >> bus bridge. > >> > > >> > Use 'ranges' in the DT, then you can pull out the proper address > >> > without hand rolling your own method. > >> > >> it seems it is not a "ranges" thing, things behind rtciobrg is much > >> like things behind USB or sdio. we need to use a rtciobrg protocol to > >> do read/write. > >> they can not be randomly accessed by load/store, and can't be XIP. > >> they don't have any ranges in CPU memory space. > > > > So what's the point of 'base' then? I assumed this was the base of > > the IP registers which where memory mapped? > > just think we have a i2c device, and this i2c device has multi-functions. > each function has a base of its register offset. > actually, the base is the offset of 1st register. Does it every change, from device to device? -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog