1b62880f7SAlexandre Courbot /*
2b62880f7SAlexandre Courbot * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3b62880f7SAlexandre Courbot *
4b62880f7SAlexandre Courbot * Permission is hereby granted, free of charge, to any person obtaining a
5b62880f7SAlexandre Courbot * copy of this software and associated documentation files (the "Software"),
6b62880f7SAlexandre Courbot * to deal in the Software without restriction, including without limitation
7b62880f7SAlexandre Courbot * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8b62880f7SAlexandre Courbot * and/or sell copies of the Software, and to permit persons to whom the
9b62880f7SAlexandre Courbot * Software is furnished to do so, subject to the following conditions:
10b62880f7SAlexandre Courbot *
11b62880f7SAlexandre Courbot * The above copyright notice and this permission notice shall be included in
12b62880f7SAlexandre Courbot * all copies or substantial portions of the Software.
13b62880f7SAlexandre Courbot *
14b62880f7SAlexandre Courbot * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15b62880f7SAlexandre Courbot * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16b62880f7SAlexandre Courbot * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17b62880f7SAlexandre Courbot * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18b62880f7SAlexandre Courbot * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19b62880f7SAlexandre Courbot * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20b62880f7SAlexandre Courbot * DEALINGS IN THE SOFTWARE.
21b62880f7SAlexandre Courbot */
22b62880f7SAlexandre Courbot #include "priv.h"
2386ce2a71SBen Skeggs
2422dcda45SBen Skeggs #include <core/memory.h>
257adc40c5SBen Skeggs #include <subdev/acr.h>
26ca3190e3SBen Skeggs #include <subdev/timer.h>
277adc40c5SBen Skeggs
2822dcda45SBen Skeggs #include <nvfw/flcn.h>
2986ce2a71SBen Skeggs #include <nvfw/sec2.h>
3086ce2a71SBen Skeggs
31eddb0473SBen Skeggs int
gp102_sec2_nofw(struct nvkm_sec2 * sec2,int ver,const struct nvkm_sec2_fwif * fwif)32eddb0473SBen Skeggs gp102_sec2_nofw(struct nvkm_sec2 *sec2, int ver,
33eddb0473SBen Skeggs const struct nvkm_sec2_fwif *fwif)
34eddb0473SBen Skeggs {
35eddb0473SBen Skeggs nvkm_warn(&sec2->engine.subdev, "firmware unavailable\n");
36eddb0473SBen Skeggs return 0;
37eddb0473SBen Skeggs }
38eddb0473SBen Skeggs
3986ce2a71SBen Skeggs static int
gp102_sec2_acr_bootstrap_falcon_callback(void * priv,struct nvfw_falcon_msg * hdr)40b448a266STimur Tabi gp102_sec2_acr_bootstrap_falcon_callback(void *priv, struct nvfw_falcon_msg *hdr)
4186ce2a71SBen Skeggs {
4286ce2a71SBen Skeggs struct nv_sec2_acr_bootstrap_falcon_msg *msg =
4386ce2a71SBen Skeggs container_of(hdr, typeof(*msg), msg.hdr);
4486ce2a71SBen Skeggs struct nvkm_subdev *subdev = priv;
4586ce2a71SBen Skeggs const char *name = nvkm_acr_lsf_id(msg->falcon_id);
4686ce2a71SBen Skeggs
4786ce2a71SBen Skeggs if (msg->error_code) {
4886ce2a71SBen Skeggs nvkm_error(subdev, "ACR_BOOTSTRAP_FALCON failed for "
4986ce2a71SBen Skeggs "falcon %d [%s]: %08x\n",
5086ce2a71SBen Skeggs msg->falcon_id, name, msg->error_code);
5186ce2a71SBen Skeggs return -EINVAL;
5286ce2a71SBen Skeggs }
5386ce2a71SBen Skeggs
5486ce2a71SBen Skeggs nvkm_debug(subdev, "%s booted\n", name);
5586ce2a71SBen Skeggs return 0;
5686ce2a71SBen Skeggs }
5786ce2a71SBen Skeggs
5886ce2a71SBen Skeggs static int
gp102_sec2_acr_bootstrap_falcon(struct nvkm_falcon * falcon,enum nvkm_acr_lsf_id id)5986ce2a71SBen Skeggs gp102_sec2_acr_bootstrap_falcon(struct nvkm_falcon *falcon,
6086ce2a71SBen Skeggs enum nvkm_acr_lsf_id id)
6186ce2a71SBen Skeggs {
6286ce2a71SBen Skeggs struct nvkm_sec2 *sec2 = container_of(falcon, typeof(*sec2), falcon);
6386ce2a71SBen Skeggs struct nv_sec2_acr_bootstrap_falcon_cmd cmd = {
6486ce2a71SBen Skeggs .cmd.hdr.unit_id = sec2->func->unit_acr,
6586ce2a71SBen Skeggs .cmd.hdr.size = sizeof(cmd),
6686ce2a71SBen Skeggs .cmd.cmd_type = NV_SEC2_ACR_CMD_BOOTSTRAP_FALCON,
6786ce2a71SBen Skeggs .flags = NV_SEC2_ACR_BOOTSTRAP_FALCON_FLAGS_RESET_YES,
6886ce2a71SBen Skeggs .falcon_id = id,
6986ce2a71SBen Skeggs };
7086ce2a71SBen Skeggs
7186ce2a71SBen Skeggs return nvkm_falcon_cmdq_send(sec2->cmdq, &cmd.cmd.hdr,
7286ce2a71SBen Skeggs gp102_sec2_acr_bootstrap_falcon_callback,
7386ce2a71SBen Skeggs &sec2->engine.subdev,
7486ce2a71SBen Skeggs msecs_to_jiffies(1000));
7586ce2a71SBen Skeggs }
7686ce2a71SBen Skeggs
7722dcda45SBen Skeggs static void
gp102_sec2_acr_bld_patch(struct nvkm_acr * acr,u32 bld,s64 adjust)7822dcda45SBen Skeggs gp102_sec2_acr_bld_patch(struct nvkm_acr *acr, u32 bld, s64 adjust)
7922dcda45SBen Skeggs {
8022dcda45SBen Skeggs struct loader_config_v1 hdr;
8122dcda45SBen Skeggs nvkm_robj(acr->wpr, bld, &hdr, sizeof(hdr));
8222dcda45SBen Skeggs hdr.code_dma_base = hdr.code_dma_base + adjust;
8322dcda45SBen Skeggs hdr.data_dma_base = hdr.data_dma_base + adjust;
8422dcda45SBen Skeggs hdr.overlay_dma_base = hdr.overlay_dma_base + adjust;
8522dcda45SBen Skeggs nvkm_wobj(acr->wpr, bld, &hdr, sizeof(hdr));
8622dcda45SBen Skeggs loader_config_v1_dump(&acr->subdev, &hdr);
8722dcda45SBen Skeggs }
8822dcda45SBen Skeggs
8922dcda45SBen Skeggs static void
gp102_sec2_acr_bld_write(struct nvkm_acr * acr,u32 bld,struct nvkm_acr_lsfw * lsfw)9022dcda45SBen Skeggs gp102_sec2_acr_bld_write(struct nvkm_acr *acr, u32 bld,
9122dcda45SBen Skeggs struct nvkm_acr_lsfw *lsfw)
9222dcda45SBen Skeggs {
9322dcda45SBen Skeggs const struct loader_config_v1 hdr = {
9422dcda45SBen Skeggs .dma_idx = FALCON_SEC2_DMAIDX_UCODE,
9522dcda45SBen Skeggs .code_dma_base = lsfw->offset.img + lsfw->app_start_offset,
9622dcda45SBen Skeggs .code_size_total = lsfw->app_size,
9722dcda45SBen Skeggs .code_size_to_load = lsfw->app_resident_code_size,
9822dcda45SBen Skeggs .code_entry_point = lsfw->app_imem_entry,
9922dcda45SBen Skeggs .data_dma_base = lsfw->offset.img + lsfw->app_start_offset +
10022dcda45SBen Skeggs lsfw->app_resident_data_offset,
10122dcda45SBen Skeggs .data_size = lsfw->app_resident_data_size,
10222dcda45SBen Skeggs .overlay_dma_base = lsfw->offset.img + lsfw->app_start_offset,
10322dcda45SBen Skeggs .argc = 1,
10422dcda45SBen Skeggs .argv = lsfw->falcon->func->emem_addr,
10522dcda45SBen Skeggs };
10622dcda45SBen Skeggs
10722dcda45SBen Skeggs nvkm_wobj(acr->wpr, bld, &hdr, sizeof(hdr));
10822dcda45SBen Skeggs }
10922dcda45SBen Skeggs
1107adc40c5SBen Skeggs static const struct nvkm_acr_lsf_func
1117adc40c5SBen Skeggs gp102_sec2_acr_0 = {
11222dcda45SBen Skeggs .bld_size = sizeof(struct loader_config_v1),
11322dcda45SBen Skeggs .bld_write = gp102_sec2_acr_bld_write,
11422dcda45SBen Skeggs .bld_patch = gp102_sec2_acr_bld_patch,
115de088372SBen Skeggs .bootstrap_falcons = BIT_ULL(NVKM_ACR_LSF_FECS) |
116de088372SBen Skeggs BIT_ULL(NVKM_ACR_LSF_GPCCS) |
117de088372SBen Skeggs BIT_ULL(NVKM_ACR_LSF_SEC2),
11886ce2a71SBen Skeggs .bootstrap_falcon = gp102_sec2_acr_bootstrap_falcon,
1197adc40c5SBen Skeggs };
1207adc40c5SBen Skeggs
121d114a139SBen Skeggs int
gp102_sec2_initmsg(struct nvkm_sec2 * sec2)122d114a139SBen Skeggs gp102_sec2_initmsg(struct nvkm_sec2 *sec2)
123d114a139SBen Skeggs {
124d114a139SBen Skeggs struct nv_sec2_init_msg msg;
125d114a139SBen Skeggs int ret, i;
126d114a139SBen Skeggs
127d114a139SBen Skeggs ret = nvkm_falcon_msgq_recv_initmsg(sec2->msgq, &msg, sizeof(msg));
128d114a139SBen Skeggs if (ret)
129d114a139SBen Skeggs return ret;
130d114a139SBen Skeggs
131d114a139SBen Skeggs if (msg.hdr.unit_id != NV_SEC2_UNIT_INIT ||
132d114a139SBen Skeggs msg.msg_type != NV_SEC2_INIT_MSG_INIT)
133d114a139SBen Skeggs return -EINVAL;
134d114a139SBen Skeggs
135d114a139SBen Skeggs for (i = 0; i < ARRAY_SIZE(msg.queue_info); i++) {
136d114a139SBen Skeggs if (msg.queue_info[i].id == NV_SEC2_INIT_MSG_QUEUE_ID_MSGQ) {
137d114a139SBen Skeggs nvkm_falcon_msgq_init(sec2->msgq,
138d114a139SBen Skeggs msg.queue_info[i].index,
139d114a139SBen Skeggs msg.queue_info[i].offset,
140d114a139SBen Skeggs msg.queue_info[i].size);
141d114a139SBen Skeggs } else {
142d114a139SBen Skeggs nvkm_falcon_cmdq_init(sec2->cmdq,
143d114a139SBen Skeggs msg.queue_info[i].index,
144d114a139SBen Skeggs msg.queue_info[i].offset,
145d114a139SBen Skeggs msg.queue_info[i].size);
146d114a139SBen Skeggs }
147d114a139SBen Skeggs }
148d114a139SBen Skeggs
149d114a139SBen Skeggs return 0;
150d114a139SBen Skeggs }
151d114a139SBen Skeggs
152c7c0aac7SBen Skeggs irqreturn_t
gp102_sec2_intr(struct nvkm_inth * inth)153c7c0aac7SBen Skeggs gp102_sec2_intr(struct nvkm_inth *inth)
154c9af47bcSBen Skeggs {
155c7c0aac7SBen Skeggs struct nvkm_sec2 *sec2 = container_of(inth, typeof(*sec2), engine.subdev.inth);
156c9af47bcSBen Skeggs struct nvkm_subdev *subdev = &sec2->engine.subdev;
157c9af47bcSBen Skeggs struct nvkm_falcon *falcon = &sec2->falcon;
158c9af47bcSBen Skeggs u32 disp = nvkm_falcon_rd32(falcon, 0x01c);
159c9af47bcSBen Skeggs u32 intr = nvkm_falcon_rd32(falcon, 0x008) & disp & ~(disp >> 16);
160c9af47bcSBen Skeggs
161c9af47bcSBen Skeggs if (intr & 0x00000040) {
1623b330f08SBen Skeggs if (unlikely(atomic_read(&sec2->initmsg) == 0)) {
1633b330f08SBen Skeggs int ret = sec2->func->initmsg(sec2);
1643b330f08SBen Skeggs
1653b330f08SBen Skeggs if (ret)
1663b330f08SBen Skeggs nvkm_error(subdev, "error parsing init message: %d\n", ret);
1673b330f08SBen Skeggs
1683b330f08SBen Skeggs atomic_set(&sec2->initmsg, ret ?: 1);
1693b330f08SBen Skeggs }
1703b330f08SBen Skeggs
1713b330f08SBen Skeggs if (atomic_read(&sec2->initmsg) > 0) {
1723b330f08SBen Skeggs if (!nvkm_falcon_msgq_empty(sec2->msgq))
1733b330f08SBen Skeggs nvkm_falcon_msgq_recv(sec2->msgq);
1743b330f08SBen Skeggs }
1753b330f08SBen Skeggs
176c9af47bcSBen Skeggs nvkm_falcon_wr32(falcon, 0x004, 0x00000040);
177c9af47bcSBen Skeggs intr &= ~0x00000040;
178c9af47bcSBen Skeggs }
179c9af47bcSBen Skeggs
1803b330f08SBen Skeggs if (intr & 0x00000010) {
181d2922879SBen Skeggs if (atomic_read(&sec2->running)) {
182d2922879SBen Skeggs FLCN_ERR(falcon, "halted");
183d2922879SBen Skeggs gm200_flcn_tracepc(falcon);
184d2922879SBen Skeggs }
185d2922879SBen Skeggs
1863b330f08SBen Skeggs nvkm_falcon_wr32(falcon, 0x004, 0x00000010);
1873b330f08SBen Skeggs intr &= ~0x00000010;
1883b330f08SBen Skeggs }
1893b330f08SBen Skeggs
190c9af47bcSBen Skeggs if (intr) {
191c9af47bcSBen Skeggs nvkm_error(subdev, "unhandled intr %08x\n", intr);
192c9af47bcSBen Skeggs nvkm_falcon_wr32(falcon, 0x004, intr);
193c9af47bcSBen Skeggs }
194c7c0aac7SBen Skeggs
195c7c0aac7SBen Skeggs return IRQ_HANDLED;
196c9af47bcSBen Skeggs }
197edd757d1SBen Skeggs
198edd757d1SBen Skeggs static const struct nvkm_falcon_func
199edd757d1SBen Skeggs gp102_sec2_flcn = {
200f15cde64SBen Skeggs .disable = gm200_flcn_disable,
201f15cde64SBen Skeggs .enable = gm200_flcn_enable,
202f15cde64SBen Skeggs .reset_pmc = true,
203f15cde64SBen Skeggs .reset_eng = gp102_flcn_reset_eng,
204f15cde64SBen Skeggs .reset_wait_mem_scrubbing = gm200_flcn_reset_wait_mem_scrubbing,
205e938c4e7SBen Skeggs .debug = 0x408,
2062541626cSBen Skeggs .bind_inst = gm200_flcn_bind_inst,
2072541626cSBen Skeggs .bind_stat = gm200_flcn_bind_stat,
2082541626cSBen Skeggs .bind_intr = true,
2092541626cSBen Skeggs .imem_pio = &gm200_flcn_imem_pio,
2102541626cSBen Skeggs .dmem_pio = &gm200_flcn_dmem_pio,
211bc3cfd18SBen Skeggs .emem_addr = 0x01000000,
2122541626cSBen Skeggs .emem_pio = &gp102_flcn_emem_pio,
213edd757d1SBen Skeggs .start = nvkm_falcon_v1_start,
214b826f48aSBen Skeggs .cmdq = { 0xa00, 0xa04, 8 },
215b826f48aSBen Skeggs .msgq = { 0xa30, 0xa34, 8 },
216edd757d1SBen Skeggs };
217edd757d1SBen Skeggs
2187adc40c5SBen Skeggs const struct nvkm_sec2_func
2197adc40c5SBen Skeggs gp102_sec2 = {
220edd757d1SBen Skeggs .flcn = &gp102_sec2_flcn,
2213b330f08SBen Skeggs .unit_unload = NV_SEC2_UNIT_UNLOAD,
22286ce2a71SBen Skeggs .unit_acr = NV_SEC2_UNIT_ACR,
223c9af47bcSBen Skeggs .intr = gp102_sec2_intr,
224d114a139SBen Skeggs .initmsg = gp102_sec2_initmsg,
2257adc40c5SBen Skeggs };
2267adc40c5SBen Skeggs
2277adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp102/sec2/desc.bin");
2287adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp102/sec2/image.bin");
2297adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp102/sec2/sig.bin");
2307adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp104/sec2/desc.bin");
2317adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp104/sec2/image.bin");
2327adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp104/sec2/sig.bin");
2337adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp106/sec2/desc.bin");
2347adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp106/sec2/image.bin");
2357adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp106/sec2/sig.bin");
2367adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/sec2/desc.bin");
2377adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/sec2/image.bin");
2387adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/sec2/sig.bin");
2397adc40c5SBen Skeggs
240*4b569dedSBen Skeggs void
gp102_sec2_acr_bld_patch_1(struct nvkm_acr * acr,u32 bld,s64 adjust)24122dcda45SBen Skeggs gp102_sec2_acr_bld_patch_1(struct nvkm_acr *acr, u32 bld, s64 adjust)
24222dcda45SBen Skeggs {
24322dcda45SBen Skeggs struct flcn_bl_dmem_desc_v2 hdr;
24422dcda45SBen Skeggs nvkm_robj(acr->wpr, bld, &hdr, sizeof(hdr));
24522dcda45SBen Skeggs hdr.code_dma_base = hdr.code_dma_base + adjust;
24622dcda45SBen Skeggs hdr.data_dma_base = hdr.data_dma_base + adjust;
24722dcda45SBen Skeggs nvkm_wobj(acr->wpr, bld, &hdr, sizeof(hdr));
24822dcda45SBen Skeggs flcn_bl_dmem_desc_v2_dump(&acr->subdev, &hdr);
24922dcda45SBen Skeggs }
25022dcda45SBen Skeggs
251*4b569dedSBen Skeggs void
gp102_sec2_acr_bld_write_1(struct nvkm_acr * acr,u32 bld,struct nvkm_acr_lsfw * lsfw)25222dcda45SBen Skeggs gp102_sec2_acr_bld_write_1(struct nvkm_acr *acr, u32 bld,
25322dcda45SBen Skeggs struct nvkm_acr_lsfw *lsfw)
25422dcda45SBen Skeggs {
25522dcda45SBen Skeggs const struct flcn_bl_dmem_desc_v2 hdr = {
25622dcda45SBen Skeggs .ctx_dma = FALCON_SEC2_DMAIDX_UCODE,
25722dcda45SBen Skeggs .code_dma_base = lsfw->offset.img + lsfw->app_start_offset,
25822dcda45SBen Skeggs .non_sec_code_off = lsfw->app_resident_code_offset,
25922dcda45SBen Skeggs .non_sec_code_size = lsfw->app_resident_code_size,
26022dcda45SBen Skeggs .code_entry_point = lsfw->app_imem_entry,
26122dcda45SBen Skeggs .data_dma_base = lsfw->offset.img + lsfw->app_start_offset +
26222dcda45SBen Skeggs lsfw->app_resident_data_offset,
26322dcda45SBen Skeggs .data_size = lsfw->app_resident_data_size,
26422dcda45SBen Skeggs .argc = 1,
26522dcda45SBen Skeggs .argv = lsfw->falcon->func->emem_addr,
26622dcda45SBen Skeggs };
26722dcda45SBen Skeggs
26822dcda45SBen Skeggs nvkm_wobj(acr->wpr, bld, &hdr, sizeof(hdr));
26922dcda45SBen Skeggs }
27022dcda45SBen Skeggs
2717adc40c5SBen Skeggs const struct nvkm_acr_lsf_func
2727adc40c5SBen Skeggs gp102_sec2_acr_1 = {
27322dcda45SBen Skeggs .bld_size = sizeof(struct flcn_bl_dmem_desc_v2),
27422dcda45SBen Skeggs .bld_write = gp102_sec2_acr_bld_write_1,
27522dcda45SBen Skeggs .bld_patch = gp102_sec2_acr_bld_patch_1,
276de088372SBen Skeggs .bootstrap_falcons = BIT_ULL(NVKM_ACR_LSF_FECS) |
277de088372SBen Skeggs BIT_ULL(NVKM_ACR_LSF_GPCCS) |
278de088372SBen Skeggs BIT_ULL(NVKM_ACR_LSF_SEC2),
27986ce2a71SBen Skeggs .bootstrap_falcon = gp102_sec2_acr_bootstrap_falcon,
2807adc40c5SBen Skeggs };
281b62880f7SAlexandre Courbot
282b62880f7SAlexandre Courbot int
gp102_sec2_load(struct nvkm_sec2 * sec2,int ver,const struct nvkm_sec2_fwif * fwif)2837adc40c5SBen Skeggs gp102_sec2_load(struct nvkm_sec2 *sec2, int ver,
2847adc40c5SBen Skeggs const struct nvkm_sec2_fwif *fwif)
285b62880f7SAlexandre Courbot {
2867adc40c5SBen Skeggs return nvkm_acr_lsfw_load_sig_image_desc_v1(&sec2->engine.subdev,
287edd757d1SBen Skeggs &sec2->falcon,
2887adc40c5SBen Skeggs NVKM_ACR_LSF_SEC2, "sec2/",
2897adc40c5SBen Skeggs ver, fwif->acr);
2907adc40c5SBen Skeggs }
2917adc40c5SBen Skeggs
2927adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp102/sec2/desc-1.bin");
2937adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp102/sec2/image-1.bin");
2947adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp102/sec2/sig-1.bin");
2957adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp104/sec2/desc-1.bin");
2967adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp104/sec2/image-1.bin");
2977adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp104/sec2/sig-1.bin");
2987adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp106/sec2/desc-1.bin");
2997adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp106/sec2/image-1.bin");
3007adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp106/sec2/sig-1.bin");
3017adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/sec2/desc-1.bin");
3027adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/sec2/image-1.bin");
3037adc40c5SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/sec2/sig-1.bin");
3047adc40c5SBen Skeggs
3057adc40c5SBen Skeggs static const struct nvkm_sec2_fwif
3067adc40c5SBen Skeggs gp102_sec2_fwif[] = {
3077adc40c5SBen Skeggs { 1, gp102_sec2_load, &gp102_sec2, &gp102_sec2_acr_1 },
3087adc40c5SBen Skeggs { 0, gp102_sec2_load, &gp102_sec2, &gp102_sec2_acr_0 },
309eddb0473SBen Skeggs { -1, gp102_sec2_nofw, &gp102_sec2 },
3107adc40c5SBen Skeggs {}
3117adc40c5SBen Skeggs };
3127adc40c5SBen Skeggs
3137adc40c5SBen Skeggs int
gp102_sec2_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_sec2 ** psec2)314d1866250SBen Skeggs gp102_sec2_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
315d1866250SBen Skeggs struct nvkm_sec2 **psec2)
3167adc40c5SBen Skeggs {
317d1866250SBen Skeggs return nvkm_sec2_new_(gp102_sec2_fwif, device, type, inst, 0, psec2);
318b62880f7SAlexandre Courbot }
319