From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree Date: Tue, 26 Mar 2013 08:17:04 +0000 Message-ID: <20130326081704.GB11734@gmail.com> References: <1364223758-17621-1-git-send-email-lee.jones@linaro.org> <1364223758-17621-2-git-send-email-lee.jones@linaro.org> <201303251540.51104.arnd@arndb.de> <20130325164600.GA11734@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Linus Walleij Cc: devicetree-discuss@lists.ozlabs.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linus.walleij@stericsson.com List-Id: devicetree@vger.kernel.org On Mon, 25 Mar 2013, Linus Walleij wrote: > On Mon, Mar 25, 2013 at 5:46 PM, Lee Jones wro= te: >=20 > >> > res =3D platform_get_resource_byname(pdev, IORESOURCE_ME= M, > >> > "prcmu-tcpm"); > >> > if (!res) { > >> > - dev_err(&pdev->dev, > >> > - "Error: no prcmu tcpm memory region prov= ided\n"); > >> > - return; > >> > - } > >> > - tcpm_base =3D ioremap(res->start, resource_size(res)); > >> > + if (np) { > >> > + tcpm_np =3D of_find_node_by_name(np->par= ent, > >> > + "prcmu-tc= pm-per4"); > >> > + if (!tcpm_np) { > >> > + dev_err(&pdev->dev, > >> > + "no prcmu tcpm mem regio= n provided\n"); > >> > + return; > >> > + } > >> > + tcpm_base =3D of_iomap(tcpm_np, 0); > >> > + } > >> > + } else > >> > + tcpm_base =3D ioremap(res->start, resource_size(= res)); > >> > + > >> > >> Why don't you just add these extra registers to the prcmu node its= elf like > >> > >> diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx= 5x0.dtsi > >> index 9de9309..6ee6c31 100644 > >> --- a/arch/arm/boot/dts/dbx5x0.dtsi > >> +++ b/arch/arm/boot/dts/dbx5x0.dtsi > >> @@ -191,8 +191,8 @@ > >> > >> prcmu: prcmu@80157000 { > >> compatible =3D "stericsson,db8500-prcmu"; > >> - reg =3D <0x80157000 0x1000>; > >> - reg-names =3D "prcmu"; > >> + reg =3D <0x80157000 0x1000>, <0x801b0000 0x1= 000>, <0x801b8000 0x1000>; > >> + reg-names =3D "prcmu", "prcmu-tcpm", "prcmu-= tcdm-per4"; > >> interrupts =3D <0 47 0x4>; > >> #address-cells =3D <1>; > >> #size-cells =3D <1>; > >> > >> > >> and document those in the prcmu binding? > >> > >> That would keep the code simpler and the same for both cases. > > > > I'm not sure you can. These addresses differ from platform to > > platform, so I'd need to provide the base PRCMU address in > > dbx5x0.dtsi, then the other two in the dts files. Can you do that? >=20 > Better ask on devicetree-discuss. >=20 > What it reflects are differences between SoC:s, so I think the > right solution is to split it in a three-layer cake: >=20 > dbx5x0.dtsi -> included by > db8500.dtsi -> included by > snowball/hrefv60plus.dts >=20 > dbx5x0.dtsi -> included by > dbx540.dtsi -> included by > ccu9540/ccu8540.dts >=20 > Here you may insert the reg property into the node at the > db8500.dtsi or dbx540.dtsi layer. It's easy done, if that's the right way. > If you prefer I can cook a patch... =2E.. and I'm fine to do it. [5 mins later] Hmm... it appears that in STE's kernel, the same address is used for all SoCs:=20 #define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x68000) However, in Mainline there is another definition: #define U9540_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x6A000) =2E.. which doesn't seem to be in use anywhere - even for the u9540. What's the deal big-man? --=20 Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog