summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/arm920t
diff options
context:
space:
mode:
authorWenyou Yang <wenyou.yang@atmel.com>2016-02-03 10:16:49 +0800
committerAndreas Bießmann <andreas.devel@googlemail.com>2016-02-18 21:34:40 +0100
commiteced5a7eb4750e16dd571a9bd4980c68d2276f11 (patch)
treefd1a74475bf9f233a8e28d46910d9019df53241a /arch/arm/mach-at91/arm920t
parent41bf25c2e1c134455257f91bbfa9dc582b687bc4 (diff)
downloadblackbird-obmc-uboot-eced5a7eb4750e16dd571a9bd4980c68d2276f11.tar.gz
blackbird-obmc-uboot-eced5a7eb4750e16dd571a9bd4980c68d2276f11.zip
ARM: cpu: at91: clean up peripheral clock code
Due to introducing the new peripheral clock handle functions, use these functions to clean up the duplicated code. Meanwhile, remove unneeded header file include, at91_pmc.h. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Tested-by: Heiko Schocher <hs@denx.de> Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com> [fixup for arm920t code] Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Diffstat (limited to 'arch/arm/mach-at91/arm920t')
-rw-r--r--arch/arm/mach-at91/arm920t/at91rm9200_devices.c14
-rw-r--r--arch/arm/mach-at91/arm920t/timer.c6
2 files changed, 6 insertions, 14 deletions
diff --git a/arch/arm/mach-at91/arm920t/at91rm9200_devices.c b/arch/arm/mach-at91/arm920t/at91rm9200_devices.c
index fc54327c0d..9b9800ad9a 100644
--- a/arch/arm/mach-at91/arm920t/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/arm920t/at91rm9200_devices.c
@@ -14,7 +14,7 @@
#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/gpio.h>
/*
@@ -34,29 +34,23 @@
void at91_serial0_hw_init(void)
{
- at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
-
at91_set_a_periph(AT91_PIO_PORTA, 17, 1); /* TXD0 */
at91_set_a_periph(AT91_PIO_PORTA, 18, PUP); /* RXD0 */
- writel(1 << ATMEL_ID_USART0, &pmc->pcer);
+ at91_periph_clk_enable(ATMEL_ID_USART0);
}
void at91_serial1_hw_init(void)
{
- at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
-
at91_set_a_periph(AT91_PIO_PORTB, 20, PUP); /* RXD1 */
at91_set_a_periph(AT91_PIO_PORTB, 21, 1); /* TXD1 */
- writel(1 << ATMEL_ID_USART1, &pmc->pcer);
+ at91_periph_clk_enable(ATMEL_ID_USART1);
}
void at91_serial2_hw_init(void)
{
- at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
-
at91_set_a_periph(AT91_PIO_PORTA, 22, PUP); /* RXD2 */
at91_set_a_periph(AT91_PIO_PORTA, 23, 1); /* TXD2 */
- writel(1 << ATMEL_ID_USART2, &pmc->pcer);
+ at91_periph_clk_enable(ATMEL_ID_USART2);
}
void at91_seriald_hw_init(void)
diff --git a/arch/arm/mach-at91/arm920t/timer.c b/arch/arm/mach-at91/arm920t/timer.c
index 6aa2994723..69ce6f9573 100644
--- a/arch/arm/mach-at91/arm920t/timer.c
+++ b/arch/arm/mach-at91/arm920t/timer.c
@@ -19,7 +19,7 @@
#include <asm/io.h>
#include <asm/arch/hardware.h>
#include <asm/arch/at91_tc.h>
-#include <asm/arch/at91_pmc.h>
+#include <asm/arch/clk.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -29,10 +29,8 @@ DECLARE_GLOBAL_DATA_PTR;
int timer_init(void)
{
at91_tc_t *tc = (at91_tc_t *) ATMEL_BASE_TC;
- at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
- /* enables TC1.0 clock */
- writel(1 << ATMEL_ID_TC0, &pmc->pcer); /* enable clock */
+ at91_periph_clk_enable(ATMEL_ID_TC0);
writel(0, &tc->bcr);
writel(AT91_TC_BMR_TC0XC0S_NONE | AT91_TC_BMR_TC1XC1S_NONE |
OpenPOWER on IntegriCloud