Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
99
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Software
Commits
96a207cd
Commit
96a207cd
authored
8 years ago
by
Grzegorz Daniluk
Committed by
Adam Wujek
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
kernel/wr_rtu: get IRQ number from the VIC domain
parent
ccfc120a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/wr_rtu/wr_rtu.c
+30
-4
30 additions, 4 deletions
kernel/wr_rtu/wr_rtu.c
with
30 additions
and
4 deletions
kernel/wr_rtu/wr_rtu.c
+
30
−
4
View file @
96a207cd
...
...
@@ -39,6 +39,7 @@
#include
<linux/wait.h>
#include
<linux/spinlock.h>
#include
<linux/io.h>
#include
<linux/irqdomain.h>
/*
* Ugly trick to be able to use headers that have been moved out
...
...
@@ -70,6 +71,13 @@ static struct RTU_WB __iomem *regs;
#define wr_rtu_readl(r) __raw_readl(®s->r);
#define wr_rtu_writel(val, r) __raw_writel(val, ®s->r);
/**
* IRQ domain to be used. This is static here but in general it should be
* a module parameter or somehow configurable. For the time being we keep
* it hard-coded here.
*/
static
const
char
*
irqdomain_name
=
"htvic-wr-swi.0"
;
static
void
wr_rtu_enable_irq
(
void
)
{
wr_rtu_writel
(
RTU_EIC_IER_NEMPTY
,
EIC_IER
);
...
...
@@ -159,6 +167,15 @@ static struct miscdevice wr_rtu_misc = {
static
int
__init
wr_rtu_init
(
void
)
{
int
err
;
int
irq
;
struct
irq_domain
*
irqdomain
;
irqdomain
=
irq_find_host
((
struct
device_node
*
)
irqdomain_name
);
if
(
!
irqdomain
)
{
pr_err
(
"pstat: The IRQ domain %s does not exist
\n
"
,
irqdomain_name
);
return
-
EINVAL
;
}
// register misc device
err
=
misc_register
(
&
wr_rtu_misc
);
...
...
@@ -182,9 +199,8 @@ static int __init wr_rtu_init(void)
// register interrupt handler
wr_rtu_disable_irq
();
err
=
request_irq
(
WRVIC_BASE_IRQ
+
WR_RTU_IRQ
,
wr_rtu_interrupt
,
irq
=
irq_find_mapping
(
irqdomain
,
WR_RTU_IRQ
);
err
=
request_irq
(
irq
,
wr_rtu_interrupt
,
IRQF_SHARED
,
"wr-rtu"
,
(
void
*
)
regs
...
...
@@ -209,10 +225,20 @@ static int __init wr_rtu_init(void)
static
void
__exit
wr_rtu_exit
(
void
)
{
int
irq
;
struct
irq_domain
*
irqdomain
;
// disable RTU interrupts
wr_rtu_disable_irq
();
// Unregister IRQ handler
free_irq
(
WRVIC_BASE_IRQ
+
WR_RTU_IRQ
,
(
void
*
)
regs
);
irqdomain
=
irq_find_host
((
struct
device_node
*
)
irqdomain_name
);
if
(
!
irqdomain
)
{
pr_err
(
"pstat: The IRQ domain %s does not exist
\n
"
,
irqdomain_name
);
}
else
{
irq
=
irq_find_mapping
(
irqdomain
,
WR_RTU_IRQ
);
free_irq
(
irq
,
(
void
*
)
regs
);
}
// Unmap RTU memory
iounmap
(
regs
);
// Unregister misc device driver
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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