xref: /rk3399_ARM-atf/docs/process/contributing.rst (revision 3d28b0a42df56bf44037544f4aa192bcd47896ea)
18aa05055SPaul BeesleyContributor's Guide
28aa05055SPaul Beesley===================
340d553cfSPaul Beesley
440d553cfSPaul BeesleyGetting Started
540d553cfSPaul Beesley---------------
640d553cfSPaul Beesley
7*3d28b0a4SSandrine Bailleux-  Make sure you have a Github account and you are logged on both
8*3d28b0a4SSandrine Bailleux   `developer.trustedfirmware.org`_ and `review.trustedfirmware.org`_.
940d553cfSPaul Beesley-  Create an `issue`_ for your work if one does not already exist. This gives
1040d553cfSPaul Beesley   everyone visibility of whether others are working on something similar.
1140d553cfSPaul Beesley
1240d553cfSPaul Beesley   -  If you intend to include Third Party IP in your contribution, please
1340d553cfSPaul Beesley      raise a separate `issue`_ for this and ensure that the changes that
1440d553cfSPaul Beesley      include Third Party IP are made on a separate topic branch.
1540d553cfSPaul Beesley
1643f35ef5SPaul Beesley-  Clone `Trusted Firmware-A`_ on your own machine as described in
1743f35ef5SPaul Beesley   :ref:`prerequisites_get_source`.
18f6ad51c8SJohn Tsichritzis-  Create a local topic branch based on the `Trusted Firmware-A`_ ``master``
1940d553cfSPaul Beesley   branch.
2040d553cfSPaul Beesley
2140d553cfSPaul BeesleyMaking Changes
2240d553cfSPaul Beesley--------------
2340d553cfSPaul Beesley
2440d553cfSPaul Beesley-  Make commits of logical units. See these general `Git guidelines`_ for
2540d553cfSPaul Beesley   contributing to a project.
26e63f5d12SPaul Beesley-  Follow the :ref:`Coding Style` and :ref:`Coding Guidelines`.
2740d553cfSPaul Beesley
2840d553cfSPaul Beesley   -  Use the checkpatch.pl script provided with the Linux source tree. A
2943f35ef5SPaul Beesley      Makefile target is provided for convenience.
3040d553cfSPaul Beesley
3140d553cfSPaul Beesley-  Keep the commits on topic. If you need to fix another bug or make another
3240d553cfSPaul Beesley   enhancement, please create a separate `issue`_ and address it on a separate
3340d553cfSPaul Beesley   topic branch.
3440d553cfSPaul Beesley-  Avoid long commit series. If you do have a long series, consider whether
3540d553cfSPaul Beesley   some commits should be squashed together or addressed in a separate topic.
3640d553cfSPaul Beesley-  Make sure your commit messages are in the proper format. If a commit fixes
3740d553cfSPaul Beesley   an `issue`_, include a reference.
3840d553cfSPaul Beesley-  Where appropriate, please update the documentation.
3940d553cfSPaul Beesley
4043f35ef5SPaul Beesley   -  Consider whether the :ref:`Porting Guide`,
4143f35ef5SPaul Beesley      :ref:`Firmware Design` document or other in-source documentation needs
4243f35ef5SPaul Beesley      updating.
4340d553cfSPaul Beesley   -  Ensure that each changed file has the correct copyright and license
4440d553cfSPaul Beesley      information. Files that entirely consist of contributions to this
4540d553cfSPaul Beesley      project should have a copyright notice and BSD-3-Clause SPDX license
4634760951SPaul Beesley      identifier of the form as shown in :ref:`license`. Files that contain
4740d553cfSPaul Beesley      changes to imported Third Party IP files should retain their original
4840d553cfSPaul Beesley      copyright and license notices. For significant contributions you may
4940d553cfSPaul Beesley      add your own copyright notice in following format:
5040d553cfSPaul Beesley
5140d553cfSPaul Beesley      ::
5240d553cfSPaul Beesley
5340d553cfSPaul Beesley          Portions copyright (c) [XXXX-]YYYY, <OWNER>. All rights reserved.
5440d553cfSPaul Beesley
5540d553cfSPaul Beesley      where XXXX is the year of first contribution (if different to YYYY) and
5640d553cfSPaul Beesley      YYYY is the year of most recent contribution. <OWNER> is your name or
5740d553cfSPaul Beesley      your company name.
58*3d28b0a4SSandrine Bailleux   -  If you are submitting new files that you intend to be the code owner for
59*3d28b0a4SSandrine Bailleux      (for example, a new platform port), then also update the
60*3d28b0a4SSandrine Bailleux      :ref:`code owners` file.
6140d553cfSPaul Beesley   -  For topics with multiple commits, you should make all documentation
6240d553cfSPaul Beesley      changes (and nothing else) in the last commit of the series. Otherwise,
6340d553cfSPaul Beesley      include the documentation changes within the single commit.
6440d553cfSPaul Beesley
6540d553cfSPaul Beesley-  Please test your changes. As a minimum, ensure that Linux boots on the
6643f35ef5SPaul Beesley   Foundation FVP. See :ref:`Arm Fixed Virtual Platforms (FVP)` for more
6743f35ef5SPaul Beesley   information. For more extensive testing, consider running the `TF-A Tests`_
6843f35ef5SPaul Beesley   against your patches.
6940d553cfSPaul Beesley
7040d553cfSPaul BeesleySubmitting Changes
7140d553cfSPaul Beesley------------------
7240d553cfSPaul Beesley
7340d553cfSPaul Beesley-  Ensure that each commit in the series has at least one ``Signed-off-by:``
7440d553cfSPaul Beesley   line, using your real name and email address. The names in the
7540d553cfSPaul Beesley   ``Signed-off-by:`` and ``Author:`` lines must match. If anyone else
7640d553cfSPaul Beesley   contributes to the commit, they must also add their own ``Signed-off-by:``
7740d553cfSPaul Beesley   line. By adding this line the contributor certifies the contribution is made
7834760951SPaul Beesley   under the terms of the
7934760951SPaul Beesley   :download:`Developer Certificate of Origin <../../dco.txt>`.
8040d553cfSPaul Beesley
8140d553cfSPaul Beesley   More details may be found in the `Gerrit Signed-off-by Lines guidelines`_.
8240d553cfSPaul Beesley
8340d553cfSPaul Beesley-  Ensure that each commit also has a unique ``Change-Id:`` line. If you have
8440d553cfSPaul Beesley   cloned the repository with the "`Clone with commit-msg hook`" clone method
8543f35ef5SPaul Beesley   (following the :ref:`Prerequisites` document), this should already be the
8643f35ef5SPaul Beesley   case.
8740d553cfSPaul Beesley
8840d553cfSPaul Beesley   More details may be found in the `Gerrit Change-Ids documentation`_.
8940d553cfSPaul Beesley
9040d553cfSPaul Beesley-  Submit your changes for review at https://review.trustedfirmware.org
9140d553cfSPaul Beesley   targeting the ``integration`` branch.
9240d553cfSPaul Beesley
9340d553cfSPaul Beesley   -  The changes will then undergo further review and testing by the
94*3d28b0a4SSandrine Bailleux      :ref:`code owners` and :ref:`maintainers`. Any review comments will be
95*3d28b0a4SSandrine Bailleux      made directly on your patch. This may require you to do some rework. For
96*3d28b0a4SSandrine Bailleux      controversial changes, the discussion might be moved to the `TF-A mailing
97*3d28b0a4SSandrine Bailleux      list`_ to involve more of the community.
9840d553cfSPaul Beesley
9940d553cfSPaul Beesley   Refer to the `Gerrit Uploading Changes documentation`_ for more details.
10040d553cfSPaul Beesley
10134760951SPaul Beesley-  When the changes are accepted, the :ref:`maintainers` will integrate them.
10240d553cfSPaul Beesley
10334760951SPaul Beesley   -  Typically, the :ref:`maintainers` will merge the changes into the
10440d553cfSPaul Beesley      ``integration`` branch.
10540d553cfSPaul Beesley   -  If the changes are not based on a sufficiently-recent commit, or if they
10634760951SPaul Beesley      cannot be automatically rebased, then the :ref:`maintainers` may rebase it
107*3d28b0a4SSandrine Bailleux      on the ``integration`` branch or ask you to do so.
10840d553cfSPaul Beesley   -  After final integration testing, the changes will make their way into the
109*3d28b0a4SSandrine Bailleux      ``master`` branch. If a problem is found during integration, the
110*3d28b0a4SSandrine Bailleux      :ref:`maintainers` will request your help to solve the issue. They may
111*3d28b0a4SSandrine Bailleux      revert your patches and ask you to resubmit a reworked version of them or
112*3d28b0a4SSandrine Bailleux      they may ask you to provide a fix-up patch.
11340d553cfSPaul Beesley
11440d553cfSPaul BeesleyBinary Components
11540d553cfSPaul Beesley-----------------
11640d553cfSPaul Beesley
11740d553cfSPaul Beesley-  Platforms may depend on binary components submitted to the `Trusted Firmware
11840d553cfSPaul Beesley   binary repository`_ if they require code that the contributor is unable or
11940d553cfSPaul Beesley   unwilling to open-source. This should be used as a rare exception.
12040d553cfSPaul Beesley-  All binary components must follow the contribution guidelines (in particular
12140d553cfSPaul Beesley   licensing rules) outlined in the `readme.rst <tf-binaries-readme_>`_ file of
12240d553cfSPaul Beesley   the binary repository.
12340d553cfSPaul Beesley-  Binary components must be restricted to only the specific functionality that
12440d553cfSPaul Beesley   cannot be open-sourced and must be linked into a larger open-source platform
12540d553cfSPaul Beesley   port. The majority of the platform port must still be implemented in open
12640d553cfSPaul Beesley   source. Platform ports that are merely a thin wrapper around a binary
12740d553cfSPaul Beesley   component that contains all the actual code will not be accepted.
12840d553cfSPaul Beesley-  Only platform port code (i.e. in the ``plat/<vendor>`` directory) may rely on
12940d553cfSPaul Beesley   binary components. Generic code must always be fully open-source.
13040d553cfSPaul Beesley
13140d553cfSPaul Beesley--------------
13240d553cfSPaul Beesley
133e63f5d12SPaul Beesley*Copyright (c) 2013-2020, Arm Limited and Contributors. All rights reserved.*
13440d553cfSPaul Beesley
13540d553cfSPaul Beesley.. _developer.trustedfirmware.org: https://developer.trustedfirmware.org
136*3d28b0a4SSandrine Bailleux.. _review.trustedfirmware.org: https://review.trustedfirmware.org
13740d553cfSPaul Beesley.. _issue: https://developer.trustedfirmware.org/project/board/1/
138f6ad51c8SJohn Tsichritzis.. _Trusted Firmware-A: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
13940d553cfSPaul Beesley.. _Git guidelines: http://git-scm.com/book/ch5-2.html
14040d553cfSPaul Beesley.. _Gerrit Uploading Changes documentation: https://review.trustedfirmware.org/Documentation/user-upload.html
14140d553cfSPaul Beesley.. _Gerrit Signed-off-by Lines guidelines: https://review.trustedfirmware.org/Documentation/user-signedoffby.html
14240d553cfSPaul Beesley.. _Gerrit Change-Ids documentation: https://review.trustedfirmware.org/Documentation/user-changeid.html
143*3d28b0a4SSandrine Bailleux.. _TF-A Tests: https://trustedfirmware-a-tests.readthedocs.io
14440d553cfSPaul Beesley.. _Trusted Firmware binary repository: https://review.trustedfirmware.org/admin/repos/tf-binaries
14540d553cfSPaul Beesley.. _tf-binaries-readme: https://git.trustedfirmware.org/tf-binaries.git/tree/readme.rst
146*3d28b0a4SSandrine Bailleux.. _TF-A mailing list: https://lists.trustedfirmware.org/mailman/listinfo/tf-a
147