Disclosure of Invention
The embodiment of the invention provides a chip system and a starting method of the chip system, which aim to realize the diversity of starting modes of the chip system.
In a first aspect, an embodiment of the present invention provides a chip system, including: the system comprises a Central Processing Unit (CPU), a serial communication interface and an address remapping unit which are connected with the CPU, and an on-chip storage unit which is connected with the address remapping unit through an on-chip bus;
the CPU is used for initializing according to the acquired reset signal;
the serial communication interface is used for sending the acquired starting instruction to the address remapping unit, wherein the starting instruction comprises starting data and a target address;
the address remapping unit is used for sending the starting data to the on-chip storage unit through the on-chip bus and storing the starting data in a target address of the on-chip storage unit;
and the CPU is used for reading the starting data from the target address of the on-chip storage unit through the on-chip bus based on the address remapping unit when the reset signal is released, and starting according to the starting data.
Optionally, the system further includes a selection unit, the selection unit is connected to the serial communication interface through a first input port, and the selection unit is connected to the external host through a second input port; and the selection unit is used for selecting the reset signal input from the first input port or the second input port according to a first selection instruction of a user and transmitting the reset signal to the CPU.
Optionally, the selecting unit is further configured to select a reset release message input from the first input port or the second input port according to a second selection instruction of the user, and transmit the reset release message to the CPU, so that the CPU releases the reset signal.
Optionally, the system further comprises a peripheral device, the peripheral device being connected to the bus; and the CPU is also used for controlling the working state of the peripheral equipment after starting.
Optionally, the system further includes a read only memory ROM connected to the on-chip bus, and an address remapping unit, and is further configured to update a historical start address with a target address, where the ROM stores historical start data in the historical start address.
Optionally, the CPU is configured to delete the saved historical operating data according to the acquired reset signal, and restore to an initial state to perform initialization.
In a second aspect, an embodiment of the present invention provides a method for starting a chip system, where the method is applied to the chip system, and includes: initializing according to the acquired reset signal through the CPU;
sending the obtained starting instruction to an address remapping unit through a serial communication interface, wherein the starting instruction comprises starting data and a target address;
sending the starting data to an on-chip storage unit through an on-chip bus by a remapping unit, and storing the starting data in a target address of the on-chip storage unit;
when the CPU determines that the reset signal is released, starting data is read from a target address of the on-chip storage unit through the on-chip bus based on the address remapping unit, and starting is carried out according to the starting data.
Optionally, before the initialization is performed by the CPU according to the acquired reset signal, the method further includes: a reset signal sent from the serial communication interface or an external host is acquired.
Optionally, after the starting is performed according to the starting data, the method further includes: the working state of the peripheral equipment is controlled by the CPU.
Optionally, the initializing by the CPU according to the acquired reset signal includes: and deleting the saved historical operating data by the CPU according to the acquired reset signal, and restoring to an initial state for initialization.
According to the technical scheme of the embodiment of the invention, the starting data acquired through the serial communication interface is stored in the target address of the on-chip storage unit, so that the CPU is started according to the starting data read from the target address after reset release, and the starting data can be changed as required, so that the requirement of a user on the diversity of starting modes is met.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, software implementations, hardware implementations, and so on.
Example one
Fig. 2 is a schematic structural diagram of a chip system according to an embodiment of the present invention, where the chip system includes: a central processing unit CPU 11, aserial communication interface 12 and anaddress remapping unit 13 connected to the CPU, and an on-chip memory unit 15 connected to the address remapping unit via an on-chip bus 14.
The CPU 11 is used for initializing according to the acquired reset signal; theserial communication interface 12 is configured to send the obtained start instruction to the address remapping unit, where the start instruction includes start data and a target address; theaddress remapping unit 13 is configured to send the start data to the on-chip memory unit through the on-chip bus, and store the start data in a target address of the on-chip memory unit; and the CPU 11 is used for reading starting data from the target address of the on-chip storage unit through the on-chip bus based on the address remapping unit when the reset signal is released, and starting according to the starting data.
Optionally, the system further includes aselection unit 16, theselection unit 16 is connected to the serial communication interface through a first input port, and the selection unit is connected to the external host through a second input port; and the selection unit is used for selecting the reset signal input from the first input port or the second input port according to a first selection instruction of a user and transmitting the reset signal to the CPU.
Optionally, the CPU is configured to delete the saved historical operating data according to the acquired reset signal, and restore to an initial state to perform initialization.
Optionally, the system further includes a read only memory ROM connected to the on-chip bus, and an address remapping unit, and is further configured to update a historical start address with a target address, where the ROM stores historical start data in the historical start address.
Specifically, the addition of serial communication has two roles:
the first function is: in this embodiment, a reset channel controlled by the serial communication interface is newly added under the condition that the original reset channel is reserved, the CPU can be reset by any one reset signal input by the two reset channels, and the selection unit can specifically select the reset channel according to a first selection instruction input by a user. And when any reset signal is wrong, the user can select the other reset signal, so that the purpose of controlling the reset of the CPU is achieved. After acquiring the reset signal, the CPU deletes historical operating data saved in the previous operating process, and restores to an initial state for initialization, thereby preparing for the CPU to start up to re-execute a new task.
The second function is: although the chip system includes a read onlymemory ROM 18 connected to an on-chip bus, the boot history data in the ROM is already written in the boot history address in the ROM during the manufacturing process of the chip system, and even if the written boot history data is found to be incorrect or the boot mode needs to be changed according to the actual situation, the boot history data in the ROM cannot be revised again. Theserial communication interface 12 is added to send the acquired boot instruction to theaddress remapping unit 13, and since the boot instruction includes boot data and a target address, theaddress remapping unit 13 sends the boot data to the on-chip storage unit 15 through the on-chip bus, and stores the boot data included in the instruction in the target address of the on-chip storage unit. The on-chip Memory unit in this embodiment may be any Memory space capable of performing data updating, for example, a Random Access Memory (RAM), etc., and of course, this embodiment is merely an example, and does not limit the specific type of the on-chip Memory unit. Compared with the prior ROM starting mode, the method and the device have the advantages that the user can modify historical starting data according to needs and store the acquired new starting data in the on-chip storage space, so that the starting space of the chip system is remarkably expanded. As shown by the dotted line in fig. 2, a schematic diagram of the transmission process of saving the startup data acquired through the serial communication interface in the on-chip storage unit is shown.
It should be noted that, while theaddress remapping unit 13 sends the boot data to the on-chip storage unit through the on-chip bus and stores the boot data in the target address of the on-chip storage unit, in order to facilitate the subsequent CPU to read new boot data from a correct location, theaddress remapping unit 15 updates the historical boot address with the target address, so that the CPU can determine the storage location of the new boot data by accessing the address remapping unit, and does not continue to read the historical boot data that may be incorrect from the historical boot address of the original ROM.
Optionally, the selectingunit 16 is further configured to select a reset release message input from the first input port or the second input port according to a second selection instruction of the user, and transmit the reset release message to the CPU, so that the CPU releases the reset signal.
When the starting data is stored in the target address of the on-chip storage unit by the address remapping unit, and the CPU obtains the disappearance of the reset release through the first input port of the selection unit connected with the serial communication interface or the second input port of the selection unit, the reset signal is released. After the reset signal is released, the CPU reads the starting data from the target address of the on-chip storage unit through the on-chip bus based on the address remapping unit and starts according to the acquired starting data.
Optionally, the chip system further includes aperipheral device 17, the peripheral device being connected to the bus; and the CPU is also used for controlling the working state of the peripheral equipment after starting. Therefore, the CPU after starting controls the normal work of the whole chip system.
It should be noted that in this embodiment, the serial communication interface may be used as one Master device, and of course, other types ofMaster device masters 19 may also be included in the chip system, and a specific type of the other types ofMaster device masters 19 is not limited in this embodiment.
According to the technical scheme of the embodiment of the invention, the starting data acquired through the serial communication interface is stored in the target address of the on-chip storage unit, so that the CPU is started according to the starting data read from the target address after reset release, and the starting data can be changed as required, so that the requirement of a user on the diversity of starting modes is met.
Example two
Fig. 3 is a flowchart of a method for starting a system on chip according to an embodiment of the present invention, where the method can be applied to the system on chip according to the embodiment of the present invention. As shown in fig. 3, the method specifically includes the following operations:
in step S101, initialization is performed by the CPU according to the acquired reset signal.
Optionally, before the initialization is performed by the CPU according to the acquired reset signal, the method may further include: a reset signal sent from the serial communication interface or an external host is acquired.
Optionally, initializing by the CPU according to the acquired reset signal may include: and deleting the saved historical operating data by the CPU according to the acquired reset signal, and restoring to an initial state for initialization.
Specifically, the system also comprises a selection unit, wherein the selection unit is connected with the serial communication interface through a first input port and is connected with an external host through a second input port; and the selection unit is used for selecting the reset signal input from the first input port or the second input port according to a first selection instruction of a user and transmitting the reset signal to the CPU.
It should be noted that, in this embodiment, in the case of keeping the original one reset channel, a reset channel controlled by the serial communication interface is newly added, any one reset signal input through the two reset channels can reset the CPU, and specifically, the selection unit can perform selection according to the first selection instruction input by the user. And when any path of reset signal is wrong, another path of reset signal can be selected, so that the aim of controlling the reset of the CPU is fulfilled. After the CPU acquires the reset signal, the CPU deletes historical operating data stored in the previous operating process and restores the historical operating data to an initial state for initialization, so that preparation is made for the CPU to start and execute a new task again.
Step S102, sending the obtained starting instruction to an address remapping unit through a serial communication interface, wherein the starting instruction comprises starting data and a target address.
Specifically, in the present embodiment, the boot space of the system-on-chip is expanded by the serial communication interface, and although the system-on-chip includes the read only memory ROM connected to the on-chip bus, the historical boot data in the ROM is already written into the historical boot address in the ROM during the manufacturing process of the system-on-chip, and even if the written historical boot data is found to be incorrect or the boot method needs to be changed according to actual conditions, the historical boot data in the ROM cannot be modified again. The obtained starting instruction can be sent to the address remapping unit by adding the serial communication interface, and the starting instruction contains starting data and a target address, so that the address remapping unit sends the starting data to the on-chip storage unit through the on-chip bus and stores the starting data contained in the instruction in the target address of the on-chip storage unit. The on-chip Memory unit in this embodiment may be any Memory space capable of performing data updating, such as a Random Access Memory (RAM), and the like. Compared with the prior ROM starting mode, the method has the advantages that the user can modify the historical starting data according to the requirement and store the acquired new starting data in the on-chip storage space, so that the starting space of the chip system is remarkably expanded.
Step S103, the starting data is sent to the on-chip storage unit through the on-chip bus by the address remapping unit and is stored in the target address of the on-chip storage unit.
Specifically, in this embodiment, the address remapping unit sends the startup data to the on-chip memory unit through the on-chip bus, and stores the startup data in the target address of the on-chip memory unit. Meanwhile, in order to facilitate the subsequent CPU to read new starting data from a correct position, the historical starting address is updated by the target address through the address remapping unit, so that the CPU can determine the storage position of the new starting data by accessing the address remapping unit, and the historical starting data which is possibly wrong is not continuously read from the historical starting address of the original ROM.
And step S104, when the CPU determines that the reset signal is released, reading starting data from the target address of the on-chip storage unit through the on-chip bus based on the address remapping unit, and starting according to the starting data.
Specifically, when the address remapping unit is determined to store the start data in the target address of the on-chip storage unit, and the CPU obtains the disappearance of the reset release through the first input port of the selection unit connected to the serial communication interface or the second input port of the selection unit, the reset signal is released. After the reset signal is released, the CPU reads the starting data from the target address of the on-chip storage unit through the on-chip bus based on the address remapping unit and starts according to the acquired starting data.
According to the technical scheme of the embodiment of the invention, the starting data acquired through the serial communication interface is stored in the target address of the on-chip storage unit, so that the CPU is started according to the starting data read from the target address after reset release, and the starting data can be changed as required, so that the requirement of a user on the diversity of starting modes is met.
EXAMPLE III
Fig. 4 is a flowchart of a startup method of a chip system according to an embodiment of the present invention, where the embodiment is based on the foregoing embodiment, and after performing startup according to startup data, the method further includes: the working state of the peripheral equipment is controlled by the CPU.
In step S201, initialization is performed by the CPU according to the acquired reset signal.
Optionally, before the initialization is performed by the CPU according to the acquired reset signal, the method may further include: a reset signal sent from the serial communication interface or an external host is acquired.
Optionally, initializing by the CPU according to the acquired reset signal may include: and deleting the saved historical operating data by the CPU according to the acquired reset signal, and restoring to an initial state for initialization.
Step S202, sending the obtained starting instruction to an address remapping unit through a serial communication interface, wherein the starting instruction comprises starting data and a target address.
Step S203, sending the start data to the on-chip storage unit through the on-chip bus by the address remapping unit, and storing the start data in the target address of the on-chip storage unit.
Step S204, when the CPU determines that the reset signal is released, starting data is read from the target address of the on-chip storage unit through the on-chip bus based on the address remapping unit, and starting is carried out according to the starting data.
In step S205, the operating state of the peripheral device is controlled by the CPU.
Specifically, the chip system further comprises a peripheral device, and the peripheral device is connected with the bus. In this embodiment, the CPU in the startup state may also control the operating state of the peripheral device, so as to ensure that other peripheral devices of the chip system can operate normally after the CPU is started.
It should be noted that the peripheral device in this embodiment may include a USB port, a sound card, or the like, and the specific type of the peripheral device is not limited in this embodiment, and it is within the scope of the present application as long as the CPU can control the operating state of the peripheral device and ensure the normal operation of the whole chip system.
According to the technical scheme of the embodiment of the invention, the starting data acquired through the serial communication interface is stored in the target address of the on-chip storage unit, so that the CPU is started according to the starting data read from the target address after reset release, and the starting data can be changed as required, so that the requirement of a user on the diversity of starting modes is met. And the CPU after starting controls the working state of the peripheral equipment, thereby ensuring the normal work of other peripheral equipment of the chip system.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.