summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-10-14 12:46:41 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-14 12:46:41 +0200
commitd2bb6342d6a812f3ff0dcf17180c0b01b85cacfb (patch)
tree662664ac398af8749af7f3c69bb298394a0fc057 /arch/arm/mach-at91
parente9299c644a17b7ae6a91d3a4b6ccdd9acba443fe (diff)
parent8fc0a99f32ea083b2e0eee217c813cf36aa8c521 (diff)
downloadbarebox-d2bb6342d6a812f3ff0dcf17180c0b01b85cacfb.tar.gz
barebox-d2bb6342d6a812f3ff0dcf17180c0b01b85cacfb.tar.xz
Merge branch 'for-next/misc' into master
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/at91_pmc_ll.c2
-rw-r--r--arch/arm/mach-at91/include/mach/at91_pmc_ll.h5
-rw-r--r--arch/arm/mach-at91/include/mach/at91_wdt.h2
3 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/at91_pmc_ll.c b/arch/arm/mach-at91/at91_pmc_ll.c
index 9205322db9..e561f20755 100644
--- a/arch/arm/mach-at91/at91_pmc_ll.c
+++ b/arch/arm/mach-at91/at91_pmc_ll.c
@@ -88,6 +88,8 @@ void at91_pmc_init(void __iomem *pmc_base, unsigned int flags)
tmp &= ~AT91_PMC_OSCBYPASS;
tmp &= ~AT91_PMC_KEY_MASK;
tmp |= AT91_PMC_KEY;
+ if (flags & AT91_PMC_LL_FLAG_MCK_BYPASS)
+ tmp |= AT91_PMC_OSCBYPASS;
at91_pmc_write(AT91_CKGR_MOR, tmp);
tmp = at91_pmc_read(AT91_CKGR_MOR);
diff --git a/arch/arm/mach-at91/include/mach/at91_pmc_ll.h b/arch/arm/mach-at91/include/mach/at91_pmc_ll.h
index 6ec3ae0852..85896a01d5 100644
--- a/arch/arm/mach-at91/include/mach/at91_pmc_ll.h
+++ b/arch/arm/mach-at91/include/mach/at91_pmc_ll.h
@@ -16,6 +16,7 @@
#define AT91_PMC_LL_FLAG_H32MXDIV (1 << 3)
#define AT91_PMC_LL_FLAG_PMC_UTMI (1 << 4)
#define AT91_PMC_LL_FLAG_GCSR (1 << 5)
+#define AT91_PMC_LL_FLAG_MCK_BYPASS (1 << 6)
#define AT91_PMC_LL_AT91RM9200 (0)
#define AT91_PMC_LL_AT91SAM9260 (0)
@@ -30,6 +31,10 @@
#define AT91_PMC_LL_SAMA5D2 (AT91_PMC_LL_FLAG_SAM9X5_PMC | \
AT91_PMC_LL_FLAG_MEASURE_XTAL | \
AT91_PMC_LL_FLAG_PMC_UTMI)
+/* This assumes a crystal on both XIN and XOUT. If your board
+ * instead has an extenal oscillator on XIN only,
+ * AT91_PMC_LL_FLAG_MCK_BYPASS needs to be OR`ed in as well
+ */
#define AT91_PMC_LL_SAMA5D3 (AT91_PMC_LL_FLAG_SAM9X5_PMC | \
AT91_PMC_LL_FLAG_DISABLE_RC | \
AT91_PMC_LL_FLAG_PMC_UTMI)
diff --git a/arch/arm/mach-at91/include/mach/at91_wdt.h b/arch/arm/mach-at91/include/mach/at91_wdt.h
index d295d35d1b..04924742a5 100644
--- a/arch/arm/mach-at91/include/mach/at91_wdt.h
+++ b/arch/arm/mach-at91/include/mach/at91_wdt.h
@@ -41,7 +41,7 @@
* Copyright (c) 2006, Atmel Corporation
*/
-#include <asm-generic/io.h>
+#include <asm/io.h>
static inline void at91_wdt_disable(void __iomem *wdt_base)
{