HSM firmware startup method, device, equipment and storage medium

By adding a migration program and setting an entry point in the HSM firmware program, splitting it into two sections, and using the loader to switch execution between the transfer station and ITCM, the problem of HSM firmware startup when memory is insufficient is solved, achieving system functional integrity and cost savings.

CN120469729BActive Publication Date: 2025-09-09SIENGINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510974012.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-09-09
Estimated Expiration
2045-07-15

AI Technical Summary

Technical Problem

In the prior art, HSM firmware cannot be fully loaded when the ITCM memory capacity is insufficient, resulting in memory waste or functional limitations.

Method used

A migration program is added to the HSM firmware program, and two entry points of the executable program are set to divide the HSM firmware into the first segment and the second segment. The first segment is loaded into the transfer station using the loader, and the second segment is loaded into the ITCM. The first segment is overwritten with the loader through the migration program and the HSM firmware startup program is executed.

Benefits of technology

The HSM firmware can be started within a limited memory space, saving chip costs and achieving system functional integrity and cost-effectiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120469729B_ABST
    Figure CN120469729B_ABST
Patent Text Reader

Abstract

The present invention discloses an HSM firmware startup method, device, equipment, and storage medium, relating to the technical field of system firmware startup. The HSM firmware startup method includes: adding a migration program to the HSM firmware program and setting two entry points for executable programs, wherein the first entry point executes the migration program and the second entry point executes the HSM firmware startup program; dividing the HSM firmware into a first segment and a second segment and storing them, wherein the first segment includes the migration program; using a loader to load the first segment into a transfer station and the second segment into an instruction-coupled memory (ITCM); jumping to the first entry point to execute the migration program, moving the first segment from the transfer station to the ITCM to overwrite the loader, and jumping to the second entry point to execute the HSM firmware startup program. The present application can startup the HSM firmware within limited memory space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of system firmware startup, and in particular to an HSM firmware startup method, apparatus, device, and storage medium. Background Art

[0002] ITCM (Instruction Tightly-Coupled Memory) is a high-speed dedicated memory area directly integrated near the processor core, specifically used to store and execute key instruction codes.

[0003] HSM (Hardware Secure Module) usually needs to be loaded into ITCM. ITCM is usually a relatively small (tens of KB to several MB) static RAM, which is relatively expensive. During the loading process, the following two situations may occur: (1) The memory capacity of ITCM is larger than the size of HSM firmware, and it can be loaded into memory for startup at one time; (2) The memory capacity of ITCM is smaller than the size of HSM firmware, and only the core code of HSM (microkernel operating system) is loaded into memory for startup. Which module needs to be called and which module is loaded into memory for operation.

[0004] However, in the first case, memory waste is likely to occur, as the memory occupied by the program responsible for loading the HSM firmware will be idle after it exits. In the second case, all HSM functions cannot be used simultaneously. In other words, in some scenarios, it is limited and when only one module can be loaded, the other module in memory needs to be overwritten. Summary of the Invention

[0005] The present application provides an HSM firmware startup method, apparatus, device, and storage medium, which can start the HSM firmware within a limited memory space.

[0006] In a first aspect, an embodiment of the present application provides an HSM firmware startup method, the HSM firmware startup method comprising:

[0007] Add a migration program to the HSM firmware program and set two entry points for the executable program, where the first entry point executes the migration program and the second entry point executes the HSM firmware startup program;

[0008] dividing the HSM firmware into a first section and a second section and storing the sections, wherein the first section includes the migration program;

[0009] The first segment is loaded into the transfer station using the loader, and the second segment is loaded into the instruction tightly coupled memory ITCM;

[0010] Jump to the first entry point to execute the migration program, move the first section from the transfer station to the ITCM to cover the loader, and jump to the second entry point to execute the HSM firmware startup program.

[0011] In conjunction with the first aspect, in one embodiment, dividing the HSM firmware into the first segment and the second segment and storing them includes:

[0012] The HSM firmware is split into the first and second segments through the splitting script, and then packaged and stored in the non-volatile memory QSPI Flash.

[0013] In combination with the first aspect, in one implementation, the first entry point is placed at the beginning or end of the HSM firmware program.

[0014] In combination with the first aspect, in one implementation, the first segment is loaded into the transfer station using a Bootloader program.

[0015] In combination with the first aspect, in one implementation, the transfer station is a static random access memory SRAM.

[0016] In a second aspect, an embodiment of the present application provides an HSM firmware startup device, the HSM firmware startup device comprising:

[0017] A setting module, which is used to add a migration program to the HSM firmware program and set two entry points for the executable program, wherein the first entry point executes the migration program and the second entry point executes the HSM firmware startup program;

[0018] a segmentation module, configured to segment the HSM firmware into a first segment and a second segment, wherein the first segment includes the migration program;

[0019] A loading module, configured to load the first segment into the transfer station using a loader, and to load the second segment into the instruction tightly coupled memory ITCM;

[0020] The execution module is used to jump to the first entry point to execute the migration program, move the first segment from the transfer station to the ITCM to cover the loader program, and jump to the second entry point to execute the HSM firmware startup program.

[0021] In conjunction with the second aspect, in one embodiment, the segmentation module segments the HSM firmware into a first segment and a second segment and stores the segments, including:

[0022] The HSM firmware is split into the first and second segments through the splitting script, and then packaged and stored in the non-volatile memory QSPI Flash.

[0023] In conjunction with the second aspect, in one embodiment, the setting module is used to place the first entry point at the beginning or end of the HSM firmware program.

[0024] In a third aspect, an embodiment of the present application provides an HSM firmware boot device, which includes a processor, a memory, and an HSM firmware boot program stored in the memory and executable by the processor, wherein when the HSM firmware boot program is executed by the processor, the steps of the above-mentioned HSM firmware boot method are implemented.

[0025] In a fourth aspect, a computer-readable storage medium stores an HSM firmware startup program, wherein when the HSM firmware startup program is executed by a processor, the steps of the above-mentioned HSM firmware startup method are implemented.

[0026] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:

[0027] The HSM firmware startup method in the present application adds a moving program to the HSM firmware program and sets two entry points of the executable program, wherein the first entry point executes the moving program and the second entry point executes the HSM firmware startup program; the HSM firmware is divided into a first segment and a second segment and stored, wherein the first segment includes the moving program; the first segment is loaded into a transfer station by a loader, and the second segment is loaded into an instruction-tightly coupled memory ITCM; the method jumps to the first entry point to execute the moving program, moves the first segment from the transfer station to the ITCM to overwrite the loader, and jumps to the second entry point to execute the HSM firmware startup program.

[0028] Since ITCM memory takes up a lot of space in the SOC and is also relatively expensive, the solution in this application can still complete the booting of HSM firmware even when ITCM memory is insufficient. This can not only realize the function of booting the system based on limited memory, but also save chip costs, thus playing a role in reducing costs and increasing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 This is a flow chart of an embodiment of the HSM firmware startup method of the present application;

[0030] Figure 2 This is a schematic diagram of the principle of the HSM firmware startup method of this application;

[0031] Figure 3 This is a structural block diagram of an embodiment of the HSM firmware startup device of the present application;

[0032] Figure 4 This is a schematic diagram of the hardware structure of the HSM firmware boot device involved in the embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0034] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0035] In a first aspect, an embodiment of the present application provides an HSM firmware startup method.

[0036] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of the HSM firmware startup method of this application. Figure 1 As shown, the HSM firmware startup method includes:

[0037] S1. Add a migration program to the HSM firmware program and set two entry points for the executable program, where the first entry point executes the migration program and the second entry point executes the HSM firmware startup program;

[0038] It is worth noting that, in this embodiment, a program migration function is added based on the HSM firmware program, and the migration program is placed at the beginning or end of the HSM firmware program as an independent program entry point.

[0039] S2. Splitting the HSM firmware into a first segment and a second segment and storing the segments, wherein the first segment includes the migration program;

[0040] In this embodiment, the HSM firmware is divided into a first segment and a second segment by a segmentation script, and the segments are packaged and stored in a Quad Serial Peripheral Interface Flash (non-volatile memory).

[0041] QSPI Flash is a nonvolatile memory using a Quad SPI (Quad SPI) interface, designed for high-speed data transmission. It is widely used in embedded systems for boot code storage, FPGA configuration, and firmware execution. It's worth noting that other types of memory can also be used as needed, and this embodiment does not impose any restrictions.

[0042] S3, using the loader to load the first segment into the transfer station, and load the second segment into the instruction tightly coupled memory ITCM;

[0043] Specifically, in this embodiment, a bootloader program is used to load the first segment into a transfer station. The transfer station can be SRAM (Static Random-Access Memory). SRAM is a non-volatile memory based on flip-flop circuits that features high-speed access, low power consumption, and high stability. Of course, other loader programs and transfer stations can be selected as needed, and this embodiment does not limit them.

[0044] S4. Jump to the first entry point to execute the migration program, move the first segment from the transfer station to the ITCM to cover the loader, and jump to the second entry point to execute the HSM firmware startup program.

[0045] The following combination Figure 2 Further explanation of the above steps:

[0046] The prerequisite for this application is that the space of ITCM and SRAM are both limited, for example, the space of ITCM is only 256K and the space of SRAM is only 130K.

[0047] At this time, a migration program function is added based on the HSM firmware program, and the migration program is placed as an independent program entry point at the beginning or back end of the HSM firmware program.

[0048] Then the compiled HSM firmware binary is split into two parts through the split script, namely Figure 2 hsm_firmware I and hsm_firmware II in the package, and then store them in QSPI Flash;

[0049] The bootloader program first loads hsm_firmware II to the predetermined address of ITCM, such as the last 128K address; the bootloader program then loads hsm_firmware I to the predetermined address of SRAM, and then jumps to the migration program entry point of hsm_firmware I;

[0050] The migration program in Hsm firmware I moves hsm_firmware I' to the first 128K address of ITCM, overwriting the original bootloader program; then jumps to the entry point of hsm_firmware program for execution.

[0051] At this point, the startup of the HSM firmware is completed.

[0052] To summarize, the HSM firmware startup method in the present application adds a moving program to the HSM firmware program and sets two entry points for the executable program, wherein the first entry point executes the moving program and the second entry point executes the HSM firmware startup program; the HSM firmware is divided into a first segment and a second segment and stored, wherein the first segment includes the moving program; the first segment is loaded into a transfer station using a loader, and the second segment is loaded into an instruction-tightly coupled memory ITCM; the method jumps to the first entry point to execute the moving program, moves the first segment from the transfer station to the ITCM to overwrite the loader, and jumps to the second entry point to execute the HSM firmware startup program.

[0053] Since ITCM memory takes up a lot of space in the SOC and is also relatively expensive, the solution in this application can still complete the booting of HSM firmware even when ITCM memory is insufficient. This can not only realize the function of booting the system based on limited memory, but also save chip costs, thus playing a role in reducing costs and increasing efficiency.

[0054] In a second aspect, an embodiment of the present application also provides an HSM firmware startup device.

[0055] In one embodiment, referring to Figure 3 , Figure 3 This is a functional module diagram of an embodiment of the HSM firmware startup device of this application. Figure 3 As shown, the HSM firmware startup device includes: a setting module, a segmentation module, a loading module and an execution module.

[0056] The setting module is used to add a migration program to the HSM firmware program and set two entry points of the executable program, wherein the first entry point executes the migration program and the second entry point executes the HSM firmware startup program.

[0057] The segmentation module is used to segment the HSM firmware into a first segment and a second segment, wherein the first segment includes the migration program; the loading module is used to load the first segment into the transfer station using the loading program, and load the second segment into the instruction tightly coupled memory ITCM;

[0058] The execution module is used to jump to the first entry point to execute the migration program, move the first segment from the transfer station to the ITCM to cover the loader program, and jump to the second entry point to execute the HSM firmware startup program.

[0059] Furthermore, in one embodiment, the segmentation module segments the HSM firmware into the first segment and the second segment and stores the segments, including:

[0060] The HSM firmware is split into the first and second segments through the splitting script, and then packaged and stored in the non-volatile memory QSPI Flash.

[0061] Furthermore, in one embodiment, the setting module is used to place the first entry point at the beginning or end of the HSM firmware program.

[0062] Furthermore, in one embodiment, the loading module is a Bootloader program.

[0063] Furthermore, in one embodiment, the loading module is used to load the first segment into a static random access memory SRAM.

[0064] Among them, the functional implementation of each module in the above-mentioned HSM firmware startup device corresponds to the various steps in the above-mentioned HSM firmware startup method embodiment, and their functions and implementation processes are not repeated here one by one.

[0065] In a third aspect, an embodiment of the present application provides an HSM firmware boot device, which may be a device with data processing capabilities, such as a personal computer (PC), a laptop, or a server.

[0066] Reference Figure 4 , Figure 4 Schematic diagram of the hardware structure of the HSM firmware boot device involved in the embodiment of the present application. In the embodiment of the present application, the HSM firmware boot device may include a processor, a memory, a communication interface and a communication bus.

[0067] The communication bus may be of any type and is used to interconnect the processor, memory, and communication interface.

[0068] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces. These interfaces interconnect components within the HSM firmware boot device and connect the HSM firmware boot device to other devices, such as other computing devices or user devices. Physical interfaces can be Ethernet, fiber, or ATM interfaces; user devices can be displays or keyboards.

[0069] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0070] The processor may be a general-purpose processor that can invoke an HSM firmware startup program stored in memory and execute the HSM firmware startup method provided in the embodiments of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the HSM firmware startup program is invoked can be referenced in the various embodiments of the HSM firmware startup method of the present application and will not be further described here.

[0071] Those skilled in the art will understand that Figure 4 The hardware structure shown in the figure does not constitute a limitation to the present application and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0072] In a fourth aspect, an embodiment of the present application also provides a readable storage medium.

[0073] The readable storage medium of the present application stores an HSM firmware startup program, wherein when the HSM firmware startup program is executed by the processor, the steps of the HSM firmware startup method as described above are implemented.

[0074] Among them, the method implemented when the HSM firmware startup program is executed can refer to the various embodiments of the HSM firmware startup method of this application, and will not be repeated here.

[0075] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0076] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, or the part that contributes to the existing technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above and includes a number of instructions for enabling a terminal device to execute the methods described in each embodiment of this application.

[0077] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit the "first", "second" and "third" to different types.

[0078] In the description of the embodiments of this application, the words "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.

[0079] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0080] In some processes described in the embodiments of the present application, multiple operations or steps are included that appear in a specific order. However, it should be understood that these operations or steps may not be performed in the order in which they appear in the embodiments of the present application or may be performed in parallel. The sequence numbers of the operations are only used to distinguish between different operations, and the sequence numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations or steps may be performed in sequence or in parallel, and these operations or steps may be combined.

[0081] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

[0082] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for starting HSM firmware, characterized in that: The HSM firmware startup method includes: Add a migration program to the HSM firmware program and set two entry points for the executable program, where the first entry point executes the migration program and the second entry point executes the HSM firmware startup program; dividing the HSM firmware into a first section and a second section and storing the sections, wherein the first section includes the migration program; The first segment is loaded into the transfer station using the loader, and the second segment is loaded into the instruction tightly coupled memory ITCM; Jump to the first entry point to execute the migration program, move the first section from the transfer station to the ITCM to cover the loader, and jump to the second entry point to execute the HSM firmware startup program.

2. The HSM firmware startup method according to claim 1, wherein: The step of dividing the HSM firmware into the first segment and the second segment and storing the segment includes: The HSM firmware is split into the first and second segments through the splitting script, and packaged and stored in the non-volatile memory QSPIFlash.

3. The HSM firmware startup method according to claim 1, wherein: Place the first entry point at the beginning or end of the HSM firmware program.

4. The HSM firmware startup method according to claim 1, wherein: Use the Bootloader program to load the first segment into the transfer station.

5. The HSM firmware startup method according to claim 1 or 4, wherein: The transfer station is a static random access memory SRAM.

6. An HSM firmware startup device, characterized in that: The HSM firmware startup device includes: A setting module, which is used to add a migration program to the HSM firmware program and set two entry points for the executable program, wherein the first entry point executes the migration program and the second entry point executes the HSM firmware startup program; a segmentation module, configured to segment the HSM firmware into a first segment and a second segment, wherein the first segment includes the migration program; A loading module, configured to load the first segment into the transfer station using a loader, and to load the second segment into the instruction tightly coupled memory ITCM; The execution module is used to jump to the first entry point to execute the migration program, move the first segment from the transfer station to the ITCM to cover the loader program, and jump to the second entry point to execute the HSM firmware startup program.

7. The HSM firmware startup device according to claim 6, wherein: The segmentation module segments the HSM firmware into a first segment and a second segment and stores the segments, including: The HSM firmware is split into the first and second segments through the splitting script, and packaged and stored in the non-volatile memory QSPIFlash.

8. The HSM firmware startup device according to claim 6, wherein: The setting module is used to place the first entry point at the beginning or end of the HSM firmware program.

9. An HSM firmware boot device, characterized in that: The HSM firmware startup device includes a processor, a memory, and an HSM firmware startup program stored in the memory and executable by the processor, wherein when the HSM firmware startup program is executed by the processor, the steps of the HSM firmware startup method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores an HSM firmware startup program, wherein when the HSM firmware startup program is executed by a processor, the steps of the HSM firmware startup method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Code loading method and device

    CN118626166A

  • Chip starting method and device, equipment, storage medium and program product

    CN119045902A