Hello. On 21-07-2011 14:19, Nori, Sekhar wrote:
Apart from what Sergei said, please take care of the following:
I've alresdy reviewed the first posting in detail, and we've exchanged some porivate emails with Constantin too...
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c index 23d2b6d..daf5398 100644 --- a/arch/arm/mach-davinci/usb.c +++ b/arch/arm/mach-davinci/usb.c
[...]
@@ -178,3 +179,23 @@ int __init da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata) return platform_device_register(&da8xx_usb11_device); } #endif /* CONFIG_DAVINCI_DA8XX */ + +#ifdef ARCH_DAVINCI_DM365 +int __init dm365_usb_configure(void) +{ + /* GPIO33 is multiplexed with USB DRVVBUS */ + davinci_cfg_reg(DM365_GPIO33); + gpio_request(33, "usb");
This can fail. Also use gpio_request_one().
The main question as it turned out is why GPIO API was used at all. DM365 has real VBUS signal and it is *multiplexed* to that GPIO. I keep wondering why VBUS signal was not directly controlled...
+ gpio_direction_output(33, 1); + return davinci_setup_usb(500, 8); +} +subsys_initcall(dm365_usb_configure); + +static void __exit dm365evm_usb_exit(void) +{ + platform_device_unregister(&usb_dev); +} +module_exit(dm365evm_usb_exit);
This is board code which should go into board-dm365-evm.c
That I've noted when reviewing the first posting of this patch.
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 2a2adf6..e6721e1 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -72,6 +72,15 @@ static inline void phy_on(void) /* power everything up; start the on-chip PHY and its PLL */ phy_ctrl&= ~(USBPHY_OSCPDWN | USBPHY_OTGPDWN | USBPHY_PHYPDWN); phy_ctrl |= USBPHY_SESNDEN | USBPHY_VBDTCTEN | USBPHY_PHYPLLON; + + if (cpu_is_davinci_dm365()) { + /* + * DM365 PHYCLKFREQ field [15:12] is set to 2 + * to get clock from 24MHz crystal + */ + phy_ctrl |= USBPHY_CLKFREQ_24MHZ; + }
Please separate out the DM365 SoC specific changes into a separate patch and CC the USB maintainers Felipe/Greg K-H on it. Also, CC the linux-usb list. scripts/get_maintainer.pl is there to help you find the right maintainers for the code your are submitting.
I think this code is actually board specific, and should be in board-dm365-evm.c instead...
+ __raw_writel(phy_ctrl, USB_PHY_CTRL); /* wait for PLL to lock before proceeding */ @@ -193,6 +202,9 @@ static void davinci_musb_source_power(struct musb *musb, int is_on, int immediat else schedule_work(&evm_vbus_work); } + + if (cpu_is_davinci_dm365()) + gpio_set_value(33, is_on);
This again looks like an EVM specific change so should be confined to board-dm365-evm.c.
This time it's DM365 specific as that GPIO is *multiplexed* to VBUS. WBR, Sergei _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
