a couple questions about device trees and "ranges"

crawling my way through the DTS files for the BBB and i ran across
this in am33xx.dtsi:

                epwmss1: epwmss@48302000 {
                        compatible = "ti,am33xx-pwmss";
                        reg = <0x48302000 0x10>;
                        ti,hwmods = "epwmss1";
                        #address-cells = <1>;
                        #size-cells = <1>;
                        status = "disabled";
                        ranges = <0x48302100 0x48302100 0x80 /* ECAP */
                                  0x48302180 0x48302180 0x80 /* EQEP */
                                  0x48302200 0x48302200 0x80>; /* EHRPWM */

                        ecap1: ecap@48302100 {
                                compatible = "ti,am33xx-ecap";
                                #pwm-cells = <3>;
                                reg = <0x48302100 0x80>;
                                interrupts = <47>;
                                interrupt-names = "ecap1";
                                ti,hwmods = "ecap1";
                                status = "disabled";
                        };

                        ehrpwm1: ehrpwm@48302200 {
                                compatible = "ti,am33xx-ehrpwm";
                                #pwm-cells = <3>;
                                reg = <0x48302200 0x80>;
                                ti,hwmods = "ehrpwm1";
                                status = "disabled";
                        };
                };

  first question ... should there be a node definition for "eqep"?
after all, the second triplet in "ranges" is commented with "EQEP",
but there is no associated child node for that. i would have expected
one.

  also, based on my understanding of "ranges", the above definition
seems to be simply mapping the child address space directly back to
the parent address space; i.e., no translation is required. so what is
the point? wouldn't the same thing be achieved with a simple:

      ranges;

which specifies that the two address spaces are identical and no
address translation is required?

  or does the above also restrict the mapping to specifically the
ranges listed there?

rday

crawling my way through the DTS files for the BBB and i ran across
this in am33xx.dtsi:

               epwmss1: epwmss@48302000 {
                       compatible = "ti,am33xx-pwmss";
                       reg = <0x48302000 0x10>;
                       ti,hwmods = "epwmss1";
                       #address-cells = <1>;
                       #size-cells = <1>;
                       status = "disabled";
                       ranges = <0x48302100 0x48302100 0x80 /* ECAP */
                                 0x48302180 0x48302180 0x80 /* EQEP */
                                 0x48302200 0x48302200 0x80>; /* EHRPWM
*/

                       ecap1: ecap@48302100 {
                               compatible = "ti,am33xx-ecap";
                               #pwm-cells = <3>;
                               reg = <0x48302100 0x80>;
                               interrupts = <47>;
                               interrupt-names = "ecap1";
                               ti,hwmods = "ecap1";
                               status = "disabled";
                       };

                       ehrpwm1: ehrpwm@48302200 {
                               compatible = "ti,am33xx-ehrpwm";
                               #pwm-cells = <3>;
                               reg = <0x48302200 0x80>;
                               ti,hwmods = "ehrpwm1";
                               status = "disabled";
                       };
               };

first question ... should there be a node definition for "eqep"?
after all, the second triplet in "ranges" is commented with "EQEP",
but there is no associated child node for that. i would have expected
one.

also, based on my understanding of "ranges", the above definition
seems to be simply mapping the child address space directly back to
the parent address space; i.e., no translation is required. so what is
the point? wouldn't the same thing be achieved with a simple:

     ranges;

which specifies that the two address spaces are identical and no
address translation is required?

or does the above also restrict the mapping to specifically the
ranges listed there?

Hi Robert,

Better to ask this question on the devicetree mailing list:
Send e-mail to Majordomo@vger.kernel.org with subscribe devicetree in the
body.

Regards,
John

except this isn't a general device tree question, it's specific to
something related to the DT on a BBB, which is why i thought it would
be more appropriate here. and the answer(s) might be helpful to other
BBB users who are curious about device tree stuff as well.

  i'm probably going to have a couple more questions about device
trees related specifically to the BBB -- anyone uninterested is
welcome to ignore them.

rday

p.s. i'm trying to clarify a few things for the sake of writing up a
DT tutorial for a couple of my courses. so i want to make sure i
understand it before trying to explain it. :slight_smile:

>
> crawling my way through the DTS files for the BBB and i ran across
>this in am33xx.dtsi:
>
> epwmss1: epwmss@48302000 {
> compatible = "ti,am33xx-pwmss";
> reg = <0x48302000 0x10>;
> ti,hwmods = "epwmss1";
> #address-cells = <1>;
> #size-cells = <1>;
> status = "disabled";
> ranges = <0x48302100 0x48302100 0x80 /* ECAP
*/
> 0x48302180 0x48302180 0x80 /* EQEP
*/
> 0x48302200 0x48302200 0x80>; /*
EHRPWM
>*/
>
> ecap1: ecap@48302100 {
> compatible = "ti,am33xx-ecap";
> #pwm-cells = <3>;
> reg = <0x48302100 0x80>;
> interrupts = <47>;
> interrupt-names = "ecap1";
> ti,hwmods = "ecap1";
> status = "disabled";
> };
>
> ehrpwm1: ehrpwm@48302200 {
> compatible = "ti,am33xx-ehrpwm";
> #pwm-cells = <3>;
> reg = <0x48302200 0x80>;
> ti,hwmods = "ehrpwm1";
> status = "disabled";
> };
> };
>
> first question ... should there be a node definition for "eqep"?
>after all, the second triplet in "ranges" is commented with "EQEP",
>but there is no associated child node for that. i would have expected
>one.
>
> also, based on my understanding of "ranges", the above definition
>seems to be simply mapping the child address space directly back to
>the parent address space; i.e., no translation is required. so what is
>the point? wouldn't the same thing be achieved with a simple:
>
> ranges;
>
>which specifies that the two address spaces are identical and no
>address translation is required?
>
> or does the above also restrict the mapping to specifically the
>ranges listed there?
Hi Robert,

Better to ask this question on the devicetree mailing list:
Send e-mail to Majordomo@vger.kernel.org with subscribe devicetree in
the
body.

except this isn't a general device tree question, it's specific to
something related to the DT on a BBB, which is why i thought it would
be more appropriate here. and the answer(s) might be helpful to other
BBB users who are curious about device tree stuff as well.

i'm probably going to have a couple more questions about device
trees related specifically to the BBB -- anyone uninterested is
welcome to ignore them.

I wasn¹t being critical, I was only trying to be helpful. There are
several people on the DeviceTree mailing list that use BBB, but
specifically, Pantelis Antoniou who wrote the cape manager and later the
devicetree overlay is someone who could answer your question and I¹m not
sure if he monitors this mailing list.

Regards,
John