[U-Boot] [PATCH] usb: r8a66597: Add support for RZ/A series

Chris Brandt Chris.Brandt at renesas.com
Mon Nov 27 17:27:50 UTC 2017


Hello Marek,

On Friday, November 17, 2017, Marek Vasut wrote:
> > +#ifdef RZA_USB
> > +	dcpctr = r8a66597_read(r8a66597, DCPCTR);
> 
> use wait_for_bit() .
> 
> > +	if ((dcpctr & PID) == PID_BUF) {
> > +		timeout2 = 10000;
> > +		while (!(dcpctr & BSTS)) {
> > +			dcpctr = r8a66597_read(r8a66597, DCPCTR);
> > +			if (timeout2-- < 0) {
> > +				printf("DCPCTR clear timeout!\n");
> > +				break;
> > +			}
> > +		}
> > +	}
> > +#endif


wait_for_bit() wants you to pass a direct address of a 32-bit register.
The register I am waiting for is a 16-bit register and the hardware 
manual doesn't say 32-bit is allowed.
When I do a 32-bit read on that address, I actually get a different 
value.

For example:

=> md.w E8010060 1
e8010060: 0040
=> md.l E8010060 1
e8010060: 00400000


So, I can't use wait_for_bit()

Chris



More information about the U-Boot mailing list