summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-05-25 15:51:42 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-25 15:51:41 -0700
commit3b0f0430c6fa1a63ff7cf0db652e543ee6d489e4 (patch)
tree3cf3551a6ea7f19b93d782a35da01f71c75a2b00
parentc1a961ce2fb4bf74bc051a46d911b99fa9e56d92 (diff)
parent5980a4dca56a22cda56e99f4a1b9e4c7e5b59f46 (diff)
Merge "ARM: dts: msm: Add USB2 device node for SDM660"
-rw-r--r--arch/arm/boot/dts/qcom/sdm660-common.dtsi56
-rw-r--r--arch/arm/boot/dts/qcom/sdm660-pm.dtsi8
-rw-r--r--drivers/usb/dwc3/core.h2
-rw-r--r--drivers/usb/dwc3/dwc3-msm.c11
-rw-r--r--drivers/usb/phy/phy-msm-qusb.c3
5 files changed, 70 insertions, 10 deletions
diff --git a/arch/arm/boot/dts/qcom/sdm660-common.dtsi b/arch/arm/boot/dts/qcom/sdm660-common.dtsi
index f933586183ec..ba3248b2985e 100644
--- a/arch/arm/boot/dts/qcom/sdm660-common.dtsi
+++ b/arch/arm/boot/dts/qcom/sdm660-common.dtsi
@@ -267,10 +267,8 @@
qusb_phy0: qusb@c012000 {
compatible = "qcom,qusb2phy";
reg = <0x0c012000 0x180>,
- <0x01fcb24c 0x4>,
<0x00188018 0x4>;
reg-names = "qusb_phy_base",
- "tcsr_clamp_dig_n_1p8",
"ref_clk_addr";
vdd-supply = <&pm660l_l1>;
vdda18-supply = <&pm660_l10>;
@@ -456,6 +454,54 @@
qcom,reset-ep-after-lpm-resume;
};
+ usb2s: hsusb@c200000 {
+ compatible = "qcom,dwc-usb3-msm";
+ reg = <0x0c200000 0xfc000>,
+ <0x0c016000 0x400>;
+ reg-names = "core_base",
+ "ahb2phy_base";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ interrupts = <0 348 0>, <0 144 0>;
+ interrupt-names = "hs_phy_irq", "pwr_event_irq";
+
+ qcom,msm-bus,name = "usb-hs";
+ qcom,msm-bus,num-cases = <2>;
+ qcom,msm-bus,num-paths = <1>;
+ qcom,msm-bus,vectors-KBps =
+ <87 512 0 0>,
+ <87 512 60000 800000>;
+
+ qcom,pm-qos-latency = <52>; /* CPU-CLUSTER-WFI-LVL latency +1 */
+ clocks = <&clock_gcc GCC_USB20_MASTER_CLK>,
+ <&clock_gcc GCC_CFG_NOC_USB2_AXI_CLK>,
+ <&clock_gcc GCC_USB20_MOCK_UTMI_CLK>,
+ <&clock_gcc GCC_USB20_SLEEP_CLK>,
+ <&clock_rpmcc CXO_DWC3_CLK>,
+ <&clock_gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>;
+ clock-names = "core_clk", "iface_clk", "utmi_clk", "sleep_clk",
+ "xo", "cfg_ahb_clk";
+ qcom,core-clk-rate = <60000000>;
+ resets = <&clock_gcc GCC_USB_20_BCR>;
+ reset-names = "core_reset";
+
+ status = "disabled";
+ dwc3@c200000 {
+ compatible = "snps,dwc3";
+ reg = <0x0c200000 0xc8d0>;
+ interrupt-parent = <&intc>;
+ interrupts = <0 143 0>;
+ usb-phy = <&qusb_phy1>, <&usb_nop_phy>;
+ maximum-speed = "high-speed";
+ snps,nominal-elastic-buffer;
+ snps,is-utmi-l1-suspend;
+ snps,hird-threshold = /bits/ 8 <0x0>;
+ dr_mode = "host";
+ };
+ };
+
qusb_phy1: qusb@c014000 {
compatible = "qcom,qusb2phy";
reg = <0x0c014000 0x180>,
@@ -465,7 +511,7 @@
vdd-supply = <&pm660l_l1>;
vdda18-supply = <&pm660_l10>;
vdda33-supply = <&pm660l_l7>;
- qcom,vdd-voltage-level = <1 5 7>;
+ qcom,vdd-voltage-level = <0 925000 925000>;
qcom,qusb-phy-init-seq = <0xF8 0x80
0xB3 0x84
0x83 0x88
@@ -490,6 +536,10 @@
reset-names = "phy_reset";
};
+ usb_nop_phy: usb_nop_phy {
+ compatible = "usb-nop-xceiv";
+ };
+
sdhc_1: sdhci@c0c4000 {
compatible = "qcom,sdhci-msm-v5";
reg = <0xc0c4000 0x1000>, <0xc0c5000 0x1000>;
diff --git a/arch/arm/boot/dts/qcom/sdm660-pm.dtsi b/arch/arm/boot/dts/qcom/sdm660-pm.dtsi
index 1624975028c5..21fab4923331 100644
--- a/arch/arm/boot/dts/qcom/sdm660-pm.dtsi
+++ b/arch/arm/boot/dts/qcom/sdm660-pm.dtsi
@@ -341,8 +341,10 @@
qcom,gic-map =
<0x02 216>, /* tsens1_tsens_upper_lower_int */
<0x34 275>, /* qmp_usb3_lfps_rxterm_irq_cx */
- <0x4f 379>, /* qusb2phy_intr */
- <0x51 379>, /* qusb2phy_intr */
+ <0x4f 379>, /* qusb2phy_intr for Dm */
+ <0x50 380>, /* qusb2phy_intr for Dm for secondary PHY */
+ <0x51 379>, /* qusb2phy_intr for Dp */
+ <0x52 380>, /* qusb2phy_intr for Dp for secondary PHY */
<0x57 358>, /* ee0_apps_hlos_spmi_periph_irq */
<0x5b 519>, /* lpass_pmu_tmr_timeout_irq_cx */
<0xff 16>, /* APC[0-7]_qgicQTmrHypPhysIrptReq */
@@ -484,6 +486,7 @@
<0xff 208>, /* lpi_dir_conn_irq_apps[0] */
<0xff 209>, /* lpi_dir_conn_irq_apps[1] */
<0xff 210>, /* lpi_dir_conn_irq_apps[2] */
+ <0xff 212>, /* usb30s_power_event_irq */
<0xff 213>, /* secure_wdog_bark_irq */
<0xff 214>, /* tsens1_tsens_max_min_int */
<0xff 215>, /* o_bimc_intr[0] */
@@ -610,7 +613,6 @@
<0xff 364>, /* osmmu_CIrpt[3] */
<0xff 365>, /* ipa_irq[0] */
<0xff 366>, /* osmmu_PMIrpt */
- <0xff 380>, /* qusb2phy_intr */
<0xff 381>, /* osmmu_CIrpt[6] */
<0xff 382>, /* osmmu_CIrpt[7] */
<0xff 385>, /* osmmu_CIrpt[12] */
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 453eee734b23..1b4fb562ce4b 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -840,6 +840,7 @@ struct dwc3_scratchpad_array {
* @irq: irq number
* @bh: tasklet which handles the interrupt
* @irq_cnt: total irq count
+ * @last_irq_cnt: last irq count
* @bh_completion_time: time taken for taklet completion
* @bh_handled_evt_cnt: no. of events handled by tasklet per interrupt
* @bh_dbg_index: index for capturing bh_completion_time and bh_handled_evt_cnt
@@ -1028,6 +1029,7 @@ struct dwc3 {
/* IRQ timing statistics */
int irq;
unsigned long irq_cnt;
+ unsigned long last_irq_cnt;
unsigned long ep_cmd_timeout_cnt;
unsigned bh_completion_time[MAX_INTR_STATS];
unsigned bh_handled_evt_cnt[MAX_INTR_STATS];
diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c
index ad9d6cc4e23f..4ed46d9ca279 100644
--- a/drivers/usb/dwc3/dwc3-msm.c
+++ b/drivers/usb/dwc3/dwc3-msm.c
@@ -3321,16 +3321,19 @@ static void msm_dwc3_perf_vote_work(struct work_struct *w)
struct dwc3_msm *mdwc = container_of(w, struct dwc3_msm,
perf_vote_work.work);
struct dwc3 *dwc = platform_get_drvdata(mdwc->dwc3);
- static unsigned long last_irq_cnt;
bool in_perf_mode = false;
+ int latency = mdwc->pm_qos_latency;
+
+ if (!latency)
+ return;
- if (dwc->irq_cnt - last_irq_cnt >= PM_QOS_THRESHOLD)
+ if (dwc->irq_cnt - dwc->last_irq_cnt >= PM_QOS_THRESHOLD)
in_perf_mode = true;
pr_debug("%s: in_perf_mode:%u, interrupts in last sample:%lu\n",
- __func__, in_perf_mode, (dwc->irq_cnt - last_irq_cnt));
+ __func__, in_perf_mode, (dwc->irq_cnt - dwc->last_irq_cnt));
- last_irq_cnt = dwc->irq_cnt;
+ dwc->last_irq_cnt = dwc->irq_cnt;
msm_dwc3_perf_vote_update(mdwc, in_perf_mode);
schedule_delayed_work(&mdwc->perf_vote_work,
msecs_to_jiffies(1000 * PM_QOS_SAMPLE_SEC));
diff --git a/drivers/usb/phy/phy-msm-qusb.c b/drivers/usb/phy/phy-msm-qusb.c
index 5867c6c204c9..6a2529ec1511 100644
--- a/drivers/usb/phy/phy-msm-qusb.c
+++ b/drivers/usb/phy/phy-msm-qusb.c
@@ -752,6 +752,9 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend)
writel_relaxed(0x00,
qphy->base + QUSB2PHY_PORT_INTR_CTRL);
+ /* Disable PHY */
+ writel_relaxed(POWER_DOWN,
+ qphy->base + QUSB2PHY_PORT_POWERDOWN);
/* Make sure that above write is completed */
wmb();