Loading Documentation/devicetree/bindings/pci/msm_pcie.txt +3 −0 Original line number Original line Diff line number Diff line Loading @@ -48,6 +48,8 @@ Optional Properties: - qcom,l1ss-supported: L1 sub-states (L1ss) is supported. - qcom,l1ss-supported: L1 sub-states (L1ss) is supported. - qcom,aux-clk-sync: The AUX clock is synchronous to the Core clock to - qcom,aux-clk-sync: The AUX clock is synchronous to the Core clock to support L1ss. support L1ss. - qcom,n-fts: The number of fast training sequences sent when the link state is changed from L0s to L0. - qcom,msi-gicm-addr: MSI address for GICv2m. - qcom,msi-gicm-addr: MSI address for GICv2m. - qcom,msi-gicm-base: MSI IRQ base for GICv2m. - qcom,msi-gicm-base: MSI IRQ base for GICv2m. - qcom,ext-ref-clk: The reference clock is external. - qcom,ext-ref-clk: The reference clock is external. Loading Loading @@ -112,6 +114,7 @@ Example: <0>, <0>, <0>, <0>; <0>, <0>, <0>, <0>; qcom,l1ss-supported; qcom,l1ss-supported; qcom,aux-clk-sync; qcom,aux-clk-sync; qcom,n-fts = <0x50>; qcom,msi-gicm-addr = <0xf9040040>; qcom,msi-gicm-addr = <0xf9040040>; qcom,msi-gicm-base = <0x160>; qcom,msi-gicm-base = <0x160>; qcom,ext-ref-clk; qcom,ext-ref-clk; Loading arch/arm/mach-msm/pcie.c +23 −5 Original line number Original line Diff line number Diff line Loading @@ -70,6 +70,7 @@ #define PCIE20_DEVICE_CONTROL2_STATUS2 0x98 #define PCIE20_DEVICE_CONTROL2_STATUS2 0x98 #define PCIE20_ACK_F_ASPM_CTRL_REG 0x70C #define PCIE20_ACK_F_ASPM_CTRL_REG 0x70C #define PCIE20_ACK_N_FTS 0xff00 #define PCIE20_PLR_IATU_VIEWPORT 0x900 #define PCIE20_PLR_IATU_VIEWPORT 0x900 #define PCIE20_PLR_IATU_CTRL1 0x904 #define PCIE20_PLR_IATU_CTRL1 0x904 Loading Loading @@ -631,17 +632,23 @@ static void msm_pcie_config_controller(struct msm_pcie_dev_t *dev) readl_relaxed(dev->dm_core + PCIE20_PLR_IATU_UTAR)); readl_relaxed(dev->dm_core + PCIE20_PLR_IATU_UTAR)); PCIE_DBG("PCIE20_PLR_IATU_CTRL2:0x%x\n", PCIE_DBG("PCIE20_PLR_IATU_CTRL2:0x%x\n", readl_relaxed(dev->dm_core + PCIE20_PLR_IATU_CTRL2)); readl_relaxed(dev->dm_core + PCIE20_PLR_IATU_CTRL2)); } static void msm_pcie_config_l1ss(struct msm_pcie_dev_t *dev) /* configure N_FTS */ { PCIE_DBG("Original PCIE20_ACK_F_ASPM_CTRL_REG:0x%x\n", PCIE_DBG("Original PCIE20_ACK_F_ASPM_CTRL_REG:0x%x\n", readl_relaxed(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG)); readl_relaxed(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG)); msm_pcie_write_mask(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG, 0, if (!dev->n_fts) BIT(15)); msm_pcie_write_mask(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG, 0, BIT(15)); else msm_pcie_write_mask(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG, PCIE20_ACK_N_FTS, dev->n_fts << 8); PCIE_DBG("Updated PCIE20_ACK_F_ASPM_CTRL_REG:0x%x\n", PCIE_DBG("Updated PCIE20_ACK_F_ASPM_CTRL_REG:0x%x\n", readl_relaxed(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG)); readl_relaxed(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG)); } static void msm_pcie_config_l1ss(struct msm_pcie_dev_t *dev) { /* Enable the AUX Clock and the Core Clk to be synchronous for L1SS*/ /* Enable the AUX Clock and the Core Clk to be synchronous for L1SS*/ if (!dev->aux_clk_sync) if (!dev->aux_clk_sync) msm_pcie_write_mask(dev->parf + msm_pcie_write_mask(dev->parf + Loading Loading @@ -1264,6 +1271,17 @@ static int msm_pcie_probe(struct platform_device *pdev) PCIE_DBG("AUX clock is %s synchronous to Core clock.\n", PCIE_DBG("AUX clock is %s synchronous to Core clock.\n", msm_pcie_dev[rc_idx].aux_clk_sync ? "" : "not"); msm_pcie_dev[rc_idx].aux_clk_sync ? "" : "not"); msm_pcie_dev[rc_idx].n_fts = 0; ret = of_property_read_u32((&pdev->dev)->of_node, "qcom,n-fts", &msm_pcie_dev[rc_idx].n_fts); if (ret) PCIE_DBG("n-fts does not exist.\n"); else PCIE_DBG("n-fts: 0x%x.\n", msm_pcie_dev[rc_idx].n_fts); msm_pcie_dev[rc_idx].ext_ref_clk = msm_pcie_dev[rc_idx].ext_ref_clk = of_property_read_bool((&pdev->dev)->of_node, of_property_read_bool((&pdev->dev)->of_node, "qcom,ext-ref-clk"); "qcom,ext-ref-clk"); Loading arch/arm/mach-msm/pcie.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -174,6 +174,7 @@ struct msm_pcie_dev_t { bool l1ss_supported; bool l1ss_supported; bool aux_clk_sync; bool aux_clk_sync; uint32_t n_fts; bool ext_ref_clk; bool ext_ref_clk; uint32_t ep_latency; uint32_t ep_latency; Loading Loading
Documentation/devicetree/bindings/pci/msm_pcie.txt +3 −0 Original line number Original line Diff line number Diff line Loading @@ -48,6 +48,8 @@ Optional Properties: - qcom,l1ss-supported: L1 sub-states (L1ss) is supported. - qcom,l1ss-supported: L1 sub-states (L1ss) is supported. - qcom,aux-clk-sync: The AUX clock is synchronous to the Core clock to - qcom,aux-clk-sync: The AUX clock is synchronous to the Core clock to support L1ss. support L1ss. - qcom,n-fts: The number of fast training sequences sent when the link state is changed from L0s to L0. - qcom,msi-gicm-addr: MSI address for GICv2m. - qcom,msi-gicm-addr: MSI address for GICv2m. - qcom,msi-gicm-base: MSI IRQ base for GICv2m. - qcom,msi-gicm-base: MSI IRQ base for GICv2m. - qcom,ext-ref-clk: The reference clock is external. - qcom,ext-ref-clk: The reference clock is external. Loading Loading @@ -112,6 +114,7 @@ Example: <0>, <0>, <0>, <0>; <0>, <0>, <0>, <0>; qcom,l1ss-supported; qcom,l1ss-supported; qcom,aux-clk-sync; qcom,aux-clk-sync; qcom,n-fts = <0x50>; qcom,msi-gicm-addr = <0xf9040040>; qcom,msi-gicm-addr = <0xf9040040>; qcom,msi-gicm-base = <0x160>; qcom,msi-gicm-base = <0x160>; qcom,ext-ref-clk; qcom,ext-ref-clk; Loading
arch/arm/mach-msm/pcie.c +23 −5 Original line number Original line Diff line number Diff line Loading @@ -70,6 +70,7 @@ #define PCIE20_DEVICE_CONTROL2_STATUS2 0x98 #define PCIE20_DEVICE_CONTROL2_STATUS2 0x98 #define PCIE20_ACK_F_ASPM_CTRL_REG 0x70C #define PCIE20_ACK_F_ASPM_CTRL_REG 0x70C #define PCIE20_ACK_N_FTS 0xff00 #define PCIE20_PLR_IATU_VIEWPORT 0x900 #define PCIE20_PLR_IATU_VIEWPORT 0x900 #define PCIE20_PLR_IATU_CTRL1 0x904 #define PCIE20_PLR_IATU_CTRL1 0x904 Loading Loading @@ -631,17 +632,23 @@ static void msm_pcie_config_controller(struct msm_pcie_dev_t *dev) readl_relaxed(dev->dm_core + PCIE20_PLR_IATU_UTAR)); readl_relaxed(dev->dm_core + PCIE20_PLR_IATU_UTAR)); PCIE_DBG("PCIE20_PLR_IATU_CTRL2:0x%x\n", PCIE_DBG("PCIE20_PLR_IATU_CTRL2:0x%x\n", readl_relaxed(dev->dm_core + PCIE20_PLR_IATU_CTRL2)); readl_relaxed(dev->dm_core + PCIE20_PLR_IATU_CTRL2)); } static void msm_pcie_config_l1ss(struct msm_pcie_dev_t *dev) /* configure N_FTS */ { PCIE_DBG("Original PCIE20_ACK_F_ASPM_CTRL_REG:0x%x\n", PCIE_DBG("Original PCIE20_ACK_F_ASPM_CTRL_REG:0x%x\n", readl_relaxed(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG)); readl_relaxed(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG)); msm_pcie_write_mask(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG, 0, if (!dev->n_fts) BIT(15)); msm_pcie_write_mask(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG, 0, BIT(15)); else msm_pcie_write_mask(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG, PCIE20_ACK_N_FTS, dev->n_fts << 8); PCIE_DBG("Updated PCIE20_ACK_F_ASPM_CTRL_REG:0x%x\n", PCIE_DBG("Updated PCIE20_ACK_F_ASPM_CTRL_REG:0x%x\n", readl_relaxed(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG)); readl_relaxed(dev->dm_core + PCIE20_ACK_F_ASPM_CTRL_REG)); } static void msm_pcie_config_l1ss(struct msm_pcie_dev_t *dev) { /* Enable the AUX Clock and the Core Clk to be synchronous for L1SS*/ /* Enable the AUX Clock and the Core Clk to be synchronous for L1SS*/ if (!dev->aux_clk_sync) if (!dev->aux_clk_sync) msm_pcie_write_mask(dev->parf + msm_pcie_write_mask(dev->parf + Loading Loading @@ -1264,6 +1271,17 @@ static int msm_pcie_probe(struct platform_device *pdev) PCIE_DBG("AUX clock is %s synchronous to Core clock.\n", PCIE_DBG("AUX clock is %s synchronous to Core clock.\n", msm_pcie_dev[rc_idx].aux_clk_sync ? "" : "not"); msm_pcie_dev[rc_idx].aux_clk_sync ? "" : "not"); msm_pcie_dev[rc_idx].n_fts = 0; ret = of_property_read_u32((&pdev->dev)->of_node, "qcom,n-fts", &msm_pcie_dev[rc_idx].n_fts); if (ret) PCIE_DBG("n-fts does not exist.\n"); else PCIE_DBG("n-fts: 0x%x.\n", msm_pcie_dev[rc_idx].n_fts); msm_pcie_dev[rc_idx].ext_ref_clk = msm_pcie_dev[rc_idx].ext_ref_clk = of_property_read_bool((&pdev->dev)->of_node, of_property_read_bool((&pdev->dev)->of_node, "qcom,ext-ref-clk"); "qcom,ext-ref-clk"); Loading
arch/arm/mach-msm/pcie.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -174,6 +174,7 @@ struct msm_pcie_dev_t { bool l1ss_supported; bool l1ss_supported; bool aux_clk_sync; bool aux_clk_sync; uint32_t n_fts; bool ext_ref_clk; bool ext_ref_clk; uint32_t ep_latency; uint32_t ep_latency; Loading