Thread (12 messages) 12 messages, 5 authors, 2021-12-10

Re: Re: [PATCH v3 2/3] phy/rockchip: add naneng combo phy for RK3568

From: 赵仪峰 <hidden>
Date: 2021-12-10 09:54:04
Also in: linux-arm-kernel, linux-rockchip

Hi Johan,

We refer to the IP documents only  and don't notice that the TRM names the registers is different. 

About the SSC, ssc_en = 1, In PCIE mode will set SSC ON, it the same with SATA and USB. 
The document description is not clear enough.




Hi,


See question below.


On 11/14/21 12:40 PM, Johan Jonker wrote:

quoted
Hi Yifeng,

quoted

quoted
Some comments. Have a look if it's useful.

quoted

quoted
On 10/25/21 10:06 AM, Yifeng Zhao wrote:

quoted
quoted
This patch implements a combo phy driver for Rockchip SoCs

quoted
quoted
with NaNeng IP block. This phy can be used as pcie-phy, usb3-phy,

quoted
quoted
sata-phy or sgmii-phy.

quoted
quoted

quoted
quoted
Signed-off-by: Yifeng Zhao <redacted>

quoted
quoted
---


quoted
quoted
diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c


quoted
quoted
+

quoted
quoted
+#define BIT_WRITEABLE_SHIFT		16

quoted
quoted
+#define REF_CLOCK_24MHz			24000000

quoted
quoted
+#define REF_CLOCK_25MHz			25000000

quoted
quoted
+#define REF_CLOCK_100MHz		100000000

quoted
quoted
+/* RK3568 T22 COMBO PHY REG */

quoted
quoted
+#define RK3568_T22_PHYREG5		0x14

quoted
quoted
+#define T22_PHYREG5_PLL_DIV_MASK	GENMASK(7, 6)

quoted
quoted
+#define T22_PHYREG5_PLL_DIV_SHIFT	6

quoted
quoted
+#define T22_PHYREG5_PLL_DIV_2		1

quoted
quoted
+


quoted
quoted
+#define RK3568_T22_PHYREG6		0x18


Multi-PHY_Register007

Address: Operational Base + offset (0x0018)


quoted
quoted
+#define T22_PHYREG6_TX_RTERM_MASK	GENMASK(7, 4)

quoted
quoted
+#define T22_PHYREG6_TX_RTERM_SHIFT	4

quoted
quoted
+#define T22_PHYREG6_TX_RTERM_50OHM	0x8

quoted
quoted
+#define T22_PHYREG6_RX_RTERM_MASK	GENMASK(3, 0)

quoted
quoted
+#define T22_PHYREG6_RX_RTERM_SHIFT	0

quoted
quoted
+#define T22_PHYREG6_RX_RTERM_44OHM	0xF

quoted
quoted
+

quoted
quoted
+#define RK3568_T22_PHYREG7		0x1C


Multi-PHY_Register008

Address: Operational Base + offset (0x001C)


quoted
quoted
+#define T22_PHYREG7_SSC_EN		BIT(4)


See Rockchip RK3568 TRM Part2 V1.0-20210111 page 1957-1958


It looks as if all PHYREG defines add -1 in value? I'm I correct here?


===


SSC_EN

In U3 and SATA mode, this bit= 1, set SSC on

In PCIE mode, this bit=0 set SSC off


     If Spread Spectrum Clocking (SSC) is used it is

     required that a common reference clock is used by the link partners.

     Most commercially available platforms with PCIe backplanes use

     SSC to reduce EMI.


Maybe a dumb question for in a possible YAML description:

Is this above text from the TRM correct?

Is SSC only used in combination with PCIE instead of U3 and SATA?


===


Johan


quoted
quoted
+

quoted
quoted
+#define RK3568_T22_PHYREG10		0x28

quoted
quoted
+#define T22_PHYREG10_SU_TRIM_0_7	0xF0

quoted
quoted
+

quoted
quoted
+#define RK3568_T22_PHYREG11		0x2C

quoted
quoted
+#define T22_PHYREG11_PLL_LPF_ADJ	0x4

quoted
quoted
+


quoted
quoted
+#define RK3568_T22_PHYREG12		0x30


Multi-PHY_Register013

Address: Operational Base + offset (0x0030)


quoted
quoted
+#define T22_PHYREG12_RESISTER_MASK	GENMASK(5, 4)

quoted
quoted
+#define T22_PHYREG12_RESISTER_SHIFT	0x4

quoted
quoted
+#define T22_PHYREG12_RESISTER_HIGH_Z	0x3

quoted
quoted
+#define T22_PHYREG12_CKRCV_AMP0		BIT(7)

quoted
quoted
+

quoted
quoted
+#define RK3568_T22_PHYREG13		0x34

quoted
quoted
+#define T22_PHYREG13_CKRCV_AMP1		BIT(0)

quoted
quoted
+

quoted
quoted
+#define RK3568_T22_PHYREG14		0x38

quoted
quoted
+#define T22_PHYREG14_CTLE_EN		BIT(0)

quoted
quoted
+#define T22_PHYREG14_SSC_CNT_MASK	GENMASK(7, 6)

quoted
quoted
+#define T22_PHYREG14_SSC_CNT_SHIFT	6

quoted
quoted
+#define T22_PHYREG14_SSC_CNT_VALUE	0x1

quoted
quoted
+

quoted
quoted
+#define RK3568_T22_PHYREG15		0x3C

quoted
quoted
+#define T22_PHYREG15_SSC_CNT_VALUE	0x5f

quoted
quoted
+

quoted
quoted
+#define RK3568_T22_PHYREG17		0x44

quoted
quoted
+#define T22_PHYREG17_PLL_LOOP		0x32

quoted
quoted
+

quoted
quoted
+#define RK3568_T22_PHYREG31		0x7C

quoted
quoted
+#define T22_PHYREG31_SSC_MASK		GENMASK(7, 4)

quoted
quoted
+#define T22_PHYREG31_SSC_DIR_SHIFT	4

quoted
quoted
+#define T22_PHYREG31_SSC_UPWARD		0

quoted
quoted
+#define T22_PHYREG31_SSC_DOWNWARD	1

quoted
quoted
+#define T22_PHYREG31_SSC_OFFSET_SHIFT	6

quoted
quoted
+#define T22_PHYREG31_SSC_OFFSET_500PPM	1

quoted
quoted
+

quoted
quoted
+#define RK3568_T22_PHYREG32		0x80

quoted
quoted
+#define T22_PHYREG32_PLL_KVCO_MASK	GENMASK(4, 2)

quoted
quoted
+#define T22_PHYREG32_PLL_KVCO_SHIFT	2

quoted
quoted
+#define T22_PHYREG32_PLL_KVCO_VALUE	2

quoted
quoted
+




-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help