xref: /rk3399_ARM-atf/docs/process/contributing.rst (revision 8aa050554b996406231a66a048b56fa03ba220c8)
1*8aa05055SPaul BeesleyContributor's Guide
2*8aa05055SPaul Beesley===================
340d553cfSPaul Beesley
440d553cfSPaul BeesleyGetting Started
540d553cfSPaul Beesley---------------
640d553cfSPaul Beesley
740d553cfSPaul Beesley-  Make sure you have a Github account and you are logged on
840d553cfSPaul Beesley   `developer.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
1640d553cfSPaul Beesley-  Clone `arm-trusted-firmware-a`_ on your own machine as suggested on the
1740d553cfSPaul Beesley   `User Guide`_.
1840d553cfSPaul Beesley-  Create a local topic branch based on the `arm-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.
2640d553cfSPaul Beesley-  Follow the `Coding Guidelines`_.
2740d553cfSPaul Beesley
2840d553cfSPaul Beesley   -  Use the checkpatch.pl script provided with the Linux source tree. A
2940d553cfSPaul Beesley      Makefile target is provided for convenience (see the "Checking source code
3040d553cfSPaul Beesley      style" section in the `User Guide`_).
3140d553cfSPaul Beesley
3240d553cfSPaul Beesley-  Keep the commits on topic. If you need to fix another bug or make another
3340d553cfSPaul Beesley   enhancement, please create a separate `issue`_ and address it on a separate
3440d553cfSPaul Beesley   topic branch.
3540d553cfSPaul Beesley-  Avoid long commit series. If you do have a long series, consider whether
3640d553cfSPaul Beesley   some commits should be squashed together or addressed in a separate topic.
3740d553cfSPaul Beesley-  Make sure your commit messages are in the proper format. If a commit fixes
3840d553cfSPaul Beesley   an `issue`_, include a reference.
3940d553cfSPaul Beesley-  Where appropriate, please update the documentation.
4040d553cfSPaul Beesley
4140d553cfSPaul Beesley   -  Consider whether the `User Guide`_, `Porting Guide`_, `Firmware Design`_
4240d553cfSPaul Beesley      or other in-source documentation needs 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
4640d553cfSPaul Beesley      identifier of the form as shown in `license.rst`_. 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.
5840d553cfSPaul Beesley   -  If you are submitting new files that you intend to be the technical
5940d553cfSPaul Beesley      sub-maintainer for (for example, a new platform port), then also update
6040d553cfSPaul Beesley      the `Maintainers`_ 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
6640d553cfSPaul Beesley   Foundation FVP. See `Running the software on FVP`_ for more information. For
6740d553cfSPaul Beesley   more extensive testing, consider running the `TF-A Tests`_ against your
6840d553cfSPaul Beesley   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
7840d553cfSPaul Beesley   under the terms of the `Developer Certificate of Origin (DCO)`_.
7940d553cfSPaul Beesley
8040d553cfSPaul Beesley   More details may be found in the `Gerrit Signed-off-by Lines guidelines`_.
8140d553cfSPaul Beesley
8240d553cfSPaul Beesley-  Ensure that each commit also has a unique ``Change-Id:`` line. If you have
8340d553cfSPaul Beesley   cloned the repository with the "`Clone with commit-msg hook`" clone method
8440d553cfSPaul Beesley   (as advised on the `User Guide`_), this should already be the case.
8540d553cfSPaul Beesley
8640d553cfSPaul Beesley   More details may be found in the `Gerrit Change-Ids documentation`_.
8740d553cfSPaul Beesley
8840d553cfSPaul Beesley-  Submit your changes for review at https://review.trustedfirmware.org
8940d553cfSPaul Beesley   targeting the ``integration`` branch.
9040d553cfSPaul Beesley
9140d553cfSPaul Beesley   -  The changes will then undergo further review and testing by the
9240d553cfSPaul Beesley      `Maintainers`_. Any review comments will be made directly on your patch.
9340d553cfSPaul Beesley      This may require you to do some rework.
9440d553cfSPaul Beesley
9540d553cfSPaul Beesley   Refer to the `Gerrit Uploading Changes documentation`_ for more details.
9640d553cfSPaul Beesley
9740d553cfSPaul Beesley-  When the changes are accepted, the `Maintainers`_ will integrate them.
9840d553cfSPaul Beesley
9940d553cfSPaul Beesley   -  Typically, the `Maintainers`_ will merge the changes into the
10040d553cfSPaul Beesley      ``integration`` branch.
10140d553cfSPaul Beesley   -  If the changes are not based on a sufficiently-recent commit, or if they
10240d553cfSPaul Beesley      cannot be automatically rebased, then the `Maintainers`_ may rebase it on
10340d553cfSPaul Beesley      the ``master`` branch or ask you to do so.
10440d553cfSPaul Beesley   -  After final integration testing, the changes will make their way into the
10540d553cfSPaul Beesley      ``master`` branch. If a problem is found during integration, the merge
10640d553cfSPaul Beesley      commit will be removed from the ``integration`` branch and the
10740d553cfSPaul Beesley      `Maintainers`_ will ask you to create a new patch set to resolve the
10840d553cfSPaul Beesley      problem.
10940d553cfSPaul Beesley
11040d553cfSPaul BeesleyBinary Components
11140d553cfSPaul Beesley-----------------
11240d553cfSPaul Beesley
11340d553cfSPaul Beesley-  Platforms may depend on binary components submitted to the `Trusted Firmware
11440d553cfSPaul Beesley   binary repository`_ if they require code that the contributor is unable or
11540d553cfSPaul Beesley   unwilling to open-source. This should be used as a rare exception.
11640d553cfSPaul Beesley-  All binary components must follow the contribution guidelines (in particular
11740d553cfSPaul Beesley   licensing rules) outlined in the `readme.rst <tf-binaries-readme_>`_ file of
11840d553cfSPaul Beesley   the binary repository.
11940d553cfSPaul Beesley-  Binary components must be restricted to only the specific functionality that
12040d553cfSPaul Beesley   cannot be open-sourced and must be linked into a larger open-source platform
12140d553cfSPaul Beesley   port. The majority of the platform port must still be implemented in open
12240d553cfSPaul Beesley   source. Platform ports that are merely a thin wrapper around a binary
12340d553cfSPaul Beesley   component that contains all the actual code will not be accepted.
12440d553cfSPaul Beesley-  Only platform port code (i.e. in the ``plat/<vendor>`` directory) may rely on
12540d553cfSPaul Beesley   binary components. Generic code must always be fully open-source.
12640d553cfSPaul Beesley
12740d553cfSPaul Beesley--------------
12840d553cfSPaul Beesley
12940d553cfSPaul Beesley*Copyright (c) 2013-2019, Arm Limited and Contributors. All rights reserved.*
13040d553cfSPaul Beesley
13140d553cfSPaul Beesley.. _developer.trustedfirmware.org: https://developer.trustedfirmware.org
13240d553cfSPaul Beesley.. _issue: https://developer.trustedfirmware.org/project/board/1/
13340d553cfSPaul Beesley.. _arm-trusted-firmware-a: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
13440d553cfSPaul Beesley.. _Git guidelines: http://git-scm.com/book/ch5-2.html
13540d553cfSPaul Beesley.. _Coding Guidelines: ./docs/coding-guidelines.rst
13640d553cfSPaul Beesley.. _User Guide: ./docs/user-guide.rst
13740d553cfSPaul Beesley.. _Porting Guide: ./docs/porting-guide.rst
13840d553cfSPaul Beesley.. _Firmware Design: ./docs/firmware-design.rst
13940d553cfSPaul Beesley.. _license.rst: ./license.rst
14040d553cfSPaul Beesley.. _Acknowledgements: ./acknowledgements.rst
14140d553cfSPaul Beesley.. _Maintainers: ./maintainers.rst
14240d553cfSPaul Beesley.. _Running the software on FVP: ./docs/user-guide.rst#user-content-running-the-software-on-fvp
14340d553cfSPaul Beesley.. _Developer Certificate of Origin (DCO): ./dco.txt
14440d553cfSPaul Beesley.. _Gerrit Uploading Changes documentation: https://review.trustedfirmware.org/Documentation/user-upload.html
14540d553cfSPaul Beesley.. _Gerrit Signed-off-by Lines guidelines: https://review.trustedfirmware.org/Documentation/user-signedoffby.html
14640d553cfSPaul Beesley.. _Gerrit Change-Ids documentation: https://review.trustedfirmware.org/Documentation/user-changeid.html
14740d553cfSPaul Beesley.. _TF-A Tests: https://git.trustedfirmware.org/TF-A/tf-a-tests.git/about/
14840d553cfSPaul Beesley.. _Trusted Firmware binary repository: https://review.trustedfirmware.org/admin/repos/tf-binaries
14940d553cfSPaul Beesley.. _tf-binaries-readme: https://git.trustedfirmware.org/tf-binaries.git/tree/readme.rst
150