[U-Boot] [PATCH 3/3] imx: mx6sllevk: add usb support

Marek Vasut marex at denx.de
Thu Dec 22 07:11:48 CET 2016


On 12/22/2016 07:03 AM, Peng Fan wrote:
> 
> Hi Marek,
> 
>> -----Original Message-----
>> From: Marek Vasut [mailto:marex at denx.de]
>> Sent: Thursday, December 22, 2016 12:40 PM
>> To: Peng Fan <peng.fan at nxp.com>; sbabic at denx.de
>> Cc: u-boot at lists.denx.de; van.freenix at gmail.com
>> Subject: Re: [PATCH 3/3] imx: mx6sllevk: add usb support
>>
>> On 12/22/2016 02:13 AM, Peng Fan wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Marek Vasut [mailto:marex at denx.de]
>>>> Sent: Wednesday, December 21, 2016 10:10 PM
>>>> To: Peng Fan <peng.fan at nxp.com>; sbabic at denx.de
>>>> Cc: u-boot at lists.denx.de; van.freenix at gmail.com
>>>> Subject: Re: [PATCH 3/3] imx: mx6sllevk: add usb support
>>>>
>>>> On 12/21/2016 09:14 AM, Peng Fan wrote:
>>>>> Add usb support for mx6sllevk board.
>>>>>
>>>>> Signed-off-by: Peng Fan <peng.fan at nxp.com>
>>>>> Cc: Stefano Babic <sbabic at denx.de>
>>>>> ---
>>> [......]
>>>
>>>>> +
>>>>> +#define USB_OTHERREGS_OFFSET   0x800
>>>>> +#define UCTRL_PWR_POL          (1 << 9)
>>>>> +
>>>>> +int board_ehci_hcd_init(int port)
>>>>> +{
>>>>> +	u32 *usbnc_usb_ctrl;
>>>>> +
>>>>> +	if (port > 1)
>>>>> +		return -EINVAL;
>>>>> +
>>>>> +	usbnc_usb_ctrl = (u32 *)(USB_BASE_ADDR + USB_OTHERREGS_OFFSET
>>>> +
>>>>> +				 port * 4);
>>>>> +
>>>>> +	/* Set Power polarity */
>>>>> +	setbits_le32(usbnc_usb_ctrl, UCTRL_PWR_POL);
>>>>> +	return 0;
>>>>> +}
>>>>
>>>> Is this function similar to what usb_oc_config() does ?
>>>
>>> No, this bit is not for overcurrent. According to RM, this is OTG
>>> Power Polarity This bit should be set according to power switch's enable
>> polarity.
>>> 1 Power switch has an active-high enable input
>>> 0 Power switch has an active-low enable input
>>>
>>> This is board specific.
>>
>> Great, except it should also be part of the driver , the same way as polarity is
>> configured, yes ?
> 
> I just found that there is code for mx7, http://lists.denx.de/pipermail/u-boot/2016-July/260321.html
> 
> Then do you agree I add such piece code in usb_power_config for mx6?
> "
> #ifdef CONFIG_MXC_USB_OTG_HACTIVE
>         setbits_le32(ctrl, UCTRL_PWR_POL); 
> #else 
>         clrbits_le32(ctrl, UCTRL_PWR_POL);        
> #endif
> "

Didn't you add DT support in a patch sent like ... yesterday ? :) Just
use DT property instead of ifdef.

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list