-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Implementation for runtime access communication method with…
… firmware to support firmware configuration access and modification on-the-fly
- Loading branch information
Showing
43 changed files
with
8,655 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
If you have two different Xml from `cli.savexml()` command you could use below method: | ||
|
||
|
||
Syntax: | ||
```python | ||
from xmlcli import XmlCli as cli | ||
|
||
cli.helpers.generate_knobs_delta( | ||
ref_xml="path/to/reference.xml", | ||
new_xml="path/to/new.xml", | ||
out_file="path/to/difference-delta.txt", | ||
compare_tag="default" # xml attribute to be compared against (default|CurrentVal|size|prompt|depex|...) | ||
) | ||
``` | ||
|
||
|
||
If you have BIOS/IFWI image, instead of doing `cli.savexml` for both image, you could directly use below command syntax: | ||
```python | ||
from xmlcli import XmlCli as cli | ||
|
||
cli.helpers.compare_bios_knobs("<path-to-reference-bios-or-ifwi>", "<path-to-bios-or-ifwi>", result_log_file="<path-to-difference-delta>") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[BiosKnobs] | ||
CvfSupport=1 | ||
MipiCam_ControlLogic0=1 | ||
MipiCam_ControlLogic1=1 | ||
MipiCam_Link0=1 | ||
MipiCam_Link1=1 | ||
MipiCam_Link1_SensorModel=1 | ||
MipiCam_Link1_DriverData_CrdVersion=0x20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
__author__ = "Gahan Saraiya" | ||
|
||
# Built-in imports | ||
|
||
# Custom imports | ||
|
||
|
||
if __name__ == "__main__": | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
__author__ = "Gahan Saraiya" | ||
|
||
# Built-in imports | ||
import os | ||
import sys | ||
import glob | ||
import shutil | ||
|
||
# Custom imports | ||
from xmlcli import XmlCli as cli | ||
from xmlcli import XmlCliLib as clb | ||
from xmlcli.common.logger import log | ||
from xmlcli import UefiFwParser as fwp | ||
|
||
|
||
def automate_program_knobs(input_bios, config_dir, output_dir, new_major_ver="", new_minor_ver=""): | ||
"""Function to perform the CvProgKnobs for multiple bios images using configuration file | ||
:param input_bios: absolute path to the folder contains bios images or absolute path to the bios file | ||
:param config_dir: absolute path to the folder contains bios knobs configuration file(.ini) | ||
:param output_dir: absolute path of the directory to store the output files | ||
:param new_major_ver: new major version for the file | ||
:param new_minor_ver: new minor version for the file | ||
""" | ||
bios_knob_config_files = glob.glob(os.path.join(config_dir, "*.ini")) | ||
original_knobs_config = clb.KnobsIniFile | ||
input_bios_files = [] | ||
if os.path.isdir(input_bios): | ||
input_bios_files = glob.glob(os.path.join(input_bios, "*.bin")) | ||
elif os.path.isfile(input_bios): | ||
input_bios_files = [input_bios] | ||
for KnobsIni in bios_knob_config_files: | ||
clb.KnobsIniFile = KnobsIni | ||
suffix_text = os.path.splitext(os.path.basename(KnobsIni))[0] | ||
for BiosBinFile in input_bios_files: | ||
log.info(f"Processing BIOS file = {BiosBinFile}") | ||
cli.CvProgKnobs(0, BiosBinFile, suffix_text, True) | ||
temp_file = clb.OutBinFile | ||
fwp.UpdateBiosId(clb.OutBinFile, new_major_ver, new_minor_ver) | ||
if clb.OutBinFile != "": | ||
shutil.move(clb.OutBinFile, output_dir) | ||
clb.RemoveFile(temp_file) | ||
clb.KnobsIniFile = original_knobs_config | ||
|
||
|
||
if __name__ == "__main__": | ||
pass |
Oops, something went wrong.