Patchwork [U-Boot,1/2] usb: musb: blackfin: make clkin configurable

login
register
mail settings
Submitter Mike Frysinger
Date March 17, 2011, 9:35 p.m.
Message ID <1300397701-7162-1-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/87434/
State Accepted
Commit 38e0745e4ddcf0b26fdc609ced835e67bf343689
Delegated to: Remy Bohmer
Headers show

Comments

Mike Frysinger - March 17, 2011, 9:35 p.m.
Not everyone has a 24MHz clkin to the USB, so let board porters override.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/blackfin_usb.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Remy Bohmer - March 25, 2011, 7:15 p.m.
Hi,

2011/3/17 Mike Frysinger <vapier@gentoo.org>:
> Not everyone has a 24MHz clkin to the USB, so let board porters override.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  drivers/usb/musb/blackfin_usb.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
>

Applied to u-boot-usb

Thanks.

Remy

Patch

diff --git a/drivers/usb/musb/blackfin_usb.c b/drivers/usb/musb/blackfin_usb.c
index 38aceb2..0eb19a0 100644
--- a/drivers/usb/musb/blackfin_usb.c
+++ b/drivers/usb/musb/blackfin_usb.c
@@ -15,6 +15,10 @@ 
 
 #include "musb_core.h"
 
+#ifndef CONFIG_USB_BLACKFIN_CLKIN
+#define CONFIG_USB_BLACKFIN_CLKIN 24
+#endif
+
 /* MUSB platform configuration */
 struct musb_config musb_cfg = {
 	.regs       = (struct musb_regs *)USB_FADDR,
@@ -109,7 +113,8 @@  int musb_platform_init(void)
 	}
 
 	/* Configure PLL oscillator register */
-	bfin_write_USB_PLLOSC_CTRL(0x30a8);
+	bfin_write_USB_PLLOSC_CTRL(0x3080 |
+		((480 / CONFIG_USB_BLACKFIN_CLKIN) << 1));
 	SSYNC();
 
 	bfin_write_USB_SRP_CLKDIV((get_sclk()/1000) / 32 - 1);