diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 21 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 3 |
2 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index b7872e73..12c36d33 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1316,6 +1316,21 @@ static int gk20a_pm_init(struct platform_device *dev) | |||
1316 | return err; | 1316 | return err; |
1317 | } | 1317 | } |
1318 | 1318 | ||
1319 | int gk20a_secure_page_alloc(struct platform_device *pdev) | ||
1320 | { | ||
1321 | struct gk20a_platform *platform = platform_get_drvdata(pdev); | ||
1322 | int err = 0; | ||
1323 | |||
1324 | if (platform->secure_page_alloc) { | ||
1325 | tegra_periph_reset_assert(platform->clk[0]); | ||
1326 | udelay(10); | ||
1327 | err = platform->secure_page_alloc(pdev); | ||
1328 | tegra_periph_reset_deassert(platform->clk[0]); | ||
1329 | } | ||
1330 | |||
1331 | return err; | ||
1332 | } | ||
1333 | |||
1319 | static int gk20a_probe(struct platform_device *dev) | 1334 | static int gk20a_probe(struct platform_device *dev) |
1320 | { | 1335 | { |
1321 | struct gk20a *gk20a; | 1336 | struct gk20a *gk20a; |
@@ -1414,6 +1429,12 @@ static int gk20a_probe(struct platform_device *dev) | |||
1414 | } | 1429 | } |
1415 | } | 1430 | } |
1416 | 1431 | ||
1432 | err = gk20a_secure_page_alloc(dev); | ||
1433 | if (err) { | ||
1434 | dev_err(&dev->dev, "failed to allocate secure buffer\n"); | ||
1435 | return err; | ||
1436 | } | ||
1437 | |||
1417 | gk20a_debug_init(dev); | 1438 | gk20a_debug_init(dev); |
1418 | 1439 | ||
1419 | /* Set DMA parameters to allow larger sgt lists */ | 1440 | /* Set DMA parameters to allow larger sgt lists */ |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index f3e82243..0e178e9e 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -2348,6 +2348,9 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) | |||
2348 | &gr->global_ctx_buffer[ATTRIBUTE_VPR], | 2348 | &gr->global_ctx_buffer[ATTRIBUTE_VPR], |
2349 | attr_buffer_size); | 2349 | attr_buffer_size); |
2350 | 2350 | ||
2351 | if (platform->secure_buffer.destroy) | ||
2352 | platform->secure_buffer.destroy(pdev, &platform->secure_buffer); | ||
2353 | |||
2351 | gk20a_dbg_info("golden_image_size : %d", | 2354 | gk20a_dbg_info("golden_image_size : %d", |
2352 | gr->ctx_vars.golden_image_size); | 2355 | gr->ctx_vars.golden_image_size); |
2353 | 2356 | ||