[coreboot] Patch set updated for coreboot: 9a1451c omit code that touches PWM to save some space
David Hendricks (dhendrix@chromium.org)
gerrit at coreboot.org
Fri Jan 11 02:39:26 CET 2013
David Hendricks (dhendrix at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2087
-gerrit
commit 9a1451c8e25f26c547c56b3a5ebf276cbd31b3db
Author: David Hendricks <dhendrix at chromium.org>
Date: Mon Dec 31 16:30:46 2012 -0800
omit code that touches PWM to save some space
This is just a temporary hack to give us some more space while
developing proper bootblock and romstage code...
Change-Id: I50b92e89b920cbc455d1da5be9afcffbf49f5000
Signed-off-by: David Hendricks <dhendrix at chromium.org>
---
src/cpu/samsung/exynos5250/lowlevel_init_c.c | 2 +-
src/cpu/samsung/s5p-common/Makefile.inc | 2 +-
src/cpu/samsung/s5p-common/timer.c | 54 ++++++++++++++--------------
3 files changed, 30 insertions(+), 28 deletions(-)
diff --git a/src/cpu/samsung/exynos5250/lowlevel_init_c.c b/src/cpu/samsung/exynos5250/lowlevel_init_c.c
index 848ebee..6c1940f 100644
--- a/src/cpu/samsung/exynos5250/lowlevel_init_c.c
+++ b/src/cpu/samsung/exynos5250/lowlevel_init_c.c
@@ -113,7 +113,7 @@ int lowlevel_init_subsystems(void)
console_tx_byte('C');
}
}
- init_timer(); /* FIXME(dhendrix): was timer_init() */
+// init_timer(); /* FIXME(dhendrix): was timer_init() */
#if 0
if (actions & DO_CLOCKS) {
diff --git a/src/cpu/samsung/s5p-common/Makefile.inc b/src/cpu/samsung/s5p-common/Makefile.inc
index 7de3c28..9557b85 100644
--- a/src/cpu/samsung/s5p-common/Makefile.inc
+++ b/src/cpu/samsung/s5p-common/Makefile.inc
@@ -1,5 +1,5 @@
romstage-y += cpu_info.c
-romstage-y += pwm.c # needed by timer.c
+#romstage-y += pwm.c # needed by timer.c
romstage-y += s5p_gpio.c
romstage-y += timer.c
romstage-y += s3c24x0_i2c.c
diff --git a/src/cpu/samsung/s5p-common/timer.c b/src/cpu/samsung/s5p-common/timer.c
index 373c374..c10ce87 100644
--- a/src/cpu/samsung/s5p-common/timer.c
+++ b/src/cpu/samsung/s5p-common/timer.c
@@ -25,16 +25,13 @@
#include <common.h>
#include <arch/io.h>
-//#include <cpu/samsung/exynos5250/pwm.h>
-//#include <cpu/samsung/exynos5250/clk.h>
+
#include <cpu/samsung/s5p-common/pwm.h>
#include <cpu/samsung/s5p-common/clk.h>
#include <cpu/samsung/exynos5250/cpu.h>
#include <cpu/samsung/exynos5-common/exynos5-common.h>
-//#include <pwm.h>
-//DECLARE_GLOBAL_DATA_PTR;
static unsigned long long timer_reset_value;
static unsigned long lastinc;
@@ -59,28 +56,6 @@ static unsigned long timer_get_us_down(void)
return readl(&timer->tcnto4);
}
-int init_timer(void)
-{
- /* Timer may have been enabled in SPL */
- if (!pwm_check_enabled(4)) {
- /* PWM Timer 4 */
- pwm_init(4, MUX_DIV_4, 0);
- pwm_config(4, 100000, 100000);
- pwm_enable(4);
-#ifndef CONFIG_SPL_BUILD
- /* Use this as the current monotonic time in us */
- //gd->timer_reset_value = 0;
- timer_reset_value = 0;
-
- /* Use this as the last timer value we saw */
- //gd->lastinc = timer_get_us_down();
- lastinc = timer_get_us_down();
-#endif
- }
-
- return 0;
-}
-
/*
* timer without interrupts
*/
@@ -107,6 +82,32 @@ unsigned long get_timer(unsigned long base)
return timer_reset_value / 1000 - base;
}
+/* FIXME(dhendrix): We should probably do init_timer() in romstage. This
+ * is just a stop-gap to reduce image size until we have the proper
+ * bootblock code implemented. */
+#ifndef __PRE_RAM__
+int init_timer(void)
+{
+ /* Timer may have been enabled in SPL */
+ if (!pwm_check_enabled(4)) {
+ /* PWM Timer 4 */
+ pwm_init(4, MUX_DIV_4, 0);
+ pwm_config(4, 100000, 100000);
+ pwm_enable(4);
+#ifndef CONFIG_SPL_BUILD
+ /* Use this as the current monotonic time in us */
+ //gd->timer_reset_value = 0;
+ timer_reset_value = 0;
+
+ /* Use this as the last timer value we saw */
+ //gd->lastinc = timer_get_us_down();
+ lastinc = timer_get_us_down();
+#endif
+ }
+
+ return 0;
+}
+
unsigned long timer_get_us(void)
{
struct s5p_timer *const timer = s5p_get_base_timer();
@@ -151,3 +152,4 @@ unsigned long timer_get_boot_us(void)
{
return timer_get_us();
}
+#endif /* __PRE_RAM__ */
More information about the coreboot
mailing list