0506-BCM270X-Add-an-overlay-for-enabling-the-vc4-driver-i.patch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. From 5395497a794d793f9657e3317634ad8e5003277f Mon Sep 17 00:00:00 2001
  2. From: Eric Anholt <eric@anholt.net>
  3. Date: Wed, 14 Sep 2016 08:52:26 +0100
  4. Subject: [PATCH] BCM270X: Add an overlay for enabling the vc4 driver in
  5. firmware-KMS mode.
  6. This gets us normal 3D support on top of the existing firmware display
  7. stack. There's no real modesetting support, no async pageflips
  8. (hurting performance), etc., but it means that the desktop can at
  9. least run until we get full native modesetting.
  10. Signed-off-by: Eric Anholt <eric@anholt.net>
  11. ---
  12. arch/arm/boot/dts/bcm2708_common.dtsi | 31 +++++---
  13. arch/arm/boot/dts/overlays/Makefile | 1 +
  14. arch/arm/boot/dts/overlays/README | 11 +++
  15. .../arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts | 89 ++++++++++++++++++++++
  16. 4 files changed, 121 insertions(+), 11 deletions(-)
  17. create mode 100644 arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts
  18. --- a/arch/arm/boot/dts/bcm2708_common.dtsi
  19. +++ b/arch/arm/boot/dts/bcm2708_common.dtsi
  20. @@ -284,6 +284,26 @@
  21. status = "disabled";
  22. };
  23. + firmwarekms: firmwarekms@7e600000 {
  24. + compatible = "raspberrypi,rpi-firmware-kms";
  25. + /* SMI interrupt reg */
  26. + reg = <0x7e600000 0x100>;
  27. + interrupts = <2 16>;
  28. + brcm,firmware = <&firmware>;
  29. + status = "disabled";
  30. + };
  31. +
  32. + smi: smi@7e600000 {
  33. + compatible = "brcm,bcm2835-smi";
  34. + reg = <0x7e600000 0x44>, <0x7e1010b0 0x8>;
  35. + interrupts = <2 16>;
  36. + brcm,smi-clock-source = <6>;
  37. + brcm,smi-clock-divisor = <4>;
  38. + dmas = <&dma 4>;
  39. + dma-names = "rx-tx";
  40. + status = "disabled";
  41. + };
  42. +
  43. dsi1: dsi@7e700000 {
  44. #address-cells = <1>;
  45. #size-cells = <0>;
  46. @@ -325,17 +345,6 @@
  47. status = "disabled";
  48. };
  49. - smi: smi@7e600000 {
  50. - compatible = "brcm,bcm2835-smi";
  51. - reg = <0x7e600000 0x44>, <0x7e1010b0 0x8>;
  52. - interrupts = <2 16>;
  53. - brcm,smi-clock-source = <6>;
  54. - brcm,smi-clock-divisor = <4>;
  55. - dmas = <&dma 4>;
  56. - dma-names = "rx-tx";
  57. - status = "disabled";
  58. - };
  59. -
  60. pixelvalve2: pixelvalve@7e807000 {
  61. compatible = "brcm,bcm2835-pixelvalve2";
  62. reg = <0x7e807000 0x100>;
  63. --- a/arch/arm/boot/dts/overlays/Makefile
  64. +++ b/arch/arm/boot/dts/overlays/Makefile
  65. @@ -96,6 +96,7 @@ dtbo-$(RPI_DT_OVERLAYS) += spi2-2cs.dtbo
  66. dtbo-$(RPI_DT_OVERLAYS) += spi2-3cs.dtbo
  67. dtbo-$(RPI_DT_OVERLAYS) += tinylcd35.dtbo
  68. dtbo-$(RPI_DT_OVERLAYS) += uart1.dtbo
  69. +dtbo-$(RPI_DT_OVERLAYS) += vc4-fkms-v3d.dtbo
  70. dtbo-$(RPI_DT_OVERLAYS) += vc4-kms-v3d.dtbo
  71. dtbo-$(RPI_DT_OVERLAYS) += vga666.dtbo
  72. dtbo-$(RPI_DT_OVERLAYS) += w1-gpio.dtbo
  73. --- a/arch/arm/boot/dts/overlays/README
  74. +++ b/arch/arm/boot/dts/overlays/README
  75. @@ -1215,6 +1215,17 @@ Params: txd1_pin GPIO pin
  76. rxd1_pin GPIO pin for RXD1 (15, 33 or 41 - default 15)
  77. +Name: vc4-fkms-v3d
  78. +Info: Enable Eric Anholt's DRM VC4 V3D driver on top of the dispmanx
  79. + display stack.
  80. +Load: dtoverlay=vc4-fkms-v3d,<param>
  81. +Params: cma-256 CMA is 256MB, 256MB-aligned (needs 1GB)
  82. + cma-192 CMA is 192MB, 256MB-aligned (needs 1GB)
  83. + cma-128 CMA is 128MB, 128MB-aligned
  84. + cma-96 CMA is 96MB, 128MB-aligned
  85. + cma-64 CMA is 64MB, 64MB-aligned
  86. +
  87. +
  88. Name: vc4-kms-v3d
  89. Info: Enable Eric Anholt's DRM VC4 HDMI/HVS/V3D driver. Running startx or
  90. booting to GUI while this overlay is in use will cause interesting
  91. --- /dev/null
  92. +++ b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts
  93. @@ -0,0 +1,89 @@
  94. +/*
  95. + * vc4-fkms-v3d-overlay.dts
  96. + */
  97. +
  98. +/dts-v1/;
  99. +/plugin/;
  100. +
  101. +/ {
  102. + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
  103. +
  104. + fragment@0 {
  105. + target-path = "/chosen";
  106. + __overlay__ {
  107. + bootargs = "cma=256M@256M";
  108. + };
  109. + };
  110. +
  111. + fragment@1 {
  112. + target-path = "/chosen";
  113. + __dormant__ {
  114. + bootargs = "cma=192M@256M";
  115. + };
  116. + };
  117. +
  118. + fragment@2 {
  119. + target-path = "/chosen";
  120. + __dormant__ {
  121. + bootargs = "cma=128M@128M";
  122. + };
  123. + };
  124. +
  125. + fragment@3 {
  126. + target-path = "/chosen";
  127. + __dormant__ {
  128. + bootargs = "cma=96M@128M";
  129. + };
  130. + };
  131. +
  132. + fragment@4 {
  133. + target-path = "/chosen";
  134. + __dormant__ {
  135. + bootargs = "cma=64M@64M";
  136. + };
  137. + };
  138. +
  139. + fragment@5 {
  140. + target = <&fb>;
  141. + __overlay__ {
  142. + status = "disabled";
  143. + };
  144. + };
  145. +
  146. + fragment@6 {
  147. + target = <&firmwarekms>;
  148. + __overlay__ {
  149. + status = "okay";
  150. + };
  151. + };
  152. +
  153. + fragment@7 {
  154. + target = <&v3d>;
  155. + __overlay__ {
  156. + interrupts = <1 10>;
  157. + status = "okay";
  158. + };
  159. + };
  160. +
  161. + fragment@8 {
  162. + target = <&gpu>;
  163. + __overlay__ {
  164. + status = "okay";
  165. + };
  166. + };
  167. +
  168. + fragment@9 {
  169. + target-path = "/soc/dma";
  170. + __overlay__ {
  171. + brcm,dma-channel-mask = <0x7f35>;
  172. + };
  173. + };
  174. +
  175. + __overrides__ {
  176. + cma-256 = <0>,"+0-1-2-3-4";
  177. + cma-192 = <0>,"-0+1-2-3-4";
  178. + cma-128 = <0>,"-0-1+2-3-4";
  179. + cma-96 = <0>,"-0-1-2+3-4";
  180. + cma-64 = <0>,"-0-1-2-3+4";
  181. + };
  182. +};