gpu: nvgpu: Add support for XPU rail split

Check if CPU/GPU rails are joint, disable railgating if they are.
Add the DT support for T194 and T186 platforms.

Disable railgate_enable sysfs node update in the above condition.

Bug 200546450
Bug 200545711

Change-Id: I002488f6418805569b0ef0fc3032b58297adeafb
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2185221
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Tested-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Debarshi Dutta
2019-08-28 12:09:25 +05:30
committed by mobile promotions
parent d601ff5159
commit 1d532589b0
4 changed files with 34 additions and 1 deletions

View File

@@ -259,13 +259,19 @@ static ssize_t railgate_enable_store(struct device *dev,
unsigned long railgate_enable = 0;
/* dev is guaranteed to be valid here. Ok to de-reference */
struct gk20a *g = get_gk20a(dev);
struct gk20a_platform *platform = dev_get_drvdata(dev);
bool enabled = nvgpu_is_enabled(g, NVGPU_CAN_RAILGATE);
int err;
if (kstrtoul(buf, 10, &railgate_enable) < 0)
return -EINVAL;
if (railgate_enable && !enabled) {
if (!platform->can_railgate_init) {
nvgpu_err(g, "Railgating is not supported");
return -EINVAL;
}
if (railgate_enable) {
__nvgpu_set_enabled(g, NVGPU_CAN_RAILGATE, true);
pm_runtime_set_autosuspend_delay(dev, g->railgate_delay);
} else if (railgate_enable == 0 && enabled) {