All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Gerlach <d-gerlach@ti.com>
To: Tony Lindgren <tony@atomide.com>, Suman Anna <s-anna@ti.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>,
	<devicetree@vger.kernel.org>, Ohad Ben-Cohen <ohad@wizery.com>,
	Kevin Hilman <khilman@linaro.org>, Felipe Balbi <balbi@ti.com>
Subject: Re: [PATCH v2 2/2] ARM: dts: am33xx: Move wkup_m3 node to soc node and add ranges
Date: Tue, 10 Mar 2015 14:55:30 -0500	[thread overview]
Message-ID: <54FF4C32.5070106@ti.com> (raw)
In-Reply-To: <20150310160919.GQ5264@atomide.com>

Tony,
On 03/10/2015 11:09 AM, Tony Lindgren wrote:
> * Suman Anna <s-anna@ti.com> [150309 16:59]:
>> On 03/05/2015 10:57 AM, Tony Lindgren wrote:
>>> * Suman Anna <s-anna@ti.com> [150305 08:47]:
>>>> On 03/05/2015 09:40 AM, Tony Lindgren wrote:
>>>>> * Dave Gerlach <d-gerlach@ti.com> [150304 20:14]:
>>>> Dave,
>>>>
>>>> Looks like the commit message disappeared during your patch preparation.
>>>>
>>>>>> Signed-off-by: Suman Anna <s-anna@ti.com>
>>>>>> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
>>>>>> ---
>>>>>>  arch/arm/boot/dts/am33xx.dtsi | 21 +++++++++++++--------
>>>>>>  1 file changed, 13 insertions(+), 8 deletions(-)
>>>>>>
>>>>>> diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
>>>>>> index acd3705..086415c 100644
>>>>>> --- a/arch/arm/boot/dts/am33xx.dtsi
>>>>>> +++ b/arch/arm/boot/dts/am33xx.dtsi
>>>>>> @@ -77,10 +77,23 @@
>>>>>>  	 */
>>>>>>  	soc {
>>>>>>  		compatible = "ti,omap-infra";
>>>>>> +		#address-cells = <1>;
>>>>>> +		#size-cells = <1>;
>>>>>> +		ranges = <0x0     0x44d00000 0x4000>,
>>>>>> +			 <0x80000 0x44d80000 0x2000>;
>>>>>> +
>>>>>
>>>>> I think putting the ranges here will cause issues for adding
>>>>> ranges for anything else.
>>>>>
>>>>> How about do something like this instead (untested):
>>>>>
>>>>> ocp {
>>>>> 	l4_wkup: l4_wkup@44c00000 {
>>>>> 		compatible = "am335-l4-wkup", "simple-bus";
>>>>> 		ranges = <0 0x44c00000 0x3fffff>;
>>>>>
>>>>> 		wkup_m3: wkup_m3@44d00000 {
>>>>> 			compatible = "ti,am3353-wkup-m3";
>>>>> 			reg = <0x1000000     0x4000>,	/* M3 UMEM */
>>>>> 			      <0x180000	     0x2000>;	/* M3 DMEM */
>>>>> 			ti,hwmods = "wkup_m3";
>>>>> 			ti,pm-firmware = "am335x-pm-firmware.elf";
>>>>> 		};
>>>>>
>>>>> 		...
>>>>> 	};
>>>>> };
>>>>>
>>>>> That way we can start moving also the other l4_wkup components there
>>>>> eventuallly without having to redo the ranges again for wkup_m3.
>>>>>
>>>>> You can also look at how the scm_conf was done for dm816x.dtsi for an
>>>>> example, and the recent large set of patches posted by Tero.
>>
>> I have taken a look at both the above. The L4_WKUP range includes the
>> PRCM, Control Module, as well as a few peripherals like DMTimer0, UART0
>> etc. What all do we want to move here eventually?
> 
> Well eventually all the children of L4_WKUP, but that can be done
> slowly as some of the drivers have weird hacks and may not work
> properly if moved around.
> 
> For example, anything with reg entries for something like SCM area will
> break as that's not going to be in the L4_WKUP area ny longer :p And
> that's actually good as it will protect us from spaghetti code
> automatically later on for new code.
> 
>> Depending on that, we may have to use 2 address cells like in Tero's
>> PRCM cleanup series rather than the single cell translation used by
>> you in dm816x.dtsi so that we can retain the relative addresses
>> w.r.t the existing node bases in the derivative child nodes.
> 
> Hmm OK, care to paste a dts snippet example for that?

Suman and I have been looking at this together, so I can comment here. An
implementation like this is what Suman is referring to:

+               l4_wkup: l4_wkup@44c00000 {
+                       compatible = "am335-l4-wkup", "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+                       ranges = <0 0           0x44c00000 0x100000>,
+                                <1 0x0         0x44d00000 0x4000>,
+                                <2 0x80000     0x44d80000 0x2000>;
+
+                       wkup_m3: wkup_m3@1,0 {
+                               compatible = "ti,am3353-wkup-m3";
+                               reg = <1 0x0     0x4000>,       /* M3 UMEM */
+                                     <2 0x80000 0x2000>;       /* M3 DMEM */
+
+                               ti,hwmods = "wkup_m3";
+                               ti,pm-firmware = "am335x-pm-firmware.elf";
+                       };
+               };
+

The of_* layer automatically translates everything so the pdata-quirks can still
match based on wkup_m3@44d00000. The existing wkup_m3_rproc driver works almost
entirely as is with this, all cpu addresses are read and mapped correctly but
the driver no longer will read the actual device addresses correctly which we
need for understanding where to load the firmware sections.

These device addresses are being read directly using of_get_address, which reads
the first value in the reg entries which is 1 and 2 now for UMEM and DMEM. We
would need some sort of change there also to get the proper 0x0 and 0x80000
device address values. Just advancing the pointer returned by of_get_address
does the trick but this doesn't seem like the cleanest solution.

Regards,
Dave

> 
> Regards,
> 
> Tony
> 


WARNING: multiple messages have this Message-ID (diff)
From: Dave Gerlach <d-gerlach@ti.com>
To: Tony Lindgren <tony@atomide.com>, Suman Anna <s-anna@ti.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	devicetree@vger.kernel.org, Ohad Ben-Cohen <ohad@wizery.com>,
	Kevin Hilman <khilman@linaro.org>, Felipe Balbi <balbi@ti.com>
Subject: Re: [PATCH v2 2/2] ARM: dts: am33xx: Move wkup_m3 node to soc node and add ranges
Date: Tue, 10 Mar 2015 14:55:30 -0500	[thread overview]
Message-ID: <54FF4C32.5070106@ti.com> (raw)
In-Reply-To: <20150310160919.GQ5264@atomide.com>

Tony,
On 03/10/2015 11:09 AM, Tony Lindgren wrote:
> * Suman Anna <s-anna@ti.com> [150309 16:59]:
>> On 03/05/2015 10:57 AM, Tony Lindgren wrote:
>>> * Suman Anna <s-anna@ti.com> [150305 08:47]:
>>>> On 03/05/2015 09:40 AM, Tony Lindgren wrote:
>>>>> * Dave Gerlach <d-gerlach@ti.com> [150304 20:14]:
>>>> Dave,
>>>>
>>>> Looks like the commit message disappeared during your patch preparation.
>>>>
>>>>>> Signed-off-by: Suman Anna <s-anna@ti.com>
>>>>>> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
>>>>>> ---
>>>>>>  arch/arm/boot/dts/am33xx.dtsi | 21 +++++++++++++--------
>>>>>>  1 file changed, 13 insertions(+), 8 deletions(-)
>>>>>>
>>>>>> diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
>>>>>> index acd3705..086415c 100644
>>>>>> --- a/arch/arm/boot/dts/am33xx.dtsi
>>>>>> +++ b/arch/arm/boot/dts/am33xx.dtsi
>>>>>> @@ -77,10 +77,23 @@
>>>>>>  	 */
>>>>>>  	soc {
>>>>>>  		compatible = "ti,omap-infra";
>>>>>> +		#address-cells = <1>;
>>>>>> +		#size-cells = <1>;
>>>>>> +		ranges = <0x0     0x44d00000 0x4000>,
>>>>>> +			 <0x80000 0x44d80000 0x2000>;
>>>>>> +
>>>>>
>>>>> I think putting the ranges here will cause issues for adding
>>>>> ranges for anything else.
>>>>>
>>>>> How about do something like this instead (untested):
>>>>>
>>>>> ocp {
>>>>> 	l4_wkup: l4_wkup@44c00000 {
>>>>> 		compatible = "am335-l4-wkup", "simple-bus";
>>>>> 		ranges = <0 0x44c00000 0x3fffff>;
>>>>>
>>>>> 		wkup_m3: wkup_m3@44d00000 {
>>>>> 			compatible = "ti,am3353-wkup-m3";
>>>>> 			reg = <0x1000000     0x4000>,	/* M3 UMEM */
>>>>> 			      <0x180000	     0x2000>;	/* M3 DMEM */
>>>>> 			ti,hwmods = "wkup_m3";
>>>>> 			ti,pm-firmware = "am335x-pm-firmware.elf";
>>>>> 		};
>>>>>
>>>>> 		...
>>>>> 	};
>>>>> };
>>>>>
>>>>> That way we can start moving also the other l4_wkup components there
>>>>> eventuallly without having to redo the ranges again for wkup_m3.
>>>>>
>>>>> You can also look at how the scm_conf was done for dm816x.dtsi for an
>>>>> example, and the recent large set of patches posted by Tero.
>>
>> I have taken a look at both the above. The L4_WKUP range includes the
>> PRCM, Control Module, as well as a few peripherals like DMTimer0, UART0
>> etc. What all do we want to move here eventually?
> 
> Well eventually all the children of L4_WKUP, but that can be done
> slowly as some of the drivers have weird hacks and may not work
> properly if moved around.
> 
> For example, anything with reg entries for something like SCM area will
> break as that's not going to be in the L4_WKUP area ny longer :p And
> that's actually good as it will protect us from spaghetti code
> automatically later on for new code.
> 
>> Depending on that, we may have to use 2 address cells like in Tero's
>> PRCM cleanup series rather than the single cell translation used by
>> you in dm816x.dtsi so that we can retain the relative addresses
>> w.r.t the existing node bases in the derivative child nodes.
> 
> Hmm OK, care to paste a dts snippet example for that?

Suman and I have been looking at this together, so I can comment here. An
implementation like this is what Suman is referring to:

+               l4_wkup: l4_wkup@44c00000 {
+                       compatible = "am335-l4-wkup", "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+                       ranges = <0 0           0x44c00000 0x100000>,
+                                <1 0x0         0x44d00000 0x4000>,
+                                <2 0x80000     0x44d80000 0x2000>;
+
+                       wkup_m3: wkup_m3@1,0 {
+                               compatible = "ti,am3353-wkup-m3";
+                               reg = <1 0x0     0x4000>,       /* M3 UMEM */
+                                     <2 0x80000 0x2000>;       /* M3 DMEM */
+
+                               ti,hwmods = "wkup_m3";
+                               ti,pm-firmware = "am335x-pm-firmware.elf";
+                       };
+               };
+

The of_* layer automatically translates everything so the pdata-quirks can still
match based on wkup_m3@44d00000. The existing wkup_m3_rproc driver works almost
entirely as is with this, all cpu addresses are read and mapped correctly but
the driver no longer will read the actual device addresses correctly which we
need for understanding where to load the firmware sections.

These device addresses are being read directly using of_get_address, which reads
the first value in the reg entries which is 1 and 2 now for UMEM and DMEM. We
would need some sort of change there also to get the proper 0x0 and 0x80000
device address values. Just advancing the pointer returned by of_get_address
does the trick but this doesn't seem like the cleanest solution.

Regards,
Dave

> 
> Regards,
> 
> Tony
> 

WARNING: multiple messages have this Message-ID (diff)
From: d-gerlach@ti.com (Dave Gerlach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/2] ARM: dts: am33xx: Move wkup_m3 node to soc node and add ranges
Date: Tue, 10 Mar 2015 14:55:30 -0500	[thread overview]
Message-ID: <54FF4C32.5070106@ti.com> (raw)
In-Reply-To: <20150310160919.GQ5264@atomide.com>

Tony,
On 03/10/2015 11:09 AM, Tony Lindgren wrote:
> * Suman Anna <s-anna@ti.com> [150309 16:59]:
>> On 03/05/2015 10:57 AM, Tony Lindgren wrote:
>>> * Suman Anna <s-anna@ti.com> [150305 08:47]:
>>>> On 03/05/2015 09:40 AM, Tony Lindgren wrote:
>>>>> * Dave Gerlach <d-gerlach@ti.com> [150304 20:14]:
>>>> Dave,
>>>>
>>>> Looks like the commit message disappeared during your patch preparation.
>>>>
>>>>>> Signed-off-by: Suman Anna <s-anna@ti.com>
>>>>>> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
>>>>>> ---
>>>>>>  arch/arm/boot/dts/am33xx.dtsi | 21 +++++++++++++--------
>>>>>>  1 file changed, 13 insertions(+), 8 deletions(-)
>>>>>>
>>>>>> diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
>>>>>> index acd3705..086415c 100644
>>>>>> --- a/arch/arm/boot/dts/am33xx.dtsi
>>>>>> +++ b/arch/arm/boot/dts/am33xx.dtsi
>>>>>> @@ -77,10 +77,23 @@
>>>>>>  	 */
>>>>>>  	soc {
>>>>>>  		compatible = "ti,omap-infra";
>>>>>> +		#address-cells = <1>;
>>>>>> +		#size-cells = <1>;
>>>>>> +		ranges = <0x0     0x44d00000 0x4000>,
>>>>>> +			 <0x80000 0x44d80000 0x2000>;
>>>>>> +
>>>>>
>>>>> I think putting the ranges here will cause issues for adding
>>>>> ranges for anything else.
>>>>>
>>>>> How about do something like this instead (untested):
>>>>>
>>>>> ocp {
>>>>> 	l4_wkup: l4_wkup at 44c00000 {
>>>>> 		compatible = "am335-l4-wkup", "simple-bus";
>>>>> 		ranges = <0 0x44c00000 0x3fffff>;
>>>>>
>>>>> 		wkup_m3: wkup_m3 at 44d00000 {
>>>>> 			compatible = "ti,am3353-wkup-m3";
>>>>> 			reg = <0x1000000     0x4000>,	/* M3 UMEM */
>>>>> 			      <0x180000	     0x2000>;	/* M3 DMEM */
>>>>> 			ti,hwmods = "wkup_m3";
>>>>> 			ti,pm-firmware = "am335x-pm-firmware.elf";
>>>>> 		};
>>>>>
>>>>> 		...
>>>>> 	};
>>>>> };
>>>>>
>>>>> That way we can start moving also the other l4_wkup components there
>>>>> eventuallly without having to redo the ranges again for wkup_m3.
>>>>>
>>>>> You can also look at how the scm_conf was done for dm816x.dtsi for an
>>>>> example, and the recent large set of patches posted by Tero.
>>
>> I have taken a look at both the above. The L4_WKUP range includes the
>> PRCM, Control Module, as well as a few peripherals like DMTimer0, UART0
>> etc. What all do we want to move here eventually?
> 
> Well eventually all the children of L4_WKUP, but that can be done
> slowly as some of the drivers have weird hacks and may not work
> properly if moved around.
> 
> For example, anything with reg entries for something like SCM area will
> break as that's not going to be in the L4_WKUP area ny longer :p And
> that's actually good as it will protect us from spaghetti code
> automatically later on for new code.
> 
>> Depending on that, we may have to use 2 address cells like in Tero's
>> PRCM cleanup series rather than the single cell translation used by
>> you in dm816x.dtsi so that we can retain the relative addresses
>> w.r.t the existing node bases in the derivative child nodes.
> 
> Hmm OK, care to paste a dts snippet example for that?

Suman and I have been looking at this together, so I can comment here. An
implementation like this is what Suman is referring to:

+               l4_wkup: l4_wkup at 44c00000 {
+                       compatible = "am335-l4-wkup", "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+                       ranges = <0 0           0x44c00000 0x100000>,
+                                <1 0x0         0x44d00000 0x4000>,
+                                <2 0x80000     0x44d80000 0x2000>;
+
+                       wkup_m3: wkup_m3 at 1,0 {
+                               compatible = "ti,am3353-wkup-m3";
+                               reg = <1 0x0     0x4000>,       /* M3 UMEM */
+                                     <2 0x80000 0x2000>;       /* M3 DMEM */
+
+                               ti,hwmods = "wkup_m3";
+                               ti,pm-firmware = "am335x-pm-firmware.elf";
+                       };
+               };
+

The of_* layer automatically translates everything so the pdata-quirks can still
match based on wkup_m3 at 44d00000. The existing wkup_m3_rproc driver works almost
entirely as is with this, all cpu addresses are read and mapped correctly but
the driver no longer will read the actual device addresses correctly which we
need for understanding where to load the firmware sections.

These device addresses are being read directly using of_get_address, which reads
the first value in the reg entries which is 1 and 2 now for UMEM and DMEM. We
would need some sort of change there also to get the proper 0x0 and 0x80000
device address values. Just advancing the pointer returned by of_get_address
does the trick but this doesn't seem like the cleanest solution.

Regards,
Dave

> 
> Regards,
> 
> Tony
> 

  reply	other threads:[~2015-03-10 19:55 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05  4:12 [PATCH v2 0/2] ARM: OMAP2+: wkup_m3_rproc support patches Dave Gerlach
2015-03-05  4:12 ` Dave Gerlach
2015-03-05  4:12 ` Dave Gerlach
2015-03-05  4:12 ` [PATCH v2 1/2] ARM: OMAP2+: Use pdata-quirks for wkup_m3 deassert_hardreset Dave Gerlach
2015-03-05  4:12   ` Dave Gerlach
2015-03-05  4:12   ` Dave Gerlach
2015-03-05  4:12 ` [PATCH v2 2/2] ARM: dts: am33xx: Move wkup_m3 node to soc node and add ranges Dave Gerlach
2015-03-05  4:12   ` Dave Gerlach
2015-03-05  4:12   ` Dave Gerlach
2015-03-05 15:40   ` Tony Lindgren
2015-03-05 15:40     ` Tony Lindgren
2015-03-05 16:46     ` Suman Anna
2015-03-05 16:46       ` Suman Anna
2015-03-05 16:46       ` Suman Anna
2015-03-05 16:57       ` Tony Lindgren
2015-03-05 16:57         ` Tony Lindgren
2015-03-09 23:59         ` Suman Anna
2015-03-09 23:59           ` Suman Anna
2015-03-09 23:59           ` Suman Anna
2015-03-10 16:09           ` Tony Lindgren
2015-03-10 16:09             ` Tony Lindgren
2015-03-10 19:55             ` Dave Gerlach [this message]
2015-03-10 19:55               ` Dave Gerlach
2015-03-10 19:55               ` Dave Gerlach
2015-03-11 16:26               ` Tony Lindgren
2015-03-11 16:26                 ` Tony Lindgren
2015-03-11 17:18                 ` Suman Anna
2015-03-11 17:18                   ` Suman Anna
2015-03-11 17:18                   ` Suman Anna
2015-03-11 17:32                   ` Tony Lindgren
2015-03-11 17:32                     ` Tony Lindgren
2015-03-11 19:18                     ` Suman Anna
2015-03-11 19:18                       ` Suman Anna
2015-03-11 19:18                       ` Suman Anna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54FF4C32.5070106@ti.com \
    --to=d-gerlach@ti.com \
    --cc=balbi@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=khilman@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=s-anna@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.