mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
JIRA DNVGPU-143 The arbiter is charged with selecting the proper frequencies when multiple applications submit simultaneously clock change requests On the current implementation, the arbiter guarantees that the selected frequency will be always higher or equal to the request, as long as the request is in range. The current code is not yet realtime friendly, as requests are not pre-allocated. Summary of changes: (1) pstate/vf switch no longer selects boot frequency (2) changed mclk code change to accept input freq (3) added arbiter (4) now a single session can submit concurrent requests the last request is the one that applies for that session (5) modified locking mechanism to reduce lock contention (6) Added callback to notify the arbiter that the VF table has changed and is no longer valid (PMU/Thermals must call this when VF table is invalid) (7) changed internal API to work with MHz (8) added debugfs for stats Change-Id: I6a7b05c9447761e8536f84ef86b5ab0793164d63 Signed-off-by: David Nieto <dmartineznie@nvidia.com> Reviewed-on: http://git-master/r/1239461 Reviewed-by: Thomas Fleury <tfleury@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1267120 Reviewed-by: Automatic_Commit_Validation_User
54 lines
1.2 KiB
C
54 lines
1.2 KiB
C
/*
|
|
* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms and conditions of the GNU General Public License,
|
|
* version 2, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*/
|
|
|
|
#ifndef _CLKMCLK_H_
|
|
#define _CLKMCLK_H_
|
|
|
|
#include <linux/mutex.h>
|
|
|
|
enum gk20a_mclk_speed {
|
|
gk20a_mclk_low_speed,
|
|
gk20a_mclk_mid_speed,
|
|
gk20a_mclk_high_speed,
|
|
};
|
|
|
|
#define MCLK_LOW_SPEED_LIMIT 405
|
|
#define MCLK_MID_SPEED_LIMIT 810
|
|
#define MCLK_HIGH_SPEED_LIMIT 3003
|
|
|
|
#define DEFAULT_BOOT_MCLK_SPEED MCLK_HIGH_SPEED_LIMIT
|
|
|
|
struct clk_mclk_state {
|
|
enum gk20a_mclk_speed speed;
|
|
struct mutex mclk_mutex;
|
|
void *vreg_buf;
|
|
bool init;
|
|
|
|
/* function pointers */
|
|
int (*change)(struct gk20a *g, u16 val);
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
s64 switch_max;
|
|
s64 switch_min;
|
|
u64 switch_num;
|
|
s64 switch_avg;
|
|
s64 switch_std;
|
|
bool debugfs_set;
|
|
#endif
|
|
};
|
|
|
|
int clk_mclkseq_init_mclk_gddr5(struct gk20a *g);
|
|
int clk_mclkseq_change_mclk_gddr5(struct gk20a *g, u16 val);
|
|
|
|
#endif
|