apm821xx: convert to dt based diag LED script
[openwrt/openwrt.git] / target / linux / apm821xx / dts / apollo3g.dtsi
1 /*
2 * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
3 * (c) Copyright 2010 Western Digital Technologies, Inc. All Rights Reserved.
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without
7 * any warranty of any kind, whether express or implied.
8 */
9
10 #include "apm82181.dtsi"
11
12 / {
13 compatible = "amcc,apollo3g";
14
15 aliases {
16 serial0 = &UART0;
17 led-boot = &status;
18 led-failsafe = &status;
19 led-running = &status;
20 led-upgrade = &status;
21 };
22 };
23
24 &POB0 {
25 ebc {
26 nor_flash@0,0 {
27 status = "okay";
28 compatible = "amd,s29gl512n", "jedec-probe", "cfi-flash", "mtd-rom";
29 bank-width = <1>;
30 reg = <0x00000000 0x00000000 0x00080000>;
31 #address-cells = <1>;
32 #size-cells = <1>;
33
34 partition@0 {
35 /* Part of bootrom - Don't use it without a jump */
36 label = "free";
37 reg = <0x00000000 0x0001e000>;
38 };
39
40 partition@1 {
41 label = "env";
42 reg = <0x0001e000 0x00002000>;
43 };
44
45 partition@2 {
46 label = "uboot";
47 reg = <0x00020000 0x00050000>;
48 };
49 };
50 };
51
52 GPIO1: gpio1@e0000000 {
53 compatible = "wd,mbl-gpio", "ti,74273";
54 reg-names = "dat";
55 reg = <0xe0000000 0x1>;
56 #gpio-cells = <2>;
57 gpio-controller;
58
59 enable-phy {
60 /* toggle to reset EMAC PHY */
61 gpio-hog;
62 line-name = "enable EMAC PHY";
63 gpios = <0 GPIO_ACTIVE_LOW>;
64 output-low;
65 };
66
67 enable-button {
68 /* Defined in u-boot as: NOT_NOR
69 * "enables features other than NOR
70 * specifically, the buffer at CS2"
71 * (button).
72 *
73 * Note: This option is disabled as
74 * it prevents the system from being
75 * rebooted successfully.
76 */
77
78 gpio-hog;
79 line-name = "Enable Reset Button, disable NOR";
80 gpios = <1 GPIO_ACTIVE_HIGH>;
81 output-low;
82 };
83
84 enable-usb {
85 gpio-hog;
86 line-name = "Power USB Core";
87 gpios = <2 GPIO_ACTIVE_LOW>;
88 output-low;
89 status = "disabled";
90 };
91
92 enable-port1 {
93 gpio-hog;
94 line-name = "Power Drive Port 1";
95 gpios = <3 GPIO_ACTIVE_LOW>;
96 output-low;
97 };
98
99 enable-port0 {
100 gpio-hog;
101 line-name = "Power Drive Port 0";
102 gpios = <7 GPIO_ACTIVE_LOW>;
103 output-low;
104 status = "disabled";
105 };
106 };
107
108 GPIO2: gpio2@e0100000 {
109 compatible = "wd,mbl-gpio", "ti,74244";
110 reg-names = "dat";
111 reg = <0xe0100000 0x1>;
112 #gpio-cells = <2>;
113 gpio-controller;
114 no-output;
115 };
116
117 gpio-leds {
118 compatible = "gpio-leds";
119
120 failsafe: power-red {
121 label = "mbl:red:power";
122 gpios = <&GPIO1 4 GPIO_ACTIVE_HIGH>;
123 linux,default-trigger = "panic";
124 };
125
126 status: power-green {
127 label = "mbl:green:power";
128 gpios = <&GPIO1 5 GPIO_ACTIVE_HIGH>;
129 };
130
131 power-blue {
132 label = "mbl:blue:power";
133 gpios = <&GPIO1 6 GPIO_ACTIVE_HIGH>;
134 };
135 };
136
137 gpio_keys_polled {
138 compatible = "gpio-keys-polled";
139 #address-cells = <1>;
140 #size-cells = <0>;
141 poll-interval = <60>; /* 3 * 20 = 60ms */
142 autorepeat;
143
144 button@1 {
145 label = "Reset button";
146 linux,code = <KEY_RESTART>;
147 gpios = <&GPIO2 2 GPIO_ACTIVE_LOW>;
148 };
149 };
150 };
151
152 &CRYPTO {
153 status = "okay";
154 };
155
156 &PKA {
157 status = "okay";
158 };
159
160 &TRNG {
161 status = "okay";
162 };
163
164 &SATA1 {
165 status = "okay";
166 };
167
168 &UART0 {
169 status = "okay";
170 };
171
172 &EMAC0 {
173 status = "okay";
174 };
175
176 &SATA1 {
177 status = "okay";
178 };