Merge branch 'master' of git://git.denx.de/u-boot-blackfin
[oweals/u-boot.git] / arch / arm / cpu / armv7 / at91 / sama5d4_devices.c
index 2708097300d30b27ee945f32e12c4a7f9908acca..7469825565892e1df715c87c320c0738e030cce1 100644 (file)
@@ -6,6 +6,10 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/clk.h>
 #include <asm/arch/sama5d4.h>
 
 char *get_cpu_name()
@@ -28,3 +32,15 @@ char *get_cpu_name()
        else
                return "Unknown CPU type";
 }
+
+#ifdef CONFIG_USB_GADGET_ATMEL_USBA
+void at91_udp_hw_init(void)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+       /* Enable UPLL clock */
+       writel(AT91_PMC_UPLLEN | AT91_PMC_BIASEN, &pmc->uckr);
+       /* Enable UDPHS clock */
+       at91_periph_clk_enable(ATMEL_ID_UDPHS);
+}
+#endif