]> git.sur5r.net Git - u-boot/commitdiff
usb: musb: blackfin: make clkin configurable
authorMike Frysinger <vapier@gentoo.org>
Thu, 17 Mar 2011 21:35:00 +0000 (17:35 -0400)
committerRemy Bohmer <linux@bohmer.net>
Sat, 2 Apr 2011 07:38:24 +0000 (09:38 +0200)
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

index 38aceb2e93d32a2a0d49dee2076d0eb55fae2b1f..0eb19a0924cb79a4e0334b575b4f8fcb310f2cff 100644 (file)
 
 #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);