Re: [PATCH v2 4/6] usb: dwc3: reference clock period configuration
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Date: 2021-08-13 19:52:15
Also in:
linux-arm-kernel, linux-arm-msm, linux-devicetree, linux-usb
Rob Herring wrote:
On Wed, Aug 04, 2021 at 05:22:27PM +0300, Baruch Siach wrote:quoted
Hi Felipe, On Wed, Aug 04 2021, Felipe Balbi wrote:quoted
Baruch Siach [off-list ref] writes:quoted
@@ -1371,6 +1398,8 @@ static void dwc3_get_properties(struct dwc3 *dwc) &dwc->hsphy_interface); device_property_read_u32(dev, "snps,quirk-frame-length-adjustment", &dwc->fladj); + device_property_read_u32(dev, "snps,ref-clock-period", + &dwc->ref_clk_per);I wonder if it would make more sense to pass an actual clock reference here. If valid, then reconfigure the period to the value returned by clk_get_rate(). It would avoid yet another DT binding. If we make the clock optional, then we won't affect any other platforms. The clock itself could be a regular fixed clock node.Thinh Nguyen asked to add a dedicated DT property. He explained that clk_get_rate() does not work for PCI hosted dwc3. This is the most complete summary of the discussion: https://urldefense.com/v3/__https://lore.kernel.org/r/c797e9cb-cae6-c0b6-5714-169c2ad79d32@synopsys.com__;!!A4F2R9G_pg!Nh6rqp_aOd8XIvqELvDRQe5ooZf13UZKwmn9lWcRgdbyMKpTMzL8HasrB1X2Ojvumo8g$PCI devices can have DT nodes with clock properties too. Or use the VID/PID to infer the frequency. Or use 'clock-frequency' property. It boils down to we have lots of standard properties for clocks and clock configuration, so custom properties are a NAK.
Do we have DT node for the PCI device before discovering the device from PCI bus enumeration? I don't think we can find the clock properties from its configuration space. For our HAPS devices, we can't use VID/PID to infer the frequency since our phy and ref clock may change. Does "clock-frequency" mean ref clock? If so, let's use that? Thanks, Thinh -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy