]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/armv7/omap-common/abb.c
arm: mx6: use fuse_read() for OCOTP fuse access
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / omap-common / abb.c
index 87d1fb82eba64689c57e11150479df08b7319d38..a0add6643e1715a65a3e05a9b38cc7d08b809b41 100644 (file)
@@ -1,5 +1,4 @@
 /*
- *
  * Adaptive Body Bias programming sequence for OMAP family
  *
  * (C) Copyright 2013
@@ -7,27 +6,12 @@
  *
  * Andrii Tseglytskyi <andrii.tseglytskyi@ti.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>
 #include <asm/omap_common.h>
+#include <asm/arch/clock.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
 
@@ -64,9 +48,9 @@ static void abb_setup_timings(u32 setup)
         */
 
        /* calculate SR2_WTCNT_VALUE */
-       sys_rate = DIV_ROUND(V_OSCK, 1000000);
-       clk_cycles = DIV_ROUND(OMAP_ABB_CLOCK_CYCLES * 10, sys_rate);
-       sr2_cnt = DIV_ROUND(OMAP_ABB_SETTLING_TIME * 10, clk_cycles);
+       sys_rate = DIV_ROUND_CLOSEST(V_OSCK, 1000000);
+       clk_cycles = DIV_ROUND_CLOSEST(OMAP_ABB_CLOCK_CYCLES * 10, sys_rate);
+       sr2_cnt = DIV_ROUND_CLOSEST(OMAP_ABB_SETTLING_TIME * 10, clk_cycles);
 
        setbits_le32(setup,
                     sr2_cnt << (ffs(OMAP_ABB_SETUP_SR2_WTCNT_VALUE_MASK) - 1));