A kind of processor system and startup method thereof of using a plurality of startup-program memory
Technical field
The present invention relates to processor system, specifically, relate to a kind of processor system and startup method thereof that comprises two startup-program memory.
Background technology
Processor system is comprising that Embedded Application field and traditional a plurality of fields such as computer realm are widely used.In processor system, starting (Boot) program is the basic software of processor system.The start-up routine major function is the initialization processor system, makes the system start-up operation.In traditional computing machine, be referred to as Basic Input or Output System (BIOS) (Basic Input-Output System, BIOS), the most basic hardware testing when mainly providing computer run, the characteristic of definition computing machine is also handled basic work.That start-up routine generally is stored in is non-volatile, in the storer of electrically rewritable, for example Flash storer, E2PROM etc. can keep content under the situation of power down, guarantee normally to start when powering on next time, and can be to the storer reprogramming, the starting and upgrading program increases new function.
But the content of start-up routine not necessarily can guarantee entirely true.At first, though the storer that start-up routine uses is a nonvolatile memory, the circuit of storer can produce degeneration along with the time, and the content of storage can change, and produces mistake; In addition,,, can cause the start-up routine mistake, cause processor system not start because outage etc. cause the interruption of upgrading owing to, need carry out online upgrading to startup-program memory to the start-up routine upgrading.
Now, two startup-program memory of multinomial use are arranged, thereby the safety that guarantees start-up routine is guaranteed the normal patent that starts of processor system.For example, U.S. Pat 5793943, US5835695, US6185696, wherein the computer system of describing is used two startup-program memory, when powering on for the first time, chooses host-initiated program storer wherein, whether the Content inspection that processor is analyzed the host-initiated program storer mistake, when finding mistake, the sheet choosing produces circuit disables host-initiated program storer, chooses from startup-program memory, from the same start-up routine of startup-program memory storage, thereby realize normal the startup.The defective of these technology is that the content of startup-program memory in the start-up course is whether wrong to be confirmed by processor, and in program error, when processor can't the startup-program memory Content inspection, system just can't start.The computer system of describing in the U.S. Pat 6079016 is also used two startup-program memory, uses two to reset or keyboard input control generation reset signal, makes the sheet choosing produce circuit and chooses different startup-program memory.When processor starts,, produce circuit by second reset signal control strip choosing and choose second startup-program memory, start again if find mistake.The defective of this technology is to find automatically the mistake of start-up routine, needs manual intervention, can not reset automatically in use in the Embedded Application field, can't recover mistake.The patent of China's application number 01104726.7 has been described a kind of method that makes BIOS memory storage autoamtic safe reset in computer system, and system has storage respectively to be used to start first bios program of computer system and the main BIOS memory storage and the safety of second bios program is replied the BIOS memory storage; One of them also comprises the quick program of BIOS.Make safety reply the energising of BIOS memory storage during start earlier, check first bios program, errors excepted then safety is replied the content reprogramming master BIOS memory storage of BIOS memory storage by the quick program of BIOS by error detect circuit.The chip power-on circuit then makes the former cut off the power supply and the latter is switched on, and is continued the boot program of computer system by the latter.The defective of technology is the error detect circuit that exists one to add, realizes relatively difficulty, and a BIOS memory storage can not be realized able to programme simultaneously.Above-mentioned all technology also have a bigger defective, are exactly that startup-program memory exists the principal and subordinate to be provided with, and must acquiescence start from a startup-program memory after outage, have bigger risk when the acquiescence startup-program memory lost efficacy.
Summary of the invention
The technical problem to be solved in the present invention is the processor system of a plurality of startup-program memory of use of the mistake that a kind of easy realization is provided, can discerns start-up routine automatically.
The another technical matters that the present invention will solve is to provide a kind of easy realization, and the method for the processor system of a plurality of startup-program memory is used in the startup of safety.
For realizing the technical problem to be solved in the present invention, the present invention uses the processor system of a plurality of startup-program memory to comprise:
Processor unit, at least two startup-program memory selecting the signal generation unit and link to each other with processor unit by data bus and address bus, described selection signal generation unit is connected with described two startup-program memory with described processor unit at least, it is characterized in that: comprise that further the selection signal that is connected with described selection signal generation unit with processor unit produces control module, reaches the non-volatile electrically alterable storage that links to each other with described selection signal generation control module.
Be the another technical matters that realizes that the present invention will solve, the present invention uses the startup method of the processor system of a plurality of startup-program memory to comprise:
(1) system powers on;
(2) processor unit output starts selection signal, address and the data that need;
(3) select signal to produce control module and read non-volatile electrically alterable storage, select the signal switch-over control signal, select the output of signal generation unit to select the output enable of signal as control according to the output that is provided with of reading; If do not have content or content false in the non-volatile electrically alterable storage, select signal to produce the control module acquiescence and select a startup-program memory or picked at random one startup-program memory, and setting is write non-volatile electrically alterable storage;
(4) select the output of signal generation unit to select signal to give the startup-program memory of setting;
(5) startup-program memory of She Dinging is selected, and system begins to start;
(6) processor unit starts successfully, and output starts successful confirmation signal and produces control module for the selection signal;
(7) in processor system successfully starts the required time, select signal to produce control module and receive the successful confirmation signal of startup, start and finish, otherwise, continue;
(8) select signal to produce control module and rewrite non-volatile electrically alterable storage, be provided with and choose the another one startup-program memory;
(9) select signal to produce control module and produce reset signal, resetting system; Continue (2), perhaps system cut-off continues (1).
Be the another technical matters that realizes that the present invention will solve, the present invention uses the processor system of a plurality of startup-program memory to realize that a method that starts in a plurality of startup-program memory comprises in the selective system:
(1) system has powered on and has successfully started operation;
(2) processor unit selection of configuration signal produces control module, changes the setting of storing in the non-volatile electrically alterable storage;
(3) processor unit selection of configuration signal produces control module and produces the reseting signal reset system, then carries out from (5), and perhaps outage restarts, and continues;
(4) system powers on;
(5) processor unit output starts selection signal, address and the data that need;
(6) select signal to produce control module and read non-volatile electrically alterable storage, select the signal switch-over control signal, select the output of signal generation unit to select the output enable of signal as control according to the output that is provided with of reading;
(7) select the output of signal generation unit to select signal to give the startup-program memory of setting;
(8) startup-program memory of She Dinging is selected, and system begins to start;
(9) processor unit starts successfully, and output starts successful confirmation signal and produces control module for the selection signal;
(10) in processor system successfully starts the required time, select signal to produce control module and receive the successful confirmation signal of startup, start and finish, otherwise, continue;
(11) select signal to produce control module and rewrite non-volatile electrically alterable storage, be provided with and choose the another one startup-program memory;
(12) select signal to produce control module and produce reset signal, resetting system; Continue (5), perhaps system cut-off continues (4).
Compared with prior art, system and method of the present invention, do not need to add the content false pick-up unit, not needing processor to carry out content false detects, can discern the mistake of start-up routine automatically, detect under the situation that can't start and to automatically reset, and switch to another startup-program memory and start, and the automatically storage setting that can successfully start, improve the safety coefficient that starts; Startup-program memory in the system does not have principal and subordinate's branch, can independently upgrade to a plurality of start-up routines in the system also can specify startup-program memory to start, and can after specifying startup-program memory, storage be provided with, after outage, re-power the back and continue according to startup is set; Can there be a plurality of start-up routines identical or inequality in system in the system, is beneficial to the upgrading and the test of system start-up program, increases the startup security of system.
Description of drawings
Fig. 1 is the synoptic diagram that the present invention uses the processor system of a plurality of startup-program memory.
Fig. 2 is a synoptic diagram of selecting the signal switch control unit among Fig. 1.
Embodiment
The present invention is described in further detail below in conjunction with accompanying drawing:
As shown in Figure 1, the present invention uses the processor system of a plurality of startup-program memory to comprise: processor unit 101, and select signal to produce control module 102, select signal generation unit 103, a plurality of startup-program memory, and non-volatile electrically alterable storage 106.A plurality of startup-program memory comprise startup-program memory A104, startup-program memory B105 ..., start-up routine storage N107.
Processor unit 101 is control modules of system, also is the promoter who starts, and is connected with selecting signal generation control module 102.Processor unit 101 is connected with address bus by data bus with a plurality of startup-program memory, and the selection signal of storer is provided, and comprises sheet choosing, read signal and write signal.Select signal to produce control module 102 generations and select the control of signal switch-over control signal to switch a plurality of startup-program memory, and the content of rewritable non-volatile electrically alterable storage 106.Selecting signal to produce control module 102 is connected with processor unit 101 by control interface, control interface can adopt the level signal mode to control, perhaps adopt memory interface, by the difference setting of a plurality of registers, reception starts the order of successfully confirming and switching a plurality of startup-program memory.Select signal generation control module 102 to be connected, and the control of selecting signal to switch is provided, export a plurality of signals and adopt the level mode to control selection signal generation unit 103 with selecting signal generation unit 103.Selecting signal to produce between control module 102 and the non-volatile electrically alterable storage 106 is memory interface, can be by this interface to non-volatile electrically alterable storage 106 read-writes.The current acquiescence of non-volatile electrically alterable storage 106 storage systems starts the setting of storer.Select signal generation unit 103 to be connected, receive and select signal with processor unit 101.Select signal generation unit 103 and select signal to produce control module 102 to be connected, reception selection signal switch-over control signal is as the output enable signal of the selection signal of a plurality of startup-program memory.Select signal generation unit 103 to be connected, the selection signal of startup-program memory is provided, select selection signal some in a plurality of startup-program memory effective according to the state of selecting the signal switch-over control signal with a plurality of startup-program memory.Be data bus and address bus interface between startup-program memory 106 and the processor unit 101, receiver address signal and data, and the generation of selection signal singly is to select signaling interface between 103 yuan.
As shown in Figure 2, select signal to produce control module 102 and comprise timer 2 01, Memory Controller 203 and signal generation unit 202.Timer 2 01 starts when powering on or reset, revise the content of non-volatile electrically alterable storage 106 by the configuration interface of Memory Controller 203 in overtime back, and can start confirmation signal timeing closing device 201 by the control interface input, perhaps the input by control interface produces reset signal.Signal generation unit 202 writes setting by control interface or by configuration interface by the content that Memory Controller 203 reads non-volatile electrically alterable storage 106, produces to select the signal switch-over control signal.Memory Controller 203, be used for reading and writing non-volatile electrically alterable storage 106, and can write non-volatile electrically alterable storage 106 by processor unit 101 or by configuration interface by timer 2 01 by control interface, and can power on or reset after read non-volatile electrically alterable storage 106, the setting of reading by configuration interface signalization generation unit 202.
Selecting signal generation unit 103 is impact dampers of a band output enable, the selection signal replication that processor unit 101 is provided becomes many groups, offer startup-program memory A104 and startup-program memory B105 or other startup-program memory, and the selection signal switch-over control signal that selection signal generation control module 102 provides is controlled the output of two group selection signals as the output enable signal.In addition, can increase independent control, the security of enhanced system to write signal.
A plurality of startup-program memory are common non-volatile electrically alterable storages.Can select according to requirements such as processor unit docking port, level and sequential.
Non-volatile electrically alterable storage 106 can adopt the non-volatile electrically alterable storage of parallel interface or serial line interface, the for example FLASH of parallel interface, electrically-alterable ROM, the perhaps electrically-alterable ROM of I2C (Inter-IntegratedCircuit), SPI (Serial Peripheral Interface, serial peripheral interface) interface.
Method of the present invention mainly is to have increased a setting that the current startup-program memory of non-volatile electrically alterable storage 106 storage systems is selected, and can keep under power-down conditions; Simultaneously, there is not the setting of principal and subordinate's startup-program memory in the system.Use the setting up procedure of processor system of a plurality of startup-program memory as follows:
System powers on; Processor unit 101 outputs start selection signal, address and the data that need; Select signal to produce control module 102 and read non-volatile electrically alterable storage 106, select the signal switch-over control signal, select 103 outputs of signal generation unit to select the output enable of signal as control according to the output that is provided with of reading; Select 103 outputs of signal generation unit to select signal to one in the startup-program memory of setting; Startup-program memory of setting 104 or startup-program memory B105 or other startup-program memory are selected, and system begins to start; Processor unit 101 starts successfully, and output starts successful confirmation signal and produces control module 102 for the selection signal; Selecting signal to produce control module 102 in time in fixed length receives the successful confirmation signal of startup, starts and finish.If the start-up routine mistake of the startup-program memory that is provided with storage, processor system can't normally start, processor unit 101 can not carried out output and start successful confirmation signal, select signal to produce control module 102 behind timer expiry, select signal to produce the setting that control module 102 is rewritten non-volatile electrically alterable storage 106, the another one startup-program memory is chosen in setting, select signal to produce control module 102 and produce reset signal, resetting system, perhaps to system cut-off and re-power system restart.
The method that the present invention also provides any appointment startup-program memory to start can realize the test immediately after start-up routine is upgraded, and starting unsuccessful back automatic switchover startup-program memory, resets and restart, and guarantees the security of upgrading.Detailed step is as follows:
System has powered on and has successfully started operation; Processor unit 101 selection of configuration signals produce control module 102, change the setting of storage in the non-volatile electrically alterable storage 106; Processor unit 101 selection of configuration signals produce control module 102 and produce the reseting signal reset system, and perhaps outage restarts.Resetting system then directly restarts, and outage then needs system to power on to restart.After restarting, processor unit 101 outputs start selection signal, address and the data that need; Select signal to produce control module 102 and read non-volatile electrically alterable storage, select the signal switch-over control signal, select 103 outputs of signal generation unit to select the output enable of signal as control according to the output that is provided with of reading; Select 103 outputs of signal generation unit to select signal to start startup-program memory A104 or startup-program memory B105 or other startup-program memory for setting; The startup-program memory of setting is selected, and system begins to start; Processor unit 101 starts successfully, and output starts successful confirmation signal and produces control module 102 for the selection signal; Selecting signal to produce control module 102 in time in fixed length receives the successful confirmation signal of startup, starts and finish.If the start-up routine mistake of the startup-program memory that is provided with storage, processor system can't normally start, processor unit 101 can not carried out output and start successful confirmation signal, select signal to produce control module 102 behind timer expiry, select signal to produce the setting that control module 102 is rewritten non-volatile electrically alterable storage 106, the another one startup-program memory is chosen in setting, select signal to produce control module 102 and produce reset signal, resetting system, perhaps outage re-powers system restart.