phy: USB and PCIe phy drivers for Qcom chipsets
v4 cover phy: USB and PCIe phy drivers for Qcom chipsets
This patch series adds couple of PHY drivers for Qualcomm chipsets.
a) qcom-qusb2 phy driver: that provides High Speed USB functionality.
b) qcom-qmp phy driver: that is a combo phy providing support for USB3, PCIe, UFS and few other controllers.
The patches are based on next branch of linux-phy tree.
These have been tested on Dragon board db820c hardware with required set of dt patches on integration tree maintained by Linaro landing team for Qualcomm [1].
Couple of other patches [2,3,4] for nvmem are also pulled in for testing. Patch series fixing DMA config for XHCI [5] is also pulled in for testing.
Changes since v3:
- Addressed review comments given by Rob and Stephen for qusb2 phy and qmp phy bindings respectively.
- Addressed review comments given by Stephen and Bjorn for qmp phy driver.
Changes since v2:
- Addressed review comments given by Rob and Stephen for bindings.
- Addressed the review comments given by Stephen for the qusb2 and qmp phy drivers.
Changes since v1:
- Moved device tree binding documentation to separate patches, as suggested by Rob.
- Addressed review comment regarding qfprom accesses by qusb2 phy driver, given by Rob.
- Addressed review comments from Kishon.
- Addressed review comments from Srinivas for QMP phy driver.
- Addressed kbuild warning.
Please see individual patches for detailed changelogs.
[1] https://git.linaro.org/landing-teams/working/qualcomm/kernel.git/log/?h=integration-linux-qcomlt
[2] https://lkml.org/lkml/2016/11/17/21
[3] https://lkml.org/lkml/2016/12/19/18
[4] http://www.spinics.net/lists/linux-arm-msm/msg25483.html
[5] https://lkml.org/lkml/2016/11/17/339
Vivek Gautam (4):
dt-bindings: phy: Add support for QUSB2 phy
phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
dt-bindings: phy: Add support for QMP phy
phy: qcom-qmp: new qmp phy driver for qcom-chipsets
.../devicetree/bindings/phy/qcom-qmp-phy.txt | 76 ++ .../devicetree/bindings/phy/qcom-qusb2-phy.txt | 45 + drivers/phy/Kconfig | 18 + drivers/phy/Makefile | 2 + drivers/phy/phy-qcom-qmp.c | 1206 ++++++++++++++++++++ drivers/phy/phy-qcom-qusb2.c | 539 +++++++++ 6 files changed, 1886 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt create mode 100644 Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt create mode 100644 drivers/phy/phy-qcom-qmp.c create mode 100644 drivers/phy/phy-qcom-qusb2.c
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v4 1/4 dt-bindings: phy: Add support for QUSB2 phy
Qualcomm chipsets have QUSB2 phy controller that provides HighSpeed functionality for DWC3 controller. Adding dt binding information for the same.
---
Changes since v3:
- Added 'Acked-by' from Rob.
- Removed 'reset-names' and 'nvmem-cell-names' from the bindings since we use only one cell.
Changes since v2:
- Removed binding for "ref_clk_src" since we don't request this clock in the driver.
- Addressed s/vdda-phy-dpdm/vdda-phy-dpdm-supply.
- Addressed s/ref_clk/ref. Don't need to add '_clk' suffix to clock names.
- Addressed s/tune2_hstx_trim_efuse/tune2_hstx_trim. Don't need to add 'efuse' suffix to nvmem cell.
- Addressed s/qusb2phy/phy for the node name.
Changes since v1:
- New patch, forked out of the original driver patch:
"phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips"
- Updated dt bindings to remove 'hstx-trim-bit-offset' and 'hstx-trim-bit-len' bindings.
.../devicetree/bindings/phy/qcom-qusb2-phy.txt | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt
Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt new file +45 -0
@@ -0,0 +1,45 @@ +Qualcomm QUSB2 phy controller +============================= + +QUSB2 controller supports LS/FS/HS usb connectivity on Qualcomm chipsets. + +Required properties: + - compatible: compatible list, contains "qcom,msm8996-qusb2-phy". + - reg: offset and length of the PHY register set. + - #phy-cells: must be 0. + + - clocks: a list of phandles and clock-specifier pairs, + one for each entry in clock-names. + - clock-names: must be "cfg_ahb" for phy config clock, + "ref" for 19.2 MHz ref clk, + "iface" for phy interface clock (Optional). + + - vdd-phy-supply: Phandle to a regulator supply to PHY core block. + - vdda-pll-supply: Phandle to 1.8V regulator supply to PHY refclk pll block. + - vdda-phy-dpdm-supply: Phandle to 3.1V regulator supply to Dp/Dm port signals. + + - resets: Phandle to reset to phy block. + +Optional properties: + - nvmem-cells: Phandle to nvmem cell that contains 'HS Tx trim' + tuning parameter value for qusb2 phy. + + - qcom,tcsr-syscon: Phandle to TCSR syscon register region. + +Example: + hsusb_phy: phy@7411000 { + compatible = "qcom,msm8996-qusb2-phy"; + reg = <0x07411000 0x180>; + #phy-cells = <0>; + + clocks = <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, + <&gcc GCC_RX1_USB2_CLKREF_CLK>, + clock-names = "cfg_ahb", "ref"; + + vdd-phy-supply = <&pm8994_s2>; + vdda-pll-supply = <&pm8994_l12>; + vdda-phy-dpdm-supply = <&pm8994_l24>; + + resets = <&gcc GCC_QUSB2PHY_PRIM_BCR>; + nvmem-cells = <&qusb2p_hstx_trim>; + };
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v4 2/4 phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
In reply to Vivek GautamPHY transceiver driver for QUSB2 phy controller that provides HighSpeed functionality for DWC3 controller present on Qualcomm chipsets.
---
Changes since v3:
- Added 'Reviewed-by' from Stephen.
- Fixed debug message for qusb2_phy_set_tune2_param().
- Replaced devm_reset_control_get() with devm_reset_control_get_by_index() since we are requesting only one reset.
- Updated devm_nvmem_cell_get() with a NULL cell id.
- Made error labels more idiomatic.
- Refactored qusb2_setbits() and qusb2_clrbits() a little bit to accept base address and register offset as two separate arguments.
Changes since v2:
- Removed selecting 'RESET_CONTROLLER' config.
- Added error handling for clk_prepare_enable paths.
- Removed explicitly setting ref_clk rate to 19.2 MHz. Don't need to do that since 'xo' is modeled as parent to this clock.
- Removed 'ref_clk_src' handling. Driver doesn't need to request and handle this clock.
- Moved nvmem_cell_get() to probe function.
- Simplified phy pll status handling.
- Using of_device_get_match_data() to get match data.
- Uniformly using lowercase for hex numbers.
- Fixed sparse warnings.
- Using shorter variable names in structure and in functions.
- Handling various comment style shortcomings.
Changes since v1:
- removed reference to clk_enabled/pwr_enabled.
- moved clock and regulator enable code to phy_power_on/off() callbacks.
- fixed return on EPROBE_DEFER in qusb2_phy_probe().
- fixed phy create and phy register ordering.
- removed references to non-lkml links from commit message.
- took care of other minor nits.
- Fixed coccinelle warnings -
'PTR_ERR applied after initialization to constant'
- Addressed review comment, regarding qfprom access for tune2 param value. This driver is now based on qfprom patch[1] that allows byte access now.
drivers/phy/Kconfig | 10 + drivers/phy/Makefile | 1 + drivers/phy/phy-qcom-qusb2.c | 539 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 550 insertions(+) create mode 100644 drivers/phy/phy-qcom-qusb2.c
drivers/phy/Kconfig +10 -0
@@ -430,6 +430,16 @@ config PHY_STIH407_USB Enable this support to enable the picoPHY device used by USB2 and USB3 controllers on STMicroelectronics STiH407 SoC families. +config PHY_QCOM_QUSB2 + tristate "Qualcomm QUSB2 PHY Driver" + depends on OF && (ARCH_QCOM || COMPILE_TEST) + select GENERIC_PHY + help + Enable this to support the HighSpeed QUSB2 PHY transceiver for USB + controllers on Qualcomm chips. This driver supports the high-speed + PHY which is usually paired with either the ChipIdea or Synopsys DWC3 + USB IPs on MSM SOCs. + config PHY_QCOM_UFS tristate "Qualcomm UFS PHY driver" depends on OF && ARCH_QCOM
drivers/phy/Makefile +1 -0
@@ -49,6 +49,7 @@ obj-$(CONFIG_PHY_ST_SPEAR1310_MIPHY) += phy-spear1310-miphy.o obj-$(CONFIG_PHY_ST_SPEAR1340_MIPHY) += phy-spear1340-miphy.o obj-$(CONFIG_PHY_XGENE) += phy-xgene.o obj-$(CONFIG_PHY_STIH407_USB) += phy-stih407-usb.o +obj-$(CONFIG_PHY_QCOM_QUSB2) += phy-qcom-qusb2.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-20nm.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-14nm.o
drivers/phy/phy-qcom-qusb2.c new file +539 -0
539 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Hi,
Quoted 160 lines · Vivek Gautam
PHY transceiver driver for QUSB2 phy controller that provides HighSpeed functionality for DWC3 controller present on Qualcomm chipsets.
Signed-off-by Vivek Gautam <[email protected]>Reviewed-by Stephen Boyd <[email protected]>---
Changes since v3:
- Added 'Reviewed-by' from Stephen.
- Fixed debug message forqusb2_phy_set_tune2_param().
- Replaceddevm_reset_control_get()withdevm_reset_control_get_by_index()since we are requesting only one reset.
- Updateddevm_nvmem_cell_get()with a NULL cell id.
- Made error labels more idiomatic.
- Refactoredqusb2_setbits()andqusb2_clrbits()a little bit to accept base address and register offset as two separate arguments.Changes since v2:
- Removed selecting 'RESET_CONTROLLER' config.
- Added error handling forclk_prepare_enablepaths.
- Removed explicitly settingref_clkrate to 19.2 MHz. Don't need to do that since 'xo' is modeled as parent to this clock.
- Removed 'ref_clk_src' handling. Driver doesn't need to request and handle this clock.
- Movednvmem_cell_get()to probe function.
- Simplified phy pll status handling.
- Usingof_device_get_match_data()to get match data.
- Uniformly using lowercase for hex numbers.
- Fixed sparse warnings.
- Using shorter variable names in structure and in functions.
- Handling various comment style shortcomings.Changes since v1:
- removed reference to clk_enabled/pwr_enabled.
- moved clock and regulator enable code to phy_power_on/off() callbacks.
- fixed return onEPROBE_DEFERinqusb2_phy_probe().
- fixed phy create and phy register ordering.
- removed references to non-lkml links from commit message.
- took care of other minor nits.
- Fixed coccinelle warnings -
'PTR_ERRapplied after initialization to constant'
- Addressed review comment, regarding qfprom access for tune2 param value. This driver is now based on qfprom patch[1] that allows byte access now.drivers/phy/Kconfig | 10 + drivers/phy/Makefile | 1 + drivers/phy/phy-qcom-qusb2.c | 539 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 550 insertions(+) create mode 100644 drivers/phy/phy-qcom-qusb2.cdrivers/phy/Kconfig +10
-0@@ -430,6 +430,16 @@ config PHY_STIH407_USB Enable this support to enable the picoPHY device used by USB2 and USB3 controllers on STMicroelectronics STiH407 SoC families. +config PHY_QCOM_QUSB2 + tristate "Qualcomm QUSB2 PHY Driver" + depends on OF && (ARCH_QCOM || COMPILE_TEST) + select GENERIC_PHY + help + Enable this to support the HighSpeed QUSB2 PHY transceiver for USB + controllers on Qualcomm chips. This driver supports the high-speed + PHY which is usually paired with either the ChipIdea or Synopsys DWC3 + USB IPs on MSM SOCs. + config PHY_QCOM_UFS tristate "Qualcomm UFS PHY driver" depends on OF && ARCH_QCOMdrivers/phy/Makefile +1
-0@@ -49,6 +49,7 @@ obj-$(CONFIG_PHY_ST_SPEAR1310_MIPHY) += phy-spear1310-miphy.o obj-$(CONFIG_PHY_ST_SPEAR1340_MIPHY) += phy-spear1340-miphy.o obj-$(CONFIG_PHY_XGENE) += phy-xgene.o obj-$(CONFIG_PHY_STIH407_USB) += phy-stih407-usb.o +obj-$(CONFIG_PHY_QCOM_QUSB2) += phy-qcom-qusb2.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-20nm.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-14nm.odrivers/phy/phy-qcom-qusb2.c new file +70
-0@@ -0,0 +1,539 @@ +/* +* Copyright (c) 2016, The Linux Foundation. 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 version 2 and +* only version 2 as published by the Free Software Foundation. +* +* 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. +*/ + +#include <linux/clk.h> +#include <linux/delay.h> +#include <linux/err.h> +#include <linux/io.h> +#include <linux/kernel.h> +#include <linux/mfd/syscon.h> +#include <linux/module.h> +#include <linux/nvmem-consumer.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/phy/phy.h> +#include <linux/platform_device.h> +#include <linux/regmap.h> +#include <linux/regulator/consumer.h> +#include <linux/reset.h> +#include <linux/slab.h> + +#define QUSB2PHY_PLL_TEST 0x04 +#define CLK_REF_SEL BIT(7) + +#define QUSB2PHY_PLL_TUNE 0x08 +#define QUSB2PHY_PLL_USER_CTL1 0x0c +#define QUSB2PHY_PLL_USER_CTL2 0x10 +#define QUSB2PHY_PLL_AUTOPGM_CTL1 0x1c +#define QUSB2PHY_PLL_PWR_CTRL 0x18 + +#define QUSB2PHY_PLL_STATUS 0x38 +#define PLL_LOCKED BIT(5) + +#define QUSB2PHY_PORT_TUNE1 0x80 +#define QUSB2PHY_PORT_TUNE2 0x84 +#define QUSB2PHY_PORT_TUNE3 0x88 +#define QUSB2PHY_PORT_TUNE4 0x8c +#define QUSB2PHY_PORT_TUNE5 0x90 +#define QUSB2PHY_PORT_TEST2 0x9c + +#define QUSB2PHY_PORT_POWERDOWN 0xb4 +#define CLAMP_N_EN BIT(5) +#define FREEZIO_N BIT(1) +#define POWER_DOWN BIT(0) + +#define QUSB2PHY_REFCLK_ENABLE BIT(0) + +#define PHY_CLK_SCHEME_SEL BIT(0) + +struct qusb2_phy_init_tbl { +unsigned int offset; +unsigned int val; +}; +#define QUSB2_PHY_INIT_CFG (o, v) \ + { \ + .offset = o, \ + .val = v, \ + } + +static const struct qusb2_phy_init_tbl msm8996_init_tbl[] = { +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE1 ,0xf8 ),
drivers/phy/phy-qcom-qusb2.c line 80
Quoted 10 lines
drivers/phy/phy-qcom-qusb2.c new file +10
-0+QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE2 ,0xb3 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE3 ,0x83 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE4 ,0xc0 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_TUNE ,0x30 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_USER_CTL1 ,0x79 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_USER_CTL2 ,0x21 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TEST2 ,0x14 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_AUTOPGM_CTL1 ,0x9f ), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00), +};
I wish all this data comes from device tree and one API in phy-core can do all these settings. Your other driver qcom-qmp also seems to have a bunch of similar settings.
The problem is every vnedor driver adds a bunch of code to perform the same thing again and again when all of these settings can be done by a single phy API.
Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Hi Kishon,
Quoted 177 lines · Kishon Vijay Abraham I
Hi,
Quoted 160 lines · Vivek Gautam
PHY transceiver driver for QUSB2 phy controller that provides HighSpeed functionality for DWC3 controller present on Qualcomm chipsets.
Signed-off-by Vivek Gautam <[email protected]>Reviewed-by Stephen Boyd <[email protected]>---
Changes since v3:
- Added 'Reviewed-by' from Stephen.
- Fixed debug message forqusb2_phy_set_tune2_param().
- Replaceddevm_reset_control_get()withdevm_reset_control_get_by_index()since we are requesting only one reset.
- Updateddevm_nvmem_cell_get()with a NULL cell id.
- Made error labels more idiomatic.
- Refactoredqusb2_setbits()andqusb2_clrbits()a little bit to accept base address and register offset as two separate arguments.Changes since v2:
- Removed selecting 'RESET_CONTROLLER' config.
- Added error handling forclk_prepare_enablepaths.
- Removed explicitly settingref_clkrate to 19.2 MHz. Don't need to do that since 'xo' is modeled as parent to this clock.
- Removed 'ref_clk_src' handling. Driver doesn't need to request and handle this clock.
- Movednvmem_cell_get()to probe function.
- Simplified phy pll status handling.
- Usingof_device_get_match_data()to get match data.
- Uniformly using lowercase for hex numbers.
- Fixed sparse warnings.
- Using shorter variable names in structure and in functions.
- Handling various comment style shortcomings.Changes since v1:
- removed reference to clk_enabled/pwr_enabled.
- moved clock and regulator enable code to phy_power_on/off() callbacks.
- fixed return onEPROBE_DEFERinqusb2_phy_probe().
- fixed phy create and phy register ordering.
- removed references to non-lkml links from commit message.
- took care of other minor nits.
- Fixed coccinelle warnings -
'PTR_ERRapplied after initialization to constant'
- Addressed review comment, regarding qfprom access for tune2 param value. This driver is now based on qfprom patch[1] that allows byte access now.drivers/phy/Kconfig | 10 + drivers/phy/Makefile | 1 + drivers/phy/phy-qcom-qusb2.c | 539 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 550 insertions(+)create mode 100644
drivers/phy/phy-qcom-qusb2.cdrivers/phy/Kconfig +10
-0@@ -430,6 +430,16 @@ config PHY_STIH407_USB Enable this support to enable the picoPHY device used by USB2 and USB3 controllers on STMicroelectronics STiH407 SoC families. +config PHY_QCOM_QUSB2 + tristate "Qualcomm QUSB2 PHY Driver" + depends on OF && (ARCH_QCOM || COMPILE_TEST) + select GENERIC_PHY + help + Enable this to support the HighSpeed QUSB2 PHY transceiver for USB + controllers on Qualcomm chips. This driver supports the high-speed + PHY which is usually paired with either the ChipIdea or Synopsys DWC3 + USB IPs on MSM SOCs. + config PHY_QCOM_UFS tristate "Qualcomm UFS PHY driver" depends on OF && ARCH_QCOMdrivers/phy/Makefile +1
-0@@ -49,6 +49,7 @@ obj-$(CONFIG_PHY_ST_SPEAR1310_MIPHY) += phy-spear1310-miphy.o obj-$(CONFIG_PHY_ST_SPEAR1340_MIPHY) += phy-spear1340-miphy.o obj-$(CONFIG_PHY_XGENE) += phy-xgene.o obj-$(CONFIG_PHY_STIH407_USB) += phy-stih407-usb.o +obj-$(CONFIG_PHY_QCOM_QUSB2) += phy-qcom-qusb2.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-20nm.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-14nm.odrivers/phy/phy-qcom-qusb2.c new file +70
-0@@ -0,0 +1,539 @@ +/* +* Copyright (c) 2016, The Linux Foundation. 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 version 2 and +* only version 2 as published by the Free Software Foundation. +* +* 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. +*/ + +#include <linux/clk.h> +#include <linux/delay.h> +#include <linux/err.h> +#include <linux/io.h> +#include <linux/kernel.h> +#include <linux/mfd/syscon.h> +#include <linux/module.h> +#include <linux/nvmem-consumer.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/phy/phy.h> +#include <linux/platform_device.h> +#include <linux/regmap.h> +#include <linux/regulator/consumer.h> +#include <linux/reset.h> +#include <linux/slab.h> + +#define QUSB2PHY_PLL_TEST 0x04 +#define CLK_REF_SEL BIT(7) + +#define QUSB2PHY_PLL_TUNE 0x08 +#define QUSB2PHY_PLL_USER_CTL1 0x0c +#define QUSB2PHY_PLL_USER_CTL2 0x10 +#define QUSB2PHY_PLL_AUTOPGM_CTL1 0x1c +#define QUSB2PHY_PLL_PWR_CTRL 0x18 + +#define QUSB2PHY_PLL_STATUS 0x38 +#define PLL_LOCKED BIT(5) + +#define QUSB2PHY_PORT_TUNE1 0x80 +#define QUSB2PHY_PORT_TUNE2 0x84 +#define QUSB2PHY_PORT_TUNE3 0x88 +#define QUSB2PHY_PORT_TUNE4 0x8c +#define QUSB2PHY_PORT_TUNE5 0x90 +#define QUSB2PHY_PORT_TEST2 0x9c + +#define QUSB2PHY_PORT_POWERDOWN 0xb4 +#define CLAMP_N_EN BIT(5) +#define FREEZIO_N BIT(1) +#define POWER_DOWN BIT(0) + +#define QUSB2PHY_REFCLK_ENABLE BIT(0) + +#define PHY_CLK_SCHEME_SEL BIT(0) + +struct qusb2_phy_init_tbl { +unsigned int offset; +unsigned int val; +}; +#define QUSB2_PHY_INIT_CFG (o, v) \ + { \ + .offset = o, \ + .val = v, \ + } + +static const struct qusb2_phy_init_tbl msm8996_init_tbl[] = { +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE1 ,0xf8 ),drivers/phy/phy-qcom-qusb2.c line 80
Quoted 10 lines
drivers/phy/phy-qcom-qusb2.c new file +10
-0+QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE2 ,0xb3 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE3 ,0x83 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE4 ,0xc0 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_TUNE ,0x30 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_USER_CTL1 ,0x79 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_USER_CTL2 ,0x21 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TEST2 ,0x14 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_AUTOPGM_CTL1 ,0x9f ), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00), +};I wish all this data comes from device tree and one API in phy-core can do all these settings. Your other driver qcom-qmp also seems to have a bunch of similar settings.
Quoted 2 lines
The problem is every vendor driver adds a bunch of code to perform the same thing again and again when all of these settings can be done by a single phy API.
Yes, i understand this. You have commented similar thing in the patch from Jaehoon - [PATCH V2 2/5] phy: phy-exynos-pcie: Add support for Exynos PCIe phy
I would like to understand the requirements here.
Would you like me to get all this information from the device tree - an array of register offset and value pair, which we can then program by calling a phy_ops (may be calibrate) ? Something of this sort:
phy-calibrate-data = <val1, register_offset1>,
<val2, register_offset2>,
<val3, register_offset3>,
....I am sure having such information in the driver (like i have in my patch) makes the driver look more clumsy.
But, all this data can be pretty huge - a set of some 100+ register-value pairs for QMP phy, for example. So, will it be okay to get this from device tree ? We also note here that such information changes from one IP version to another. I remember Rob having some concerns about it.
Regards
Vivek
Quoted 2 lines
Thanks
Kishon
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Quoted 4 lines · Vivek Gautam
Quoted 3 lines · Kishon Vijay Abraham I
Hi,
On Tuesday 10 January 2017 04:21 PM, Vivek Gautam wrote:
[..]
Quoted 33 lines
Quoted 16 lines
drivers/phy/phy-qcom-qusb2.c line 80
Quoted 12 lines
drivers/phy/phy-qcom-qusb2.c new file +12
-0+static const struct qusb2_phy_init_tbl msm8996_init_tbl[] = { +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE1 ,0xf8 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE2 ,0xb3 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE3 ,0x83 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE4 ,0xc0 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_TUNE ,0x30 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_USER_CTL1 ,0x79 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_USER_CTL2 ,0x21 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TEST2 ,0x14 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_AUTOPGM_CTL1 ,0x9f ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_PWR_CTRL ,0x00 ), +};I wish all this data comes from device tree and one API in phy-core can do all these settings. Your other driver qcom-qmp also seems to have a bunch of similar settings.
Quoted 2 lines
The problem is every vendor driver adds a bunch of code to perform the same thing again and again when all of these settings can be done by a single phy API.
Yes, i understand this. You have commented similar thing in the patch from Jaehoon -
[PATCH V2 2/5] phy: phy-exynos-pcie: Add support for Exynos PCIe phyI would like to understand the requirements here.
Would you like me to get all this information from the device tree - an array of register offset and value pair, which we can then program by calling aphy_ops(may be calibrate) ? Something of this sort:phy-calibrate-data = <val1,
register_offset1>,<val2, register_offset2>, <val3, register_offset3>, ....
Quoted 9 lines
I am sure having such information in the driver (like i have in my patch) makes the driver look more clumsy.
But, all this data can be pretty huge - a set of some 100+ register-value pairs
for QMP phy, for example. So, will it be okay to get this from device tree ? We also note here that such information changes from one IP version to another.
I remember Rob having some concerns about it.
The devicetree is supposed to describe which hardware components a certain device has, most of the time this carries a set of properties to describe how this piece is connected and configured.
A dump of magic register values does not describe how the QMP is connected to anything and is, as far as this patch shows, static for this particular hardware block.
Further more moving this blob to devicetree will not allow us to treat the various QMP configurations as one HW block, as there are other differences as well.
Like many other drivers it's possible to create a generic version that has every bit of logic driven by configuration from devicetree, but like most of those cases this is not the way we split things.
And this has the side effect of keeping the dts files human readable, human understandable and human maintainable.
Regards,
Bjorn
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Quoted 49 lines · Bjorn Andersson
Quoted 4 lines · Vivek Gautam
Quoted 3 lines · Kishon Vijay Abraham I
Hi,
On Tuesday 10 January 2017 04:21 PM, Vivek Gautam wrote:
[..]
Quoted 33 lines
Quoted 16 lines
drivers/phy/phy-qcom-qusb2.c line 80
Quoted 12 lines
drivers/phy/phy-qcom-qusb2.c new file +12
-0+static const struct qusb2_phy_init_tbl msm8996_init_tbl[] = { +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE1 ,0xf8 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE2 ,0xb3 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE3 ,0x83 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE4 ,0xc0 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_TUNE ,0x30 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_USER_CTL1 ,0x79 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_USER_CTL2 ,0x21 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TEST2 ,0x14 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_AUTOPGM_CTL1 ,0x9f ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_PWR_CTRL ,0x00 ), +};I wish all this data comes from device tree and one API in phy-core can do all these settings. Your other driver qcom-qmp also seems to have a bunch of similar settings.
Quoted 2 lines
The problem is every vendor driver adds a bunch of code to perform the same thing again and again when all of these settings can be done by a single phy API.
Yes, i understand this. You have commented similar thing in the patch from Jaehoon -
[PATCH V2 2/5] phy: phy-exynos-pcie: Add support for Exynos PCIe phyI would like to understand the requirements here.
Would you like me to get all this information from the device tree - an array of register offset and value pair, which we can then program by calling aphy_ops(may be calibrate) ? Something of this sort:phy-calibrate-data = <val1,
register_offset1>,<val2, register_offset2>, <val3, register_offset3>, ....Quoted 9 lines
I am sure having such information in the driver (like i have in my patch) makes the driver look more clumsy.
But, all this data can be pretty huge - a set of some 100+ register-value pairs
for QMP phy, for example. So, will it be okay to get this from device tree ? We also note here that such information changes from one IP version to another.
I remember Rob having some concerns about it.
Quoted 7 lines
The devicetree is supposed to describe which hardware components a certain device has, most of the time this carries a set of properties to describe how this piece is connected and configured.
A dump of magic register values does not describe how the QMP is connected to anything and is, as far as this patch shows, static for this particular hardware block.
Yes, that's correct. The QMP and QUSB2 phy init sequences are a bunch of static values for a particular IP version. These values hardly give a meaningful data to put few phy bindings that could be referenced to configure the phy further.
Quoted 11 lines
Further more moving this blob to devicetree will not allow us to treat the various QMP configurations as one HW block, as there are other differences as well.
Like many other drivers it's possible to create a generic version that has every bit of logic driven by configuration from devicetree, but like most of those cases this is not the way we split things.
And this has the side effect of keeping the dts files human readable, human understandable and human maintainable.
That's right. These register-value pairs (100+ for qmp) don't give a human understandable data when put in dts.
Kishon,
Please let me know if you have concerns.
If this looks good otherwise, please consider taking this for 4.11.
Regards
Vivek
Quoted 7 lines
Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Hi,
Quoted 51 lines · Vivek Gautam
Quoted 49 lines · Bjorn Andersson
Quoted 4 lines · Vivek Gautam
Quoted 3 lines · Kishon Vijay Abraham I
Hi,
On Tuesday 10 January 2017 04:21 PM, Vivek Gautam wrote:
[..]
Quoted 42 lines
Quoted 16 lines
drivers/phy/phy-qcom-qusb2.c line 80
Quoted 12 lines
drivers/phy/phy-qcom-qusb2.c new file +12
-0+static const struct qusb2_phy_init_tbl msm8996_init_tbl[] = { +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE1 ,0xf8 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE2 ,0xb3 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE3 ,0x83 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TUNE4 ,0xc0 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_TUNE ,0x30 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_USER_CTL1 ,0x79 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_USER_CTL2 ,0x21 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PORT_TEST2 ,0x14 ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_AUTOPGM_CTL1 ,0x9f ), +QUSB2_PHY_INIT_CFG (QUSB2PHY_PLL_PWR_CTRL ,0x00 ), +};I wish all this data comes from device tree and one API in phy-core can do all these settings. Your other driver qcom-qmp also seems to have a bunch of similar settings.
Quoted 2 lines
The problem is every vendor driver adds a bunch of code to perform the same thing again and again when all of these settings can be done by a single phy API.
Yes, i understand this. You have commented similar thing in the patch from Jaehoon -
[PATCH V2 2/5] phy: phy-exynos-pcie: Add support for Exynos PCIe phyI would like to understand the requirements here.
Would you like me to get all this information from the device tree - an array of register offset and value pair, which we can then program by calling aphy_ops(may be calibrate) ? Something of this sort:phy-calibrate-data = <val1,
register_offset1>,<val2, register_offset2>, <val3, register_offset3>, ....I am sure having such information in the driver (like i have in my patch) makes the driver look more clumsy.
But, all this data can be pretty huge - a set of some 100+ register-value pairs
for QMP phy, for example. So, will it be okay to get this from device tree ? We also note here that such information changes from one IP version to another.
I remember Rob having some concerns about it.
Quoted 7 lines
Quoted 7 lines
The devicetree is supposed to describe which hardware components a certain device has, most of the time this carries a set of properties to describe how this piece is connected and configured.
A dump of magic register values does not describe how the QMP is connected to anything and is, as far as this patch shows, static for this particular hardware block.
device tree has also been used to have configuration information. see [1]
Quoted 5 lines
Yes, that's correct. The QMP and QUSB2 phy init sequences are a bunch of static values for a particular IP version. These values hardly give a meaningful data to put few phy bindings that could be referenced to configure the phy further.
Not really. You can have clearly defined phy binding to give meaningful data. Every driver doing the same configuration bloats the driver and these configuration values are just magic values which hardly can be reviewed by anyone.
Quoted 6 lines
Quoted 6 lines
Further more moving this blob to devicetree will not allow us to treat the various QMP configurations as one HW block, as there are other differences as well.
Quoted 6 lines
Quoted 6 lines
Like many other drivers it's possible to create a generic version that has every bit of logic driven by configuration from devicetree, but like most of those cases this is not the way we split things.
And this has the side effect of keeping the dts files human readable, human understandable and human maintainable.
right. That's why I recommend having clearly defined bindings.
phy,tx-<param1> = <val, offset, mask> phy,tx-<param2> = <val, offset, mask> phy,tx-<param3> = <val, offset, mask>
[1] -> https://www.linuxplumbersconf.org/2016/ocw/proposals/4047
Thanks
Kishon
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Quoted 2 lines · Kishon Vijay Abraham I
Quoted 1 line · Vivek Gautam
On Wed, Jan 18, 2017 at 11:33 PM, Bjorn Andersson
[..]
Quoted 19 lines
Quoted 5 lines
Yes, that's correct. The QMP and QUSB2 phy init sequences are a bunch of static values for a particular IP version. These values hardly give a meaningful data to put few phy bindings that could be referenced to configure the phy further.
Not really. You can have clearly defined phy binding to give meaningful data. Every driver doing the same configuration bloats the driver and these configuration values are just magic values which hardly can be reviewed by anyone.
Quoted 10 lines
Quoted 10 lines
Further more moving this blob to devicetree will not allow us to treat the various QMP configurations as one HW block, as there are other differences as well.
Like many other drivers it's possible to create a generic version that has every bit of logic driven by configuration from devicetree, but like most of those cases this is not the way we split things.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
And this has the side effect of keeping the dts files human readable, human understandable and human maintainable.
right. That's why I recommend having clearly defined bindings.
phy,tx-<param1> = <val, offset, mask> phy,tx-<param2> = <val, offset, mask> phy,tx-<param3> = <val, offset, mask>
There's no doubt that this table needs to be encoded somewhere, so the question is should we hard code this in a C file or in a DTSI file.
Skimming through [1] I see examples of things that differs based on how the specific component is integrated in a SoC or on a particular board - properties that are relevant to a "system integrator".
As far as I can tell this blob will, if ever, only be changed by a driver developer and as such it's not carry information about how this component relates to the rest of the system and should as such not be part of the device tree.
If there are properties of the hardware that is affected by how the component is integrated in the system I really would like for those to be exposed as human-readable properties that I can understand and alter without deep knowledge about the register map of the hardware block.
Quoted 1 line
[1] -> https://www.linuxplumbersconf.org/2016/ocw/proposals/4047
Regards,
Bjorn
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Quoted 38 lines · Bjorn Andersson
Quoted 2 lines · Kishon Vijay Abraham I
Quoted 1 line · Vivek Gautam
On Wed, Jan 18, 2017 at 11:33 PM, Bjorn Andersson
[..]
Quoted 15 lines
Quoted 4 lines
Yes, that's correct. The QMP and QUSB2 phy init sequences are a bunch of static values for a particular IP version. These values hardly give a meaningful data to put few phy bindings that could be referenced to configure the phy further.
Not really. You can have clearly defined phy binding to give meaningful data. Every driver doing the same configuration bloats the driver and these configuration values are just magic values which hardly can be reviewed by anyone.
Quoted 8 lines
Quoted 8 lines
Further more moving this blob to devicetree will not allow us to treat the various QMP configurations as one HW block, as there are other differences as well.
Like many other drivers it's possible to create a generic version that has every bit of logic driven by configuration from devicetree, but like most of those cases this is not the way we split things.
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
And this has the side effect of keeping the dts files human readable, human understandable and human maintainable.
right. That's why I recommend having clearly defined bindings.
phy,tx-<param1> = <val, offset, mask> phy,tx-<param2> = <val, offset, mask> phy,tx-<param3> = <val, offset, mask>There's no doubt that this table needs to be encoded somewhere, so the question is should we hard code this in a C file or in a DTSI file.
Skimming through [1] I see examples of things that differs based on how the specific component is integrated in a SoC or on a particular board - properties that are relevant to a "system integrator".
As far as I can tell this blob will, if ever, only be changed by a driver developer and as such it's not carry information about how this component relates to the rest of the system and should as such not be part of the device tree.
Quoted 4 lines
If there are properties of the hardware that is affected by how the component is integrated in the system I really would like for those to be exposed as human-readable properties that I can understand and alter without deep knowledge about the register map of the hardware block.
I am reaching out to our internal teams to get more information on different possible phy configurations, based on which the registers values are decided.
This is something that i tried to understand in the past as well, but couldn't grab much information that time.
Will come back with relevant information on this.
Regards
Vivek
Quoted 7 lines
Quoted 1 line
[1] -> https://www.linuxplumbersconf.org/2016/ocw/proposals/4047
Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Hi Kishon,
Quoted 59 lines · Vivek Gautam
Quoted 50 lines · Bjorn Andersson
Quoted 4 lines · Kishon Vijay Abraham I
Quoted 2 lines · Vivek Gautam
On Wed, Jan 18, 2017 at 11:33 PM, Bjorn Andersson
[..]
Quoted 21 lines
Quoted 5 lines
Yes, that's correct. The QMP and QUSB2 phy init sequences are a bunch of static values for a particular IP version. These values hardly give a meaningful data to put few phy bindings that could be referenced to configure the phy further.
Not really. You can have clearly defined phy binding to give meaningful data.
Every driver doing the same configuration bloats the driver and these configuration values are just magic values which hardly can be reviewed by anyone.Quoted 10 lines
Quoted 10 lines
Further more moving this blob to devicetree will not allow us to treat the various QMP configurations as one HW block, as there are other differences as well.
Like many other drivers it's possible to create a generic version that has every bit of logic driven by configuration from devicetree, but like
most of those cases this is not the way we split things.Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
And this has the side effect of keeping the dts files human readable, human understandable and human maintainable.
right. That's why I recommend having clearly defined bindings.
phy,tx-<param1> = <val, offset, mask> phy,tx-<param2> = <val, offset, mask> phy,tx-<param3> = <val, offset, mask>There's no doubt that this table needs to be encoded somewhere, so the question is should we hard code this in a C file or in a DTSI file.
Skimming through [1] I see examples of things that differs based on how the specific component is integrated in a SoC or on a particular board - properties that are relevant to a "system integrator".
As far as I can tell this blob will, if ever, only be changed by a driver developer and as such it's not carry information about how this component relates to the rest of the system and should as such not be part of the device tree.
Quoted 4 lines
If there are properties of the hardware that is affected by how the component is integrated in the system I really would like for those to be exposed as human-readable properties that I can understand and alter without deep knowledge about the register map of the hardware block.
Quoted 8 lines
I am reaching out to our internal teams to get more information on different possible phy configurations, based on which the registers values are decided.
This is something that i tried to understand in the past as well, but couldn't
grab much information that time.
Will come back with relevant information on this.
We have started looking into understanding the PHYs on msm and eventually create a set of generic phy bindings that can serve multiple platforms.
But this task, I presume, will take its course and will involve multi-party discussions.
For these QUSB2 and QMP phy drivers, a good amount of work has already gone in getting these drivers in upstream state.
The common QMP phy driver supports a bunch of controllers on msm platforms - USB, PCIe and UFS and there are platforms such as DB820c and others that want to pull in these changes from upstream. The future phy controllers also depend on these drivers and we don't want to hold other developers to contribute to these drivers.
So, we wish to not delay these drivers further because of the phy bindings. I see that there are phys that still program the registers-value pairs for phy initialization.
We will keep working on the bindings while these patches make way to upstream.
Can you consider pulling in these drivers?
I can send the next version of these drivers with other comments addressed. Please let me know your comments.
Regards
Vivek
Quoted 23 lines
Regards
VivekQuoted 9 lines
Quoted 1 line
[1] -> https://www.linuxplumbersconf.org/2016/ocw/proposals/4047
Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Hi Kishon,
Quoted 90 lines · Vivek Gautam
Hi Kishon,
Quoted 59 lines · Vivek Gautam
Quoted 50 lines · Bjorn Andersson
Quoted 4 lines · Kishon Vijay Abraham I
Quoted 2 lines · Vivek Gautam
On Wed, Jan 18, 2017 at 11:33 PM, Bjorn Andersson
[..]
Quoted 21 lines
Quoted 5 lines
Yes, that's correct. The QMP and QUSB2 phy init sequences are a bunch of static values for a particular IP version. These values hardly give a meaningful data to put few phy bindings that could be referenced to configure the phy further.
Not really. You can have clearly defined phy binding to give meaningful data.
Every driver doing the same configuration bloats the driver and these configuration values are just magic values which hardly can be reviewed by anyone.Quoted 10 lines
Quoted 10 lines
Further more moving this blob to devicetree will not allow us to treat the various QMP configurations as one HW block, as there are other differences as well.
Like many other drivers it's possible to create a generic version that has every bit of logic driven by configuration from devicetree, but like
most of those cases this is not the way we split things.Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
And this has the side effect of keeping the dts files human readable, human understandable and human maintainable.
right. That's why I recommend having clearly defined bindings.
phy,tx-<param1> = <val, offset, mask> phy,tx-<param2> = <val, offset, mask> phy,tx-<param3> = <val, offset, mask>There's no doubt that this table needs to be encoded somewhere, so the question is should we hard code this in a C file or in a DTSI file.
Skimming through [1] I see examples of things that differs based on how the specific component is integrated in a SoC or on a particular board - properties that are relevant to a "system integrator".
As far as I can tell this blob will, if ever, only be changed by a driver developer and as such it's not carry information about how this component relates to the rest of the system and should as such not be part of the device tree.
Quoted 4 lines
If there are properties of the hardware that is affected by how the component is integrated in the system I really would like for those to be exposed as human-readable properties that I can understand and alter without deep knowledge about the register map of the hardware block.
Quoted 8 lines
I am reaching out to our internal teams to get more information on different possible phy configurations, based on which the registers values are decided.
This is something that i tried to understand in the past as well, but couldn't
grab much information that time.
Will come back with relevant information on this.We have started looking into understanding the PHYs on msm and eventually create a set of generic phy bindings that can serve multiple platforms.
But this task, I presume, will take its course and will involve multi-party discussions.For these QUSB2 and QMP phy drivers, a good amount of work has already gone in getting these drivers in upstream state.
The common QMP phy driver supports a bunch of controllers on msm platforms - USB, PCIe and UFS and there are platforms such as DB820c and others that want to pull in these changes from upstream. The future phy controllers also depend on these drivers and we don't want to hold other developers to contribute to these drivers.
So, we wish to not delay these drivers further because of the phy bindings. I see that there are phys that still program the registers-value pairs for phy initialization.
Quoted 6 lines
We will keep working on the bindings while these patches make way to upstream.
Can you consider pulling in these drivers?
I can send the next version of these drivers with other comments addressed. Please let me know your comments.
Gentle ping. Any thoughts on this ?
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
[1] -> https://www.linuxplumbersconf.org/2016/ocw/proposals/4047
Regards,
Bjorn
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Hi,
Quoted 95 lines · Vivek Gautam
Hi Kishon,
Quoted 90 lines · Vivek Gautam
Hi Kishon,
Quoted 59 lines · Vivek Gautam
Quoted 50 lines · Bjorn Andersson
Quoted 4 lines · Kishon Vijay Abraham I
Quoted 2 lines · Vivek Gautam
On Wed, Jan 18, 2017 at 11:33 PM, Bjorn Andersson
[..]
Quoted 21 lines
Quoted 5 lines
Yes, that's correct. The QMP and QUSB2 phy init sequences are a bunch of static values for a particular IP version. These values hardly give a meaningful data to put few phy bindings that could be referenced to configure the phy further.
Not really. You can have clearly defined phy binding to give meaningful data.
Every driver doing the same configuration bloats the driver and these configuration values are just magic values which hardly can be reviewed by anyone.Quoted 10 lines
Quoted 10 lines
Further more moving this blob to devicetree will not allow us to treat the various QMP configurations as one HW block, as there are other differences as well.
Like many other drivers it's possible to create a generic version that has every bit of logic driven by configuration from devicetree, but like
most of those cases this is not the way we split things.Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
And this has the side effect of keeping the dts files human readable, human understandable and human maintainable.
right. That's why I recommend having clearly defined bindings.
phy,tx-<param1> = <val, offset, mask> phy,tx-<param2> = <val, offset, mask> phy,tx-<param3> = <val, offset, mask>There's no doubt that this table needs to be encoded somewhere, so the question is should we hard code this in a C file or in a DTSI file.
Skimming through [1] I see examples of things that differs based on how the specific component is integrated in a SoC or on a particular board - properties that are relevant to a "system integrator".
As far as I can tell this blob will, if ever, only be changed by a driver developer and as such it's not carry information about how this component relates to the rest of the system and should as such not be part of the device tree.
Quoted 4 lines
If there are properties of the hardware that is affected by how the component is integrated in the system I really would like for those to be exposed as human-readable properties that I can understand and alter without deep knowledge about the register map of the hardware block.
Quoted 8 lines
I am reaching out to our internal teams to get more information on different possible phy configurations, based on which the registers values are decided.
This is something that i tried to understand in the past as well, but couldn't
grab much information that time.
Will come back with relevant information on this.We have started looking into understanding the PHYs on msm and eventually create a set of generic phy bindings that can serve multiple platforms.
But this task, I presume, will take its course and will involve multi-party discussions.For these QUSB2 and QMP phy drivers, a good amount of work has already gone in getting these drivers in upstream state.
The common QMP phy driver supports a bunch of controllers on msm platforms - USB, PCIe and UFS and there are platforms such as DB820c and others that want to pull in these changes from upstream. The future phy controllers also depend on these drivers and we don't want to hold other developers to contribute to these drivers.
So, we wish to not delay these drivers further because of the phy bindings. I see that there are phys that still program the registers-value pairs for phy initialization.
Quoted 8 lines
Quoted 6 lines
We will keep working on the bindings while these patches make way to upstream.
Can you consider pulling in these drivers?
I can send the next version of these drivers with other comments addressed. Please let me know your comments.Gentle ping. Any thoughts on this ?
sure, lets hold the phy configuration binding and complete the rest of the patch.
Thanks
Kishon
Re: [PATCH v4 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips
Hi,
Quoted 86 lines · Kishon Vijay Abraham I
Hi,
Quoted 83 lines · Vivek Gautam
Hi Kishon,
Quoted 78 lines · Vivek Gautam
Hi Kishon,
Quoted 48 lines · Vivek Gautam
Quoted 41 lines · Bjorn Andersson
Quoted 2 lines · Kishon Vijay Abraham I
Quoted 1 line · Vivek Gautam
On Wed, Jan 18, 2017 at 11:33 PM, Bjorn Andersson
[..]
Quoted 18 lines
Quoted 4 lines
Yes, that's correct. The QMP and QUSB2 phy init sequences are a bunch of static values for a particular IP version. These values hardly give a meaningful data to put few phy bindings that could be referenced to configure the phy further.
Not really. You can have clearly defined phy binding to give meaningful data.
Every driver doing the same configuration bloats the driver and these configuration values are just magic values which hardly can be reviewed by anyone.Quoted 9 lines
Quoted 9 lines
Further more moving this blob to devicetree will not allow us to treat the various QMP configurations as one HW block, as there are other differences as well.
Like many other drivers it's possible to create a generic version that has every bit of logic driven by configuration from devicetree, but like
most of those cases this is not the way we split things.Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
And this has the side effect of keeping the dts files human readable, human understandable and human maintainable.
right. That's why I recommend having clearly defined bindings.
phy,tx-<param1> = <val, offset, mask> phy,tx-<param2> = <val, offset, mask> phy,tx-<param3> = <val, offset, mask>There's no doubt that this table needs to be encoded somewhere, so the question is should we hard code this in a C file or in a DTSI file.
Skimming through [1] I see examples of things that differs based on how the specific component is integrated in a SoC or on a particular board - properties that are relevant to a "system integrator".
As far as I can tell this blob will, if ever, only be changed by a driver developer and as such it's not carry information about how this component relates to the rest of the system and should as such not be part of the device tree.
Quoted 4 lines
If there are properties of the hardware that is affected by how the component is integrated in the system I really would like for those to be exposed as human-readable properties that I can understand and alter without deep knowledge about the register map of the hardware block.
Quoted 8 lines
I am reaching out to our internal teams to get more information on different possible phy configurations, based on which the registers values are decided.
This is something that i tried to understand in the past as well, but couldn't
grab much information that time.
Will come back with relevant information on this.We have started looking into understanding the PHYs on msm and eventually create a set of generic phy bindings that can serve multiple platforms.
But this task, I presume, will take its course and will involve multi-party discussions.For these QUSB2 and QMP phy drivers, a good amount of work has already gone in getting these drivers in upstream state.
The common QMP phy driver supports a bunch of controllers on msm platforms - USB, PCIe and UFS and there are platforms such as DB820c and others that want to pull in these changes from upstream. The future phy controllers also depend on these drivers and we don't want to hold other developers to contribute to these drivers.
So, we wish to not delay these drivers further because of the phy bindings. I see that there are phys that still program the registers-value pairs for phy initialization.
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
We will keep working on the bindings while these patches make way to upstream.
Can you consider pulling in these drivers?
I can send the next version of these drivers with other comments addressed. Please let me know your comments.Gentle ping. Any thoughts on this ?
sure, lets hold the phy configuration binding and complete the rest of the patch.
Sure, thanks. Will post out the next version of patches soon.
Regards
Vivek
Quoted 3 lines
Thanks
Kishon
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v4 3/4 dt-bindings: phy: Add support for QMP phy
In reply to Vivek GautamQualcomm chipsets have QMP phy controller that provides support to a number of controller, viz. PCIe, UFS, and USB. Adding dt binding information for the same.
---
Changes since v3:
- Added #clock-cells = <1>, indicating that phy is a clock provider.
Changes since v2:
- Removed binding for "ref_clk_src" since we don't request this clock in the driver.
- Addressed s/ref_clk/ref. Don't need to add '_clk' suffix to clock names.
- Using 'phy' for the node name.
Changes since v1:
- New patch, forked out of the original driver patch:
"phy: qcom-qmp: new qmp phy driver for qcom-chipsets"
- Added 'Acked-by' from Rob.
- Updated bindings to include mem resource as a list of offset - length pair for serdes block and for each lane.
- Added a new binding for 'lane-offsets' that contains offsets to tx, rx and pcs blocks from each lane base address.
.../devicetree/bindings/phy/qcom-qmp-phy.txt | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt new file +76 -0
@@ -0,0 +1,76 @@ +Qualcomm QMP PHY controller +=========================== + +QMP phy controller supports physical layer functionality for a number of +controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB. + +Required properties: + - compatible: compatible list, contains: + "qcom,msm8996-qmp-pcie-phy" for 14nm PCIe phy on msm8996, + "qcom,msm8996-qmp-usb3-phy" for 14nm USB3 phy on msm8996. + - reg: list of offset and length pair of the PHY register sets. + at index 0: offset and length of register set for PHY common + serdes block. + from index 1 - N: offset and length of register set for each lane, + for N number of phy lanes (ports). + - lane-offsets: array of offsets to tx, rx and pcs blocks for phy lanes. + - #phy-cells: must be 1 + - Cell after phy phandle should be the port (lane) number. + - #clock-cells: must be 1 + - Phy pll outputs a bunch of clocks for Tx, Rx and Pipe + interface (for pipe based PHYs). These clock are then gate-controlled + by gcc. + - clocks: a list of phandles and clock-specifier pairs, + one for each entry in clock-names. + - clock-names: must be "cfg_ahb" for phy config clock, + "aux" for phy aux clock, + "ref" for 19.2 MHz ref clk, + "pipe<port-number>" for pipe clock specific to + each port/lane (Optional). + - resets: a list of phandles and reset controller specifier pairs, + one for each entry in reset-names. + - reset-names: must be "phy" for reset of phy block, + "common" for phy common block reset, + "cfg" for phy's ahb cfg block reset (Optional). + "port<port-number>" for reset specific to + each port/lane (Optional). + - vdda-phy-supply: Phandle to a regulator supply to PHY core block. + - vdda-pll-supply: Phandle to 1.8V regulator supply to PHY refclk pll block. + +Optional properties: + - vddp-ref-clk-supply: Phandle to a regulator supply to any specific refclk + pll block. + +Example: + pcie_phy: phy@34000 { + compatible = "qcom,msm8996-qmp-pcie-phy"; + reg = <0x034000 0x48f>, + <0x035000 0x5bf>, + <0x036000 0x5bf>, + <0x037000 0x5bf>; + /* tx, rx, pcs */ + lane-offsets = <0x0 0x200 0x400>; + #phy-cells = <1>; + #clock-cells = <1>; + + clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>, + <&gcc GCC_PCIE_PHY_CFG_AHB_CLK>, + <&gcc GCC_PCIE_CLKREF_CLK>, + <&gcc GCC_PCIE_0_PIPE_CLK>, + <&gcc GCC_PCIE_1_PIPE_CLK>, + <&gcc GCC_PCIE_2_PIPE_CLK>; + clock-names = "aux", "cfg_ahb", "ref", + "pipe0", "pipe1", "pipe2"; + + vdda-phy-supply = <&pm8994_l28>; + vdda-pll-supply = <&pm8994_l12>; + + resets = <&gcc GCC_PCIE_PHY_BCR>, + <&gcc GCC_PCIE_PHY_COM_BCR>, + <&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>, + <&gcc GCC_PCIE_0_PHY_BCR>, + <&gcc GCC_PCIE_1_PHY_BCR>, + <&gcc GCC_PCIE_2_PHY_BCR>; + reset-names = "phy", "common", "cfg", + "lane0", "lane1", "lane2"; + };
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Hi,
Quoted 101 lines · Vivek Gautam
Qualcomm chipsets have QMP phy controller that provides support to a number of controller, viz. PCIe, UFS, and USB. Adding dt binding information for the same.
Signed-off-by Vivek Gautam <[email protected]>Acked-by Rob Herring <[email protected]>---
Changes since v3:
- Added #clock-cells = <1>, indicating that phy is a clock provider.Changes since v2:
- Removed binding for "ref_clk_src" since we don't request this clock in the driver.
- Addressed s/ref_clk/ref. Don't need to add '_clk' suffix to clock names.
- Using 'phy' for the node name.Changes since v1:
- New patch, forked out of the original driver patch:
"phy: qcom-qmp: new qmp phy driver for qcom-chipsets"
- Added 'Acked-by' from Rob.
- Updated bindings to include mem resource as a list of offset - length pair for serdes block and for each lane.
- Added a new binding for 'lane-offsets' that contains offsets to tx, rx and pcs blocks from each lane base address..../devicetree/bindings/phy/qcom-qmp-phy.txt | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/qcom-qmp-phy.txtDocumentation/devicetree/bindings/phy/qcom-qmp-phy.txt new file +65
-0@@ -0,0 +1,76 @@ +Qualcomm QMP PHY controller +=========================== + +QMP phy controller supports physical layer functionality for a number of +controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB. + +Required properties: + - compatible: compatible list, contains: + "qcom,msm8996-qmp-pcie-phy" for 14nm PCIe phy on msm8996, + "qcom,msm8996-qmp-usb3-phy" for 14nm USB3 phy on msm8996. + - reg: list of offset and length pair of the PHY register sets. + at index 0: offset and length of register set for PHY common + serdes block. + from index 1 - N: offset and length of register set for each lane, + for N number of phy lanes (ports). + - lane-offsets: array of offsets to tx, rx and pcs blocks for phy lanes. + - #phy-cells: must be 1 + - Cell after phy phandle should be the port (lane) number. + - #clock-cells: must be 1 + - Phy pll outputs a bunch of clocks for Tx, Rx and Pipe + interface (for pipe based PHYs). These clock are then gate-controlled + by gcc. + - clocks: a list of phandles and clock-specifier pairs, + one for each entry in clock-names. + - clock-names: must be "cfg_ahb" for phy config clock, + "aux" for phy aux clock, + "ref" for 19.2 MHz ref clk, + "pipe<port-number>" for pipe clock specific to + each port/lane (Optional). + - resets: a list of phandles and reset controller specifier pairs, + one for each entry in reset-names. + - reset-names: must be "phy" for reset of phy block, + "common" for phy common block reset, + "cfg" for phy's ahb cfg block reset (Optional). + "port<port-number>" for reset specific to + each port/lane (Optional). + - vdda-phy-supply: Phandle to a regulator supply to PHY core block. + - vdda-pll-supply: Phandle to 1.8V regulator supply to PHY refclk pll block. + +Optional properties: + - vddp-ref-clk-supply: Phandle to a regulator supply to any specific refclk + pll block. + +Example: + pcie_phy: phy@34000 { + compatible = "qcom,msm8996-qmp-pcie-phy"; + reg = <0x034000 0x48f>, + <0x035000 0x5bf>, + <0x036000 0x5bf>, + <0x037000 0x5bf>; + /* tx, rx, pcs */ + lane-offsets = <0x0 0x200 0x400>; + #phy-cells = <1>; + #clock-cells = <1>; + + clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>, + <&gcc GCC_PCIE_PHY_CFG_AHB_CLK>, + <&gcc GCC_PCIE_CLKREF_CLK>, + <&gcc GCC_PCIE_0_PIPE_CLK>, + <&gcc GCC_PCIE_1_PIPE_CLK>, + <&gcc GCC_PCIE_2_PIPE_CLK>; + clock-names = "aux", "cfg_ahb", "ref", + "pipe0", "pipe1", "pipe2"; + + vdda-phy-supply = <&pm8994_l28>;
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt line 75
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt new file +10
-0+ vdda-pll-supply = <&pm8994_l12>; + + resets = <&gcc GCC_PCIE_PHY_BCR>, + <&gcc GCC_PCIE_PHY_COM_BCR>, + <&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>, + <&gcc GCC_PCIE_0_PHY_BCR>, + <&gcc GCC_PCIE_1_PHY_BCR>, + <&gcc GCC_PCIE_2_PHY_BCR>; + reset-names = "phy", "common", "cfg", + "lane0", "lane1", "lane2";
Each lane has a separate clock, separate reset.. why not create sub-nodes for each lane?
Thanks
Kishon
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Hi Kishon,
Quoted 108 lines · Kishon Vijay Abraham I
Hi,
Quoted 105 lines · Vivek Gautam
Qualcomm chipsets have QMP phy controller that provides support to a number of controller, viz. PCIe, UFS, and USB. Adding dt binding information for the same.
Signed-off-by Vivek Gautam <[email protected]>Acked-by Rob Herring <[email protected]>---
Changes since v3:
- Added #clock-cells = <1>, indicating that phy is a clock provider.Changes since v2:
- Removed binding for "ref_clk_src" since we don't request this clock in the driver.
- Addressed s/ref_clk/ref. Don't need to add '_clk' suffix to clock names.
- Using 'phy' for the node name.Changes since v1:
- New patch, forked out of the original driver patch:
"phy: qcom-qmp: new qmp phy driver for qcom-chipsets"
- Added 'Acked-by' from Rob.
- Updated bindings to include mem resource as a list of offset - length pair for serdes block and for each lane.
- Added a new binding for 'lane-offsets' that contains offsets to tx, rx and pcs blocks from each lane base address..../devicetree/bindings/phy/qcom-qmp-phy.txt | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+)create mode 100644
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txtDocumentation/devicetree/bindings/phy/qcom-qmp-phy.txt new file +69
-0@@ -0,0 +1,76 @@ +Qualcomm QMP PHY controller +=========================== + +QMP phy controller supports physical layer functionality for a number of +controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB. + +Required properties: + - compatible: compatible list, contains: + "qcom,msm8996-qmp-pcie-phy" for 14nm PCIe phy on msm8996, + "qcom,msm8996-qmp-usb3-phy" for 14nm USB3 phy on msm8996. + - reg: list of offset and length pair of the PHY register sets. + at index 0: offset and length of register set for PHY common + serdes block. + from index 1 - N: offset and length of register set for each lane, + for N number of phy lanes (ports). + - lane-offsets: array of offsets to tx, rx and pcs blocks for phy lanes. + - #phy-cells: must be 1 + - Cell after phy phandle should be the port (lane) number. + - #clock-cells: must be 1 + - Phy pll outputs a bunch of clocks for Tx, Rx and Pipe + interface (for pipe based PHYs). These clock are then gate-controlled + by gcc. + - clocks: a list of phandles and clock-specifier pairs, + one for each entry in clock-names. + - clock-names: must be "cfg_ahb" for phy config clock, + "aux" for phy aux clock, + "ref" for 19.2 MHz ref clk, + "pipe<port-number>" for pipe clock specific to + each port/lane (Optional). + - resets: a list of phandles and reset controller specifier pairs, + one for each entry in reset-names. + - reset-names: must be "phy" for reset of phy block, + "common" for phy common block reset, + "cfg" for phy's ahb cfg block reset (Optional). + "port<port-number>" for reset specific to + each port/lane (Optional). + - vdda-phy-supply: Phandle to a regulator supply to PHY core block. + - vdda-pll-supply: Phandle to 1.8V regulator supply to PHY refclk pll block. + +Optional properties: + - vddp-ref-clk-supply: Phandle to a regulator supply to any specific refclk + pll block. + +Example: + pcie_phy: phy@34000 { + compatible = "qcom,msm8996-qmp-pcie-phy"; + reg = <0x034000 0x48f>, + <0x035000 0x5bf>, + <0x036000 0x5bf>, + <0x037000 0x5bf>; + /* tx, rx, pcs */ + lane-offsets = <0x0 0x200 0x400>; + #phy-cells = <1>; + #clock-cells = <1>; + + clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>, + <&gcc GCC_PCIE_PHY_CFG_AHB_CLK>, + <&gcc GCC_PCIE_CLKREF_CLK>, + <&gcc GCC_PCIE_0_PIPE_CLK>, + <&gcc GCC_PCIE_1_PIPE_CLK>, + <&gcc GCC_PCIE_2_PIPE_CLK>; + clock-names = "aux", "cfg_ahb", "ref", + "pipe0", "pipe1", "pipe2"; + + vdda-phy-supply = <&pm8994_l28>; + vdda-pll-supply = <&pm8994_l12>; + + resets = <&gcc GCC_PCIE_PHY_BCR>, + <&gcc GCC_PCIE_PHY_COM_BCR>,
Quoted 8 lines
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt line 75
Quoted 6 lines
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt new file +6
-0+ <&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>, + <&gcc GCC_PCIE_0_PHY_BCR>, + <&gcc GCC_PCIE_1_PHY_BCR>, + <&gcc GCC_PCIE_2_PHY_BCR>; + reset-names = "phy", "common", "cfg", + "lane0", "lane1", "lane2";Each lane has a separate clock, separate reset.. why not create sub-nodes for each lane?
Yes, each lane has separate pipe clock and resets.
I can have a binding such as written below.
Does it makes sense to pull in the tx, rx and pcs offsets as well to the child node, and iomap the entire address space of the phy ?
+ pcie_phy: pciephy@34000 {
+ compatible = "qcom,qmp-14nm-phy"; + reg = <0x034000 0x3fff>; + #address-cells = <1>; + #size-cells = <0>;
...
+ port@0 {
+ reg = <0>; + tx-offset = <0x1000>; + rx-offset = <0x1200>; + pcs-offset = <0x1400>; + clocks = <&gcc GCC_USB3_PHY_PIPE_CLK>; + clock-names = "pipe0"; + resets = <&gcc GCC_PCIE_0_PHY_BCR>; + reset-names = "lane0";
+ };
+ };
Regards
Vivek
Quoted 7 lines
Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Quoted 2 lines · Vivek Gautam
Quoted 1 line · Kishon Vijay Abraham I
On Tuesday 10 January 2017 04:21 PM, Vivek Gautam wrote:
[..]
Quoted 7 lines
Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt line 75
Quoted 2 lines
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt new file +2
-0+ reset-names = "phy", "common", "cfg", + "lane0", "lane1", "lane2";Each lane has a separate clock, separate reset.. why not create sub-nodes for each lane?
Yes, each lane has separate pipe clock and resets. I can have a binding such as written below.
+1
Quoted 3 lines
Does it makes sense to pull in the tx, rx and pcs offsets as well to the child node, and iomap the entire address space of the phy ?
Note that you don't have to follow the same structure in your device driver as you describe your hardware in devicetree.
I would suggest that you replace the lane-offset and various lane specific resources with subnodes, but keep the driver "as is".
Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Quoted 18 lines · Bjorn Andersson
Quoted 2 lines · Vivek Gautam
Quoted 1 line · Kishon Vijay Abraham I
On Tuesday 10 January 2017 04:21 PM, Vivek Gautam wrote:
[..]
Quoted 7 lines
Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt line 75
Quoted 2 lines
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt new file +2
-0+ reset-names = "phy", "common", "cfg", + "lane0", "lane1", "lane2";Each lane has a separate clock, separate reset.. why not create sub-nodes for each lane?
Yes, each lane has separate pipe clock and resets. I can have a binding such as written below.
+1
Quoted 3 lines
Does it makes sense to pull in the tx, rx and pcs offsets as well to the child node, and iomap the entire address space of the phy ?
Quoted 6 lines
Note that you don't have to follow the same structure in your device driver as you describe your hardware in devicetree.
I would suggest that you replace the lane-offset and various lane specific resources with subnodes, but keep the driver "as is".
Didn't we already move away from subnodes for lanes in an earlier revision of these patches? I seem to recall we did that because lanes are not devices and the whole "phy as a bus" concept not making sense.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Quoted 19 lines · Stephen Boyd
Quoted 18 lines · Bjorn Andersson
Quoted 2 lines · Vivek Gautam
Quoted 1 line · Kishon Vijay Abraham I
On Tuesday 10 January 2017 04:21 PM, Vivek Gautam wrote:
[..]
Quoted 6 lines
Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt line 75
Quoted 2 lines
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt new file +2
-0+ reset-names = "phy", "common", "cfg", + "lane0", "lane1", "lane2";Each lane has a separate clock, separate reset.. why not create sub-nodes for each lane?
Yes, each lane has separate pipe clock and resets. I can have a binding such as written below.
+1
Quoted 3 lines
Does it makes sense to pull in the tx, rx and pcs offsets as well to the child node, and iomap the entire address space of the phy ?
Note that you don't have to follow the same structure in your device driver as you describe your hardware in devicetree.
Quoted 7 lines
Quoted 3 lines
I would suggest that you replace the lane-offset and various lane specific resources with subnodes, but keep the driver "as is".
Didn't we already move away from subnodes for lanes in an earlier revision of these patches? I seem to recall we did that because lanes are not devices and the whole "phy as a bus" concept not making sense.
Yea, we started out without having any sub-nodes and we argued that we don't require them since the qmp device is represented by the qmp node itself.
The lanes otoh are representative of gen_phys and related properties.
In the driver -
"struct qmp_phy " represents the lanes and holds "struct phy", "struct qcom_qmp" represents the qmp block as a whole and holds "struct device" Does this make lanes qualify to be childs of qmp ?
"phy as a bus" (just trying to understand here) -
let's say a usb phy controller has one HSIC phy port and one USB2 phy port. So, should this phy controller be a bus providing two ports (and so we will have couple of child nodes to the phy controller) ?
Regards
Vivek
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Quoted 13 lines · Vivek Gautam
Quoted 5 lines · Stephen Boyd
Quoted 1 line
Didn't we already move away from subnodes for lanes in an earlier revision of these patches? I seem to recall we did that because lanes are not devices and the whole "phy as a bus" concept not making sense.
Yea, we started out without having any sub-nodes and we argued that we don't require them since the qmp device is represented by the qmp node itself.
The lanes otoh are representative ofgen_physand related properties.
Quoted 5 lines
In the driver -
"structqmp_phy" represents the lanes and holds "struct phy", "structqcom_qmp" represents the qmp block as a whole and holds "struct device"
Does this make lanes qualify to be childs of qmp ?
Hmm... maybe I was recalling the DSI phy binding. I think there are lanes there too but we decided to just have one node.
Quoted 7 lines
"phy as a bus" (just trying to understand here) -
let's say a usb phy controller has one HSIC phy port and one USB2 phy port. So, should this phy controller be a bus providing two ports (and so we will have
couple of child nodes to the phy controller) ?
Typically in DT a subnode or collection of subnodes means there's some sort of bus involved. Usually each node corresponds to a struct device, and the parent node corresponds to the bus or controller for the logical bus.
In this case (only PCIe though? not UFS or USB?) it seems like we have multiple phys that share a common register space, but otherwise they have their own register space and power management. Would you have each PCIe controller point to a different subnode for their associated phy? I'm trying to understand the benefit of the subnodes if they aren't treated as struct devices.
At the least, please get DT reviewers to ack the new binding before rewriting the code.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Quoted 30 lines · Stephen Boyd
Quoted 10 lines · Vivek Gautam
Quoted 4 lines · Stephen Boyd
Didn't we already move away from subnodes for lanes in an earlier revision of these patches? I seem to recall we did that because lanes are not devices and the whole "phy as a bus" concept not making sense.
Yea, we started out without having any sub-nodes and we argued that we don't require them since the qmp device is represented by the qmp node itself.
The lanes otoh are representative ofgen_physand related properties.Quoted 5 lines
In the driver -
"structqmp_phy" represents the lanes and holds "struct phy", "structqcom_qmp" represents the qmp block as a whole and holds "struct device"
Does this make lanes qualify to be childs of qmp ?Hmm... maybe I was recalling the DSI phy binding. I think there are lanes there too but we decided to just have one node.
Quoted 6 lines
"phy as a bus" (just trying to understand here) -
let's say a usb phy controller has one HSIC phy port and one USB2 phy port. So, should this phy controller be a bus providing two ports (and so we will have
couple of child nodes to the phy controller) ?Typically in DT a subnode or collection of subnodes means there's some sort of bus involved. Usually each node corresponds to a struct device, and the parent node corresponds to the bus or controller for the logical bus.
Quoted 7 lines
In this case (only PCIe though? not UFS or USB?) it seems like we have multiple phys that share a common register space, but otherwise they have their own register space and power management. Would you have each PCIe controller point to a different subnode for their associated phy? I'm trying to understand the benefit of the subnodes if they aren't treated as struct devices.
AFAIU, It's not straight that forward to point each controller to different subnodes and not associate a 'struct device' with subnodes.
The phy translation (of_phy_simple_xlate, in case we point each controller to subnodes) will not be able to associate a correct phy_provider device to the phy consumer.
Kishon,
Is my understanding correct here? Please correct me if i am missing things.
Regards
Vivek
Quoted 4 lines
At the least, please get DT reviewers to ack the new binding before rewriting the code.
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
In reply to Stephen BoydHi,
Quoted 36 lines · Stephen Boyd
Quoted 13 lines · Vivek Gautam
Quoted 5 lines · Stephen Boyd
Quoted 1 line
Didn't we already move away from subnodes for lanes in an earlier revision of these patches? I seem to recall we did that because lanes are not devices and the whole "phy as a bus" concept not making sense.
Yea, we started out without having any sub-nodes and we argued that we don't require them since the qmp device is represented by the qmp node itself.
The lanes otoh are representative ofgen_physand related properties.Quoted 5 lines
In the driver -
"structqmp_phy" represents the lanes and holds "struct phy", "structqcom_qmp" represents the qmp block as a whole and holds "struct device"
Does this make lanes qualify to be childs of qmp ?Hmm... maybe I was recalling the DSI phy binding. I think there are lanes there too but we decided to just have one node.
Quoted 7 lines
"phy as a bus" (just trying to understand here) -
let's say a usb phy controller has one HSIC phy port and one USB2 phy port. So, should this phy controller be a bus providing two ports (and so we will have
couple of child nodes to the phy controller) ?Typically in DT a subnode or collection of subnodes means there's some sort of bus involved. Usually each node corresponds to a struct device, and the parent node corresponds to the bus or controller for the logical bus.
Quoted 7 lines
In this case (only PCIe though? not UFS or USB?) it seems like we have multiple phys that share a common register space, but otherwise they have their own register space and power management. Would you have each PCIe controller point to a different subnode for their associated phy? I'm trying to understand the benefit of the subnodes if they aren't treated as struct devices.
Yes, instead of having all the controller having a phandle to the same PHY and then using other mechanisms to differentiate between the PHYs, each controller can have a phandle to the exact port that it is connected to.
This also gives a better representation of the hardware and can avoid lot of boilerplate code in the driver.
Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Quoted 47 lines · Kishon Vijay Abraham I
Hi,
Quoted 36 lines · Stephen Boyd
Quoted 13 lines · Vivek Gautam
Quoted 5 lines · Stephen Boyd
Quoted 1 line
Didn't we already move away from subnodes for lanes in an earlier revision of these patches? I seem to recall we did that because lanes are not devices and the whole "phy as a bus" concept not making sense.
Yea, we started out without having any sub-nodes and we argued that we don't require them since the qmp device is represented by the qmp node itself.
The lanes otoh are representative ofgen_physand related properties.Quoted 5 lines
In the driver -
"structqmp_phy" represents the lanes and holds "struct phy", "structqcom_qmp" represents the qmp block as a whole and holds "struct device"
Does this make lanes qualify to be childs of qmp ?Hmm... maybe I was recalling the DSI phy binding. I think there are lanes there too but we decided to just have one node.
Quoted 7 lines
"phy as a bus" (just trying to understand here) -
let's say a usb phy controller has one HSIC phy port and one USB2 phy port. So, should this phy controller be a bus providing two ports (and so we will have
couple of child nodes to the phy controller) ?Typically in DT a subnode or collection of subnodes means there's some sort of bus involved. Usually each node corresponds to a struct device, and the parent node corresponds to the bus or controller for the logical bus.
Quoted 7 lines
In this case (only PCIe though? not UFS or USB?) it seems like we have multiple phys that share a common register space, but otherwise they have their own register space and power management. Would you have each PCIe controller point to a different subnode for their associated phy? I'm trying to understand the benefit of the subnodes if they aren't treated as struct devices.
Quoted 6 lines
Yes, instead of having all the controller having a phandle to the same PHY and then using other mechanisms to differentiate between the PHYs, each controller can have a phandle to the exact port that it is connected to.
This also gives a better representation of the hardware and can avoid lot of boilerplate code in the driver.
Below is one binding that works for me.
--------------------
phy@34000 {
compatible = "qcom,msm8996-qmp-pcie-phy";
reg = <0x034000 0x488>;
#clock-cells = <1>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>,
<&gcc GCC_PCIE_PHY_CFG_AHB_CLK>,
<&gcc GCC_PCIE_CLKREF_CLK>;
clock-names = "aux", "cfg_ahb", "ref";
vdda-phy-supply = <&pm8994_l28>;
vdda-pll-supply = <&pm8994_l12>;
resets = <&gcc GCC_PCIE_PHY_BCR>,
<&gcc GCC_PCIE_PHY_COM_BCR>,
<&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>;
reset-names = "phy", "common", "cfg";
pciephy_p0: port@0 {
reg = <0x035000 0x130>,
<0x035200 0x200>,
<0x035400 0x1dc>;
#phy-cells = <0>;
clocks = <&gcc GCC_PCIE_0_PIPE_CLK>;
clock-names = "pipe0";
resets = <&gcc GCC_PCIE_0_PHY_BCR>;
reset-names = "lane0";
};
pciephy_p1: port@1 {
reg = <0x036000 0x130>,
<0x036200 0x200>,
<0x036400 0x1dc>;
#phy-cells = <0>;
clocks = <&gcc GCC_PCIE_1_PIPE_CLK>;
clock-names = "pipe1";
resets = <&gcc GCC_PCIE_1_PHY_BCR>;
reset-names = "lane1";
};
pciephy_p2: port@2 {
reg = <0x037000 0x130>,
<0x037200 0x200>,
<0x037400 0x1dc>;
#phy-cells = <0>;
clocks = <&gcc GCC_PCIE_2_PIPE_CLK>;
clock-names = "pipe2";
resets = <&gcc GCC_PCIE_2_PHY_BCR>;
reset-names = "lane2";
};
};--------------------
let me know if this looks okay.
Regards
Vivek
Quoted 7 lines
Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Hi,
Quoted 114 lines · Vivek Gautam
Quoted 47 lines · Kishon Vijay Abraham I
Hi,
Quoted 36 lines · Stephen Boyd
Quoted 13 lines · Vivek Gautam
Quoted 5 lines · Stephen Boyd
Quoted 1 line
Didn't we already move away from subnodes for lanes in an earlier revision of these patches? I seem to recall we did that because lanes are not devices and the whole "phy as a bus" concept not making sense.
Yea, we started out without having any sub-nodes and we argued that we don't require them since the qmp device is represented by the qmp node itself.
The lanes otoh are representative ofgen_physand related properties.Quoted 5 lines
In the driver -
"structqmp_phy" represents the lanes and holds "struct phy", "structqcom_qmp" represents the qmp block as a whole and holds "struct device"
Does this make lanes qualify to be childs of qmp ?Hmm... maybe I was recalling the DSI phy binding. I think there are lanes there too but we decided to just have one node.
Quoted 7 lines
"phy as a bus" (just trying to understand here) -
let's say a usb phy controller has one HSIC phy port and one USB2 phy port. So, should this phy controller be a bus providing two ports (and so we will have
couple of child nodes to the phy controller) ?Typically in DT a subnode or collection of subnodes means there's some sort of bus involved. Usually each node corresponds to a struct device, and the parent node corresponds to the bus or controller for the logical bus.
Quoted 7 lines
In this case (only PCIe though? not UFS or USB?) it seems like we have multiple phys that share a common register space, but otherwise they have their own register space and power management. Would you have each PCIe controller point to a different subnode for their associated phy? I'm trying to understand the benefit of the subnodes if they aren't treated as struct devices.
Quoted 6 lines
Yes, instead of having all the controller having a phandle to the same PHY and then using other mechanisms to differentiate between the PHYs, each controller can have a phandle to the exact port that it is connected to.
This also gives a better representation of the hardware and can avoid lot of boilerplate code in the driver.
Below is one binding that works for me.
--------------------phy@34000 { compatible = "qcom,msm8996-qmp-pcie-phy"; reg = <0x034000 0x488>; #clock-cells = <1>; #address-cells = <1>; #size-cells = <1>; ranges; clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>, <&gcc GCC_PCIE_PHY_CFG_AHB_CLK>, <&gcc GCC_PCIE_CLKREF_CLK>; clock-names = "aux", "cfg_ahb", "ref"; vdda-phy-supply = <&pm8994_l28>; vdda-pll-supply = <&pm8994_l12>; resets = <&gcc GCC_PCIE_PHY_BCR>, <&gcc GCC_PCIE_PHY_COM_BCR>, <&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>; reset-names = "phy", "common", "cfg"; pciephy_p0: port@0 { reg = <0x035000 0x130>, <0x035200 0x200>, <0x035400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_0_PIPE_CLK>; clock-names = "pipe0"; resets = <&gcc GCC_PCIE_0_PHY_BCR>; reset-names = "lane0"; }; pciephy_p1: port@1 { reg = <0x036000 0x130>, <0x036200 0x200>, <0x036400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_1_PIPE_CLK>; clock-names = "pipe1"; resets = <&gcc GCC_PCIE_1_PHY_BCR>; reset-names = "lane1"; }; pciephy_p2: port@2 { reg = <0x037000 0x130>, <0x037200 0x200>, <0x037400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_2_PIPE_CLK>; clock-names = "pipe2"; resets = <&gcc GCC_PCIE_2_PHY_BCR>; reset-names = "lane2"; }; };
Quoted 3 lines
--------------------
let me know if this looks okay.
looks good to me.
Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Hi,
Quoted 119 lines · Kishon Vijay Abraham I
Hi,
Quoted 116 lines · Vivek Gautam
Quoted 47 lines · Kishon Vijay Abraham I
Hi,
Quoted 36 lines · Stephen Boyd
Quoted 13 lines · Vivek Gautam
Quoted 5 lines · Stephen Boyd
Quoted 1 line
Didn't we already move away from subnodes for lanes in an earlier revision of these patches? I seem to recall we did that because lanes are not devices and the whole "phy as a bus" concept not making sense.
Yea, we started out without having any sub-nodes and we argued that we don't require them since the qmp device is represented by the qmp node itself.
The lanes otoh are representative ofgen_physand related properties.Quoted 5 lines
In the driver -
"structqmp_phy" represents the lanes and holds "struct phy", "structqcom_qmp" represents the qmp block as a whole and holds "struct device"
Does this make lanes qualify to be childs of qmp ?Hmm... maybe I was recalling the DSI phy binding. I think there are lanes there too but we decided to just have one node.
Quoted 7 lines
"phy as a bus" (just trying to understand here) -
let's say a usb phy controller has one HSIC phy port and one USB2 phy port. So, should this phy controller be a bus providing two ports (and so we will have
couple of child nodes to the phy controller) ?Typically in DT a subnode or collection of subnodes means there's some sort of bus involved. Usually each node corresponds to a struct device, and the parent node corresponds to the bus or controller for the logical bus.
Quoted 7 lines
In this case (only PCIe though? not UFS or USB?) it seems like we have multiple phys that share a common register space, but otherwise they have their own register space and power management. Would you have each PCIe controller point to a different subnode for their associated phy? I'm trying to understand the benefit of the subnodes if they aren't treated as struct devices.
Quoted 6 lines
Yes, instead of having all the controller having a phandle to the same PHY and then using other mechanisms to differentiate between the PHYs, each controller can have a phandle to the exact port that it is connected to.
This also gives a better representation of the hardware and can avoid lot of boilerplate code in the driver.
Below is one binding that works for me.
--------------------phy@34000 { compatible = "qcom,msm8996-qmp-pcie-phy"; reg = <0x034000 0x488>; #clock-cells = <1>; #address-cells = <1>; #size-cells = <1>; ranges; clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>, <&gcc GCC_PCIE_PHY_CFG_AHB_CLK>, <&gcc GCC_PCIE_CLKREF_CLK>; clock-names = "aux", "cfg_ahb", "ref"; vdda-phy-supply = <&pm8994_l28>; vdda-pll-supply = <&pm8994_l12>; resets = <&gcc GCC_PCIE_PHY_BCR>, <&gcc GCC_PCIE_PHY_COM_BCR>, <&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>; reset-names = "phy", "common", "cfg"; pciephy_p0: port@0 { reg = <0x035000 0x130>, <0x035200 0x200>, <0x035400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_0_PIPE_CLK>; clock-names = "pipe0"; resets = <&gcc GCC_PCIE_0_PHY_BCR>; reset-names = "lane0"; }; pciephy_p1: port@1 { reg = <0x036000 0x130>, <0x036200 0x200>, <0x036400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_1_PIPE_CLK>; clock-names = "pipe1"; resets = <&gcc GCC_PCIE_1_PHY_BCR>; reset-names = "lane1"; }; pciephy_p2: port@2 { reg = <0x037000 0x130>, <0x037200 0x200>, <0x037400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_2_PIPE_CLK>; clock-names = "pipe2"; resets = <&gcc GCC_PCIE_2_PHY_BCR>; reset-names = "lane2"; }; };--------------------
Quoted 3 lines
Quoted 1 line
let me know if this looks okay.
looks good to me.
Great.
Rob, please let me know if above bindings look okay to you. I can re-spin the bindings patch then.
Thanks
Regards
Vivek
Quoted 7 lines
Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
In reply to Vivek GautamQuoted 17 lines · Vivek Gautam
Below is one binding that works for me.
--------------------phy@34000 { compatible = "qcom,msm8996-qmp-pcie-phy"; reg = <0x034000 0x488>; #clock-cells = <1>; #address-cells = <1>; #size-cells = <1>; ranges; clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>, <&gcc GCC_PCIE_PHY_CFG_AHB_CLK>, <&gcc GCC_PCIE_CLKREF_CLK>; clock-names = "aux", "cfg_ahb", "ref"; vdda-phy-supply = <&pm8994_l28>;
Quoted 8 lines
vdda-pll-supply = <&pm8994_l12>;
resets = <&gcc GCC_PCIE_PHY_BCR>,
<&gcc GCC_PCIE_PHY_COM_BCR>,
<&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>;
reset-names = "phy", "common", "cfg";
pciephy_p0: port@0 {The unit address '@0' should be replaced with something from the reg properties.
Also 'port' and 'ports' are almost keywords in DT now with the graph binding so we need to be careful when using them.
Quoted 35 lines
reg = <0x035000 0x130>,
<0x035200 0x200>,
<0x035400 0x1dc>;
#phy-cells = <0>;
clocks = <&gcc GCC_PCIE_0_PIPE_CLK>;
clock-names = "pipe0";
resets = <&gcc GCC_PCIE_0_PHY_BCR>;
reset-names = "lane0";
};
pciephy_p1: port@1 {
reg = <0x036000 0x130>,
<0x036200 0x200>,
<0x036400 0x1dc>;
#phy-cells = <0>;
clocks = <&gcc GCC_PCIE_1_PIPE_CLK>;
clock-names = "pipe1";
resets = <&gcc GCC_PCIE_1_PHY_BCR>;
reset-names = "lane1";
};
pciephy_p2: port@2 {
reg = <0x037000 0x130>,
<0x037200 0x200>,
<0x037400 0x1dc>;
#phy-cells = <0>;
clocks = <&gcc GCC_PCIE_2_PIPE_CLK>;
clock-names = "pipe2";
resets = <&gcc GCC_PCIE_2_PHY_BCR>;
reset-names = "lane2";
};
};Quoted 5 lines
--------------------
let me know if this looks okay.
What's the plan for non-pcie qmp phy binding? In that case we don't have ports, so it gets folded into one node?
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Quoted 19 lines · Stephen Boyd
Quoted 18 lines · Vivek Gautam
Below is one binding that works for me.
--------------------phy@34000 { compatible = "qcom,msm8996-qmp-pcie-phy"; reg = <0x034000 0x488>; #clock-cells = <1>; #address-cells = <1>; #size-cells = <1>; ranges; clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>, <&gcc GCC_PCIE_PHY_CFG_AHB_CLK>, <&gcc GCC_PCIE_CLKREF_CLK>; clock-names = "aux", "cfg_ahb", "ref"; vdda-phy-supply = <&pm8994_l28>; vdda-pll-supply = <&pm8994_l12>;
Quoted 8 lines
Quoted 6 lines
resets = <&gcc GCC_PCIE_PHY_BCR>, <&gcc GCC_PCIE_PHY_COM_BCR>, <&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>; reset-names = "phy", "common", "cfg"; pciephy_p0: port@0 {The unit address '@0' should be replaced with something from the reg properties.
Sure, will take care of this.
Quoted 4 lines
Also 'port' and 'ports' are almost keywords in DT now with the graph binding so we need to be careful when using them.
From "./Documentation/devicetree/bindings/graph.txt" -
"The device tree graph bindings described herein abstract more complex devices that can have multiple specifiable ports, each of which can be linked to one or more ports of other devices."
So, this means we use 'port', 'ports' and 'endpoint' for devices whose one or more ports is connected to other device's one or more ports.
I can use 'lane' for the node name here.
Quoted 38 lines
Quoted 38 lines
reg = <0x035000 0x130>, <0x035200 0x200>, <0x035400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_0_PIPE_CLK>; clock-names = "pipe0"; resets = <&gcc GCC_PCIE_0_PHY_BCR>; reset-names = "lane0"; }; pciephy_p1: port@1 { reg = <0x036000 0x130>, <0x036200 0x200>, <0x036400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_1_PIPE_CLK>; clock-names = "pipe1"; resets = <&gcc GCC_PCIE_1_PHY_BCR>; reset-names = "lane1"; }; pciephy_p2: port@2 { reg = <0x037000 0x130>, <0x037200 0x200>, <0x037400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_2_PIPE_CLK>; clock-names = "pipe2"; resets = <&gcc GCC_PCIE_2_PHY_BCR>; reset-names = "lane2"; }; };--------------------
Quoted 6 lines
Quoted 3 lines
let me know if this looks okay.
What's the plan for non-pcie qmp phy binding? In that case we don't have ports, so it gets folded into one node?
The non-pcie qmp phys still have one lane, that provides tx/rx.
I am of the opinion that we don't have two different ways to create phys in the driver, and keep one port/lane for such phys in dt.
Regards
Vivek
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
(Not sure I replied so here it is)
Quoted 10 lines · Vivek Gautam
Quoted 1 line · Stephen Boyd
On 01/24, Vivek Gautam wrote:
From "
./Documentation/devicetree/bindings/graph.txt" -
"The device tree graph bindings described herein abstract more complex devices that can have multiple specifiable ports, each of which can be linked to one or more ports of other devices."
Quoted 4 lines
So, this means we use 'port', 'ports' and 'endpoint' for devices whose one or more ports is connected to other device's one or more ports.
I can use 'lane' for the node name here.
Ok.
Quoted 42 lines
Quoted 42 lines
Quoted 42 lines
reg = <0x035000 0x130>, <0x035200 0x200>, <0x035400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_0_PIPE_CLK>; clock-names = "pipe0"; resets = <&gcc GCC_PCIE_0_PHY_BCR>; reset-names = "lane0"; }; pciephy_p1: port@1 { reg = <0x036000 0x130>, <0x036200 0x200>, <0x036400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_1_PIPE_CLK>; clock-names = "pipe1"; resets = <&gcc GCC_PCIE_1_PHY_BCR>; reset-names = "lane1"; }; pciephy_p2: port@2 { reg = <0x037000 0x130>, <0x037200 0x200>, <0x037400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_2_PIPE_CLK>; clock-names = "pipe2"; resets = <&gcc GCC_PCIE_2_PHY_BCR>; reset-names = "lane2"; }; };--------------------
let me know if this looks okay.
Quoted 8 lines
Quoted 3 lines
What's the plan for non-pcie qmp phy binding? In that case we don't have ports, so it gets folded into one node?
The non-pcie qmp phys still have one lane, that provides tx/rx.
I am of the opinion that we don't have two different ways to create phys in the driver, and keep one port/lane for such phys in dt.
Ok so we would still have a subnode in that case. Sounds ok.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 3/4] dt-bindings: phy: Add support for QMP phy
Quoted 60 lines · Stephen Boyd
(Not sure I replied so here it is)
Quoted 8 lines · Vivek Gautam
Quoted 1 line · Stephen Boyd
On 01/24, Vivek Gautam wrote:
From "
./Documentation/devicetree/bindings/graph.txt" -
"The device tree graph bindings described herein abstract more complex devices that can have multiple specifiable ports, each of which can be linked to one or more ports of other devices."Quoted 4 lines
So, this means we use 'port', 'ports' and 'endpoint' for devices whose one or more ports is connected to other device's one or more ports.
I can use 'lane' for the node name here.
Ok.
Quoted 43 lines
Quoted 43 lines
Quoted 35 lines
reg = <0x035000 0x130>, <0x035200 0x200>, <0x035400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_0_PIPE_CLK>; clock-names = "pipe0"; resets = <&gcc GCC_PCIE_0_PHY_BCR>; reset-names = "lane0"; }; pciephy_p1: port@1 { reg = <0x036000 0x130>, <0x036200 0x200>, <0x036400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_1_PIPE_CLK>; clock-names = "pipe1"; resets = <&gcc GCC_PCIE_1_PHY_BCR>; reset-names = "lane1"; }; pciephy_p2: port@2 { reg = <0x037000 0x130>, <0x037200 0x200>, <0x037400 0x1dc>; #phy-cells = <0>; clocks = <&gcc GCC_PCIE_2_PIPE_CLK>; clock-names = "pipe2"; resets = <&gcc GCC_PCIE_2_PHY_BCR>; reset-names = "lane2"; }; };Quoted 5 lines
--------------------
let me know if this looks okay.
What's the plan for non-pcie qmp phy binding? In that case we don't have ports, so it gets folded into one node?
Quoted 6 lines
Quoted 5 lines
The non-pcie qmp phys still have one lane, that provides tx/rx.
I am of the opinion that we don't have two different ways to create phys in the driver, and keep one port/lane for such phys in dt.
Ok so we would still have a subnode in that case. Sounds ok.
Cool.
Thanks
Vivek
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v4 4/4 phy: qcom-qmp: new qmp phy driver for qcom-chipsets
In reply to Vivek GautamQualcomm SOCs have QMP phy controller that provides support to a number of controller, viz. PCIe, UFS, and USB. Add a new driver, based on generic phy framework, for this phy controller.
---
Changes since v3:
- Renamed 'struct qcom_qmp_phy' to 'struct qcom_qmp' and 'struct qmp_phy_desc' to 'struct qmp_phy' to avoid any confusion in distinguishing between QMP phy block and per-lane phy which is the actual phy in Linux eyes (suggested by Bjorn Andersson).
- Made error labels more idiomatic.
- Modified status checking for phy pcs.
- Fixed power_down_delay check.
- Refactored phy_pipe_clk_register() to register the pipe clock source using devm_clk_hw_register() (suggested by Stephen).
- qcom_qmp_phy_xlate() function:
- Removed unnecessary 'for loop'.
- Added additional check for '0' or -ve args_count.
- Fixed the mixed tabs and spaces in pipe_clk_src diagram.
- Removed instances of memset() since we use snprintf() for the buffers.
- Refactored qphy_setbits() and qphy_clrbits() a little bit to accept base address and register offset as two separate arguments.
Changes since v2:
- Removed selecting 'RESET_CONTROLLER' config.
- Added error handling for clk_prepare_enable paths.
- Removed 'ref_clk_src' handling. Driver doesn't need to request and handle this clock.
- Using readl_poll_timeout() to simplify pcs ready status polling. Also fixed the polling condition for pcs block ready status:
'Common block ready status bit is set on phy init completion, while PCS block ready status bit (PHYSTATUS) is reset on phy init completion.'
- Moved out the per-lane phy creation from probe() to separate function.
- Registering pipe clock source as a fixed rate clock that comes out of the PLL block of QMP phy. These source clocks serve as parent to 'pipe_clks' that are requested by pcie or usb3 phys.
- Using of_device_get_match_data() to get match data.
- Fixed sparse warnings for 'static' and 'const'.
- Using shorter variable names in structure and in functions.
- Handling various comment style shortcomings.
Changes since v1:
- Fixed missing mutex_unlock() calls in error cases, reported by Julia Lawall.
- Selecting CONFIG_RESET_CONTROLLER when this driver is enabled.
- Added a boolean property to check if the phy has individual lane reset available.
- Took care or EPROBE_DEFER, dev_vdbg() and other minor nits.
- Removed references to non-lkml links from commit message.
- Moved to use separate iomem resources for each lanes. Tx, Rx and PCS offsets per lane can now come from dt bindings.
drivers/phy/Kconfig | 8 + drivers/phy/Makefile | 1 + drivers/phy/phy-qcom-qmp.c | 1206 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1215 insertions(+) create mode 100644 drivers/phy/phy-qcom-qmp.c
drivers/phy/Kconfig +8 -0
@@ -430,6 +430,14 @@ config PHY_STIH407_USB Enable this support to enable the picoPHY device used by USB2 and USB3 controllers on STMicroelectronics STiH407 SoC families. +config PHY_QCOM_QMP + tristate "Qualcomm QMP PHY Driver" + depends on OF && (ARCH_QCOM || COMPILE_TEST) + select GENERIC_PHY + help + Enable this to support the QMP PHY transceiver that is used + with controllers such as PCIe, UFS, and USB on Qualcomm chips. + config PHY_QCOM_QUSB2 tristate "Qualcomm QUSB2 PHY Driver" depends on OF && (ARCH_QCOM || COMPILE_TEST)
drivers/phy/Makefile +1 -0
@@ -50,6 +50,7 @@ obj-$(CONFIG_PHY_ST_SPEAR1340_MIPHY) += phy-spear1340-miphy.o obj-$(CONFIG_PHY_XGENE) += phy-xgene.o obj-$(CONFIG_PHY_STIH407_USB) += phy-stih407-usb.o obj-$(CONFIG_PHY_QCOM_QUSB2) += phy-qcom-qusb2.o +obj-$(CONFIG_PHY_QCOM_QMP) += phy-qcom-qmp.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-20nm.o obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-14nm.o
drivers/phy/phy-qcom-qmp.c new file +1206 -0
1,206 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets
Quoted 8 lines · Vivek Gautam
Qualcomm SOCs have QMP phy controller that provides support to a number of controller, viz. PCIe, UFS, and USB. Add a new driver, based on generic phy framework, for this phy controller.
Signed-off-by Vivek Gautam <[email protected]>Tested-by Srinivas Kandagatla <[email protected]>---
< snip>
drivers/phy/phy-qcom-qmp.c line 1097
Quoted 8 lines
drivers/phy/phy-qcom-qmp.c new file +8
-0+static const struct of_device_id qcom_qmp_phy_of_match_table[] = { + { + .compatible ="qcom,msm8996-qmp-pcie-phy" , + .data = &msm8996_pciephy_cfg, + }, { + .compatible ="qcom,msm8996-qmp-usb3-phy" , + .data = &msm8996_usb3phy_cfg, + },
Which other chips would this driver support?
Regards,
Andy Gross
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets
Hi,
Quoted 11 lines · Andy Gross
Quoted 8 lines · Vivek Gautam
Qualcomm SOCs have QMP phy controller that provides support to a number of controller, viz. PCIe, UFS, and USB. Add a new driver, based on generic phy framework, for this phy controller.
Signed-off-by Vivek Gautam <[email protected]>Tested-by Srinivas Kandagatla <[email protected]>---
< snip>
Quoted 9 lines
drivers/phy/phy-qcom-qmp.c line 1097
Quoted 8 lines
drivers/phy/phy-qcom-qmp.c new file +8
-0+static const struct of_device_id qcom_qmp_phy_of_match_table[] = { + { + .compatible ="qcom,msm8996-qmp-pcie-phy" , + .data = &msm8996_pciephy_cfg, + }, { + .compatible ="qcom,msm8996-qmp-usb3-phy" , + .data = &msm8996_usb3phy_cfg, + },Which other chips would this driver support?
msm8998 has the same combo PHY IP. We may need minor changes in the initialization tables to support that.
Regards
Vivek
Quoted 9 lines
Regards,
Andy Gross
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project