linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Franklin S Cooper Jr." <fcooper@ti.com>
To: Rob Herring <robh@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Benoit Cousson <bcousson@baylibre.com>,
	Tony Lindgren <tony@atomide.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Tero Kristo <t-kristo@ti.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Linux PWM List <linux-pwm@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	linux-clk <linux-clk@vger.kernel.org>,
	Sekhar Nori <nsekhar@ti.com>
Subject: Re: [PATCH 5/5] pwm: pwm-tiehrpwm: Update dt binding document to use generic node name
Date: Thu, 17 Mar 2016 14:51:54 -0500	[thread overview]
Message-ID: <56EB0ADA.4020006@ti.com> (raw)
In-Reply-To: <CAL_JsqKLhyOVUa_21bwf4vRNCNFt0tadwW+RUavgsXeJu3p1pQ@mail.gmail.com>



On 03/17/2016 02:48 PM, Rob Herring wrote:
> On Thu, Mar 17, 2016 at 2:25 PM, Franklin S Cooper Jr. <fcooper@ti.com> wrote:
>> +Sekhar
>>
>> On 03/17/2016 01:56 PM, Rob Herring wrote:
>>> On Thu, Mar 17, 2016 at 1:20 PM, Franklin S Cooper Jr. <fcooper@ti.com> wrote:
>>>> On 03/17/2016 01:00 PM, Rob Herring wrote:
>>>>> On Thu, Mar 17, 2016 at 11:49 AM, Franklin S Cooper Jr. <fcooper@ti.com> wrote:
>>>>>> On 03/17/2016 10:03 AM, Rob Herring wrote:
>>>>>>> On Mon, Mar 07, 2016 at 01:51:58PM -0600, Franklin S Cooper Jr wrote:
>>>>>>>> Now that the node name has been changed from ehrpwm to pwm the document
>>>>>>>> should show this proper usage. Also change the unit address in the example
>>>>>>>> from 0 to the proper physical address value that should be used.
>>>>>>>>
>>>>>>>> Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
>>>>>>>> ---
>>>>>>>>  Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt | 4 ++--
>>>>>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt b/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
>>>>>>>> index 9c100b2..20211ed 100644
>>>>>>>> --- a/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
>>>>>>>> +++ b/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
>>>>>>>> @@ -15,14 +15,14 @@ Optional properties:
>>>>>>>>
>>>>>>>>  Example:
>>>>>>>>
>>>>>>>> -ehrpwm0: ehrpwm@0 { /* EHRPWM on am33xx */
>>>>>>>> +ehrpwm0: pwm@48300200 { /* EHRPWM on am33xx */
>>>>>>>>      compatible = "ti,am33xx-ehrpwm";
>>>>>>>>      #pwm-cells = <3>;
>>>>>>>>      reg = <0x48300200 0x100>;
>>>>>>>>      ti,hwmods = "ehrpwm0";
>>>>>>>>  };
>>>>>>>>
>>>>>>>> -ehrpwm0: ehrpwm@0 { /* EHRPWM on da850 */
>>>>>>>> +ehrpwm0: pwm@01f00000 { /* EHRPWM on da850 */
>>>>>>> No leading 0s, but more importantly the address is wrong.
>>>>>> I will remove the leading 0. However, this value was taken
>>>>>> from the .dtsi and I just double checked and I see the same
>>>>>> value in the datasheet. I believe DA850,OMAP-L138 and AM18x
>>>>>> all have the same memory mapping. I'm looking at
>>>>>> http://www.ti.com/lit/ds/symlink/am1808.pdf page 233 and the
>>>>>> addresses match up what is seen here and in the .dtsi.
>>>>>>
>>>>>> Can you point me to which document your looking at that
>>>>>> shows a different value?
>>>>> Ummm, ...
>>>>>
>>>>>>>>      compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
>>>>>>>>      #pwm-cells = <3>;
>>>>>>>>      reg = <0x300000 0x2000>;
>>>>> right here.
>>>> So I don't know the history but the SOC node specifies a
>>>> ranges value of ranges = <0x0 0x01c00000 0x400000>;. It
>>>> seems that all child nodes of SOC have a reg property then
>>>> is based on an offset of 0x01c00000. So this is true for
>>>> UART, rtc, i2c, wdt, mmc, spi etc... So using a base offset
>>>> of 0x01c00000 + 0x300000 (reg value of the pwm) equals the
>>>> physical address of the ehrpwm0 register 0x1f00000.
>>>>
>>>> For the child nodes within the SOC node, the unit-address is
>>>> always based on the physical address not based on the offset
>>>> address.
>>> They are all wrong and should be fixed. Unit address should match the
>>> reg property unless the bus has defined something different (e.g.
>>> PCI).
>> I added Sekhar to hopefully comment if it would be better to
>> try to get the reg properties to use their physical
>> addresses or change the unit address to use the offset values.
> Change the unit addresses (i.e. use ranges). The main reason ranges
> with translation is preferred is it limits the scope of the bus as the
> h/w design typically would.
>
>> I don't mind shooting a patch that makes this massive switch
>> for all the various peripherals and documentation. However,
>> this is a bit beyond this series.  In this series I am not
>> setting the unit address or reg address I am simply
>> documenting what is currently being used. This patch set is
>> a dependency for another patchset to get PWM support for DRA7.
> Agreed. I'm not asking for everything to be fixed.
>
>> Are you ok with me doing the below?
>> I submit a v2 that removes the leading 0 in this patch. This
>> way this patchset and my PWMSS support for DRA7 patchset can
>> get merged. I can then follow up with another separate
>> patchset that insures both the unit address and the value in
>> the reg property are aligned.
> The example is an example. It doesn't have to match dts files (if it
> always did, then examples would be pointless). So please fix the
> documentation now. The dts files can be updated separately.

Ok will do.
>
> Rob

      reply	other threads:[~2016-03-17 19:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07 19:51 [PATCH 0/5] ARM: am335x/am437x: Correct pwm bindings Franklin S Cooper Jr
2016-03-07 19:51 ` [PATCH 1/5] clk: ti: am335x/am4372: Add tbclk to pwm node Franklin S Cooper Jr
2016-04-16  0:46   ` Stephen Boyd
2016-03-07 19:51 ` [PATCH 2/5] ARM: DTS: da850/am4372/am33xx: Use generic node name for ehrpwm Franklin S Cooper Jr
2016-03-07 19:51 ` [PATCH 3/5] ARM: DTS: am33xx: Set pwmss ranges property to an empty value Franklin S Cooper Jr
2016-03-07 19:51 ` [PATCH 4/5] pwm: pwm-tipwmss: Update documentation to use empty range property Franklin S Cooper Jr
2016-03-17 15:01   ` Rob Herring
2016-03-17 16:56     ` Franklin S Cooper Jr.
2016-03-17 21:29       ` Franklin S Cooper Jr.
2016-03-07 19:51 ` [PATCH 5/5] pwm: pwm-tiehrpwm: Update dt binding document to use generic node name Franklin S Cooper Jr
2016-03-17 15:03   ` Rob Herring
2016-03-17 16:49     ` Franklin S Cooper Jr.
2016-03-17 18:00       ` Rob Herring
2016-03-17 18:20         ` Franklin S Cooper Jr.
2016-03-17 18:56           ` Rob Herring
2016-03-17 19:25             ` Franklin S Cooper Jr.
2016-03-17 19:48               ` Rob Herring
2016-03-17 19:51                 ` Franklin S Cooper Jr. [this message]

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=56EB0ADA.4020006@ti.com \
    --to=fcooper@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=nsekhar@ti.com \
    --cc=pawel.moll@arm.com \
    --cc=robh@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=t-kristo@ti.com \
    --cc=thierry.reding@gmail.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 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).