Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
e02a9b7c
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
14
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e02a9b7c
编写于
8月 23, 2016
作者:
J
Jason Cooper
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'irqchip/mvebu64' into irqchip/core
上级
fbbf2b36
04208a24
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
227 addition
and
0 deletion
+227
-0
Documentation/devicetree/bindings/interrupt-controller/marvell,armada-8k-pic.txt
...e/bindings/interrupt-controller/marvell,armada-8k-pic.txt
+25
-0
arch/arm64/Kconfig.platforms
arch/arm64/Kconfig.platforms
+1
-0
drivers/irqchip/Kconfig
drivers/irqchip/Kconfig
+3
-0
drivers/irqchip/Makefile
drivers/irqchip/Makefile
+1
-0
drivers/irqchip/irq-mvebu-pic.c
drivers/irqchip/irq-mvebu-pic.c
+197
-0
未找到文件。
Documentation/devicetree/bindings/interrupt-controller/marvell,armada-8k-pic.txt
0 → 100644
浏览文件 @
e02a9b7c
Marvell Armada 7K/8K PIC Interrupt controller
---------------------------------------------
This is the Device Tree binding for the PIC, a secondary interrupt
controller available on the Marvell Armada 7K/8K ARM64 SoCs, and
typically connected to the GIC as the primary interrupt controller.
Required properties:
- compatible: should be "marvell,armada-8k-pic"
- interrupt-controller: identifies the node as an interrupt controller
- #interrupt-cells: the number of cells to define interrupts on this
controller. Should be 1
- reg: the register area for the PIC interrupt controller
- interrupts: the interrupt to the primary interrupt controller,
typically the GIC
Example:
pic: interrupt-controller@3f0100 {
compatible = "marvell,armada-8k-pic";
reg = <0x3f0100 0x10>;
#interrupt-cells = <1>;
interrupt-controller;
interrupts = <GIC_PPI 15 IRQ_TYPE_LEVEL_HIGH>;
};
arch/arm64/Kconfig.platforms
浏览文件 @
e02a9b7c
...
@@ -93,6 +93,7 @@ config ARCH_MVEBU
...
@@ -93,6 +93,7 @@ config ARCH_MVEBU
select ARMADA_CP110_SYSCON
select ARMADA_CP110_SYSCON
select ARMADA_37XX_CLK
select ARMADA_37XX_CLK
select MVEBU_ODMI
select MVEBU_ODMI
select MVEBU_PIC
help
help
This enables support for Marvell EBU familly, including:
This enables support for Marvell EBU familly, including:
- Armada 3700 SoC Family
- Armada 3700 SoC Family
...
...
drivers/irqchip/Kconfig
浏览文件 @
e02a9b7c
...
@@ -258,6 +258,9 @@ config IRQ_MXS
...
@@ -258,6 +258,9 @@ config IRQ_MXS
config MVEBU_ODMI
config MVEBU_ODMI
bool
bool
config MVEBU_PIC
bool
config LS_SCFG_MSI
config LS_SCFG_MSI
def_bool y if SOC_LS1021A || ARCH_LAYERSCAPE
def_bool y if SOC_LS1021A || ARCH_LAYERSCAPE
depends on PCI && PCI_MSI
depends on PCI && PCI_MSI
...
...
drivers/irqchip/Makefile
浏览文件 @
e02a9b7c
...
@@ -69,6 +69,7 @@ obj-$(CONFIG_INGENIC_IRQ) += irq-ingenic.o
...
@@ -69,6 +69,7 @@ obj-$(CONFIG_INGENIC_IRQ) += irq-ingenic.o
obj-$(CONFIG_IMX_GPCV2)
+=
irq-imx-gpcv2.o
obj-$(CONFIG_IMX_GPCV2)
+=
irq-imx-gpcv2.o
obj-$(CONFIG_PIC32_EVIC)
+=
irq-pic32-evic.o
obj-$(CONFIG_PIC32_EVIC)
+=
irq-pic32-evic.o
obj-$(CONFIG_MVEBU_ODMI)
+=
irq-mvebu-odmi.o
obj-$(CONFIG_MVEBU_ODMI)
+=
irq-mvebu-odmi.o
obj-$(CONFIG_MVEBU_PIC)
+=
irq-mvebu-pic.o
obj-$(CONFIG_LS_SCFG_MSI)
+=
irq-ls-scfg-msi.o
obj-$(CONFIG_LS_SCFG_MSI)
+=
irq-ls-scfg-msi.o
obj-$(CONFIG_EZNPS_GIC)
+=
irq-eznps.o
obj-$(CONFIG_EZNPS_GIC)
+=
irq-eznps.o
obj-$(CONFIG_ARCH_ASPEED)
+=
irq-aspeed-vic.o
obj-$(CONFIG_ARCH_ASPEED)
+=
irq-aspeed-vic.o
drivers/irqchip/irq-mvebu-pic.c
0 → 100644
浏览文件 @
e02a9b7c
/*
* Copyright (C) 2016 Marvell
*
* Yehuda Yitschak <yehuday@marvell.com>
* Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/irqchip.h>
#include <linux/irqchip/chained_irq.h>
#include <linux/irqdomain.h>
#include <linux/module.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#define PIC_CAUSE 0x0
#define PIC_MASK 0x4
#define PIC_MAX_IRQS 32
#define PIC_MAX_IRQ_MASK ((1UL << PIC_MAX_IRQS) - 1)
struct
mvebu_pic
{
void
__iomem
*
base
;
u32
parent_irq
;
struct
irq_domain
*
domain
;
struct
irq_chip
irq_chip
;
};
static
void
mvebu_pic_reset
(
struct
mvebu_pic
*
pic
)
{
/* ACK and mask all interrupts */
writel
(
0
,
pic
->
base
+
PIC_MASK
);
writel
(
PIC_MAX_IRQ_MASK
,
pic
->
base
+
PIC_CAUSE
);
}
static
void
mvebu_pic_eoi_irq
(
struct
irq_data
*
d
)
{
struct
mvebu_pic
*
pic
=
irq_data_get_irq_chip_data
(
d
);
writel
(
1
<<
d
->
hwirq
,
pic
->
base
+
PIC_CAUSE
);
}
static
void
mvebu_pic_mask_irq
(
struct
irq_data
*
d
)
{
struct
mvebu_pic
*
pic
=
irq_data_get_irq_chip_data
(
d
);
u32
reg
;
reg
=
readl
(
pic
->
base
+
PIC_MASK
);
reg
|=
(
1
<<
d
->
hwirq
);
writel
(
reg
,
pic
->
base
+
PIC_MASK
);
}
static
void
mvebu_pic_unmask_irq
(
struct
irq_data
*
d
)
{
struct
mvebu_pic
*
pic
=
irq_data_get_irq_chip_data
(
d
);
u32
reg
;
reg
=
readl
(
pic
->
base
+
PIC_MASK
);
reg
&=
~
(
1
<<
d
->
hwirq
);
writel
(
reg
,
pic
->
base
+
PIC_MASK
);
}
static
int
mvebu_pic_irq_map
(
struct
irq_domain
*
domain
,
unsigned
int
virq
,
irq_hw_number_t
hwirq
)
{
struct
mvebu_pic
*
pic
=
domain
->
host_data
;
irq_set_percpu_devid
(
virq
);
irq_set_chip_data
(
virq
,
pic
);
irq_set_chip_and_handler
(
virq
,
&
pic
->
irq_chip
,
handle_percpu_devid_irq
);
irq_set_status_flags
(
virq
,
IRQ_LEVEL
);
irq_set_probe
(
virq
);
return
0
;
}
static
const
struct
irq_domain_ops
mvebu_pic_domain_ops
=
{
.
map
=
mvebu_pic_irq_map
,
.
xlate
=
irq_domain_xlate_onecell
,
};
static
void
mvebu_pic_handle_cascade_irq
(
struct
irq_desc
*
desc
)
{
struct
mvebu_pic
*
pic
=
irq_desc_get_handler_data
(
desc
);
struct
irq_chip
*
chip
=
irq_desc_get_chip
(
desc
);
unsigned
long
irqmap
,
irqn
;
unsigned
int
cascade_irq
;
irqmap
=
readl_relaxed
(
pic
->
base
+
PIC_CAUSE
);
chained_irq_enter
(
chip
,
desc
);
for_each_set_bit
(
irqn
,
&
irqmap
,
BITS_PER_LONG
)
{
cascade_irq
=
irq_find_mapping
(
pic
->
domain
,
irqn
);
generic_handle_irq
(
cascade_irq
);
}
chained_irq_exit
(
chip
,
desc
);
}
static
void
mvebu_pic_enable_percpu_irq
(
void
*
data
)
{
struct
mvebu_pic
*
pic
=
data
;
mvebu_pic_reset
(
pic
);
enable_percpu_irq
(
pic
->
parent_irq
,
IRQ_TYPE_NONE
);
}
static
void
mvebu_pic_disable_percpu_irq
(
void
*
data
)
{
struct
mvebu_pic
*
pic
=
data
;
disable_percpu_irq
(
pic
->
parent_irq
);
}
static
int
mvebu_pic_probe
(
struct
platform_device
*
pdev
)
{
struct
device_node
*
node
=
pdev
->
dev
.
of_node
;
struct
mvebu_pic
*
pic
;
struct
irq_chip
*
irq_chip
;
struct
resource
*
res
;
pic
=
devm_kzalloc
(
&
pdev
->
dev
,
sizeof
(
struct
mvebu_pic
),
GFP_KERNEL
);
if
(
!
pic
)
return
-
ENOMEM
;
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
pic
->
base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
res
);
if
(
IS_ERR
(
pic
->
base
))
return
PTR_ERR
(
pic
->
base
);
irq_chip
=
&
pic
->
irq_chip
;
irq_chip
->
name
=
dev_name
(
&
pdev
->
dev
);
irq_chip
->
irq_mask
=
mvebu_pic_mask_irq
;
irq_chip
->
irq_unmask
=
mvebu_pic_unmask_irq
;
irq_chip
->
irq_eoi
=
mvebu_pic_eoi_irq
;
pic
->
parent_irq
=
irq_of_parse_and_map
(
node
,
0
);
if
(
pic
->
parent_irq
<=
0
)
{
dev_err
(
&
pdev
->
dev
,
"Failed to parse parent interrupt
\n
"
);
return
-
EINVAL
;
}
pic
->
domain
=
irq_domain_add_linear
(
node
,
PIC_MAX_IRQS
,
&
mvebu_pic_domain_ops
,
pic
);
if
(
!
pic
->
domain
)
{
dev_err
(
&
pdev
->
dev
,
"Failed to allocate irq domain
\n
"
);
return
-
ENOMEM
;
}
irq_set_chained_handler
(
pic
->
parent_irq
,
mvebu_pic_handle_cascade_irq
);
irq_set_handler_data
(
pic
->
parent_irq
,
pic
);
on_each_cpu
(
mvebu_pic_enable_percpu_irq
,
pic
,
1
);
platform_set_drvdata
(
pdev
,
pic
);
return
0
;
}
static
int
mvebu_pic_remove
(
struct
platform_device
*
pdev
)
{
struct
mvebu_pic
*
pic
=
platform_get_drvdata
(
pdev
);
on_each_cpu
(
mvebu_pic_disable_percpu_irq
,
pic
,
1
);
irq_domain_remove
(
pic
->
domain
);
return
0
;
}
static
const
struct
of_device_id
mvebu_pic_of_match
[]
=
{
{
.
compatible
=
"marvell,armada-8k-pic"
,
},
{},
};
MODULE_DEVICE_TABLE
(
of
,
mvebu_pic_of_match
);
static
struct
platform_driver
mvebu_pic_driver
=
{
.
probe
=
mvebu_pic_probe
,
.
remove
=
mvebu_pic_remove
,
.
driver
=
{
.
name
=
"mvebu-pic"
,
.
of_match_table
=
mvebu_pic_of_match
,
},
};
module_platform_driver
(
mvebu_pic_driver
);
MODULE_AUTHOR
(
"Yehuda Yitschak <yehuday@marvell.com>"
);
MODULE_AUTHOR
(
"Thomas Petazzoni <thomas.petazzoni@free-electrons.com>"
);
MODULE_LICENSE
(
"GPL v2"
);
MODULE_ALIAS
(
"platform:mvebu_pic"
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录