mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 23:33:20 +08:00
* Sysman: add firmware flash API Signed-off-by: Vilvaraj, T J Vivek <t.j.vivek.vilvaraj@intel.com> * Sysman: fixed windows implementation of firmware flash API. Signed-off-by: Vilvaraj, T J Vivek <t.j.vivek.vilvaraj@intel.com> * add unit tests to test flashing. Signed-off-by: Vilvaraj, T J Vivek <t.j.vivek.vilvaraj@intel.com> * sysman: add firmware flashing support to zello sysman Signed-off-by: T J Vivek Vilvaraj <t.j.vivek.vilvaraj@intel.com> * sysman: added progress update function to firmware flash API Signed-off-by: T J Vivek Vilvaraj <t.j.vivek.vilvaraj@intel.com>
45 lines
931 B
C++
45 lines
931 B
C++
/*
|
|
* Copyright (C) 2020-2021 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "firmware_imp.h"
|
|
|
|
#include "shared/source/helpers/debug_helpers.h"
|
|
|
|
#include "os_firmware.h"
|
|
|
|
#include <cmath>
|
|
|
|
namespace L0 {
|
|
|
|
ze_result_t FirmwareImp::firmwareGetProperties(zes_firmware_properties_t *pProperties) {
|
|
pOsFirmware->osGetFwProperties(pProperties);
|
|
return ZE_RESULT_SUCCESS;
|
|
}
|
|
|
|
ze_result_t FirmwareImp::firmwareFlash(void *pImage, uint32_t size) {
|
|
return pOsFirmware->osFirmwareFlash(pImage, size);
|
|
}
|
|
|
|
void FirmwareImp::init() {
|
|
this->isFirmwareEnabled = pOsFirmware->isFirmwareSupported();
|
|
}
|
|
|
|
FirmwareImp::FirmwareImp(OsSysman *pOsSysman) {
|
|
pOsFirmware = OsFirmware::create(pOsSysman);
|
|
UNRECOVERABLE_IF(nullptr == pOsFirmware);
|
|
init();
|
|
}
|
|
|
|
FirmwareImp::~FirmwareImp() {
|
|
if (pOsFirmware != nullptr) {
|
|
delete pOsFirmware;
|
|
pOsFirmware = nullptr;
|
|
}
|
|
}
|
|
|
|
} // namespace L0
|