Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linux_grx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Intel
linux_grx
Commits
b15b56a0
Commit
b15b56a0
authored
8 years ago
by
leichuan
Committed by
Kenneth Johansson
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
GPTC heartbeat timer for ledc
parent
becd5978
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/clocksource/intel-gptc-timer.c
+32
-1
32 additions, 1 deletion
drivers/clocksource/intel-gptc-timer.c
with
32 additions
and
1 deletion
drivers/clocksource/intel-gptc-timer.c
+
32
−
1
View file @
b15b56a0
...
...
@@ -83,6 +83,7 @@ enum gptc_timer_type {
TIMER_TYPE_CLK_SRC
,
TIMER_TYPE_CLK_EVT
,
TIMER_TYPE_WDT
,
TIMER_TYPE_HEARTBEAT
,
TIMER_TYPE_MAX
,
};
...
...
@@ -117,6 +118,7 @@ struct gptc_timer {
struct
list_head
clksrc
;
/* Node in clock source list */
struct
list_head
clkevt
;
/* Node in clock event list */
struct
list_head
wdt
;
/* Node in watchdog timer */
struct
list_head
heartbeat
;
/* Heartbeat */
};
struct
gptc_clocksource
{
...
...
@@ -135,6 +137,7 @@ static LIST_HEAD(gptc_list);
static
LIST_HEAD
(
gptc_clksrc_list
);
static
LIST_HEAD
(
gptc_clkevt_list
);
static
LIST_HEAD
(
gptc_wdt_list
);
static
LIST_HEAD
(
gptc_heartbeat_list
);
unsigned
long
gptc_phy_base
;
static
bool
gptc_clksrc_init
;
...
...
@@ -355,7 +358,8 @@ static void gptc_per_timer_init(struct gptc_timer *timer)
gptc_count_dir
(
timer
);
gptc_enable_32bit_timer
(
timer
);
gptc_reset_counter
(
timer
);
if
(
timer
->
type
==
TIMER_TYPE_CLK_SRC
)
if
(
timer
->
type
==
TIMER_TYPE_CLK_SRC
||
timer
->
type
==
TIMER_TYPE_HEARTBEAT
)
gptc_reload_and_run
(
timer
);
}
...
...
@@ -370,6 +374,8 @@ static const char *const timer_type_to_str(u32 type)
case
TIMER_TYPE_WDT
:
return
"wdt"
;
case
TIMER_TYPE_HEARTBEAT
:
return
"heartbeat"
;
default:
return
"none"
;
}
...
...
@@ -545,6 +551,13 @@ static int gptc_of_parse_timer(struct gptc *gptc)
timer
->
cpuid
=
0
;
list_add_tail
(
&
timer
->
clksrc
,
&
gptc_clksrc_list
);
break
;
case
TIMER_TYPE_HEARTBEAT
:
INIT_LIST_HEAD
(
&
timer
->
heartbeat
);
timer
->
irq
=
0
;
timer
->
dir
=
GPTC_COUNT_UP
;
timer
->
cpuid
=
0
;
list_add_tail
(
&
timer
->
heartbeat
,
&
gptc_heartbeat_list
);
break
;
case
TIMER_TYPE_CLK_EVT
:
case
TIMER_TYPE_WDT
:
timer
->
irq
=
irq_of_parse_and_map
(
np
,
timer
->
tid
);
...
...
@@ -850,6 +863,24 @@ static int __init gptc_timer_init(struct device_node *np)
CLOCKSOURCE_OF_DECLARE
(
lantiq_gptc_timer
,
"lantiq,gptc"
,
gptc_timer_init
);
CLOCKSOURCE_OF_DECLARE
(
intel_gptc_timer
,
"intel,gptc"
,
gptc_timer_init
);
static
int
__init
gptc_heartbeat_init
(
void
)
{
struct
gptc_timer
*
timer
;
list_for_each_entry
(
timer
,
&
gptc_heartbeat_list
,
heartbeat
)
{
if
(
!
timer
->
used
)
{
gptc_per_timer_init
(
timer
);
timer
->
used
=
true
;
gptc_get
(
timer
->
gptc
);
pr_debug
(
"gptc %d timer %d heartbeat register @cpu%d
\n
"
,
timer
->
gptcid
,
timer
->
tid
,
timer
->
cpuid
);
return
0
;
}
}
return
-
EINVAL
;
}
arch_initcall
(
gptc_heartbeat_init
);
static
void
*
gptc_seq_start
(
struct
seq_file
*
s
,
loff_t
*
pos
)
{
if
(
list_empty
(
&
gptc_list
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment