A chip startup method, a chip, an electronic device, and a storage medium.

By acquiring the boot chip select information after the system-on-a-chip (SoC) is powered on, the boot program from the external memory is automatically transferred to the chip, solving the problem of manually selecting the boot chip select pin in the prior art and realizing a fast, safe and flexible boot process.

CN119987874BActive Publication Date: 2026-03-06SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510018235.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2026-03-06
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

Existing technologies require manual operation or additional control modules in system-on-a-chip (SoC) configurations to select the startup chip select pin, increasing the user burden and limiting system response speed and startup efficiency.

Method used

By acquiring pre-configured startup chip select information after the chip is powered on, the startup program in at least two external memories is automatically transferred to the chip, realizing automatic switching startup of the system-level chip, avoiding the need for additional chip pins and dedicated firmware programs.

Benefits of technology

It improves system startup speed and flexibility, enhances security and reliability, simplifies operation procedures, and ensures that the system can quickly adapt and work normally in different application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987874B_ABST
    Figure CN119987874B_ABST
Patent Text Reader

Abstract

This invention provides a chip startup method, a chip, an electronic device, and a storage medium. The method includes: after the chip is powered on, acquiring pre-configured startup chip select information; according to the startup chip select information, transferring the startup program of one of at least two external memories to the chip; and executing the transferred startup program to the chip. This invention, by setting startup chip select information and transferring the startup program from the memory to the chip according to the startup chip select information, enables automatic switching startup of the system-level chip upon power-on without adding additional chip pins or requiring dedicated firmware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of chip application development technology, and in particular to a chip startup method, a chip, an electronic device, and a storage medium. Background Technology

[0002] The system-on-a-chip (SoC) bootloader is stored in non-volatile memory outside the chip. Typically, SoCs have two or more non-volatile memories, primarily for redundancy and fault tolerance during chip startup and for firmware upgrade switching. For example, after the chip boots from the first non-volatile memory for the first time, the user needs to update the bootloader and store it in the second non-volatile memory, requiring the chip to switch to the second non-volatile memory for startup on the next power-on.

[0003] Existing technologies typically involve bringing out a dedicated boot select pin in the system-on-a-chip (SoC). This requires manually assigning an input value to the boot select pin or connecting it to an additional control module. The dedicated boot select pin serves as an input, and the boot select pin selects which memory to boot from through encoding. This cumbersome operation not only increases the user's workload but also limits the system's response speed and boot efficiency to some extent. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a chip startup method, chip, electronic device and storage medium that overcomes or at least partially solves the above problems.

[0005] According to a first aspect of the present invention, a method for booting a chip is provided, the chip being connected to at least two external memories, the method comprising:

[0006] After the chip is powered on, the pre-configured startup chip select information is obtained;

[0007] Based on the boot chip select information, the boot program of one of the at least two external memories is transferred to the chip;

[0008] Execute the boot procedure that transports the device to the chip.

[0009] Optionally, the chip includes an internal memory that stores startup chip select information;

[0010] After the chip is powered on, the process of obtaining pre-configured startup chip select information includes:

[0011] After the chip is powered on, the startup chip select information is read from the internal memory.

[0012] Optionally, the at least two external memories store startup chip select information;

[0013] After the chip is powered on, the process of obtaining pre-configured startup chip select information includes:

[0014] After the chip is powered on, the read order for the at least two external memories is determined;

[0015] The boot chip select information is read from the external memory one by one in the order of reading the at least two external memory.

[0016] Determine whether the boot chip select information instructs a boot program based on the external memory corresponding to the boot chip select information to start;

[0017] If the boot chip select information does not indicate that the boot program based on the external memory corresponding to the boot chip select information should be started, then the process returns to the step of reading the boot chip select information from the external memory one by one in the order of reading the at least two external memory, until it is determined that the boot chip select information indicates that the boot program based on the external memory corresponding to the boot chip select information should be started.

[0018] Optionally, the step of transferring the boot program of one of the at least two external memories to the chip according to the boot chip select information includes:

[0019] When the boot chip select information indicates that the boot program is to be started based on the boot program in the external memory corresponding to the boot chip select information, the boot program in the external memory corresponding to the boot chip select information is transferred to the chip.

[0020] Optionally, the step of transferring the boot program of one of the at least two external memories to the chip according to the boot chip select information includes:

[0021] If none of the boot chip select information corresponding to the at least two external memories indicates that the boot program of the external memory corresponding to the boot chip select information should be started, the boot program of the external memory with the first order of reads shall be transferred to the chip according to the read order.

[0022] According to a second aspect of the present invention, a chip is provided, the chip comprising: a processor, a first internal memory, and a second internal memory; the chip is connected to at least two external memories;

[0023] The processor is configured to read a first boot program from the first internal memory; call the first boot program to obtain pre-configured boot chip select information; according to the boot chip select information, transfer the boot program of one of the at least two external memories to the second internal memory; and execute the boot program transferred to the chip.

[0024] The first internal memory is used to store the first startup program;

[0025] The second internal memory is used to store the boot program after it has been moved.

[0026] Optionally, the chip includes a third internal memory for storing startup chip select information;

[0027] The processor is configured to, after the chip is powered on, invoke the first boot program to read boot chip select information from the third internal memory.

[0028] Optionally, the at least two external memories are used to store startup chip select information;

[0029] The processor is configured to, after the chip is powered on, determine the read order for the at least two external memories; read boot chip select information from the external memories one by one according to the read order of the at least two external memories; determine whether the boot chip select information indicates that the boot program based on the external memory corresponding to the boot chip select information should be started; if the boot chip select information does not indicate that the boot program based on the memory corresponding to the boot chip select information should be started, then return to the step of reading the boot chip select information from the external memories one by one according to the read order of the at least two external memories, until it is determined that the boot chip select information indicates that the boot program based on the memory corresponding to the boot chip select information should be started.

[0030] Optionally, the processor is configured to, when the boot chip select information indicates that a boot program from the external memory corresponding to the boot chip select information should be started, transfer the boot program from the external memory corresponding to the boot chip select information to the second internal memory.

[0031] Optionally, the processor is configured to, when none of the boot chip select information corresponding to the at least two external memories indicates that a boot program based on the external memory corresponding to the boot chip select information should be started, move the boot program of the first external memory in the read order to the second internal memory.

[0032] According to a third aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the chip startup method as described above.

[0033] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the chip startup method described above.

[0034] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:

[0035] This invention provides a chip startup method, comprising: after the chip is powered on, acquiring pre-configured startup chip select information; according to the startup chip select information, transferring the startup program of one of at least two external memories to the chip; and executing the transferred startup program to the chip. This invention, by pre-configuring startup chip select information and transferring the startup program from the memory to the chip according to the startup chip select information, enables automatic switching startup of the system-level chip upon power-on without adding additional chip pins or requiring dedicated firmware. Attached Figure Description

[0036] Figure 1 This is a flowchart of the steps of a chip startup method provided in an embodiment of the present invention;

[0037] Figure 2 This is a structural block diagram of a chip provided in an embodiment of the present invention;

[0038] Figure 3 This is a structural block diagram of another chip provided in an embodiment of the present invention;

[0039] Figure 4 This is a structural block diagram of an electronic device provided in an embodiment of the present invention;

[0040] Figure 5 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present invention. Detailed Implementation

[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0042] One of the core concepts of this invention is that the system-on-a-chip (SoC) boot program is stored in a non-volatile memory outside the chip. Typically, an SoC has two or more non-volatile memories, mainly used for redundancy and fault tolerance backup during chip startup and firmware upgrade switching. For example, after the chip boots from the first non-volatile memory for the first time, the user needs to update the boot program and store it in the second non-volatile memory, requiring the chip to switch to the second non-volatile memory for startup on the next power-on.

[0043] Existing technologies typically involve bringing out a dedicated boot select pin in the system-on-a-chip (SoC). This requires manually assigning an input value to the boot select pin or connecting it to an additional control module. The dedicated boot select pin serves as an input, and the boot select pin selects which memory to boot from through encoding. This cumbersome operation not only increases the user's workload but also limits the system's response speed and boot efficiency to some extent.

[0044] This invention enables automatic switching and startup of the system-level chip upon power-up by setting startup chip select information and transferring the startup program from the memory to the chip according to the startup chip select information, without adding additional chip pins or requiring dedicated firmware programs.

[0045] Reference Figure 1 The diagram illustrates a flowchart of a chip startup method according to an embodiment of the present invention. The method may specifically include the following steps:

[0046] Step 101: After the chip is powered on, obtain the pre-configured startup chip select information;

[0047] The chip refers to a SoC (System on Chip). The boot chip select information is configured by the user and is used to instruct the boot program of one of the at least two external memories to start.

[0048] Obtaining pre-configured boot chip select information after the chip powers on is a crucial step, essential for ensuring a correct and secure system startup. By acquiring this information, the system can determine the correct boot path, avoiding the loading of incorrect code and thus preventing boot failures or potential security threats. Furthermore, the boot chip select information can contain important configuration parameters about the boot process, such as the boot mode (normal boot, recovery mode, etc.), encryption keys, and other security verification data. This helps enhance system security, ensuring that only verified code can be executed. In some cases, the boot chip select information may also be used to implement multiple boot options, allowing users to select different operating systems or firmware versions as needed. Timely and accurate acquisition of boot chip select information is a vital means of ensuring system reliability and security, and is the foundation for implementing flexible boot strategies. In this way, developers can better control and optimize the system boot process to meet the needs of different application scenarios.

[0049] Step 102: According to the boot chip select information, the boot program of one of the at least two external memories is transferred to the chip;

[0050] External memory refers to non-volatile memory connected to the chip. Typically, when the system powers on or resets, the processor needs to start executing code from a predefined location, often located in external memory. However, because these external memories have relatively slow access speeds, directly executing code from them can impact system performance. Therefore, after identifying the correct boot device through the chip select mechanism, the system copies the boot code (usually the bootloader) from that device to the internal RAM or cache area. This allows the processor to execute code from these fast-access memories at a much higher speed. This not only improves boot speed but also enhances system flexibility and configurability, enabling it to quickly adapt and function normally even in different application scenarios. Furthermore, this design facilitates later software upgrades and maintenance, as only the data in the external memory needs to be updated, without changing the hardware structure.

[0051] Step 103: Execute the boot program that transports the chip.

[0052] The processor executes the boot program transferred to the chip to initialize hardware devices, configure the system environment, and load the operating system or other necessary software after the system is powered on or reset, thus enabling the entire system to operate normally. This boot program is usually stored in the chip's memory and is responsible for performing a series of initialization steps to ensure that the processor and peripherals are in the correct state, ultimately guiding the system into an operational state.

[0053] This invention provides a chip startup method, comprising: after the chip is powered on, acquiring pre-configured startup chip select information; according to the startup chip select information, transferring the startup program of one of at least two external memories to the chip; and executing the startup program transferred to the chip. This invention, by setting startup chip select information and transferring the startup program from the memory to the chip according to the startup chip select information, enables automatic switching startup of the system-level chip upon power-on without adding additional chip pins or requiring dedicated firmware.

[0054] In one embodiment, the chip includes an internal memory that stores startup chip select information; obtaining the pre-configured startup chip select information after the chip is powered on includes: reading the startup chip select information from the internal memory after the chip is powered on.

[0055] Internal memory is non-volatile memory located within the chip. In this configuration, the internal memory stores the boot chip select information, while the external memory does not.

[0056] After the chip is powered on, acquiring the boot chip select information stored in its internal memory is a crucial step to ensure the system can initialize correctly and start smoothly. This process is essential for the system's stability and security. When the chip is first powered on, it is in an undefined state and requires a series of preset steps to complete hardware and software initialization. The boot chip select information contains important data about how to select and configure various key components in the system (such as the processor, memory, and other peripherals). This information typically includes address mappings, device configuration parameters, and initial state settings, which are essential for correctly identifying and activating the various parts of the system.

[0057] In one embodiment, the at least two external memories store boot chip select information; the step of obtaining the pre-configured boot chip select information after the chip is powered on includes: after the chip is powered on, determining the reading order for the at least two external memories; reading the boot chip select information from the external memories one by one according to the reading order of the at least two external memories; determining whether the boot chip select information indicates that the boot program based on the external memory corresponding to the boot chip select information should be started; if the boot chip select information does not indicate that the boot program based on the external memory corresponding to the boot chip select information should be started, then returning to the step of reading the boot chip select information from the external memories one by one according to the reading order of the at least two external memories, until it is determined that the boot chip select information indicates that the boot program based on the external memory corresponding to the boot chip select information should be started.

[0058] The external memory is an external non-volatile memory. In this method, each external memory stores the boot chip select information, eliminating the need for internal memory to store the boot chip select information.

[0059] Different external storage devices may store different boot configuration data, including but not limited to bootloaders, operating system images, drivers, and other necessary boot files. This data is crucial for system startup because it contains information on how to load the operating system and configure the hardware. Therefore, determining a specific read order ensures that the system accesses this critical data in the correct logical order, thus avoiding boot failures due to read errors or omissions. Furthermore, considering hardware resource limitations and performance optimization, a reasonable read order can reduce unnecessary waiting time and improve boot efficiency. If the system randomly attempts to access various storage devices, it may encounter situations where it cannot respond immediately, such as a storage device being busy with other operations or being in an unready state. By planning the read order in advance, access strategies can be optimized based on the characteristics and current state of each storage device, ensuring that the required information is obtained quickly and efficiently.

[0060] By examining the boot chip select information, the system can identify which external storage devices are marked as bootable and understand their priority order. This helps the system attempt to load the bootloader from each specified storage device in a predetermined order, avoiding blindly searching all possible storage devices and saving valuable boot time. Verifying the boot chip select information also helps improve security. If the boot chip select information is tampered with or corrupted, the system may attempt to load data from the wrong location, leading to boot failure or even security risks. Therefore, by verifying the validity and integrity of the boot chip select information, the system can prevent potential security threats, ensuring that only certified bootloaders can be loaded and executed.

[0061] In the presence of multiple external storage devices, if the currently checked storage device does not have a valid boot program or boot configuration, the system can continue to try the next storage device until a device that can be successfully booted is found. This ensures that even if one storage device fails or is misconfigured, the system still has the opportunity to boot normally from other storage devices, thereby avoiding the failure of the entire system to boot, improving fault tolerance, enhancing security, and simplifying management processes.

[0062] In one embodiment, the step of transferring the boot program of one of the at least two external memories to the chip according to the boot chip select information includes: when the boot chip select information indicates that the boot program of the external memory corresponding to the boot chip select information is to be started, transferring the boot program of the external memory corresponding to the boot chip select information to the chip.

[0063] First, moving the bootloader from external memory to on-chip RAM significantly improves execution efficiency. External memory access is typically much slower than RAM. Once the bootloader is loaded into RAM, the processor can directly read instructions from RAM and execute them, greatly reducing data access latency and speeding up the boot process. Second, moving the bootloader into RAM also meets the processor's need to directly execute code. Modern processor designs require instructions to reside in fast-access memory areas for efficient execution. If the bootloader remains in external memory, the processor needs to frequently access these instructions through slower interfaces, severely impacting system response time and overall performance.

[0064] Furthermore, moving the bootloader into memory offers greater flexibility and security. In memory, the bootloader can be modified and updated as needed without affecting the original data in external storage. Simultaneously, data in memory is volatile, meaning it is erased after the system shuts down, preventing unauthorized access. This is crucial for protecting sensitive boot code and configuration information. Finally, this relocation is part of the standard boot process, ensuring the system initializes in a predetermined manner. Once the bootloader is successfully loaded into memory, it can begin further booting processes, such as loading the operating system kernel, initializing hardware devices, and launching the user interface. This ensures the coherence and reliability of the entire boot process, guaranteeing the system reaches a fully usable state in the shortest possible time.

[0065] In one embodiment, the step of transferring the boot program of one of the at least two external memories to the chip according to the boot chip select information includes: when the boot chip select information corresponding to the at least two external memories does not indicate that the boot program of the external memory corresponding to the boot chip select information should be started, the boot program of the external memory with the first order is transferred to the chip according to the reading order.

[0066] In this embodiment, a more intelligent selection algorithm can be introduced to determine the boot order, rather than a simple fixed order. For example, the system can dynamically adjust the boot order based on the historical success rate, health status, or user preferences of each memory. This can be achieved by analyzing log files, hardware self-test results, and user configurations. Furthermore, detailed fault information can be recorded each time a boot fails, and diagnostics can be performed during subsequent boot processes. The system can use this information for self-repair or provide it to the administrator for troubleshooting. For example, if a particular memory frequently experiences problems, the system can flag that device and lower its priority.

[0067] A default boot mechanism is provided, allowing the system to attempt to load the boot program from the first memory location in a preset order, even if the boot chip select information of all external memory locations does not explicitly indicate the location of the boot program. This prevents the system from failing to boot due to the inability to find a boot point, thus ensuring system availability. In practical applications, various reasons may lead to incorrect or lost boot chip select information, such as configuration errors, hardware failures, or malicious tampering. By attempting to boot in the preset order, the system can automatically find alternative solutions when encountering these problems, improving system robustness and reliability. Furthermore, users or administrators do not need to develop detailed recovery plans for every possible boot failure scenario; they can rely on this default boot process. Once the correct read order is set, the system can automatically handle various anomalies encountered during the boot process, reducing the need for manual intervention. If the boot chip select information of all memory locations is corrupted or untrusted, the system can still load the boot program from a predetermined, trusted memory location. This prevents malicious software from gaining control by tampering with the boot configuration, ensuring that the system starts running from a known safe state.

[0068] This invention provides a chip startup method, comprising: after the chip is powered on, acquiring pre-configured startup chip select information; according to the startup chip select information, transferring the startup program of one of at least two external memories to the chip; and executing the startup program transferred to the chip. This invention, by setting startup chip select information and transferring the startup program from the memory to the chip according to the startup chip select information, enables automatic switching startup of the system-level chip upon power-on without adding additional chip pins or requiring dedicated firmware.

[0069] Reference Figure 2 The diagram illustrates a structural block diagram of a chip according to an embodiment of the present invention; the chip structure includes: a processor 20, a first internal memory 21, and a second internal memory 22; the chip is connected to at least two external memories 30.

[0070] The processor 20 is configured to read a first boot program from the first internal memory 21; call the first boot program to obtain pre-configured boot chip select information; according to the boot chip select information, transfer the boot program of one of the at least two external memories to the second internal memory 22; and execute the boot program transferred to the chip. The first internal memory 21 is configured to store the first boot program; and the second internal memory 22 is configured to store the transferred boot program.

[0071] The first internal memory 21 can be a read-only memory, and the second internal memory 22 can be a random access memory. The boot chip select information is configured by the user and is used to instruct the boot program of one of the at least two external memories to start the boot process.

[0072] Obtaining pre-configured boot chip select information after the chip powers on is a crucial step, essential for ensuring a correct and secure system startup. By acquiring this information, the system can determine the correct boot path, avoiding the loading of incorrect code and thus preventing boot failures or potential security threats. Furthermore, the boot chip select information can contain important configuration parameters about the boot process, such as the boot mode (normal boot, recovery mode, etc.), encryption keys, and other security verification data. This helps enhance system security, ensuring that only verified code can be executed. In some cases, the boot chip select information may also be used to implement multiple boot options, allowing users to select different operating systems or firmware versions as needed. Timely and accurate acquisition of boot chip select information is a vital means of ensuring system reliability and security, and is the foundation for implementing flexible boot strategies. In this way, developers can better control and optimize the system boot process to meet the needs of different application scenarios.

[0073] External memory refers to non-volatile memory connected to the chip. Typically, when the system powers on or resets, the processor needs to start executing code from a predefined location, often located in external memory. However, because these external memories have relatively slow access speeds, directly executing code from them can impact system performance. Therefore, after identifying the correct boot device through the chip select mechanism, the system copies the boot code (usually the bootloader) from that device to the internal RAM or cache area. This allows the processor to execute code from these fast-access memories at a much higher speed. This not only improves boot speed but also enhances system flexibility and configurability, enabling it to quickly adapt and function normally even in different application scenarios. Furthermore, this design facilitates later software upgrades and maintenance, as only the data in the external memory needs to be updated, without changing the hardware structure.

[0074] This invention provides a chip startup method, comprising: after the chip is powered on, acquiring pre-configured startup chip select information; according to the startup chip select information, transferring the startup program of one of at least two external memories to the chip; and executing the startup program transferred to the chip. This invention, by setting startup chip select information and transferring the startup program from the memory to the chip according to the startup chip select information, enables automatic switching startup of the system-level chip upon power-on without adding additional chip pins or requiring dedicated firmware.

[0075] Reference Figure 3 This shows a structural block diagram of another chip provided in an embodiment of the present invention;

[0076] In one embodiment, the chip includes a third internal memory 23 for storing startup chip select information; the processor 20 is configured to call the first startup program to read the startup chip select information from the third internal memory 23 after the chip is powered on.

[0077] The third internal memory 23 is a non-volatile memory within the chip. In this configuration, the internal memory stores the boot chip select information, while the external memory does not. Signals are transmitted internally via the system bus 24.

[0078] After the chip is powered on, acquiring the boot chip select information stored in its internal memory is a crucial step to ensure the system can initialize correctly and start smoothly. This process is essential for the system's stability and security. When the chip is first powered on, it is in an undefined state and requires a series of preset steps to complete hardware and software initialization. The boot chip select information contains important data about how to select and configure various key components in the system (such as the processor, memory, and other peripherals). This information typically includes address mappings, device configuration parameters, and initial state settings, which are essential for correctly identifying and activating the various parts of the system.

[0079] In one embodiment, the at least two external memories 30 are used to store boot chip select information; the processor is configured to, after the chip is powered on, determine the reading order for the at least two external memories 30; read the boot chip select information from the external memories 30 one by one according to the reading order of the at least two external memories 30; determine whether the boot chip select information indicates that the boot program based on the external memory corresponding to the boot chip select information should be started; if the boot chip select information does not indicate that the boot program based on the memory corresponding to the boot chip select information should be started, then return to the step of reading the boot chip select information from the external memories one by one according to the reading order of the at least two external memories, until it is determined that the boot chip select information indicates that the boot program based on the memory corresponding to the boot chip select information should be started.

[0080] The external memory is external non-volatile memory. In this method, each external memory stores the boot chip select information, eliminating the need for internal non-volatile memory.

[0081] Different external storage devices 30 may store different boot configuration data, including but not limited to bootloaders, operating system images, drivers, and other necessary boot files. This data is crucial for system startup because it contains information on how to load the operating system and configure the hardware. Therefore, determining a specific read order ensures that the system accesses this critical data in the correct logical order, thus avoiding boot failures due to read errors or omissions. Furthermore, considering hardware resource limitations and performance optimization, a reasonable read order can reduce unnecessary waiting time and improve boot efficiency. If the system randomly attempts to access various storage devices, it may encounter situations where it cannot respond immediately, such as a storage device being busy with other operations or being in an unready state. By planning the read order in advance, access strategies can be optimized based on the characteristics and current state of each storage device, ensuring that the required information is obtained quickly and efficiently.

[0082] By examining the boot chip select information, the system can identify which external storage devices are marked as bootable and understand their priority order. This helps the system attempt to load the bootloader from each specified storage device in a predetermined order, avoiding blindly searching all possible storage devices and saving valuable boot time. Verifying the boot chip select information also helps improve security. If the boot chip select information is tampered with or corrupted, the system may attempt to load data from the wrong location, leading to boot failure or even security risks. Therefore, by verifying the validity and integrity of the boot chip select information, the system can prevent potential security threats, ensuring that only certified bootloaders can be loaded and executed.

[0083] In the presence of multiple external storage devices 30, if the currently checked storage device does not have a valid boot program or boot configuration, the system can continue to try the next storage device until a device that can be successfully booted is found. This ensures that even if a storage device fails or is misconfigured, the system still has the opportunity to boot normally from other storage devices, thereby avoiding the failure of the entire system to boot, improving fault tolerance, enhancing security, and simplifying management processes.

[0084] In one embodiment, the processor 20 is configured to, when the boot chip select information indicates that the boot program of the external memory 30 corresponding to the boot chip select information should be started, transfer the boot program of the external memory 30 corresponding to the boot chip select information to the second internal memory 22.

[0085] First, moving the bootloader from external memory to the chip's internal second memory 22 significantly improves execution efficiency. External memory access is typically much slower than internal memory. Once the bootloader is loaded into internal memory, the processor can directly read and execute instructions from internal memory, greatly reducing data access latency and speeding up the boot process. Second, moving the bootloader to internal memory also meets the processor's need for direct code execution. Modern processor designs require instructions to reside in fast-accessible internal memory regions for efficient execution. If the bootloader remains in external memory, the processor needs to frequently access these instructions through a slower interface, severely impacting system response time and overall performance. Furthermore, moving the bootloader to memory provides greater flexibility and security. In memory, the bootloader can be modified and updated as needed without affecting the original data in external memory. Simultaneously, data in internal memory is volatile, meaning it is cleared after system shutdown, preventing unauthorized access. This is crucial for protecting sensitive boot code and configuration information. Finally, this relocation operation is part of the standard boot process, ensuring the system initializes in a predetermined manner. Once the bootloader is successfully loaded into internal memory, it can begin further boot processes, such as loading the operating system kernel, initializing hardware devices, and launching the user interface. This ensures the continuity and reliability of the entire boot process, guaranteeing that the system reaches a fully usable state in the shortest possible time.

[0086] In one embodiment, the processor 20 is configured to, in the case that none of the boot chip select information corresponding to the at least two external memories 30 indicates that a boot program based on the external memory corresponding to the boot chip select information should be started, move the boot program of the first external memory in the read order to the second internal memory.

[0087] In one embodiment, a more intelligent selection algorithm can be introduced to determine the boot order, rather than a simple fixed order. For example, the system can dynamically adjust the boot order based on the historical success rate, health status, or user preferences of each memory. This can be achieved by analyzing log files, hardware self-test results, and user configurations. Furthermore, detailed fault information can be recorded each time a boot fails, and diagnostics can be performed during subsequent boot processes. The system can use this information for self-repair or provide it to the administrator for troubleshooting. For example, if a particular memory frequently experiences problems, the system can flag that device and lower its priority.

[0088] A default boot mechanism is provided, allowing the system to attempt to load the boot program from the first memory location in a preset order, even if the boot chip select information of all external memory locations 30 does not explicitly indicate the location of the boot program. This prevents the system from failing to boot due to the inability to find a boot point, thus ensuring system availability. In practical applications, various reasons may lead to incorrect or lost boot chip select information, such as configuration errors, hardware failures, or malicious tampering. By attempting to boot in the preset order, the system can automatically find alternative solutions when encountering these problems, improving system robustness and reliability. Furthermore, users or administrators do not need to develop detailed recovery plans for every possible boot failure scenario; they can rely on this default boot process. Once the correct read order is set, the system can automatically handle various anomalies encountered during the boot process, reducing the need for manual intervention. If the boot chip select information of all memory locations is corrupted or untrusted, the system can still load the boot program from a predetermined, trusted memory location. This prevents malicious software from gaining control by tampering with the boot configuration, ensuring that the system starts operating from a known safe state.

[0089] This invention provides a chip startup method, comprising: after the chip is powered on, acquiring pre-configured startup chip select information; according to the startup chip select information, transferring the startup program of one of at least two external memories to the chip; and executing the startup program transferred to the chip. This invention, by setting startup chip select information and transferring the startup program from the memory to the chip according to the startup chip select information, enables automatic switching startup of the system-level chip upon power-on without adding additional chip pins or requiring dedicated firmware.

[0090] like Figure 4 The diagram illustrates a structural block diagram of an electronic device 40 provided by an embodiment of the present invention, comprising:

[0091] The processor 401, the memory 402, and the computer program 4021 stored in the memory 402 and capable of running on the processor 401, when the computer program 4021 is executed by the processor 401, implement the various processes of the above-described chip startup method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0092] like Figure 5 The diagram shows a structural block diagram of a computer-readable storage medium 50 provided in an embodiment of the present invention. The computer-readable storage medium 50 stores a computer program 501. When the computer program 501 is executed by a processor, it implements the various processes of the above-described chip startup method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0093] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0094] Those skilled in the art will understand that embodiments of the present invention can provide methods or computer program products. Therefore, embodiments of the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0095] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0096] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0097] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0098] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0099] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0100] The above provides a detailed description of the chip startup method, chip, electronic device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method of starting up a chip, characterized by, The chip is connected with at least two external memories, and the at least two external memories store boot piece selection information; the method comprises: After the chip is powered on, preconfigured boot piece selection information is acquired; According to the boot piece selection information, a boot program of one of the at least two external memories is carried to the chip; The boot program carried to the chip is executed; The step of acquiring the preconfigured boot piece selection information after the chip is powered on comprises: After the chip is powered on, a reading sequence for the at least two external memories is determined; Boot piece selection information is read from the external memories one by one according to the reading sequence of the at least two external memories; It is determined whether the boot piece selection information indicates that a boot program based on the external memory corresponding to the boot piece selection information is started; If the boot piece selection information does not indicate that the boot program based on the external memory corresponding to the boot piece selection information is started, the step of reading the boot piece selection information from the external memories one by one according to the reading sequence of the at least two external memories is returned until it is determined that the boot piece selection information indicates that the boot program based on the external memory corresponding to the boot piece selection information is started.

2. The method of claim 1, wherein, The step of carrying the boot program of one of the at least two external memories to the chip according to the boot piece selection information comprises: If the boot piece selection information indicates that the boot program based on the external memory corresponding to the boot piece selection information is started, the boot program of the external memory corresponding to the boot piece selection information is carried to the chip.

3. The method of claim 1, wherein, The step of carrying the boot program of one of the at least two external memories to the chip according to the boot piece selection information comprises: If the boot piece selection information corresponding to the at least two external memories does not indicate that the boot program based on the external memory corresponding to the boot piece selection information is started, the boot program of the external memory in sequence first is carried to the chip according to the reading sequence.

4. A chip, characterized by The chip comprises a processor, a first internal memory and a second internal memory; the chip is connected with at least two external memories, and the at least two external memories store boot piece selection information; The processor is configured to read a first boot program in the first internal memory, acquire preconfigured boot piece selection information by calling the first boot program, carry a boot program of one of the at least two external memories to the second internal memory according to the boot piece selection information, and execute the boot program carried to the chip; The first internal memory is configured to store the first boot program; The second internal memory is configured to store the boot program carried; The step of acquiring the preconfigured boot piece selection information by calling the first boot program comprises: A reading sequence for the at least two external memories is determined; Boot piece selection information is read from the external memories one by one according to the reading sequence of the at least two external memories; determining whether the boot option information indicates to boot a boot program based on the external memory corresponding to the boot option information; if the boot option information does not indicate to boot a boot program based on the external memory corresponding to the boot option information, returning to the step of reading the boot option information from the external memories one by one in the reading order of the at least two external memories until it is determined that the boot option information indicates to boot a boot program based on the external memory corresponding to the boot option information.

5. The chip of claim 4, wherein the processor is configured to, if the boot option information indicates to boot a boot program based on the external memory corresponding to the boot option information, move the boot program of the external memory corresponding to the boot option information to the second internal memory.

6. The chip of claim 4, wherein the processor is configured to, if none of the boot option information corresponding to the at least two external memories indicates to boot a boot program based on the external memory corresponding to the boot option information, move the boot program of the first external memory in the reading order to the second internal memory.

7. An electronic device, comprising: comprising: a processor, a memory, and a computer program stored on the memory and capable of running on the processor, the computer program being executed by the processor to implement the boot method of the chip according to any one of claims 1-3.

8. A non-volatile readable storage medium, characterized by a computer program is stored on the non-volatile readable storage medium, the computer program being executed by the processor to implement the boot method of the chip according to any one of claims 1-3.

Citation Information

Patent Citations

  • Chip starting method and device, computer equipment and storage medium

    CN116450244A