maintainer-soc.rst 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. .. SPDX-License-Identifier: GPL-2.0
  2. =============
  3. SoC Subsystem
  4. =============
  5. Overview
  6. --------
  7. The SoC subsystem is a place of aggregation for SoC-specific code.
  8. The main components of the subsystem are:
  9. * devicetrees (DTS) for 32- & 64-bit ARM and RISC-V
  10. * 32-bit ARM board files (arch/arm/mach*)
  11. * 32- & 64-bit ARM defconfigs
  12. * SoC-specific drivers across architectures, in particular for 32- & 64-bit
  13. ARM, RISC-V and Loongarch
  14. These "SoC-specific drivers" do not include clock, GPIO etc drivers that have
  15. other top-level maintainers. The drivers/soc/ directory is generally meant
  16. for kernel-internal drivers that are used by other drivers to provide SoC-
  17. specific functionality like identifying an SoC revision or interfacing with
  18. power domains.
  19. The SoC subsystem also serves as an intermediate location for changes to
  20. drivers/bus, drivers/firmware, drivers/reset and drivers/memory. The addition
  21. of new platforms, or the removal of existing ones, often go through the SoC
  22. tree as a dedicated branch covering multiple subsystems.
  23. The main SoC tree is housed on git.kernel.org:
  24. https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/
  25. Maintainers
  26. -----------
  27. Clearly this is quite a wide range of topics, which no one person, or even
  28. small group of people are capable of maintaining. Instead, the SoC subsystem
  29. is comprised of many submaintainers (platform maintainers), each taking care of
  30. individual platforms and driver subdirectories.
  31. In this regard, "platform" usually refers to a series of SoCs from a given
  32. vendor, for example, Nvidia's series of Tegra SoCs. Many submaintainers operate
  33. on a vendor level, responsible for multiple product lines. For several reasons,
  34. including acquisitions/different business units in a company, things vary
  35. significantly here. The various submaintainers are documented in the
  36. MAINTAINERS file.
  37. Most of these submaintainers have their own trees where they stage patches,
  38. sending pull requests to the main SoC tree. These trees are usually, but not
  39. always, listed in MAINTAINERS.
  40. What the SoC tree is not, however, is a location for architecture-specific code
  41. changes. Each architecture has its own maintainers that are responsible for
  42. architectural details, CPU errata and the like.
  43. Submitting Patches for Given SoC
  44. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  45. All typical platform related patches should be sent via SoC submaintainers
  46. (platform-specific maintainers). This includes also changes to per-platform or
  47. shared defconfigs. Note that scripts/get_maintainer.pl might not provide
  48. correct addresses for the shared defconfig, so ignore its output and manually
  49. create CC-list based on MAINTAINERS file or use something like
  50. ``scripts/get_maintainer.pl -f drivers/soc/FOO/``).
  51. Submitting Patches to the Main SoC Maintainers
  52. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  53. The main SoC maintainers can be reached via the alias soc@kernel.org only in
  54. following cases:
  55. 1. There are no platform-specific maintainers.
  56. 2. Platform-specific maintainers are unresponsive.
  57. 3. Introducing a completely new SoC platform. Such new SoC work should be sent
  58. first to common mailing lists, pointed out by scripts/get_maintainer.pl, for
  59. community review. After positive community review, work should be sent to
  60. soc@kernel.org in one patchset containing new arch/foo/Kconfig entry, DTS
  61. files, MAINTAINERS file entry and optionally initial drivers with their
  62. Devicetree bindings. The MAINTAINERS file entry should list new
  63. platform-specific maintainers, who are going to be responsible for handling
  64. patches for the platform from now on.
  65. Note that the soc@kernel.org is usually not the place to discuss the patches,
  66. thus work sent to this address should be already considered as acceptable by
  67. the community.
  68. Information for (new) Submaintainers
  69. ------------------------------------
  70. As new platforms spring up, they often bring with them new submaintainers,
  71. many of whom work for the silicon vendor, and may not be familiar with the
  72. process.
  73. Devicetree ABI Stability
  74. ~~~~~~~~~~~~~~~~~~~~~~~~
  75. Perhaps one of the most important things to highlight is that dt-bindings
  76. document the ABI between the devicetree and the kernel.
  77. Please read Documentation/devicetree/bindings/ABI.rst.
  78. If changes are being made to a DTS that are incompatible with old
  79. kernels, the DTS patch should not be applied until the driver is, or an
  80. appropriate time later. Most importantly, any incompatible changes should be
  81. clearly pointed out in the patch description and pull request, along with the
  82. expected impact on existing users, such as bootloaders or other operating
  83. systems.
  84. Driver Branch Dependencies
  85. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  86. A common problem is synchronizing changes between device drivers and devicetree
  87. files. Even if a change is compatible in both directions, this may require
  88. coordinating how the changes get merged through different maintainer trees.
  89. Usually the branch that includes a driver change will also include the
  90. corresponding change to the devicetree binding description, to ensure they are
  91. in fact compatible. This means that the devicetree branch can end up causing
  92. warnings in the ``make dtbs_check`` step. If a devicetree change depends on
  93. missing additions to a header file in include/dt-bindings/, it will fail the
  94. ``make dtbs`` step and not get merged.
  95. There are multiple ways to deal with this:
  96. * Avoid defining custom macros in include/dt-bindings/ for hardware constants
  97. that can be derived from a datasheet -- binding macros in header files should
  98. only be used as a last resort if there is no natural way to define a binding
  99. * Use literal values in the devicetree file in place of macros even when a
  100. header is required, and change them to the named representation in a
  101. following release
  102. * Defer the devicetree changes to a release after the binding and driver have
  103. already been merged
  104. * Change the bindings in a shared immutable branch that is used as the base for
  105. both the driver change and the devicetree changes
  106. * Add duplicate defines in the devicetree file guarded by an #ifndef section,
  107. removing them in a later release
  108. Devicetree Naming Convention
  109. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  110. The general naming scheme for devicetree files is as follows. The aspects of a
  111. platform that are set at the SoC level, like CPU cores, are contained in a file
  112. named $soc.dtsi, for example, jh7100.dtsi. Integration details, that will vary
  113. from board to board, are described in $soc-$board.dts. An example of this is
  114. jh7100-beaglev-starlight.dts. Often many boards are variations on a theme, and
  115. frequently there are intermediate files, such as jh7100-common.dtsi, which sit
  116. between the $soc.dtsi and $soc-$board.dts files, containing the descriptions of
  117. common hardware.
  118. Some platforms also have System on Modules, containing an SoC, which are then
  119. integrated into several different boards. For these platforms, $soc-$som.dtsi
  120. and $soc-$som-$board.dts are typical.
  121. Directories are usually named after the vendor of the SoC at the time of its
  122. inclusion, leading to some historical directory names in the tree.
  123. Validating Devicetree Files
  124. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  125. ``make dtbs_check`` can be used to validate that devicetree files are compliant
  126. with the dt-bindings that describe the ABI. Please read the section
  127. "Running checks" of Documentation/devicetree/bindings/writing-schema.rst for
  128. more information on the validation of devicetrees.
  129. For new platforms, or additions to existing ones, ``make dtbs_check`` should not
  130. add any new warnings. For RISC-V and Samsung SoC, ``make dtbs_check W=1`` is
  131. required to not add any new warnings.
  132. If in any doubt about a devicetree change, reach out to the devicetree
  133. maintainers.
  134. Branches and Pull Requests
  135. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  136. Just as the main SoC tree has several branches, it is expected that
  137. submaintainers will do the same. Driver, defconfig and devicetree changes should
  138. all be split into separate branches and appear in separate pull requests to the
  139. SoC maintainers. Each branch should be usable by itself and avoid
  140. regressions that originate from dependencies on other branches.
  141. Small sets of patches can also be sent as separate emails to soc@kernel.org,
  142. grouped into the same categories.
  143. If changes do not fit into the normal patterns, there can be additional
  144. top-level branches, e.g. for a treewide rework, or the addition of new SoC
  145. platforms including dts files and drivers.
  146. Branches with a lot of changes can benefit from getting split up into separate
  147. topics branches, even if they end up getting merged into the same branch of the
  148. SoC tree. An example here would be one branch for devicetree warning fixes, one
  149. for a rework and one for newly added boards.
  150. Another common way to split up changes is to send an early pull request with the
  151. majority of the changes at some point between rc1 and rc4, following up with one
  152. or more smaller pull requests towards the end of the cycle that can add late
  153. changes or address problems identified while testing the first set.
  154. While there is no cut-off time for late pull requests, it helps to only send
  155. small branches as time gets closer to the merge window.
  156. Pull requests for bugfixes for the current release can be sent at any time, but
  157. again having multiple smaller branches is better than trying to combine too many
  158. patches into one pull request.
  159. The subject line of a pull request should begin with "[GIT PULL]" and made using
  160. a signed tag, rather than a branch. This tag should contain a short description
  161. summarising the changes in the pull request. For more detail on sending pull
  162. requests, please see Documentation/maintainer/pull-requests.rst.