2
0

003-add-theobroma-a31-pangolin.patch 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. --- a/arch/arm/dts/Makefile
  2. +++ b/arch/arm/dts/Makefile
  3. @@ -152,6 +152,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
  4. sun6i-a31-m9.dtb \
  5. sun6i-a31-mele-a1000g-quad.dtb \
  6. sun6i-a31-mixtile-loftq.dtb \
  7. + sun6i-a31-pangolin.dtb \
  8. sun6i-a31s-cs908.dtb \
  9. sun6i-a31s-primo81.dtb \
  10. sun6i-a31s-sinovoip-bpi-m2.dtb
  11. --- a/arch/arm/dts/sun6i-a31.dtsi
  12. +++ b/arch/arm/dts/sun6i-a31.dtsi
  13. @@ -643,6 +643,13 @@
  14. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  15. };
  16. + i2c3_pins_a: i2c3@0 {
  17. + allwinner,pins = "PB5", "PB6";
  18. + allwinner,function = "i2c3";
  19. + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  20. + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  21. + };
  22. +
  23. mmc0_pins_a: mmc0@0 {
  24. allwinner,pins = "PF0", "PF1", "PF2",
  25. "PF3", "PF4", "PF5";
  26. --- /dev/null
  27. +++ b/arch/arm/dts/sun6i-a31-pangolin.dts
  28. @@ -0,0 +1,292 @@
  29. +/*
  30. + * Copyright 2015, Theobroma Systems Design und Consulting GmbH
  31. + *
  32. + * This file is dual-licensed: you can use it either under the terms
  33. + * of the GPL or the X11 license, at your option. Note that this dual
  34. + * licensing only applies to this file, and not this project as a
  35. + * whole.
  36. + *
  37. + * a) This file is free software; you can redistribute it and/or
  38. + * modify it under the terms of the GNU General Public License as
  39. + * published by the Free Software Foundation; either version 2 of the
  40. + * License, or (at your option) any later version.
  41. + *
  42. + * This file is distributed in the hope that it will be useful,
  43. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  44. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  45. + * GNU General Public License for more details.
  46. + *
  47. + * Or, alternatively,
  48. + *
  49. + * b) Permission is hereby granted, free of charge, to any person
  50. + * obtaining a copy of this software and associated documentation
  51. + * files (the "Software"), to deal in the Software without
  52. + * restriction, including without limitation the rights to use,
  53. + * copy, modify, merge, publish, distribute, sublicense, and/or
  54. + * sell copies of the Software, and to permit persons to whom the
  55. + * Software is furnished to do so, subject to the following
  56. + * conditions:
  57. + *
  58. + * The above copyright notice and this permission notice shall be
  59. + * included in all copies or substantial portions of the Software.
  60. + *
  61. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  62. + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  63. + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  64. + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  65. + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  66. + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  67. + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  68. + * OTHER DEALINGS IN THE SOFTWARE.
  69. + */
  70. +
  71. +/dts-v1/;
  72. +#include "sun6i-a31.dtsi"
  73. +#include "sunxi-common-regulators.dtsi"
  74. +
  75. +#include <dt-bindings/gpio/gpio.h>
  76. +#include <dt-bindings/pinctrl/sun4i-a10.h>
  77. +
  78. +/ {
  79. + model = "Theobroma Systems A31 Pangolin";
  80. + compatible = "tsd,a31-pangolin", "allwinner,sun6i-a31";
  81. +
  82. + aliases {
  83. + serial0 = &uart0;
  84. + serial2 = &uart2;
  85. + spi0 = &spi0;
  86. + spi1 = &spi1;
  87. + spi2 = &spi2;
  88. + spi3 = &spi3;
  89. + };
  90. +
  91. + chosen {
  92. + stdout-path = "serial2:115200n8";
  93. + };
  94. +};
  95. +
  96. +&ehci0 {
  97. + status = "okay";
  98. +};
  99. +
  100. +&ohci0 {
  101. + status = "okay";
  102. +};
  103. +
  104. +&ehci1 {
  105. + status = "okay";
  106. +};
  107. +
  108. +&ohci1 {
  109. + status = "okay";
  110. +};
  111. +
  112. +&ohci2 {
  113. + status = "okay";
  114. +};
  115. +
  116. +&gmac {
  117. + pinctrl-names = "default";
  118. + pinctrl-0 = <&gmac_pins_rgmii_a>;
  119. + phy = <&phy1>;
  120. + phy-mode = "rgmii";
  121. + snps,reset-gpio = <&pio 0 7 GPIO_ACTIVE_LOW>;
  122. + snps,reset-active-low;
  123. + snps,reset-delays-us = <0 10000 30000>;
  124. + status = "okay";
  125. +
  126. + phy1: ethernet-phy@4 {
  127. + reg = <4>;
  128. + };
  129. +};
  130. +
  131. +&i2c0 {
  132. + pinctrl-names = "default";
  133. + pinctrl-0 = <&i2c0_pins_a>;
  134. + status = "okay";
  135. +};
  136. +
  137. +&i2c1 {
  138. + pinctrl-names = "default";
  139. + pinctrl-0 = <&i2c1_pins_a>;
  140. + status = "okay";
  141. +};
  142. +
  143. +&i2c2 {
  144. + pinctrl-names = "default";
  145. + pinctrl-0 = <&i2c2_pins_a>;
  146. + status = "okay";
  147. +};
  148. +
  149. +&i2c3 {
  150. + pinctrl-names = "default";
  151. + pinctrl-0 = <&i2c3_pins_a>;
  152. + status = "okay";
  153. +
  154. + rtc_twi: rtc@6f {
  155. + compatible = "isil,isl1208";
  156. + reg = <0x6f>;
  157. + };
  158. + fan: fan@18 {
  159. + compatible = "ti,amc6821";
  160. + reg = <0x18>;
  161. + cooling-min-state = <0>;
  162. + cooling-max-state = <9>;
  163. + #cooling-cells = <2>;
  164. + };
  165. +};
  166. +
  167. +&spi0 {
  168. + status = "okay";
  169. +
  170. + flash: flash@0 {
  171. + compatible = "spansion,m25p40";
  172. + spi-max-frequency = <16000000>;
  173. + spi-cpol;
  174. + spi-cpha;
  175. + };
  176. +};
  177. +
  178. +&spi1 {
  179. + status = "okay";
  180. +};
  181. +
  182. +&ir {
  183. + pinctrl-names = "default";
  184. + pinctrl-0 = <&ir_pins_a>;
  185. + status = "okay";
  186. +};
  187. +
  188. +&mmc0 {
  189. + pinctrl-names = "default";
  190. + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_pangolin>;
  191. + vmmc-supply = <&reg_vcc3v0>;
  192. + bus-width = <4>;
  193. + cd-gpios = <&pio 2 19 GPIO_ACTIVE_LOW>; /* PC19 */
  194. + status = "okay";
  195. +};
  196. +
  197. +&mmc0_pins_a {
  198. + /* external pull-ups missing for some pins */
  199. + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  200. +};
  201. +
  202. +&mmc2 {
  203. + pinctrl-names = "default";
  204. + pinctrl-0 = <&mmc2_pins_a>;
  205. + vmmc-supply = <&reg_vcc3v0>;
  206. + bus-width = <8>;
  207. + non-removable;
  208. + status = "okay";
  209. +};
  210. +
  211. +&pio {
  212. + mmc0_cd_pin_pangolin: mmc0_cd_pin@0 {
  213. + allwinner,pins = "PC19";
  214. + allwinner,function = "gpio_in";
  215. + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  216. + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  217. + };
  218. +
  219. + leds_pins_pangolin: led_pins@0 {
  220. + allwinner,pins = "PH7", "PC16";
  221. + allwinner,function = "gpio_out";
  222. + allwinner,drive = <SUN4I_PINCTRL_20_MA>;
  223. + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  224. + };
  225. +
  226. + mmc2_pins_a: mmc2@0 {
  227. + allwinner,pins = "PC6","PC7","PC8","PC9","PC10","PC11",
  228. + "PC12","PC13","PC14","PC15";
  229. + allwinner,function = "mmc2";
  230. + allwinner,drive = <SUN4I_PINCTRL_30_MA>;
  231. + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  232. + };
  233. +};
  234. +
  235. +&p2wi {
  236. + status = "okay";
  237. +
  238. + axp221: pmic@68 {
  239. + compatible = "x-powers,axp221";
  240. + reg = <0x68>;
  241. + interrupt-parent = <&nmi_intc>;
  242. + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  243. + interrupt-controller;
  244. + #interrupt-cells = <1>;
  245. + dcdc1-supply = <&vcc_3v0>;
  246. + dcdc5-supply = <&vcc_dram>;
  247. +
  248. + regulators {
  249. + x-powers,dcdc-freq = <3000>;
  250. +
  251. + vcc_3v0: dcdc1 {
  252. + regulator-always-on;
  253. + regulator-min-microvolt = <3000000>;
  254. + regulator-max-microvolt = <3000000>;
  255. + regulator-name = "vcc-3v0";
  256. + };
  257. +
  258. + vdd_cpu: dcdc2 {
  259. + regulator-always-on;
  260. + regulator-min-microvolt = <700000>;
  261. + regulator-max-microvolt = <1320000>;
  262. + regulator-name = "vdd-cpu";
  263. + };
  264. +
  265. + vdd_gpu: dcdc3 {
  266. + regulator-always-on;
  267. + regulator-min-microvolt = <700000>;
  268. + regulator-max-microvolt = <1320000>;
  269. + regulator-name = "vdd-gpu";
  270. + };
  271. +
  272. + vdd_sys_dll: dcdc4 {
  273. + regulator-always-on;
  274. + regulator-min-microvolt = <1100000>;
  275. + regulator-max-microvolt = <1100000>;
  276. + regulator-name = "vdd-sys-dll";
  277. + };
  278. +
  279. + vcc_dram: dcdc5 {
  280. + regulator-always-on;
  281. + regulator-min-microvolt = <1500000>;
  282. + regulator-max-microvolt = <1500000>;
  283. + regulator-name = "vcc-dram";
  284. + };
  285. +
  286. + vcc_wifi: aldo1 {
  287. + regulator-min-microvolt = <3300000>;
  288. + regulator-max-microvolt = <3300000>;
  289. + regulator-name = "vcc_wifi";
  290. + };
  291. +
  292. + avcc: aldo3 {
  293. + regulator-always-on;
  294. + regulator-min-microvolt = <3000000>;
  295. + regulator-max-microvolt = <3000000>;
  296. + regulator-name = "avcc";
  297. + };
  298. + };
  299. + };
  300. +};
  301. +
  302. +&uart0 {
  303. + pinctrl-names = "default";
  304. + pinctrl-0 = <&uart0_pins_a>;
  305. + status = "okay";
  306. +};
  307. +
  308. +&usb1_vbus_pin_a {
  309. + allwinner,pins = "PD23";
  310. +};
  311. +
  312. +&reg_usb1_vbus {
  313. + gpio = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD 23 */
  314. + status = "okay";
  315. +};
  316. +
  317. +&usbphy {
  318. + status = "okay";
  319. + usb1_vbus-supply = <&reg_usb1_vbus>;
  320. +};
  321. --- /dev/null
  322. +++ b/configs/pangolin_defconfig
  323. @@ -0,0 +1,36 @@
  324. +CONFIG_SUNXI_PANGOLIN=y
  325. +CONFIG_SPL=y
  326. +CONFIG_SYS_EXTRA_OPTIONS="USB_EHCI,SUNXI_GMAC,RGMII"
  327. +CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-pangolin"
  328. +CONFIG_VIDEO_VGA_VIA_LCD=y
  329. +CONFIG_VIDEO_VGA_EXTERNAL_DAC_EN="PH25"
  330. +CONFIG_ARM=y
  331. +CONFIG_ARCH_SUNXI=y
  332. +CONFIG_MACH_SUN6I=y
  333. +CONFIG_DRAM_CHANNELS=1
  334. +CONFIG_DRAM_CLK=360
  335. +CONFIG_DRAM_ZQ=70
  336. +CONFIG_AXP_DCDC1_VOLT=3300
  337. +CONFIG_AXP_ALDO1_VOLT=0
  338. +CONFIG_AXP_ALDO2_VOLT=1800
  339. +CONFIG_AXP_ALDO3_VOLT=3000
  340. +CONFIG_AXP_DLDO4_VOLT=3300
  341. +CONFIG_AXP_ELDO1_VOLT=1200
  342. +CONFIG_AXP_ELDO2_VOLT=2500
  343. +CONFIG_AXP_ELDO3_VOLT=3300
  344. +CONFIG_MMC_SUNXI_SLOT_EXTRA=2
  345. +CONFIG_CONS_INDEX=3
  346. +# Vbus gpio for usb1
  347. +CONFIG_USB1_VBUS_PIN=""
  348. +# No Vbus gpio for usb2
  349. +CONFIG_USB2_VBUS_PIN=""
  350. +CONFIG_USB=y
  351. +CONFIG_DM_USB=y
  352. +CONFIG_USB_EHCI=y
  353. +CONFIG_USB_KEYBOARD=y
  354. +CONFIG_DM_ETH=y
  355. +CONFIG_CMD_IMLS=n
  356. +CONFIG_ETH_DESIGNWARE=y
  357. +CONFIG_DM_SPI=y
  358. +CONFIG_DM_SPI_FLASH=y
  359. +CONFIG_SUNXI_SPI=y
  360. --- a/board/sunxi/Kconfig
  361. +++ b/board/sunxi/Kconfig
  362. @@ -15,7 +15,6 @@ config SUNXI_GEN_SUN6I
  363. separate ahb reset control registers, custom pmic bus, new style
  364. watchdog, etc.
  365. -
  366. choice
  367. prompt "Sunxi SoC Variant"
  368. optional
  369. @@ -533,6 +532,14 @@ config VIDEO_LCD_PANEL_I2C_SCL
  370. Set the SCL pin for the LCD i2c interface. This takes a string in the
  371. format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
  372. +choice
  373. + prompt "Sunxi Board Variant"
  374. + optional
  375. +
  376. +config SUNXI_PANGOLIN
  377. + bool "Theobroma A31 uQ7 Board"
  378. +
  379. +endchoice
  380. # Note only one of these may be selected at a time! But hidden choices are
  381. # not supported by Kconfig