Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f3877047
Commit
f3877047
authored
Aug 01, 2012
by
Paul Mundt
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'common/irqdomain' into sh-latest
parents
1ca8fe38
1d6a21b0
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
333 additions
and
174 deletions
+333
-174
Documentation/IRQ-domain.txt
Documentation/IRQ-domain.txt
+5
-0
arch/powerpc/sysdev/xics/icp-hv.c
arch/powerpc/sysdev/xics/icp-hv.c
+1
-1
arch/powerpc/sysdev/xics/icp-native.c
arch/powerpc/sysdev/xics/icp-native.c
+1
-1
arch/powerpc/sysdev/xics/xics-common.c
arch/powerpc/sysdev/xics/xics-common.c
+0
-3
drivers/sh/intc/Kconfig
drivers/sh/intc/Kconfig
+4
-0
drivers/sh/intc/Makefile
drivers/sh/intc/Makefile
+1
-1
drivers/sh/intc/core.c
drivers/sh/intc/core.c
+7
-4
drivers/sh/intc/internals.h
drivers/sh/intc/internals.h
+5
-0
drivers/sh/intc/irqdomain.c
drivers/sh/intc/irqdomain.c
+68
-0
include/linux/irqdomain.h
include/linux/irqdomain.h
+24
-4
include/linux/of.h
include/linux/of.h
+10
-5
kernel/irq/irqdomain.c
kernel/irq/irqdomain.c
+207
-155
No files found.
Documentation/IRQ-domain.txt
View file @
f3877047
...
...
@@ -93,6 +93,7 @@ Linux IRQ number into the hardware.
Most drivers cannot use this mapping.
==== Legacy ====
irq_domain_add_simple()
irq_domain_add_legacy()
irq_domain_add_legacy_isa()
...
...
@@ -115,3 +116,7 @@ The legacy map should only be used if fixed IRQ mappings must be
supported. For example, ISA controllers would use the legacy map for
mapping Linux IRQs 0-15 so that existing ISA drivers get the correct IRQ
numbers.
Most users of legacy mappings should use irq_domain_add_simple() which
will use a legacy domain only if an IRQ range is supplied by the
system and will otherwise use a linear domain mapping.
arch/powerpc/sysdev/xics/icp-hv.c
View file @
f3877047
...
...
@@ -111,7 +111,7 @@ static unsigned int icp_hv_get_irq(void)
if
(
vec
==
XICS_IRQ_SPURIOUS
)
return
NO_IRQ
;
irq
=
irq_
radix_revmap_lookup
(
xics_host
,
vec
);
irq
=
irq_
find_mapping
(
xics_host
,
vec
);
if
(
likely
(
irq
!=
NO_IRQ
))
{
xics_push_cppr
(
vec
);
return
irq
;
...
...
arch/powerpc/sysdev/xics/icp-native.c
View file @
f3877047
...
...
@@ -119,7 +119,7 @@ static unsigned int icp_native_get_irq(void)
if
(
vec
==
XICS_IRQ_SPURIOUS
)
return
NO_IRQ
;
irq
=
irq_
radix_revmap_lookup
(
xics_host
,
vec
);
irq
=
irq_
find_mapping
(
xics_host
,
vec
);
if
(
likely
(
irq
!=
NO_IRQ
))
{
xics_push_cppr
(
vec
);
return
irq
;
...
...
arch/powerpc/sysdev/xics/xics-common.c
View file @
f3877047
...
...
@@ -329,9 +329,6 @@ static int xics_host_map(struct irq_domain *h, unsigned int virq,
pr_devel
(
"xics: map virq %d, hwirq 0x%lx
\n
"
,
virq
,
hw
);
/* Insert the interrupt mapping into the radix tree for fast lookup */
irq_radix_revmap_insert
(
xics_host
,
virq
,
hw
);
/* They aren't all level sensitive but we just don't really know */
irq_set_status_flags
(
virq
,
IRQ_LEVEL
);
...
...
drivers/sh/intc/Kconfig
View file @
f3877047
config SH_INTC
def_bool y
select IRQ_DOMAIN
comment "Interrupt controller options"
config INTC_USERIMASK
...
...
drivers/sh/intc/Makefile
View file @
f3877047
obj-y
:=
access.o chip.o core.o handle.o virq.o
obj-y
:=
access.o chip.o core.o handle.o
irqdomain.o
virq.o
obj-$(CONFIG_INTC_BALANCING)
+=
balancing.o
obj-$(CONFIG_INTC_USERIMASK)
+=
userimask.o
...
...
drivers/sh/intc/core.c
View file @
f3877047
...
...
@@ -25,6 +25,7 @@
#include <linux/stat.h>
#include <linux/interrupt.h>
#include <linux/sh_intc.h>
#include <linux/irqdomain.h>
#include <linux/device.h>
#include <linux/syscore_ops.h>
#include <linux/list.h>
...
...
@@ -310,6 +311,8 @@ int __init register_intc_controller(struct intc_desc *desc)
BUG_ON
(
k
>
256
);
/* _INTC_ADDR_E() and _INTC_ADDR_D() are 8 bits */
intc_irq_domain_init
(
d
,
hw
);
/* register the vectors one by one */
for
(
i
=
0
;
i
<
hw
->
nr_vectors
;
i
++
)
{
struct
intc_vect
*
vect
=
hw
->
vectors
+
i
;
...
...
@@ -319,8 +322,8 @@ int __init register_intc_controller(struct intc_desc *desc)
if
(
!
vect
->
enum_id
)
continue
;
res
=
irq_
alloc_desc_at
(
irq
,
numa_node_id
()
);
if
(
res
!=
irq
&&
res
!=
-
EEXIST
)
{
res
=
irq_
create_identity_mapping
(
d
->
domain
,
irq
);
if
(
unlikely
(
res
)
)
{
pr_err
(
"can't get irq_desc for %d
\n
"
,
irq
);
continue
;
}
...
...
@@ -340,8 +343,8 @@ int __init register_intc_controller(struct intc_desc *desc)
* IRQ support, each vector still needs to have
* its own backing irq_desc.
*/
res
=
irq_
alloc_desc_at
(
irq2
,
numa_node_id
()
);
if
(
res
!=
irq2
&&
res
!=
-
EEXIST
)
{
res
=
irq_
create_identity_mapping
(
d
->
domain
,
irq2
);
if
(
unlikely
(
res
)
)
{
pr_err
(
"can't get irq_desc for %d
\n
"
,
irq2
);
continue
;
}
...
...
drivers/sh/intc/internals.h
View file @
f3877047
#include <linux/sh_intc.h>
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/list.h>
#include <linux/kernel.h>
#include <linux/types.h>
...
...
@@ -66,6 +67,7 @@ struct intc_desc_int {
unsigned
int
nr_sense
;
struct
intc_window
*
window
;
unsigned
int
nr_windows
;
struct
irq_domain
*
domain
;
struct
irq_chip
chip
;
bool
skip_suspend
;
};
...
...
@@ -187,6 +189,9 @@ unsigned long intc_get_ack_handle(unsigned int irq);
void
intc_enable_disable_enum
(
struct
intc_desc
*
desc
,
struct
intc_desc_int
*
d
,
intc_enum
enum_id
,
int
enable
);
/* irqdomain.c */
void
intc_irq_domain_init
(
struct
intc_desc_int
*
d
,
struct
intc_hw_desc
*
hw
);
/* virq.c */
void
intc_subgroup_init
(
struct
intc_desc
*
desc
,
struct
intc_desc_int
*
d
);
void
intc_irq_xlate_set
(
unsigned
int
irq
,
intc_enum
id
,
struct
intc_desc_int
*
d
);
...
...
drivers/sh/intc/irqdomain.c
0 → 100644
View file @
f3877047
/*
* IRQ domain support for SH INTC subsystem
*
* Copyright (C) 2012 Paul Mundt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#define pr_fmt(fmt) "intc: " fmt
#include <linux/irqdomain.h>
#include <linux/sh_intc.h>
#include <linux/export.h>
#include "internals.h"
/**
* intc_irq_domain_evt_xlate() - Generic xlate for vectored IRQs.
*
* This takes care of exception vector to hwirq translation through
* by way of evt2irq() translation.
*
* Note: For platforms that use a flat vector space without INTEVT this
* basically just mimics irq_domain_xlate_onecell() by way of a nopped
* out evt2irq() implementation.
*/
static
int
intc_evt_xlate
(
struct
irq_domain
*
d
,
struct
device_node
*
ctrlr
,
const
u32
*
intspec
,
unsigned
int
intsize
,
unsigned
long
*
out_hwirq
,
unsigned
int
*
out_type
)
{
if
(
WARN_ON
(
intsize
<
1
))
return
-
EINVAL
;
*
out_hwirq
=
evt2irq
(
intspec
[
0
]);
*
out_type
=
IRQ_TYPE_NONE
;
return
0
;
}
static
const
struct
irq_domain_ops
intc_evt_ops
=
{
.
xlate
=
intc_evt_xlate
,
};
void
__init
intc_irq_domain_init
(
struct
intc_desc_int
*
d
,
struct
intc_hw_desc
*
hw
)
{
unsigned
int
irq_base
,
irq_end
;
/*
* Quick linear revmap check
*/
irq_base
=
evt2irq
(
hw
->
vectors
[
0
].
vect
);
irq_end
=
evt2irq
(
hw
->
vectors
[
hw
->
nr_vectors
-
1
].
vect
);
/*
* Linear domains have a hard-wired assertion that IRQs start at
* 0 in order to make some performance optimizations. Lamely
* restrict the linear case to these conditions here, taking the
* tree penalty for linear cases with non-zero hwirq bases.
*/
if
(
irq_base
==
0
&&
irq_end
==
(
irq_base
+
hw
->
nr_vectors
-
1
))
d
->
domain
=
irq_domain_add_linear
(
NULL
,
hw
->
nr_vectors
,
&
intc_evt_ops
,
NULL
);
else
d
->
domain
=
irq_domain_add_tree
(
NULL
,
&
intc_evt_ops
,
NULL
);
BUG_ON
(
!
d
->
domain
);
}
include/linux/irqdomain.h
View file @
f3877047
...
...
@@ -112,6 +112,11 @@ struct irq_domain {
};
#ifdef CONFIG_IRQ_DOMAIN
struct
irq_domain
*
irq_domain_add_simple
(
struct
device_node
*
of_node
,
unsigned
int
size
,
unsigned
int
first_irq
,
const
struct
irq_domain_ops
*
ops
,
void
*
host_data
);
struct
irq_domain
*
irq_domain_add_legacy
(
struct
device_node
*
of_node
,
unsigned
int
size
,
unsigned
int
first_irq
,
...
...
@@ -144,16 +149,31 @@ static inline struct irq_domain *irq_domain_add_legacy_isa(
extern
void
irq_domain_remove
(
struct
irq_domain
*
host
);
extern
int
irq_domain_associate_many
(
struct
irq_domain
*
domain
,
unsigned
int
irq_base
,
irq_hw_number_t
hwirq_base
,
int
count
);
static
inline
int
irq_domain_associate
(
struct
irq_domain
*
domain
,
unsigned
int
irq
,
irq_hw_number_t
hwirq
)
{
return
irq_domain_associate_many
(
domain
,
irq
,
hwirq
,
1
);
}
extern
unsigned
int
irq_create_mapping
(
struct
irq_domain
*
host
,
irq_hw_number_t
hwirq
);
extern
void
irq_dispose_mapping
(
unsigned
int
virq
);
extern
unsigned
int
irq_find_mapping
(
struct
irq_domain
*
host
,
irq_hw_number_t
hwirq
);
extern
unsigned
int
irq_create_direct_mapping
(
struct
irq_domain
*
host
);
extern
void
irq_radix_revmap_insert
(
struct
irq_domain
*
host
,
unsigned
int
virq
,
irq_hw_number_t
hwirq
);
extern
unsigned
int
irq_radix_revmap_lookup
(
struct
irq_domain
*
host
,
irq_hw_number_t
hwirq
);
extern
int
irq_create_strict_mappings
(
struct
irq_domain
*
domain
,
unsigned
int
irq_base
,
irq_hw_number_t
hwirq_base
,
int
count
);
static
inline
int
irq_create_identity_mapping
(
struct
irq_domain
*
host
,
irq_hw_number_t
hwirq
)
{
return
irq_create_strict_mappings
(
host
,
hwirq
,
hwirq
,
1
);
}
extern
unsigned
int
irq_linear_revmap
(
struct
irq_domain
*
host
,
irq_hw_number_t
hwirq
);
...
...
include/linux/of.h
View file @
f3877047
...
...
@@ -21,6 +21,7 @@
#include <linux/kref.h>
#include <linux/mod_devicetable.h>
#include <linux/spinlock.h>
#include <linux/topology.h>
#include <asm/byteorder.h>
#include <asm/errno.h>
...
...
@@ -158,11 +159,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
#define OF_BAD_ADDR ((u64)-1)
#ifndef of_node_to_nid
static
inline
int
of_node_to_nid
(
struct
device_node
*
np
)
{
return
-
1
;
}
#define of_node_to_nid of_node_to_nid
#endif
static
inline
const
char
*
of_node_full_name
(
struct
device_node
*
np
)
{
return
np
?
np
->
full_name
:
"<no-node>"
;
...
...
@@ -427,6 +423,15 @@ static inline int of_machine_is_compatible(const char *compat)
while (0)
#endif
/* CONFIG_OF */
#ifndef of_node_to_nid
static
inline
int
of_node_to_nid
(
struct
device_node
*
np
)
{
return
numa_node_id
();
}
#define of_node_to_nid of_node_to_nid
#endif
/**
* of_property_read_bool - Findfrom a property
* @np: device node from which the property value is to be read.
...
...
kernel/irq/irqdomain.c
View file @
f3877047
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment