Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
e653034e
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e653034e
编写于
3月 20, 2009
作者:
K
Kevin Hilman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
davinci: add runtime CPU detection support
Signed-off-by:
N
Kevin Hilman
<
khilman@deeprootsystems.com
>
上级
9232fcc9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
75 addition
and
3 deletion
+75
-3
arch/arm/mach-davinci/id.c
arch/arm/mach-davinci/id.c
+26
-3
arch/arm/mach-davinci/include/mach/cputype.h
arch/arm/mach-davinci/include/mach/cputype.h
+49
-0
未找到文件。
arch/arm/mach-davinci/id.c
浏览文件 @
e653034e
...
...
@@ -17,6 +17,8 @@
#define JTAG_ID_BASE 0x01c40028
static
unsigned
int
davinci_revision
;
struct
davinci_id
{
u8
variant
;
/* JTAG ID bits 31:28 */
u16
part_no
;
/* JTAG ID bits 27:12 */
...
...
@@ -33,6 +35,20 @@ static struct davinci_id davinci_ids[] __initdata = {
.
manufacturer
=
0x017
,
.
type
=
0x64460000
,
},
{
/* DM646X */
.
part_no
=
0xb770
,
.
variant
=
0x0
,
.
manufacturer
=
0x017
,
.
type
=
0x64670000
,
},
{
/* DM355 */
.
part_no
=
0xb73b
,
.
variant
=
0x0
,
.
manufacturer
=
0x00f
,
.
type
=
0x03550000
,
},
};
/*
...
...
@@ -63,6 +79,12 @@ static u8 __init davinci_get_variant(void)
return
variant
;
}
unsigned
int
davinci_rev
(
void
)
{
return
davinci_revision
>>
16
;
}
EXPORT_SYMBOL
(
davinci_rev
);
void
__init
davinci_check_revision
(
void
)
{
int
i
;
...
...
@@ -75,7 +97,7 @@ void __init davinci_check_revision(void)
/* First check only the major version in a safe way */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
davinci_ids
);
i
++
)
{
if
(
part_no
==
(
davinci_ids
[
i
].
part_no
))
{
system_rev
=
davinci_ids
[
i
].
type
;
davinci_revision
=
davinci_ids
[
i
].
type
;
break
;
}
}
...
...
@@ -84,10 +106,11 @@ void __init davinci_check_revision(void)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
davinci_ids
);
i
++
)
{
if
(
part_no
==
davinci_ids
[
i
].
part_no
&&
variant
==
davinci_ids
[
i
].
variant
)
{
system_rev
=
davinci_ids
[
i
].
type
;
davinci_revision
=
davinci_ids
[
i
].
type
;
break
;
}
}
printk
(
"DaVinci DM%04x variant 0x%x
\n
"
,
system_rev
>>
16
,
variant
);
printk
(
KERN_INFO
"DaVinci DM%04x variant 0x%x
\n
"
,
davinci_rev
(),
variant
);
}
arch/arm/mach-davinci/include/mach/cputype.h
0 → 100644
浏览文件 @
e653034e
/*
* DaVinci CPU type detection
*
* Author: Kevin Hilman, Deep Root Systems, LLC
*
* Defines the cpu_is_*() macros for runtime detection of DaVinci
* device type. In addtion, if support for a given device is not
* compiled in to the kernel, the macros return 0 so that
* resulting code can be optimized out.
*
* 2009 (c) Deep Root Systems, LLC. 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.
*/
#ifndef _ASM_ARCH_CPU_H
#define _ASM_ARCH_CPU_H
extern
unsigned
int
davinci_rev
(
void
);
#define IS_DAVINCI_CPU(type, id) \
static inline int is_davinci_dm ##type(void) \
{ \
return (davinci_rev() == (id)) ? 1 : 0; \
}
IS_DAVINCI_CPU
(
644
x
,
0x6446
)
IS_DAVINCI_CPU
(
646
x
,
0x6467
)
IS_DAVINCI_CPU
(
355
,
0x355
)
#ifdef CONFIG_ARCH_DAVINCI_DM644x
#define cpu_is_davinci_dm644x() is_davinci_dm644x()
#else
#define cpu_is_davinci_dm644x() 0
#endif
#ifdef CONFIG_ARCH_DAVINCI_DM646x
#define cpu_is_davinci_dm646x() is_davinci_dm646x()
#else
#define cpu_is_davinci_dm646x() 0
#endif
#ifdef CONFIG_ARCH_DAVINCI_DM355
#define cpu_is_davinci_dm355() is_davinci_dm355()
#else
#define cpu_is_davinci_dm355() 0
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录