* Re: [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree [not found] ` <20130325164600.GA11734@gmail.com> @ 2013-03-25 21:32 ` Linus Walleij 2013-03-26 8:17 ` Lee Jones 0 siblings, 1 reply; 5+ messages in thread From: Linus Walleij @ 2013-03-25 21:32 UTC (permalink / raw) To: Lee Jones, devicetree-discuss Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel, linus.walleij On Mon, Mar 25, 2013 at 5:46 PM, Lee Jones <lee.jones@linaro.org> wrote: >> > res = platform_get_resource_byname(pdev, IORESOURCE_MEM, >> > "prcmu-tcpm"); >> > if (!res) { >> > - dev_err(&pdev->dev, >> > - "Error: no prcmu tcpm memory region provided\n"); >> > - return; >> > - } >> > - tcpm_base = ioremap(res->start, resource_size(res)); >> > + if (np) { >> > + tcpm_np = of_find_node_by_name(np->parent, >> > + "prcmu-tcpm-per4"); >> > + if (!tcpm_np) { >> > + dev_err(&pdev->dev, >> > + "no prcmu tcpm mem region provided\n"); >> > + return; >> > + } >> > + tcpm_base = of_iomap(tcpm_np, 0); >> > + } >> > + } else >> > + tcpm_base = ioremap(res->start, resource_size(res)); >> > + >> >> Why don't you just add these extra registers to the prcmu node itself like >> >> diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.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 = "stericsson,db8500-prcmu"; >> - reg = <0x80157000 0x1000>; >> - reg-names = "prcmu"; >> + reg = <0x80157000 0x1000>, <0x801b0000 0x1000>, <0x801b8000 0x1000>; >> + reg-names = "prcmu", "prcmu-tcpm", "prcmu-tcdm-per4"; >> interrupts = <0 47 0x4>; >> #address-cells = <1>; >> #size-cells = <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? Better ask on devicetree-discuss. What it reflects are differences between SoC:s, so I think the right solution is to split it in a three-layer cake: dbx5x0.dtsi -> included by db8500.dtsi -> included by snowball/hrefv60plus.dts dbx5x0.dtsi -> included by dbx540.dtsi -> included by ccu9540/ccu8540.dts Here you may insert the reg property into the node at the db8500.dtsi or dbx540.dtsi layer. If you prefer I can cook a patch... Yours, Linus Walleij ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree 2013-03-25 21:32 ` [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree Linus Walleij @ 2013-03-26 8:17 ` Lee Jones [not found] ` <20130326081704.GB11734-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Lee Jones @ 2013-03-26 8:17 UTC (permalink / raw) To: Linus Walleij Cc: devicetree-discuss, Arnd Bergmann, linux-arm-kernel, linux-kernel, linus.walleij On Mon, 25 Mar 2013, Linus Walleij wrote: > On Mon, Mar 25, 2013 at 5:46 PM, Lee Jones <lee.jones@linaro.org> wrote: > > >> > res = platform_get_resource_byname(pdev, IORESOURCE_MEM, > >> > "prcmu-tcpm"); > >> > if (!res) { > >> > - dev_err(&pdev->dev, > >> > - "Error: no prcmu tcpm memory region provided\n"); > >> > - return; > >> > - } > >> > - tcpm_base = ioremap(res->start, resource_size(res)); > >> > + if (np) { > >> > + tcpm_np = of_find_node_by_name(np->parent, > >> > + "prcmu-tcpm-per4"); > >> > + if (!tcpm_np) { > >> > + dev_err(&pdev->dev, > >> > + "no prcmu tcpm mem region provided\n"); > >> > + return; > >> > + } > >> > + tcpm_base = of_iomap(tcpm_np, 0); > >> > + } > >> > + } else > >> > + tcpm_base = ioremap(res->start, resource_size(res)); > >> > + > >> > >> Why don't you just add these extra registers to the prcmu node itself like > >> > >> diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.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 = "stericsson,db8500-prcmu"; > >> - reg = <0x80157000 0x1000>; > >> - reg-names = "prcmu"; > >> + reg = <0x80157000 0x1000>, <0x801b0000 0x1000>, <0x801b8000 0x1000>; > >> + reg-names = "prcmu", "prcmu-tcpm", "prcmu-tcdm-per4"; > >> interrupts = <0 47 0x4>; > >> #address-cells = <1>; > >> #size-cells = <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? > > Better ask on devicetree-discuss. > > What it reflects are differences between SoC:s, so I think the > right solution is to split it in a three-layer cake: > > dbx5x0.dtsi -> included by > db8500.dtsi -> included by > snowball/hrefv60plus.dts > > dbx5x0.dtsi -> included by > dbx540.dtsi -> included by > ccu9540/ccu8540.dts > > 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... ... 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: #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) ... which doesn't seem to be in use anywhere - even for the u9540. What's the deal big-man? -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20130326081704.GB11734-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree [not found] ` <20130326081704.GB11734-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2013-03-26 9:11 ` Linus Walleij [not found] ` <20130326094848.GA14151@gmail.com> 0 siblings, 1 reply; 5+ messages in thread From: Linus Walleij @ 2013-03-26 9:11 UTC (permalink / raw) To: Lee Jones Cc: linus.walleij-0IS4wlFg1OjSUeElwK9/Pw, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Tue, Mar 26, 2013 at 9:17 AM, Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote: > On Mon, 25 Mar 2013, Linus Walleij wrote: >> On Mon, Mar 25, 2013 at 5:46 PM, Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote: >> >> >> > res = platform_get_resource_byname(pdev, IORESOURCE_MEM, >> >> > "prcmu-tcpm"); >> >> > if (!res) { >> >> > - dev_err(&pdev->dev, >> >> > - "Error: no prcmu tcpm memory region provided\n"); >> >> > - return; >> >> > - } >> >> > - tcpm_base = ioremap(res->start, resource_size(res)); >> >> > + if (np) { >> >> > + tcpm_np = of_find_node_by_name(np->parent, >> >> > + "prcmu-tcpm-per4"); >> >> > + if (!tcpm_np) { >> >> > + dev_err(&pdev->dev, >> >> > + "no prcmu tcpm mem region provided\n"); >> >> > + return; >> >> > + } >> >> > + tcpm_base = of_iomap(tcpm_np, 0); >> >> > + } >> >> > + } else >> >> > + tcpm_base = ioremap(res->start, resource_size(res)); >> >> > + >> >> >> >> Why don't you just add these extra registers to the prcmu node itself like >> >> >> >> diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.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 = "stericsson,db8500-prcmu"; >> >> - reg = <0x80157000 0x1000>; >> >> - reg-names = "prcmu"; >> >> + reg = <0x80157000 0x1000>, <0x801b0000 0x1000>, <0x801b8000 0x1000>; >> >> + reg-names = "prcmu", "prcmu-tcpm", "prcmu-tcdm-per4"; >> >> interrupts = <0 47 0x4>; >> >> #address-cells = <1>; >> >> #size-cells = <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? >> >> Better ask on devicetree-discuss. >> >> What it reflects are differences between SoC:s, so I think the >> right solution is to split it in a three-layer cake: >> >> dbx5x0.dtsi -> included by >> db8500.dtsi -> included by >> snowball/hrefv60plus.dts >> >> dbx5x0.dtsi -> included by >> dbx540.dtsi -> included by >> ccu9540/ccu8540.dts >> >> 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... > > ... 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: > > #define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x68000) Yes that's correct... > However, in Mainline there is another definition: > > #define U9540_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x6A000) > > ... which doesn't seem to be in use anywhere - even for the u9540. > > What's the deal big-man? Probably there was another address at some point in some FPGA or early silicon and it now needs fixing. So you should be able to use the same thing on all ASICs, put one single value in the dbx5x0.dtsi *and* fix this bug at the same time, good! Yours, Linus Walleij ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20130326094848.GA14151@gmail.com>]
* Re: [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree [not found] ` <20130326094848.GA14151@gmail.com> @ 2013-03-26 10:00 ` Arnd Bergmann 2013-03-26 10:19 ` Lee Jones 0 siblings, 1 reply; 5+ messages in thread From: Arnd Bergmann @ 2013-03-26 10:00 UTC (permalink / raw) To: Lee Jones Cc: Linus Walleij, devicetree-discuss, linux-arm-kernel, linux-kernel, linus.walleij On Tuesday 26 March 2013, Lee Jones wrote: > Bit for information for you. > > I have confirmed that the address locations are the same for > all SoCs are the same. However, the size of the TCDM changes from 4k > on the db8500 to 12k on the db8540. > > Is there a way we can increase the size for the db8540 without > creating an entire new DTS file? Seems overkill. You can always override a property by setting it again, like soc { prcmu: db8500-prcmu@abcd0000 { reg = <0xabcd0000 0x1000>; }; }; ... &prcmu { reg = <0xabcd0000 0x3000>; } Arnd ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree 2013-03-26 10:00 ` Arnd Bergmann @ 2013-03-26 10:19 ` Lee Jones 0 siblings, 0 replies; 5+ messages in thread From: Lee Jones @ 2013-03-26 10:19 UTC (permalink / raw) To: Arnd Bergmann Cc: Linus Walleij, devicetree-discuss, linux-arm-kernel, linux-kernel, linus.walleij On Tue, 26 Mar 2013, Arnd Bergmann wrote: > On Tuesday 26 March 2013, Lee Jones wrote: > > Bit for information for you. > > > > I have confirmed that the address locations are the same for > > all SoCs are the same. However, the size of the TCDM changes from 4k > > on the db8500 to 12k on the db8540. > > > > Is there a way we can increase the size for the db8540 without > > creating an entire new DTS file? Seems overkill. > > You can always override a property by setting it again, like > > soc { > prcmu: db8500-prcmu@abcd0000 { > reg = <0xabcd0000 0x1000>; > }; > }; > > ... > > > &prcmu { > reg = <0xabcd0000 0x3000>; > } Perfect, thanks. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-26 10:19 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1364223758-17621-1-git-send-email-lee.jones@linaro.org> [not found] ` <1364223758-17621-2-git-send-email-lee.jones@linaro.org> [not found] ` <201303251540.51104.arnd@arndb.de> [not found] ` <20130325164600.GA11734@gmail.com> 2013-03-25 21:32 ` [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree Linus Walleij 2013-03-26 8:17 ` Lee Jones [not found] ` <20130326081704.GB11734-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2013-03-26 9:11 ` Linus Walleij [not found] ` <20130326094848.GA14151@gmail.com> 2013-03-26 10:00 ` Arnd Bergmann 2013-03-26 10:19 ` Lee Jones
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).