diff options
author | Bo Shen <voice.shen@atmel.com> | 2013-04-15 11:17:53 +0800 |
---|---|---|
committer | Bo Shen <voice.shen@atmel.com> | 2013-04-18 11:07:44 +0800 |
commit | 712ec1d124960c4ea1f9a58e66f3a8ca3ee64079 (patch) | |
tree | a244c6a334d7ea234634e5855a158ab7d0d5b386 | |
parent | 3e44b9bf68147d2857a8c29ba16c51a909c443fa (diff) |
USB: ohci-at91: add clock select to avoid more #ifdeffery
Add following two configuration for USB clock selecting
- CONFIG_USB_ATMEL_CLK_SEL_PLLB
- using PLLB as usb ohci input clock
- CONFIG_USB_ATMEL_CLK_SEL_UPLL
- using UPLL as usb ohci input clock
Signed-off-by: Bo Shen <voice.shen@atmel.com>
-rw-r--r-- | drivers/usb/host/ohci-at91.c | 13 | ||||
-rw-r--r-- | include/configs/at91rm9200ek.h | 1 | ||||
-rw-r--r-- | include/configs/at91sam9260ek.h | 1 | ||||
-rw-r--r-- | include/configs/at91sam9261ek.h | 1 | ||||
-rw-r--r-- | include/configs/at91sam9263ek.h | 1 | ||||
-rw-r--r-- | include/configs/at91sam9m10g45ek.h | 1 | ||||
-rw-r--r-- | include/configs/at91sam9x5ek.h | 1 | ||||
-rw-r--r-- | include/configs/sama5d3xek.h | 1 |
8 files changed, 11 insertions, 9 deletions
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index aeb93e2112..f3fd0d9852 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -34,15 +34,12 @@ int usb_cpu_init(void) { at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC; -#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \ - defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \ - defined(CONFIG_AT91SAM9261) +#ifdef CONFIG_USB_ATMEL_CLK_SEL_PLLB /* Enable PLLB */ writel(get_pllb_init(), &pmc->pllbr); while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB) ; -#elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \ - defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3) +#elif defined(CONFIG_USB_ATMEL_CLK_SEL_UPLL) /* Enable UPLL */ writel(readl(&pmc->uckr) | AT91_PMC_UPLLEN | AT91_PMC_BIASEN, &pmc->uckr); @@ -85,14 +82,12 @@ int usb_cpu_stop(void) writel(ATMEL_PMC_UHP, &pmc->scdr); #endif -#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \ - defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) +#ifdef CONFIG_USB_ATMEL_CLK_SEL_PLLB /* Disable PLLB */ writel(0, &pmc->pllbr); while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != 0) ; -#elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \ - defined(CONFIG_AT91SAM9X5) +#elif defined(CONFIG_USB_ATMEL_CLK_SEL_UPLL) /* Disable UPLL */ writel(readl(&pmc->uckr) & (~AT91_PMC_UPLLEN), &pmc->uckr); while ((readl(&pmc->sr) & AT91_PMC_LOCKU) == AT91_PMC_LOCKU) diff --git a/include/configs/at91rm9200ek.h b/include/configs/at91rm9200ek.h index 7352113266..13ca09bd15 100644 --- a/include/configs/at91rm9200ek.h +++ b/include/configs/at91rm9200ek.h @@ -170,6 +170,7 @@ * USB Config */ #define CONFIG_USB_ATMEL 1 +#define CONFIG_USB_ATMEL_CLK_SEL_PLLB #define CONFIG_USB_OHCI_NEW 1 #define CONFIG_USB_KEYBOARD 1 #define CONFIG_USB_STORAGE 1 diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h index ebcc69afa3..bf159df4f3 100644 --- a/include/configs/at91sam9260ek.h +++ b/include/configs/at91sam9260ek.h @@ -169,6 +169,7 @@ /* USB */ #define CONFIG_USB_ATMEL +#define CONFIG_USB_ATMEL_CLK_SEL_PLLB #define CONFIG_USB_OHCI_NEW 1 #define CONFIG_DOS_PARTITION 1 #define CONFIG_SYS_USB_OHCI_CPU_INIT 1 diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h index cabff9a9fe..7deccae1a7 100644 --- a/include/configs/at91sam9261ek.h +++ b/include/configs/at91sam9261ek.h @@ -162,6 +162,7 @@ /* USB */ #define CONFIG_USB_ATMEL +#define CONFIG_USB_ATMEL_CLK_SEL_PLLB #define CONFIG_USB_OHCI_NEW #define CONFIG_DOS_PARTITION #define CONFIG_SYS_USB_OHCI_CPU_INIT diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h index 0fc001b787..c5175b981e 100644 --- a/include/configs/at91sam9263ek.h +++ b/include/configs/at91sam9263ek.h @@ -298,6 +298,7 @@ /* USB */ #define CONFIG_USB_ATMEL +#define CONFIG_USB_ATMEL_CLK_SEL_PLLB #define CONFIG_USB_OHCI_NEW 1 #define CONFIG_DOS_PARTITION 1 #define CONFIG_SYS_USB_OHCI_CPU_INIT 1 diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h index 07e1c9f890..469bf44503 100644 --- a/include/configs/at91sam9m10g45ek.h +++ b/include/configs/at91sam9m10g45ek.h @@ -139,6 +139,7 @@ /* USB */ #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_ATMEL +#define CONFIG_USB_ATMEL_CLK_SEL_UPLL #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 #define CONFIG_DOS_PARTITION #define CONFIG_USB_STORAGE diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h index 6057d460e4..c90805a71b 100644 --- a/include/configs/at91sam9x5ek.h +++ b/include/configs/at91sam9x5ek.h @@ -178,6 +178,7 @@ #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 3 #endif #define CONFIG_USB_ATMEL +#define CONFIG_USB_ATMEL_CLK_SEL_UPLL #define CONFIG_USB_STORAGE #endif diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h index 9377362838..78a967f884 100644 --- a/include/configs/sama5d3xek.h +++ b/include/configs/sama5d3xek.h @@ -187,6 +187,7 @@ #ifdef CONFIG_CMD_USB #define CONFIG_USB_ATMEL +#define CONFIG_USB_ATMEL_CLK_SEL_UPLL #define CONFIG_USB_OHCI_NEW #define CONFIG_DOS_PARTITION #define CONFIG_SYS_USB_OHCI_CPU_INIT |