kernel: move console loglevel to generic
[oweals/openwrt.git] / target / linux / sunxi / patches-4.9 / 0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch
1 From 49f01c9e14b3476cbdf9623c4812c43f6485830b Mon Sep 17 00:00:00 2001
2 From: Milo Kim <woogyom.kim@gmail.com>
3 Date: Fri, 28 Oct 2016 15:59:01 +0900
4 Subject: ARM: dts: sun8i: Add common dtsi file for NanoPi SBCs
5
6 (backported from kernel 4.13)
7
8 This patch provides a common file for NanoPi M1 and Neo SBC.
9
10 Those have common features below.
11   * UART0
12   * 2 LEDs
13   * USB host (EHCI3, OHCI3) and PHY
14   * MicroSD
15   * GPIO key switch
16
17 Cc: James Pettigrew <james@innovum.com.au>
18 Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
19 Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
20
21 --- /dev/null
22 +++ b/arch/arm/boot/dts/sun8i-h3-nanopi.dtsi
23 @@ -0,0 +1,137 @@
24 +/*
25 + * Copyright (C) 2016 James Pettigrew <james@innovum.com.au>
26 + * Copyright (C) 2016 Milo Kim <woogyom.kim@gmail.com>
27 + *
28 + * This file is dual-licensed: you can use it either under the terms
29 + * of the GPL or the X11 license, at your option. Note that this dual
30 + * licensing only applies to this file, and not this project as a
31 + * whole.
32 + *
33 + *  a) This file is free software; you can redistribute it and/or
34 + *     modify it under the terms of the GNU General Public License as
35 + *     published by the Free Software Foundation; either version 2 of the
36 + *     License, or (at your option) any later version.
37 + *
38 + *     This file is distributed in the hope that it will be useful,
39 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
40 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
41 + *     GNU General Public License for more details.
42 + *
43 + * Or, alternatively,
44 + *
45 + *  b) Permission is hereby granted, free of charge, to any person
46 + *     obtaining a copy of this software and associated documentation
47 + *     files (the "Software"), to deal in the Software without
48 + *     restriction, including without limitation the rights to use,
49 + *     copy, modify, merge, publish, distribute, sublicense, and/or
50 + *     sell copies of the Software, and to permit persons to whom the
51 + *     Software is furnished to do so, subject to the following
52 + *     conditions:
53 + *
54 + *     The above copyright notice and this permission notice shall be
55 + *     included in all copies or substantial portions of the Software.
56 + *
57 + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
58 + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
59 + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
60 + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
61 + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
62 + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
63 + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
64 + *     OTHER DEALINGS IN THE SOFTWARE.
65 + */
66 +
67 +/dts-v1/;
68 +#include "sun8i-h3.dtsi"
69 +#include "sunxi-common-regulators.dtsi"
70 +
71 +#include <dt-bindings/gpio/gpio.h>
72 +#include <dt-bindings/input/input.h>
73 +
74 +/ {
75 +       aliases {
76 +               serial0 = &uart0;
77 +       };
78 +
79 +       chosen {
80 +               stdout-path = "serial0:115200n8";
81 +       };
82 +
83 +       leds {
84 +               compatible = "gpio-leds";
85 +               pinctrl-names = "default";
86 +               pinctrl-0 = <&leds_npi>, <&leds_r_npi>;
87 +
88 +               status {
89 +                       label = "nanopi:blue:status";
90 +                       gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
91 +                       linux,default-trigger = "heartbeat";
92 +               };
93 +
94 +               pwr {
95 +                       label = "nanopi:green:pwr";
96 +                       gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
97 +                       default-state = "on";
98 +               };
99 +       };
100 +
101 +       r_gpio_keys {
102 +               compatible = "gpio-keys";
103 +               input-name = "k1";
104 +               pinctrl-names = "default";
105 +               pinctrl-0 = <&sw_r_npi>;
106 +
107 +               k1@0 {
108 +                       label = "k1";
109 +                       linux,code = <KEY_POWER>;
110 +                       gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
111 +               };
112 +       };
113 +};
114 +
115 +&ehci3 {
116 +       status = "okay";
117 +};
118 +
119 +&mmc0 {
120 +       bus-width = <4>;
121 +       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
122 +       cd-inverted;
123 +       pinctrl-names = "default";
124 +       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
125 +       status = "okay";
126 +       vmmc-supply = <&reg_vcc3v3>;
127 +};
128 +
129 +&ohci3 {
130 +       status = "okay";
131 +};
132 +
133 +&pio {
134 +       leds_npi: led_pins@0 {
135 +               pins = "PA10";
136 +               function = "gpio_out";
137 +       };
138 +};
139 +
140 +&r_pio {
141 +       leds_r_npi: led_pins@0 {
142 +               pins = "PL10";
143 +               function = "gpio_out";
144 +       };
145 +
146 +       sw_r_npi: key_pins@0 {
147 +               pins = "PL3";
148 +               function = "gpio_in";
149 +       };
150 +};
151 +
152 +&uart0 {
153 +       pinctrl-names = "default";
154 +       pinctrl-0 = <&uart0_pins_a>;
155 +       status = "okay";
156 +};
157 +
158 +&usbphy {
159 +       status = "okay";
160 +};