Guest User

Vivax-TPC9150.patch

a guest
Mar 26th, 2021
34
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
  2. index 6d1e8668..a209534d 100644
  3. --- a/arch/arm/dts/Makefile
  4. +++ b/arch/arm/dts/Makefile
  5. @@ -493,6 +493,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
  6. sun7i-a20-pcduino3.dtb \
  7. sun7i-a20-pcduino3-nano.dtb \
  8. sun7i-a20-primo73.dtb \
  9. + sun7i-a20-tpc9150.dtb \
  10. sun7i-a20-wexler-tab7200.dtb \
  11. sun7i-a20-wits-pro-a20-dkt.dtb \
  12. sun7i-a20-yones-toptech-bd1078.dtb
  13. diff --git a/arch/arm/dts/sun7i-a20-tpc9150.dts b/arch/arm/dts/sun7i-a20-tpc9150.dts
  14. new file mode 100644
  15. index 00000000..73519d0b
  16. --- /dev/null
  17. +++ b/arch/arm/dts/sun7i-a20-tpc9150.dts
  18. @@ -0,0 +1,219 @@
  19. +/*
  20. + * Copyright 2020 Nikola Pavlica <pavlica.nikola@xxxxxxxxx>
  21. + *
  22. + * This file is dual-licensed: you can use it either under the terms
  23. + * of the GPL or the X11 license, at your option. Note that this dual
  24. + * licensing only applies to this file, and not this project as a
  25. + * whole.
  26. + *
  27. + * a) This library is free software; you can redistribute it and/or
  28. + * modify it under the terms of the GNU General Public License as
  29. + * published by the Free Software Foundation; either version 2 of the
  30. + * License, or (at your option) any later version.
  31. + *
  32. + * This library is distributed in the hope that it will be useful,
  33. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  34. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  35. + * GNU General Public License for more details.
  36. + *
  37. + * You should have received a copy of the GNU General Public
  38. + * License along with this library; if not, write to the Free
  39. + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
  40. + * MA 02110-1301 USA
  41. + *
  42. + * Or, alternatively,
  43. + *
  44. + * b) Permission is hereby granted, free of charge, to any person
  45. + * obtaining a copy of this software and associated documentation
  46. + * files (the "Software"), to deal in the Software without
  47. + * restriction, including without limitation the rights to use,
  48. + * copy, modify, merge, publish, distribute, sublicense, and/or
  49. + * sell copies of the Software, and to permit persons to whom the
  50. + * Software is furnished to do so, subject to the following
  51. + * conditions:
  52. + *
  53. + * The above copyright notice and this permission notice shall be
  54. + * included in all copies or substantial portions of the Software.
  55. + *
  56. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  57. + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  58. + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  59. + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  60. + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  61. + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  62. + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  63. + * OTHER DEALINGS IN THE SOFTWARE.
  64. + */
  65. +
  66. +/dts-v1/;
  67. +#include "sun7i-a20.dtsi"
  68. +#include "sunxi-common-regulators.dtsi"
  69. +
  70. +#include <dt-bindings/gpio/gpio.h>
  71. +#include <dt-bindings/input/input.h>
  72. +#include <dt-bindings/interrupt-controller/irq.h>
  73. +#include <dt-bindings/pwm/pwm.h>
  74. +
  75. +/ {
  76. + model = "Vivax TPC-9150 tablet";
  77. + compatible = "vivax,tpc9150", "allwinner,sun7i-a20";
  78. +
  79. + aliases {
  80. + serial0 = &uart0;
  81. + };
  82. +
  83. + backlight {
  84. + compatible = "pwm-backlight";
  85. + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
  86. + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
  87. + default-brightness-level = <8>;
  88. + enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
  89. + };
  90. +
  91. + chosen {
  92. + stdout-path = "serial0:115200n8";
  93. + };
  94. +};
  95. +
  96. +&codec {
  97. + allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
  98. + status = "okay";
  99. +};
  100. +
  101. +&cpu0 {
  102. + cpu-supply = <&reg_dcdc2>;
  103. +};
  104. +
  105. +&ehci0 {
  106. + status = "okay";
  107. +};
  108. +
  109. +&ehci1 {
  110. + status = "okay";
  111. +};
  112. +
  113. +&i2c0 {
  114. + status = "okay";
  115. +
  116. + axp209: pmic@34 {
  117. + reg = <0x34>;
  118. + interrupt-parent = <&nmi_intc>;
  119. + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  120. + };
  121. +};
  122. +
  123. +#include "axp209.dtsi"
  124. +
  125. +&i2c1 {
  126. + status = "okay";
  127. +};
  128. +
  129. +&i2c2 {
  130. + status = "okay";
  131. +
  132. + ft5x: touchscreen@38 {
  133. + compatible = "edt,edt-ft5406";
  134. + reg = <0x38>;
  135. + interrupt-parent = <&pio>;
  136. + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
  137. + wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */
  138. + touchscreen-size-x = <600>;
  139. + touchscreen-size-y = <1024>;
  140. + };
  141. +};
  142. +
  143. +&lradc {
  144. + vref-supply = <&reg_vcc3v0>;
  145. + status = "okay";
  146. +};
  147. +
  148. +&mmc0 {
  149. + vmmc-supply = <&reg_vcc3v3>;
  150. + bus-width = <4>;
  151. + cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
  152. + status = "okay";
  153. +};
  154. +
  155. +&ohci0 {
  156. + status = "okay";
  157. +};
  158. +
  159. +&ohci1 {
  160. + status = "okay";
  161. +};
  162. +
  163. +&otg_sram {
  164. + status = "okay";
  165. +};
  166. +
  167. +&pio {
  168. + usb0_id_detect_pin: usb0-id-detect-pin {
  169. + pins = "PH4";
  170. + function = "gpio_in";
  171. + bias-pull-up;
  172. + };
  173. +};
  174. +
  175. +&reg_dcdc2 {
  176. + regulator-always-on;
  177. + regulator-min-microvolt = <1000000>;
  178. + regulator-max-microvolt = <1400000>;
  179. + regulator-name = "vdd-cpu";
  180. +};
  181. +
  182. +&reg_dcdc3 {
  183. + regulator-always-on;
  184. + regulator-min-microvolt = <1000000>;
  185. + regulator-max-microvolt = <1250000>;
  186. + regulator-name = "vdd-int-dll";
  187. +};
  188. +
  189. +&reg_ldo1 {
  190. + regulator-name = "vdd-rtc";
  191. +};
  192. +
  193. +&reg_ldo2 {
  194. + regulator-always-on;
  195. + regulator-min-microvolt = <3000000>;
  196. + regulator-max-microvolt = <3000000>;
  197. + regulator-name = "avcc";
  198. +};
  199. +
  200. +&reg_usb0_vbus {
  201. + status = "okay";
  202. +};
  203. +
  204. +&reg_usb1_vbus {
  205. + status = "okay";
  206. +};
  207. +
  208. +&reg_usb2_vbus {
  209. + status = "okay";
  210. +};
  211. +
  212. +&uart0 {
  213. + pinctrl-names = "default";
  214. + pinctrl-0 = <&uart0_pb_pins>;
  215. + status = "okay";
  216. +};
  217. +
  218. +&usb_otg {
  219. + dr_mode = "otg";
  220. + status = "okay";
  221. +};
  222. +
  223. +&usb_power_supply {
  224. + status = "okay";
  225. +};
  226. +
  227. +&usbphy {
  228. + pinctrl-names = "default";
  229. + pinctrl-0 = <&usb0_id_detect_pin>;
  230. + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  231. + usb0_vbus_power-supply = <&usb_power_supply>;
  232. + usb0_vbus-supply = <&reg_usb0_vbus>;
  233. + usb1_vbus-supply = <&reg_usb1_vbus>;
  234. + usb2_vbus-supply = <&reg_usb2_vbus>;
  235. + status = "okay";
  236. +};
  237. +
  238. diff --git a/configs/Vivax_TPC9150_defconfig b/configs/Vivax_TPC9150_defconfig
  239. new file mode 100644
  240. index 00000000..5785e829
  241. --- /dev/null
  242. +++ b/configs/Vivax_TPC9150_defconfig
  243. @@ -0,0 +1,13 @@
  244. +CONFIG_ARM=y
  245. +CONFIG_ARCH_SUNXI=y
  246. +CONFIG_SPL=y
  247. +CONFIG_MACH_SUN7I=y
  248. +CONFIG_DRAM_CLK=384
  249. +CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:60000,le:60,ri:160,up:13,lo:12,hs:100,vs:10,sync:3,vmode:0"
  250. +CONFIG_VIDEO_LCD_DCLK_PHASE=0
  251. +CONFIG_VIDEO_LCD_POWER="PH8"
  252. +CONFIG_VIDEO_LCD_BL_EN="PH7"
  253. +CONFIG_VIDEO_LCD_BL_PWM="PB2"
  254. +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
  255. +CONFIG_SPL_I2C_SUPPORT=y
  256. +CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-tpc9150"
RAW Paste Data