Device Trees: Difference between labels and aliases?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
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













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


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


















    up vote
    1
    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













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


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
















      up vote
      1
      down vote

      favorite









      up vote
      1
      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

      1062




      1062




      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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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






























          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















































           


          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













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?