Advertisement
theonedemon

Untitled

Jan 20th, 2019
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.30 KB | None | 0 0
  1. /dts-v1/;
  2. #include <dt-bindings/gpio/gpio.h>
  3. #include "armada-375.dtsi"
  4.  
  5. / {
  6.     model = "WD MyCloud Gen2";
  7.     compatible = "marvell,a375-db", "marvell,armada375";
  8.  
  9.     chosen {
  10.         stdout-path = "serial0:115200n8";
  11.     };
  12.  
  13.     memory@0 {
  14.         device_type = "memory";
  15.         reg = <0x00000000 0x20000000>; /* 512 MB */
  16.     };
  17.  
  18.     soc {
  19.         ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
  20.               MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
  21.               MBUS_ID(0x09, 0x09) 0 0xf1100000 0x10000
  22.               MBUS_ID(0x09, 0x05) 0 0xf1110000 0x10000>;
  23.     };
  24.  
  25.     gpio-leds {
  26.         compatible = "gpio-leds";
  27.         pinctrl-names = "default";
  28.         pinctrl-0 = <&sys_led_pins>;
  29.  
  30.         system-red {
  31.             label = "system-red";
  32.             gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;   // chip, pin, state (1=active-low)
  33.             // Triggers: none nand-disk timer oneshot heartbeat backlight gpio cpu0 cpu1 default-on
  34.             //linux,default-trigger = "default-on";
  35.             default-state = "keep";
  36.         };
  37.         system-green {
  38.             label = "system-green";
  39.             gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; // 43 (mpp43) - 32 (gpio in chip) = 11 (pin in this chip)
  40.             linux,default-trigger = "default-on";
  41.             default-state = "on";
  42.         };
  43.         system-blue {
  44.             label = "system-blue";
  45.             gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
  46.             linux,default-trigger = "default-off";
  47.             default-state = "off";
  48.         };
  49.     };
  50.  
  51.     gpio-keys {
  52.         compatible = "gpio-keys";
  53.         pinctrl-names = "default";
  54.         pinctrl-0 = <&btn_reset_pins>;
  55.         #address-cells = <1>;
  56.         #size-cells = <0>;
  57.  
  58.         btn-reset {
  59.             label = "btn-reset";
  60.             gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; // 44-32=12
  61.             linux,code = <198>; // KEY_RESTART, from: include/uapi/linux/input-event-codes.h
  62.             gpio-key,wakeup;
  63.             //autorepeat;
  64.         };
  65.     };
  66.  
  67.     usb3_phy: usb3-phy {
  68.         compatible = "usb-nop-xceiv";
  69.         vcc-supply = <&usb3_vbus>;
  70.     };
  71.  
  72.     usb3_vbus: usb3-vbus {
  73.         compatible = "regulator-fixed";
  74.         pinctrl-names = "default";
  75.         pinctrl-0 = <&usb3_vbus_pins>;
  76.         regulator-name = "usb3-vbus";
  77.         regulator-min-microvolt = <5000000>;
  78.         regulator-max-microvolt = <5000000>;
  79.         enable-active-high;
  80.         regulator-always-on;
  81.         gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>;
  82.     };
  83. };
  84.  
  85. &spi0 {
  86.     pinctrl-0 = <&spi0_pins>;
  87.     pinctrl-names = "default";
  88.     status = "okay";
  89.  
  90.     spi-flash@0 {
  91.         #address-cells = <1>;
  92.         #size-cells = <1>;
  93.         compatible = "mxicy,mx25l8005", "jedec,spi-nor";
  94.         reg = <0>; /* Chip select 0 */
  95.         spi-max-frequency = <108000000>;
  96.         partition@0 {
  97.             label = "u-boot";
  98.             reg = <0x0 0x100000>;
  99.         };
  100.     };
  101. };
  102.  
  103. &i2c0 {
  104.     status = "okay";
  105.     clock-frequency = <100000>;
  106.     pinctrl-0 = <&i2c0_pins>;
  107.     pinctrl-names = "default";
  108. };
  109.  
  110. &i2c1 {
  111.     status = "okay";
  112.     clock-frequency = <100000>;
  113.     pinctrl-0 = <&i2c1_pins>;
  114.     pinctrl-names = "default";
  115. };
  116.  
  117. &uart0 {
  118.     status = "okay";
  119. };
  120.  
  121. &pinctrl {
  122.     sys_led_pins: sys-led-pins {
  123.         marvell,pins = "mpp20", "mpp43", "mpp22"; // R G B
  124.         marvell,function = "gpio";
  125.     };
  126.  
  127.     btn_reset_pins: btn-reset-pins {
  128.         marvell,pins = "mpp44";
  129.         marvell,function = "gpio";
  130.     };
  131.  
  132.     usb3_vbus_pins: usb3-vbus-pins {
  133.         marvell,pins = "mpp13";
  134.         marvell,function = "gpio";
  135.     };
  136. };
  137.  
  138. &sata {
  139.     status = "okay";
  140.     nr-ports = <1>;
  141. };
  142.  
  143. &usb1 {
  144.     status = "okay";
  145. };
  146.  
  147. &usb2 {
  148.     status = "okay";
  149. };
  150.  
  151. &mdio {
  152.     phy0: ethernet-phy@0 {
  153.         reg = <0>;
  154.     };
  155. };
  156.  
  157. &ethernet {
  158.     status = "okay";
  159. };
  160.  
  161. &eth0 {
  162.     status = "okay";
  163.     phy = <&phy0>;
  164.     phy-mode = "mii";
  165. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement