Chen-Yu Tsai | d7b17f1 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 | /* |
| 3 | * Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org> |
| 4 | */ |
| 5 | |
| 6 | #include <dt-bindings/gpio/gpio.h> |
| 7 | #include <dt-bindings/input/input.h> |
| 8 | |
| 9 | / { |
| 10 | aliases { |
| 11 | ethernet0 = &emac; |
| 12 | serial0 = &uart0; |
| 13 | }; |
| 14 | |
| 15 | chosen { |
| 16 | stdout-path = "serial0:115200n8"; |
| 17 | }; |
| 18 | |
| 19 | leds { |
| 20 | compatible = "gpio-leds"; |
| 21 | |
| 22 | pwr_led { |
| 23 | label = "librecomputer:green:pwr"; |
| 24 | gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */ |
| 25 | default-state = "on"; |
| 26 | }; |
| 27 | |
| 28 | status_led { |
| 29 | label = "librecomputer:blue:status"; |
| 30 | gpios = <&pio 0 7 GPIO_ACTIVE_HIGH>; /* PA7 */ |
| 31 | }; |
| 32 | }; |
| 33 | |
| 34 | gpio_keys { |
| 35 | compatible = "gpio-keys"; |
| 36 | |
| 37 | power { |
| 38 | label = "power"; |
| 39 | linux,code = <KEY_POWER>; |
| 40 | gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ |
| 41 | }; |
| 42 | }; |
| 43 | |
| 44 | reg_vcc1v2: vcc1v2 { |
| 45 | compatible = "regulator-fixed"; |
| 46 | regulator-name = "vcc1v2"; |
| 47 | regulator-min-microvolt = <3300000>; |
| 48 | regulator-max-microvolt = <3300000>; |
| 49 | regulator-always-on; |
| 50 | regulator-boot-on; |
| 51 | vin-supply = <®_vcc5v0>; |
| 52 | gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ |
| 53 | enable-active-high; |
| 54 | }; |
| 55 | |
| 56 | reg_vcc3v3: vcc3v3 { |
| 57 | compatible = "regulator-fixed"; |
| 58 | regulator-name = "vcc3v3"; |
| 59 | regulator-min-microvolt = <3300000>; |
| 60 | regulator-max-microvolt = <3300000>; |
| 61 | vin-supply = <®_vcc5v0>; |
| 62 | }; |
| 63 | |
| 64 | /* This represents the board's 5V input */ |
| 65 | reg_vcc5v0: vcc5v0 { |
| 66 | compatible = "regulator-fixed"; |
| 67 | regulator-name = "vcc5v0"; |
| 68 | regulator-min-microvolt = <5000000>; |
| 69 | regulator-max-microvolt = <5000000>; |
| 70 | }; |
| 71 | |
| 72 | reg_vcc_dram: vcc-dram { |
| 73 | compatible = "regulator-fixed"; |
| 74 | regulator-name = "vcc-dram"; |
| 75 | regulator-min-microvolt = <1500000>; |
| 76 | regulator-max-microvolt = <1500000>; |
| 77 | regulator-always-on; |
| 78 | regulator-boot-on; |
| 79 | vin-supply = <®_vcc5v0>; |
| 80 | gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */ |
| 81 | enable-active-high; |
| 82 | }; |
| 83 | |
| 84 | reg_vcc_io: vcc-io { |
| 85 | compatible = "regulator-fixed"; |
| 86 | regulator-name = "vcc-io"; |
| 87 | regulator-min-microvolt = <3300000>; |
| 88 | regulator-max-microvolt = <3300000>; |
| 89 | regulator-always-on; |
| 90 | regulator-boot-on; |
| 91 | vin-supply = <®_vcc3v3>; |
| 92 | gpio = <&r_pio 0 5 GPIO_ACTIVE_LOW>; /* PL5 */ |
| 93 | }; |
| 94 | |
| 95 | reg_vdd_cpux: vdd-cpux { |
| 96 | compatible = "regulator-fixed"; |
| 97 | regulator-name = "vdd-cpux"; |
| 98 | regulator-min-microvolt = <3300000>; |
| 99 | regulator-max-microvolt = <3300000>; |
| 100 | regulator-always-on; |
| 101 | regulator-boot-on; |
| 102 | vin-supply = <®_vcc5v0>; |
| 103 | gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ |
| 104 | enable-active-high; |
| 105 | }; |
| 106 | }; |
| 107 | |
| 108 | &ehci1 { |
| 109 | status = "okay"; |
| 110 | }; |
| 111 | |
| 112 | &ehci2 { |
| 113 | status = "okay"; |
| 114 | }; |
| 115 | |
| 116 | &ehci3 { |
| 117 | status = "okay"; |
| 118 | }; |
| 119 | |
| 120 | &emac { |
| 121 | phy-handle = <&int_mii_phy>; |
| 122 | phy-mode = "mii"; |
| 123 | allwinner,leds-active-low; |
| 124 | status = "okay"; |
| 125 | }; |
| 126 | |
| 127 | &ir { |
| 128 | pinctrl-names = "default"; |
| 129 | pinctrl-0 = <&ir_pins_a>; |
| 130 | status = "okay"; |
| 131 | }; |
| 132 | |
| 133 | &mmc0 { |
Chen-Yu Tsai | d7b17f1 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 134 | vmmc-supply = <®_vcc_io>; |
| 135 | bus-width = <4>; |
| 136 | cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ |
| 137 | cd-inverted; |
| 138 | status = "okay"; |
| 139 | }; |
| 140 | |
Chen-Yu Tsai | 32f67bb | 2018-07-14 21:55:45 +0800 | [diff] [blame] | 141 | &mmc2 { |
| 142 | pinctrl-names = "default"; |
| 143 | pinctrl-0 = <&mmc2_8bit_pins>; |
| 144 | vmmc-supply = <®_vcc_io>; |
| 145 | bus-width = <8>; |
| 146 | non-removable; |
| 147 | status = "okay"; |
| 148 | }; |
| 149 | |
Chen-Yu Tsai | d7b17f1 | 2018-04-28 13:36:01 +0800 | [diff] [blame] | 150 | &ohci1 { |
| 151 | status = "okay"; |
| 152 | }; |
| 153 | |
| 154 | &ohci2 { |
| 155 | status = "okay"; |
| 156 | }; |
| 157 | |
| 158 | &ohci3 { |
| 159 | status = "okay"; |
| 160 | }; |
| 161 | |
| 162 | &uart0 { |
| 163 | pinctrl-names = "default"; |
| 164 | pinctrl-0 = <&uart0_pins_a>; |
| 165 | status = "okay"; |
| 166 | }; |
| 167 | |
| 168 | &usbphy { |
| 169 | /* VBUS on USB ports are always on */ |
| 170 | usb0_vbus-supply = <®_vcc5v0>; |
| 171 | usb1_vbus-supply = <®_vcc5v0>; |
| 172 | usb2_vbus-supply = <®_vcc5v0>; |
| 173 | usb3_vbus-supply = <®_vcc5v0>; |
| 174 | status = "okay"; |
| 175 | }; |