sun8i-h2-plus-bananapi-p2-zero.dts revision 1.1 1 1.1 thorpej /* $NetBSD: sun8i-h2-plus-bananapi-p2-zero.dts,v 1.1 2019/06/05 03:38:09 thorpej Exp $ */
2 1.1 thorpej
3 1.1 thorpej /*-
4 1.1 thorpej * Copyright (c) 2019 Jason R. Thorpe
5 1.1 thorpej * All rights reserved.
6 1.1 thorpej *
7 1.1 thorpej * Redistribution and use in source and binary forms, with or without
8 1.1 thorpej * modification, are permitted provided that the following conditions
9 1.1 thorpej * are met:
10 1.1 thorpej * 1. Redistributions of source code must retain the above copyright
11 1.1 thorpej * notice, this list of conditions and the following disclaimer.
12 1.1 thorpej * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 thorpej * notice, this list of conditions and the following disclaimer in the
14 1.1 thorpej * documentation and/or other materials provided with the distribution.
15 1.1 thorpej *
16 1.1 thorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1 thorpej * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1 thorpej * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1 thorpej * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1 thorpej * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 1.1 thorpej * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 1.1 thorpej * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 1.1 thorpej * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 1.1 thorpej * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 1.1 thorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 1.1 thorpej * SUCH DAMAGE.
27 1.1 thorpej */
28 1.1 thorpej
29 1.1 thorpej /*
30 1.1 thorpej * Device tree for Banana Pi BPI-P2 Zero. The P2 Zero is essentially an
31 1.1 thorpej * M2 Zero with the following additions:
32 1.1 thorpej *
33 1.1 thorpej * - On-board Ethernet (with PoE capability available as an
34 1.1 thorpej * optional module).
35 1.1 thorpej * - On-board eMMC module.
36 1.1 thorpej */
37 1.1 thorpej
38 1.1 thorpej #include "../../../external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts"
39 1.1 thorpej
40 1.1 thorpej / {
41 1.1 thorpej model = "Banana Pi BPI-P2-Zero";
42 1.1 thorpej compatible = "sinovoip,bpi-p2-zero", "allwinner,sun8i-h2-plus";
43 1.1 thorpej
44 1.1 thorpej aliases {
45 1.1 thorpej /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
46 1.1 thorpej ethernet0 = &emac;
47 1.1 thorpej };
48 1.1 thorpej
49 1.1 thorpej leds {
50 1.1 thorpej pwr_led {
51 1.1 thorpej label = "bananapi-p2-zero:red:pwr";
52 1.1 thorpej };
53 1.1 thorpej };
54 1.1 thorpej };
55 1.1 thorpej
56 1.1 thorpej &emac {
57 1.1 thorpej phy-handle = <&int_mii_phy>;
58 1.1 thorpej phy-mode = "mii";
59 1.1 thorpej allwinner,leds-active-low;
60 1.1 thorpej status = "okay";
61 1.1 thorpej };
62 1.1 thorpej
63 1.1 thorpej &mmc0 {
64 1.1 thorpej /*
65 1.1 thorpej * There seems to be a discrepancy between how the card-detect
66 1.1 thorpej * signal is wired up between the P2 Zero and the M2 Zero, on
67 1.1 thorpej * which the P2 Zero is based.
68 1.1 thorpej *
69 1.1 thorpej * The M2 Zero device tree file claims that early samples of
70 1.1 thorpej * the M2 Zero were wired active-low, but that the production
71 1.1 thorpej * of the board is wired active-high; as such, the M2 Zero
72 1.1 thorpej * device tree uses an active-high signal for card-detect.
73 1.1 thorpej *
74 1.1 thorpej * However, the P2 Zero has been observed in the wild to have
75 1.1 thorpej * an active-low card-detect signal. I don't know if this is
76 1.1 thorpej * an early-vs-late situation like the M2 Zero, but for now we
77 1.1 thorpej * will configure the card-detect signal to active-low to match
78 1.1 thorpej * known samples of the board that exist in the wild.
79 1.1 thorpej */
80 1.1 thorpej cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
81 1.1 thorpej };
82 1.1 thorpej
83 1.1 thorpej &mmc2 {
84 1.1 thorpej pinctrl-names = "default";
85 1.1 thorpej pinctrl-0 = <&mmc2_8bit_pins>;
86 1.1 thorpej bus-width = <8>;
87 1.1 thorpej non-removable;
88 1.1 thorpej status = "okay";
89 1.1 thorpej };
90