320-sunxi-Add-support-for-Orange-Pi-R1.patch 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. From fd3736abbe57a819312c8df96d14ec396b074581 Mon Sep 17 00:00:00 2001
  2. From: Hauke Mehrtens <hauke@hauke-m.de>
  3. Date: Tue, 26 Sep 2017 22:16:59 +0200
  4. Subject: sun8i: h2: Add initial Orange Pi R1
  5. Orange Pi R1 is an open-source single-board computer using the
  6. Allwinner H2+ SOC.
  7. H2+ Orange Pi R1 has
  8. - Quad-core Cortex-A7
  9. - 256MB DDR3
  10. - micrSD slot
  11. - 128MBit SPI Nor flash
  12. - Debug TTL UART
  13. - 100MBit/s Ethernet (H2+)
  14. - 100MBit/s Ethernet (RTL8152B)
  15. - Wifi (RTL8189ETV)
  16. - USB 2.0 OTG + power supply
  17. This board is very similar to the Orange Pi Zero.
  18. The device tree file is copied from the Linux kernel 4.18.
  19. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  20. ---
  21. arch/arm/dts/Makefile | 1 +
  22. arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts | 101 +++++++++++++++++++++++++++++
  23. board/sunxi/MAINTAINERS | 5 ++
  24. configs/orangepi_r1_defconfig | 16 +++++
  25. 4 files changed, 123 insertions(+)
  26. create mode 100644 arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts
  27. create mode 100644 configs/orangepi_r1_defconfig
  28. --- a/arch/arm/dts/Makefile
  29. +++ b/arch/arm/dts/Makefile
  30. @@ -350,6 +350,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \
  31. sun8i-a83t-cubietruck-plus.dtb \
  32. sun8i-a83t-tbs-a711.dts
  33. dtb-$(CONFIG_MACH_SUN8I_H3) += \
  34. + sun8i-h2-plus-orangepi-r1.dtb \
  35. sun8i-h2-plus-orangepi-zero.dtb \
  36. sun8i-h3-bananapi-m2-plus.dtb \
  37. sun8i-h3-libretech-all-h3-cc.dtb \
  38. --- /dev/null
  39. +++ b/arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts
  40. @@ -0,0 +1,101 @@
  41. +/*
  42. + * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
  43. + *
  44. + * This file is dual-licensed: you can use it either under the terms
  45. + * of the GPL or the X11 license, at your option. Note that this dual
  46. + * licensing only applies to this file, and not this project as a
  47. + * whole.
  48. + *
  49. + * a) This file is free software; you can redistribute it and/or
  50. + * modify it under the terms of the GNU General Public License as
  51. + * published by the Free Software Foundation; either version 2 of the
  52. + * License, or (at your option) any later version.
  53. + *
  54. + * This file is distributed in the hope that it will be useful,
  55. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  56. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  57. + * GNU General Public License for more details.
  58. + *
  59. + * Or, alternatively,
  60. + *
  61. + * b) Permission is hereby granted, free of charge, to any person
  62. + * obtaining a copy of this software and associated documentation
  63. + * files (the "Software"), to deal in the Software without
  64. + * restriction, including without limitation the rights to use,
  65. + * copy, modify, merge, publish, distribute, sublicense, and/or
  66. + * sell copies of the Software, and to permit persons to whom the
  67. + * Software is furnished to do so, subject to the following
  68. + * conditions:
  69. + *
  70. + * The above copyright notice and this permission notice shall be
  71. + * included in all copies or substantial portions of the Software.
  72. + *
  73. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  74. + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  75. + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  76. + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  77. + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  78. + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  79. + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  80. + * OTHER DEALINGS IN THE SOFTWARE.
  81. + */
  82. +
  83. +/* Orange Pi R1 is based on Orange Pi Zero design */
  84. +#include "sun8i-h2-plus-orangepi-zero.dts"
  85. +
  86. +/ {
  87. + model = "Xunlong Orange Pi R1";
  88. + compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus";
  89. +
  90. + /delete-node/ reg_vcc_wifi;
  91. +
  92. + /*
  93. + * Ths pin of this regulator is the same with the Wi-Fi extra
  94. + * regulator on the original Zero. However it's used for USB
  95. + * Ethernet rather than the Wi-Fi now.
  96. + */
  97. + reg_vcc_usb_eth: reg-vcc-usb-ethernet {
  98. + compatible = "regulator-fixed";
  99. + regulator-min-microvolt = <3300000>;
  100. + regulator-max-microvolt = <3300000>;
  101. + regulator-name = "vcc-usb-ethernet";
  102. + enable-active-high;
  103. + gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>;
  104. + };
  105. +
  106. + aliases {
  107. + ethernet1 = &rtl8189etv;
  108. + };
  109. +};
  110. +
  111. +/*
  112. +&spi0 {
  113. + status = "okay";
  114. +
  115. + flash@0 {
  116. + compatible = "mxicy,mx25l12805d", "jedec,spi-nor";
  117. + };
  118. +};
  119. +*/
  120. +
  121. +&ohci1 {
  122. + /*
  123. + * RTL8152B USB-Ethernet adapter is connected to USB1,
  124. + * and it's a USB 2.0 device. So the OHCI1 controller
  125. + * can be left disabled.
  126. + */
  127. + status = "disabled";
  128. +};
  129. +
  130. +&mmc1 {
  131. + vmmc-supply = <&reg_vcc3v3>;
  132. + vqmmc-supply = <&reg_vcc3v3>;
  133. +
  134. + rtl8189etv: sdio_wifi@1 {
  135. + reg = <1>;
  136. + };
  137. +};
  138. +
  139. +&usbphy {
  140. + usb1_vbus-supply = <&reg_vcc_usb_eth>;
  141. +};
  142. --- a/board/sunxi/MAINTAINERS
  143. +++ b/board/sunxi/MAINTAINERS
  144. @@ -342,6 +342,11 @@ M: Jagan Teki <jagan@amarulasolutions.co
  145. S: Maintained
  146. F: configs/orangepi_prime_defconfig
  147. +ORANGEPI R1 BOARD
  148. +M: Hauke Mehrtens <hauke@hauke-m.de>
  149. +S: Maintained
  150. +F: configs/orangepi_r1_defconfig
  151. +
  152. PINE64 BOARDS
  153. M: Andre Przywara <andre.przywara@arm.com>
  154. S: Maintained
  155. --- /dev/null
  156. +++ b/configs/orangepi_r1_defconfig
  157. @@ -0,0 +1,16 @@
  158. +CONFIG_ARM=y
  159. +CONFIG_ARCH_SUNXI=y
  160. +CONFIG_SPL=y
  161. +CONFIG_MACH_SUN8I_H3=y
  162. +CONFIG_DRAM_CLK=624
  163. +CONFIG_DRAM_ZQ=3881979
  164. +CONFIG_DRAM_ODT_EN=y
  165. +# CONFIG_VIDEO_DE2 is not set
  166. +CONFIG_SPL_SPI_SUNXI=y
  167. +CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-r1"
  168. +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
  169. +CONFIG_CONSOLE_MUX=y
  170. +# CONFIG_CMD_FLASH is not set
  171. +CONFIG_SUN8I_EMAC=y
  172. +CONFIG_USB_EHCI_HCD=y
  173. +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y