提交 bc3cfd18 编写于 作者: B Ben Skeggs

drm/nouveau/flcn: specify EMEM address from subdev

Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 ca3190e3
...@@ -30,7 +30,6 @@ struct nvkm_falcon { ...@@ -30,7 +30,6 @@ struct nvkm_falcon {
u8 version; u8 version;
u8 secret; u8 secret;
bool debug; bool debug;
bool has_emem;
struct nvkm_memory *core; struct nvkm_memory *core;
bool external; bool external;
...@@ -84,6 +83,7 @@ struct nvkm_falcon_func { ...@@ -84,6 +83,7 @@ struct nvkm_falcon_func {
void (*load_imem)(struct nvkm_falcon *, void *, u32, u32, u16, u8, bool); void (*load_imem)(struct nvkm_falcon *, void *, u32, u32, u16, u8, bool);
void (*load_dmem)(struct nvkm_falcon *, void *, u32, u32, u8); void (*load_dmem)(struct nvkm_falcon *, void *, u32, u32, u8);
void (*read_dmem)(struct nvkm_falcon *, u32, u32, u8, void *); void (*read_dmem)(struct nvkm_falcon *, u32, u32, u8, void *);
u32 emem_addr;
void (*bind_context)(struct nvkm_falcon *, struct nvkm_memory *); void (*bind_context)(struct nvkm_falcon *, struct nvkm_memory *);
int (*wait_for_halt)(struct nvkm_falcon *, u32); int (*wait_for_halt)(struct nvkm_falcon *, u32);
int (*clear_interrupt)(struct nvkm_falcon *, u32); int (*clear_interrupt)(struct nvkm_falcon *, u32);
......
...@@ -92,6 +92,7 @@ gp102_sec2_flcn = { ...@@ -92,6 +92,7 @@ gp102_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,
.emem_addr = 0x01000000,
.bind_context = gp102_sec2_flcn_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,
......
...@@ -27,6 +27,7 @@ tu102_sec2_flcn = { ...@@ -27,6 +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,
.emem_addr = 0x01000000,
.bind_context = gp102_sec2_flcn_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,
......
...@@ -170,7 +170,6 @@ nvkm_falcon_oneinit(struct nvkm_falcon *falcon) ...@@ -170,7 +170,6 @@ nvkm_falcon_oneinit(struct nvkm_falcon *falcon)
break; break;
case NVKM_ENGINE_SEC2: case NVKM_ENGINE_SEC2:
debug_reg = 0x408; debug_reg = 0x408;
falcon->has_emem = true;
break; break;
case NVKM_SUBDEV_GSP: case NVKM_SUBDEV_GSP:
debug_reg = 0x0; /*XXX*/ debug_reg = 0x0; /*XXX*/
......
...@@ -89,18 +89,17 @@ nvkm_falcon_v1_load_emem(struct nvkm_falcon *falcon, void *data, u32 start, ...@@ -89,18 +89,17 @@ nvkm_falcon_v1_load_emem(struct nvkm_falcon *falcon, void *data, u32 start,
} }
} }
static const u32 EMEM_START_ADDR = 0x1000000;
void void
nvkm_falcon_v1_load_dmem(struct nvkm_falcon *falcon, void *data, u32 start, nvkm_falcon_v1_load_dmem(struct nvkm_falcon *falcon, void *data, u32 start,
u32 size, u8 port) u32 size, u8 port)
{ {
const struct nvkm_falcon_func *func = falcon->func;
u8 rem = size % 4; u8 rem = size % 4;
int i; int i;
if (start >= EMEM_START_ADDR && falcon->has_emem) if (func->emem_addr && start >= func->emem_addr)
return nvkm_falcon_v1_load_emem(falcon, data, return nvkm_falcon_v1_load_emem(falcon, data,
start - EMEM_START_ADDR, size, start - func->emem_addr, size,
port); port);
size -= rem; size -= rem;
...@@ -152,11 +151,12 @@ void ...@@ -152,11 +151,12 @@ void
nvkm_falcon_v1_read_dmem(struct nvkm_falcon *falcon, u32 start, u32 size, nvkm_falcon_v1_read_dmem(struct nvkm_falcon *falcon, u32 start, u32 size,
u8 port, void *data) u8 port, void *data)
{ {
const struct nvkm_falcon_func *func = falcon->func;
u8 rem = size % 4; u8 rem = size % 4;
int i; int i;
if (start >= EMEM_START_ADDR && falcon->has_emem) if (func->emem_addr && start >= func->emem_addr)
return nvkm_falcon_v1_read_emem(falcon, start - EMEM_START_ADDR, return nvkm_falcon_v1_read_emem(falcon, start - func->emem_addr,
size, port, data); size, port, data);
size -= rem; size -= rem;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册