summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorPuneet Saxena <puneets@nvidia.com>2018-03-01 05:32:31 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-04-02 01:33:00 -0400
commitd2c3fc38fb4afcb34503e121ccc1acda00c56dcd (patch)
treede987440978e29bb7e80e9c8224b8cfcd49151ca /include/linux
parent22f214a65cf48d10e84392f03d630366bb6a2df7 (diff)
video: tegra: nvmap: add runtime busy/idle calls
CVSRAM falls under cvnas cluster. nvmap_alloc/free from cvsram heap requires CV rail to be power ungated/gated. Presently CV rail is always on/not power gated as CVNAS power gating is called from driver remove and cvnas driver is statically loaded The change registers runtime cvnas busy/idle callbacks at cvsram carveout creation. It exports CVNAS power gate(nvcvnas_idle()) and CVNAS power ungate(nvcvnas_busy). The callbacks are used during nvmap_alloc/free from CVSRAM. Bug 200383595 Change-Id: I545c18ea7bcf61bb6356e2d6d05c2f4f9b1f5368 Signed-off-by: Puneet Saxena <puneets@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1666574 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nvmap.h16
-rw-r--r--include/linux/nvmap_t19x.h5
2 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/nvmap.h b/include/linux/nvmap.h
index 1b8020e9b..6e441aad8 100644
--- a/include/linux/nvmap.h
+++ b/include/linux/nvmap.h
@@ -69,6 +69,21 @@ ulong nvmap_iovmm_get_used_pages(void);
69int nvmap_register_vidmem_carveout(struct device *dma_dev, 69int nvmap_register_vidmem_carveout(struct device *dma_dev,
70 phys_addr_t base, size_t size); 70 phys_addr_t base, size_t size);
71 71
72/*
73 * A heap can be mapped to memory other than DRAM.
74 * The HW, controls the memory, can be power gated/ungated
75 * based upon the clients using the memory.
76 * if no client/alloc happens from the memory, the HW needs
77 * to be power gated. Similarly it should power ungated if
78 * alloc happens from the memory.
79 * int (*busy)(void) - trigger runtime power ungate
80 * int (*idle)(void) - trigger runtime power gate
81 */
82struct nvmap_pm_ops {
83 int (*busy)(void);
84 int (*idle)(void);
85};
86
72struct nvmap_platform_carveout { 87struct nvmap_platform_carveout {
73 const char *name; 88 const char *name;
74 unsigned int usage_mask; 89 unsigned int usage_mask;
@@ -87,6 +102,7 @@ struct nvmap_platform_carveout {
87 bool disable_dynamic_dma_map; 102 bool disable_dynamic_dma_map;
88 bool no_cpu_access; /* carveout can't be accessed from cpu at all */ 103 bool no_cpu_access; /* carveout can't be accessed from cpu at all */
89 bool init_done; /* FIXME: remove once all caveouts use reserved-memory */ 104 bool init_done; /* FIXME: remove once all caveouts use reserved-memory */
105 struct nvmap_pm_ops pm_ops;
90}; 106};
91 107
92struct nvmap_platform_data { 108struct nvmap_platform_data {
diff --git a/include/linux/nvmap_t19x.h b/include/linux/nvmap_t19x.h
index 86e7271e3..0820e0618 100644
--- a/include/linux/nvmap_t19x.h
+++ b/include/linux/nvmap_t19x.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * structure declarations for nvmem and nvmap user-space ioctls 4 * structure declarations for nvmem and nvmap user-space ioctls
5 * 5 *
6 * Copyright (c) 2009-2017, NVIDIA CORPORATION. All rights reserved. 6 * Copyright (c) 2009-2018, NVIDIA CORPORATION. All rights reserved.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License, 9 * under the terms and conditions of the GNU General Public License,
@@ -25,7 +25,8 @@
25#define NVMAP_HEAP_CARVEOUT_GOS (1ul<<24) 25#define NVMAP_HEAP_CARVEOUT_GOS (1ul<<24)
26 26
27int nvmap_register_cvsram_carveout(struct device *dma_dev, 27int nvmap_register_cvsram_carveout(struct device *dma_dev,
28 phys_addr_t base, size_t size); 28 phys_addr_t base, size_t size,
29 int (*pmops_busy)(void), int (*pmops_idle)(void));
29 30
30struct cv_dev_info { 31struct cv_dev_info {
31 struct device_node *np; 32 struct device_node *np;