diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2013-03-19 01:17:48 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2013-03-19 01:17:48 -0700 |
commit | 48a96c77d031520690372387ed391faf2b8e019d (patch) | |
tree | 73b029fdaaad39114b693abc51defc3e622e3660 | |
parent | 62e60b7d74b457387033e52af5bcfff41e43dbf6 (diff) | |
parent | baee4748371dbfcda4a21c247657f29b45cfe029 (diff) | |
download | lk-48a96c77d031520690372387ed391faf2b8e019d.tar.gz |
Merge "platform: msm8974: add support for bootup timestamps"
-rw-r--r-- | platform/msm8974/include/platform/iomap.h | 6 | ||||
-rw-r--r-- | platform/msm8974/platform.c | 42 |
2 files changed, 40 insertions, 8 deletions
diff --git a/platform/msm8974/include/platform/iomap.h b/platform/msm8974/include/platform/iomap.h index 86f154d2..df49060a 100644 --- a/platform/msm8974/include/platform/iomap.h +++ b/platform/msm8974/include/platform/iomap.h @@ -39,8 +39,10 @@ #define RPM_MSG_RAM_BASE 0xFC42B000 #define SYSTEM_IMEM_BASE 0xFE800000 -#define RESTART_REASON_ADDR (RPM_MSG_RAM_BASE + 0x65C) -#define RESTART_REASON_ADDR_V2 (SYSTEM_IMEM_BASE + 0x565C) +#define MSM_SHARED_IMEM_BASE 0xFE850000 + +#define RESTART_REASON_ADDR (RPM_MSG_RAM_BASE + 0x65C) +#define RESTART_REASON_ADDR_V2 (MSM_SHARED_IMEM_BASE + 0x65C) #define KPSS_BASE 0xF9000000 diff --git a/platform/msm8974/platform.c b/platform/msm8974/platform.c index 430116bb..cb8876ec 100644 --- a/platform/msm8974/platform.c +++ b/platform/msm8974/platform.c @@ -35,6 +35,8 @@ #include <mmu.h> #include <arch/arm/mmu.h> #include <smem.h> +#include <board.h> +#include <boot_stats.h> #define MB (1024*1024) @@ -56,6 +58,11 @@ static mmu_section_t mmu_section_table[] = { static struct smem_ram_ptable ram_ptable; +/* Boot timestamps */ +#define BS_INFO_OFFSET (0x6B0) +#define BS_INFO_ADDR_V1 (RPM_MSG_RAM_BASE + BS_INFO_OFFSET) +#define BS_INFO_ADDR_V2 (MSM_SHARED_IMEM_BASE + BS_INFO_OFFSET) + void platform_early_init(void) { board_init(); @@ -69,19 +76,42 @@ void platform_init(void) dprintf(INFO, "platform_init()\n"); } -static void platform_print_sclk(void) +static uint32_t platform_get_sclk_count(void) +{ + return readl(MPM2_MPM_SLEEP_TIMETICK_COUNT_VAL); +} + +static uint32_t kernel_load_start; +void bs_set_timestamp(enum bs_entry bs_id) { - uint32_t count; + void *bs_imem; + uint32_t soc_ver = board_soc_version(); - count = readl(MPM2_MPM_SLEEP_TIMETICK_COUNT_VAL); + if (bs_id >= BS_MAX) { + dprintf(CRITICAL, "bad bs id: %u, max: %u\n", bs_id, BS_MAX); + ASSERT(0); + } + + if (bs_id == BS_KERNEL_LOAD_START) { + kernel_load_start = platform_get_sclk_count(); + return; + } - dprintf(INFO, "mpm sclk=(%lu)\n", count); + if (soc_ver < BOARD_SOC_VERSION2) + bs_imem = (void *)BS_INFO_ADDR_V1; + else + bs_imem = (void *)BS_INFO_ADDR_V2; + + if(bs_id == BS_KERNEL_LOAD_DONE) + writel(platform_get_sclk_count() - kernel_load_start, + bs_imem + (sizeof(uint32_t) * BS_KERNEL_LOAD_TIME)); + else + writel(platform_get_sclk_count(), + bs_imem + (sizeof(uint32_t) * bs_id)); } void platform_uninit(void) { - platform_print_sclk(); - #if DISPLAY_SPLASH_SCREEN display_shutdown(); #endif |