]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
USB: ohci-at91: support sama5d3x devices
authorBo Shen <voice.shen@atmel.com>
Sun, 12 May 2013 22:40:53 +0000 (22:40 +0000)
committerAndreas Bießmann <andreas.devel@googlemail.com>
Tue, 21 May 2013 09:54:13 +0000 (11:54 +0200)
Add OHCI support for sama5d3x devices

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
drivers/usb/host/ohci-at91.c

index efd711d489f4b36aa1a89345774b9fc6771aa4ee..086cd0fe5dcd39fc817783094866b597d1488770 100644 (file)
@@ -42,7 +42,7 @@ int usb_cpu_init(void)
        while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
                ;
 #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
-       defined(CONFIG_AT91SAM9X5)
+       defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3)
        /* Enable UPLL */
        writel(readl(&pmc->uckr) | AT91_PMC_UPLLEN | AT91_PMC_BIASEN,
                &pmc->uckr);
@@ -54,7 +54,12 @@ int usb_cpu_init(void)
 #endif
 
        /* Enable USB host clock. */
+#ifdef CONFIG_SAMA5D3
+       writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcer1);
+#else
        writel(1 << ATMEL_ID_UHP, &pmc->pcer);
+#endif
+
 #ifdef CONFIG_AT91SAM9261
        writel(ATMEL_PMC_UHP | AT91_PMC_HCK0, &pmc->scer);
 #else
@@ -69,7 +74,12 @@ int usb_cpu_stop(void)
        at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
 
        /* Disable USB host clock. */
+#ifdef CONFIG_SAMA5D3
+       writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcdr1);
+#else
        writel(1 << ATMEL_ID_UHP, &pmc->pcdr);
+#endif
+
 #ifdef CONFIG_AT91SAM9261
        writel(ATMEL_PMC_UHP | AT91_PMC_HCK0, &pmc->scdr);
 #else
@@ -83,7 +93,7 @@ int usb_cpu_stop(void)
        while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != 0)
                ;
 #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
-       defined(CONFIG_AT91SAM9X5)
+       defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3)
        /* Disable UPLL */
        writel(readl(&pmc->uckr) & (~AT91_PMC_UPLLEN), &pmc->uckr);
        while ((readl(&pmc->sr) & AT91_PMC_LOCKU) == AT91_PMC_LOCKU)