Skip to content
Snippets Groups Projects
Commit e38e2ea1 authored by leichuan's avatar leichuan Committed by Kenneth Johansson
Browse files

GPTC heartbeat timer count down mode

parent b15b56a0
No related branches found
No related tags found
No related merge requests found
...@@ -357,7 +357,10 @@ static void gptc_per_timer_init(struct gptc_timer *timer) ...@@ -357,7 +357,10 @@ static void gptc_per_timer_init(struct gptc_timer *timer)
{ {
gptc_count_dir(timer); gptc_count_dir(timer);
gptc_enable_32bit_timer(timer); gptc_enable_32bit_timer(timer);
gptc_reset_counter(timer); if (timer->type == TIMER_TYPE_HEARTBEAT)
gptc_reload_counter(timer, 1); /* TODO for interval */
else
gptc_reset_counter(timer);
if (timer->type == TIMER_TYPE_CLK_SRC || if (timer->type == TIMER_TYPE_CLK_SRC ||
timer->type == TIMER_TYPE_HEARTBEAT) timer->type == TIMER_TYPE_HEARTBEAT)
gptc_reload_and_run(timer); gptc_reload_and_run(timer);
...@@ -374,8 +377,10 @@ static const char *const timer_type_to_str(u32 type) ...@@ -374,8 +377,10 @@ static const char *const timer_type_to_str(u32 type)
case TIMER_TYPE_WDT: case TIMER_TYPE_WDT:
return "wdt"; return "wdt";
case TIMER_TYPE_HEARTBEAT: case TIMER_TYPE_HEARTBEAT:
return "heartbeat"; return "heartbeat";
default: default:
return "none"; return "none";
} }
...@@ -554,7 +559,7 @@ static int gptc_of_parse_timer(struct gptc *gptc) ...@@ -554,7 +559,7 @@ static int gptc_of_parse_timer(struct gptc *gptc)
case TIMER_TYPE_HEARTBEAT: case TIMER_TYPE_HEARTBEAT:
INIT_LIST_HEAD(&timer->heartbeat); INIT_LIST_HEAD(&timer->heartbeat);
timer->irq = 0; timer->irq = 0;
timer->dir = GPTC_COUNT_UP; timer->dir = GPTC_COUNT_DOWN;
timer->cpuid = 0; timer->cpuid = 0;
list_add_tail(&timer->heartbeat, &gptc_heartbeat_list); list_add_tail(&timer->heartbeat, &gptc_heartbeat_list);
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment