[U-Boot] [PATCH v7] Add generic ULPI layer

Igor Grinberg grinberg at compulab.co.il
Wed Dec 7 13:59:52 CET 2011


Hi Marek,

On 12/07/11 01:49, Marek Vasut wrote:
>> Although it is a single patch, I felt that a cover letter will
>> definetly not hurt here, also the patch version history is so big, so
>> I decided to move it here.
>>
>> The ULPI (UTMI Low Pin (count) Interface) PHYs are widely used on
>> variety of boards. This requires a generic architecture independant
>> implementation which can be reused and will eliminate the need for
>> direct write of arbitrary values to the ULPI transciever.
>> Although, the generic implementation can be reused on any architecture,
>> the access to ULPI PHY must be done in a platform specific way.
>> The platform specific way is in majority of case called a viewport.
>> Also, the ULPI specification defines a hybrid aproach for managing the
>> ULPI PHY. That is, the PHY must be managed through both the PHY registers
>> and control lines.
>>
>> The proposed patch provides a partial implementation of the ULPI
>> specification, which should be enough for boot loader use cases,
>> and a viewport implementation for Chipidea/ARC based controllers,
>> which, AFAIK, are used on imx and tegra SoCs.
>>
>> It is based on the Wolfgang's master branch (4 Dec 2012),
>> compile tested and checkpatch clean.
>>
>> What is still missing, IMO:
>> 	- documentation for the CONFIG_* macros (I can add it in a separate 
> patch)
>> 	- a way to make most of the initialization in one ulpi_init() call
>> 	- viewport extension to be able to implement resume,
>> 	  reset and disabling the serial mode
>>
>> The change log:
>> Changes for v2:
>> 	- make code EHCI-independent
>> 	- use udelay() in waiting loop
>> 	- mark static functions as static
>> 	- naming changes
>> Changes for v3:
>> 	- merge with patch ulpi: add generic ULPI support header file
>> 	- rewrite ULPI interface in more functionality-oriented way
>> Changes for v4:
>> 	- add error-checking
>> 	- add waiting for completion into ulpi_reset() function
>> Changes for v5:
>> 	- CodingStyle changes
>> 	- add comments
>> 	- simplify implemenation of the ULPI interface functions
>> Changes for v6:
>> 	- cleanup function ulpi_drive_vbus()
>> Changes for v7:
>> 	- ulpi-viewport.c:
>> 		- reorder bit definitions
>> 		- split ulpi_request() to two functions
>> 		- reuse ulpi_wakeup() from ulpi_request()
>> 		  to remove duplicated calls from ulpi_{read|write}()
>> 		- inline ulpi_*_mask as it is simple and used only once
>> 	- ulpi.c:
>> 		- move several defines into c file
>> 		- rework all the functions to propagate error values
>> 		- move function description comments into ulpi.h
>> 		  along with declarations
>> 		- check arguments validity (as suggested by Simon)
>> 		- fix cases when using the *_set register,
>> 		  bits cannot be cleared
>> 		- shorten several arguments names (e.g. ulpi_set_vbus())
>> 		- add ability to disable VBUS
>> 		- clean up ulpi_set_pd()
>> 		- add ability to enter the serial mode
>> 		- add verbosity in error cases
>> 		- remove ulpi_resume() as it were wrong and
>> 		  must be implemented in a viewport specific way
>> 		- rework ulpi_reset() as it must be implemented in a
>> 		  viewport specific way, but provide kind of generic
>> 		  implementation which should work in most of the cases
>> 	- ulpi.h:
>> 		- add default timeout value
>> 		- remove unused defines
>> 		- move several defines inside c files
>> 		- add description for each function
>> 		- move the API declaration to the top of the header file
>>
>> Jana Rapava (1):
>>   USB: Add generic ULPI layer and a viewport
>>
>>  Makefile                         |    1 +
>>  drivers/usb/ulpi/Makefile        |   44 ++++++
>>  drivers/usb/ulpi/ulpi-viewport.c |  118 +++++++++++++++
>>  drivers/usb/ulpi/ulpi.c          |  227 +++++++++++++++++++++++++++++
>>  include/usb/ulpi.h               |  298
>> ++++++++++++++++++++++++++++++++++++++ 5 files changed, 688 insertions(+),
>> 0 deletions(-)
>>  create mode 100644 drivers/usb/ulpi/Makefile
>>  create mode 100644 drivers/usb/ulpi/ulpi-viewport.c
>>  create mode 100644 drivers/usb/ulpi/ulpi.c
>>  create mode 100644 include/usb/ulpi.h
> 
> Igor, please add Cc annotations to this patch too.

Well, I indeed forgot this, but I've send a forward of this email
to everybody supposed to be in Cc. Adding Cc once again...


-- 
Regards,
Igor.


More information about the U-Boot mailing list