Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
d8f266a3
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
d8f266a3
编写于
8月 20, 2015
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/bios: switch to device pri macros
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
9155c162
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
38 addition
and
30 deletion
+38
-30
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c
+7
-4
drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c
drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c
+4
-3
drivers/gpu/drm/nouveau/nvkm/subdev/bios/ramcfg.c
drivers/gpu/drm/nouveau/nvkm/subdev/bios/ramcfg.c
+1
-1
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c
+14
-11
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
+12
-11
未找到文件。
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c
浏览文件 @
d8f266a3
...
...
@@ -180,27 +180,30 @@ init_nvreg(struct nvbios_init *init, u32 reg)
static
u32
init_rd32
(
struct
nvbios_init
*
init
,
u32
reg
)
{
struct
nvkm_device
*
device
=
init
->
bios
->
subdev
.
device
;
reg
=
init_nvreg
(
init
,
reg
);
if
(
reg
!=
~
0
&&
init_exec
(
init
))
return
nv
_rd32
(
init
->
subdev
,
reg
);
return
nv
km_rd32
(
device
,
reg
);
return
0x00000000
;
}
static
void
init_wr32
(
struct
nvbios_init
*
init
,
u32
reg
,
u32
val
)
{
struct
nvkm_device
*
device
=
init
->
bios
->
subdev
.
device
;
reg
=
init_nvreg
(
init
,
reg
);
if
(
reg
!=
~
0
&&
init_exec
(
init
))
nv
_wr32
(
init
->
subdev
,
reg
,
val
);
nv
km_wr32
(
device
,
reg
,
val
);
}
static
u32
init_mask
(
struct
nvbios_init
*
init
,
u32
reg
,
u32
mask
,
u32
val
)
{
struct
nvkm_device
*
device
=
init
->
bios
->
subdev
.
device
;
reg
=
init_nvreg
(
init
,
reg
);
if
(
reg
!=
~
0
&&
init_exec
(
init
))
{
u32
tmp
=
nv
_rd32
(
init
->
subdev
,
reg
);
nv
_wr32
(
init
->
subdev
,
reg
,
(
tmp
&
~
mask
)
|
val
);
u32
tmp
=
nv
km_rd32
(
device
,
reg
);
nv
km_wr32
(
device
,
reg
,
(
tmp
&
~
mask
)
|
val
);
return
tmp
;
}
return
0x00000000
;
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c
浏览文件 @
d8f266a3
...
...
@@ -221,6 +221,7 @@ pll_map_type(struct nvkm_bios *bios, u8 type, u32 *reg, u8 *ver, u8 *len)
int
nvbios_pll_parse
(
struct
nvkm_bios
*
bios
,
u32
type
,
struct
nvbios_pll
*
info
)
{
struct
nvkm_device
*
device
=
bios
->
subdev
.
device
;
u8
ver
,
len
;
u32
reg
=
type
;
u16
data
;
...
...
@@ -360,9 +361,9 @@ nvbios_pll_parse(struct nvkm_bios *bios, u32 type, struct nvbios_pll *info)
}
if
(
!
info
->
refclk
)
{
info
->
refclk
=
nv_device
(
bios
)
->
crystal
;
info
->
refclk
=
device
->
crystal
;
if
(
bios
->
version
.
chip
==
0x51
)
{
u32
sel_clk
=
nv
_rd32
(
bios
,
0x680524
);
u32
sel_clk
=
nv
km_rd32
(
device
,
0x680524
);
if
((
info
->
reg
==
0x680508
&&
sel_clk
&
0x20
)
||
(
info
->
reg
==
0x680520
&&
sel_clk
&
0x80
))
{
if
(
nv_rdvgac
(
bios
,
0
,
0x27
)
<
0xa3
)
...
...
@@ -392,7 +393,7 @@ nvbios_pll_parse(struct nvkm_bios *bios, u32 type, struct nvbios_pll *info)
info
->
vco1
.
max_n
=
0xff
;
info
->
vco1
.
min_m
=
0x1
;
if
(
nv_device
(
bios
)
->
crystal
==
13500
)
{
if
(
device
->
crystal
==
13500
)
{
/* nv05 does this, nv11 doesn't, nv10 unknown */
if
(
bios
->
version
.
chip
<
0x11
)
info
->
vco1
.
min_m
=
0x7
;
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/bios/ramcfg.c
浏览文件 @
d8f266a3
...
...
@@ -29,7 +29,7 @@
static
u8
nvbios_ramcfg_strap
(
struct
nvkm_subdev
*
subdev
)
{
return
(
nv
_rd32
(
subdev
,
0x101000
)
&
0x0000003c
)
>>
2
;
return
(
nv
km_rd32
(
subdev
->
device
,
0x101000
)
&
0x0000003c
)
>>
2
;
}
u8
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c
浏览文件 @
d8f266a3
...
...
@@ -30,10 +30,11 @@ struct priv {
static
u32
pramin_read
(
void
*
data
,
u32
offset
,
u32
length
,
struct
nvkm_bios
*
bios
)
{
struct
nvkm_device
*
device
=
bios
->
subdev
.
device
;
u32
i
;
if
(
offset
+
length
<=
0x00100000
)
{
for
(
i
=
offset
;
i
<
offset
+
length
;
i
+=
4
)
*
(
u32
*
)
&
bios
->
data
[
i
]
=
nv
_rd32
(
bios
,
0x700000
+
i
);
*
(
u32
*
)
&
bios
->
data
[
i
]
=
nv
km_rd32
(
device
,
0x700000
+
i
);
return
length
;
}
return
0
;
...
...
@@ -44,7 +45,8 @@ pramin_fini(void *data)
{
struct
priv
*
priv
=
data
;
if
(
priv
)
{
nv_wr32
(
priv
->
bios
,
0x001700
,
priv
->
bar0
);
struct
nvkm_device
*
device
=
priv
->
bios
->
subdev
.
device
;
nvkm_wr32
(
device
,
0x001700
,
priv
->
bar0
);
kfree
(
priv
);
}
}
...
...
@@ -52,19 +54,20 @@ pramin_fini(void *data)
static
void
*
pramin_init
(
struct
nvkm_bios
*
bios
,
const
char
*
name
)
{
struct
nvkm_device
*
device
=
bios
->
subdev
.
device
;
struct
priv
*
priv
=
NULL
;
u64
addr
=
0
;
/* PRAMIN always potentially available prior to nv50 */
if
(
nv_device
(
bios
)
->
card_type
<
NV_50
)
if
(
device
->
card_type
<
NV_50
)
return
NULL
;
/* we can't get the bios image pointer without PDISP */
if
(
nv_device
(
bios
)
->
card_type
>=
GM100
)
addr
=
nv
_rd32
(
bios
,
0x021c04
);
if
(
device
->
card_type
>=
GM100
)
addr
=
nv
km_rd32
(
device
,
0x021c04
);
else
if
(
nv_device
(
bios
)
->
card_type
>=
NV_C0
)
addr
=
nv
_rd32
(
bios
,
0x022500
);
if
(
device
->
card_type
>=
NV_C0
)
addr
=
nv
km_rd32
(
device
,
0x022500
);
if
(
addr
&
0x00000001
)
{
nv_debug
(
bios
,
"... display disabled
\n
"
);
return
ERR_PTR
(
-
ENODEV
);
...
...
@@ -74,7 +77,7 @@ pramin_init(struct nvkm_bios *bios, const char *name)
* important as we don't want to be touching vram on an
* uninitialised board
*/
addr
=
nv
_rd32
(
bios
,
0x619f04
);
addr
=
nv
km_rd32
(
device
,
0x619f04
);
if
(
!
(
addr
&
0x00000008
))
{
nv_debug
(
bios
,
"... not enabled
\n
"
);
return
ERR_PTR
(
-
ENODEV
);
...
...
@@ -87,7 +90,7 @@ pramin_init(struct nvkm_bios *bios, const char *name)
/* some alternate method inherited from xf86-video-nv... */
addr
=
(
addr
&
0xffffff00
)
<<
8
;
if
(
!
addr
)
{
addr
=
(
u64
)
nv
_rd32
(
bios
,
0x001700
)
<<
16
;
addr
=
(
u64
)
nv
km_rd32
(
device
,
0x001700
)
<<
16
;
addr
+=
0xf0000
;
}
...
...
@@ -98,8 +101,8 @@ pramin_init(struct nvkm_bios *bios, const char *name)
}
priv
->
bios
=
bios
;
priv
->
bar0
=
nv
_rd32
(
bios
,
0x001700
);
nv
_wr32
(
bios
,
0x001700
,
addr
>>
16
);
priv
->
bar0
=
nv
km_rd32
(
device
,
0x001700
);
nv
km_wr32
(
device
,
0x001700
,
addr
>>
16
);
return
priv
;
}
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
浏览文件 @
d8f266a3
...
...
@@ -25,10 +25,11 @@
static
u32
prom_read
(
void
*
data
,
u32
offset
,
u32
length
,
struct
nvkm_bios
*
bios
)
{
struct
nvkm_device
*
device
=
data
;
u32
i
;
if
(
offset
+
length
<=
0x00100000
)
{
for
(
i
=
offset
;
i
<
offset
+
length
;
i
+=
4
)
*
(
u32
*
)
&
bios
->
data
[
i
]
=
nv
_rd32
(
bios
,
0x300000
+
i
);
*
(
u32
*
)
&
bios
->
data
[
i
]
=
nv
km_rd32
(
device
,
0x300000
+
i
);
return
length
;
}
return
0
;
...
...
@@ -37,25 +38,25 @@ prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
static
void
prom_fini
(
void
*
data
)
{
struct
nvkm_
bios
*
bios
=
data
;
if
(
nv_device
(
bios
)
->
card_type
<
NV_50
)
nv
_mask
(
bios
,
0x001850
,
0x00000001
,
0x00000001
);
struct
nvkm_
device
*
device
=
data
;
if
(
device
->
card_type
<
NV_50
)
nv
km_mask
(
device
,
0x001850
,
0x00000001
,
0x00000001
);
else
nv
_mask
(
bios
,
0x088050
,
0x00000001
,
0x00000001
);
nv
km_mask
(
device
,
0x088050
,
0x00000001
,
0x00000001
);
}
static
void
*
prom_init
(
struct
nvkm_bios
*
bios
,
const
char
*
name
)
{
if
(
nv_device
(
bios
)
->
card_type
<
NV_50
)
{
if
(
nv_device
(
bios
)
->
card_type
==
NV_40
&&
nv_device
(
bios
)
->
chipset
>=
0x4c
)
struct
nvkm_device
*
device
=
bios
->
subdev
.
device
;
if
(
device
->
card_type
<
NV_50
)
{
if
(
device
->
card_type
==
NV_40
&&
device
->
chipset
>=
0x4c
)
return
ERR_PTR
(
-
ENODEV
);
nv
_mask
(
bios
,
0x001850
,
0x00000001
,
0x00000000
);
nv
km_mask
(
device
,
0x001850
,
0x00000001
,
0x00000000
);
}
else
{
nv
_mask
(
bios
,
0x088050
,
0x00000001
,
0x00000000
);
nv
km_mask
(
device
,
0x088050
,
0x00000001
,
0x00000000
);
}
return
bios
;
return
device
;
}
const
struct
nvbios_source
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录