xref: /rk3399_ARM-atf/docs/process/contributing.rst (revision e256cc63ae6a577af24b184783b54cc38e5ecc55)
18aa05055SPaul BeesleyContributor's Guide
28aa05055SPaul Beesley===================
340d553cfSPaul Beesley
440d553cfSPaul BeesleyGetting Started
540d553cfSPaul Beesley---------------
640d553cfSPaul Beesley
73d28b0a4SSandrine Bailleux-  Make sure you have a Github account and you are logged on both
83d28b0a4SSandrine Bailleux   `developer.trustedfirmware.org`_ and `review.trustedfirmware.org`_.
940d553cfSPaul Beesley
10a88b3c29SSandrine Bailleux-  If you plan to contribute a major piece of work, it is usually a good idea to
11a88b3c29SSandrine Bailleux   start a discussion around it on the mailing list. This gives everyone
12a88b3c29SSandrine Bailleux   visibility of what is coming up, you might learn that somebody else is
13a88b3c29SSandrine Bailleux   already working on something similar or the community might be able to
14a88b3c29SSandrine Bailleux   provide some early input to help shaping the design of the feature.
15a88b3c29SSandrine Bailleux
16a88b3c29SSandrine Bailleux   If you intend to include Third Party IP in your contribution, please mention
17a88b3c29SSandrine Bailleux   it explicitly in the email thread and ensure that the changes that include
18a88b3c29SSandrine Bailleux   Third Party IP are made in a separate patch (or patch series).
1940d553cfSPaul Beesley
2043f35ef5SPaul Beesley-  Clone `Trusted Firmware-A`_ on your own machine as described in
2143f35ef5SPaul Beesley   :ref:`prerequisites_get_source`.
22*e256cc63SSandrine Bailleux
23f6ad51c8SJohn Tsichritzis-  Create a local topic branch based on the `Trusted Firmware-A`_ ``master``
2440d553cfSPaul Beesley   branch.
2540d553cfSPaul Beesley
2640d553cfSPaul BeesleyMaking Changes
2740d553cfSPaul Beesley--------------
2840d553cfSPaul Beesley
2940d553cfSPaul Beesley-  Make commits of logical units. See these general `Git guidelines`_ for
3040d553cfSPaul Beesley   contributing to a project.
31*e256cc63SSandrine Bailleux
32e63f5d12SPaul Beesley-  Follow the :ref:`Coding Style` and :ref:`Coding Guidelines`.
3340d553cfSPaul Beesley
3440d553cfSPaul Beesley   -  Use the checkpatch.pl script provided with the Linux source tree. A
3543f35ef5SPaul Beesley      Makefile target is provided for convenience.
3640d553cfSPaul Beesley
3740d553cfSPaul Beesley-  Keep the commits on topic. If you need to fix another bug or make another
38a88b3c29SSandrine Bailleux   enhancement, please address it on a separate topic branch.
39*e256cc63SSandrine Bailleux
4040d553cfSPaul Beesley-  Avoid long commit series. If you do have a long series, consider whether
4140d553cfSPaul Beesley   some commits should be squashed together or addressed in a separate topic.
42*e256cc63SSandrine Bailleux
4340d553cfSPaul Beesley-  Make sure your commit messages are in the proper format. If a commit fixes
4440d553cfSPaul Beesley   an `issue`_, include a reference.
45*e256cc63SSandrine Bailleux
4640d553cfSPaul Beesley-  Where appropriate, please update the documentation.
4740d553cfSPaul Beesley
48*e256cc63SSandrine Bailleux   -  Consider whether the :ref:`Porting Guide`, :ref:`Firmware Design` document
49*e256cc63SSandrine Bailleux      or other in-source documentation needs updating.
50*e256cc63SSandrine Bailleux
51*e256cc63SSandrine Bailleux   -  If you are submitting new files that you intend to be the code owner for
52*e256cc63SSandrine Bailleux      (for example, a new platform port), then also update the
53*e256cc63SSandrine Bailleux      :ref:`code owners` file.
54*e256cc63SSandrine Bailleux
55*e256cc63SSandrine Bailleux   -  For topics with multiple commits, you should make all documentation changes
56*e256cc63SSandrine Bailleux      (and nothing else) in the last commit of the series. Otherwise, include
57*e256cc63SSandrine Bailleux      the documentation changes within the single commit.
58*e256cc63SSandrine Bailleux
5940d553cfSPaul Beesley-  Ensure that each changed file has the correct copyright and license
60*e256cc63SSandrine Bailleux   information. Files that entirely consist of contributions to this project
61*e256cc63SSandrine Bailleux   should have a copyright notice and BSD-3-Clause SPDX license identifier of
62*e256cc63SSandrine Bailleux   the form as shown in :ref:`license`. Files that contain changes to imported
63*e256cc63SSandrine Bailleux   Third Party IP files should retain their original copyright and license
64*e256cc63SSandrine Bailleux   notices.
65*e256cc63SSandrine Bailleux
66*e256cc63SSandrine Bailleux   For significant contributions you may add your own copyright notice in the
67*e256cc63SSandrine Bailleux   following format:
6840d553cfSPaul Beesley
6940d553cfSPaul Beesley   ::
7040d553cfSPaul Beesley
7140d553cfSPaul Beesley       Portions copyright (c) [XXXX-]YYYY, <OWNER>. All rights reserved.
7240d553cfSPaul Beesley
73*e256cc63SSandrine Bailleux   where XXXX is the year of first contribution (if different to YYYY) and YYYY
74*e256cc63SSandrine Bailleux   is the year of most recent contribution. <OWNER> is your name or your company
75*e256cc63SSandrine Bailleux   name.
7640d553cfSPaul Beesley
7740d553cfSPaul Beesley-  Please test your changes. As a minimum, ensure that Linux boots on the
7843f35ef5SPaul Beesley   Foundation FVP. See :ref:`Arm Fixed Virtual Platforms (FVP)` for more
7943f35ef5SPaul Beesley   information. For more extensive testing, consider running the `TF-A Tests`_
8043f35ef5SPaul Beesley   against your patches.
8140d553cfSPaul Beesley
8240d553cfSPaul BeesleySubmitting Changes
8340d553cfSPaul Beesley------------------
8440d553cfSPaul Beesley
8540d553cfSPaul Beesley-  Ensure that each commit in the series has at least one ``Signed-off-by:``
8640d553cfSPaul Beesley   line, using your real name and email address. The names in the
8740d553cfSPaul Beesley   ``Signed-off-by:`` and ``Author:`` lines must match. If anyone else
8840d553cfSPaul Beesley   contributes to the commit, they must also add their own ``Signed-off-by:``
8940d553cfSPaul Beesley   line. By adding this line the contributor certifies the contribution is made
9034760951SPaul Beesley   under the terms of the
9134760951SPaul Beesley   :download:`Developer Certificate of Origin <../../dco.txt>`.
9240d553cfSPaul Beesley
9340d553cfSPaul Beesley   More details may be found in the `Gerrit Signed-off-by Lines guidelines`_.
9440d553cfSPaul Beesley
9540d553cfSPaul Beesley-  Ensure that each commit also has a unique ``Change-Id:`` line. If you have
9640d553cfSPaul Beesley   cloned the repository with the "`Clone with commit-msg hook`" clone method
9743f35ef5SPaul Beesley   (following the :ref:`Prerequisites` document), this should already be the
9843f35ef5SPaul Beesley   case.
9940d553cfSPaul Beesley
10040d553cfSPaul Beesley   More details may be found in the `Gerrit Change-Ids documentation`_.
10140d553cfSPaul Beesley
10240d553cfSPaul Beesley-  Submit your changes for review at https://review.trustedfirmware.org
10340d553cfSPaul Beesley   targeting the ``integration`` branch.
10440d553cfSPaul Beesley
10540d553cfSPaul Beesley   -  The changes will then undergo further review and testing by the
1063d28b0a4SSandrine Bailleux      :ref:`code owners` and :ref:`maintainers`. Any review comments will be
1073d28b0a4SSandrine Bailleux      made directly on your patch. This may require you to do some rework. For
1083d28b0a4SSandrine Bailleux      controversial changes, the discussion might be moved to the `TF-A mailing
1093d28b0a4SSandrine Bailleux      list`_ to involve more of the community.
11040d553cfSPaul Beesley
11140d553cfSPaul Beesley   Refer to the `Gerrit Uploading Changes documentation`_ for more details.
11240d553cfSPaul Beesley
11334760951SPaul Beesley-  When the changes are accepted, the :ref:`maintainers` will integrate them.
11440d553cfSPaul Beesley
11534760951SPaul Beesley   -  Typically, the :ref:`maintainers` will merge the changes into the
11640d553cfSPaul Beesley      ``integration`` branch.
11740d553cfSPaul Beesley   -  If the changes are not based on a sufficiently-recent commit, or if they
11834760951SPaul Beesley      cannot be automatically rebased, then the :ref:`maintainers` may rebase it
1193d28b0a4SSandrine Bailleux      on the ``integration`` branch or ask you to do so.
12040d553cfSPaul Beesley   -  After final integration testing, the changes will make their way into the
1213d28b0a4SSandrine Bailleux      ``master`` branch. If a problem is found during integration, the
1223d28b0a4SSandrine Bailleux      :ref:`maintainers` will request your help to solve the issue. They may
1233d28b0a4SSandrine Bailleux      revert your patches and ask you to resubmit a reworked version of them or
1243d28b0a4SSandrine Bailleux      they may ask you to provide a fix-up patch.
12540d553cfSPaul Beesley
12640d553cfSPaul BeesleyBinary Components
12740d553cfSPaul Beesley-----------------
12840d553cfSPaul Beesley
12940d553cfSPaul Beesley-  Platforms may depend on binary components submitted to the `Trusted Firmware
13040d553cfSPaul Beesley   binary repository`_ if they require code that the contributor is unable or
13140d553cfSPaul Beesley   unwilling to open-source. This should be used as a rare exception.
13240d553cfSPaul Beesley-  All binary components must follow the contribution guidelines (in particular
13340d553cfSPaul Beesley   licensing rules) outlined in the `readme.rst <tf-binaries-readme_>`_ file of
13440d553cfSPaul Beesley   the binary repository.
13540d553cfSPaul Beesley-  Binary components must be restricted to only the specific functionality that
13640d553cfSPaul Beesley   cannot be open-sourced and must be linked into a larger open-source platform
13740d553cfSPaul Beesley   port. The majority of the platform port must still be implemented in open
13840d553cfSPaul Beesley   source. Platform ports that are merely a thin wrapper around a binary
13940d553cfSPaul Beesley   component that contains all the actual code will not be accepted.
14040d553cfSPaul Beesley-  Only platform port code (i.e. in the ``plat/<vendor>`` directory) may rely on
14140d553cfSPaul Beesley   binary components. Generic code must always be fully open-source.
14240d553cfSPaul Beesley
14340d553cfSPaul Beesley--------------
14440d553cfSPaul Beesley
145e63f5d12SPaul Beesley*Copyright (c) 2013-2020, Arm Limited and Contributors. All rights reserved.*
14640d553cfSPaul Beesley
14740d553cfSPaul Beesley.. _developer.trustedfirmware.org: https://developer.trustedfirmware.org
1483d28b0a4SSandrine Bailleux.. _review.trustedfirmware.org: https://review.trustedfirmware.org
14940d553cfSPaul Beesley.. _issue: https://developer.trustedfirmware.org/project/board/1/
150f6ad51c8SJohn Tsichritzis.. _Trusted Firmware-A: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
15140d553cfSPaul Beesley.. _Git guidelines: http://git-scm.com/book/ch5-2.html
15240d553cfSPaul Beesley.. _Gerrit Uploading Changes documentation: https://review.trustedfirmware.org/Documentation/user-upload.html
15340d553cfSPaul Beesley.. _Gerrit Signed-off-by Lines guidelines: https://review.trustedfirmware.org/Documentation/user-signedoffby.html
15440d553cfSPaul Beesley.. _Gerrit Change-Ids documentation: https://review.trustedfirmware.org/Documentation/user-changeid.html
1553d28b0a4SSandrine Bailleux.. _TF-A Tests: https://trustedfirmware-a-tests.readthedocs.io
15640d553cfSPaul Beesley.. _Trusted Firmware binary repository: https://review.trustedfirmware.org/admin/repos/tf-binaries
15740d553cfSPaul Beesley.. _tf-binaries-readme: https://git.trustedfirmware.org/tf-binaries.git/tree/readme.rst
1583d28b0a4SSandrine Bailleux.. _TF-A mailing list: https://lists.trustedfirmware.org/mailman/listinfo/tf-a
159