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
ca3190e3
Commit
ca3190e3
authored
Jan 15, 2020
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/flcn: move bind_context WAR out of common code
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
fb0a5bbe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
39 deletions
+45
-39
drivers/gpu/drm/nouveau/include/nvkm/core/falcon.h
drivers/gpu/drm/nouveau/include/nvkm/core/falcon.h
+2
-0
drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp102.c
drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp102.c
+41
-1
drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c
drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c
+1
-1
drivers/gpu/drm/nouveau/nvkm/falcon/v1.c
drivers/gpu/drm/nouveau/nvkm/falcon/v1.c
+0
-36
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gv100.c
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gv100.c
+1
-1
No files found.
drivers/gpu/drm/nouveau/include/nvkm/core/falcon.h
View file @
ca3190e3
...
@@ -17,4 +17,6 @@ void nvkm_falcon_v1_set_start_addr(struct nvkm_falcon *, u32 start_addr);
...
@@ -17,4 +17,6 @@ void nvkm_falcon_v1_set_start_addr(struct nvkm_falcon *, u32 start_addr);
void
nvkm_falcon_v1_start
(
struct
nvkm_falcon
*
);
void
nvkm_falcon_v1_start
(
struct
nvkm_falcon
*
);
int
nvkm_falcon_v1_enable
(
struct
nvkm_falcon
*
);
int
nvkm_falcon_v1_enable
(
struct
nvkm_falcon
*
);
void
nvkm_falcon_v1_disable
(
struct
nvkm_falcon
*
);
void
nvkm_falcon_v1_disable
(
struct
nvkm_falcon
*
);
void
gp102_sec2_flcn_bind_context
(
struct
nvkm_falcon
*
,
struct
nvkm_memory
*
);
#endif
#endif
drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp102.c
View file @
ca3190e3
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
*/
*/
#include "priv.h"
#include "priv.h"
#include <subdev/acr.h>
#include <subdev/acr.h>
#include <subdev/timer.h>
static
const
struct
nvkm_acr_lsf_func
static
const
struct
nvkm_acr_lsf_func
gp102_sec2_acr_0
=
{
gp102_sec2_acr_0
=
{
...
@@ -46,13 +47,52 @@ gp102_sec2_intr(struct nvkm_sec2 *sec2)
...
@@ -46,13 +47,52 @@ gp102_sec2_intr(struct nvkm_sec2 *sec2)
}
}
}
}
void
gp102_sec2_flcn_bind_context
(
struct
nvkm_falcon
*
falcon
,
struct
nvkm_memory
*
ctx
)
{
struct
nvkm_device
*
device
=
falcon
->
owner
->
device
;
nvkm_falcon_v1_bind_context
(
falcon
,
ctx
);
if
(
!
ctx
)
return
;
/* Not sure if this is a WAR for a HW issue, or some additional
* programming sequence that's needed to properly complete the
* context switch we trigger above.
*
* Fixes unreliability of booting the SEC2 RTOS on Quadro P620,
* particularly when resuming from suspend.
*
* Also removes the need for an odd workaround where we needed
* to program SEC2's FALCON_CPUCTL_ALIAS_STARTCPU twice before
* the SEC2 RTOS would begin executing.
*/
nvkm_msec
(
device
,
10
,
u32
irqstat
=
nvkm_falcon_rd32
(
falcon
,
0x008
);
u32
flcn0dc
=
nvkm_falcon_rd32
(
falcon
,
0x0dc
);
if
((
irqstat
&
0x00000008
)
&&
(
flcn0dc
&
0x00007000
)
==
0x00005000
)
break
;
);
nvkm_falcon_mask
(
falcon
,
0x004
,
0x00000008
,
0x00000008
);
nvkm_falcon_mask
(
falcon
,
0x058
,
0x00000002
,
0x00000002
);
nvkm_msec
(
device
,
10
,
u32
flcn0dc
=
nvkm_falcon_rd32
(
falcon
,
0x0dc
);
if
((
flcn0dc
&
0x00007000
)
==
0x00000000
)
break
;
);
}
static
const
struct
nvkm_falcon_func
static
const
struct
nvkm_falcon_func
gp102_sec2_flcn
=
{
gp102_sec2_flcn
=
{
.
fbif
=
0x600
,
.
fbif
=
0x600
,
.
load_imem
=
nvkm_falcon_v1_load_imem
,
.
load_imem
=
nvkm_falcon_v1_load_imem
,
.
load_dmem
=
nvkm_falcon_v1_load_dmem
,
.
load_dmem
=
nvkm_falcon_v1_load_dmem
,
.
read_dmem
=
nvkm_falcon_v1_read_dmem
,
.
read_dmem
=
nvkm_falcon_v1_read_dmem
,
.
bind_context
=
nvkm_falcon_v1
_bind_context
,
.
bind_context
=
gp102_sec2_flcn
_bind_context
,
.
wait_for_halt
=
nvkm_falcon_v1_wait_for_halt
,
.
wait_for_halt
=
nvkm_falcon_v1_wait_for_halt
,
.
clear_interrupt
=
nvkm_falcon_v1_clear_interrupt
,
.
clear_interrupt
=
nvkm_falcon_v1_clear_interrupt
,
.
set_start_addr
=
nvkm_falcon_v1_set_start_addr
,
.
set_start_addr
=
nvkm_falcon_v1_set_start_addr
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c
View file @
ca3190e3
...
@@ -27,7 +27,7 @@ tu102_sec2_flcn = {
...
@@ -27,7 +27,7 @@ tu102_sec2_flcn = {
.
load_imem
=
nvkm_falcon_v1_load_imem
,
.
load_imem
=
nvkm_falcon_v1_load_imem
,
.
load_dmem
=
nvkm_falcon_v1_load_dmem
,
.
load_dmem
=
nvkm_falcon_v1_load_dmem
,
.
read_dmem
=
nvkm_falcon_v1_read_dmem
,
.
read_dmem
=
nvkm_falcon_v1_read_dmem
,
.
bind_context
=
nvkm_falcon_v1
_bind_context
,
.
bind_context
=
gp102_sec2_flcn
_bind_context
,
.
wait_for_halt
=
nvkm_falcon_v1_wait_for_halt
,
.
wait_for_halt
=
nvkm_falcon_v1_wait_for_halt
,
.
clear_interrupt
=
nvkm_falcon_v1_clear_interrupt
,
.
clear_interrupt
=
nvkm_falcon_v1_clear_interrupt
,
.
set_start_addr
=
nvkm_falcon_v1_set_start_addr
,
.
set_start_addr
=
nvkm_falcon_v1_set_start_addr
,
...
...
drivers/gpu/drm/nouveau/nvkm/falcon/v1.c
View file @
ca3190e3
...
@@ -182,7 +182,6 @@ nvkm_falcon_v1_read_dmem(struct nvkm_falcon *falcon, u32 start, u32 size,
...
@@ -182,7 +182,6 @@ nvkm_falcon_v1_read_dmem(struct nvkm_falcon *falcon, u32 start, u32 size,
void
void
nvkm_falcon_v1_bind_context
(
struct
nvkm_falcon
*
falcon
,
struct
nvkm_memory
*
ctx
)
nvkm_falcon_v1_bind_context
(
struct
nvkm_falcon
*
falcon
,
struct
nvkm_memory
*
ctx
)
{
{
struct
nvkm_device
*
device
=
falcon
->
owner
->
device
;
const
u32
fbif
=
falcon
->
func
->
fbif
;
const
u32
fbif
=
falcon
->
func
->
fbif
;
u32
inst_loc
;
u32
inst_loc
;
...
@@ -220,41 +219,6 @@ nvkm_falcon_v1_bind_context(struct nvkm_falcon *falcon, struct nvkm_memory *ctx)
...
@@ -220,41 +219,6 @@ nvkm_falcon_v1_bind_context(struct nvkm_falcon *falcon, struct nvkm_memory *ctx)
nvkm_falcon_mask
(
falcon
,
0x090
,
0x10000
,
0x10000
);
nvkm_falcon_mask
(
falcon
,
0x090
,
0x10000
,
0x10000
);
nvkm_falcon_mask
(
falcon
,
0x0a4
,
0x8
,
0x8
);
nvkm_falcon_mask
(
falcon
,
0x0a4
,
0x8
,
0x8
);
/* Not sure if this is a WAR for a HW issue, or some additional
* programming sequence that's needed to properly complete the
* context switch we trigger above.
*
* Fixes unreliability of booting the SEC2 RTOS on Quadro P620,
* particularly when resuming from suspend.
*
* Also removes the need for an odd workaround where we needed
* to program SEC2's FALCON_CPUCTL_ALIAS_STARTCPU twice before
* the SEC2 RTOS would begin executing.
*/
switch
(
falcon
->
owner
->
index
)
{
case
NVKM_SUBDEV_GSP
:
case
NVKM_ENGINE_SEC2
:
nvkm_msec
(
device
,
10
,
u32
irqstat
=
nvkm_falcon_rd32
(
falcon
,
0x008
);
u32
flcn0dc
=
nvkm_falcon_rd32
(
falcon
,
0x0dc
);
if
((
irqstat
&
0x00000008
)
&&
(
flcn0dc
&
0x00007000
)
==
0x00005000
)
break
;
);
nvkm_falcon_mask
(
falcon
,
0x004
,
0x00000008
,
0x00000008
);
nvkm_falcon_mask
(
falcon
,
0x058
,
0x00000002
,
0x00000002
);
nvkm_msec
(
device
,
10
,
u32
flcn0dc
=
nvkm_falcon_rd32
(
falcon
,
0x0dc
);
if
((
flcn0dc
&
0x00007000
)
==
0x00000000
)
break
;
);
break
;
default:
break
;
}
}
}
void
void
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gv100.c
View file @
ca3190e3
...
@@ -27,7 +27,7 @@ gv100_gsp_flcn = {
...
@@ -27,7 +27,7 @@ gv100_gsp_flcn = {
.
load_imem
=
nvkm_falcon_v1_load_imem
,
.
load_imem
=
nvkm_falcon_v1_load_imem
,
.
load_dmem
=
nvkm_falcon_v1_load_dmem
,
.
load_dmem
=
nvkm_falcon_v1_load_dmem
,
.
read_dmem
=
nvkm_falcon_v1_read_dmem
,
.
read_dmem
=
nvkm_falcon_v1_read_dmem
,
.
bind_context
=
nvkm_falcon_v1
_bind_context
,
.
bind_context
=
gp102_sec2_flcn
_bind_context
,
.
wait_for_halt
=
nvkm_falcon_v1_wait_for_halt
,
.
wait_for_halt
=
nvkm_falcon_v1_wait_for_halt
,
.
clear_interrupt
=
nvkm_falcon_v1_clear_interrupt
,
.
clear_interrupt
=
nvkm_falcon_v1_clear_interrupt
,
.
set_start_addr
=
nvkm_falcon_v1_set_start_addr
,
.
set_start_addr
=
nvkm_falcon_v1_set_start_addr
,
...
...
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