Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
6c20a683
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
6c20a683
编写于
3月 23, 2009
作者:
H
Hiroshi DOYU
提交者:
Tony Lindgren
3月 23, 2009
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
omap mailbox: add initial omap3 support
Signed-off-by:
N
Hiroshi DOYU
<
Hiroshi.DOYU@nokia.com
>
上级
733ecc5c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
80 addition
and
36 deletion
+80
-36
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/devices.c
+29
-8
arch/arm/mach-omap2/mailbox.c
arch/arm/mach-omap2/mailbox.c
+42
-28
arch/arm/plat-omap/Kconfig
arch/arm/plat-omap/Kconfig
+8
-0
arch/arm/plat-omap/include/mach/omap34xx.h
arch/arm/plat-omap/include/mach/omap34xx.h
+1
-0
未找到文件。
arch/arm/mach-omap2/devices.c
浏览文件 @
6c20a683
...
@@ -28,13 +28,14 @@
...
@@ -28,13 +28,14 @@
#include <mach/eac.h>
#include <mach/eac.h>
#include <mach/mmc.h>
#include <mach/mmc.h>
#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
#define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE)
static
struct
resource
mbox_resources
[]
=
{
#define MBOX_REG_SIZE 0x120
static
struct
resource
omap2_mbox_resources
[]
=
{
{
{
.
start
=
OMAP2
_M
BOX_BASE
,
.
start
=
OMAP2
4XX_MAIL
BOX_BASE
,
.
end
=
OMAP2
_MBOX_BASE
+
0x11f
,
.
end
=
OMAP2
4XX_MAILBOX_BASE
+
MBOX_REG_SIZE
-
1
,
.
flags
=
IORESOURCE_MEM
,
.
flags
=
IORESOURCE_MEM
,
},
},
{
{
...
@@ -47,20 +48,40 @@ static struct resource mbox_resources[] = {
...
@@ -47,20 +48,40 @@ static struct resource mbox_resources[] = {
},
},
};
};
static
struct
resource
omap3_mbox_resources
[]
=
{
{
.
start
=
OMAP34XX_MAILBOX_BASE
,
.
end
=
OMAP34XX_MAILBOX_BASE
+
MBOX_REG_SIZE
-
1
,
.
flags
=
IORESOURCE_MEM
,
},
{
.
start
=
INT_24XX_MAIL_U0_MPU
,
.
flags
=
IORESOURCE_IRQ
,
},
};
static
struct
platform_device
mbox_device
=
{
static
struct
platform_device
mbox_device
=
{
.
name
=
"mailbox"
,
.
name
=
"mailbox"
,
.
id
=
-
1
,
.
id
=
-
1
,
.
num_resources
=
ARRAY_SIZE
(
mbox_resources
),
.
resource
=
mbox_resources
,
};
};
static
inline
void
omap_init_mbox
(
void
)
static
inline
void
omap_init_mbox
(
void
)
{
{
if
(
cpu_is_omap2420
())
{
mbox_device
.
num_resources
=
ARRAY_SIZE
(
omap2_mbox_resources
);
mbox_device
.
resource
=
omap2_mbox_resources
;
}
else
if
(
cpu_is_omap3430
())
{
mbox_device
.
num_resources
=
ARRAY_SIZE
(
omap3_mbox_resources
);
mbox_device
.
resource
=
omap3_mbox_resources
;
}
else
{
pr_err
(
"%s: platform not supported
\n
"
,
__func__
);
return
;
}
platform_device_register
(
&
mbox_device
);
platform_device_register
(
&
mbox_device
);
}
}
#else
#else
static
inline
void
omap_init_mbox
(
void
)
{
}
static
inline
void
omap_init_mbox
(
void
)
{
}
#endif
#endif
/* CONFIG_OMAP_MBOX_FWK */
#if defined(CONFIG_OMAP_STI)
#if defined(CONFIG_OMAP_STI)
...
...
arch/arm/mach-omap2/mailbox.c
浏览文件 @
6c20a683
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u)))
#define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u)))
#define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1))
#define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1))
static
unsigned
long
mbox_base
;
static
void
__iomem
*
mbox_base
;
struct
omap_mbox2_fifo
{
struct
omap_mbox2_fifo
{
unsigned
long
msg
;
unsigned
long
msg
;
...
@@ -52,14 +52,14 @@ static struct clk *mbox_ick_handle;
...
@@ -52,14 +52,14 @@ static struct clk *mbox_ick_handle;
static
void
omap2_mbox_enable_irq
(
struct
omap_mbox
*
mbox
,
static
void
omap2_mbox_enable_irq
(
struct
omap_mbox
*
mbox
,
omap_mbox_type_t
irq
);
omap_mbox_type_t
irq
);
static
inline
unsigned
int
mbox_read_reg
(
unsigned
int
reg
)
static
inline
unsigned
int
mbox_read_reg
(
size_t
ofs
)
{
{
return
__raw_readl
(
mbox_base
+
reg
);
return
__raw_readl
(
mbox_base
+
ofs
);
}
}
static
inline
void
mbox_write_reg
(
u
nsigned
int
val
,
unsigned
int
reg
)
static
inline
void
mbox_write_reg
(
u
32
val
,
size_t
ofs
)
{
{
__raw_writel
(
val
,
mbox_base
+
reg
);
__raw_writel
(
val
,
mbox_base
+
ofs
);
}
}
/* Mailbox H/W preparations */
/* Mailbox H/W preparations */
...
@@ -208,7 +208,7 @@ struct omap_mbox mbox_dsp_info = {
...
@@ -208,7 +208,7 @@ struct omap_mbox mbox_dsp_info = {
};
};
EXPORT_SYMBOL
(
mbox_dsp_info
);
EXPORT_SYMBOL
(
mbox_dsp_info
);
/* IVA */
#if defined(CONFIG_ARCH_OMAP2420)
/* IVA */
static
struct
omap_mbox2_priv
omap2_mbox_iva_priv
=
{
static
struct
omap_mbox2_priv
omap2_mbox_iva_priv
=
{
.
tx_fifo
=
{
.
tx_fifo
=
{
.
msg
=
MAILBOX_MESSAGE
(
2
),
.
msg
=
MAILBOX_MESSAGE
(
2
),
...
@@ -229,17 +229,12 @@ static struct omap_mbox mbox_iva_info = {
...
@@ -229,17 +229,12 @@ static struct omap_mbox mbox_iva_info = {
.
ops
=
&
omap2_mbox_ops
,
.
ops
=
&
omap2_mbox_ops
,
.
priv
=
&
omap2_mbox_iva_priv
,
.
priv
=
&
omap2_mbox_iva_priv
,
};
};
#endif
static
int
__init
omap2_mbox_probe
(
struct
platform_device
*
pdev
)
static
int
__init
omap2_mbox_probe
(
struct
platform_device
*
pdev
)
{
{
struct
resource
*
res
;
struct
resource
*
res
;
int
ret
=
0
;
int
ret
;
if
(
pdev
->
num_resources
!=
3
)
{
dev_err
(
&
pdev
->
dev
,
"invalid number of resources: %d
\n
"
,
pdev
->
num_resources
);
return
-
ENODEV
;
}
/* MBOX base */
/* MBOX base */
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
...
@@ -247,34 +242,53 @@ static int __init omap2_mbox_probe(struct platform_device *pdev)
...
@@ -247,34 +242,53 @@ static int __init omap2_mbox_probe(struct platform_device *pdev)
dev_err
(
&
pdev
->
dev
,
"invalid mem resource
\n
"
);
dev_err
(
&
pdev
->
dev
,
"invalid mem resource
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
mbox_base
=
res
->
start
;
mbox_base
=
ioremap
(
res
->
start
,
res
->
end
-
res
->
start
);
if
(
!
mbox_base
)
return
-
ENOMEM
;
/* DSP IRQ */
/* DSP
or IVA2
IRQ */
res
=
platform_get_resource
(
pdev
,
IORESOURCE_IRQ
,
0
);
mbox_dsp_info
.
irq
=
platform_get_irq
(
pdev
,
0
);
if
(
unlikely
(
!
res
)
)
{
if
(
mbox_dsp_info
.
irq
<
0
)
{
dev_err
(
&
pdev
->
dev
,
"invalid irq resource
\n
"
);
dev_err
(
&
pdev
->
dev
,
"invalid irq resource
\n
"
);
return
-
ENODEV
;
ret
=
-
ENODEV
;
goto
err_dsp
;
}
}
mbox_dsp_info
.
irq
=
res
->
start
;
ret
=
omap_mbox_register
(
&
mbox_dsp_info
);
ret
=
omap_mbox_register
(
&
mbox_dsp_info
);
if
(
ret
)
goto
err_dsp
;
#if defined(CONFIG_ARCH_OMAP2420)
/* IVA */
if
(
cpu_is_omap2420
())
{
/* IVA IRQ */
/* IVA IRQ */
res
=
platform_get_resource
(
pdev
,
IORESOURCE_IRQ
,
1
);
res
=
platform_get_resource
(
pdev
,
IORESOURCE_IRQ
,
1
);
if
(
unlikely
(
!
res
))
{
if
(
unlikely
(
!
res
))
{
dev_err
(
&
pdev
->
dev
,
"invalid irq resource
\n
"
);
dev_err
(
&
pdev
->
dev
,
"invalid irq resource
\n
"
);
return
-
ENODEV
;
ret
=
-
ENODEV
;
goto
err_iva1
;
}
}
mbox_iva_info
.
irq
=
res
->
start
;
mbox_iva_info
.
irq
=
res
->
start
;
ret
=
omap_mbox_register
(
&
mbox_iva_info
);
ret
=
omap_mbox_register
(
&
mbox_iva_info
);
if
(
ret
)
goto
err_iva1
;
}
#endif
return
0
;
err_iva1:
omap_mbox_unregister
(
&
mbox_dsp_info
);
err_dsp:
iounmap
(
mbox_base
);
return
ret
;
return
ret
;
}
}
static
int
omap2_mbox_remove
(
struct
platform_device
*
pdev
)
static
int
omap2_mbox_remove
(
struct
platform_device
*
pdev
)
{
{
#if defined(CONFIG_ARCH_OMAP2420)
omap_mbox_unregister
(
&
mbox_iva_info
);
#endif
omap_mbox_unregister
(
&
mbox_dsp_info
);
omap_mbox_unregister
(
&
mbox_dsp_info
);
iounmap
(
mbox_base
);
return
0
;
return
0
;
}
}
...
...
arch/arm/plat-omap/Kconfig
浏览文件 @
6c20a683
...
@@ -104,6 +104,14 @@ config OMAP_MCBSP
...
@@ -104,6 +104,14 @@ config OMAP_MCBSP
Say Y here if you want support for the OMAP Multichannel
Say Y here if you want support for the OMAP Multichannel
Buffered Serial Port.
Buffered Serial Port.
config OMAP_MBOX_FWK
tristate "Mailbox framework support"
depends on ARCH_OMAP
default n
help
Say Y here if you want to use OMAP Mailbox framework support for
DSP, IVA1.0 and IVA2 in OMAP1/2/3.
choice
choice
prompt "System timer"
prompt "System timer"
default OMAP_MPU_TIMER
default OMAP_MPU_TIMER
...
...
arch/arm/plat-omap/include/mach/omap34xx.h
浏览文件 @
6c20a683
...
@@ -61,6 +61,7 @@
...
@@ -61,6 +61,7 @@
#define OMAP2_CM_BASE OMAP3430_CM_BASE
#define OMAP2_CM_BASE OMAP3430_CM_BASE
#define OMAP2_PRM_BASE OMAP3430_PRM_BASE
#define OMAP2_PRM_BASE OMAP3430_PRM_BASE
#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP34XX_IC_BASE)
#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP34XX_IC_BASE)
#define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000)
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录