]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/armv7/at91/timer.c
ARM: atmel: add sama5d4ek board support
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / at91 / timer.c
index b3a450fb310864fe8d8ee3c033b449453d0f2dd4..19bf80ba7eb6195a57b8d91bde9e793567da7fd6 100644 (file)
@@ -6,23 +6,7 @@
  * (C) Copyright 2013
  * Bo Shen <voice.shen@atmel.com>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -76,12 +60,13 @@ int timer_init(void)
        at91_pit_t *pit = (at91_pit_t *)ATMEL_BASE_PIT;
 
        /* Enable PITC Clock */
-       at91_periph_clk_enable(ATMEL_ID_SYS);
+       at91_periph_clk_enable(ATMEL_ID_PIT);
 
        /* Enable PITC */
        writel(TIMER_LOAD_VAL | AT91_PIT_MR_EN , &pit->mr);
 
-       gd->arch.timer_rate_hz = gd->arch.mck_rate_hz / 16;
+       gd->arch.timer_rate_hz = get_pit_clk_rate() / 16;
+
        gd->arch.tbu = 0;
        gd->arch.tbl = 0;