System on chip, firmware starting method, electronic device and electronic equipment

By using the data storage device in the system on chip to load the first firmware into its operation, the problems of high difficulty in firmware development and low R&D efficiency are solved, and more efficient firmware development and operation are achieved.

CN119806658APending Publication Date: 2025-04-11CHENGDU HAIGUANG INTEGRATED CIRCUIT DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411874828.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the existing technology, firmware development is difficult and R&D efficiency is low. It is mainly due to the space limitations of the firmware running media, which requires multi-level loading, which increases the design difficulty and R&D time.

Method used

By introducing a data storage device into the on-chip system, the target firmware is loaded onto the first firmware running medium and then run, and the first firmware is loaded into the data storage device for running, thereby avoiding multi-level loading and reducing the difficulty of firmware development.

Benefits of technology

The development of the first firmware without considering decomposition is achieved, thereby reducing the difficulty of firmware development and R&D efficiency, while improving the operation efficiency of other firmware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806658A_ABST
    Figure CN119806658A_ABST
Patent Text Reader

Abstract

The invention provides a system-on-chip, a firmware starting method, an electronic device and electronic equipment. The system-on-chip comprises a first firmware running medium and a processor, the processor is connected with the first firmware running medium and is configured to be respectively connected with an off-chip firmware storage device and a data storage device; the processor is further configured to load the first firmware in the off-chip firmware storage device to the data storage device to run after loading the target firmware in the off-chip firmware storage device to the first firmware running medium and running the target firmware; wherein the target firmware is the firmware which can initialize the data storage device, and the first firmware is the firmware which realizes the software application in a user runtime state. According to the method and the device, when the first firmware is developed, the detachability does not need to be considered, so that the development difficulty of the first firmware is reduced, and the problems of high firmware development difficulty and low research and development efficiency are solved to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of firmware startup, and in particular to a system on chip, a firmware startup method, an electronic device, and an electronic device. Background Art

[0002] When the processor starts, it usually uses the on-chip firmware as the root of trust, loads and verifies the off-chip firmware in sequence, and then executes the off-chip firmware. The off-chip firmware is stored in the off-chip firmware storage device and needs to be loaded into the on-chip firmware running medium (such as SRAM (Static Random Access Memory)) to run, so the size of the off-chip firmware that can be loaded and run each time is limited by the space size of the firmware running medium of the processor running firmware.

[0003] Taking into account that when the firmware is running, there are often situations where management firmware and application firmware need to run in parallel, so the current conventional implementation method is: split the firmware running medium into two parts of the same size, divided into two spaces for exclusive use of management and application (corresponding to the firmware when the administrator is running and the firmware when the user is running), the firmware can select the corresponding space to use according to demand, and load and run all firmware by loading and running the application area through the management area.

[0004] Due to the limitation of the space corresponding to each type of firmware, the current conventional method is to use multi-level loading. However, this requires that when designing the firmware, it should be designed to be disassembled according to the corresponding space size, and a large firmware should be designed to be composed of multiple disassembled small firmwares, and the size of each small firmware should not exceed the space size corresponding to the firmware. The smaller the space size corresponding to the firmware, the more firmware needs to be disassembled, and the greater the corresponding design difficulty. Therefore, this method increases the difficulty of firmware development and slows down the efficiency of firmware research and development. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a system on chip, a firmware startup method, an electronic device and an electronic device, so as to solve the problems of high difficulty in firmware development and low R&D efficiency existing in the related art to a certain extent.

[0006] An embodiment of the present application provides a system on chip, comprising: a first firmware running medium and a processor; the processor is connected to the first firmware running medium and is configured to be connected to an off-chip firmware storage device and a data storage device respectively; the processor is further configured to: after loading a target firmware in the off-chip firmware storage device into the first firmware running medium and running it, load the first firmware in the off-chip firmware storage device into the data storage device and run it; wherein the target firmware is a firmware that can initialize the data storage device, and the first firmware is a firmware that implements a software application in a user runtime state.

[0007] In the above implementation, when the firmware is loaded and run, after the target firmware is loaded and run, the data storage device is initialized and is in a usable state. The first firmware in the off-chip firmware storage device is loaded into the data storage device for running, so that the first firmware can be loaded and run in a data storage device with a larger space, so that the first firmware does not need to be loaded in multiple levels, which also means that when developing the first firmware, there is no need to consider disassembly, so that the difficulty of developing the first firmware is reduced, thereby solving the problem of high difficulty in firmware development and low R&D efficiency to a certain extent.

[0008] In addition, since data storage devices are commonly found in various electronic devices, and even some on-chip systems have their own data storage devices, there is no need to set up new storage devices in the on-chip system when using the above implementation scheme, which will not increase the hardware cost of the on-chip system, nor will it increase the area overhead of the on-chip system.

[0009] In addition, since the first firmware is loaded into the data storage device for execution, after the first firmware is loaded into the data storage device, the first firmware execution medium can be used exclusively by other firmware except the first firmware, thereby improving the execution efficiency of other firmware.

[0010] Furthermore, the first firmware running medium includes a first running space and a second running space; the first running space is used to load and run the second firmware; the second firmware is the firmware that implements the firmware loading service in the administrator runtime firmware group; the second running space is used to load and run each firmware except the second firmware.

[0011] In the above implementation, the firmware loading service is abstracted to construct the second firmware, and the first firmware running medium is divided into the first running space and the second running space, so that the first running space is used alone to load and run the second firmware that implements the firmware loading service. In this way, since the firmware loading service is the basis for loading other firmware, the second firmware needs to be run all the time. Then, after the implementation in the above manner, the traditional division method based on management and application space is changed into the division method of running the second firmware and running other firmware. Since the second firmware only implements the firmware loading service, the required space size will be much smaller than half of the space of the first firmware running medium, so that the second running space can be much larger than the first running space, so that other firmware can have a larger space for loading and running, so that for other firmware that needs to be loaded into the second running space except the first firmware, the size allowed during the design is larger, and compared with the related technology, the number of firmware that needs to be disassembled can be reduced, which reduces the difficulty of firmware design to a certain extent and improves the efficiency of firmware research and development.

[0012] Furthermore, the size of the first operating space is equal to the size of the second firmware.

[0013] In the above implementation, the size of the first operating space is set to be equal to the size of the second firmware, so that the size of the second operating space can be maximized, so that other firmware that needs to be loaded into the second operating space has a larger loading and operating space. In addition, since the size of the first operating space is equal to the size of the second firmware, the second firmware fully utilizes the first operating space, and other firmware that needs to be loaded into the second operating space is designed according to the size of the second operating space, so the utilization of the second operating space can also be nearly sufficient. Therefore, based on the above implementation, it is possible to achieve more sufficient utilization of the space of the first firmware operating medium, with a higher space utilization rate.

[0014] Furthermore, the administrator runtime firmware group also includes: a third firmware for implementing hardware initialization in the administrator runtime state, and a fourth firmware for implementing application management in the administrator runtime state; the third firmware, the fourth firmware, and the target firmware run in the second running space, and after the target firmware runs, the fourth firmware exclusively occupies the second running space.

[0015] After the hardware is initialized in the administrator runtime state, the administrator application management service (i.e., the function implemented by the fourth firmware) also has the need to run for a long time. In the above implementation, after the target firmware runs, the fourth firmware runs exclusively in the second running space, which can ensure the sufficiency of the running space of the fourth firmware. Since the fourth firmware runs exclusively in the second running space, it can also allow the fourth firmware to be designed larger, so that it can have richer application management functions.

[0016] Furthermore, the target firmware is firmware that implements the hardware initialization phase of the entire user runtime; wherein the hardware initialization phase of the entire user runtime includes initialization of the data storage device.

[0017] Furthermore, the target firmware and the fifth firmware are stored in the off-chip firmware storage device; the target firmware is the firmware for initializing the data storage device; the fifth firmware is the firmware for initializing the remaining hardware except the data storage device in the hardware initialization phase during the entire user runtime; the processor is also configured to: after loading the target firmware in the off-chip firmware storage device into the first firmware running medium and running it, load the fifth firmware into the data storage device and run it.

[0018] In the above implementation, the initialization of the data storage device is extracted from the hardware initialization stage during the entire user runtime and loaded and run as a separate target firmware in the first firmware running medium, and then the fifth firmware that implements the initialization of the remaining hardware except the data storage device is placed in the data storage device for execution like the first firmware. In this way, the first firmware running medium can be exclusively used by the relevant firmware during the administrator runtime earlier, so that the relevant firmware during the administrator runtime (such as the aforementioned fourth firmware) can be loaded and run earlier.

[0019] Furthermore, the data storage device is arranged in the system on chip.

[0020] An embodiment of the present application also provides a firmware startup method, which is applied to a processor of a system on chip, wherein the system on chip also includes a first firmware running medium; the processor is connected to the first firmware running medium, and is configured to be connected to an off-chip firmware storage device and a data storage device respectively; the method includes: obtaining firmware from the off-chip firmware storage device and loading it into the first firmware running medium for execution; after loading the target firmware in the off-chip firmware storage device into the first firmware running medium and executing it, obtaining the first firmware from the off-chip firmware storage device and loading it into the data storage device for execution; wherein the target firmware is firmware that can initialize the data storage device, and the first firmware is firmware that implements software applications in a user runtime state.

[0021] Furthermore, the first firmware running medium includes a first running space and a second running space; obtaining firmware from the off-chip firmware storage device and loading it into the first firmware running medium for running includes: obtaining the second firmware from the off-chip firmware storage device and loading it into the first running space for running; the second firmware is the firmware that implements the firmware loading service in the administrator runtime firmware group; obtaining other firmware except the second firmware from the off-chip firmware storage device and loading it into the second running space for running, until the target firmware is loaded into the second running space and runs.

[0022] Furthermore, the other firmware includes a fourth firmware for implementing application management in the administrator runtime state; the method also includes: after the target firmware in the off-chip firmware storage device is loaded into the first firmware running medium and runs, the fourth firmware is run when the fourth firmware exclusively occupies the second running space.

[0023] An embodiment of the present application also provides an electronic device, comprising any one of the above-mentioned systems on a chip.

[0024] An embodiment of the present application also provides an electronic device, including the above-mentioned electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 A schematic diagram of the system structure involved in firmware loading in the related technology;

[0027] Figure 2 A schematic diagram of the structure of a system on a chip provided in an embodiment of the present application;

[0028] Figure 3 A schematic diagram of a system-on-chip structure when a first firmware running medium is divided into a first running space and a second running space provided in an embodiment of the present application;

[0029] Figure 4 A structural schematic diagram of a data storage device provided in an embodiment of the present application when it is arranged in a system on a chip;

[0030] Figure 5 A schematic diagram of the structure of a system on a chip provided with a second firmware running medium provided in an embodiment of the present application;

[0031] Figure 6 A flowchart of a firmware startup method provided in an embodiment of the present application;

[0032] Figure 7 It is the firmware running timing diagram in the comparative example;

[0033] Figure 8 The figure is a comparison chart of the firmware running timing of the embodiment of the present application and the comparative example. DETAILED DESCRIPTION

[0034] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0035] To facilitate understanding of the solutions and advantages of the embodiments of the present application, the following is an introduction and description of the relevant technologies:

[0036] See also Figure 1 As shown, Figure 1 The schematic diagram of the structure of the system involved in the startup of a common processor includes a first firmware running medium (e.g., SRAM), a second firmware running medium (e.g., ROM (Read-Only Memory)) and a processor (e.g., CPU (Central Processing Unit)) located in the system on chip, and an off-chip firmware storage device (e.g., FLASH (flash memory)) located outside the system on chip. The processor is connected to the first firmware running medium, the second firmware running medium and the off-chip firmware storage device, respectively. The on-chip firmware is stored in the second firmware running medium, and the off-chip firmware is stored in the off-chip firmware storage device.

[0037] The following description is made by taking the example that the first firmware running medium is SRAM, the second firmware running medium is ROM, and the off-chip firmware storage device is FLASH.

[0038] When the processor is started, the processor uses the on-chip firmware in ROM as the trusted root, loads the off-chip firmware in FLASH into SRAM in sequence, and runs it after verification.

[0039] The size of FLASH is usually 1MB, which is used to store off-chip firmware, while ROM and SRAM are both 64KB, and SRAM is divided into two spaces (respectively recorded as management space and application space), each space is 32KB, which are used to load and run the administrator runtime firmware (Admin Runtime FW, recorded as FW1) and user runtime firmware (User Runtime FW) in the off-chip firmware. Among them, the user runtime firmware can be further divided into the firmware FW2 that implements the initialization of each hardware in the user runtime state, and the firmware used to implement the software application in the user runtime state (referred to as the first firmware in this application embodiment, recorded as FW3).

[0040] When the firmware is actually started, FW1 will be loaded and run in the management space of SRAM, and FW2 and FW3 will be loaded and run in the application space of SRAM, and FW2 needs to run before FW3.

[0041] However, due to the size of the operating space, it is usually necessary to load the firmware in multiple levels, which means that the firmware must be designed to be disassembled based on the size of the operating space, that is, one firmware is designed as multiple disassembled firmwares, and the size of each firmware does not exceed the size of the operating space. For example, FW1, FW2 and FW3 need to be disassembled into multiple firmwares to be loaded and run in sequence. Obviously, the smaller the size of the space corresponding to the firmware, the more firmware needs to be disassembled, and the greater the corresponding design difficulty.

[0042] In order to solve the problems of high difficulty in firmware development and low R&D efficiency in related technologies to a certain extent, an on-chip system and a corresponding firmware startup method are provided in an embodiment of the present application.

[0043] See also Figure 2 As shown, Figure 2 The basic structural diagram of the system on chip provided in the embodiment of the present application includes a first firmware running medium and a processor, wherein the processor is connected to the first firmware running medium and is configured to be connected to an off-chip firmware storage device and a data storage device respectively.

[0044] The processor is further configured to: after the target firmware in the off-chip firmware storage device is loaded into the first firmware running medium and runs, load the first firmware in the off-chip firmware storage device into the data storage device and run it.

[0045] The target firmware is a firmware that can initialize the data storage device.

[0046] In the embodiment of the present application, the data storage device refers to a storage device in the electronic device in which the system-on-chip is set, or a storage device in the system-on-chip for realizing data storage during operation. For example, the data storage device may be a memory in the electronic device in which the system-on-chip is set, or a memory in the system-on-chip. Therefore, the data storage device often has a larger storage space than the first firmware running medium.

[0047] In the embodiment of the present application, after the target firmware is loaded and run, the data storage device is initialized and is in an available state. As mentioned above, the first firmware will be loaded and run only after the firmware FW2 that implements the initialization of each hardware in the user runtime state has run, that is, the first firmware will be loaded and run only after the target firmware is loaded and run. Therefore, after the target firmware is loaded and run so that the data storage device is initialized, the first firmware is still located in the off-chip firmware storage device, and the first firmware in the off-chip firmware storage device can be loaded into the data storage device for operation. In this way, the first firmware can be loaded and run in a data storage device with a larger space, so that the first firmware does not need to be loaded in multiple levels, which also makes it unnecessary to consider disassembly when developing the first firmware, thereby reducing the difficulty of developing the first firmware, thereby solving the problem of high difficulty in firmware development and low R&D efficiency to a certain extent.

[0048] In some optional implementations of the embodiments of the present application, an area of ​​a set size (referred to as a firmware running area) may be isolated in advance in the data storage device, so that the first firmware is loaded into the firmware running area for running.

[0049] In this optional implementation, the size of the firmware running area can be set to an area greater than or equal to the size of the first firmware. Exemplarily, the size of the firmware running area can be set to an area greater than or equal to 1MB.

[0050] In an embodiment of the present application, the data storage device can be located outside the system on chip or inside the system on chip. It can be implemented using the memory of the system on chip itself or the memory in the electronic device where the system on chip is located. This eliminates the need to set up a new storage device in the system on chip, increases the hardware cost of the system on chip, and does not increase the area overhead of the system on chip.

[0051] In an embodiment of the present application, after the first firmware is loaded into the data storage device, the first firmware running medium can be used exclusively by other firmware (such as firmware run by an administrator) except the first firmware, thereby improving the running efficiency of other firmware.

[0052] In an optional implementation of the embodiment of the present application, if Figure 3As shown, the first firmware running medium may include a first running space and a second running space. The first running space is used to load and run the second firmware, and the second firmware is the firmware that implements the firmware loading service in the administrator runtime firmware group. The second running space is used to load and run each firmware except the second firmware.

[0053] In this optional implementation, the firmware loading service is abstracted to construct the second firmware, and the first firmware running medium is divided into the first running space and the second running space, so that the first running space is used alone to load and run the second firmware that implements the firmware loading service. In this way, since the firmware loading service is the basis for loading other firmware, the second firmware needs to be run all the time. Then, after being implemented in the above manner, the traditional division method based on management and application space is changed into a division method for running the second firmware and running other firmware. Since the second firmware only implements the firmware loading service, the required space size will be much smaller than half of the space of the first firmware running medium, so that the second running space can be much larger than the first running space, so that other firmware can have a larger space for loading and running, so that for other firmware that needs to be loaded into the second running space except the first firmware, the size allowed during the design is larger, and compared with the related technology, the number of firmware that needs to be disassembled can be reduced, which reduces the difficulty of firmware design to a certain extent and improves the efficiency of firmware research and development.

[0054] Optionally, the size of the first operating space can be equal to the size of the second firmware. Exemplarily, assuming that the size of the program currently implementing the firmware loading service is 10KB, that is, the size of the second firmware is 10KB, then the first operating space is 10KB. Assuming that the total size of the first firmware running medium is 64KB, then the size of the second operating space is 54KB. In this way, the size of the second operating space can be maximized, so that other firmware that needs to be loaded into the second operating space has a larger loading and running space. In addition, since the size of the first operating space is equal to the size of the second firmware, the second firmware is fully utilized for the first operating space, and other firmware that needs to be loaded into the second operating space is designed according to the size of the second operating space, then the utilization of the second operating space can also be close to full, so based on the above implementation method, it is possible to achieve a more full utilization of the space of the first firmware running medium, with a higher space utilization rate.

[0055] In the embodiment of the present application, in addition to implementing the firmware loading service in the administrator runtime state, some other services also need to be implemented, such as hardware initialization in the administrator runtime stage, and administrator application management.

[0056] To this end, in an embodiment of the present application, multiple firmwares will be designed for administrator runtime, thereby forming an administrator runtime firmware group. In an optional implementation, in addition to the second firmware, the administrator runtime firmware group may also include a third firmware for implementing hardware initialization in the administrator runtime state, and a fourth firmware for implementing application management in the administrator runtime state. At this time, the third firmware, the fourth firmware, and the target firmware described above run in the second operating space, and after the target firmware runs, the fourth firmware occupies the second operating space exclusively. In this way, after the target firmware runs, the fourth firmware occupies the second operating space exclusively for operation, which can ensure the adequacy of the operating space of the fourth firmware. And because the fourth firmware occupies the second operating space exclusively for operation, this can also allow the fourth firmware to be designed larger, so that it can have richer application management functions.

[0057] In an optional implementation of the embodiment of the present application, the target firmware may be firmware for implementing the hardware initialization phase of the entire user runtime, wherein the hardware initialization phase of the entire user runtime includes initialization of the data storage device.

[0058] As mentioned above, when the first operating space is dedicated to loading and running the second firmware, the size of the second operating space can be larger, for example, it can be set to 54KB as mentioned above. In this case, the program size of the hardware that needs to be initialized when the user is running may be directly accommodated by the second operating space, so that the firmware of the hardware initialization stage when the user is running does not need to be split, and can be implemented through one firmware. Of course, if the program size of the hardware that needs to be initialized when the user is running still exceeds the size of the second operating space, it is still necessary to carry out a disassembled design, designed as multiple firmware.

[0059] In an optional implementation of the embodiment of the present application, the off-chip firmware storage device may further store target firmware and fifth firmware, wherein the target firmware is the firmware for initializing the data storage device, and the fifth firmware is the firmware for initializing the remaining hardware except the data storage device in the hardware initialization phase during the entire user runtime.

[0060] At this time, in an optional implementation, the processor can be configured to: after the target firmware in the off-chip firmware storage device is loaded into the first firmware running medium and runs, the fifth firmware is loaded into the data storage device and runs. That is, in this optional implementation, both the fifth firmware and the first firmware are loaded and run in the data storage device.

[0061] Accordingly, in the above optional implementation manner, the size of the firmware running area set in the data storage device should be greater than or equal to the total size of the fifth firmware and the first firmware.

[0062] Through the above-mentioned optional implementation method, the initialization of the data storage device is extracted from the hardware initialization stage during the entire user runtime and loaded and run as a separate target firmware in the first firmware running medium, and then the fifth firmware that implements the initialization of the remaining hardware except the data storage device is placed in the data storage device for execution like the first firmware. In this way, the first firmware running medium can be exclusively used by the relevant firmware during the administrator runtime earlier, so that the relevant firmware during the administrator runtime (such as the aforementioned fourth firmware) can be loaded and run earlier.

[0063] In some other optional implementations of the embodiments of the present application, both the target firmware and the fifth firmware may be loaded and run in the second running space.

[0064] In an optional implementation of the embodiment of the present application, if Figure 4 As shown, the data storage device may be disposed in a system on chip. In another optional implementation of the embodiment of the present application, as Figure 2 As shown, the data storage device may be disposed outside the system on chip.

[0065] like Figure 5 As shown, in the embodiment of the present application, the system on chip may also have a second firmware running medium for storing the on-chip firmware. The processor is connected to the second firmware running medium to use the on-chip firmware as a trusted root to verify the off-chip firmware. The specific verification method can be implemented in an existing manner, which will not be described in detail in the embodiment of the present application.

[0066] Based on the same inventive concept, see Figure 6 As shown, Figure 6 The flowchart of the firmware startup method provided in the embodiment of the present application is shown. The firmware startup method is applied to the processor of the above-mentioned system on chip, including:

[0067] S601: Obtain firmware from an off-chip firmware storage device and load it into a first firmware execution medium for execution.

[0068] S602: After the target firmware in the off-chip firmware storage device is loaded into the first firmware running medium and runs, the first firmware is obtained from the off-chip firmware storage device and loaded into the data storage device for running.

[0069] In the case where the first firmware running medium includes a first running space and a second running space, step S701 may include: obtaining the second firmware from an off-chip firmware storage device and loading it into the first running space for running; and obtaining other firmware except the second firmware from the off-chip firmware storage device and loading it into the second running space for running, until the target firmware is loaded into the second running space and run.

[0070] Optionally, when other firmware includes a fourth firmware for implementing application management in the administrator runtime state, the method provided in the embodiment of the present application may further include: after the target firmware in the off-chip firmware storage device is loaded into the first firmware running medium and run, running the fourth firmware when the fourth firmware exclusively occupies the second running space.

[0071] To facilitate understanding of the specific process of the embodiment of the present application, the firmware loading process is described below by taking the case where the administrator runtime firmware group includes the second firmware, the third firmware, and the fourth firmware described above; the user runtime firmware includes the first firmware and the target firmware that implements the hardware initialization phase of the entire user runtime as an example:

[0072] First, the processor loads the second firmware into the first running space for execution, and then loads the third firmware into the second running space and executes it to initialize the hardware related to the administrator's runtime. Then, the target firmware is loaded into the second running space and executed to initialize all the hardware related to the user's runtime, including the data storage device. Thereafter, the fourth firmware is loaded into the second running space and executed to provide application management services in the administrator's runtime state, and the first firmware is loaded into the data storage device and executed to provide software application services in the user's runtime state.

[0073] The solution based on the embodiment of the present application can not only reduce the difficulty of firmware development and design to a certain extent, but also have more benefits compared with the related technology. In order to more clearly reflect the benefits, the following comparative description is made with the related technology as a comparative example:

[0074] Assume that the first firmware runs on SRAM and the second firmware runs on ROM, both of which are 64KB. The on-chip firmware includes FW0, and the off-chip firmware includes FW1, FW2, and FW3. For related definitions, see the above description.

[0075] In the comparative example, the SRAM is equally divided into two spaces, one space is dedicated to running the firmware during administrator runtime, namely FW1, and the other space is dedicated to running the firmware during user runtime, namely FW2 and FW3.

[0076] Due to the limitation of 32KB of running space, FW1, FW2 and FW3 are divided into firmware FW1.0, FW1.1, FW2.0, FW2.1 and FW3 respectively. Among them, the size of FW3 is determined by the number and size of user-mode software applications. Here, only the example of FW3 being less than 32KB is shown. In other cases, FW3 may be larger than 32KB, and in this case, it is also necessary to split it in the relevant technology.

[0077] The function definition of each firmware is shown in the table below.

[0078] Table 1

[0079]

[0080] When loading the off-chip firmware FW1, FW2 and FW3 into SRAM for operation, the timing can be seen in Figure 7 As shown. At startup, the on-chip firmware FW0 of the ROM is first run, and the firmware FW1.0 is loaded and run in the management space of the SRAM (executed at time t0). Then, at time t1, the firmware FW2.0 is loaded and run in the application space of the SRAM, until time t3, the firmware FW2.1 is loaded and run in the application space of the SRAM, and until time t6, the firmware FW1.1 is loaded and run in the management space of the SRAM, and the firmware FW3 is loaded and run in the application space of the SRAM.

[0081] Correspondingly, in the embodiment of the present application, the SRAM is divided into two areas, 10KB and 54KB respectively.

[0082] As shown in Table 2 below, the embodiment of the present application divides FW1 into FW1.0.0 (i.e., the second firmware, with a size of 10KB), FW1.0.1 (the third firmware), and FW1.1 (the fourth firmware); and divides FW2 into FW2.0 and FW2.1, one of which includes a program for implementing the initialization of the data storage device.

[0083] Table 2

[0084]

[0085] Then correspondingly, when the off-chip firmware FW1, FW2 and FW3 are loaded into SRAM for operation, the timing can be seen in Figure 8 As shown. At startup, the on-chip firmware FW0 of the ROM will be run first, and the firmware FW1.0.0 will be loaded and run in the first running space of the SRAM (executed at time t0). Then, the firmware FW1.0.1 will be loaded and run in the second running space of the SRAM at time t1, and then the firmware FW2.0 will be loaded and run in the second running space of the SRAM at time t2, and then the firmware FW2.1 will be loaded and run in the second running space of the SRAM at time t2, until the firmware FW1.1 is loaded and run in the second running space of the SRAM at time t5, and the firmware FW3 will be loaded and run in the data storage device at time t6.

[0086] Then, referring to Table 3 below, the space benefit of this application relative to the comparative example is as shown in Table 3.

[0087] Table 3

[0088]

[0089] It should be noted that both FW1.0 and FW1.1 in the comparative example include a firmware loading service, which occupies 10KB in size. The above table is a slogan comparison, and this part is extracted for comparison. Among them, 1024KB+ means that at least 1M of space in the data storage device is isolated as the firmware running space in this application.

[0090] In addition, for the firmware FW2, assuming that the data size is between 32K and 54K, the comparative solution needs to be split into FW2.0 and FW2.1, while the solution of the present application does not need to be split. The operating benefits at this time can be shown in Table 4 below.

[0091] Table 4

[0092]

[0093]

[0094] Among them, SS is the total space of SRAM, SM is the size of the firmware running area isolated in the data storage device, and SAL is the space required for loading and running FW1.0.0.

[0095] Based on the same inventive concept, an embodiment of the present application further provides an electronic device, which includes the system on chip provided by the embodiment of the present application.

[0096] Exemplarily, the electronic device may be a mainboard, a card, a graphics card, a controller, or the like having the system on a chip, and may be an electronic device that is a part of the entire electronic device.

[0097] In the embodiment of the present application, the data storage device may be disposed on the electronic device and be a part of the electronic device, or may be a storage device disposed outside the electronic device.

[0098] In the embodiment of the present application, the off-chip firmware storage device may be disposed on the electronic device and be a part of the electronic device, or may be disposed outside the electronic device.

[0099] In an embodiment of the present application, an electronic device is also provided, which includes the above-mentioned electronic device and also includes a data storage device and an off-chip firmware storage device.

[0100] Exemplarily, the electronic device may also include an internal communication bus for realizing communication between the on-chip system and various devices outside the chip; for example, it may also have an external communication interface, such as a USB (Universal Serial Bus) interface, a CAN (Controller Area Network) bus interface, etc.; for example, it may also have information display components such as a display screen, but this is not a limitation.

[0101] Exemplarily, the electronic device may be, but is not limited to, a server, a host, an intelligent terminal (such as a laptop computer, a smart phone, a desktop computer, a car computer, etc.).

[0102] In the embodiment of the present application, the processor may be a GPU (Graphics Processing Unit), a CPU (Central Processing Unit), an AI (Artificial Intelligence) processor, an NPU (Neural Network Processing Unit), an ISP (Image Signal Processor), a DPU (Display Processing Unit), a VPU (Video Processing Unit), a data processing core of a DSP (Digital Signal Processor), etc. The above are only examples and should not be a limitation to the present application.

[0103] In the embodiments provided in this application, it should be understood that the disclosed products and methods can be implemented in other ways. The device embodiments described above are only exemplary. The coupling or direct coupling or communication connection between each other shown or discussed can be an indirect coupling or communication connection through some communication interface, device or unit, which can be electrical, mechanical or other forms.

[0104] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0105] As used herein, a plurality refers to two or more than two.

[0106] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A system on chip, characterized in that: include: A first firmware running medium and a processor; The processor is connected to the first firmware running medium and is configured to be connected to an off-chip firmware storage device and a data storage device respectively; The processor is also configured to: after loading the target firmware in the off-chip firmware storage device into the first firmware running medium and running it, load the first firmware in the off-chip firmware storage device into the data storage device and run it; wherein the target firmware is firmware that can initialize the data storage device, and the first firmware is firmware that implements software applications in a user runtime state.

2. The system on chip according to claim 1, wherein: The first firmware running medium includes a first running space and a second running space; The first running space is used to load and run the second firmware; the second firmware is the firmware that implements the firmware loading service in the administrator runtime firmware group; The second running space is used to load and run each firmware except the second firmware.

3. The system on chip according to claim 2, wherein: The size of the first operating space is equal to the size of the second firmware.

4. The system on chip according to claim 2, wherein: The administrator runtime firmware group also includes: a third firmware for implementing hardware initialization in the administrator runtime state, and a fourth firmware for implementing application management in the administrator runtime state; the third firmware, the fourth firmware, and the target firmware run in the second running space, and after the target firmware runs, the fourth firmware exclusively occupies the second running space.

5. The system on chip according to claim 1, wherein: The target firmware is a firmware that implements the hardware initialization phase of the entire user runtime; wherein the hardware initialization phase of the entire user runtime includes the initialization of the data storage device.

6. The system on chip according to claim 1, wherein: The target firmware and the fifth firmware are stored in the off-chip firmware storage device; the target firmware is the firmware for initializing the data storage device; the fifth firmware is the firmware for initializing the remaining hardware except the data storage device in the hardware initialization phase during the entire user runtime; The processor is further configured to: after the target firmware in the off-chip firmware storage device is loaded into the first firmware execution medium and executed, load the fifth firmware into the data storage device and execute it.

7. The system on chip according to any one of claims 1 to 6, characterized in that: The data storage device is disposed in the system on chip.

8. A firmware startup method, characterized in that: In a processor applied to a system on chip, the system on chip further includes a first firmware running medium; the processor is connected to the first firmware running medium and is configured to be connected to an off-chip firmware storage device and a data storage device respectively; the method includes: Obtaining firmware from the off-chip firmware storage device and loading it into the first firmware running medium for execution; After the target firmware in the off-chip firmware storage device is loaded into the first firmware running medium and runs, the first firmware is obtained from the off-chip firmware storage device and loaded into the data storage device for running; The target firmware is firmware that can initialize the data storage device, and the first firmware is firmware that implements software applications in a user runtime state.

9. The firmware startup method according to claim 8, characterized in that: The first firmware running medium includes a first running space and a second running space; Obtaining firmware from the off-chip firmware storage device and loading it into the first firmware running medium for execution, comprising: Obtain a second firmware from the off-chip firmware storage device and load it into the first running space for running; the second firmware is the firmware that implements the firmware loading service in the administrator runtime firmware group; Firmware other than the second firmware is acquired from the off-chip firmware storage device and loaded into the second operating space for execution, until the target firmware is loaded into the second operating space for execution.

10. The firmware startup method according to claim 9, characterized in that: The other firmware includes a fourth firmware that implements application management in an administrator runtime state; The method further comprises: After the target firmware in the off-chip firmware storage device is loaded into the first firmware running medium and runs, the fourth firmware runs when the fourth firmware exclusively occupies the second running space.

11. An electronic device, characterized in that: The method comprises a system on chip as claimed in any one of claims 1 to 7.

12. An electronic device, characterized in that: Comprising the electronic device as claimed in claim 11.