gpu: nvgpu: Implement clk_good and pll_lock check

Add clk_good and pll_lock check as a part of fmon polling.
This will poll for any clock related faults at FTTI interval.
Add new function to poll for vbios init completion.

NVGPU-4967
Bug 2849506
Bug 200564937

Change-Id: I5bc885329981e07376824e148edabe9be4120e1c
Signed-off-by: Abdul Salam <absalam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2305782
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Abdul Salam
2020-03-24 22:19:53 +05:30
committed by Alex Waterman
parent b8a3e54dda
commit 4f5bd9e633
9 changed files with 116 additions and 10 deletions

View File

@@ -26,6 +26,7 @@
#include <nvgpu/string.h>
#include <nvgpu/soc.h>
#include <nvgpu/static_analysis.h>
#include <nvgpu/timers.h>
#include "bios_sw_gv100.h"
#include "bios_sw_tu104.h"
@@ -833,3 +834,31 @@ u32 nvgpu_bios_read_u32(struct gk20a *g, u32 offset)
return val;
}
#ifdef CONFIG_NVGPU_DGPU
bool nvgpu_bios_wait_for_init_done(struct gk20a *g)
{
struct nvgpu_timeout timeout;
int err;
err = nvgpu_timeout_init(g, &timeout,
NVGPU_BIOS_DEVINIT_VERIFY_TIMEOUT_MS, NVGPU_TIMER_CPU_TIMER);
if (err != 0) {
return false;
}
/* Wait till vbios is completed */
do {
if (g->bios_is_init == true) {
return true;
}
nvgpu_msleep(NVGPU_BIOS_DEVINIT_VERIFY_COMPLETION_MS);
} while (nvgpu_timeout_expired(&timeout) == 0);
if (g->bios_is_init == true) {
return true;
} else {
return false;
}
}
#endif

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -28,9 +28,6 @@
#include "bios_sw_gv100.h"
#include "bios_sw_tu104.h"
#define NV_DEVINIT_VERIFY_TIMEOUT_MS 1000U
#define NV_DEVINIT_VERIFY_TIMEOUT_DELAY_US 10U
#define NV_PGC6_AON_SECURE_SCRATCH_GROUP_05_0_GFW_BOOT_PROGRESS_MASK \
0xFFU
#define NV_PGC6_AON_SECURE_SCRATCH_GROUP_05_0_GFW_BOOT_PROGRESS_COMPLETED \
@@ -123,8 +120,8 @@ int tu104_bios_verify_devinit(struct gk20a *g)
u32 aon_secure_scratch_reg;
int err;
err = nvgpu_timeout_init(g, &timeout, NV_DEVINIT_VERIFY_TIMEOUT_MS,
NVGPU_TIMER_CPU_TIMER);
err = nvgpu_timeout_init(g, &timeout,
NVGPU_BIOS_DEVINIT_VERIFY_TIMEOUT_MS, NVGPU_TIMER_CPU_TIMER);
if (err != 0) {
return err;
}
@@ -139,7 +136,7 @@ int tu104_bios_verify_devinit(struct gk20a *g)
return 0;
}
nvgpu_udelay(NV_DEVINIT_VERIFY_TIMEOUT_DELAY_US);
nvgpu_udelay(NVGPU_BIOS_DEVINIT_VERIFY_DELAY_US);
} while (nvgpu_timeout_expired(&timeout) == 0);
return -ETIMEDOUT;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -23,6 +23,10 @@
#ifndef NVGPU_BIOS_SW_TU104_H
#define NVGPU_BIOS_SW_TU104_H
#define NVGPU_BIOS_DEVINIT_VERIFY_TIMEOUT_MS 1000U
#define NVGPU_BIOS_DEVINIT_VERIFY_DELAY_US 10U
#define NVGPU_BIOS_DEVINIT_VERIFY_COMPLETION_MS 1U
struct gk20a;
int tu104_bios_verify_devinit(struct gk20a *g);