Device Trees: Difference between labels and aliases?











up vote
2
down vote

favorite












In the file imx6qdl.dtsi is the following definition of gpio nodes (somewhat shortened):



gpio1: gpio@0209c000 {
[...]
};

gpio2: gpio@020a0000 {
[...]
};

[...]

gpio7: gpio@020b4000 {
[...]
};


But also in this file, the aliases node has the following properties (again shortened):



aliases {
[...]
gpio0 = &gpio1;
gpio1 = &gpio2;
gpio2 = &gpio3;
gpio3 = &gpio4;
gpio4 = &gpio5;
gpio5 = &gpio6;
gpio6 = &gpio7;
[...]
};


What exactly is the reason for doing so?
Do the labels get overwritten?










share|improve this question














bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






migrated from stackoverflow.com Dec 8 '15 at 18:00


This question came from our site for professional and enthusiast programmers.



















    up vote
    2
    down vote

    favorite












    In the file imx6qdl.dtsi is the following definition of gpio nodes (somewhat shortened):



    gpio1: gpio@0209c000 {
    [...]
    };

    gpio2: gpio@020a0000 {
    [...]
    };

    [...]

    gpio7: gpio@020b4000 {
    [...]
    };


    But also in this file, the aliases node has the following properties (again shortened):



    aliases {
    [...]
    gpio0 = &gpio1;
    gpio1 = &gpio2;
    gpio2 = &gpio3;
    gpio3 = &gpio4;
    gpio4 = &gpio5;
    gpio5 = &gpio6;
    gpio6 = &gpio7;
    [...]
    };


    What exactly is the reason for doing so?
    Do the labels get overwritten?










    share|improve this question














    bumped to the homepage by Community yesterday


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






    migrated from stackoverflow.com Dec 8 '15 at 18:00


    This question came from our site for professional and enthusiast programmers.

















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      In the file imx6qdl.dtsi is the following definition of gpio nodes (somewhat shortened):



      gpio1: gpio@0209c000 {
      [...]
      };

      gpio2: gpio@020a0000 {
      [...]
      };

      [...]

      gpio7: gpio@020b4000 {
      [...]
      };


      But also in this file, the aliases node has the following properties (again shortened):



      aliases {
      [...]
      gpio0 = &gpio1;
      gpio1 = &gpio2;
      gpio2 = &gpio3;
      gpio3 = &gpio4;
      gpio4 = &gpio5;
      gpio5 = &gpio6;
      gpio6 = &gpio7;
      [...]
      };


      What exactly is the reason for doing so?
      Do the labels get overwritten?










      share|improve this question













      In the file imx6qdl.dtsi is the following definition of gpio nodes (somewhat shortened):



      gpio1: gpio@0209c000 {
      [...]
      };

      gpio2: gpio@020a0000 {
      [...]
      };

      [...]

      gpio7: gpio@020b4000 {
      [...]
      };


      But also in this file, the aliases node has the following properties (again shortened):



      aliases {
      [...]
      gpio0 = &gpio1;
      gpio1 = &gpio2;
      gpio2 = &gpio3;
      gpio3 = &gpio4;
      gpio4 = &gpio5;
      gpio5 = &gpio6;
      gpio6 = &gpio7;
      [...]
      };


      What exactly is the reason for doing so?
      Do the labels get overwritten?







      linux device-tree






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 3 '15 at 15:00









      happyMOOyear

      1112




      1112





      bumped to the homepage by Community yesterday


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community yesterday


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






      migrated from stackoverflow.com Dec 8 '15 at 18:00


      This question came from our site for professional and enthusiast programmers.






      migrated from stackoverflow.com Dec 8 '15 at 18:00


      This question came from our site for professional and enthusiast programmers.
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          @happyMOOyear, not sure if you found an answer but I'll provide how I understand this. I'm working with the same i.MX chip.



          The second section uses the already defined node with the label gpio1@0209c000 and creates a new ALIAS for that node. The alias is another way to refer to the same pin. In this case the alias is created with a zero based scheme for easier reference. Thus referring to gpio1@0209c000 is equivalent to gpio0, which is shorter as well.



          reference: http://devicetree.org/Device_Tree_Usage#aliases_Node






          share|improve this answer





















          • I still have not found a good answer to my question so thanks for your input. In case of the label gpio0 I think it is clear that I refer to gpio1@0209c000. But which gpio am I refereing to when I use the label gpio1? gpio1@0209c000 or gpio2@020a0000?
            – happyMOOyear
            Jan 11 '16 at 7:45












          • if you use gpio1, that is the alias. if you wish to access gpio1@0209c000 you must either use the gpio0 alias, or the full gpio1@0209c000 label.
            – Daniel
            Jan 11 '16 at 20:32











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f248149%2fdevice-trees-difference-between-labels-and-aliases%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          @happyMOOyear, not sure if you found an answer but I'll provide how I understand this. I'm working with the same i.MX chip.



          The second section uses the already defined node with the label gpio1@0209c000 and creates a new ALIAS for that node. The alias is another way to refer to the same pin. In this case the alias is created with a zero based scheme for easier reference. Thus referring to gpio1@0209c000 is equivalent to gpio0, which is shorter as well.



          reference: http://devicetree.org/Device_Tree_Usage#aliases_Node






          share|improve this answer





















          • I still have not found a good answer to my question so thanks for your input. In case of the label gpio0 I think it is clear that I refer to gpio1@0209c000. But which gpio am I refereing to when I use the label gpio1? gpio1@0209c000 or gpio2@020a0000?
            – happyMOOyear
            Jan 11 '16 at 7:45












          • if you use gpio1, that is the alias. if you wish to access gpio1@0209c000 you must either use the gpio0 alias, or the full gpio1@0209c000 label.
            – Daniel
            Jan 11 '16 at 20:32















          up vote
          0
          down vote













          @happyMOOyear, not sure if you found an answer but I'll provide how I understand this. I'm working with the same i.MX chip.



          The second section uses the already defined node with the label gpio1@0209c000 and creates a new ALIAS for that node. The alias is another way to refer to the same pin. In this case the alias is created with a zero based scheme for easier reference. Thus referring to gpio1@0209c000 is equivalent to gpio0, which is shorter as well.



          reference: http://devicetree.org/Device_Tree_Usage#aliases_Node






          share|improve this answer





















          • I still have not found a good answer to my question so thanks for your input. In case of the label gpio0 I think it is clear that I refer to gpio1@0209c000. But which gpio am I refereing to when I use the label gpio1? gpio1@0209c000 or gpio2@020a0000?
            – happyMOOyear
            Jan 11 '16 at 7:45












          • if you use gpio1, that is the alias. if you wish to access gpio1@0209c000 you must either use the gpio0 alias, or the full gpio1@0209c000 label.
            – Daniel
            Jan 11 '16 at 20:32













          up vote
          0
          down vote










          up vote
          0
          down vote









          @happyMOOyear, not sure if you found an answer but I'll provide how I understand this. I'm working with the same i.MX chip.



          The second section uses the already defined node with the label gpio1@0209c000 and creates a new ALIAS for that node. The alias is another way to refer to the same pin. In this case the alias is created with a zero based scheme for easier reference. Thus referring to gpio1@0209c000 is equivalent to gpio0, which is shorter as well.



          reference: http://devicetree.org/Device_Tree_Usage#aliases_Node






          share|improve this answer












          @happyMOOyear, not sure if you found an answer but I'll provide how I understand this. I'm working with the same i.MX chip.



          The second section uses the already defined node with the label gpio1@0209c000 and creates a new ALIAS for that node. The alias is another way to refer to the same pin. In this case the alias is created with a zero based scheme for easier reference. Thus referring to gpio1@0209c000 is equivalent to gpio0, which is shorter as well.



          reference: http://devicetree.org/Device_Tree_Usage#aliases_Node







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 7 '16 at 18:27









          Daniel

          1239




          1239












          • I still have not found a good answer to my question so thanks for your input. In case of the label gpio0 I think it is clear that I refer to gpio1@0209c000. But which gpio am I refereing to when I use the label gpio1? gpio1@0209c000 or gpio2@020a0000?
            – happyMOOyear
            Jan 11 '16 at 7:45












          • if you use gpio1, that is the alias. if you wish to access gpio1@0209c000 you must either use the gpio0 alias, or the full gpio1@0209c000 label.
            – Daniel
            Jan 11 '16 at 20:32


















          • I still have not found a good answer to my question so thanks for your input. In case of the label gpio0 I think it is clear that I refer to gpio1@0209c000. But which gpio am I refereing to when I use the label gpio1? gpio1@0209c000 or gpio2@020a0000?
            – happyMOOyear
            Jan 11 '16 at 7:45












          • if you use gpio1, that is the alias. if you wish to access gpio1@0209c000 you must either use the gpio0 alias, or the full gpio1@0209c000 label.
            – Daniel
            Jan 11 '16 at 20:32
















          I still have not found a good answer to my question so thanks for your input. In case of the label gpio0 I think it is clear that I refer to gpio1@0209c000. But which gpio am I refereing to when I use the label gpio1? gpio1@0209c000 or gpio2@020a0000?
          – happyMOOyear
          Jan 11 '16 at 7:45






          I still have not found a good answer to my question so thanks for your input. In case of the label gpio0 I think it is clear that I refer to gpio1@0209c000. But which gpio am I refereing to when I use the label gpio1? gpio1@0209c000 or gpio2@020a0000?
          – happyMOOyear
          Jan 11 '16 at 7:45














          if you use gpio1, that is the alias. if you wish to access gpio1@0209c000 you must either use the gpio0 alias, or the full gpio1@0209c000 label.
          – Daniel
          Jan 11 '16 at 20:32




          if you use gpio1, that is the alias. if you wish to access gpio1@0209c000 you must either use the gpio0 alias, or the full gpio1@0209c000 label.
          – Daniel
          Jan 11 '16 at 20:32


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f248149%2fdevice-trees-difference-between-labels-and-aliases%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Accessing regular linux commands in Huawei's Dopra Linux

          Can't connect RFCOMM socket: Host is down

          Kernel panic - not syncing: Fatal Exception in Interrupt