Control method and device
By sending control signals and storing target parameters in electronic devices, realizing instant update and effectiveness of firmware parameters is achieved, solving the problem of restarting after changing firmware parameters in the prior art, and improving the system's response speed and flexibility.
Patent Information
- Application Number
- CN202411215169.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-06
AI Technical Summary
After changing the parameters of the firmware system (such as BIOS), existing electronic devices need to restart before they can take effect, which will take a long time to change and affect the user experience.
By sending control signals, the processor enters a specific operating mode, obtains and stores target parameters, and updates firmware parameters in registers to take effect instantly, and is saved in non-volatile memory to ensure that they still take effect after restart.
Realize instant update of firmware parameters, reduce downtime, improve system response speed and flexibility, and reduce the risk of system errors caused by inconsistent parameters. It is suitable for remote management and automated control scenarios.
Smart Images

Figure CN119088463A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a control method and device. Background Art
[0002] After the electronic device changes the firmware parameters of the firmware system (such as the Basic Input Output System), the electronic device needs to be restarted to make the changed firmware parameters of the firmware system take effect.
[0003] However, it takes a long time to restart the electronic device each time, so that after each firmware parameter of the firmware system is changed, it takes a long time for the configuration information to take effect, which affects the user's use. Summary of the invention
[0004] The present application provides a control method, including:
[0005] The first system responds to a first control signal sent by the second controller, wherein the first control signal is used to control a processor of the first system to be in a first working mode;
[0006] Acquire a target parameter stored in the second controller, where the target parameter is a parameter used to set the first system;
[0007] Based on the target parameters, updating the firmware parameters in the register of the first system, wherein the updating can make the firmware parameters effective immediately after the updating;
[0008] The processor controlling the first system leaves the first operating mode.
[0009] In some embodiments, the method further comprises:
[0010] The second controller obtains a target parameter of a firmware parameter to be updated in the first system;
[0011] When the second controller completes storing the target parameter, the second controller generates the first control signal, wherein the first control signal is a system management interrupt indication;
[0012] The first control signal is sent to the first system, where the first control signal is used to control a processor of the first system to be in a system management mode.
[0013] In some embodiments, the second controller obtains a target parameter of a firmware parameter to be updated in the first system, including:
[0014] The second controller acquires a setting list, wherein the setting list includes at least one first parameter;
[0015] Based on a first target format, the first parameter is converted into the target parameter and stored, wherein the data format of the target parameter is different from or the same as that of the first parameter.
[0016] In some embodiments, obtaining the target parameter stored by the second controller includes:
[0017] After the processor controlling the first system is in a first working mode, a response program is started;
[0018] The response program obtains target parameters stored by the second controller based on a second target format, wherein the first target format is the same as the second target format.
[0019] In some embodiments, updating the firmware parameters in the register of the first system based on the target parameters includes:
[0020] The target parameters are stored in the register of the first system, so that the firmware parameters are in a valid state after being updated.
[0021] In some embodiments, the method further comprises:
[0022] While storing the target parameter in the register of the first system, the target parameter is stored in the non-volatile memory of the first system, so that the firmware parameter is in a valid state after the first system is restarted.
[0023] In some embodiments, updating the firmware parameters in the register of the first system based on the target parameters includes:
[0024] Writing the target parameter into a register of the first system;
[0025] reading the register;
[0026] When the read content is identical to the written content, it is determined that the firmware parameter of the register of the first system is updated successfully.
[0027] In some embodiments, the method further comprises:
[0028] The first system generates an update status, wherein the update status is used to indicate whether the firmware parameter update is successful or failed;
[0029] The updated status is sent to the second controller.
[0030] In some embodiments, the method further comprises:
[0031] The second controller generates a second control signal based on the updated state and sends the second control signal to the first system;
[0032] The first system updates firmware parameters in registers of the first system based on the second control signal and the target parameters, wherein the firmware parameters are firmware parameters that fail to update.
[0033] The present application also provides a control device, including:
[0034] a response module, configured so that the first system responds to a first control signal sent by the second controller, wherein the first control signal is used to control a processor of the first system to be in a first working mode;
[0035] an acquisition module, configured to acquire a target parameter stored in the second controller, wherein the target parameter is a parameter used to set the first system;
[0036] An update module configured to update firmware parameters in registers of the first system based on the target parameters, wherein the update enables the firmware parameters to be in a valid state immediately after the update;
[0037] A control module is configured to control the processor of the first system to leave the first working mode. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flow chart of a control method according to an embodiment of the present application;
[0039] Figure 2 This is a flow chart of step S0 of the control method of an embodiment of the present application;
[0040] Figure 3 This is a flow chart of step S01 of the control method of an embodiment of the present application;
[0041] Figure 4 This is a flow chart of step S20 of the control method of an embodiment of the present application;
[0042] Figure 5 This is a flow chart of step S30 of the control method of an embodiment of the present application;
[0043] Figure 6 This is a flow chart of step S31 of the control method of an embodiment of the present application;
[0044] Figure 7 Another flow chart of the control method of the embodiment of the present application;
[0045] Figure 8 is a structural block diagram of a control device according to an embodiment of the present application;
[0046] Fig. 9 An interactive schematic diagram of a control method according to an embodiment of the present application. DETAILED DESCRIPTION
[0047] Various aspects and features of the present application are described herein with reference to the accompanying drawings.
[0048] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.
[0049] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0050] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0051] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.
[0052] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
[0053] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.
[0054] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.
[0055] The main task of the Basic Input Output System (BIOS) system is to set registers. Currently, users can change the settings of the BIOS system in the following three ways:
[0056] First, the user needs to restart the electronic device to enter the BIOS interactive interface. The user makes settings according to the prompts, that is, the user modifies the options and saves them. The user's modification records are saved to the non-volatile storage area, and the data will not be lost even if the power is off. After restarting the electronic device again, the BIOS reads the user's modifications from the non-volatile storage area, and according to the settings, the BIOS code implements the corresponding functions.
[0057] Second, the user temporarily stores the settings on the baseboard management controller (BMC) out-of-band, and then restarts the electronic device. The BIOS system obtains the user settings from the baseboard management controller and writes the settings to the non-volatile storage area. After restarting again, the BIOS reads the user changes from the non-volatile storage area, and the BIOS code implements the corresponding functions according to the settings.
[0058] Third, registers are modified directly through internal programs of an operating system (eg, OS), but the operating system cannot be applied to all platforms and has a limited range of control registers.
[0059] Therefore, the above methods have the problem of taking a long time or incomplete settings support, which affects the user experience.
[0060] In view of the above content, the embodiment of the present application provides a control method, such as Figure 1 As shown, the control method includes:
[0061] S10. The first system responds to a first control signal sent by the second controller, wherein the first control signal is used to control a processor of the first system to be in a first operating mode.
[0062] In this embodiment, the first system is a firmware system, which may be a BIOS system, a Unified Extensible Firmware Interface (UEFI), or other firmware systems, which is not limited in this application.
[0063] Among them, the BIOS options of the BIOS system are function options displayed in the BIOS setup for users to adjust. Users can set them in the BIOS options to turn off or turn on certain functions of the server, such as CMOS settings (such as date, time, hardware timing, and monitor display mode, etc.), CPU (Central Processing Unit) operating frequency, operating voltage settings, temperature protection settings, power management settings, etc.
[0064] The second controller may be a baseboard management controller (BMC), through which a user may remotely monitor the operating status of the electronic device.
[0065] S20. Obtain target parameters stored in the second controller, where the target parameters are parameters used to set the first system.
[0066] In this embodiment, the target parameter refers to a parameter value to which the firmware parameter of the first system is expected to be adjusted, and there may be one or more firmware parameters to be updated in the first system.
[0067] S30. Based on the target parameters, update the firmware parameters in the register of the first system, wherein the update can make the firmware parameters take effect immediately after the update.
[0068] In this embodiment, the firmware parameter refers to a parameter in the firmware system whose setting value needs to be changed. Taking the firmware system as a BIOS system as an example, the BIOS parameter to be updated in the BIOS system is a BIOS parameter whose parameter value needs to be modified and which is input or set by a user.
[0069] Specifically, after the first system obtains the target parameter of the firmware parameter to be adjusted, the value of the firmware parameter stored in the register corresponding to the first system can be updated to the target parameter. After the first system modifies the value of the firmware parameter to be updated to the required target parameter, the target parameter of the firmware parameter of the first system takes effect.
[0070] S40: Controlling the processor of the first system to leave the first working mode.
[0071] In this embodiment, after the processor of the first system completes the update of the firmware parameters, it needs to leave the first working mode, that is, return to the normal working state.
[0072] The control method controls the working mode of the processor of the first system according to the instruction of the second controller and updates the firmware parameters of the first system, specifically including:
[0073] When the second controller detects that the state of the first system needs to be changed, it sends a first control signal. The first system receives the first control signal and identifies that it needs to enter the first working mode.
[0074] After entering the first working mode, the first system obtains the target parameters from the second controller. Then, the first system updates the firmware parameters in the register, and these parameters take effect immediately. Finally, after the processor of the first system completes the update of the firmware parameters, it returns to the normal working state.
[0075] The processor of the first system of the present application can quickly respond to the first control signal and switch to the specified first working mode, which helps to improve the response speed and efficiency of the first system. Through the control of the second controller, the behavior of the first system can be adjusted remotely or automatically, increasing the flexibility of operation.
[0076] Furthermore, firmware parameter updates can take effect immediately, meaning that the first system can be configured without restarting, reducing downtime. Furthermore, since updates are immediately effective, the risk of system errors or failures caused by inconsistent parameters is reduced.
[0077] This application is suitable for scenarios that require remote management or automated control, such as server cluster management, embedded system control, etc. In this way, system administrators or automated scripts can remotely adjust system configurations without directly intervening in physical devices.
[0078] Exemplarily, the first system is a basic input output system (hereinafter referred to as BIOS), and the second controller is a baseboard management controller (hereinafter referred to as BMC).
[0079] The control method specifically includes: the BMC monitors the hardware status of the BIOS, and when it is detected that the BIOS settings need to be updated, the BMC sends a first control signal to the BIOS to instruct the processor of the BIOS to enter a specific working mode.
[0080] The BIOS responds to the first control signal and switches the processor to the first working mode. The BIOS obtains the target parameters from the BMC and prepares to update. The BIOS updates the firmware parameters, and the update takes effect immediately, that is, no restart is required. The BIOS controls the processor to exit the first working mode.
[0081] BIOS updates controlled by BMC ensure that system security settings are applied in a timely manner. Real-time updates of BIOS parameters improve system flexibility and responsiveness.
[0082] In one embodiment, if Figure 2 As shown, the method also includes:
[0083] S01. The second controller obtains target parameters of firmware parameters to be updated in the first system.
[0084] In this embodiment, the second controller obtains target parameters of firmware parameters to be updated in the first system, which are new settings or configurations required during the update process.
[0085] S02. When the second controller completes storing the target parameter, the second controller generates the first control signal, wherein the first control signal is a system management interrupt indication.
[0086] In this embodiment, after the second controller successfully acquires and stores the target parameter, the second controller generates a system management interrupt indication and sends it to the first system, wherein the system management interrupt indication is System Management Interrupt-SMI or System Control Interrupt-SCI.
[0087] S03. Send the first control signal to the first system, where the first control signal is used to control the processor of the first system to be in a system management mode.
[0088] In this embodiment, the second controller sends the system management interrupt indication to the first system, so that the processor of the first system enters the system management mode. When sending the SMI or SCI interrupt, it can be triggered by GPIO (General Purpose Input / Output) to achieve direct connection; or it can be transferred and stored through hardware such as FPGA (Field-Programmable Gate Array) to ensure accurate transmission and processing of the interrupt signal.
[0089] The system management interrupt indication can trigger the processor of the first system to enter the system management mode (System Management Mode, SMM), so that the first system can take over the corresponding processing operation. The system management mode (System Management Mode, SMMP) is a special processor state, usually used by system management software (such as BIOS or UEFI) to perform hardware-related tasks, such as power management, system security, etc., allowing low-level system configuration and updates.
[0090] Exemplarily, the first system is a basic input and output system (hereinafter referred to as BIOS), the second controller is a baseboard management controller (hereinafter referred to as BMC), and the control method specifically includes:
[0091] The BMC obtains target parameters required for firmware parameter update from a preset configuration source, and stores the obtained target parameters locally (eg, BMC ROM or EMMC) in preparation for update.
[0092] The BMC generates a system management interrupt indication (hereinafter referred to as SMI) as the first control signal and sends it to the BIOS, triggering the processor to enter the system management mode. At this time, the BIOS can directly modify the register without powering on and off the register again. Through this process, the BMC can effectively manage and control the firmware update of the BIOS to ensure that the stability and security of the first system are maintained.
[0093] The automated update process of the present application reduces human errors and ensures timely update of firmware parameters. The processor of the first system directly enters the system management mode through the SMI, which improves the efficiency and security of the update process. Updates are performed in the system management mode to reduce the impact on normal operations, thereby reducing system downtime. In addition, timely updating of firmware parameters helps improve the stability and security of the system, especially when patching known vulnerabilities.
[0094] In one embodiment, if Figure 3 As shown, the second controller obtains the target parameters of the firmware parameters to be updated in the first system, including:
[0095] S011. The second controller obtains a setting list, wherein the setting list includes at least one first parameter.
[0096] In this embodiment, the second controller obtains a setting list from a configuration source (which may be user input, a configuration file, or a remote server), and the setting list includes one or more first parameters that need to be updated in the first system. The present application allows obtaining configuration lists from different sources and converting them into a format suitable for use by the first system, thereby increasing the flexibility of operation.
[0097] For example, when the first system is a basic input and output system (hereinafter referred to as BIOS) and the second controller is a baseboard management controller (hereinafter referred to as BMC), the user transmits the setting in plain text, "BIOS option name" = "setting value" to the BMC through the redfish interface or BMC web. It can also be sent in cipher text.
[0098] For example, "Ac Loss Control" = "Always On",
[0099] "MCA error thresh count"="0xFF5";
[0100] Or, via IPMI command OEM_COMMAND WRITE_COMMAND BIOS_OPTION1BIOS_DATA_LENGTH1 BIOS_DATA_0BIOS_DATA_2…BIOS_OPTION2BIOS_DATA_LENGHTH2 BIOS_DATA0 BIOS_DATA2….
[0101] For example, Ipmitool raw 0x3a 0x50 0x01[1]0x01[2]0x0[3]0x02[1]0x02[2]0xff[3]0xf5[3];
[0102] [1] "Ac Loss Control" corresponds to 0x01, and "MCA error thresh count" corresponds to 0x02;
[0103] [2] The length of "Ac Loss Control" data is 0x01, and the length of "MCA error thresh count" data is 0x02;
[0104] [3] "Ac Loss Control" data 0x0 means "Always On", and "MCA error thresh count" data 0xff 0xf5 is a numerical value.
[0105] S012. Based on a first target format, convert the first parameter into the target parameter and store the parameter, wherein the data format of the target parameter is different from or the same as that of the first parameter.
[0106] In this embodiment, the second controller converts the acquired first parameter into a target parameter. If the data format of the target parameter may be different from the data format of the first parameter, conversion is required. If the data format of the target parameter may be the same as the data format of the first parameter, consistency needs to be confirmed to avoid errors caused by data format mismatch. The converted target parameter is stored for subsequent use in updating the firmware parameters in the first system.
[0107] The second controller (such as a baseboard management controller BMC) of the present application manages and updates the firmware parameters in the first system (such as a BIOS system), including obtaining a setting list, converting a parameter format, and storing target parameters.
[0108] Specifically, the second controller obtains a setting list containing first parameters from a configuration source. For each first parameter, the second controller converts according to the target format requirement. During the conversion process, the second controller verifies the consistency of the target parameter with the first parameter. The converted target parameter is stored in a storage medium of the second controller.
[0109] Through this process, the second controller can ensure that the firmware parameters in the first system are up to date and consistent with the requirements of the first system, thereby improving the stability and performance of the entire system
[0110] Exemplarily, the first system is a basic input and output system (hereinafter referred to as BIOS), the second controller is a baseboard management controller (hereinafter referred to as BMC), and the control method specifically includes:
[0111] The value of a first parameter of at least one BIOS parameter configured by a user for the BIOS system is obtained through the operating system, and the value of the first parameter of the at least one BIOS parameter is stored in the baseboard management controller.
[0112] After obtaining the first parameter of the at least one BIOS parameter, the baseboard management controller converts the first parameter into a format to obtain a target parameter, the format of the target parameter is an IPMI command format, and stores the target parameter. When the storage is completed, the baseboard management controller generates a system management interrupt indication.
[0113] Among them, the first parameter is set by the user through the redfish interface or BMC web, and needs to be converted into the IPMI command format; if the first parameter is set by the user through the IPMI command, no conversion is required.
[0114] For example, the first parameter is "Ac Loss Control"="Always On", "MCA error threshcount"="0xFF5", and the first parameter is format-converted to obtain a target parameter, and the target parameter is 0x01 0x01 0x0 0x02 0x02 0xff 0xf5.
[0115] In one embodiment, if Figure 4 As shown, the obtaining of the target parameter stored by the second controller includes:
[0116] S21. After the processor controlling the first system is in a first working mode, a response program is started.
[0117] In this embodiment, in order to enable the first system to promptly confirm that the target parameter of the firmware parameter changed by the user exists in the second controller, in this application, the second controller may be used to trigger the first system to obtain the target parameter of the firmware parameter.
[0118] The second controller sends a first control signal to enable the processor of the first system to enter a specific working mode so that the first system can safely perform operations such as firmware update or system configuration.
[0119] Once the processor is in the first working mode, the first system will start a preset response program. This program is specifically used to process the target parameters from the second controller. For example, when the system management interrupt indication is SMI, the response program is the SMI response program; when the system management interrupt indication is SCI, the response program is the GPE handle program.
[0120] S22. The response program obtains target parameters stored in the second controller based on a second target format, wherein the first target format is the same as the second target format.
[0121] In this embodiment, the responder obtains the stored target parameters from the second controller according to the second target format. The "first target format" and "second target format" here refer to the data formats of the parameters, which are the same, which means that the responder can directly use these parameters without additional conversion.
[0122] Specifically, the second controller prepares the target parameters and waits for the first system to enter an appropriate working mode. The processor of the first system enters the first working mode according to the instruction of the second controller.
[0123] In the first working mode, the first system starts a response program and prepares to receive target parameters. The response program obtains the target parameters from the second controller according to a second target format, wherein the second target format is an IPMI command format.
[0124] This application ensures that the responder can obtain and process the target parameters in the correct format, reducing the risk of errors and inconsistencies.
[0125] Exemplarily, the first system is a basic input and output system (hereinafter referred to as BIOS), the second controller is a baseboard management controller (hereinafter referred to as BMC), the system management interrupt indication is SMI, the response program is an SMI response program, and the control method specifically includes:
[0126] The processor of the first system responds to the system management interrupt indication, controls the processor to be in the system management mode, and the BIOS starts the SMI response program in the system management mode, and the SMI response program obtains the value of the target parameter of the at least one BIOS parameter from the baseboard management controller through the IPMI command format. For example, the obtained target parameter is 0x01 0x01 0x00x02 0x02 0xff 0xf5, and its corresponding first parameter is Ipmitool raw 0x3a 0x51.
[0127] In one embodiment, if Figure 5 As shown, updating the firmware parameters in the register of the first system based on the target parameters includes:
[0128] S31. Store the target parameter in a register of the first system, so that the firmware parameter is in a valid state after being updated.
[0129] In this embodiment, the register is a fast storage resource inside the processor, which is used to temporarily store key data. Storing the target parameters in the register can ensure that the update of the firmware parameters takes effect immediately without additional steps. The register of the first system can be MSR or CPUID or MMIO or PCIe Configuration space register or IO, etc.
[0130] Specifically, the system finds the corresponding register through the target parameter, and then instructs the corresponding response program through the system management interrupt to write the value of the target parameter into the register to realize instant modification of the set value. At this time, because the modification has been completed at the hardware level, the modified set value can take effect immediately.
[0131] In the present application, by storing the target parameters in registers, the update of the firmware parameters can take effect immediately, thereby improving the response speed of the first system.
[0132] After the first system is restarted, the register value may be lost, resulting in the inability to implement the functions required by the user. Figure 5 As shown, the method also includes:
[0133] S32. While storing the target parameter in the register of the first system, the target parameter is stored in the non-volatile memory of the first system, so that the firmware parameter is in a valid state after the first system is restarted.
[0134] In this embodiment, in addition to storing the target parameters in the register, the method also includes storing the target parameters in a non-volatile memory of the first system. Non-volatile memory refers to a storage device that can keep data from being lost in the event of a power outage, such as a hard disk, a solid-state drive, or a flash memory. The purpose of this is to ensure that the update of the firmware parameters remains valid even after the first system is restarted. Among them, the non-volatile memory of the present application can be a BIOS ROM.
[0135] The present application ensures that the firmware parameter update is still valid after the first system restart by storing the target parameters in a non-volatile memory, thereby enhancing the data persistence. This method improves the reliability of system updates because the updated firmware parameters will not be lost even in the event of an unexpected restart.
[0136] In one embodiment, if Figure 6 As shown, updating the firmware parameters in the register of the first system based on the target parameters includes:
[0137] S311. Write the target parameter into a register of the first system.
[0138] In this embodiment, the target parameters are written into the register of the first system, which is the first step of updating the firmware parameters.
[0139] S312, read the register.
[0140] S313: When the read content is identical to the written content, it is determined that the firmware parameter of the register of the first system is updated successfully.
[0141] In this embodiment, in order to verify the success of the write operation, the first system reads the register content just written in. By comparing the read content with the written content, the first system determines whether the firmware parameters are successfully updated.
[0142] Specifically, the second controller prepares the target parameters and sends them to the first system. The first system writes the target parameters into its register. The first system reads the register content and compares it with the written content. If the verification succeeds, the first system generates an update status indicating success; if it fails, it generates an update status indicating failure.
[0143] This application enhances the reliability of the system by verifying the update process to ensure that the firmware parameters are updated correctly.
[0144] For example, the target parameter is "Ac Loss Control" = "Always On". In AMD Genoa, write the corresponding register ACPI_MMIO_BASE+PMIO_BASE+
[0145] FCH_PMIOA_REG5B=0000 0101b, then read the register. If the read content is the same as the written content, it is judged that the register is written successfully, that is, the firmware parameters are updated successfully.
[0146] The target parameter is "MCA error thresh count" = "0xFF5". In AMD Genoa, the corresponding registers are multiple MSRs. Write the corresponding register MSRC000_2003[32:43] = 0Xff5, and then read the register. If the read content is the same as the written content, it is determined that the register is written successfully, that is, the firmware parameter is updated successfully.
[0147] In another embodiment, the corresponding non-volatile memory is L"AmdSetup", and the location is CBS_CONFIG.CbsCmnFchSystemPwrFailShadow. The variable is written to 1 using the SetVariable program interface. If the program returns success, it is determined that the writing of the non-volatile memory is successful.
[0148] Or, the corresponding non-volatile memory is L"AmdSetup", the location is
[0149] CBS_CONFIG.CbsCmnCpuMcaErrThreshCount. Use the SetVariable program interface to write this variable = 0xff5. If the program returns success, it is determined that the writing of the non-volatile memory is successful.
[0150] In one embodiment, if Figure 7 As shown, the method also includes:
[0151] S50: The first system generates an update status, wherein the update status is used to indicate whether the firmware parameter update is successful or failed.
[0152] In this embodiment, the firmware parameter updated by the first system is one or more, and accordingly, the update status includes the update result of the one or more firmware parameters.
[0153] S60: Send the update status to the second controller.
[0154] In this embodiment, the first system generates an update status indicating whether the firmware update is successful or failed. The first system sends the update status to the second controller for further processing.
[0155] The generation and transmission of the update status of the present application provides feedback to the second controller, so that the second controller can respond to the update result.
[0156] Exemplarily, the update status is Ipmitool raw 0x3a 0x52 STATUS_LENGTH[6]STATUS1[5]STATUS2 STATUS3..., wherein [6]STATUS_LENGTH is the number of target parameters obtained from the second controller, and [5]0:SUCCESS, 1:FAIL.
[0157] In another embodiment, the update status includes:
[0158] Register setting is successful; register setting fails, where register setting failure includes the following:
[0159] 1: Register setting failed (there is a corresponding register, but the read content and the written content do not match);
[0160] 2: There is no corresponding register for this target parameter.
[0161] In yet another embodiment, the update status further includes:
[0162] The non-volatile memory setting is successful; the non-volatile memory setting fails, wherein the non-volatile memory setting failure includes:
[0163] 1: Non-volatile memory setting failed (there is a corresponding non-volatile memory, but the write program returns failure);
[0164] 2: There is no corresponding non-volatile memory for this target parameter.
[0165] In one embodiment, if Figure 7 As shown, the method also includes:
[0166] S70: The second controller generates a second control signal based on the update status and sends the second control signal to the first system.
[0167] In this embodiment, whether the update is successful is determined by the update status, and re-update is performed when necessary. When the update status includes that at least one target parameter fails to be updated, the second controller generates a second control signal.
[0168] Specifically, if the update of the firmware parameters is successful, the second control signal generated by the second controller is used to feed back the setting status to the user, and at the same time control the processor of the first system to exit the first working mode.
[0169] If the update of the firmware parameters fails, the second control signal generated by the second controller is used to update the firmware parameters that failed to be updated in the first system again.
[0170] S80. The first system updates firmware parameters in registers of the first system based on the second control signal and the target parameter, wherein the firmware parameters are firmware parameters that fail to update.
[0171] In this embodiment, the second controller sends the second control signal back to the first system, and the first system attempts to update the firmware parameters again according to the second control signal and the target parameters.
[0172] Specifically, the second controller generates a second control signal according to the update status and sends it back to the first system. If the update fails, the first system tries to update the firmware parameters again according to the second control signal and the target parameters.
[0173] The first system of the present application is capable of performing recovery operations when an update fails. The entire update process is automated, reducing manual intervention and improving efficiency.
[0174] In some embodiments, the user can preset the number of times to try to update the firmware parameters again after an update fails, for example, set it to 1 time. When the update fails, the first system attempts to update the firmware parameters again. If it is still unsuccessful at this time, the first system confirms the final status of the firmware parameters and records the information of update success or failure.
[0175] In another embodiment, after receiving the update status, the second controller directly feeds back to the user to inform him whether the setting is successful. The notification content is as follows:
[0176] register Non-volatile memory Option1 PASS / FAIL / NOT SUPPORT PASS / FAIL / NOT SUPPORT Option2 PASS / FAIL / NOT SUPPORT PASS / FAIL / NOT SUPPORT
[0177] In one embodiment, the control method specifically includes:
[0178] The second controller obtains a setting list from the configuration source to confirm that there are firmware parameters to be updated in the first system. At this time, the second controller converts the format of at least one first parameter included in the setting list based on the first target format to obtain the corresponding target parameter, and stores the target parameter in the memory of the second controller. When the second controller completes storing the target parameter, it generates a first control signal and sends it to the first system.
[0179] The first system receives the first control signal and identifies that it needs to enter the first working mode. After the processor of the first system enters the first working mode, the response program is started, and the response program obtains the target parameter from the second controller through the second target format.
[0180] The first system updates the firmware parameters in the register based on the target parameters, that is, writes the target parameters into the register of the first system. The register is read, and when the read content is the same as the written content, it is determined that the firmware parameters of the register of the first system are successfully updated, and these parameters take effect immediately.
[0181] After updating the firmware parameters, the first system generates an update status and sends it to the second controller, so that the second controller generates a second control signal, and the second control signal is used to update the firmware parameters again (update the firmware parameters that failed), or control the first system to exit the first working mode.
[0182] After the processor of the first system completes the update of the firmware parameters, it returns to the normal working state. In addition to modifying the register, the non-volatile memory can also be modified so that the firmware parameters are in effect at the moment or after the first system is restarted.
[0183] For example, Fig. 9 As shown, the first system is a basic input and output system (hereinafter referred to as BIOS), the second controller is a baseboard management controller (hereinafter referred to as BMC), and the first control signal is a system management interrupt indication (hereinafter referred to as SMI).
[0184] Specifically, the user sends the settings to the BMC in plain text through the redfish interface or the BMC web, and the setting list is: "Ac Loss Control" = "Always On", "MCA error thresh count" = "0xFF5".
[0185] At this time, the BMC confirms that the BIOS has firmware parameters to be updated. The BMC first converts the format of at least one first parameter included in the setting list to obtain a corresponding target parameter, which is: 0x01 0x01 0x0 0x02 0x020xff 0xf5.
[0186] The target parameters are stored in the BMC memory in the IPMI command format. When the BMC completes storing the target parameters, it generates an SMI and sends it to the BIOS to notify the BIOS that the target parameters are ready.
[0187] After receiving SMI, BIOS controls CPU to enter system management mode and starts SMI responder. SMI responder obtains target parameters from BMC through IPMI command format. This application sets a wide range of registers through SMI, such as MSR, CPUID, etc., and NVRAM (non-volatile storage area) can also be set.
[0188] BIOS modifies the firmware parameters of the register according to the target parameters, and writes the first modification item ("AcLoss Control" = "Always On") modified by the user into the corresponding register
[0189] ACPI_MMIO_BASE+PMIO_BASE+FCH_PMIOA_REG5B=0000 0101b, then read the register. If the read content is the same as the written content, it is determined that the register is written successfully. Write the second modification item modified by the user ("MCA error thresh count"="0xFF5") to the corresponding register MSRC000_2003[32:43]=0Xff5, then read the register. If the read content is the same as the written content, it is determined that the register is written successfully.
[0190] After the BIOS updates the firmware parameters, it generates an update status in the IPMI command format and sends it to the BMC, so that the BMC generates a second control signal according to the update status and sends it to the BIOS.
[0191] If the update status includes at least one target parameter that failed to update, the second control signal is used to enable the BIOS to continue updating the firmware parameters. If the update status is that all target parameters are successfully updated, the second control signal is used to feedback the setting status to the user, and at the same time, the BIOS exits the first working mode.
[0192] In another embodiment, the process of writing the target parameters into the non-volatile memory refers to the process of writing the target parameters into the register in the present application.
[0193] This application uses specific tools under the operating system to implement the modification of BIOS option setting values, and the modified BIOS setting values take effect immediately. This process does not require restarting the BIOS system, and does not require entering the BIOS Setup interface to find the corresponding options, saving at least one system restart time, reducing the difficulty of system maintenance for operation and maintenance personnel, greatly improving work efficiency, and at the same time improving the operability and serviceability of the server, enhancing product quality, and improving customer satisfaction.
[0194] The present application also provides a control device, such as Figure 8 As shown, including:
[0195] a response module, configured so that the first system responds to a first control signal sent by the second controller, wherein the first control signal is used to control a processor of the first system to be in a first working mode;
[0196] an acquisition module, configured to acquire a target parameter stored in the second controller, wherein the target parameter is a parameter used to set the first system;
[0197] An update module configured to update firmware parameters in registers of the first system based on the target parameters, wherein the update enables the firmware parameters to be in a valid state immediately after the update;
[0198] A control module is configured to control the processor of the first system to leave the first working mode.
[0199] It should be noted that the principle of solving the technical problem by the control device provided in the embodiment of the present application is similar to the control method provided in the embodiment of the present application. Therefore, the implementation of the control device provided in the embodiment of the present application can refer to the implementation of the control method provided in the embodiment of the present application, and the repeated parts will not be repeated.
[0200] The present application also provides an electronic device, which can be any type of electronic device, and the electronic device at least includes a memory and a processor, wherein the processor is used to execute the firmware parameter update control method in any of the above embodiments. The memory is used to store programs required for the processor to perform operations. The electronic device may also include a display unit and an input unit, etc.
[0201] The processor may be a general purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The general purpose processor may be a microprocessor or any conventional processor.
[0202] Since the electronic device introduced in the embodiments of the present application is an electronic device provided with a memory for implementing the method disclosed in the embodiments of the present application, based on the method introduced in the embodiments of the present application, technical personnel in this field can understand the structure and deformation of the electronic device introduced in the embodiments of the present application, so it is not repeated here.
[0203] Another embodiment of the present application further provides a storage medium, which includes a stored program, wherein when the program is executed, a device including the storage medium is controlled to execute the control method as described in any one of the above embodiments.
[0204] The storage medium in this embodiment may be included in the electronic device, or may exist independently without being installed in the electronic device. The storage medium carries one or more computer programs, and when the one or more computer programs are executed, any step of the control method provided in the embodiment of the present application is implemented.
[0205] It should be understood that each scheme in this embodiment has the corresponding technical effects in the above method embodiment, which will not be repeated here.
[0206] The embodiment of the present application also provides a computer program product, which is tangibly stored on a computer-readable medium and includes computer-readable instructions, and when the computer-executable instructions are executed, at least one processor executes the control method in the embodiment described above. It should be understood that each solution in this embodiment has the corresponding technical effect in the above method embodiment, which will not be repeated here.
[0207] It should be noted that the computer storage medium of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the above two. The computer readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access storage medium (RAM), a read-only storage medium (ROM), an erasable programmable read-only storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only storage medium (CD-ROM), an optical storage medium, a magnetic storage medium, or any suitable combination of the above.
[0208] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program configured to be used by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, antenna, optical cable, RF, etc., or any suitable combination of the above.
[0209] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.
Claims
1. A control method, include: The first system responds to a first control signal sent by the second controller, wherein the first control signal is used to control a processor of the first system to be in a first working mode; Acquire a target parameter stored in the second controller, where the target parameter is a parameter used to set the first system; Based on the target parameters, updating the firmware parameters in the register of the first system, wherein the updating can make the firmware parameters effective immediately after the updating; The processor controlling the first system leaves the first operating mode.
2. The control method according to claim 1, wherein the method further comprises: include: The second controller obtains a target parameter of a firmware parameter to be updated in the first system; When the second controller completes storing the target parameter, the second controller generates the first control signal, wherein the first control signal is a system management interrupt indication; The first control signal is sent to the first system, where the first control signal is used to control a processor of the first system to be in a system management mode.
3. The control method according to claim 2, wherein the second controller obtains a target parameter of a firmware parameter to be updated in the first system, include: The second controller acquires a setting list, wherein the setting list includes at least one first parameter; Based on a first target format, the first parameter is converted into the target parameter and stored, wherein the data format of the target parameter is different from or the same as that of the first parameter.
4. The control method according to claim 3, wherein the acquiring the target parameter stored in the second controller comprises: include: After the processor controlling the first system is in a first working mode, a response program is started; The response program obtains target parameters stored by the second controller based on a second target format, wherein the first target format is the same as the second target format.
5. The control method according to claim 1, wherein the firmware parameters are updated in the register of the first system based on the target parameters. include: The target parameters are stored in the register of the first system, so that the firmware parameters are in a valid state after being updated.
6. The control method according to claim 5, wherein the method further comprises: include: While storing the target parameter in the register of the first system, the target parameter is stored in the non-volatile memory of the first system, so that the firmware parameter is in a valid state after the first system is restarted.
7. The control method according to claim 1, wherein the firmware parameters are updated in the register of the first system based on the target parameters. include: Writing the target parameter into a register of the first system; reading the register; When the read content is identical to the written content, it is determined that the firmware parameter of the register of the first system is updated successfully.
8. The control method according to claim 7, wherein the method further comprises: include: The first system generates an update status, wherein the update status is used to indicate whether the firmware parameter update is successful or failed; The updated status is sent to the second controller.
9. The control method according to claim 8, wherein the method further comprises: include: The second controller generates a second control signal based on the updated state and sends the second control signal to the first system; The first system updates firmware parameters in registers of the first system based on the second control signal and the target parameters, wherein the firmware parameters are firmware parameters that fail to update.
10. A control device, include: a response module, configured so that the first system responds to a first control signal sent by the second controller, wherein the first control signal is used to control a processor of the first system to be in a first working mode; an acquisition module, configured to acquire a target parameter stored in the second controller, wherein the target parameter is a parameter used to set the first system; An update module configured to update firmware parameters in registers of the first system based on the target parameters, wherein the update enables the firmware parameters to be in a valid state immediately after the update; A control module is configured to control the processor of the first system to leave the first working mode.
