misc: Reorganize modem DT
BH Hsieh [Thu, 7 May 2015 02:26:01 +0000 (10:26 +0800)]
1. Remove "nvidia,use-xhci-hsic" property
2. Centralize modem DT node in common dtsi by chip
3. Remove "nvidia,mdm-sar0-gpio" property

Bug 200076665

Change-Id: Ie78b0fb3b3c32aa74560b16f618dc39934c8fe28
Signed-off-by: BH Hsieh <bhsieh@nvidia.com>
Reviewed-on: http://git-master/r/735385
(cherry picked from commit d29d21798accbd8a016a081751ff5be011a50cab)
Reviewed-on: http://git-master/r/746573
Reviewed-by: Steve Lin <stlin@nvidia.com>
Tested-by: Steve Lin <stlin@nvidia.com>

12 files changed:
Documentation/devicetree/bindings/misc/tegra_usb_modem_power.txt
arch/arm/boot/dts/tegra124-ardbeg-e1780-1000-a00-common.dtsi
arch/arm/boot/dts/tegra124-ardbeg-e1780-1000-a03-common.dtsi
arch/arm/boot/dts/tegra124-platforms/tegra124-modem-common.dtsi [new file with mode: 0644]
arch/arm/boot/dts/tegra124-tn8.dtsi
arch/arm64/boot/dts/tegra132-bowmore-e1971-1100-a00-00.dts
arch/arm64/boot/dts/tegra132-platforms/tegra132-modem-common.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/tegra132-tn8.dtsi
arch/arm64/boot/dts/tegra210-common.dtsi
arch/arm64/boot/dts/tegra210-platforms/tegra210-hawkeye-modem-p2290-1100-a00.dtsi
arch/arm64/boot/dts/tegra210-platforms/tegra210-modem-common.dtsi [new file with mode: 0644]
drivers/misc/tegra-baseband/tegra_usb_modem_power.c

index 36fbbfd..28f2f32 100644 (file)
@@ -25,14 +25,8 @@ Optional properties:
                          IN USE FOR T210 LOKI ONLY (P2530 E03 mother board only)
 - nvidia,num-temp-sensors: integer which specifies temperature sensor count for
                     modem thermal reporting.
-- nvidia,use-xhci-hsic: this property is only set by bootloader SHIM layer
-                    according to odmdata passed. If odmdata bit[26] is set,
-                    this property will be <1> to indicate XHCI HSIC is to
-                    be used as modem interface.
 - nvidia,phy-type: integer 0, 1, or 2, which stand for EHCI HSIC, XHCI HSIC,
-                    or XHCI UTMI. This will be set automatically in driver
-                    according to nvidia,use-xhci-hsic property. This is used
-                    currently only for T210 loki E03 to indicate "XHCI UTMI".
+                    or XHCI UTMI.
 
 Example:
 
@@ -56,7 +50,6 @@ With all properties defined:
         nvidia,num-temp-sensors = <3>;
 
         /* USB PHY interfaces */
-        nvidia,use-xhci-hsic = <1>;
         nvidia,phy-type = <1>;
 
         /* should be disabled by default. Bootloader will determine if this
index c6391d1..3ba556d 100644 (file)
@@ -31,6 +31,7 @@
 #include "panel-s-wqxga-10-1.dtsi"
 #include "tegra124-platforms/tegra124-ardbeg-hdmi-e1780-1000-a00.dtsi"
 #include "tegra124-platforms/tegra124-tn8-camera-e1780-a00.dtsi"
+#include "tegra124-platforms/tegra124-modem-common.dtsi"
 
 / {
        model = "NVIDIA Tegra124 Ardbeg";
                interrupts = <166 0x01>;
     };
 
-       modem {
-               compatible = "nvidia,icera-i500";
-               nvidia,boot-gpio = <&gpio TEGRA_GPIO(O, 5) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-power-report-gpio = <&gpio TEGRA_GPIO(K, 0) GPIO_ACTIVE_LOW>;
-               nvidia,reset-gpio = <&gpio TEGRA_GPIO(S, 3) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-en-gpio = <&gpio TEGRA_GPIO(S, 4) GPIO_ACTIVE_HIGH>;
-               status = "disabled";
-       };
-
        cpu_edp {
                nvidia,edp_limit = <14000>;
        };
index 7413f31..a05556e 100644 (file)
@@ -33,6 +33,7 @@
 #include "panel-a-edp-1080p-14-0.dtsi"
 #include "panel-i-edp-1080p-11-6.dtsi"
 #include "tegra124-platforms/tegra124-ardbeg-hdmi-e1780-1000-a00.dtsi"
+#include "tegra124-platforms/tegra124-modem-common.dtsi"
 
 / {
        model = "NVIDIA Tegra124 Ardbeg";
                interrupts = <166 0x01>;
     };
 
-       modem {
-               compatible = "nvidia,icera-i500";
-               nvidia,boot-gpio = <&gpio TEGRA_GPIO(O, 5) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-power-report-gpio = <&gpio TEGRA_GPIO(K, 0) GPIO_ACTIVE_LOW>;
-               nvidia,reset-gpio = <&gpio TEGRA_GPIO(S, 3) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-en-gpio = <&gpio TEGRA_GPIO(S, 4) GPIO_ACTIVE_HIGH>;
-               status = "disabled";
-       };
-
        cpu_edp {
                nvidia,edp_limit = <14000>;
        };
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-modem-common.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-modem-common.dtsi
new file mode 100644 (file)
index 0000000..cc19b30
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include <dt-bindings/gpio/tegra-gpio.h>
+
+/ {
+       modem {
+               compatible = "nvidia,icera-i500";
+               status = "disabled";
+
+               /* use EHCI HSIC */
+               nvidia,phy-type = <0>;
+
+               nvidia,boot-gpio = <&gpio TEGRA_GPIO(O, 5) GPIO_ACTIVE_LOW>;
+               nvidia,mdm-power-report-gpio = <&gpio TEGRA_GPIO(K, 0) GPIO_ACTIVE_LOW>;
+               nvidia,reset-gpio = <&gpio TEGRA_GPIO(S, 3) GPIO_ACTIVE_LOW>;
+               nvidia,mdm-en-gpio = <&gpio TEGRA_GPIO(S, 4) GPIO_ACTIVE_HIGH>;
+       };
+};
index 9848f08..ed82a80 100644 (file)
@@ -1,4 +1,25 @@
+/*
+ * arch/arm/boot/dts/tegra124-tn8.dtsi
+ *
+ * Copyright (c) 2013-2015, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
 #include "tegra124-soc-shield.dtsi"
+#include "tegra124-platforms/tegra124-modem-common.dtsi"
 
 / {
        serial@70006000 {
                power-supply,extcon-dev = "tegra-udc";
        };
 
-       modem {
-               compatible = "nvidia,icera-i500";
-               nvidia,boot-gpio = <&gpio TEGRA_GPIO(O, 5) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-power-report-gpio = <&gpio TEGRA_GPIO(K, 0) GPIO_ACTIVE_LOW>;
-               nvidia,reset-gpio = <&gpio TEGRA_GPIO(S, 3) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-en-gpio = <&gpio TEGRA_GPIO(S, 4) GPIO_ACTIVE_HIGH>;
-               status = "disabled";
-       };
-
        therm_est_sensor {
                subdev {
                        subdev_names = "Tdiode", "Tboard";
index 5bee3ba..a341491 100644 (file)
@@ -34,6 +34,7 @@
 #include "panel-p-wuxga-10-1.dtsi"
 #include "tegra124-platforms/tegra124-ardbeg-hdmi-e1780-1000-a00.dtsi"
 #include <dt-bindings/thermal/thermal.h>
+#include "tegra132-platforms/tegra132-modem-common.dtsi"
 
 / {
        model = "bowmore";
                interrupts = <166 0x01>;
     };
 
-       modem {
-               compatible = "nvidia,icera-i500";
-               nvidia,boot-gpio = <&gpio TEGRA_GPIO(O, 5) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-power-report-gpio = <&gpio TEGRA_GPIO(K, 0) GPIO_ACTIVE_LOW>;
-               nvidia,reset-gpio = <&gpio TEGRA_GPIO(S, 3) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-en-gpio = <&gpio TEGRA_GPIO(S, 4) GPIO_ACTIVE_HIGH>;
-               status = "disabled";
-       };
-
        ehci@7d004000 {
                avdd_usb-supply = <&ldousb_reg>;
                avdd_pll_utmip-supply = <&palmas_smps8>;
diff --git a/arch/arm64/boot/dts/tegra132-platforms/tegra132-modem-common.dtsi b/arch/arm64/boot/dts/tegra132-platforms/tegra132-modem-common.dtsi
new file mode 100644 (file)
index 0000000..cc19b30
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include <dt-bindings/gpio/tegra-gpio.h>
+
+/ {
+       modem {
+               compatible = "nvidia,icera-i500";
+               status = "disabled";
+
+               /* use EHCI HSIC */
+               nvidia,phy-type = <0>;
+
+               nvidia,boot-gpio = <&gpio TEGRA_GPIO(O, 5) GPIO_ACTIVE_LOW>;
+               nvidia,mdm-power-report-gpio = <&gpio TEGRA_GPIO(K, 0) GPIO_ACTIVE_LOW>;
+               nvidia,reset-gpio = <&gpio TEGRA_GPIO(S, 3) GPIO_ACTIVE_LOW>;
+               nvidia,mdm-en-gpio = <&gpio TEGRA_GPIO(S, 4) GPIO_ACTIVE_HIGH>;
+       };
+};
index 8f47afe..5bfa0e9 100644 (file)
@@ -1,5 +1,26 @@
+/*
+ * arch/arm64/boot/dts/tegra132-tn8.dtsi
+ *
+ * Copyright (c) 2014-2015, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
 #define TEGRA132_PACKAGE_IS_DSC
 #include "tegra132-soc-shield.dtsi"
+#include "tegra132-platforms/tegra132-modem-common.dtsi"
 
 / {
        serial@70006000 {
                status = "disabled";
        };
 
-       modem {
-               compatible = "nvidia,icera-i500";
-               nvidia,boot-gpio = <&gpio TEGRA_GPIO(O, 5) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-power-report-gpio = <&gpio TEGRA_GPIO(K, 0) GPIO_ACTIVE_LOW>;
-               nvidia,reset-gpio = <&gpio TEGRA_GPIO(S, 3) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-en-gpio = <&gpio TEGRA_GPIO(S, 4) GPIO_ACTIVE_HIGH>;
-               status = "disabled";
-       };
-
        therm_est_sensor {
                subdev {
                        subdev_names = "Tdiode", "Tboard";
index 9328ec6..220b13f 100644 (file)
@@ -22,6 +22,7 @@
 #include <dt-bindings/padctrl/tegra210-pads.h>
 #include "tegra210-platforms/tegra210-prods.dtsi"
 #include "tegra210-platforms/tegra210-ers-touch-e1937-1000-a00.dtsi"
+#include "tegra210-platforms/tegra210-modem-common.dtsi"
 
 / {
        nvidia,dtbbuildtime = __DATE__, __TIME__;
                };
        };
 
-       modem {
-               compatible = "nvidia,icera-i500";
-               nvidia,boot-gpio = <&gpio TEGRA_GPIO(K, 6) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-power-report-gpio = <&gpio TEGRA_GPIO(L, 1) GPIO_ACTIVE_LOW>;
-               nvidia,reset-gpio = <&gpio TEGRA_GPIO(L, 0) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-en-gpio = <&gpio TEGRA_GPIO(K, 7) GPIO_ACTIVE_HIGH>;
-               nvidia,num-temp-sensors = <3>;
-               status = "disabled";
-       };
-
        usb_cd: usb_cd@7009f000 {
                compatible = "nvidia,tegra210-usb-cd";
                reg = <0x0 0x7009f000 0x0 0x1000>;
index ca6dfe4..ddaed35 100644 (file)
  */
 
 
-#include <dt-bindings/gpio/tegra-gpio.h>
+#include "tegra210-platforms/tegra210-modem-common.dtsi"
 
 / {
        modem {
-               compatible = "nvidia,icera-i500";
                nvidia,regulator = "vdd";
-               nvidia,boot-gpio = <&gpio TEGRA_GPIO(K, 6) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-en-gpio = <&gpio TEGRA_GPIO(K, 7) GPIO_ACTIVE_HIGH>;
-               nvidia,reset-gpio = <&gpio TEGRA_GPIO(L, 0) GPIO_ACTIVE_LOW>;
-               nvidia,mdm-power-report-gpio = <&gpio TEGRA_GPIO(L, 1) GPIO_ACTIVE_LOW>;
-               nvidia,num-temp-sensors = <3>;
-               status = "disabled";
        };
 };
 
diff --git a/arch/arm64/boot/dts/tegra210-platforms/tegra210-modem-common.dtsi b/arch/arm64/boot/dts/tegra210-platforms/tegra210-modem-common.dtsi
new file mode 100644 (file)
index 0000000..64db847
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include <dt-bindings/gpio/tegra-gpio.h>
+
+/ {
+       modem {
+               compatible = "nvidia,icera-i500";
+               status = "disabled";
+
+               /* use EHCI HSIC */
+               nvidia,phy-type = <0>;
+
+               nvidia,boot-gpio = <&gpio TEGRA_GPIO(K, 6) GPIO_ACTIVE_LOW>;
+               nvidia,mdm-power-report-gpio = <&gpio TEGRA_GPIO(L, 1) GPIO_ACTIVE_LOW>;
+               nvidia,reset-gpio = <&gpio TEGRA_GPIO(L, 0) GPIO_ACTIVE_LOW>;
+               nvidia,mdm-en-gpio = <&gpio TEGRA_GPIO(K, 7) GPIO_ACTIVE_HIGH>;
+               nvidia,num-temp-sensors = <3>;
+       };
+};
index 9c8552f..b3275b8 100644 (file)
@@ -584,6 +584,7 @@ static ssize_t load_unload_usb_host(struct device *dev,
        mutex_lock(&modem->hc_lock);
        switch (modem->phy_type) {
        case XHCI_HSIC:
+               dev_info(&modem->pdev->dev, "using XHCI_HSIC\n");
                if (host) {
                        if (modem->xusb_roothub &&
                                        !modem->nvhsic_work_queued) {
@@ -606,6 +607,7 @@ static ssize_t load_unload_usb_host(struct device *dev,
                }
                break;
        case EHCI_HSIC:
+               dev_info(&modem->pdev->dev, "using EHCI_HSIC\n");
                pr_info("%s EHCI\n", host ? "Load" : "Unload");
                if (host && !modem->hc) {
                        modem->hc = tegra_usb_host_register(modem);
@@ -615,6 +617,7 @@ static ssize_t load_unload_usb_host(struct device *dev,
                }
                break;
        case XHCI_UTMI:
+               dev_info(&modem->pdev->dev, "using XHCI_UTMI\n");
                modem->hc = host ? (struct platform_device *)1 : NULL;
                break;
        default:
@@ -881,7 +884,6 @@ static int tegra_usb_modem_parse_dt(struct tegra_usb_modem *modem,
        const unsigned int *prop;
        int gpio;
        int ret;
-       u32 use_xhci_hsic = 0;
 
        if (!node)
                return 0;
@@ -943,17 +945,11 @@ static int tegra_usb_modem_parse_dt(struct tegra_usb_modem *modem,
 
        /* determine phy type */
        ret = of_property_read_u32(node, "nvidia,phy-type", &modem->phy_type);
-       if (modem->phy_type != XHCI_UTMI) {
-               ret = of_property_read_u32(node, "nvidia,use-xhci-hsic",
-                       &use_xhci_hsic);
-               modem->phy_type = (ret == 0 && use_xhci_hsic) ? XHCI_HSIC :
-                       EHCI_HSIC;
+       if (ret != 0) {
+               dev_err(&pdev->dev, "DT property 'nvidia,phy-type' read fail!\n");
+               return ret;
        }
 
-       dev_info(&pdev->dev, "using %s\n",
-               modem->phy_type == EHCI_HSIC ? "EHCI HSIC" :
-               modem->phy_type == XHCI_HSIC ? "XHCI HSIC" : "XHCI UTMI");
-
        prop = of_get_property(node, "nvidia,num-temp-sensors", NULL);
        if (prop)
                pdata->num_temp_sensors = be32_to_cpup(prop);