apm821xx: use SPDX-License-identifiers
[openwrt/staging/stintel.git] / target / linux / apm821xx / dts / netgear-wndr4700.dts
index 2e0addf74b0b4951d585723495500a0069826837..f711eb7782e46689bc963a5040ddd5bc7c35e1bb 100644 (file)
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * Device Tree Source for Netgear WNDR4700/WNDR4720 Series
  *
  * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without
- * any warranty of any kind, whether express or implied.
  */
 
 /dts-v1/;
@@ -15,7 +12,7 @@
 
 / {
        model = "Netgear WNDR4700/WNDR4720 Series";
-       compatible = "netgear,wndr4700";
+       compatible = "netgear,wndr4700", "apm,bluestone";
 
        aliases {
                serial0 = &UART0;
@@ -26,7 +23,7 @@
        };
 
        chosen {
-               linux,stdout-path = "/plb/opb/serial@ef600300";
+               stdout-path = "/plb/opb/serial@ef600300:115200n8";
        };
 
        thermal-zones {
 
                        thermal-sensors = <&temp0 1>;
 
+                       /*
+                        * REVISIT:
+                        *
+                        * Add the <&drive_temp>; sensor there and wire up
+                        * the coefficients = <1 1>; property.
+                        *
+                        * Note: The kernel does not yet support more than
+                        * one sensor (see of_thermal.c's function:
+                        * thermal_of_build_thermal_zon()). Once this is
+                        * implemented.
+                        */
+
                        trips {
                                /*
                                 * Once the thermal governers are a bit smarter
                                 * and do hysteresis properly, we can disable
                                 * the fan when the HDD and CPU has < 39 C.
                                 */
-                               cpu_alert0: cpu-alert0 {
+                               cpu_alert0: board-alert0 {
                                        temperature = <25000>;
                                        hysteresis = <2000>;
                                        type = "active";
@@ -79,7 +88,7 @@
                                };
 
                                cpu_alert6: cpu-alert6 {
-                                       temperature = <850000>; /* millicelsius */
+                                       temperature = <85000>; /* millicelsius */
                                        hysteresis = <2000>; /* millicelsius */
                                        type = "active";
                                };
 
                                map1 {
                                        trip = <&cpu_alert1>;
-                                       cooling-device = <&fan0 1 87>;
+                                       cooling-device = <&fan0 1 76>;
                                };
 
                                map2 {
                                        trip = <&cpu_alert2>;
-                                       cooling-device = <&fan0 88 100>;
+                                       cooling-device = <&fan0 77 101>;
                                };
 
                                map3 {
                                        trip = <&cpu_alert3>;
-                                       cooling-device = <&fan0 101 147>;
+                                       cooling-device = <&fan0 102 147>;
                                };
 
                                map4 {
 
 &SATA1 {
        status = "okay";
+
+       /*
+        * This drive may have a temperature sensor with a
+        * thermal zone we can use for thermal control of the
+        * chassis temperature using the fan.
+        */
+
+       drive_temp: sata-port@0 {
+               reg = <0>;
+               #thermal-sensor-cells = <0>;
+       };
 };
 
 &USBOTG0 {
                status = "okay";
                /* 128 MiB Nand Flash */
                nand {
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition0,0@0x00000000 {
+                       partition0,0@0 {
                                label = "NAND 128MiB 3,3V 8-bit";
                                reg = <0x00000000 0x08000000>;
                                read-only;
                        };
 
-                       partition0,1@0x00000000 {
+                       partition0,1@0 {
                                label = "uboot";
                                reg = <0x00000000 0x00180000>;
                                read-only;
                        };
 
-                       partition0,2@0x00180000 {
+                       partition0,2@180000 {
                                label = "device-tree";
                                reg = <0x00180000 0x00020000>;
                        };
 
-                       partition0,3@0x001a0000 {
+                       partition0,3@180000 {
                                label = "kernel";
-                               reg = <0x001a0000 0x001e0000>;
+                               reg = <0x00180000 0x00380000>;
                                /*
-                                * will also contain a fake/empty
-                                * rootfs to fool Netgear's uboot
-                                * rootfs integrety checks.
+                                * device-tree is @ 0x00180000 - 0x001fffff
+                                * kernel starts from 0x200000.
+                                * this is coded into netgear's u-boot.
+                                *
+                                * this partition will also contain a
+                                * fake/empty rootfs at the end to fool
+                                * Netgear's uboot rootfs integrety checks.
                                 */
                        };
 
-                       partition0,4@0x00380000 {
+                       partition0,4@500000 {
                                label = "ubi";
-                               reg = <0x00380000 0x01660000>;
+                               reg = <0x00500000 0x014e0000>;
                        };
 
-                       partition0,5@0x019e0000 {
+                       partition0,5@19e0000 {
                                label = "config";
                                reg = <0x019e0000 0x00080000>;
                                read-only;
                        };
 
-                       partition0,6@0x01a60000 {
+                       partition0,6@1a60000 {
                                label = "pot";
                                reg = <0x01a60000 0x00080000>;
                                read-only;
                        };
 
-                       partition0,7@0x01ae0000 {
+                       partition0,7@1ae0000 {
                                label = "traffic_meter";
                                reg = <0x01ae0000 0x00300000>;
                                read-only;
                        };
 
-                       partition0,8@0x01de0000 {
+                       partition0,8@1de0000 {
                                label = "language";
                                reg = <0x01de0000 0x001c0000>;
                                read-only;
                        };
 
-                       partition0,9@0x01fa0000 {
+                       partition0,9@1fa0000 {
                                label = "ecos";
                                reg = <0x01fa0000 0x06020000>;
                                read-only;
                        };
 
-                       partition0,10@0x07fc0000 {
+                       partition0,10@7fc0000 {
                                label = "wifi_data";
                                reg = <0x07fc0000 0x00040000>;
                                read-only;
                        };
 
-                       partition0,11@0x00180000 {
+                       partition0,11@180000 {
                                label = "firmware";
                                reg = <0x00180000 0x01860000>;
                                read-only;
 
 &GPIO0 {
        status = "okay";
-       #interrupt-cells = <2>;
-       interrupt-controller;
-       interrupts-extended = <&UIC1 0x14>,
-                             <&UIC1 0x1e>,
-                             <&UIC1 0x1f>,
-                             <&UIC2 0x19>;
 };
 
 &IIC0 {
 &EMAC0 {
        status = "okay";
        phy-handle = <&phy0>;
+       fifo-entry-size = <10>;
 
        mdio {
                #address-cells = <1>;
                phy0: ethernet-phy@0 {
                        device_type = "ethernet-phy";
                        reg = <0>;
+                       qca,mib-poll-interval = <500>;
+
                        qca,ar8327-initvals = <
                                0x0010 0x40000000
                                0x0624 0x007f7f7f
 };
 
 &POB0 {
-       gpio_keys_polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               #interrupt-cells = <2>;
-               autorepeat;
-               poll-interval = <60>;   /* 3 * 20 = 60ms */
+
+       keys {
+               compatible = "gpio-keys";
 
                reset {
                        label = "Reset button";
+                       gpios = <&GPIO0 15 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
-                       gpios = <&GPIO0 15 GPIO_ACTIVE_HIGH>;
                        interrupt-parent = <&UIC1>;
                        interrupts = <0x14 IRQ_TYPE_EDGE_FALLING>;
+                       debounce-interval = <60>;
                };
 
                backup_hd {
                        label = "Backup HD button";
-                       gpios = <&GPIO0 19 GPIO_ACTIVE_HIGH>;
+                       gpios = <&GPIO0 19 GPIO_ACTIVE_LOW>;
                        linux,code = <BTN_0>;
                        interrupt-parent = <&UIC1>;
                        interrupts = <0x1e IRQ_TYPE_EDGE_FALLING>;
+                       debounce-interval = <60>;
                };
 
                rfkill {
                        label = "RFKILL button";
-                       gpios = <&GPIO0 20 GPIO_ACTIVE_HIGH>;
+                       gpios = <&GPIO0 20 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RFKILL>;
                        interrupt-parent = <&UIC1>;
                        interrupts = <0x1f IRQ_TYPE_EDGE_FALLING>;
+                       debounce-interval = <60>;
                };
 
                wps {
                        label = "WPS button";
-                       gpios = <&GPIO0 23 GPIO_ACTIVE_HIGH>;
+                       gpios = <&GPIO0 23 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WPS_BUTTON>;
                        interrupt-parent = <&UIC2>;
                        interrupts = <0x19 IRQ_TYPE_EDGE_FALLING>;
-               };
-
-               sdcard {
-                       label = "SDCard inserted";
-                       gpios = <&GPIO0 7 GPIO_ACTIVE_LOW>;
-                       linux,code = <BTN_1>;
+                       debounce-interval = <60>;
                };
        };
 
-       gpio-leds {
+       leds {
                compatible = "gpio-leds";
                status: power-green {
                        label = "wndr4700:green:power";
                usb-blue {
                        label = "wndr4700:blue:usb";
                        gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>;
+                       trigger-sources = <&usb2_port 1>, <&usb2_port 2>,
+                                         <&usb3_port 1>, <&usb3_port 2>;
+                       linux,default-trigger = "usbport";
                };
 
                logo-white {
                hd-green {
                        label = "wndr4700:green:hd";
                        gpios = <&GPIO0 14 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "disk-activity";
                };
 
                hd-red {
                wlan-blue {
                        label = "wndr4700:blue:wlan";
                        gpios = <&GPIO0 18 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "phy0tpt";
                };
        };
 };
 
 &PCIE0 {
        status = "okay";
+
+       /*
+        * relevant lspci topology:
+        *
+        *      -+-[0000:40]---00.0-[41-7f]----00.0-[42-45]--+-02.0-[43]----00.0
+        *                                                   +-03.0-[44]----00.0
+        *                                                   \-04.0-[45]----00.0
+        *
+        */
+
+       bridge@64,0 {
+               reg = <0x00400000 0 0 0 0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               ranges;
+
+               bridge@65,0 {
+                       /* IDT PES4T4 PCI Express Switch */
+                       compatible = "pci111d,803a";
+                       reg = <0x00410000 0 0 0 0>;
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       bridge@66,2 {
+                               compatible = "pci111d,803a";
+                               reg = <0x00421000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               ranges;
+
+                               wifi0: wifi@67,0 {
+                                       /* Atheros AR9380 5GHz */
+                                       compatible = "pci168c,0030";
+                                       reg = <0x00430000 0 0 0 0>;
+                                       qca,no-eeprom;
+                                       /* wifi CAL & MAC is stored in nvram */
+
+                                       /*
+                                        * Because this was such a pain.
+                                        * Here's the full device path:
+                                        * pci0000:40/0000:40:00.0/0000:41:00.0/0000:42:02.0/0000:43:00.0
+                                        */
+                               };
+                       };
+
+                       bridge@66,3 {
+                               compatible = "pci111d,803a";
+                               reg = <0x00421800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               ranges;
+
+                               wifi1: wifi@68,0 {
+                                       /* Atheros AR9381 2.4GHz */
+                                       compatible = "pci168c,0033";
+                                       reg = <0x00440000 0 0 0 0>;
+                                       qca,no-eeprom;
+                                       /* wifi CAL & MAC is stored in nvram */
+                               };
+                       };
+
+                       bridge@66,4 {
+                               compatible = "pci111d,803a";
+                               reg = <0x00422000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               ranges;
+
+                               usb1: usb@69,0 {
+                                       /* Renesas uPD720202 */
+                                       compatible = "pci1912,0015";
+                                       reg = <0x00450000 0 0 0 0>;
+
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       usb2_port: port@1 {
+                                               reg = <1>;
+                                               #trigger-source-cells = <1>;
+                                       };
+
+                                       usb3_port: port@2 {
+                                               reg = <2>;
+                                               #trigger-source-cells = <1>;
+                                       };
+                               };
+                       };
+               };
+       };
 };
 
 &MSI {