/* * Copyright 2022 Red Hat Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE.
*/ #include"priv.h"
ret = nvkm_falcon_get(falcon, user); if (ret) return ret;
if (fw->sigs) {
ret = nvkm_falcon_fw_patch(fw); if (ret) goto done;
nvkm_falcon_fw_dtor_sigs(fw);
}
FLCNFW_DBG(fw, "resetting");
fw->func->reset(fw);
FLCNFW_DBG(fw, "loading"); if (fw->func->setup) {
ret = fw->func->setup(fw); if (ret) goto done;
}
/* after last write to the img, sync dma mappings */
dma_sync_single_for_device(fw->fw.device->dev,
fw->fw.phys,
sg_dma_len(&fw->fw.mem.sgl),
DMA_TO_DEVICE);
ret = fw->func->load(fw); if (ret) goto done;
FLCNFW_DBG(fw, "booting");
ret = fw->func->boot(fw, pmbox0, pmbox1, mbox0_ok, irqsclr); if (ret)
FLCNFW_ERR(fw, "boot failed: %d", ret); else
FLCNFW_DBG(fw, "booted");
done: if (ret || release)
nvkm_falcon_put(falcon, user); return ret;
}
int
nvkm_falcon_fw_oneinit(struct nvkm_falcon_fw *fw, struct nvkm_falcon *falcon, struct nvkm_vmm *vmm, struct nvkm_memory *inst)
{ int ret;
ret = nvkm_falcon_fw_ctor(func, name, subdev->device, bl != NULL,
blob->data + hdr->data_offset, hdr->data_size, falcon, fw); if (ret) goto done;
/* Earlier FW releases by NVIDIA for Nouveau's use aren't in NVIDIA's * standard format, and don't have the indirection seen in the 0x10de * case.
*/ switch (hdr->bin_magic) { case 0x000010de:
loc = *(u32 *)(blob->data + hshdr->patch_loc);
sig = *(u32 *)(blob->data + hshdr->patch_sig); break; case 0x3b1d14f0:
loc = hshdr->patch_loc;
sig = hshdr->patch_sig; break; default:
WARN_ON(1);
ret = -EINVAL; goto done;
}
ret = nvkm_falcon_fw_sign(fw, loc, hshdr->sig_prod_size, blob->data,
1, hshdr->sig_prod_offset + sig,
1, hshdr->sig_dbg_offset + sig); if (ret) goto done;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.