[coreboot-gerrit] New patch to review for coreboot: 5f18153 exynos5250/snow: deprecate time.h

David Hendricks (dhendrix@chromium.org) gerrit at coreboot.org
Mon May 6 00:03:18 CEST 2013


David Hendricks (dhendrix at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3201

-gerrit

commit 5f1815349a3a4e867b6f97c95c8fa736fbc8ae5c
Author: David Hendricks <dhendrix at chromium.org>
Date:   Thu May 2 16:47:54 2013 -0700

    exynos5250/snow: deprecate time.h
    
    This re-introduces 2fde966 (http://review.coreboot.org/#/c/3177/)
    which was reverted due to unsatisfied dependencies.
    
    time.h We Hardly Knew Ye.
    
    This deprecates time.h which is currently only used by Exynos5250 and
    Snow. The original idea was to try and unify some of the various timer
    interfaces and has been supplanted by the monotonic timer API.
    
    timer_us() is now obsolete. timer_start() is now mct_start() and
    is exposed in exynos5250/clk.h.
    
    Change-Id: I8e60105629d9da68ed622e89209b3ef6c8e2445b
    Signed-off-by: David Hendricks <dhendrix at chromium.org>
---
 src/cpu/samsung/exynos5250/clk.h             |  1 +
 src/cpu/samsung/exynos5250/mct.c             | 12 ++----------
 src/cpu/samsung/exynos5250/monotonic_timer.c |  1 -
 src/include/time.h                           | 26 --------------------------
 src/mainboard/google/snow/bootblock.c        |  6 +++---
 src/mainboard/google/snow/romstage.c         |  1 -
 6 files changed, 6 insertions(+), 41 deletions(-)

diff --git a/src/cpu/samsung/exynos5250/clk.h b/src/cpu/samsung/exynos5250/clk.h
index 1894c00..828e7d8 100644
--- a/src/cpu/samsung/exynos5250/clk.h
+++ b/src/cpu/samsung/exynos5250/clk.h
@@ -585,6 +585,7 @@ int clock_get_mem_selection(enum ddr_mode *mem_type,
 		unsigned *frequency_mhz, unsigned *arm_freq,
 		enum mem_manuf *mem_manuf);
 
+void mct_start(void);
 uint64_t mct_raw_value(void);
 
 #endif
diff --git a/src/cpu/samsung/exynos5250/mct.c b/src/cpu/samsung/exynos5250/mct.c
index 4216643..db76e9d 100644
--- a/src/cpu/samsung/exynos5250/mct.c
+++ b/src/cpu/samsung/exynos5250/mct.c
@@ -22,7 +22,7 @@
 
 #include <arch/io.h>
 #include <stdint.h>
-#include <time.h>
+
 #include "clk.h"
 
 struct __attribute__((packed)) mct_regs
@@ -101,16 +101,8 @@ uint64_t mct_raw_value(void)
 	return (upper << 32) | lower;
 }
 
-void timer_start(void)
+void mct_start(void)
 {
 	writel(readl(&mct->g_tcon) | (0x1 << 8), &mct->g_tcon);
 	enabled = 1;
 }
-
-u32 timer_us(void)
-{
-	uint64_t raw = mct_raw_value();
-	static uint32_t ticks_per_microsecond = MCT_HZ/1000000;
-	uint32_t usec = raw / ticks_per_microsecond;
-	return usec;
-}
diff --git a/src/cpu/samsung/exynos5250/monotonic_timer.c b/src/cpu/samsung/exynos5250/monotonic_timer.c
index 85fb208..7c6229b 100644
--- a/src/cpu/samsung/exynos5250/monotonic_timer.c
+++ b/src/cpu/samsung/exynos5250/monotonic_timer.c
@@ -20,7 +20,6 @@
 #include <stdint.h>
 #include <delay.h>
 #include <timer.h>
-#include <time.h>	/* TODO: deprecate in favor of monotonic timer stuff */
 
 #include "clk.h"
 
diff --git a/src/include/time.h b/src/include/time.h
deleted file mode 100644
index 2cfcb35..0000000
--- a/src/include/time.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2013 Google, Inc.
- *
- * 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; version 2 of the License.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
- */
-
-#ifndef TIME_H
-#define TIME_H
-
-void timer_start(void);
-u32 timer_us(void);
-
-#endif /* TIME_H */
diff --git a/src/mainboard/google/snow/bootblock.c b/src/mainboard/google/snow/bootblock.c
index 4464042..56c2650 100644
--- a/src/mainboard/google/snow/bootblock.c
+++ b/src/mainboard/google/snow/bootblock.c
@@ -21,8 +21,8 @@
 #include <arch/io.h>
 #include <cbfs.h>
 #include <uart.h>
-#include <time.h>
 #include <console/console.h>
+#include <cpu/samsung/exynos5250/clk.h>
 #include <cpu/samsung/exynos5250/periph.h>
 #include <cpu/samsung/exynos5250/pinmux.h>
 #include "mainboard.h"
@@ -30,10 +30,10 @@
 void bootblock_mainboard_init(void);
 void bootblock_mainboard_init(void)
 {
-	/* kick off the microsecond timer.
+	/* kick off the multi-core timer.
 	 * We want to do this as early as we can.
 	 */
-	timer_start();
+	mct_start();
 
 	if (snow_get_wakeup_state() == SNOW_WAKEUP_DIRECT) {
 		snow_wakeup();
diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c
index aa3a340..508dac6 100644
--- a/src/mainboard/google/snow/romstage.c
+++ b/src/mainboard/google/snow/romstage.c
@@ -36,7 +36,6 @@
 #include <cpu/samsung/exynos5250/clock_init.h>
 #include <console/console.h>
 #include <arch/stages.h>
-#include <time.h>
 
 #include <drivers/maxim/max77686/max77686.h>
 #include <device/i2c.h>



More information about the coreboot-gerrit mailing list