xref: /rk3399_ARM-atf/docs/process/contributing.rst (revision e63f5d129fadf520f42110d9a16c4192cba48784)
18aa05055SPaul BeesleyContributor's Guide
28aa05055SPaul 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
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.
26*e63f5d12SPaul 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.
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
6034760951SPaul Beesley      the :ref:`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
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
9434760951SPaul Beesley      :ref:`maintainers`. Any review comments will be made directly on your
9534760951SPaul Beesley      patch. This may require you to do some rework.
9640d553cfSPaul Beesley
9740d553cfSPaul Beesley   Refer to the `Gerrit Uploading Changes documentation`_ for more details.
9840d553cfSPaul Beesley
9934760951SPaul Beesley-  When the changes are accepted, the :ref:`maintainers` will integrate them.
10040d553cfSPaul Beesley
10134760951SPaul Beesley   -  Typically, the :ref:`maintainers` will merge the changes into the
10240d553cfSPaul Beesley      ``integration`` branch.
10340d553cfSPaul Beesley   -  If the changes are not based on a sufficiently-recent commit, or if they
10434760951SPaul Beesley      cannot be automatically rebased, then the :ref:`maintainers` may rebase it
10534760951SPaul Beesley      on the ``master`` branch or ask you to do so.
10640d553cfSPaul Beesley   -  After final integration testing, the changes will make their way into the
10740d553cfSPaul Beesley      ``master`` branch. If a problem is found during integration, the merge
10840d553cfSPaul Beesley      commit will be removed from the ``integration`` branch and the
10934760951SPaul Beesley      :ref:`maintainers` will ask you to create a new patch set to resolve the
11040d553cfSPaul Beesley      problem.
11140d553cfSPaul Beesley
11240d553cfSPaul BeesleyBinary Components
11340d553cfSPaul Beesley-----------------
11440d553cfSPaul Beesley
11540d553cfSPaul Beesley-  Platforms may depend on binary components submitted to the `Trusted Firmware
11640d553cfSPaul Beesley   binary repository`_ if they require code that the contributor is unable or
11740d553cfSPaul Beesley   unwilling to open-source. This should be used as a rare exception.
11840d553cfSPaul Beesley-  All binary components must follow the contribution guidelines (in particular
11940d553cfSPaul Beesley   licensing rules) outlined in the `readme.rst <tf-binaries-readme_>`_ file of
12040d553cfSPaul Beesley   the binary repository.
12140d553cfSPaul Beesley-  Binary components must be restricted to only the specific functionality that
12240d553cfSPaul Beesley   cannot be open-sourced and must be linked into a larger open-source platform
12340d553cfSPaul Beesley   port. The majority of the platform port must still be implemented in open
12440d553cfSPaul Beesley   source. Platform ports that are merely a thin wrapper around a binary
12540d553cfSPaul Beesley   component that contains all the actual code will not be accepted.
12640d553cfSPaul Beesley-  Only platform port code (i.e. in the ``plat/<vendor>`` directory) may rely on
12740d553cfSPaul Beesley   binary components. Generic code must always be fully open-source.
12840d553cfSPaul Beesley
12940d553cfSPaul Beesley--------------
13040d553cfSPaul Beesley
131*e63f5d12SPaul Beesley*Copyright (c) 2013-2020, Arm Limited and Contributors. All rights reserved.*
13240d553cfSPaul Beesley
13340d553cfSPaul Beesley.. _developer.trustedfirmware.org: https://developer.trustedfirmware.org
13440d553cfSPaul Beesley.. _issue: https://developer.trustedfirmware.org/project/board/1/
135f6ad51c8SJohn Tsichritzis.. _Trusted Firmware-A: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
13640d553cfSPaul Beesley.. _Git guidelines: http://git-scm.com/book/ch5-2.html
13740d553cfSPaul Beesley.. _Gerrit Uploading Changes documentation: https://review.trustedfirmware.org/Documentation/user-upload.html
13840d553cfSPaul Beesley.. _Gerrit Signed-off-by Lines guidelines: https://review.trustedfirmware.org/Documentation/user-signedoffby.html
13940d553cfSPaul Beesley.. _Gerrit Change-Ids documentation: https://review.trustedfirmware.org/Documentation/user-changeid.html
14040d553cfSPaul Beesley.. _TF-A Tests: https://git.trustedfirmware.org/TF-A/tf-a-tests.git/about/
14140d553cfSPaul Beesley.. _Trusted Firmware binary repository: https://review.trustedfirmware.org/admin/repos/tf-binaries
14240d553cfSPaul Beesley.. _tf-binaries-readme: https://git.trustedfirmware.org/tf-binaries.git/tree/readme.rst
143