diff options
author | Bo Shen <voice.shen@atmel.com> | 2013-04-15 11:24:35 +0800 |
---|---|---|
committer | Bo Shen <voice.shen@atmel.com> | 2013-04-18 11:07:44 +0800 |
commit | 28d7a5783674c638ba7b4494c848fab34883c215 (patch) | |
tree | 786e6160db858dbce65b640d11d1005703bdc9a7 | |
parent | 712ec1d124960c4ea1f9a58e66f3a8ca3ee64079 (diff) |
ARM: at91: using micro to calculate divisor
Using micro to calculate divisor
Add AT91_PMC_USBS_USB_PLLB definition
Signed-off-by: Bo Shen <voice.shen@atmel.com>
-rw-r--r-- | arch/arm/include/asm/arch-at91/at91_pmc.h | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-at91.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/include/asm/arch-at91/at91_pmc.h b/arch/arm/include/asm/arch-at91/at91_pmc.h index ca529778b7..1bc022529b 100644 --- a/arch/arm/include/asm/arch-at91/at91_pmc.h +++ b/arch/arm/include/asm/arch-at91/at91_pmc.h @@ -223,8 +223,8 @@ typedef struct at91_pmc { #endif #define AT91_PMC_USBS_USB_PLLA (0x0) /* USB Clock Input is PLLA */ #define AT91_PMC_USBS_USB_UPLL (0x1) /* USB Clock Input is UPLL */ -#define AT91_PMC_USBDIV_8 (0x7 << 8) /* USB Clock divided by 8 */ -#define AT91_PMC_USBDIV_10 (0x9 << 8) /* USB Clock divided by 10 */ +#define AT91_PMC_USBS_USB_PLLB (0x1) /* USB Clock Input is PLLB [AT91SAM9N12 only] */ +#define AT91_PMC_USBDIV_(x) (((x - 1) & 0xf) << 8) #ifdef CONFIG_AT91_LEGACY #define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-3 Registers */ diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index f3fd0d9852..076af18a5c 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -47,7 +47,7 @@ int usb_cpu_init(void) ; /* Select PLLA as input clock of OHCI */ - writel(AT91_PMC_USBS_USB_UPLL | AT91_PMC_USBDIV_10, &pmc->usb); + writel(AT91_PMC_USBS_USB_UPLL | AT91_PMC_USBDIV_(10), &pmc->usb); #endif #if defined(CONFIG_SAMA5D3) |