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

Marek Vasut marex at denx.de
Tue Nov 28 03:06:21 UTC 2017


On 11/27/2017 06:27 PM, Chris Brandt wrote:
> 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()

Can we somehow extend wait_for_bit() ?

> Chris
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list