Firmware data burning method and device, electronic equipment and storage medium
By storing and using SPI and I2C interfaces in BIOS for communication, the space and cost problems of Type-C management chip firmware data storage and burning are solved, and efficient and low-cost firmware data burning is achieved.
Patent Information
- Application Number
- CN202411886127.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-05-16
AI Technical Summary
In the prior art, due to the large size of the firmware data of the Type-C management chip, it cannot be stored in the built-in memory of the embedded control chip, and the external memory solution increases hardware cost and design complexity.
By storing firmware data in the basic input and output system (BIOS), the BIOS communicates with the embedded controller (EC) through the serial peripheral interface bus (SPI), and the EC communicates with the target chip through the serial communication bus (I2C), to realize the burning of firmware data.
This method does not require additional hardware storage firmware, and can efficiently and at low cost to burn firmware data without affecting the space required for BIOS operation, solving the space and cost problems of firmware data storage and burning.
Smart Images

Figure CN120010868A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to a method, device, electronic device and storage medium for burning firmware data. Background Art
[0002] In the design process of electronic devices such as laptops, the Type-C interface is controlled and updated via the firmware of the management chip. As the functions of the Type-C interface become more and more abundant, the firmware of the Type-C management chip is also getting larger. In the related art, some solutions place the firmware of the Type-C management chip in the built-in memory of the EC (embedded control chip), but as the firmware of the Type-C management chip becomes larger and larger, it even exceeds the size required by the EC firmware itself, and it cannot meet the increasing demand for the firmware of the Type-C management chip. Some solutions place the firmware of the Type-C management chip in an external memory. This solution requires the addition of additional hardware, which brings additional expenses to the research and development of electronic equipment or increases the difficulty of design. Summary of the invention
[0003] The present application provides a method, device, electronic device and storage medium for burning firmware data to at least solve the above technical problems existing in the prior art.
[0004] According to a first aspect of the present application, a method for burning firmware data is provided, the method being applied to an electronic device, the electronic device comprising a basic input and output system BIOS, an embedded controller EC and a target chip; the firmware data is stored in the BIOS, the BIOS communicates with the EC via a serial peripheral interface bus SPI, and the EC communicates with the target chip via a serial communication bus I2C; the method comprising:
[0005] Acquire storage data from BIOS via EC and SPI; the storage data includes target firmware data;
[0006] Determine a first pointer position of the EC based on a storage address of the target firmware data in the BIOS;
[0007] extracting target firmware data from the acquired storage data based on the first pointer position of the EC;
[0008] The extracted target firmware data is transferred to the target chip via I2C for burning.
[0009] In one possible implementation manner, the target firmware data includes a plurality of data blocks; and determining the first pointer position of the EC based on the storage address of the target firmware data in the BIOS includes:
[0010] Determine the first pointer position of the EC for each data block based on the storage address of each data block of the target firmware data in the BIOS;
[0011] The step of extracting target firmware data from the acquired storage data based on the first pointer position of the EC includes:
[0012] Based on the first pointer position of the EC for each data block, each data block of the target firmware data is extracted from the acquired storage data.
[0013] In one possible implementation manner, the data block includes first region data and second region data; the extracting each data block of the target firmware data from the acquired storage data based on the first pointer position of the EC for each data block includes:
[0014] For any data block in each data block,
[0015] Extracting data of a first area of the data block based on a first pointer position of the EC for the data block;
[0016] Determine a second pointer position of the EC for the data block based on a first pointer position of the EC for the data block and a length of the first region data;
[0017] Based on the second pointer data of the EC for the data block, the second area data of the data block is extracted.
[0018] In one possible implementation manner, the EC includes a transmission area and a cache area; the step of transmitting the extracted target firmware data to the target chip via I2C for burning includes:
[0019] storing the extracted target firmware data in the cache area, and transmitting the target firmware data in the cache area to the transmission area;
[0020] Based on the transmission area, the extracted target firmware data is transmitted to the target chip via I2C for burning.
[0021] In one possible implementation manner, the first pointer position of the EC for each data block is different.
[0022] In one possible implementation, before acquiring the storage data from the BIOS through the EC and the SPI, the method further includes:
[0023] Get the status information of the target chip;
[0024] When the state information of the target chip indicates that the firmware data does not exist in the target chip or the firmware data is firmware data to be updated, the storage data is obtained from the BIOS through the EC and the SPI.
[0025] According to a second aspect of the present application, a device for burning firmware data is provided, the device being applied to an electronic device, the electronic device comprising a basic input and output system BIOS, an embedded controller EC and a target chip; the firmware data is stored in the BIOS, the BIOS communicates with the EC via a serial peripheral interface bus SPI, and the EC communicates with the target chip via a serial communication bus I2C; the device comprises:
[0026] A first acquisition unit, used to acquire storage data from BIOS through EC and SPI; the storage data includes target firmware data;
[0027] A first determining unit, configured to determine a first pointer position of the EC based on a storage address of the target firmware data in the BIOS;
[0028] an extraction unit, configured to extract target firmware data from the acquired storage data based on the first pointer position of the EC;
[0029] The burning unit is used to transfer the extracted target firmware data to the target chip through I2C for burning.
[0030] In one possible implementation, the target firmware data includes a plurality of data blocks; the first determining unit is used to determine the first pointer position of the EC for each data block based on the storage address of each data block of the target firmware data in the BIOS;
[0031] The extraction unit is used to extract each data block of the target firmware data from the acquired storage data based on the first pointer position of the EC for each data block.
[0032] According to a third aspect of the present application, an electronic device is provided, including:
[0033] at least one processor; and
[0034] a memory communicatively connected to the at least one processor; wherein,
[0035] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present application.
[0036] According to a fourth aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method described in the present application.
[0037] In this application, storage data is obtained from BIOS through EC and SPI; the storage data includes target firmware data; based on the storage address of the target firmware data in BIOS, the first pointer position of EC is determined; based on the first pointer position of EC, the target firmware data is extracted from the obtained storage data; the extracted target firmware data is transmitted to the target chip through I2C for burning. This application does not require the use of additional hardware to store firmware. By storing firmware data in the BIOS of the electronic device, efficient and low-cost burning of firmware data can be achieved without affecting the space required for the operation of the BIOS itself.
[0038] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become readily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, wherein:
[0040] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0041] Figure 1 A schematic diagram of the implementation process of the method for burning firmware data in an embodiment of the present application is shown;
[0042] Figure 2 A schematic diagram of a system block diagram of an electronic device according to an embodiment of the present application is shown;
[0043] Figure 3 A schematic diagram showing data storage in an embodiment of the present application is shown;
[0044] Figure 4 A schematic diagram showing a first pointer position and a second pointer position for target firmware data in storage data in an embodiment of the present application is shown;
[0045] Figure 5 A schematic diagram showing the composition structure of a device for burning firmware data according to an embodiment of the present application is shown;
[0046] Figure 6 A schematic diagram of the structure of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0047] In order to make the purpose, features, and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0048] The embodiment of the present application provides a method for burning firmware data, the method is applied to an electronic device, the electronic device includes a basic input and output system BIOS, an embedded controller EC and a target chip; the firmware data is stored in the BIOS, the BIOS communicates with the EC via a serial peripheral interface bus SPI, and the EC communicates with the target chip via a serial communication bus I2C; Figure 1 As shown, the method includes:
[0049] S101: Acquire storage data from BIOS via EC and SPI; the storage data includes target firmware data.
[0050] The embodiments of the present application are applied to electronic devices, including laptop computers, desktop computers, etc. Figure 2 As shown, Figure 2 This is a schematic diagram of a system block diagram of an electronic device of an embodiment of the present application, wherein the electronic device includes a BIOS (Basic Input / Output System), an EC (Embedded Controller) and a target chip TCMC. Among them, the customized parameters TCMC Config of the target chip are stored in the EC, the firmware data TCMC FW of the target chip is stored in the ROM (Read-Only Memory) of the BIOS, the EC communicates with the target chip via I2C (Inter-Integrated Circuit, serial communication bus), and the EC communicates with the BIOS via SPI (Serial Peripheral Interface, serial peripheral interface bus) (specifically, the EC communicates with the ROM of the BIOS via SPI, and the BIOSROM communicates with the BIOS via SPI).
[0051] Considering that the storage space of BIOS ROM itself is relatively large during the development of electronic devices such as laptops, this application stores the firmware data of the target chip (type-c management chip) in the BIOS, and obtains the firmware data from the BIOS based on EC. However, since EC communicates with the BIOS through SPI, and the access of SPI follows the 1K alignment principle, EC can only retrieve data in integer multiples of 1K when retrieving data from the BIOS, but the firmware data may not be stored at an integer multiple of 1K when stored in the BIOS. Therefore, the target firmware data cannot be directly extracted from the BIOS based on EC and SPI, but the storage data in the BIOS is extracted, and the storage data includes the target firmware data. Reference Figure 3 As shown, Figure 3 The 40 small cells in the whole represent 1K data. In this 1K data, the target firmware data is not stored from the starting position, but in the third small cell of the 1K data, that is, the remaining small cells except the first two small cells in the 40 small cells are all target firmware data. Due to the 1K alignment principle of SPI, EC can only take integer multiples of 1K data from BIOS each time, that is, storage data. The storage data read includes the target firmware data.
[0052] S102: Determine a first pointer position of the EC based on the storage address of the target firmware data in the BIOS.
[0053] In this step, refer to Figure 3 As shown in the figure, since the data to be burned is the target firmware data, the target firmware data needs to be extracted from the storage data of the BIOS. Since the EC obtains the storage data of the BIOS in accordance with the 1K alignment principle, the pointer of the EC naturally points to the starting position of the storage data, that is, Figure 3 The left position of the first small grid in the target chip. However, the data to be burned on the target chip is the target firmware data, so the EC pointer needs to be offset to obtain the first pointer position of the EC. Figure 3 Taking the storage location of the target firmware data shown in the figure as an example, the initial pointer of EC is shifted two small grids to the right to the left position of the third small grid. Figure 3 The left position of the third small grid is the first pointer position of EC.
[0054] S103: extracting target firmware data from the acquired storage data based on the first pointer position of the EC.
[0055] In this step, based on the first pointer position of the EC (the starting position of the target firmware data storage) and the size of the target firmware data, the target firmware data can be extracted from the storage data of the BIOS for burning.
[0056] S104: The extracted target firmware data is transmitted to the target chip via I2C for burning.
[0057] In this application, after the target firmware data is extracted, the target firmware data is transmitted to the target chip via I2C for burning to complete the update or initial burning of the target chip firmware, so as to better manage the type-c interface.
[0058] In the scheme shown in steps S101 to S104, storage data is obtained from BIOS through EC and SPI; the storage data includes target firmware data; based on the storage address of the target firmware data in BIOS, the first pointer position of EC is determined; based on the first pointer position of EC, the target firmware data is extracted from the obtained storage data; the extracted target firmware data is transmitted to the target chip through I2C for burning. This application does not require the use of additional hardware to store firmware. By storing firmware data in the BIOS of the electronic device, efficient and low-cost burning of firmware data can be achieved without affecting the space required for the operation of the BIOS itself.
[0059] In an optional solution, the target firmware data includes a plurality of data blocks; and determining the first pointer position of the EC based on the storage address of the target firmware data in the BIOS includes:
[0060] Determine the first pointer position of the EC for each data block based on the storage address of each data block of the target firmware data in the BIOS;
[0061] The step of extracting target firmware data from the acquired storage data based on the first pointer position of the EC includes:
[0062] Based on the first pointer position of the EC for each data block, each data block of the target firmware data is extracted from the acquired storage data.
[0063] In this application, since the target firmware data may be large as a whole, it may not be transmitted at one time. Therefore, the target firmware data is divided into multiple data blocks. Each data block has a corresponding block number, but the storage position of different data blocks in the BIOS is random. Each data block may be stored in the BIOS in the order of the sequence number, or it may be stored in the BIOS at a fixed address with a sequence number, or it may be stored in the BIOS at an unfixed address with a sequence number, or it may be stored in the BIOS randomly without a sequence number. Therefore, EC obtains the offset pointer position (first pointer position) for each data block according to the actual storage position of each data block in the BIOS, and extracts each data block based on the offset pointer position of each data block and transmits it to the target chip in sequence for burning. Exemplarily, the first data block is extracted and transmitted to the target chip for burning, and then the second data block is extracted and transmitted to the target chip for burning... until all data blocks are extracted and transmitted to the target chip for burning, the burning of the target firmware data is completed. The present application extracts and burns the target firmware data in blocks, thereby avoiding data loss or errors caused by direct transmission of too large target firmware data, and ensuring the integrity and accuracy of firmware data burning.
[0064] In an optional solution, the data block includes first region data and second region data; the extracting each data block of the target firmware data from the acquired storage data based on the first pointer position of each data block of the EC includes:
[0065] For any data block in each data block,
[0066] Extracting data of a first area of the data block based on a first pointer position of the EC for the data block;
[0067] Determine a second pointer position of the EC for the data block based on a first pointer position of the EC for the data block and a length of the first region data;
[0068] Based on the second pointer data of the EC for the data block, the second area data of the data block is extracted.
[0069] In the present application, each data block includes first area data and second area data. Among them, the first area data is the protocol header, and the second area data is the actual firmware data. Assume that there are N data blocks in total, and the first data block is of fixed length, which contains parameters such as the number of subsequent data blocks. The protocol headers of data blocks 1 to (N-1) each contain information such as the data length in the current data block. Data block N contains information about the configuration parameters of the target chip. The length of all data block protocol headers is fixed, and the actual firmware data is a multiple of 1k.
[0070] When extracting each data block, the first area data and the second area data are extracted and transmitted respectively. Figure 4 As shown, assuming Figure 4 The data includes a data block, which is from Figure 4 Starting from the third grid, Figure 4 The last small grid of ends. That is, Figure 4 Except for the first two cells, all the data are from one data block. Figure 4 The first four small grids in the data of a data block are the first area data, and the rest are the second area data. Based on the first pointer position of EC for the data block, the first area data of the data block is extracted and transmitted to the target chip for burning. Then, based on the first pointer position of EC for the data block and the length of the first area data, the second pointer position of EC for the data block, that is, the starting position of the second area data of the data block, is determined, and based on the second pointer data of EC for the data block, the second area data of the data block is extracted and transmitted to the target chip for burning. The present application extracts the first area data and the second area data of each data block respectively and then burns them immediately, further ensuring the integrity and accuracy of the firmware data burning.
[0071] In an optional solution, the EC includes a transmission area and a cache area; the step of transmitting the extracted target firmware data to the target chip via I2C for burning includes:
[0072] storing the extracted target firmware data in the cache area, and transmitting the target firmware data in the cache area to the transmission area;
[0073] Based on the transmission area, the extracted target firmware data is transmitted to the target chip via I2C for burning.
[0074] In the present application, the EC includes a transmission area and a cache area, wherein the cache area is used to cache data to be transmitted to the target chip, and the transmission area is used to transmit the data cached in the cache area to the target chip.
[0075] The embodiment of the present application adopts a ping-pong cache mechanism, and the EC reserves n*2K of SRAM (Static Random Access Memory) space for the update of the target chip firmware and the update of the parameters. When the target chip firmware needs to be updated, the EC will divide the n*2K reserved in the SRAM into two n*1K areas, which are defined as the transmission area and the cache area respectively. When the EC reads the BIOS storage data for the first time, it will read n*2K data and fill the reserved EC SRAM space. Since the valid data first address of the first data block protocol header is not at the first address position of the EC SRAM, when obtaining the valid data of the first data block protocol header, a pointer offset is required to obtain the first pointer position. Starting from the first pointer position, the first address of the SRAM is the first address of the first data block protocol header, because the length and content of the protocol header are fixed. Therefore, according to the address position relationship, various data in the protocol header can be read, including the number of subsequent data blocks, the size of the current data block, the timeout time, the I2C address and other parameters. Then the alignment operation will be performed. EC will calculate the actual firmware data first address of the first data block according to the address of the protocol header part in the current SRAM and the initial offset address, and move the pointer to point the first address of the SRAM to the first address of the actual firmware data of the first data block (the second pointer position). Each time, the complete 1K data is stored in the transmission area reserved by EC. Since the data blocks transmitted by the protocol are integer multiples of 1K, only the transmission area needs to be used for data transmission to complete the transmission of the entire target chip firmware data. After the transmission is completed, the data in the cache area is moved to the transmission area, and the cache area is vacated to wait for the next data cache.
[0076] After each transmission area is sent, a check will be performed, because each data block may be multiple n*1K, and it is necessary to check whether the current data block has been transmitted. If not completed, read the n*1K data to the cache area again. In other words, the transmission area is equivalent to the sending preparation area, and the cache area is equivalent to the read cache area. After the data is aligned in the transmission area, the data of the entire transmission area will be sent. After the sending is completed, it will be checked whether there is any subsequent data. If so, the data in the cache area will be moved to the transmission area and the cache area will be filled again. The operations of reading, aligning, and sending are looped until the transmission of a data block is completed. If there are still data blocks to be transmitted, continue to move n*1K data to the transmission area, and continue the above cycle until all data blocks are transmitted. Not only does it save the cost of research and development and production of electronic equipment, but there is no additional hardware. Integrated management can also be achieved. Compared with the external ROM method, this application uniformly manages firmware through the BIOS upgrade mechanism, reducing the complexity of independent management. In addition, the convenience of firmware updates is improved. When the target chip firmware data needs to be upgraded, the latest firmware can be obtained through the BIOS update mechanism, and then the upgrade can be completed through the EC transfer algorithm, which is completely transparent to the user layer.
[0077] In an optional solution, the first pointer position of the EC for each data block is different.
[0078] In the present application, as mentioned above, each data block has a corresponding block serial number, but the storage positions of different data blocks in the BIOS are random. Each data block may be stored in the BIOS in a sequential order of serial numbers, or may be stored in the BIOS at fixed addresses with intervals between serial numbers, or may be stored in the BIOS at unfixed addresses with intervals between serial numbers, or may be stored in the BIOS randomly without serial numbers. Therefore, the first pointer position of each data block is different.
[0079] In an optional solution, before acquiring the storage data from the BIOS through the EC and the SPI, the method further includes:
[0080] Get the status information of the target chip;
[0081] When the state information of the target chip indicates that the firmware data does not exist in the target chip or the firmware data is firmware data to be updated, the storage data is obtained from the BIOS through the EC and the SPI.
[0082] In this application, before EC obtains storage data from BIOS through SPI, it is also necessary to read the status information of the target chip. Specifically, the EC chip is powered on, and the target chip is powered on through EC control. The current status of the target chip is read to determine whether there is firmware in the target chip. If there is firmware, the version number of the firmware is determined. When the version number of the firmware is not the latest version, it means that the firmware of the current target chip is the firmware data to be updated, and the BIOS ROM is powered on, and the storage data is obtained from the BIOS through EC and SPI, and the aforementioned firmware data burning steps are performed.
[0083] And, if the target chip currently does not have firmware, the BIOS ROM is powered on. The storage data is obtained from the BIOS through EC and SPI, and the aforementioned firmware data burning steps are performed. Each time it is sent, it is checked whether the transmission of all data is completed. After all data is sent, a check is performed. If the check fails, the data needs to be moved from the BIOSROM again. If multiple attempts fail, an error code is thrown and waits for the user engineer to handle it. If the check passes, the firmware data update step of the target chip is ended. It can save space and resources, no additional EC built-in space expenses are required, and the target chip firmware can be moved with only as little as 2K space through the new transfer algorithm. And the configuration parameters of the target chip are managed by EC, making parameter updates and adjustments more flexible. EC can control the configuration of the target chip in real time through parameter configuration, giving users a better experience. At the same time, EC manages and configures the firmware data, which can better perform version control and consistency checks and improve the stability of the system. And through the security measures taken by EC, the risk of firmware data and configuration being tampered with is reduced, and the security of the system is improved. Efficient and low-cost burning of firmware data is achieved.
[0084] The embodiment of the present application also provides a device for burning firmware data, the device is applied to an electronic device, the electronic device includes a basic input and output system BIOS, an embedded controller EC and a target chip; the firmware data is stored in the BIOS, the BIOS communicates with the EC via a serial peripheral interface bus SPI, and the EC communicates with the target chip via a serial communication bus I2C; Figure 5 As shown, the device comprises:
[0085] A first acquisition unit 501 is used to acquire storage data from BIOS via EC and SPI; the storage data includes target firmware data;
[0086] A first determining unit 502, configured to determine a first pointer position of the EC based on a storage address of the target firmware data in the BIOS;
[0087] An extraction unit 503, configured to extract target firmware data from the acquired storage data based on the first pointer position of the EC;
[0088] The burning unit 504 is used to transmit the extracted target firmware data to the target chip through I2C for burning.
[0089] In an optional solution, the target firmware data includes multiple data blocks; the first determining unit 502 is used to determine the first pointer position of the EC for each data block based on the storage address of each data block of the target firmware data in the BIOS;
[0090] The extraction unit 503 is used to extract each data block of the target firmware data from the acquired storage data based on the first pointer position of each data block of the EC.
[0091] In an optional scheme, the data block includes first area data and second area data; the extraction unit 503 is used to extract the first area data of the data block for any data block in each data block based on the first pointer position of EC for the data block; determine the second pointer position of EC for the data block based on the first pointer position of EC for the data block and the length of the first area data; and extract the second area data of the data block based on the second pointer data of EC for the data block.
[0092] In an optional solution, the EC includes a transmission area and a cache area; the burning unit 504 is used to store the extracted target firmware data in the cache area, and to transfer the target firmware data in the cache area to the transmission area; based on the transmission area, the extracted target firmware data is transmitted to the target chip via I2C for burning.
[0093] In an optional solution, the first pointer position of the EC for each data block is different.
[0094] In an optional solution, the device further includes:
[0095] The second acquisition unit is used to acquire the state information of the target chip; when the state information of the target chip indicates that there is no firmware data in the target chip or the firmware data is firmware data to be updated, the storage data is acquired from the BIOS through EC and SPI.
[0096] It should be noted that the firmware data burning device of the embodiment of the present application solves the problem in a similar principle to the aforementioned firmware data burning method. Therefore, the implementation process, implementation principle, and beneficial effects of the firmware data burning device can all be referred to the description of the implementation process, implementation principle, and beneficial effects of the aforementioned method, and the repeated parts will not be repeated.
[0097] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
[0098] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0099] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0100] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0101] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as a method for burning firmware data. For example, in some embodiments, the method for burning firmware data may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the method for burning firmware data described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the method for burning firmware data in any other appropriate manner (e.g., by means of firmware).
[0102] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0103] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0104] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0105] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0106] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0107] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0108] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0109] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0110] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for burning firmware data, characterized in that: The method is applied to an electronic device, which includes a basic input and output system BIOS, an embedded controller EC and a target chip; the firmware data is stored in the BIOS, the BIOS communicates with the EC via a serial peripheral interface bus SPI, and the EC communicates with the target chip via a serial communication bus I2C; the method includes: Acquire storage data from BIOS via EC and SPI; the storage data includes target firmware data; Determine a first pointer position of the EC based on a storage address of the target firmware data in the BIOS; extracting target firmware data from the acquired storage data based on the first pointer position of the EC; The extracted target firmware data is transferred to the target chip via I2C for burning.
2. The method according to claim 1, characterized in that The target firmware data includes a plurality of data blocks; and determining the first pointer position of the EC based on the storage address of the target firmware data in the BIOS includes: Determine the first pointer position of the EC for each data block based on the storage address of each data block of the target firmware data in the BIOS; The step of extracting target firmware data from the acquired storage data based on the first pointer position of the EC includes: Based on the first pointer position of the EC for each data block, each data block of the target firmware data is extracted from the acquired storage data.
3. The method according to claim 2, characterized in that The data block includes first area data and second area data; the extracting each data block of the target firmware data from the acquired storage data based on the first pointer position of each data block by EC includes: For any data block in each data block, Extracting data of a first area of the data block based on a first pointer position of the EC for the data block; Determine a second pointer position of the EC for the data block based on a first pointer position of the EC for the data block and a length of the first region data; Based on the second pointer data of the EC for the data block, the second area data of the data block is extracted.
4. The method according to any one of claims 1 to 3, characterized in that: The EC includes a transmission area and a cache area; the extracted target firmware data is transmitted to the target chip through I2C for burning, including: storing the extracted target firmware data in the cache area, and transmitting the target firmware data in the cache area to the transmission area; Based on the transmission area, the extracted target firmware data is transmitted to the target chip via I2C for burning.
5. The method according to claim 3, characterized in that: The first pointer position of the EC is different for each data block.
6. The method according to claim 1, characterized in that Before acquiring the storage data from the BIOS through the EC and the SPI, the method further includes: Get the status information of the target chip; When the state information of the target chip indicates that the firmware data does not exist in the target chip or the firmware data is firmware data to be updated, the storage data is obtained from the BIOS through the EC and the SPI.
7. A device for burning firmware data, characterized in that: The device is applied to an electronic device, which includes a basic input and output system BIOS, an embedded controller EC and a target chip; the firmware data is stored in the BIOS, the BIOS communicates with the EC via a serial peripheral interface bus SPI, and the EC communicates with the target chip via a serial communication bus I2C; the device includes: A first acquisition unit, used to acquire storage data from BIOS through EC and SPI; the storage data includes target firmware data; A first determining unit, configured to determine a first pointer position of the EC based on a storage address of the target firmware data in the BIOS; an extraction unit, configured to extract target firmware data from the acquired storage data based on the first pointer position of the EC; The burning unit is used to transfer the extracted target firmware data to the target chip through I2C for burning.
8. The device according to claim 7, characterized in that The target firmware data includes a plurality of data blocks; the first determining unit is used to determine the first pointer position of the EC for each data block based on the storage address of each data block of the target firmware data in the BIOS; The extraction unit is used to extract each data block of the target firmware data from the acquired storage data based on the first pointer position of the EC for each data block.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1-6.
Citation Information
Cited By
SPD burning method and system based on serial port instruction and embedded controller
CN120704600A