diff --git a/drivers/gpu/nvgpu/Makefile.nvgpu b/drivers/gpu/nvgpu/Makefile.nvgpu index 6bbf49a56..8bb64af7a 100644 --- a/drivers/gpu/nvgpu/Makefile.nvgpu +++ b/drivers/gpu/nvgpu/Makefile.nvgpu @@ -36,6 +36,7 @@ nvgpu-y := \ common/linux/nvgpu_mem.o \ common/linux/dma.o \ common/linux/soc.o \ + common/linux/fuse.o \ common/linux/driver_common.o \ common/linux/firmware.o \ common/linux/thread.o \ diff --git a/drivers/gpu/nvgpu/common/linux/fuse.c b/drivers/gpu/nvgpu/common/linux/fuse.c new file mode 100644 index 000000000..5c832a2a9 --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/fuse.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, 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. + */ + +#include + +#include + +int nvgpu_tegra_fuse_read(unsigned long offset, u32 *value) +{ + return tegra_fuse_readl(offset, value); +} + +void nvgpu_tegra_fuse_write(u32 value, unsigned long offset) +{ + tegra_fuse_control_write(value, offset); +} + +int nvgpu_tegra_get_gpu_speedo_id(void) +{ + return tegra_sku_info.gpu_speedo_id; +} diff --git a/drivers/gpu/nvgpu/include/nvgpu/fuse.h b/drivers/gpu/nvgpu/include/nvgpu/fuse.h new file mode 100644 index 000000000..1e306b2d7 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/fuse.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2017, 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 __NVGPU_FUSE_H__ +#define __NVGPU_FUSE_H__ + +int nvgpu_tegra_fuse_read(unsigned long offset, u32 *value); +void nvgpu_tegra_fuse_write(u32 value, unsigned long offset); + +int nvgpu_tegra_get_gpu_speedo_id(void); + +#endif