Tool/software: Linux
Hi,all
DRA75xx provides the 100MHz clock for PCIE。How to configure the register?Do you have reference code?Thanks for your recovery。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Linux
Hi,all
DRA75xx provides the 100MHz clock for PCIE。How to configure the register?Do you have reference code?Thanks for your recovery。
Hi,
I've seen the file drivers/phy/phy-ti-pipe3.c.I found a lack of " .data = dpll_map_pcie" as follows:
static const struct of_device_id ti_pipe3_id_table[] = {
{
.compatible = "ti,phy-usb3",
.data = dpll_map_usb,
},
{
.compatible = "ti,omap-usb3",
.data = dpll_map_usb,
},
{
.compatible = "ti,phy-pipe3-sata",
.data = dpll_map_sata,
},
{
.compatible = "ti,phy-pipe3-pcie",
},
{}
};
At the same time, it is found that the configuration of this structure "pipe3_dpll_params" is not consistent with the configuration of PCIe. Do you have a solution? Thanks.
Dear Shravan,
Have anyone in your group configured PCIe 100MHz clk? Help us with the consultation,we are particularly anxious about the PCIe project.The boss asks for a quick solution.Please give us more help.Thanks very much.
Dahua Technology Co., Ltd
Dear Mariya,
After CTRL_CORE_SMA_SW_6[17:16]=0x01 and CM_CLKMODE_APLL_PCIE[7]=0, Why can't I measure the clock signal 100MHz from pin LJCB_CLKN and LJCB_CLKP?
Hi,
I would like to recommend TRM section 26.4.5 PCIePHY Subsystem Low-Level Programming Model.
It was validated and works fine for PCIe PHY initialization and clocking.
Regards,
Stan
Hi,
If you want to use DPLL_PCIE_REF as input clock to APLL it is configured using the below call in the function ti_pipe3_get_clk in the file drivers/phy/phy-ti-pipe3.c (this is the default configuration)
clk = devm_clk_get(dev, "dpll_ref_m2");
if (IS_ERR(clk)) {
dev_err(dev, "unable to get dpll ref m2 clk\n");
return PTR_ERR(clk);
}
clk_set_rate(clk, 100000000);
If you want to set APLL input clock as ASPCIE then apply the below patch on kernel. The exact details of the registers set is available in the TRM (link provided in previous posts).
Regards
Shravan
From 5a16e6f5223b06e076c5d97f57b626721486a03a Mon Sep 17 00:00:00 2001 From: Shravan Karthik <shravan.karthik@ti.com> Date: Fri, 8 Jun 2018 15:51:05 +0530 Subject: [PATCH] phy: pcie: Set APLL reference input clock as ACSPCIE Set mux configurationt to enable ACSPCIE as APLL input clock Also set ASCPCIe in RX Mode and disable dpll_ref_m2 clock --- drivers/phy/phy-ti-pipe3.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c index bf46844..f3f75f1 100644 --- a/drivers/phy/phy-ti-pipe3.c +++ b/drivers/phy/phy-ti-pipe3.c @@ -410,12 +410,14 @@ static int ti_pipe3_get_clk(struct ti_pipe3 *phy) } clk_set_rate(clk, 1500000000); +/* clk = devm_clk_get(dev, "dpll_ref_m2"); if (IS_ERR(clk)) { dev_err(dev, "unable to get dpll ref m2 clk\n"); return PTR_ERR(clk); } clk_set_rate(clk, 100000000); +*/ clk = devm_clk_get(dev, "phy-div"); if (IS_ERR(clk)) { @@ -423,7 +425,6 @@ static int ti_pipe3_get_clk(struct ti_pipe3 *phy) return PTR_ERR(clk); } clk_set_rate(clk, 100000000); - phy->div_clk = devm_clk_get(dev, "div-clk"); if (IS_ERR(phy->div_clk)) { dev_err(dev, "unable to get div-clk\n"); @@ -551,6 +552,19 @@ static int ti_pipe3_probe(struct platform_device *pdev) struct device_node *node = pdev->dev.of_node; struct device *dev = &pdev->dev; int ret; + uint32_t readval; + + void __iomem *txrxregs = ioremap(0x4a003c14, 4); + readval = (uint32_t) readl(txrxregs); + readval |= 0x20000; + writel(readval,txrxregs); + iounmap(txrxregs); + + void __iomem *muxregs = ioremap(0x4a00821c, 4); + readval = (uint32_t) readl(muxregs); + readval |= 0x180; + writel(readval,muxregs); + iounmap(muxregs); phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); if (!phy) -- 2.7.4
Hi Shravan,
Can the address of (0x4a003c14 and 0x4a00821c) be mapped directly? Direct mapping leads to the kernel halt. Is there another function to be opened to guarantee address mapping ? Thanks.
Hi,
The patch provided has been tested and works fine, thus these addresses can be mapped directly. A condition check ensuring txrxregs and muxregs are not NULL can be used to guarantee address mapping.
The thread has been marked resolved, if you have any further queries, please initiate a new thread, we will support you.
Regards
Shravan