summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include/nvgpu/firmware.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/include/nvgpu/firmware.h')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/firmware.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/firmware.h b/drivers/gpu/nvgpu/include/nvgpu/firmware.h
new file mode 100644
index 00000000..b541947a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/firmware.h
@@ -0,0 +1,72 @@
1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _NVGPU_FIRMWARE_H_
24#define _NVGPU_FIRMWARE_H_
25
26struct gk20a;
27
28#define NVGPU_REQUEST_FIRMWARE_NO_WARN (1UL << 0)
29#define NVGPU_REQUEST_FIRMWARE_NO_SOC (1UL << 1)
30
31struct nvgpu_firmware {
32 u8 *data;
33 size_t size;
34};
35
36/**
37 * nvgpu_request_firmware - load a firmware blob from filesystem.
38 *
39 * @g The GPU driver struct for device to load firmware for
40 * @fw_name The base name of the firmware file.
41 * @flags Flags for loading;
42 *
43 * NVGPU_REQUEST_FIRMWARE_NO_WARN: Do not display warning on
44 * failed load.
45 *
46 * NVGPU_REQUEST_FIRMWARE_NO_SOC: Do not attempt loading from
47 * path <SOC_NAME>.
48 *
49 * nvgpu_request_firmware() will load firmware from:
50 *
51 * <system firmware load path>/<GPU name>/<fw_name>
52 *
53 * If that fails and NO_SOC is not enabled, it'll try next from:
54 *
55 * <system firmware load path>/<SOC name>/<fw_name>
56 *
57 * It'll allocate a nvgpu_firmware structure and initializes it and returns
58 * it to caller.
59 */
60struct nvgpu_firmware *nvgpu_request_firmware(struct gk20a *g,
61 const char *fw_name,
62 int flags);
63
64/**
65 * nvgpu_release_firmware - free firmware and associated nvgpu_firmware blob
66 *
67 * @g The GPU driver struct for device to free firmware for
68 * @fw The firmware to free. fw blob will also be freed.
69 */
70void nvgpu_release_firmware(struct gk20a *g, struct nvgpu_firmware *fw);
71
72#endif