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 10*a88b3c29SSandrine Bailleux- If you plan to contribute a major piece of work, it is usually a good idea to 11*a88b3c29SSandrine Bailleux start a discussion around it on the mailing list. This gives everyone 12*a88b3c29SSandrine Bailleux visibility of what is coming up, you might learn that somebody else is 13*a88b3c29SSandrine Bailleux already working on something similar or the community might be able to 14*a88b3c29SSandrine Bailleux provide some early input to help shaping the design of the feature. 15*a88b3c29SSandrine Bailleux 16*a88b3c29SSandrine Bailleux If you intend to include Third Party IP in your contribution, please mention 17*a88b3c29SSandrine Bailleux it explicitly in the email thread and ensure that the changes that include 18*a88b3c29SSandrine 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`. 22f6ad51c8SJohn Tsichritzis- Create a local topic branch based on the `Trusted Firmware-A`_ ``master`` 2340d553cfSPaul Beesley branch. 2440d553cfSPaul Beesley 2540d553cfSPaul BeesleyMaking Changes 2640d553cfSPaul Beesley-------------- 2740d553cfSPaul Beesley 2840d553cfSPaul Beesley- Make commits of logical units. See these general `Git guidelines`_ for 2940d553cfSPaul Beesley contributing to a project. 30e63f5d12SPaul Beesley- Follow the :ref:`Coding Style` and :ref:`Coding Guidelines`. 3140d553cfSPaul Beesley 3240d553cfSPaul Beesley - Use the checkpatch.pl script provided with the Linux source tree. A 3343f35ef5SPaul Beesley Makefile target is provided for convenience. 3440d553cfSPaul Beesley 3540d553cfSPaul Beesley- Keep the commits on topic. If you need to fix another bug or make another 36*a88b3c29SSandrine Bailleux enhancement, please address it on a separate topic branch. 3740d553cfSPaul Beesley- Avoid long commit series. If you do have a long series, consider whether 3840d553cfSPaul Beesley some commits should be squashed together or addressed in a separate topic. 3940d553cfSPaul Beesley- Make sure your commit messages are in the proper format. If a commit fixes 4040d553cfSPaul Beesley an `issue`_, include a reference. 4140d553cfSPaul Beesley- Where appropriate, please update the documentation. 4240d553cfSPaul Beesley 4343f35ef5SPaul Beesley - Consider whether the :ref:`Porting Guide`, 4443f35ef5SPaul Beesley :ref:`Firmware Design` document or other in-source documentation needs 4543f35ef5SPaul Beesley updating. 4640d553cfSPaul Beesley - Ensure that each changed file has the correct copyright and license 4740d553cfSPaul Beesley information. Files that entirely consist of contributions to this 4840d553cfSPaul Beesley project should have a copyright notice and BSD-3-Clause SPDX license 4934760951SPaul Beesley identifier of the form as shown in :ref:`license`. Files that contain 5040d553cfSPaul Beesley changes to imported Third Party IP files should retain their original 5140d553cfSPaul Beesley copyright and license notices. For significant contributions you may 5240d553cfSPaul Beesley add your own copyright notice in following format: 5340d553cfSPaul Beesley 5440d553cfSPaul Beesley :: 5540d553cfSPaul Beesley 5640d553cfSPaul Beesley Portions copyright (c) [XXXX-]YYYY, <OWNER>. All rights reserved. 5740d553cfSPaul Beesley 5840d553cfSPaul Beesley where XXXX is the year of first contribution (if different to YYYY) and 5940d553cfSPaul Beesley YYYY is the year of most recent contribution. <OWNER> is your name or 6040d553cfSPaul Beesley your company name. 613d28b0a4SSandrine Bailleux - If you are submitting new files that you intend to be the code owner for 623d28b0a4SSandrine Bailleux (for example, a new platform port), then also update the 633d28b0a4SSandrine Bailleux :ref:`code owners` file. 6440d553cfSPaul Beesley - For topics with multiple commits, you should make all documentation 6540d553cfSPaul Beesley changes (and nothing else) in the last commit of the series. Otherwise, 6640d553cfSPaul Beesley include the documentation changes within the single commit. 6740d553cfSPaul Beesley 6840d553cfSPaul Beesley- Please test your changes. As a minimum, ensure that Linux boots on the 6943f35ef5SPaul Beesley Foundation FVP. See :ref:`Arm Fixed Virtual Platforms (FVP)` for more 7043f35ef5SPaul Beesley information. For more extensive testing, consider running the `TF-A Tests`_ 7143f35ef5SPaul Beesley against your patches. 7240d553cfSPaul Beesley 7340d553cfSPaul BeesleySubmitting Changes 7440d553cfSPaul Beesley------------------ 7540d553cfSPaul Beesley 7640d553cfSPaul Beesley- Ensure that each commit in the series has at least one ``Signed-off-by:`` 7740d553cfSPaul Beesley line, using your real name and email address. The names in the 7840d553cfSPaul Beesley ``Signed-off-by:`` and ``Author:`` lines must match. If anyone else 7940d553cfSPaul Beesley contributes to the commit, they must also add their own ``Signed-off-by:`` 8040d553cfSPaul Beesley line. By adding this line the contributor certifies the contribution is made 8134760951SPaul Beesley under the terms of the 8234760951SPaul Beesley :download:`Developer Certificate of Origin <../../dco.txt>`. 8340d553cfSPaul Beesley 8440d553cfSPaul Beesley More details may be found in the `Gerrit Signed-off-by Lines guidelines`_. 8540d553cfSPaul Beesley 8640d553cfSPaul Beesley- Ensure that each commit also has a unique ``Change-Id:`` line. If you have 8740d553cfSPaul Beesley cloned the repository with the "`Clone with commit-msg hook`" clone method 8843f35ef5SPaul Beesley (following the :ref:`Prerequisites` document), this should already be the 8943f35ef5SPaul Beesley case. 9040d553cfSPaul Beesley 9140d553cfSPaul Beesley More details may be found in the `Gerrit Change-Ids documentation`_. 9240d553cfSPaul Beesley 9340d553cfSPaul Beesley- Submit your changes for review at https://review.trustedfirmware.org 9440d553cfSPaul Beesley targeting the ``integration`` branch. 9540d553cfSPaul Beesley 9640d553cfSPaul Beesley - The changes will then undergo further review and testing by the 973d28b0a4SSandrine Bailleux :ref:`code owners` and :ref:`maintainers`. Any review comments will be 983d28b0a4SSandrine Bailleux made directly on your patch. This may require you to do some rework. For 993d28b0a4SSandrine Bailleux controversial changes, the discussion might be moved to the `TF-A mailing 1003d28b0a4SSandrine Bailleux list`_ to involve more of the community. 10140d553cfSPaul Beesley 10240d553cfSPaul Beesley Refer to the `Gerrit Uploading Changes documentation`_ for more details. 10340d553cfSPaul Beesley 10434760951SPaul Beesley- When the changes are accepted, the :ref:`maintainers` will integrate them. 10540d553cfSPaul Beesley 10634760951SPaul Beesley - Typically, the :ref:`maintainers` will merge the changes into the 10740d553cfSPaul Beesley ``integration`` branch. 10840d553cfSPaul Beesley - If the changes are not based on a sufficiently-recent commit, or if they 10934760951SPaul Beesley cannot be automatically rebased, then the :ref:`maintainers` may rebase it 1103d28b0a4SSandrine Bailleux on the ``integration`` branch or ask you to do so. 11140d553cfSPaul Beesley - After final integration testing, the changes will make their way into the 1123d28b0a4SSandrine Bailleux ``master`` branch. If a problem is found during integration, the 1133d28b0a4SSandrine Bailleux :ref:`maintainers` will request your help to solve the issue. They may 1143d28b0a4SSandrine Bailleux revert your patches and ask you to resubmit a reworked version of them or 1153d28b0a4SSandrine Bailleux they may ask you to provide a fix-up patch. 11640d553cfSPaul Beesley 11740d553cfSPaul BeesleyBinary Components 11840d553cfSPaul Beesley----------------- 11940d553cfSPaul Beesley 12040d553cfSPaul Beesley- Platforms may depend on binary components submitted to the `Trusted Firmware 12140d553cfSPaul Beesley binary repository`_ if they require code that the contributor is unable or 12240d553cfSPaul Beesley unwilling to open-source. This should be used as a rare exception. 12340d553cfSPaul Beesley- All binary components must follow the contribution guidelines (in particular 12440d553cfSPaul Beesley licensing rules) outlined in the `readme.rst <tf-binaries-readme_>`_ file of 12540d553cfSPaul Beesley the binary repository. 12640d553cfSPaul Beesley- Binary components must be restricted to only the specific functionality that 12740d553cfSPaul Beesley cannot be open-sourced and must be linked into a larger open-source platform 12840d553cfSPaul Beesley port. The majority of the platform port must still be implemented in open 12940d553cfSPaul Beesley source. Platform ports that are merely a thin wrapper around a binary 13040d553cfSPaul Beesley component that contains all the actual code will not be accepted. 13140d553cfSPaul Beesley- Only platform port code (i.e. in the ``plat/<vendor>`` directory) may rely on 13240d553cfSPaul Beesley binary components. Generic code must always be fully open-source. 13340d553cfSPaul Beesley 13440d553cfSPaul Beesley-------------- 13540d553cfSPaul Beesley 136e63f5d12SPaul Beesley*Copyright (c) 2013-2020, Arm Limited and Contributors. All rights reserved.* 13740d553cfSPaul Beesley 13840d553cfSPaul Beesley.. _developer.trustedfirmware.org: https://developer.trustedfirmware.org 1393d28b0a4SSandrine Bailleux.. _review.trustedfirmware.org: https://review.trustedfirmware.org 14040d553cfSPaul Beesley.. _issue: https://developer.trustedfirmware.org/project/board/1/ 141f6ad51c8SJohn Tsichritzis.. _Trusted Firmware-A: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git 14240d553cfSPaul Beesley.. _Git guidelines: http://git-scm.com/book/ch5-2.html 14340d553cfSPaul Beesley.. _Gerrit Uploading Changes documentation: https://review.trustedfirmware.org/Documentation/user-upload.html 14440d553cfSPaul Beesley.. _Gerrit Signed-off-by Lines guidelines: https://review.trustedfirmware.org/Documentation/user-signedoffby.html 14540d553cfSPaul Beesley.. _Gerrit Change-Ids documentation: https://review.trustedfirmware.org/Documentation/user-changeid.html 1463d28b0a4SSandrine Bailleux.. _TF-A Tests: https://trustedfirmware-a-tests.readthedocs.io 14740d553cfSPaul Beesley.. _Trusted Firmware binary repository: https://review.trustedfirmware.org/admin/repos/tf-binaries 14840d553cfSPaul Beesley.. _tf-binaries-readme: https://git.trustedfirmware.org/tf-binaries.git/tree/readme.rst 1493d28b0a4SSandrine Bailleux.. _TF-A mailing list: https://lists.trustedfirmware.org/mailman/listinfo/tf-a 150