A kind of method of chip self-adapting start equipment of system on chip
[technical field]
The present invention relates generally to a kind of method of starting outfit, especially the method for chip self-adapting start equipment of system on chip.
[background technology]
Current, along with the development of portable product with popularize, increasing portable system begins to adopt on-chip system chip (SOC:system-on-chip) to come the simplified system design, reduces system cost.Be to guarantee the versatility of SOC, SOC need support from USB (universal serial bus) (USB:Universal Serial Bus), with the non-volatile type flash memories of non-type (Nandflash), the non-volatile type flash memories of serial line interface (Serial Flash), universal asynchronous receiver and transmitter (uart) and the non-volatile type flash memories device starts such as (Norflash) of or/no type.Because different application systems need adopt different Starting mode, same system can adopt different Starting mode under different situations, for adapting to different Starting mode, need in The Hardware Design and SOC design, increase complicated circuit to meet the demands.
At present, for supporting various starting outfit, existing SOC implementation method has following two kinds:
Method one: be similar to the Starting mode of PC (personal computer, PC), its system architecture please refer to Fig. 1.The implementation of this method is: at the external generally starting memory device of SOC, this generally starting memory device can be various non-volatile type flash memories (flash) or read-only type storer (ROM:read-only-memory).When system start-up, SOC is reading system log-on message from universal storage device at first, according to system start-up information, determines system obtains remaining log-on data from which kind of equipment, to finish startup.But the realization of method one need increase extra generally starting memory device, has increased system cost, and needs SOC to provide special purpose interface to support the generally starting memory device, has increased the cost expense of SOC; The starting outfit of change system that can't be real-time, the starting outfit of system is determined by the generally starting memory device fully.
Method two: use the external starting outfit base pin selection of SOC to select starting outfit, its system architecture please refer to Fig. 2.The implementation of this method is: when system start-up, select starting outfit according to the combination of external starting outfit base pin selection.But the selection that the realization of method two needs SOC to provide extra pin to be used for starting outfit has increased the cost of SOC; Realize real-time modification starting outfit by designing extra circuit, increased the cost of system.
[summary of the invention]
The object of the present invention is to provide a kind of method of chip self-adapting start equipment of system on chip, this method has reduced the complexity of system cost and system, and can select starting outfit automatically according to the state of system.
In order to solve the problems of the technologies described above, the technical solution used in the present invention comprises a kind of method of chip self-adapting start equipment of system on chip, may further comprise the steps: steps A: built-in starting outfit identification code in on-chip system chip, identification code is distributed to the equipment of supporting that on-chip system chip starts; Step B: system powers on, and enters the starting outfit enumeration process, and on-chip system chip is enumerated starting outfit; Step C: by enumerating the identification code that starting outfit obtains starting outfit, mate, to determine whether the being effective recognition sign indicating number with the identification code character that on-chip system chip is built-in; Step D: noting identification code is effective equipment; Step e: on-chip system chip finds the starting outfit of setting, and system enters start-up course.
This method also comprises: described steps A further comprises: identification code is made as identical value or identification code is generated as different values according to the algorithm of determining, corresponding different startup priority.
This method also comprises: in described step e, in case the effectively start equipment that on-chip system chip is set to find is the starting outfit of setting, finish enumeration process, enter start-up course.
This method also comprises: in described step e, on-chip system chip is set to have enumerated the starting outfit of all supports, find out all effective starting outfits, finish enumeration process, then according to the priority of the identification code of effectively start equipment sign, find out effective starting outfit, enter start-up course.
The technical solution used in the present invention also comprises a kind of method of chip self-adapting start equipment of system on chip, may further comprise the steps: steps A: with on-chip system chip not the general purpose input/output port of usefulness identify each starting outfit, and the boot sequence of equipment; Step B: system powers on, and enters the starting outfit enumeration process, and on-chip system chip is enumerated starting outfit; Step C: by enumerating the identification code that starting outfit obtains starting outfit, mate, to determine whether the being effective recognition sign indicating number with the identification code character that on-chip system chip is built-in; Step D: noting identification code is effective equipment: step e: on-chip system chip finds the starting outfit of setting, and system enters start-up course.
Adopt technique scheme, in conjunction with the following embodiment that will describe in detail, beneficial technical effects of the present invention is: the present invention utilizes the built-in instruction stream of SOC, remove to enumerate each possible starting outfit, in case find effective starting outfit then stop search, begin to start from effective starting outfit; And the modification of external starting outfit can be identified automatically, thereby modification that can be real-time according to starting outfit, automatically start from appointed equipment, realize the various starting outfits of self-adaptation and do not need to increase the method for any additional circuit, solved problem, reduced the hardware cost and the SOC cost of system for the complicated hardware circuit that adapts to different Starting mode needs employings.
Feature of the present invention and advantage will be elaborated in conjunction with the accompanying drawings by embodiment.
[description of drawings]
Fig. 1 is existing system architecture reference diagram at the external generally starting memory device of SOC.
Fig. 2 selects the system architecture reference diagram of starting outfit for the external starting outfit base pin selection of existing use SOC.
Fig. 3 is the process flow diagram of the method for chip self-adapting start equipment of system on chip of the present invention.
[embodiment]
Core concept of the present invention is: utilize the built-in instruction stream of SOC, remove to enumerate each possible starting outfit, in case find effective starting outfit then stop search, begin to start from effective starting outfit; And the modification of external starting outfit can be identified automatically, thereby the modification according to starting outfit that can be real-time starts from appointed equipment automatically.
As shown in Figure 3, be the process flow diagram of the method for chip self-adapting start equipment of system on chip of the present invention.The method of this chip self-adapting start equipment of system on chip may further comprise the steps:
Step 100: built-in one group of starting outfit identification code in SOC, simultaneously identification code is distributed to the equipment of supporting that SOC starts, the allocation scheme that this identification code distributes is: simple system applies can be made as all identification codes identical value, complicated application can be generated as different values according to the algorithm of determining with identification code, corresponding different startup priority;
Step 110: when system powers on the back, at first enter the starting outfit enumeration process;
The built-in instruction stream of step 120:SOC begins to enumerate each possible starting outfit;
Step 130: by enumerating the identification code that starting outfit obtains starting outfit, mate with the identification code character that SOC is built-in, to determine whether the being effective recognition sign indicating number, the equipment that contains the effective recognition sign indicating number is effective starting outfit, if determine it is the effective recognition sign indicating number, then forward step 140 to,, then forward step 150 to if determine it is not the effective recognition sign indicating number;
Step 140: note this equipment;
Step 150: whether the judgment device enumeration process is finished, if enumeration process is finished, then forwards step 160 to, if enumeration process is not finished, then forwards step 120 to;
Step 160: when enumerate finish after, SOC finds the starting outfit of setting, system enters start-up course.
For simple system applies, in case the effectively start equipment that can be set to find is the starting outfit of setting, and finish enumeration process, enter start-up course; For the system applies of complexity, then need to have enumerated the starting outfit of all supports, find out all effective starting outfits, could finish enumeration process, according to the priority of the identification code of effectively start equipment sign, find out effective starting outfit then, enter start-up course.
A concrete application of the method for chip self-adapting start equipment of system on chip of the present invention: some application systems support USB to start and Nandflash starts.Under normal mode, USB is connecting system not, only can enumerate Nandflash during system start-up, therefore directly starts from Nandflash, in case Nandflash damages, then system can't start, and with the USB connecting system, then the USB startup can be enumerated by system under this kind state, after the USB startup, can repair Nandflash, the method for chip self-adapting start equipment of system on chip of the present invention does not need to revise any software and hardware setting, can finish the reparation to system.
Another embodiment of the method for chip self-adapting start equipment of system on chip of the present invention is: the method for this chip self-adapting start equipment of system on chip by the SOC chip not the general purpose input/output port (GPIO:generalpurpose input/output) of usefulness replace identification code, identify each starting outfit, and the boot sequence of equipment.
The above; only for the preferable concrete true mode of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claims.