forked from alibaba-archive/alibabacloud-tool-bmc-hal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhal_firmware.py
78 lines (58 loc) · 1.82 KB
/
hal_firmware.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
###############################################################################
#
# Hardware Abstraction Layer APIs -- Firmware APIs.
#
# Copyright (C) Alibaba, INC.
#
###############################################################################
"""
class for HAL Firmware APIs.
"""
class HalFirmware(object):
def __init__(self):
pass
def program_bios(self, flash, image):
"""
Program BIOS flash with specific image
@param flash 'master' or 'slave' BIOS flash
@param image Absolute path of the BIOS image file
@return 0 for success, -1 for failure
"""
pass
def get_bios_next_boot(self):
"""
Get next booting flash of BIOS
@return "master"/"slave" on success, "N/A" for failure
"""
pass
def set_bios_next_boot(self, flash):
"""
Set flash from which next BIOS boot
@param flash Booting flash of BIOS, "master" or "slave"
@return 0 on success, -1 for failure
"""
pass
def program_bmc(self, flash, image):
"""
Program BMC flash witch specific image
@param flash 'master' or 'slave' BMC flash
@param image Absolute path of BMC image file
@return 0 for success, -1 for failure
"""
pass
def program_cpld(self, names, files):
"""
Program CPLD
@param names List of CPLD/FPGA names
@param files List of refresh files for CPLD/FPGA
@return 0 on success, -1 for failure
"""
pass
def refresh_firmware(self, names, files):
"""
Refresh CPLD/FPGA/BIOS(reload ME) if applicable
@param names List of CPLD/FPGA/BIOS names
@param files List of refresh files for CPLD/FPGA
@return 0 on success, -1 for failure
"""
pass