sunxi: Backport patches needed for A64
[openwrt/staging/lynxis.git] / target / linux / sunxi / patches-4.9 / 0011-arm64-dts-add-Pine64-support.patch
1 From 4e3886081848b7ea16452a92c4324acaab644d49 Mon Sep 17 00:00:00 2001
2 From: Andre Przywara <andre.przywara@arm.com>
3 Date: Tue, 19 Jan 2016 10:36:39 +0000
4 Subject: arm64: dts: add Pine64 support
5
6 The Pine64 is a cost-efficient development board based on the
7 Allwinner A64 SoC.
8 There are three models: the basic version with Fast Ethernet and
9 512 MB of DRAM (Pine64) and two Pine64+ versions, which both
10 feature Gigabit Ethernet and additional connectors for touchscreens
11 and a camera. Or as my son put it: "Those are smaller and these are
12 missing." ;-)
13 The two Pine64+ models just differ in the amount of DRAM
14 (1GB vs. 2GB). Since U-Boot will figure out the right size for us and
15 patches the DT accordingly we just need to provide one DT for the
16 Pine64+.
17
18 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
19 [Maxime: Removed the common DTSI and include directly the pine64 DTS]
20 Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
21 ---
22 arch/arm64/boot/dts/Makefile | 1 +
23 arch/arm64/boot/dts/allwinner/Makefile | 5 ++
24 .../boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 50 +++++++++++++++
25 .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 74 ++++++++++++++++++++++
26 4 files changed, 130 insertions(+)
27 create mode 100644 arch/arm64/boot/dts/allwinner/Makefile
28 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts
29 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
30
31 --- a/arch/arm64/boot/dts/Makefile
32 +++ b/arch/arm64/boot/dts/Makefile
33 @@ -1,4 +1,5 @@
34 dts-dirs += al
35 +dts-dirs += allwinner
36 dts-dirs += altera
37 dts-dirs += amd
38 dts-dirs += amlogic
39 --- /dev/null
40 +++ b/arch/arm64/boot/dts/allwinner/Makefile
41 @@ -0,0 +1,5 @@
42 +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
43 +
44 +always := $(dtb-y)
45 +subdir-y := $(dts-dirs)
46 +clean-files := *.dtb
47 --- /dev/null
48 +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts
49 @@ -0,0 +1,50 @@
50 +/*
51 + * Copyright (c) 2016 ARM Ltd.
52 + *
53 + * This file is dual-licensed: you can use it either under the terms
54 + * of the GPL or the X11 license, at your option. Note that this dual
55 + * licensing only applies to this file, and not this project as a
56 + * whole.
57 + *
58 + * a) This library is free software; you can redistribute it and/or
59 + * modify it under the terms of the GNU General Public License as
60 + * published by the Free Software Foundation; either version 2 of the
61 + * License, or (at your option) any later version.
62 + *
63 + * This library is distributed in the hope that it will be useful,
64 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
65 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66 + * GNU General Public License for more details.
67 + *
68 + * Or, alternatively,
69 + *
70 + * b) Permission is hereby granted, free of charge, to any person
71 + * obtaining a copy of this software and associated documentation
72 + * files (the "Software"), to deal in the Software without
73 + * restriction, including without limitation the rights to use,
74 + * copy, modify, merge, publish, distribute, sublicense, and/or
75 + * sell copies of the Software, and to permit persons to whom the
76 + * Software is furnished to do so, subject to the following
77 + * conditions:
78 + *
79 + * The above copyright notice and this permission notice shall be
80 + * included in all copies or substantial portions of the Software.
81 + *
82 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
83 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
84 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
85 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
86 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
87 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
88 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
89 + * OTHER DEALINGS IN THE SOFTWARE.
90 + */
91 +
92 +#include "sun50i-a64-pine64.dts"
93 +
94 +/ {
95 + model = "Pine64+";
96 + compatible = "pine64,pine64-plus", "allwinner,sun50i-a64";
97 +
98 + /* TODO: Camera, Ethernet PHY, touchscreen, etc. */
99 +};
100 --- /dev/null
101 +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
102 @@ -0,0 +1,74 @@
103 +/*
104 + * Copyright (c) 2016 ARM Ltd.
105 + *
106 + * This file is dual-licensed: you can use it either under the terms
107 + * of the GPL or the X11 license, at your option. Note that this dual
108 + * licensing only applies to this file, and not this project as a
109 + * whole.
110 + *
111 + * a) This library is free software; you can redistribute it and/or
112 + * modify it under the terms of the GNU General Public License as
113 + * published by the Free Software Foundation; either version 2 of the
114 + * License, or (at your option) any later version.
115 + *
116 + * This library is distributed in the hope that it will be useful,
117 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
118 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
119 + * GNU General Public License for more details.
120 + *
121 + * Or, alternatively,
122 + *
123 + * b) Permission is hereby granted, free of charge, to any person
124 + * obtaining a copy of this software and associated documentation
125 + * files (the "Software"), to deal in the Software without
126 + * restriction, including without limitation the rights to use,
127 + * copy, modify, merge, publish, distribute, sublicense, and/or
128 + * sell copies of the Software, and to permit persons to whom the
129 + * Software is furnished to do so, subject to the following
130 + * conditions:
131 + *
132 + * The above copyright notice and this permission notice shall be
133 + * included in all copies or substantial portions of the Software.
134 + *
135 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
136 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
137 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
138 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
139 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
140 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
141 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
142 + * OTHER DEALINGS IN THE SOFTWARE.
143 + */
144 +
145 +/dts-v1/;
146 +
147 +#include "sun50i-a64.dtsi"
148 +
149 +/ {
150 + model = "Pine64";
151 + compatible = "pine64,pine64", "allwinner,sun50i-a64";
152 +
153 + aliases {
154 + serial0 = &uart0;
155 + };
156 +
157 + chosen {
158 + stdout-path = "serial0:115200n8";
159 + };
160 +};
161 +
162 +&uart0 {
163 + pinctrl-names = "default";
164 + pinctrl-0 = <&uart0_pins_a>;
165 + status = "okay";
166 +};
167 +
168 +&i2c1 {
169 + pinctrl-names = "default";
170 + pinctrl-0 = <&i2c1_pins>;
171 + status = "okay";
172 +};
173 +
174 +&i2c1_pins {
175 + bias-pull-up;
176 +};