Re: Set reference clock for onboard hub in DT

2018-11-05 Thread Schrempf Frieder
Hi Fabio,

On 25.10.18 15:20, Fabio Estevam wrote:
> Hi Frieder,
> 
> On Thu, Sep 20, 2018 at 10:52 AM Frieder Schrempf
>  wrote:
>>
>> Hi,
>>
>> I have a question concerning the setup for a board with an onboard USB
>> hub. The SoC (i.MX6S) is expected to provide a 12 MHz clock on one of
>> the clock output pins as a reference for the USB hub.
>>
>> Now I was looking for a way to configure this in the DT, which works
>> fine up to the point, that there doesn't seem to be a way to set a
>> reference clock for a generic USB device.
>>
>> Would it make sense to implement the enabling/disabling of the clock in
>> the generic USB device driver?
>> It doesn't seem right to write a separate driver for the hub only to
>> turn the clock on and off.
>>
>> My intended DT setup would look something like this:
>>
>>  {
>>  vbus-supply = <_usb_h1_vbus>;
>>  pinctrl-names = "default";
>>  pinctrl-0 = <_usbh1>;
>>  dr_mode = "host";
>>  status = "okay";
>>  #address-cells = <1>;
>>  #size-cells = <0>;
>>
>>  hub@1 {
>>  compatible = "usb4b4,6570";
>>  reg = <1>;
>>  clocks = < IMX6QDL_CLK_CKO>;
>>  assigned-clocks = < IMX6QDL_CLK_CKO>,
>>< IMX6QDL_CLK_CKO2_SEL>,
>>< IMX6QDL_CLK_CKO2>;
>>  assigned-clock-parents = < IMX6QDL_CLK_CKO2>,
>>   < IMX6QDL_CLK_OSC>,
>>   < IMX6QDL_CLK_CKO2_PODF>;
>>  assigned-clock-rates = <0 0 1200>;
>>  }
>> };
> 
> Peter Chen has tried to implement such support:
> https://lkml.org/lkml/2017/6/21/88
> 
> However it still needs some work so that it can be accepted in mainline.

Thank you for pointing that out. This looks like a rather complex 
framework, trying to handle all kinds of generic clock and power setups.

For my use case it would be enough to add handling of a single reference 
clock to the USB device driver.

Thanks,
Frieder


Re: Set reference clock for onboard hub in DT

2018-10-25 Thread Fabio Estevam
Hi Frieder,

On Thu, Sep 20, 2018 at 10:52 AM Frieder Schrempf
 wrote:
>
> Hi,
>
> I have a question concerning the setup for a board with an onboard USB
> hub. The SoC (i.MX6S) is expected to provide a 12 MHz clock on one of
> the clock output pins as a reference for the USB hub.
>
> Now I was looking for a way to configure this in the DT, which works
> fine up to the point, that there doesn't seem to be a way to set a
> reference clock for a generic USB device.
>
> Would it make sense to implement the enabling/disabling of the clock in
> the generic USB device driver?
> It doesn't seem right to write a separate driver for the hub only to
> turn the clock on and off.
>
> My intended DT setup would look something like this:
>
>  {
> vbus-supply = <_usb_h1_vbus>;
> pinctrl-names = "default";
> pinctrl-0 = <_usbh1>;
> dr_mode = "host";
> status = "okay";
> #address-cells = <1>;
> #size-cells = <0>;
>
> hub@1 {
> compatible = "usb4b4,6570";
> reg = <1>;
> clocks = < IMX6QDL_CLK_CKO>;
> assigned-clocks = < IMX6QDL_CLK_CKO>,
>   < IMX6QDL_CLK_CKO2_SEL>,
>   < IMX6QDL_CLK_CKO2>;
> assigned-clock-parents = < IMX6QDL_CLK_CKO2>,
>  < IMX6QDL_CLK_OSC>,
>  < IMX6QDL_CLK_CKO2_PODF>;
> assigned-clock-rates = <0 0 1200>;
> }
> };

Peter Chen has tried to implement such support:
https://lkml.org/lkml/2017/6/21/88

However it still needs some work so that it can be accepted in mainline.


Set reference clock for onboard hub in DT

2018-09-20 Thread Frieder Schrempf

Hi,

I have a question concerning the setup for a board with an onboard USB 
hub. The SoC (i.MX6S) is expected to provide a 12 MHz clock on one of 
the clock output pins as a reference for the USB hub.


Now I was looking for a way to configure this in the DT, which works 
fine up to the point, that there doesn't seem to be a way to set a 
reference clock for a generic USB device.


Would it make sense to implement the enabling/disabling of the clock in 
the generic USB device driver?
It doesn't seem right to write a separate driver for the hub only to 
turn the clock on and off.


My intended DT setup would look something like this:

 {
vbus-supply = <_usb_h1_vbus>;
pinctrl-names = "default";
pinctrl-0 = <_usbh1>;
dr_mode = "host";
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

hub@1 {
compatible = "usb4b4,6570";
reg = <1>;
clocks = < IMX6QDL_CLK_CKO>;
assigned-clocks = < IMX6QDL_CLK_CKO>,
  < IMX6QDL_CLK_CKO2_SEL>,
  < IMX6QDL_CLK_CKO2>;
assigned-clock-parents = < IMX6QDL_CLK_CKO2>,
 < IMX6QDL_CLK_OSC>,
 < IMX6QDL_CLK_CKO2_PODF>;
assigned-clock-rates = <0 0 1200>;
}
};

Thanks,
Frieder