[U-Boot] [PATCH v3]ulpi: add generic ULPI functionality
Igor Grinberg
grinberg at compulab.co.il
Sun Nov 27 08:50:24 CET 2011
On 11/25/11 20:39, Jana Rapava wrote:
>
>
> 2011/11/24 Igor Grinberg <grinberg at compulab.co.il <mailto:grinberg at compulab.co.il>>
>
> > +/*
> > + * If enable is 0, pull-down resistor not connected to D+, else pull-down
> > + * resistor connected to D+.
> > + * Default behaviour is as for enable equal to 1.
> > + */
> > +void ulpi_dp_pulldown(u32 ulpi_viewport, int enable)
> > +{
> > + if (enable)
> > + ulpi_write(ulpi_viewport,
> > + (u32)&ulpi->otg_ctrl_set, ULPI_OTG_DP_PULLDOWN);
> > + else
> > + ulpi_write(ulpi_viewport,
> > + (u32)&ulpi->otg_ctrl_clear, ULPI_OTG_DP_PULLDOWN);
> > +}
> > +
> > +/*
> > + * If enable is 0, pull-down resistor not connected to D- else pull-down
> > + * resistor connected to D-.
> > + * Default behaviour is as for enable equal to 1.
> > + */
> > +void ulpi_dm_pulldown(u32 ulpi_viewport, int enable)
> > +{
> > + if (enable)
> > + ulpi_write(ulpi_viewport,
> > + (u32)&ulpi->otg_ctrl_set, ULPI_OTG_DM_PULLDOWN);
> > + else
> > + ulpi_write(ulpi_viewport,
> > + (u32)&ulpi->otg_ctrl_clear, ULPI_OTG_DM_PULLDOWN);
> > +}
>
>
> Correct me if I'm wrong, but I don't think there is a use for
> the above functions in separate and the user will have to
> call them both.
> So, can these two functions be united in one,
> say ulpi_pulldown(u32 ..., int enable)?
>
>
> If I understand ULPI specification well, the overall effect is the same
> when both bits are set to 1 as when they are set to 0.
> And default setting is for both bits to be 1, so I don't think that have
> one function for both bits make sense.
It has nothing to do with the ULPI spec, but with the USB (or USB2.0) spec.
This technique is used for speed identification, so for both, Low and Full
speed devices to function properly, both resistors must be enabled.
So for sake of correctness, please, provide one unite function.
--
Regards,
Igor.
More information about the U-Boot
mailing list