diff options
author | Ronald G. Minnich <rminnich@gmail.com> | 2013-04-11 15:03:28 -0700 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2013-04-13 00:47:27 +0200 |
commit | c0b972f60dbd1a3dadfc568b5245c6b0ee6df559 (patch) | |
tree | b46cccbe95f4c95a1319596434b437e357b9c5c8 /src/mainboard/google | |
parent | 2c8f81b57b20c14edf4b77d3f5dcd2bcce717180 (diff) |
Exynos5250: add a microsecond timer
Add a microsecond timer, its declaration, the function to start it,
and its usage. To start it, one calls timer_start(). From that point
on, one can call timer_us() to find microseconds since the timer was
started.
We show its use in the bootblock. You want it started very early.
Finally, the delay.h change having been (ironically) delayed, we
create time.h and have it hold one declaration, for the timer_us() and
timer_start() prototype.
We feel that these two functions should become the hardware specific
functions, allowing us to finally move udelay() into src/lib where it
belongs.
Change-Id: I19cbc2bb0089a3de88cfb94276266af38b9363c5
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: http://review.coreboot.org/3073
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/mainboard/google')
-rw-r--r-- | src/mainboard/google/snow/bootblock.c | 6 | ||||
-rw-r--r-- | src/mainboard/google/snow/romstage.c | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/mainboard/google/snow/bootblock.c b/src/mainboard/google/snow/bootblock.c index 2df0e4ef61..d2e0b50b54 100644 --- a/src/mainboard/google/snow/bootblock.c +++ b/src/mainboard/google/snow/bootblock.c @@ -21,6 +21,7 @@ #include <arch/io.h> #include <cbfs.h> #include <uart.h> +#include <time.h> #include <console/console.h> #include <cpu/samsung/exynos5250/periph.h> #include <cpu/samsung/exynos5250/pinmux.h> @@ -28,6 +29,11 @@ void bootblock_mainboard_init(void); void bootblock_mainboard_init(void) { + /* kick off the microsecond timer. We want to do this as early + * as we can. + */ + timer_start(); + exynos_pinmux_config(PERIPH_ID_SPI1, PINMUX_FLAG_NONE); #if CONFIG_EARLY_CONSOLE exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE); diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c index 7a26ed9b50..dda4e7ca60 100644 --- a/src/mainboard/google/snow/romstage.c +++ b/src/mainboard/google/snow/romstage.c @@ -36,6 +36,7 @@ #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> |