Updating method and system for SBL startup firmware, terminal and storage medium

By saving and writing TSN MAC data during the SBL update process, the problem of MAC address loss caused by SBL update is solved, ensuring the stability of the MAC address and enhancing the market competitiveness of the product.

CN120560682APending Publication Date: 2025-08-29JWIPC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510629903.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

When updating the SBL boot firmware, the TSN MAC address will be overwritten and lost, resulting in the problem of re-restore of the MAC address.

Method used

During the update process, the old version of SBL content in the BIOS chip is read, the TSN MAC data is saved to the memory space, and when the new content is flushed, the TSN MAC data in the memory space is written to the BIOS chip, and the CMOS register 0xF0 is used as the identifier to control the data writing process.

Benefits of technology

It realizes that the TSN MAC address is not lost when updating the SBL, solves the problem of loss of MAC addresses, and improves the market competitiveness and popularity of the product.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120560682A_ABST
    Figure CN120560682A_ABST
Patent Text Reader

Abstract

The invention relates to an updating method and system for SBL startup firmware, a terminal and a storage medium. Judging whether current updating is full-area updating or not, if yes, reading old-version SBL content in the BIOS chip, searching TSN MAC data in the old-version SBL content, storing the TSN MAC data in a memory space, flashing 4KB-size SBL content every time, and judging whether a CMOS register 0xF0 is 2 or not; if yes, the TSN MAC data in the memory space are written into a BIOS chip, and a CMOS register 0xF0 is reset; otherwise, whether the first four characters of the content of the BIOS chip are IPFW or not is judged, and if the first four characters of the content of the BIOS chip are IPFW, the CMOS register 0xF0 is set to 2; continuing to write the current SBL content with the size of 4KB into the BIOS chip; the problem that when a product uses the TSN in the SBL, the MAC address of the TSN is lost due to updating of the SBL, and the MAC address needs to be recovered again is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of SBL startup firmware update, and more particularly to an SBL startup firmware update method, system, terminal and storage medium. Background Art

[0002] SBL (Slim Bootloader), an open-source boot firmware, is a type of BIOS (Basic Input & Output System). Time Sensitive Networking (TSN), a suite of protocols for achieving deterministic minimal latency in non-deterministic Ethernet networks, is a feature of Industrial IoT solutions. Embedded in SBL, it can be used as Ethernet. TSN brings industrial-grade stability and reliability to Ethernet, providing time synchronization and IEEE (Institute of Electrical and Electronic Engineers) open standard communication protocols.

[0003] A MAC address (Media Access Control Address) is an address used to locate a network device and uniquely identifies a network card within the network. All products using TSN functionality must provide a unique TSN MAC address.

[0004] For products using SBL, after the production line individually writes its unique TSN MAC address to each product during the production process, the product must maintain this TSN MAC address. TSN is a built-in function of the SBL, and the TSN MAC address is stored in the SBL. However, the SBL is updated by directly overwriting the old version of the SBL with the new version of the SBL. This means that the product's original TSN MAC address will be overwritten by the newly written initial TSN MAC address during the update, resulting in the loss of the TSN MAC address. A method and system for updating SBL startup firmware that can solve the problem of TSN MAC address loss during SBL updates is needed. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide an SBL startup firmware update method, an SBL startup firmware update system, a server terminal and a computer-readable storage medium in response to the above-mentioned defects of the prior art.

[0006] The technical solution adopted by the present invention to solve its technical problem is:

[0007] A method for updating SBL startup firmware is constructed, wherein the method comprises the steps of:

[0008] Step 1: Start SBL and enter update mode;

[0009] Step 2: Clear the contents of CMOS register 0xF0 and set it to 0;

[0010] Step 3: Determine whether the current update is a full-area update. If so, set the CMOS register 0xF0 to 1 and proceed to the next step; otherwise, directly overwrite the content to be updated and jump to step 10.

[0011] Step 4: Read the old version of the SBL content in the BIOS chip, find the TSN MAC data in the old version of the SBL content and save it to the memory space, and then proceed to the next step of flashing the SBL content;

[0012] Step 5: Flash the 4KB SBL content and check whether the CMOS register 0xF0 is 2;

[0013] Step 6: Determine whether the CMOS register 0xF0 is 2. If so, write the TSN MAC data in the memory space to the BIOS chip and clear the CMOS register 0xF0 to 0, and proceed to the next step;

[0014] Otherwise, determine whether the first four characters of the content of the BIOS chip being flashed are IPFW. If they are IPFW, set the CMOS register 0xF0 to 2 and proceed to the next step. If they are not IPFW, proceed directly to the next step.

[0015] Step 7: Continue writing the current 4KB SBL content into the BIOS chip;

[0016] Step 8: Determine whether all SBL contents have been flashed. If yes, proceed to the next step. Otherwise, jump to step 5 to continue flashing the remaining SBL contents.

[0017] Step 9: Free up memory space;

[0018] Step 10: Restart SBL.

[0019] In the SBL startup firmware update method of the present invention, the step 3 of determining whether the current update is a full-area update adopts:

[0020] Check whether the flag area in the update content is "BIOS";

[0021] If so, it is determined to be a full-area update; otherwise, it is determined to be a non-full-area update.

[0022] In the method for updating the SBL startup firmware of the present invention, the step 4 of reading the old version of the SBL content in the BIOS chip is performed through the SPI channel.

[0023] In the method for updating the SBL startup firmware of the present invention, the step 4 of finding the TSN MAC data in the old version of the SBL content and saving it to the memory space includes:

[0024] Read 4KB of content from the old version of SBL each time;

[0025] Identify whether the first four characters of the 4KB content currently read are IPFW;

[0026] If IPFW is recognized, the next 4KB read will be saved to the memory space;

[0027] Otherwise, continue reading the next 4KB of content until IPFW is identified.

[0028] The SBL startup firmware update method of the present invention, wherein, when the address content of the CMOS register 0xF0 is 0, it indicates that it is in the default state; when the address content of the CMOS register 0xF0 is 1, it indicates that the TSN MAC content in the BIOS chip is read and saved to the memory space; when the address content of the CMOS register 0xF0 is 2, it indicates that the TSN MAC in the memory space replaces the content written into the BIOS chip.

[0029] A system for updating SBL startup firmware, wherein the system includes an SBL firmware update unit, a BIOS chip, a CMOS register and a memory space;

[0030] The SBL firmware updating unit is used to complete the updating operation of the SBL firmware in cooperation with the BIOS chip, the CMOS register and the memory space according to the above-mentioned updating method of the SBL startup firmware.

[0031] A server terminal comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0032] A computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the above method when executed by a processor.

[0033] The beneficial effect of the present invention is that it realizes the function of not losing the TSN MAC address when updating the SBL when using the TSN in the SBL. It solves the problem that when the product uses the TSN in the SBL, the TSN MAC address is lost when the SBL is updated, and the MAC address needs to be restored. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be further described below with reference to the accompanying drawings and embodiments. The drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive efforts.

[0035] Figure 1 1 is a flow chart of a method for updating the SBL startup firmware according to a preferred embodiment of the present invention;

[0036] Figure 2 This is a principle block diagram of an SBL startup firmware update system according to a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0037] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the following will be a clear and complete description of the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work shall fall within the scope of protection of the present invention.

[0038] The updating method of the SBL startup firmware of the preferred embodiment of the present invention is as follows: Figure 1 As shown, comprising the steps of:

[0039] Step 1: Start SBL and enter update mode;

[0040] Step 2: Clear the contents of CMOS register 0xF0 and set it to 0;

[0041] Step 3: Determine whether the current update is a full-area update. If so, set the CMOS register 0xF0 to 1 and proceed to the next step; otherwise, directly overwrite the content to be updated and jump to step 10.

[0042] Step 4: Read the old version of the SBL content in the BIOS chip, find the TSN MAC data in the old version of the SBL content and save it to the memory space, and then proceed to the next step of flashing the SBL content;

[0043] Step 5: Flash the 4KB SBL content and check whether the CMOS register 0xF0 is 2;

[0044] Step 6: Determine whether the CMOS register 0xF0 is 2. If so, write the TSN MAC data in the memory space to the BIOS chip and clear the CMOS register 0xF0 to 0, and proceed to the next step;

[0045] Otherwise, determine whether the first four characters of the content of the BIOS chip being flashed are IPFW. If they are IPFW, set the CMOS register 0xF0 to 2 and proceed to the next step. If they are not IPFW, proceed directly to the next step.

[0046] Step 7: Continue writing the current 4KB SBL content into the BIOS chip;

[0047] Step 8: Determine whether all SBL contents have been flashed. If yes, proceed to the next step. Otherwise, jump to step 5 to continue flashing the remaining SBL contents.

[0048] Step 9: Free up memory space;

[0049] Step 10: Restart SBL;

[0050] This feature allows users to update the SBL without losing the TSN MAC address when using the TSN in the SBL. This fixes the issue where updating the SBL causes the TSN MAC address to be lost and the MAC address needs to be restored when using the TSN in the SBL.

[0051] More specifically, the following is explained:

[0052] The present invention adds a specific program to the SBL (Slim Bootloader). During the process of updating the SBL, the content in the BIOS chip is judged to be the target object TSN MAC address and is saved in the memory space.

[0053] In addition, the CMOS register (Complementary Metal-Oxide-Semiconductor Register) 0xF0 address content is used as an identifier. When the 0xF0 address content is 0, it indicates that it is in the default state. When the 0xF0 address content is 1, it indicates that the TSN MAC content in the BIOS chip is read and saved to the memory space. When the 0xF0 address content is 2, it indicates that the TSN MAC in the memory space replaces the content written into the BIOS chip.

[0054] This feature allows updating the SBL without losing the TSN MAC address when using the TSN in the SBL. This solves the problem of losing the TSN MAC address when updating the SBL and requiring a MAC address recovery when using the TSN in the SBL. This improves the competitiveness and visibility of our products in the market.

[0055] The operation adopts the following process:

[0056] Start SBL, clear the contents of CMOS register 0xF0 and initialize it to 0.

[0057] The SBL update program is triggered to detect whether the flag area in the update content is "BIOS" to determine whether to perform a full area update. If a full area update is performed, a value of 1 is written to the CMOS register 0xF0, indicating that the TSN MAC address needs to be saved for this update; otherwise, if a component update is performed, the normal update steps are maintained.

[0058] After entering the update program, read the CMOS register 0xF0. If the register value is 1, first obtain the old version of the SBL content in the BIOS chip through the SPI channel, and only read 4KB of content each time, and read it in a loop until the TSNMAC address is found.

[0059] Each time 4KB of content is read, the first four characters are identified as "IPFW". If "IPFW" is recognized, the next 4KB of content read (which is the TSN MAC address data) is saved to the system's available memory space and the SBL flashing phase is entered.

[0060] When flashing the SBL, each time 4KB of content is written, the BIOS chip first checks whether the value of CMOS register 0xF0 is 2. If it is 2, the content stored in the memory space is written as the new SBL content to the BIOS chip, and CMOS register 0xF0 is cleared to 0.

[0061] If it is not 2, then determine whether the first four characters of the 4KB content are "IPFW". If it is "IPFW", write 2 to the CMOS register 0xF0 and continue to loop to write the new SBL content to the BIOS chip.

[0062] After all SBL updates are complete, clear the TSN MAC data stored in the memory, free up memory space, and restart.

[0063] An update system for SBL boot firmware, such as Figure 2 As shown, the system includes an SBL firmware update unit 1, a BIOS chip 2, a CMOS register 3, and a memory space 4;

[0064] The SBL firmware update unit is used to update the SBL firmware in accordance with the above-mentioned SBL startup firmware update method, in conjunction with the BIOS chip, CMOS register and memory space;

[0065] The system of this application enables the use of TSNs in an SBL, so that updating the SBL does not cause loss of the TSN MAC address. This solves the problem of TSN MAC address loss caused by SBL updates when using the TSN in the SBL, requiring MAC address recovery. This improves the competitiveness and visibility of our products in the market.

[0066] A server terminal comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0067] A computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the above method when executed by a processor.

[0068] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all such improvements and changes should fall within the scope of protection of the appended claims of the present invention.

Claims

1. A method for updating SBL startup firmware, characterized in that: The method comprises the steps of: Step 1: Start SBL and enter update mode; Step 2: Clear the contents of CMOS register 0xF0 and set it to 0; Step 3: Determine whether the current update is a full-area update. If so, set the CMOS register 0xF0 to 1 and proceed to the next step. Otherwise, directly overwrite the content that needs to be updated and jump to step 10; Step 4: Read the old version of the SBL content in the BIOS chip, find the TSN MAC data in the old version of the SBL content and save it to the memory space, and then proceed to the next step of flashing the SBL content; Step 5: Flash the 4KB SBL content; Step 6: Determine whether the CMOS register 0xF0 is 2. If so, write the TSN MAC data in the memory space to the BIOS chip and clear the CMOS register 0xF0 to 0, and proceed to the next step; Otherwise, determine whether the first four characters of the content of the BIOS chip being flashed are IPFW. If they are IPFW, set the CMOS register 0xF0 to 2 and proceed to the next step. If they are not IPFW, proceed directly to the next step. Step 7: Continue writing the current 4KB SBL content into the BIOS chip; Step 8: Determine whether all SBL contents have been flashed. If yes, proceed to the next step. Otherwise, jump to step 5 to continue flashing the remaining SBL contents. Step 9: Free up memory space; Step 10: Restart SBL.

2. The method for updating the SBL startup firmware according to claim 1, wherein: In step 3, whether the current update is a full-area update is determined by: Check whether the flag area in the update content is "BIOS"; If so, it is determined to be a full-area update; otherwise, it is determined to be a non-full-area update.

3. The method for updating the SBL startup firmware according to claim 1, wherein: In the step 4, the old version SBL content in the BIOS chip is read through the SPI channel.

4. The method for updating the SBL startup firmware according to claim 1, wherein: The step 4 of finding the TSN MAC data in the old version of the SBL content and saving it to the memory space includes: Read 4KB of content from the old version of SBL each time; Identify whether the first four characters of the 4KB content currently read are IPFW; If IPFW is recognized, the next 4KB read will be saved to the memory space; Otherwise, continue reading the next 4KB of content until IPFW is identified.

5. The method for updating the SBL startup firmware according to claim 1, wherein: When the address content of the CMOS register 0xF0 is 0, it indicates that it is in the default state; when the address content of the CMOS register 0xF0 is 1, it indicates that the TSN MAC content in the BIOS chip is read and saved to the memory space; when the address content of the CMOS register 0xF0 is 2, it indicates that the TSN MAC in the memory space replaces the content written into the BIOS chip.

6. A system for updating SBL startup firmware, characterized in that: The system includes an SBL firmware update unit, a BIOS chip, a CMOS register and a memory space; The SBL firmware updating unit is used to complete the updating operation of the SBL firmware in cooperation with the BIOS chip, the CMOS register and the memory space according to the updating method of the SBL startup firmware according to any one of claims 1 to 5.

7. A server terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.