xref: /aosp_15_r20/external/dtc/CONTRIBUTING.md (revision cd60bc56d4bea3af4ec04523e4d71c2b272c8aff)
1*cd60bc56SAndroid Build Coastguard Worker# Contributing to dtc or libfdt
2*cd60bc56SAndroid Build Coastguard Worker
3*cd60bc56SAndroid Build Coastguard WorkerThere are two ways to submit changes for dtc or libfdt:
4*cd60bc56SAndroid Build Coastguard Worker
5*cd60bc56SAndroid Build Coastguard Worker* Post patches directly to the the
6*cd60bc56SAndroid Build Coastguard Worker  [devicetree-compiler](mailto:[email protected])
7*cd60bc56SAndroid Build Coastguard Worker  mailing list.
8*cd60bc56SAndroid Build Coastguard Worker* Submit pull requests via
9*cd60bc56SAndroid Build Coastguard Worker  [Github](https://github.com/dgibson/dtc/pulls)
10*cd60bc56SAndroid Build Coastguard Worker
11*cd60bc56SAndroid Build Coastguard Worker## Adding a new function to libfdt.h
12*cd60bc56SAndroid Build Coastguard Worker
13*cd60bc56SAndroid Build Coastguard WorkerThe shared library uses `libfdt/version.lds` to list the exported
14*cd60bc56SAndroid Build Coastguard Workerfunctions, so add your new function there. Check that your function
15*cd60bc56SAndroid Build Coastguard Workerworks with pylibfdt. If it cannot be supported, put the declaration in
16*cd60bc56SAndroid Build Coastguard Worker`libfdt.h` behind `#ifndef SWIG` so that swig ignores it.
17*cd60bc56SAndroid Build Coastguard Worker
18*cd60bc56SAndroid Build Coastguard Worker## Tests
19*cd60bc56SAndroid Build Coastguard Worker
20*cd60bc56SAndroid Build Coastguard WorkerTest files are kept in the `tests/` directory. Use `make check` to build and run
21*cd60bc56SAndroid Build Coastguard Workerall tests.
22*cd60bc56SAndroid Build Coastguard Worker
23*cd60bc56SAndroid Build Coastguard WorkerIf you want to adjust a test file, be aware that `tree_tree1.dts` is compiled
24*cd60bc56SAndroid Build Coastguard Workerand checked against a binary tree from assembler macros in `trees.S`. So
25*cd60bc56SAndroid Build Coastguard Workerif you change that file you must change `tree.S` also.
26*cd60bc56SAndroid Build Coastguard Worker
27*cd60bc56SAndroid Build Coastguard Worker## Developer's Certificate of Origin
28*cd60bc56SAndroid Build Coastguard Worker
29*cd60bc56SAndroid Build Coastguard WorkerLike many other projects, dtc and libfdt have adopted the "Developer's
30*cd60bc56SAndroid Build Coastguard WorkerCertificate of Origin" (Signed-off-by) process created by the Linux
31*cd60bc56SAndroid Build Coastguard Workerkernel community to improve tracking of who did what.  Here's how it
32*cd60bc56SAndroid Build Coastguard Workerworks (this is a very slight modification of the description from
33*cd60bc56SAndroid Build Coastguard Worker`Documentation/process/submitting-patches.rst` in the kernel tree):
34*cd60bc56SAndroid Build Coastguard Worker
35*cd60bc56SAndroid Build Coastguard WorkerThe sign-off is a simple line at the end of the explanation for the
36*cd60bc56SAndroid Build Coastguard Workerpatch, which certifies that you wrote it or otherwise have the right
37*cd60bc56SAndroid Build Coastguard Workerto pass it on as an open-source patch.  The rules are pretty simple:
38*cd60bc56SAndroid Build Coastguard Workerif you can certify the below:
39*cd60bc56SAndroid Build Coastguard Worker
40*cd60bc56SAndroid Build Coastguard Worker    Developer's Certificate of Origin 1.1
41*cd60bc56SAndroid Build Coastguard Worker
42*cd60bc56SAndroid Build Coastguard Worker    By making a contribution to this project, I certify that:
43*cd60bc56SAndroid Build Coastguard Worker
44*cd60bc56SAndroid Build Coastguard Worker        (a) The contribution was created in whole or in part by me and I
45*cd60bc56SAndroid Build Coastguard Worker            have the right to submit it under the open source license
46*cd60bc56SAndroid Build Coastguard Worker            indicated in the file; or
47*cd60bc56SAndroid Build Coastguard Worker
48*cd60bc56SAndroid Build Coastguard Worker        (b) The contribution is based upon previous work that, to the best
49*cd60bc56SAndroid Build Coastguard Worker            of my knowledge, is covered under an appropriate open source
50*cd60bc56SAndroid Build Coastguard Worker            license and I have the right under that license to submit that
51*cd60bc56SAndroid Build Coastguard Worker            work with modifications, whether created in whole or in part
52*cd60bc56SAndroid Build Coastguard Worker            by me, under the same open source license (unless I am
53*cd60bc56SAndroid Build Coastguard Worker            permitted to submit under a different license), as indicated
54*cd60bc56SAndroid Build Coastguard Worker            in the file; or
55*cd60bc56SAndroid Build Coastguard Worker
56*cd60bc56SAndroid Build Coastguard Worker        (c) The contribution was provided directly to me by some other
57*cd60bc56SAndroid Build Coastguard Worker            person who certified (a), (b) or (c) and I have not modified
58*cd60bc56SAndroid Build Coastguard Worker            it.
59*cd60bc56SAndroid Build Coastguard Worker
60*cd60bc56SAndroid Build Coastguard Worker        (d) I understand and agree that this project and the contribution
61*cd60bc56SAndroid Build Coastguard Worker            are public and that a record of the contribution (including all
62*cd60bc56SAndroid Build Coastguard Worker            personal information I submit with it, including my sign-off) is
63*cd60bc56SAndroid Build Coastguard Worker            maintained indefinitely and may be redistributed consistent with
64*cd60bc56SAndroid Build Coastguard Worker            this project or the open source license(s) involved.
65*cd60bc56SAndroid Build Coastguard Worker
66*cd60bc56SAndroid Build Coastguard Workerthen you just add a line saying::
67*cd60bc56SAndroid Build Coastguard Worker
68*cd60bc56SAndroid Build Coastguard Worker	Signed-off-by: Random J Developer <[email protected]>
69*cd60bc56SAndroid Build Coastguard Worker
70*cd60bc56SAndroid Build Coastguard Workerusing your real name (sorry, no pseudonyms or anonymous
71*cd60bc56SAndroid Build Coastguard Workercontributions.)  This will be done for you automatically if you use
72*cd60bc56SAndroid Build Coastguard Worker`git commit -s`.  Reverts should also include "Signed-off-by". `git
73*cd60bc56SAndroid Build Coastguard Workerrevert -s` does that for you.
74*cd60bc56SAndroid Build Coastguard Worker
75*cd60bc56SAndroid Build Coastguard WorkerAny further SoBs (Signed-off-by:'s) following the author's SoB are
76*cd60bc56SAndroid Build Coastguard Workerfrom people handling and transporting the patch, but were not involved
77*cd60bc56SAndroid Build Coastguard Workerin its development. SoB chains should reflect the **real** route a
78*cd60bc56SAndroid Build Coastguard Workerpatch took as it was propagated to the maintainers, with the first SoB
79*cd60bc56SAndroid Build Coastguard Workerentry signalling primary authorship of a single author.
80