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

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