WO2017143513A1 - Method, cpu and single board for starting boot - Google Patents

Method, cpu and single board for starting boot Download PDF

Info

Publication number
WO2017143513A1
WO2017143513A1 PCT/CN2016/074331 CN2016074331W WO2017143513A1 WO 2017143513 A1 WO2017143513 A1 WO 2017143513A1 CN 2016074331 W CN2016074331 W CN 2016074331W WO 2017143513 A1 WO2017143513 A1 WO 2017143513A1
Authority
WO
WIPO (PCT)
Prior art keywords
boot
address
backup
cpu
backups
Prior art date
Application number
PCT/CN2016/074331
Other languages
French (fr)
Chinese (zh)
Inventor
徐炜
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2016/074331 priority Critical patent/WO2017143513A1/en
Priority to CN201680082286.XA priority patent/CN108701036A/en
Publication of WO2017143513A1 publication Critical patent/WO2017143513A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the BootStrap determines the number of failed L2BootRom backups, and if it reaches the predetermined number of times, it jumps to the L1BootRom backup. Therefore, if the L2BootRom backup fails to be started, the board can also start the L1BootRom backup to complete the board startup.
  • the offset address is determined according to a pre-configured hardware indication signal, and the first address accessed by the CPU may be a zero address during the boot process. Or, the first address accessed by the CPU can be a non-zero address, when If the Boot backup of the non-zero address fails to start, try to start the Boot backup corresponding to the 0 address.
  • On-chip boot logic supports reading the backup code from two or more power-up locations.
  • the power-on position is the starting address of the code that reads the Boot backup when the on-chip boot logic starts running.
  • a power-on location corresponds to a Boot backup. Different Boot backup codes are read from different power-on locations to start different Boot backups.
  • the on-chip boot logic defines at least two alternate offset addresses, the number of alternate offset addresses being the number of power-up locations.
  • the number of alternative offset addresses is 2
  • the values of the two alternative offset addresses are 2 megabytes and 4 megabytes, respectively.
  • the CPU is provided with a pin for indicating an offset address, and is used for receiving a hardware indication signal input by the board, such as a pull-up corresponding to 2 megabytes and a pull-down corresponding to 4 megabytes.
  • the board designer selects one of the 2 megabits or 4 megabytes as the offset address according to actual needs, stores 2 Boot backups in the memory according to the value of the selected offset address, and configures corresponding hardware instructions. signal.
  • the on-chip boot logic determines the second address, reads the digital signature from the second boot backup, and the second Boot backup is verified.
  • the second boot backup passes the verification, the second boot backup is started.
  • the second boot backup is a factory version, and the second boot backup start address is a zero address.
  • the factory version of the second boot backup is started, and the second boot backup address is a non-zero address.
  • the on-chip boot logic supports two or more power-on locations. Each boot backup can be independently verified. It is not possible to check another boot backup because one boot backup fails. Therefore, A boot backup can be started normally by verifying and booting normally, thus improving the boot. Boot startup reliability.
  • the determining unit 301 is specifically configured to read the register value in the EPLD 303 and use the register value as the value of the offset address.
  • the memory 402 includes at least one flash memory chip 403, and FIG. 4 shows a case where three flash memory chips 403 are included. At least two boot backups are stored in at least one flash chip 403. Among the at least one flash chip 403, at least one boot backup is stored in one flash chip 403.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present invention relates to the field of computers. Disclosed are a method, a CPU and a single board for starting Boot, which may improve the Boot start reliability. The specific solution is as follows: the CPU is installed on the single board, and the single board includes a memory, the memory containing at least two guide Boot backups. In the at least two Boot backups, an offset address of two adjacent backups has a preset value, wherein the offset address is the interval between the starting addresses of two adjacent Boot backups. The CPU determines the offset address and according to the offset address, starts the at least two Boot backups one by one and in a preset order until one Boot backup starts successfully. The present invention is applicable to the manufacturing of CPU and single boards.

Description

一种启动Boot的方法、CPU及单板Method for starting boot, CPU and board 技术领域Technical field
本发明涉及计算机领域,尤其涉及一种启动Boot的方法、CPU及单板。The present invention relates to the field of computers, and in particular, to a method, a CPU, and a board for booting a boot.
背景技术Background technique
许多电子设备中都安装有具有一定计算、处理功能的单板,例如无线通信领域的基站以及其它网元中、轨道交通领域内的各种信号控制设备中,都安装有具备各种定制化功能的单板。通常单板包括中央处理器(全称:Central Processing Unit,简称:CPU)以及存储器,存储器可以是非易失性存储器(全称:non-volatile memory),用于存储定制的操作系统、单板启动所需的引导程序(全称:Boot)代码等。A board with certain calculation and processing functions is installed in many electronic devices, for example, base stations in the field of wireless communication and various signal control devices in other network elements and in the field of rail transit, and various customized functions are installed. The veneer. A board usually includes a central processing unit (Central Processing Unit, CPU for short) and a memory. The memory can be a non-volatile memory (for a non-volatile memory). The bootloader (full name: Boot) code, etc.
为保证单板正常启动,可以对Boot进行备份,当一个Boot备份启动失败时,尝试启动另一个Boot备份。在一种现有技术的方案中,Boot包括两个备份,结合图1所示,两个备份分别为一级BootRom(简称:L1BootRom)以及二级BootRom(简称:L2BootRom)。L1BootRom和L2BootRom是两个相同版本或者不同版本的备份,例如两个均为最新版本的Boot备份,或者其中一个为最新版本的Boot备份,另一个为出厂版本备份。L1BootRom包括Bootstrap,位于L1BootRom的开头部分,CPU上电后首先加载Bootstrap,完成最简单的初始化和启动跳转判断。To ensure that the board starts normally, you can back up the Boot. When a boot backup fails, try to start another boot backup. In a prior art solution, the Boot includes two backups. As shown in Figure 1, the two backups are Level 1 BootRom (L1BootRom for short) and Level 2 BootRom (L2BootRom for short). L1BootRom and L2BootRom are two backups of the same version or different versions. For example, two are the latest version of Boot backup, or one of them is the latest version of Boot backup, and the other is the factory version backup. L1BootRom includes Bootstrap, which is located at the beginning of L1BootRom. After the CPU is powered on, it first loads Bootstrap to complete the simplest initialization and start jump judgment.
结合图1中实线箭头所示的执行流程,CPU上电后从L1BootRom的起始地址开始执行,在执行完Bootstrap部分后,跳转至L2BootRom的起始地址开始执行,尝试启动L2BootRom备份。如果L2BootRom备份启动失败,最终导致单板本次启动失败,则CPU复位并重新从L1BootRom跳转到L2BootRom备份,尝试再次启动L2BootRom备份。In conjunction with the execution flow shown by the solid arrow in Figure 1, after the CPU is powered on, it starts from the start address of L1BootRom. After the Bootstrap part is executed, it jumps to the start address of L2BootRom and starts to execute. Try to start the L2BootRom backup. If the L2BootRom backup fails, the board fails to start. The CPU resets and restarts from L1BootRom to the L2BootRom backup. Try to start the L2BootRom backup again.
结合图1中虚线箭头所示的执行流程,当再一次执行到BootStrap时,BootStrap判断启动L2BootRom备份的失败次数,如果达到预定次数则跳转至L1BootRom备份。因此,如果L2BootRom备份不能正常启动,那么单板还可以尝试启动L1BootRom备份,以完成单板启动。 In conjunction with the execution flow shown by the dotted arrow in FIG. 1, when the BootStrap is executed again, the BootStrap determines the number of failed L2BootRom backups, and if it reaches the predetermined number of times, it jumps to the L1BootRom backup. Therefore, if the L2BootRom backup fails to be started, the board can also start the L1BootRom backup to complete the board startup.
进一步地,BootRom可以有两个以上备份,启动时首先尝试其中一个,当满足失败条件后尝试另外一个。然而,如果L1BootRom备份在Bootstrap段的代码存在错误,L1BootRom备份无法完成跳转和计数,这种情况下即使有再多的Boot备份都没有意义,Boot启动一定会失败,并最终导致单板启动失败。因此,现有技术中启动Boot的方法可靠性不足,易导致单板启动失败。Further, BootRom can have more than two backups. At startup, try one of them first, and try another one when the failure condition is met. However, if there is an error in the code of the Bootstrap segment in the L1BootRom backup, the L1BootRom backup cannot complete the jump and the count. In this case, even if there are more Boot backups, the Boot will fail and the board will fail to start. . Therefore, the method for starting the Boot in the prior art is insufficient in reliability, which may cause the board to fail to start.
发明内容Summary of the invention
本申请提供一种启动Boot的方法、CPU及单板,能够提高Boot启动的可靠性。The present invention provides a method for starting a boot, a CPU, and a board, which can improve the reliability of boot startup.
为达到上述目的,本申请采用如下技术方案:To achieve the above objectives, the present application adopts the following technical solutions:
第一方面,提供一种启动Boot的方法,应用于CPU,所述CPU安装于单板上。In a first aspect, a method for booting a boot is provided, which is applied to a CPU, and the CPU is installed on a single board.
所述CPU包括片内启动逻辑,片内启动逻辑定义了Boot备份的数量、偏移地址以及尝试启动Boot备份的先后顺序。其中Boot备份的数量大于或者等于2,偏移地址是指相邻两个Boot备份的起始地址之间的间隔。The CPU includes on-chip boot logic, and the on-chip boot logic defines the number of boot backups, the offset address, and the order in which the boot backup is attempted. The number of Boot backups is greater than or equal to 2. The offset address is the interval between the start addresses of two adjacent Boot backups.
所述单板包括存储器,单板开发人员或者生产商,根据CPU支持的Boot备份数量以及偏移地址,在所述存储器中存入Boot备份。The board includes a memory, a board developer or a manufacturer, and stores a Boot backup in the memory according to the number of Boot backups supported by the CPU and the offset address.
所述CPU通过所述片内启动逻辑执行所述启动Boot的方法,具体包括:确定所述偏移地址;按照预设顺序逐一根据偏移地址启动所述至少两个Boot备份,直到有一个Boot备份启动成功。就是说CPU以片内启动逻辑所定义的先后顺序,采用逐一尝试的方式启动Boot备份,如果一个Boot备份启动失败,则尝试启动另一个Boot备份。各个Boot备份的启动相互独立互无影响,从而克服因为一个Boot备份启动失败而导致不能启动另一个Boot备份的问题,这样在至少两个Boot备份中,只要有一个备份能够正常启动就能够保证Boot启动,由此提高了Boot启动的可靠性。The method for the CPU to execute the booting by using the on-chip booting logic specifically includes: determining the offset address; and starting the at least two boot backups according to an offset address one by one according to a preset sequence until there is a boot The backup was successfully started. That is to say, the CPU starts the boot backup one by one in the order defined by the on-chip boot logic. If a boot backup fails, an attempt is made to start another boot backup. The booting of each boot backup has no effect on each other, thus overcoming the problem that another boot backup cannot be started because one boot backup fails, so that at least two boot backups can be guaranteed as long as one backup can be started normally. Startup, which improves the reliability of boot startup.
结合第一方面,在一种可能的实现方式中,根据预配置的硬件指示信号确定所述偏移地址,启动Boot过程中,CPU第一个访问的地址可以是0地址。或者,CPU第一个访问的地址可以是非0地址,当 非0地址对应的Boot备份启动失败时,再尝试启动0地址对应的Boot备份。With reference to the first aspect, in a possible implementation, the offset address is determined according to a pre-configured hardware indication signal, and the first address accessed by the CPU may be a zero address during the boot process. Or, the first address accessed by the CPU can be a non-zero address, when If the Boot backup of the non-zero address fails to start, try to start the Boot backup corresponding to the 0 address.
结合第一方面,在普通启动Boot的应用场景中,可以直接尝试启动一个Boot备份,或者在对进行校验之后再尝试启动该Boot备份。In combination with the first aspect, in a common startup boot scenario, you can directly try to start a Boot backup, or try to start the Boot backup after verifying.
结合第一方面,在安全启动Boot的应用场景中,对一个Boot备份经过数字签名校验之后,再尝试启动该Boot备份。In combination with the first aspect, in the application scenario of the secure booting boot, after a boot backup is digitally signed and verified, the boot backup is attempted.
第二方面,提供一种CPU,所述CPU包括片内启动逻辑。CPU上电后,通过片内启动逻辑,执行第一方面所提供的启动Boot的方法。In a second aspect, a CPU is provided, the CPU including on-chip boot logic. After the CPU is powered on, the method of booting the Boots provided by the first aspect is performed by the on-chip boot logic.
结合第二方面,在第一种可能的实现方式中,CPU包括:确定单元和Boot启动控制单元,其中确定单元,用于确定所述偏移地址,Boot启动控制单元,用于按照预设顺序逐一根据所述偏移地址启动所述至少两个Boot备份,直到有一个Boot备份启动成功。With reference to the second aspect, in a first possible implementation, the CPU includes: a determining unit and a boot startup control unit, wherein the determining unit is configured to determine the offset address, and the boot startup control unit is configured to follow a preset sequence The at least two boot backups are started according to the offset address one by one until a boot backup is successfully started.
第三方面,提供一种单板,所述单板包括CPU以及存储器,其中CPU为第二方面所提供的CPU,存储器中存储有至少两个Boot备份。所述CPU通过执行第一方面所提供的启动Boot的方法,启动Boot并进一步启动单板的操作系统、应用程序等软件。In a third aspect, a board is provided, where the board includes a CPU and a memory, wherein the CPU is a CPU provided by the second aspect, and the memory stores at least two boot backups. The CPU starts the boot and further starts the operating system and application software of the board by executing the booting method provided by the first aspect.
附图说明DRAWINGS
图1为现有技术中启动Boot备份的流程示意图;1 is a schematic flowchart of starting a boot backup in the prior art;
图2为本发明的实施例所提供的启动Boot的方法流程示意图;2 is a schematic flowchart of a method for starting a boot according to an embodiment of the present invention;
图3为本发明的实施例所提供的CPU的结构示意图;3 is a schematic structural diagram of a CPU according to an embodiment of the present invention;
图4为本发明的实施例所提供的单板的结构示意图。FIG. 4 is a schematic structural diagram of a single board according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行描述。The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
单板启动过程中,需要先后启动Boot和操作系统。Boot在某些情况下可能会被篡改或者发生比特位跳变,从而导致Boot代码出现错误。例如无线通信系统中,基站内的功能单板可能会被入侵,并被恶意篡改。 或者,由于单板电压跳变、器件老化等原因,导致Boot中的某些比特位会发生跳变。During the board startup process, you need to start the boot and the operating system. Boot may be tampered with or bit hopping in some cases, resulting in an error in the Boot code. For example, in a wireless communication system, a function board in a base station may be invaded and maliciously tampered with. Or, due to the voltage jump of the board, aging of the device, etc., some bits in the Boot may jump.
Boot代码关键位置的错误可能会导致Boot启动失败,并进一步导致单板启动失败。通过对Boot进行备份,当一个Boot备份启动失败时,可以尝试启动另一个Boot备份,以保证单板正常启动。然而并非只要有Boot备份就能够万无一失,现有技术中启动Boot时,即使有一个Boot备份的代码没有出错,能够正常启动,也可能因为不能跳转到该备份而导致Boot启动失败。本发明的目的在于提供一种启动Boot的方法、CPU及单板,克服由于一个Boot备份启动失败而导致不能启动另一个Boot备份的问题,以保证只要有一个Boot备份能够启动时,就能够正常启动Boot,从而提高Boot启动的可靠性。An error in the key position of the Boot code may cause the Boot to fail to start and further cause the board to fail to start. After the Boot is backed up, you can try to start another Boot backup to ensure that the board starts normally. However, as long as there is a Boot backup, it can be foolproof. In the prior art, when Boot is started, even if there is a bug in the Boot backup code, it can be started normally, and the boot startup may fail because it cannot be jumped to the backup. The object of the present invention is to provide a method for starting a boot, a CPU, and a board to overcome the problem that a Boot backup cannot be started due to a boot failure of a boot backup, so as to ensure that only one boot backup can be started normally. Boot is started to improve the reliability of boot startup.
实施例一Embodiment 1
本发明的实施例一提供一种启动Boot的方法,应用于CPU,CPU包括片内启动逻辑,片内启动逻辑具体可以是片内硬件电路,或者还可以是片内启动代码,或者是两者的结合。CPU上电后通过片内启动逻辑执行启动Boot的方法,参照图2所示,启动Boot的方法包括以下步骤:A first embodiment of the present invention provides a method for booting a boot, which is applied to a CPU. The CPU includes on-chip boot logic. The on-chip boot logic may be an on-chip hardware circuit, or may be an on-chip boot code, or both. Combination of. After the CPU is powered on, the method for booting the boot is performed by using the on-chip boot logic. Referring to FIG. 2, the method for booting includes the following steps:
201、确定偏移地址。201. Determine an offset address.
CPU安装于单板上,单板包括存储器,存储器为非易失性存储器,例如闪存(全称:flash memory)。存储器中存储有至少两个Boot备份。The CPU is installed on a board. The board includes a memory, and the memory is a non-volatile memory, such as a flash memory (full name: flash memory). At least two boot backups are stored in the memory.
片内启动逻辑支持从两个或者两个以上的上电位置读取Boot备份的代码。其中上电位置是指片内启动逻辑开始运行时,读取Boot备份的代码的起始地址。一个上电位置对应一个Boot备份,通过从不同上电位置读取不同Boot备份的代码,以启动不同的Boot备份。On-chip boot logic supports reading the backup code from two or more power-up locations. The power-on position is the starting address of the code that reads the Boot backup when the on-chip boot logic starts running. A power-on location corresponds to a Boot backup. Different Boot backup codes are read from different power-on locations to start different Boot backups.
片内启动逻辑相邻的两个上电位置之间的地址间隔大小为偏移地址。存储器中存储的至少两个Boot备份中,相邻两个Boot备份各自的起始地址之间的间隔大小也为偏移地址。也就是说,当一个Boot备份启动失败时,片内启动逻辑跳转到另一Boot备份,尝试启动另一Boot备份。一个Boot备份启动失败包括没有执行该Boot备 份或者在执行该Boot备份时出现异常导致该Boot备份没有启动成功。可以理解的是,偏移地址可以为1个,也可以为多个,具体可以由实际系数设计需求确定。比如,第一个Boot备份和第二个Boot备份之间的间隔大小为X,第二个Boot备份和第三个Boot备份之间的间隔大小为X+1,…第n-1个Boot备份和第n个Boot备份之间的间隔大小为X+n-2,又或者间隔大小的变化其他预定的规则,在此不予赘述。The size of the address interval between two power-on positions adjacent to the on-chip boot logic is an offset address. In at least two boot backups stored in the memory, the interval between the start addresses of the adjacent two boot backups is also an offset address. That is to say, when a boot backup fails, the on-chip boot logic jumps to another boot backup and attempts to start another boot backup. A Boot Backup failed to start, including not executing the Boot Reserve. An exception occurred during the execution of the boot backup, and the boot backup did not start successfully. It can be understood that the offset address may be one or multiple, which may be determined by actual coefficient design requirements. For example, the interval between the first boot backup and the second boot backup is X, and the interval between the second boot backup and the third boot backup is X+1, ... the n-1th boot backup. The size of the interval between the nth boot backup and the nth boot backup is X+n-2, or other predetermined rules for the change of the interval size, and details are not described herein.
例如,在开始执行Boot备份前对Boot备份做正确性校验,若未通过校验则不启动该Boot备份,则认为该Boot备份启动失败。其中正确性校验是为了确定Boot备份的内容是否严格正确所做的校验,包括哈希值校验或者循环冗余校验等。如果比特位跳变的情况,则Boot备份不能通过正确性校验。For example, the Boot backup is checked for correctness before the Boot backup is started. If the Boot backup is not started after the verification is not performed, the Boot backup fails. The correctness check is to verify whether the content of the boot backup is strictly correct, including hash value check or cyclic redundancy check. If the bit jumps, the Boot backup cannot pass the correctness check.
或者,通过正确性校验后开始执行该Boot备份,但是执行过程中出现异常,导致该Boot备份没有正常启动,则认为该Boot备份启动失败。Or, after the correctness check is performed, the boot backup is started. If the boot backup does not start normally, the boot backup fails.
又或者,不对Boot备份的做正确性校验就直接开始执行Boot备份,由于执行过程中出现异常,导致该Boot备份没有正常启动,也认为该Boot备份启动失败。Or, if the backup is not properly verified, the Boot backup is started. The boot backup fails because the exception occurs during the execution.
CPU上电后,片内启动逻辑启动第一个上电位置对应的Boot备份,如果该Boot备份启动失败,那么在CPU重置后,片内启动逻辑从第一个上电位置跳转到第二个上电位置,尝试启动第二个上电位置对应的Boot备份。需要特别说明的是,第一个上电位置对应的Boot备份(第一个访问的Boot备份),起始地址可以为0,也可以为不为0,取决于片内启动逻辑所定义的尝试启动的顺序。After the CPU is powered on, the on-chip boot logic starts the Boot backup corresponding to the first power-on position. If the boot backup fails, the on-chip boot logic jumps from the first power-on position to the first time after the CPU resets. At the two power-on positions, try to start the Boot backup corresponding to the second power-on position. It should be specially noted that the Boot backup corresponding to the first power-on location (the first access boot backup) may have a starting address of 0 or 0, depending on the attempt defined by the on-chip boot logic. The order of startup.
在片内启动逻辑进行跳转之前,首先需要确定偏移地址的具体值是多少,本实施例提供两种具体的确定偏移地址的方式如下:Before the on-chip boot logic is used to jump, it is first necessary to determine the specific value of the offset address. In this embodiment, two specific methods for determining the offset address are provided as follows:
第一种方式,CPU上电后,片内启动逻辑从flash中读取偏移地址。或者进一步地,片内启动逻辑可以从flash读取每一个Boot备份的起始地址,这样开发人员可以自定义偏移地址或起始地址。In the first mode, after the CPU is powered on, the on-chip boot logic reads the offset address from the flash. Or further, the on-chip boot logic can read the start address of each boot backup from flash so that the developer can customize the offset address or the start address.
第二种方式,CPU上电后根据预配置的硬件指示信号确定偏移 地址。在一种具体的应用场景中,上电位置的数量、偏移地址的大小以及尝试启动Boot备份的先后顺序均由片内启动逻辑定义。In the second mode, after the CPU is powered on, the offset is determined according to the pre-configured hardware indication signal. address. In a specific application scenario, the number of power-on locations, the size of the offset address, and the order in which the boot backup is attempted are all defined by the on-chip boot logic.
例如,片内启动逻辑定义至少两个备选偏移地址,备选偏移地址的数量即为上电位置的数量。以备选偏移地址的数量为2的情况为例,两个备选偏移地址的取值分别为2兆和4兆。CPU设置有用于指示偏移地址的管脚,用于接收单板输入的硬件指示信号,比如上拉对应2兆、下拉对应4兆。单板设计人员根据实际需要从2兆或者4兆中选择其一作为偏移地址的取值,按照所选定偏移地址的取值在存储器中存储2个Boot备份,并配置相应的硬件指示信号。比如Boot备份的大小在2兆和4兆之间,那么选择偏移地址的取值为4兆,在向存储器写入2个Boot备份时,第一个Boot备份对应的起始地址为0,第二个Boot备份起始地址取值为1×4兆。同时,单板上配置将指示偏移地址的管脚下拉的输入信号。CPU上电后,单板向该管脚输入预配置的硬件指示信号,片内启动逻辑从该管脚读取该预配置的硬件指示信号,根据硬件指示信号确定偏移地址。For example, the on-chip boot logic defines at least two alternate offset addresses, the number of alternate offset addresses being the number of power-up locations. For example, in the case where the number of alternative offset addresses is 2, the values of the two alternative offset addresses are 2 megabytes and 4 megabytes, respectively. The CPU is provided with a pin for indicating an offset address, and is used for receiving a hardware indication signal input by the board, such as a pull-up corresponding to 2 megabytes and a pull-down corresponding to 4 megabytes. The board designer selects one of the 2 megabits or 4 megabytes as the offset address according to actual needs, stores 2 Boot backups in the memory according to the value of the selected offset address, and configures corresponding hardware instructions. signal. For example, if the size of the Boot backup is between 2 megabytes and 4 megabytes, the value of the offset address is 4 megabytes. When two Boot backups are written to the memory, the starting address of the first boot backup is 0. The second boot backup start address takes 1 x 4 megabytes. At the same time, the board will configure an input signal that will indicate the pin of the offset address. After the CPU is powered on, the board inputs a pre-configured hardware indication signal to the pin, and the on-chip startup logic reads the pre-configured hardware indication signal from the pin, and determines the offset address according to the hardware indication signal.
当然,根据上电位置的数量的不同,用于指示偏移地址的管脚的数量也不同。例如,上电位置的数量为4,则备选偏移地址的数量为4,需要用2个管脚来指示4个备选偏移地址中具体哪个为偏移地址。Of course, depending on the number of power-on positions, the number of pins used to indicate the offset address is also different. For example, if the number of power-on positions is 4, the number of candidate offset addresses is 4, and 2 pins are needed to indicate which of the 4 candidate offset addresses is the offset address.
另外,当用于指示偏移地址的管脚可以有多个时,可以直接向管脚输入表示偏移地址取值的二进制代码。例如管脚数量为10,单板直接向10个管脚输入10位二进制代码,指示偏移地址的取值。比如,10个管脚输入均为1,代表偏移地址的取值为2的10次方,即1024兆。In addition, when there are more than one pin for indicating the offset address, a binary code indicating the value of the offset address can be directly input to the pin. For example, if the number of pins is 10, the board directly inputs a 10-bit binary code to 10 pins to indicate the value of the offset address. For example, the 10 pin inputs are all 1, which means that the offset address takes the value of 2 to the power of 10, which is 1024 megabytes.
或者,在CPU外围设置可擦除可编辑逻辑器件(全称:Erasable Programmable Logic Device,简称:EPLD),预配置的硬件指示信号可以是EPLD中固定的寄存器值,片内启动逻辑通过读取EPLD中固定的寄存器值确定偏移地址。Alternatively, an erasable editable logic device (full name: Erasable Programmable Logic Device, EPLD) is set on the periphery of the CPU. The pre-configured hardware indication signal can be a fixed register value in the EPLD, and the on-chip boot logic is read in the EPLD. A fixed register value determines the offset address.
202、按照预设顺序逐一根据偏移地址启动至少两个Boot备份,直到有一个Boot备份启动成功。 202. Start at least two boot backups according to the offset address one by one according to a preset sequence, until one boot backup succeeds.
CPU上电后,片内启动逻辑开始运行,片内启动逻辑通过CPU预配置的硬件指示信号确定偏移地址,然后按照预设顺序逐一启动存储器中的Boot备份,直到有一个Boot备份启动成功。上电位置的数量、偏移地址的大小以及尝试启动Boot备份的先后顺序均由片内启动逻辑定义,本发明的实施例中,预设顺序是指由片内启动逻辑所定义的,对全部Boot备份逐一尝试启动的顺序。例如,Boot备份的数量为3,分别用数字1、2和3代表3个上电位置各自对应的起始地址,其中数字1对应的起始地址为0地址。CPU上电后的第一个上电位置可以是3个上电位置中的任意一个,那么预设顺序可以是3个上电位置的6种排列方式中的一种,即可以是1-2-3、1-3-2、2-1-3、2-3-1、3-1-2、3-2-1中的任一种。After the CPU is powered on, the on-chip boot logic starts running. The on-chip boot logic determines the offset address through the CPU pre-configured hardware indication signal, and then starts the Boot backup in the memory one by one in a preset order until a Boot backup is successfully started. The number of power-on positions, the size of the offset address, and the order in which the boot backup is attempted are all defined by the on-chip boot logic. In the embodiment of the present invention, the preset order is defined by the on-chip boot logic. Boot backup attempts to start the order one by one. For example, the number of Boot backups is three, and the numbers 1, 2, and 3 respectively represent the respective start addresses of the three power-on positions, and the start address corresponding to the number 1 is the 0 address. The first power-on position after the CPU is powered on may be any one of the three power-on positions, and the preset sequence may be one of six types of three power-on positions, that is, 1-2. -3, any of 1-3-2, 2-1-3, 2-3-1, 3-1-2, 3-2-1.
以第一Boot备份和第二Boot备份为例进行说明。其中,第二Boot备份为按照预设顺序,位于第一Boot备份之后且与第一Boot备份相邻的Boot备份。需要说明的是,这里的相邻是指执行顺序先后相邻,而非存储位置的相邻。The first boot backup and the second boot backup are taken as an example for description. The second boot backup is a backup backup that is located in the preset order and is adjacent to the first boot backup and is adjacent to the first boot backup. It should be noted that the adjacent here refers to the sequential order of execution, rather than the adjacent position of the storage location.
第一Boot备份的起始地址为第一地址,第二Boot备份的起始地址为第二地址。第一地址取值为偏移地址的M倍,第二地址取值为偏移地址的N倍,M和N为不相等的两个预设值,M和N均大于或者等于0。The starting address of the first boot backup is the first address, and the starting address of the second boot backup is the second address. The first address is taken as M times the offset address, and the second address is taken as N times the offset address. M and N are two preset values that are not equal, and both M and N are greater than or equal to zero.
例如,偏移地址的取值为4兆,Boot备份的数量为3,3个Boot备份的起始地址取值分别为0×4兆、1×4兆和2×4兆。第一地址可以为3个地址中的任意一个,第二地址为3个地址中除第一地址之外的任意一个。For example, the value of the offset address is 4 megabytes, the number of boot backups is 3, and the starting addresses of the three boot backups are 0×4 megabytes, 1×4 megabytes, and 2×4 megabytes, respectively. The first address may be any one of three addresses, and the second address is any one of the three addresses except the first address.
片内启动逻辑根据偏移地址确定第一地址,并尝试启动第一Boot备份。当第一Boot备份启动失败时,根据偏移地址确定第二地址,并启动第二Boot备份。依次类推,直到有一个Boot备份启动成功。The on-chip boot logic determines the first address based on the offset address and attempts to initiate the first boot backup. When the first boot backup fails, the second address is determined according to the offset address, and the second boot backup is started. And so on, until a boot backup is successfully started.
可以理解的是,CPU上电后也可以从flash中读取偏移地址,按照偏移地址和启动顺序逐一尝试启动Boot备份。或者,在另一种 可能的情况中,偏移地址的存储及获得并非必要的,CPU上电后从flash中直接读取第一Boot备份的起始地址,然后尝试启动第一Boot备份。若第一Boot备份启动失败,再从flash中直接读取第二Boot备份的起始地址,然后尝试启动第二Boot备份。可以理解的是,这两种方式仍可以和本发明实施例中提到的正确性校验的方案相结合,也可以和前述提到的上电位置对应的Boot备份的起始地址为非0地址的方案相结合。It can be understood that the offset address can be read from the flash after the CPU is powered on, and the boot backup is started one by one according to the offset address and the startup sequence. Or, in another In the possible case, the storage and acquisition of the offset address is not necessary. After the CPU is powered on, the start address of the first boot backup is directly read from the flash, and then the first boot backup is attempted. If the first boot backup fails, read the start address of the second boot backup directly from the flash, and then try to start the second boot backup. It can be understood that the two methods can still be combined with the correctness check solution mentioned in the embodiment of the present invention, and the start address of the Boot backup corresponding to the foregoing power-on position is non-zero. The combination of address schemes.
需要说明的是,本发明的实施例中存储有至少两个Boot备份的存储器,可以是单个的非易失性存储器芯片,也可以是一个以上的非易失性存储器芯片。以flash芯片为例,至少两个Boot备份存储于至少一个flash芯片内,其中至少一个flash芯片中,一个flash芯片内存储有至少一个Boot备份。在CPU和至少一个flash芯片之间设置闪存控制逻辑电路,CPU通过闪存控制逻辑电路访问至少一个flash芯片。It should be noted that, in the embodiment of the present invention, the memory storing at least two Boot backups may be a single non-volatile memory chip, or may be more than one non-volatile memory chip. Taking the flash chip as an example, at least two boot backups are stored in at least one flash chip, and at least one flash chip stores at least one boot backup in one flash chip. A flash control logic circuit is disposed between the CPU and the at least one flash chip, and the CPU accesses the at least one flash chip through the flash control logic circuit.
通过至少一个flash芯片存储Boot备份的好处在于,flash芯片不断向容量更大、价格更便宜的趋势发展,但是其可靠性却参差不齐。因此可以采用可靠性不同的flash芯片分别存储不同的Boot备份。The advantage of storing Boot backups through at least one flash chip is that flash chips continue to evolve toward larger capacity and cheaper prices, but their reliability is uneven. Therefore, different flash backups can be stored separately using flash chips with different reliability.
例如,第一Boot备份为新版本的Boot备份,第二Boot备份为出厂版本的Boot备份,且单板在后期的使用中不对第二Boot备份进行升级。如果第一Boot备份正确无误,就能够启动新版本的Boot。如果如果第一Boot备份启动失败,在启动出厂版本的Boot,即第二Boot备份。这种情况下,可以将第二Boot备份的数据量做的相对小,存储在价格高同时可靠性也高的flash芯片内,而第一Boot备份的数据量可以相对较大,存储在价格低同时可靠性也相对较低的flash芯片内。For example, the first boot backup is a new version of the boot backup, and the second boot backup is the factory version of the boot backup, and the board does not upgrade the second boot backup in the later use. If the first boot backup is correct, you can start a new version of Boot. If the boot of the first boot fails, the boot of the factory version is started, that is, the second boot backup. In this case, the amount of data of the second boot backup can be relatively small, and is stored in a flash chip with high price and high reliability, and the amount of data of the first boot backup can be relatively large, and the price is low. At the same time the reliability is also relatively low within the flash chip.
本发明的实施例所提供的启动Boot的方法,CPU包括片内启动逻辑,CPU上电后运行片内启动逻辑,片内启动逻辑确定偏移地址,根据偏移地址,逐一启动Boot备份,直到有一个Boot备份启动成功。片内启动逻辑支持两个或者两个以上上电位置,不同Boot备份 各自独立互无影响,不会因为一个Boot备份启动失败而导致不能启动另一个Boot备份,因此只要有一个Boot备份能够正常启动,就能够保证Boot启动,由此提高了Boot启动的可靠性。In the method for starting the boot provided by the embodiment of the present invention, the CPU includes on-chip boot logic. After the CPU is powered on, the on-chip boot logic is run, the on-chip boot logic determines the offset address, and the boot backup is started one by one according to the offset address. A boot backup has been successfully started. On-chip boot logic supports two or more power-on locations, different boot backups Each of them has no effect on each other. It does not cause another Boot backup to be started because a boot backup fails. Therefore, as long as one boot backup can be started normally, the Boot boot can be guaranteed, thereby improving the reliability of Boot boot.
实施例二Embodiment 2
结合实施例一,本发明的实施例二提供另一种启动Boot的方法,应用于CPU,本实施例中结合安全启动的应用场景进行说明。With reference to the first embodiment, the second embodiment of the present invention provides another method for starting the boot, which is applied to the CPU, and is described in conjunction with the application scenario of the secure boot in this embodiment.
在对安全性要求较高的应用场景中,需要单板支持安全启动。安全启动要求单板从上电开始所启动的程序都应该通过数字签名校验。包括Boot和操作系统在内的程序,在启动之前都需经过数字签名校验,校验失败则程序不能启动,单板停止本次启动。In an application scenario where security is required, the board needs to support secure startup. The program that the security boot requires the board to start from power-on should be verified by digital signature. Programs, including the Boot and the operating system, must be digitally signed and verified before starting. If the verification fails, the program cannot be started. The board stops this startup.
结合图1所示现有技术中的执行流程,在L1BootRom启动之前CPU要对其进行数字签名校验,如果L1BootRom未通过校验,由于不能实现从L1BootRom向其它备份的跳转,Boot启动一定会失败,继而导致单板安全启动失败。本发明的实施例二所提供的启动Boot的方法,目的在于克服由于一个Boot备份未通过校验而导致不能对其它Boot备份进行校验的问题,参照图2所示,启动Boot的方法包括以下步骤:In combination with the execution process in the prior art shown in FIG. 1, the CPU needs to perform digital signature verification on the L1BootRom before starting. If the L1BootRom fails to pass the verification, since the jump from L1BootRom to other backups cannot be implemented, the Boot startup will definitely Failure, which in turn caused the board to fail to boot safely. The method for booting the boot provided in the second embodiment of the present invention is to overcome the problem that the boot backup cannot be verified due to the failure of a boot backup to be verified. Referring to FIG. 2, the method for booting the boot includes the following. step:
201、确定偏移地址。201. Determine an offset address.
与实施例一中步骤201相同,此处不再赘述。The same as step 201 in the first embodiment, and details are not described herein again.
202、按照预设顺序逐一根据偏移地址安全启动至少两个Boot备份,直到有一个Boot备份安全启动成功。202. Safely start at least two boot backups according to the offset address one by one according to the preset sequence, until one boot backup is successfully started.
在安全启动的应用场景中,CPU片内启动逻辑包括片内启动代码,片内启动代码包括启动校验代码以及Boot备份数字签名的公钥。CPU上电后,运行片内启动逻辑的校验代码,读取某一个Boot备份的数字签名,并使用公钥对该Boot备份进行数字签名校验。安全启动Boot备份,即Boot备份在通过数字签名校验后启动成功。In the secure boot application scenario, the CPU on-chip boot logic includes an on-chip boot code, and the on-chip boot code includes a boot check code and a public key for the boot backup digital signature. After the CPU is powered on, run the verification code of the on-chip startup logic, read the digital signature of a certain boot backup, and perform digital signature verification on the boot backup using the public key. Boot backup is safely started. That is, the Boot backup is successfully started after being verified by digital signature.
片内启动逻辑支持从两个或者两个以上的上电位置读取Boot备份的代码。一个上电位置对应一个Boot备份,通过从不同上电位 置读取不同Boot备份的代码,片内启动逻辑可以对至少两个Boot备份中的每个Boot备份分别进行数字签名校验。也就是说,当一个Boot备份未通过数字签名校验时,片内启动逻辑跳转到另一Boot备份,对另一Boot备份进行数字签名校验。On-chip boot logic supports reading the backup code from two or more power-up locations. A power-on position corresponds to a boot backup, passing from different upper potentials To read the code of different boot backups, the on-chip boot logic can perform digital signature verification on each of the at least two boot backups. That is to say, when a boot backup fails the digital signature verification, the on-chip boot logic jumps to another boot backup, and the other boot backup is digitally signed and verified.
例如,CPU上电后,片内启动逻辑对第一个上电位置对应的Boot备份进行数字签名校验,如果该Boot备份未通过校验,那么在CPU重置后,片内启动逻辑根据偏移地址进行跳转,对第二个上电位置对应的Boot备份进行数字签名校验。当然,在安全启动的应用场景中,除了对Boot备份做数字签名校验外,还可以对Boot备份做正确性校验。For example, after the CPU is powered on, the on-chip startup logic performs digital signature verification on the Boot backup corresponding to the first power-on position. If the Boot backup fails the verification, the on-chip startup logic is based on the CPU after the CPU resets. Move the address to jump, and perform digital signature verification on the Boot backup corresponding to the second power-on location. Of course, in the application scenario of the secure startup, in addition to performing digital signature verification on the Boot backup, the correctness check can be performed on the Boot backup.
以第一Boot备份和第二Boot备份为例进行说明。其中,第一Boot备份的起始地址为第一地址,第二Boot备份的起始地址为第二地址,第一地址和第二地址分别为两个不同的上电位置,且第一地址为片内启动逻辑开始运行时默认的上电位置。第一地址取值为偏移地址的M倍,第二地址取值为偏移地址的N倍,M和N为不相等的两个预设值,M和N均大于或者等于0。The first boot backup and the second boot backup are taken as an example for description. The starting address of the first boot backup is the first address, the starting address of the second boot backup is the second address, and the first address and the second address are respectively two different power-on positions, and the first address is The default power-up position when the on-chip boot logic starts running. The first address is taken as M times the offset address, and the second address is taken as N times the offset address. M and N are two preset values that are not equal, and both M and N are greater than or equal to zero.
CPU上电后,片内启动逻辑确定第一地址,从第一Boot备份读取数字签名,对第一Boot备份进行数字签名校验和正确性校验。After the CPU is powered on, the on-chip boot logic determines the first address, reads the digital signature from the first boot backup, and performs digital signature verification and correctness check on the first boot backup.
当第一Boot备份通过校验(数字签名校验和正确性校验均通过)时,启动第一Boot备份。当第一Boot备份是CPU上电后校验的第一个Boot备份时,以第一Boot备份为新版本的Boot备份为宜,如果校验通过,就能够启动新版本的Boot。When the first boot backup passes the verification (the digital signature checksum correctness check passes), the first boot backup is started. When the first boot backup is the first boot backup that is verified after the CPU is powered on, it is better to use the first boot backup as the new version of the boot backup. If the verification is passed, the new version of the boot can be started.
当第一Boot备份未通过校验时(数字签名校验和正确性校验其中任一项未通过),片内启动逻辑确定第二地址,从第二Boot备份读取数字签名,对第二Boot备份进行校验。当第二Boot备份通过校验时,启动第二Boot备份。可选的,第二Boot备份为出厂版本,第二Boot备份起始地址为0地址。当第一Boot备份的新版本启动失败时,启动第二Boot备份的出厂版本,第二Boot备份起始地址为非0地址。 When the first boot backup fails the verification (the digital signature checksum correctness check fails), the on-chip boot logic determines the second address, reads the digital signature from the second boot backup, and the second Boot backup is verified. When the second boot backup passes the verification, the second boot backup is started. Optionally, the second boot backup is a factory version, and the second boot backup start address is a zero address. When the new version of the first boot backup fails, the factory version of the second boot backup is started, and the second boot backup address is a non-zero address.
至少两个引导Boot备份中,除了第一Boot备份和第二Boot备份之外,还包括第三Boot备份,第三Boot备份为新版本Boot备份。如果第二Boot备份未通过校验,片内启动逻辑可以再对第三Boot备份进行校验。In addition to the first boot backup and the second boot backup, the third boot backup includes a third boot backup, and the third boot backup is a new version of the boot backup. If the second boot backup fails verification, the on-chip boot logic can verify the third boot backup.
或者,还可以通过另一种方式启动第三Boot备份,即当第二Boot备份能够正常启动时,由第二Boot备份对第三Boot备份进行校验,如果第三Boot备份通过校验,则指示第三Boot备份启动。这么做的好处在于,第二Boot备份为出厂版本,其功能相比新版本Boot备份往往不够完善,因此第二Boot备份对第三Boot备份进行校验且第三Boot备份通过校验后,启动第三Boot备份启动,这样就可以启动新版本的Boot备份。Alternatively, the third boot backup can be started in another manner, that is, when the second boot backup can be started normally, the third boot backup is verified by the second boot backup, and if the third boot backup passes the verification, Indicates that the third boot backup is started. The advantage of this is that the second boot backup is the factory version, and its function is often not perfect compared to the new version of the boot backup. Therefore, the second boot backup verifies the third boot backup and the third boot backup passes the verification and starts. The third boot backup is started, so that a new version of the boot backup can be started.
需要特别说明一点,Boot备份的代码包括引导部分和非引导部分,在片内启动逻辑对第三Boot备份进行校验且通过的情况下,片内启动逻辑跳转到第三Boot备份的引导部分,启动第三Boot备份。在第二Boot备份对第三Boot备份进行校验且通过的情况下,指示第三Boot备份启动时,由于第二Boot备份已经运行完成引导部分,因此直接跳转到第三Boot备份的非引导部分继续执行。It should be specially stated that the boot backup code includes a boot part and a non-boot part. When the on-chip boot logic verifies the third boot backup and passes, the on-chip boot logic jumps to the boot part of the third boot backup. , start the third boot backup. In the case that the second boot backup verifies and passes the third boot backup, indicating that the third boot backup is started, since the second boot backup has already completed the boot portion, the direct jump to the third boot backup is performed. Part of the execution continues.
本发明的实施例所提供的启动Boot的方法中,CPU上电后运行片内启动逻辑,片内启动逻辑确定偏移地址,根据偏移地址,逐一对至少两个Boot备份进行校验,直到有一个Boot备份安全启动成功。或者,片内启动逻辑根据至少两个Boot备份的起始地址,逐一对所述Boot备份进行校验,直到有一个Boot备份安全启动成功。或者,片内启动逻辑根据上电位置对应的Boot备份的起始地址(非0)对所述Boot备份进行校验,若失败,则根据偏移地址,逐一对其他Boot备份进行检验,至少两个Boot备份进行校验,直到有一个Boot备份安全启动成功。片内启动逻辑支持两个或者两个以上上电位置,可以对各个Boot备份独立地进行校验,不会因为一个Boot备份校验失败而导致不能对另一个Boot备份进行校验,因此只要有一个Boot备份能够通过校验且正常启动,就能够正常启动Boot,由此提高了 Boot启动的可靠性。In the method for starting the boot provided by the embodiment of the present invention, after the CPU is powered on, the on-chip boot logic is run, and the on-chip boot logic determines the offset address, and according to the offset address, at least two Boot backups are performed one by one until the check is performed. A Boot Backup security boot was successful. Alternatively, the on-chip boot logic performs verification on the boot backup one by one according to the start address of at least two boot backups until a boot backup is successfully started. Alternatively, the on-chip boot logic verifies the boot backup according to the start address (non-zero) of the boot backup corresponding to the power-on position, and if it fails, checks one by one other boot backup according to the offset address, at least two Boot backup is verified until a boot backup is successfully started. The on-chip boot logic supports two or more power-on locations. Each boot backup can be independently verified. It is not possible to check another boot backup because one boot backup fails. Therefore, A boot backup can be started normally by verifying and booting normally, thus improving the boot. Boot startup reliability.
基于图2所对应的实施例,本发明的实施例还提供一种CPU,CPU用于安装于单板上,所述单板包括存储器,所述存储器中存储有至少两个引导Boot备份,所述至少两个Boot备份中,相邻两个Boot备份的偏移地址为预设值,其中所述偏移地址为相邻两个Boot备份的起始地址之间的间隔。Based on the embodiment corresponding to FIG. 2, an embodiment of the present invention further provides a CPU, where the CPU is used to be installed on a board, the board includes a memory, and the memory stores at least two boot disk backups. In the at least two boot backups, the offset addresses of the two adjacent boot backups are preset values, where the offset address is the interval between the start addresses of the two adjacent boot backups.
CPU包括片内启动逻辑,片内启动逻辑具体可以是片内硬件电路,或者还可以是片内启动代码,或者是两者的结合。The CPU includes on-chip boot logic, and the on-chip boot logic may specifically be an on-chip hardware circuit, or may be an on-chip boot code, or a combination of the two.
硬件电路可以是集成于CPU内部的特定集成电路(英文全称:Application Specific Integrated Circuit,英文简称:ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路。The hardware circuit may be a specific integrated circuit integrated in the CPU (Application Specific Integrated Circuit, English abbreviation: ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
片内启动代码可以是存储于CPU内部的固化的代码,CPU上电后,调用片内启动代码,执行本发明的实施例所提供的启动Boot的方法中,CPU所执行的步骤。或者片内启动代码与片内硬件电路相配合,共同完成启动Boot的方法中CPU所执行的步骤,具体包括以下两种方式:The on-chip boot code may be a firmware code stored in the CPU. After the CPU is powered on, the on-chip boot code is invoked to execute the steps performed by the CPU in the method of booting the boot provided by the embodiment of the present invention. Or the on-chip boot code cooperates with the on-chip hardware circuit to jointly complete the steps performed by the CPU in the method of booting the boot, which specifically includes the following two methods:
第一种方式,CPU确定偏移地址并根据偏移地址逐一尝试启动Boot备份。例如,CPU片内启动逻辑定义上电位置的数量、偏移地址的大小以及尝试启动Boot备份的先后顺序。CPU上电后确定偏移地址,按照预设顺序逐一根据偏移地址启动Boot备份,以及对Boot备份进行正确性校验和数字签名校验,直到有一个Boot备份启动成功。In the first way, the CPU determines the offset address and attempts to initiate a boot backup one by one according to the offset address. For example, the CPU on-chip boot logic defines the number of power-on locations, the size of the offset address, and the order in which the boot backups are attempted. After the CPU is powered on, the offset address is determined, and the Boot backup is started according to the offset address in a preset order, and the correctness check and digital signature verification of the Boot backup are performed until a Boot backup is successfully started.
第二种方式,CPU上电后从flash中读取Boot备份的起始地址,并尝试启动起始地址对应的Boot备份。若一个Boot备份启动失败,则读取下一Boot备份的起始地址,尝试启动下一Boot备份,直到有一个Boot备份启动成功。In the second mode, after the CPU is powered on, the boot address of the Boot backup is read from the flash, and the boot backup corresponding to the start address is attempted. If a boot backup fails, read the start address of the next boot backup and try to start the next boot backup until a boot backup succeeds.
可以理解的是,这两种方式可以和本发明实施例中提到的正确性校验的方案相结合,也可以和前述提到的上电位置对应的Boot备份的起始地址为非0地址的方案相结合。 It can be understood that the two methods can be combined with the correctness check solution mentioned in the embodiment of the present invention, and the start address of the Boot backup corresponding to the power-on position mentioned above is a non-zero address. The combination of the programs.
结合图3所示,在一种可能的实施方式中,CPU30包括:As shown in FIG. 3, in a possible implementation manner, the CPU 30 includes:
确定单元301,用于确定偏移地址。The determining unit 301 is configured to determine an offset address.
Boot启动控制单元302,用于按照预设顺序逐一根据偏移地址启动至少两个Boot备份,直到有一个Boot备份启动成功。The boot startup control unit 302 is configured to start at least two boot backups according to the offset address one by one according to a preset sequence, until one boot backup is successfully started.
可选的,确定单元301,具体用于根据预配置的硬件指示信号确定偏移地址。Optionally, the determining unit 301 is specifically configured to determine an offset address according to the pre-configured hardware indication signal.
可选的,启动Boot过程中,Boot启动控制单元302访问的第一个Boot备份对应的起始地址不为0。Optionally, the startup address corresponding to the first boot backup accessed by the Boot startup control unit 302 is not 0.
可选的,至少两个Boot备份包括第一Boot备份和第二Boot备份。Optionally, at least two boot backups include a first boot backup and a second boot backup.
Boot启动控制单元302,具体用于根据偏移地址确定第一地址,并对第一Boot备份进行校验。当第一Boot备份通过校验时,启动第一Boot备份。其中,第一地址为第一Boot备份的起始地址,第一地址为偏移地址的M倍,M为大于或者等于0的整数,且M为预设值。The Boot Start Control Unit 302 is configured to determine a first address according to the offset address, and check the first Boot backup. When the first boot backup passes the verification, the first boot backup is started. The first address is the starting address of the first boot backup, the first address is M times the offset address, M is an integer greater than or equal to 0, and M is a preset value.
Boot启动控制单元302,还用于当第一Boot备份未通过校验时,根据偏移地址确定第二地址,并根据第二地址对第二Boot备份进行校验,当第二Boot备份通过校验时,启动第二Boot备份。其中,第二地址为第二Boot备份的起始地址,第二地址为偏移地址的N倍,N为大于或者等于0的整数,且N为不等于M的预设值。The boot control unit 302 is further configured to: when the first boot backup fails the verification, determine the second address according to the offset address, and verify the second boot backup according to the second address, when the second boot backup passes the school At the time of verification, the second boot backup is started. The second address is the starting address of the second boot backup, the second address is N times the offset address, N is an integer greater than or equal to 0, and N is a preset value that is not equal to M.
可选的,至少两个Boot备份包括第一Boot备份和第二Boot备份。Optionally, at least two boot backups include a first boot backup and a second boot backup.
Boot启动控制单元302,具体用于根据偏移地址确定第一地址,并启动第一Boot备份。其中,第一地址为第一Boot备份的起始地址,第一地址为偏移地址的M倍,M为大于或者等于0的整数,且M为预设值。The boot startup control unit 302 is configured to determine a first address according to the offset address, and start the first boot backup. The first address is the starting address of the first boot backup, the first address is M times the offset address, M is an integer greater than or equal to 0, and M is a preset value.
Boot启动控制单元302,还用当第一Boot备份启动失败时,根据偏移地址确定第二地址,并启动第二Boot备份。其中,第二地址为第二Boot备份的起始地址,第二地址为偏移地址的N倍,N为大 于或者等于0的整数,且N为不等于M的预设值。The boot startup control unit 302 also determines, when the first boot backup fails, determines the second address according to the offset address, and starts the second boot backup. The second address is the starting address of the second boot backup, and the second address is N times the offset address, where N is large. An integer equal to or equal to 0, and N is a preset value that is not equal to M.
可选的,CPU30外围设置有EPLD 303。Optionally, the EP30 303 is disposed on the periphery of the CPU 30.
确定单元301,具体用于读取EPLD 303中的寄存器值,将寄存器值作为偏移地址的取值。The determining unit 301 is specifically configured to read the register value in the EPLD 303 and use the register value as the value of the offset address.
可选的,CPU30设置有用于接收硬件指示信号的管脚。Optionally, the CPU 30 is provided with a pin for receiving a hardware indication signal.
确定单元301,具体用于读取单板向管脚输入的二进制代码,并根据二进制代码确定偏移地址。The determining unit 301 is specifically configured to read a binary code input by the board to the pin, and determine an offset address according to the binary code.
可选的,CPU30还包括存储单元304,用于存储至少两个备选偏移地址。Optionally, the CPU 30 further includes a storage unit 304, configured to store at least two candidate offset addresses.
确定单元301,具体用于根据二进制代码,从至少两个备选偏移地址中确定其一为偏移地址。The determining unit 301 is specifically configured to determine, according to the binary code, one of the at least two candidate offset addresses as an offset address.
可选的,确定单元301,具体用于将二进制代码的取值作为偏置地址的取值。Optionally, the determining unit 301 is specifically configured to use the value of the binary code as the value of the offset address.
本发明的实施例所提供的CPU,CPU包括片内启动逻辑,CPU上电后运行片内启动逻辑,片内启动逻辑确定偏移地址,根据偏移地址,逐一启动Boot备份,直到有一个Boot备份启动成功。片内启动逻辑支持两个或者两个以上上电位置,不同Boot备份各自独立互无影响,不会因为一个Boot备份启动失败而导致不能启动另一个Boot备份,因此只要有一个Boot备份能够正常启动,就能够保证Boot启动,由此提高了Boot启动的可靠性。The CPU provided by the embodiment of the present invention includes an on-chip boot logic. After the CPU is powered on, the on-chip boot logic is run, and the on-chip boot logic determines the offset address. According to the offset address, the boot backup is started one by one until there is a boot. The backup was successfully started. The on-chip boot logic supports two or more power-on locations. Different boot backups have no independent effects. They do not start another boot backup because one boot backup fails. Therefore, as long as one boot backup can be started normally. , it can ensure the boot of the boot, thereby improving the reliability of the boot boot.
基于图3所对应的实施例,本发明的实施例还提供一种单板,参照图4所示,单板40包括CPU401以及存储器402。Based on the embodiment corresponding to FIG. 3, an embodiment of the present invention further provides a single board. Referring to FIG. 4, the board 40 includes a CPU 401 and a memory 402.
其中,CPU401为图4所对应的实施例中所描述的CPU401。The CPU 401 is the CPU 401 described in the embodiment corresponding to FIG. 4.
存储器402中存储有至少两个引导Boot备份,至少两个Boot备份中,相邻两个Boot备份的偏移地址为预设值,偏移地址为相邻两个Boot备份的起始地址之间的间隔。The memory 402 stores at least two boot backups. In at least two boot backups, the offset addresses of the two adjacent backups are preset values, and the offset address is between the start addresses of two adjacent boot backups. Interval.
可选的,至少两个引导Boot备份包括第一Boot备份、第二Boot备份以及第三Boot备份。Optionally, the at least two booting backups include a first boot backup, a second boot backup, and a third boot backup.
当第一Boot备份启动失败,且第二Boot备份启动后,第二Boot 用于对第三Boot备份进行校验,当第三Boot备份通过校验时,指示第三Boot备份启动。When the first boot backup fails, and the second boot backup is started, the second boot is started. It is used to verify the third boot backup. When the third boot backup passes the verification, the third boot backup is started.
可选的,第一Boot备份以及第三Boot备份为新版本Boot备份,第二Boot备份为出厂版本Boot备份。Optionally, the first boot backup and the third boot backup are the new version of the boot backup, and the second boot backup is the factory version of the boot backup.
可选的,存储器402包括至少一个闪存芯片403,图4所示为包括3个闪存芯片403的情况。至少两个Boot备份存储于至少一个闪存芯片403内。其中至少一个闪存芯片403中,一个闪存芯片403内存储有至少一个Boot备份。Optionally, the memory 402 includes at least one flash memory chip 403, and FIG. 4 shows a case where three flash memory chips 403 are included. At least two boot backups are stored in at least one flash chip 403. Among the at least one flash chip 403, at least one boot backup is stored in one flash chip 403.
单板40还包括闪存控制逻辑电路404,CPU401通过闪存控制逻辑电路404访问至少一个闪存芯片。The board 40 also includes flash control logic 404 through which the CPU 401 accesses at least one flash chip.
本发明的实施例所提供的单板,包括CPU以及存储器,CPU上电后确定偏移地址,根据偏移地址,逐一启动存储器中所存储的Boot备份,直到有一个Boot备份启动成功。CPU支持两个或者两个以上上电位置,不同Boot备份各自独立互无影响,不会因为一个Boot备份启动失败而导致不能启动另一个Boot备份,因此只要有一个Boot备份能够正常启动,就能够保证Boot启动,由此提高了Boot启动的可靠性,并进一步提高了单板启动的可靠性。The board provided by the embodiment of the present invention includes a CPU and a memory. After the CPU is powered on, the offset address is determined. According to the offset address, the Boot backup stored in the memory is started one by one until a Boot backup is successfully started. The CPU supports two or more power-on locations. Different boot backups have no effect on each other. They do not start another boot backup because one boot backup fails. Therefore, as long as one boot backup can be started normally, you can Ensures boot startup, which improves the reliability of boot startup and further improves the reliability of board startup.
以上,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。 The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It is within the scope of the invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims (22)

  1. 一种启动Boot的方法,应用于中央处理器CPU,其特征在于,所述CPU安装于单板上,所述单板包括存储器,所述存储器中存储有至少两个引导Boot备份,所述至少两个Boot备份中,相邻两个Boot备份的偏移地址为预设值,其中所述偏移地址为相邻两个Boot备份的起始地址之间的间隔,所述CPU包括片内启动逻辑,所述CPU通过所述片内启动逻辑执行所述启动Boot的方法,所述启动Boot的方法包括:A method for booting a boot, which is applied to a CPU of a central processing unit, wherein the CPU is mounted on a single board, the single board includes a memory, and at least two boot boot backups are stored in the memory, where the at least two In the two boot backups, the offset addresses of the two adjacent boot backups are preset values, where the offset address is the interval between the start addresses of two adjacent boot backups, and the CPU includes an on-chip boot. Logic, the CPU executes the method for booting a boot by using the on-chip booting logic, where the method for booting the boot includes:
    确定所述偏移地址;按照预设顺序逐一根据偏移地址启动所述至少两个Boot备份,直到有一个Boot备份启动成功。Determining the offset address; starting the at least two boot backups according to the offset address one by one in a preset order until one boot backup is successfully started.
  2. 根据权利要求1所述的启动Boot的方法,其特征在于,所述确定所述偏移地址包括:The method for starting a boot according to claim 1, wherein the determining the offset address comprises:
    根据预配置的硬件指示信号确定所述偏移地址。The offset address is determined based on a pre-configured hardware indication signal.
  3. 根据权利要求1或2所述的启动Boot的方法,其特征在于,启动Boot过程中,所述CPU访问的第一个Boot备份对应的起始地址不为0。The method for starting the boot according to claim 1 or 2, wherein the starting address corresponding to the first boot backup accessed by the CPU is not 0 during the booting process.
  4. 根据权利要求1-3中任意一项所述的启动Boot的方法,其特征在于,所述至少两个Boot备份包括第一Boot备份和第二Boot备份,所述根据所述偏移地址,按照预设顺序逐一启动所述至少两个Boot备份,包括:The method for initiating a boot according to any one of claims 1 to 3, wherein the at least two boot backups comprise a first boot backup and a second boot backup, according to the offset address, according to The at least two boot backups are started one by one in a preset sequence, including:
    根据所述偏移地址确定第一地址,并对所述第一Boot备份进行校验;其中,所述第一地址为所述第一Boot备份的起始地址,所述第一地址为所述偏移地址的M倍,M为大于或者等于0的整数,且M为预设值;Determining a first address according to the offset address, and verifying the first boot backup; wherein the first address is a start address of the first boot backup, and the first address is the M times the offset address, M is an integer greater than or equal to 0, and M is a preset value;
    当所述第一Boot备份通过校验时,启动所述第一Boot备份;When the first boot backup passes the verification, the first boot backup is started;
    当所述第一Boot备份未通过校验时,根据所述偏移地址确定第二地址,并根据所述第二地址对所述第二Boot备份进行校验,当所述第二Boot备份通过校验时,启动所述第二Boot备份;其中,所述第二地址为所述第二Boot备份的起始地址,所述第二地址为所述偏 移地址的N倍,N为大于或者等于0的整数,且N为不等于M的预设值。When the first boot backup fails the verification, determining the second address according to the offset address, and verifying the second boot backup according to the second address, when the second boot backup passes During the verification, the second boot backup is started; wherein the second address is a starting address of the second boot backup, and the second address is the partial N times the address is shifted, N is an integer greater than or equal to 0, and N is a preset value that is not equal to M.
  5. 根据权利要求1-3中任意一项所述的启动Boot的方法,其特征在于,所述至少两个Boot备份包括第一Boot备份和第二Boot备份,所述根据所述偏移地址,按照预设顺序逐一启动所述至少两个Boot备份,包括:The method for initiating a boot according to any one of claims 1 to 3, wherein the at least two boot backups comprise a first boot backup and a second boot backup, according to the offset address, according to The at least two boot backups are started one by one in a preset sequence, including:
    根据所述偏移地址确定第一地址,并启动所述第一Boot备份;其中,所述第一地址为所述第一Boot备份的起始地址,所述第一地址为所述偏移地址的M倍,M为大于或者等于0的整数,且M为预设值;Determining a first address according to the offset address, and starting the first boot backup; wherein the first address is a start address of the first boot backup, and the first address is the offset address M times, M is an integer greater than or equal to 0, and M is a preset value;
    当所述第一Boot备份启动失败时,根据所述偏移地址确定第二地址,并启动所述第二Boot备份;其中,所述第二地址为所述第二Boot备份的起始地址,所述第二地址为所述偏移地址的N倍,N为大于或者等于0的整数,且N为不等于M的预设值。Determining, according to the offset address, the second address, and starting the second boot backup, where the second address is the starting address of the second boot backup, The second address is N times the offset address, N is an integer greater than or equal to 0, and N is a preset value that is not equal to M.
  6. 根据权利要求2-5任一项所述的启动Boot的方法,其特征在于,所述CPU外围设置有可擦除可编辑逻辑器件EPLD;The method for booting a boot according to any one of claims 2 to 5, wherein the CPU peripheral is provided with an erasable editable logic device EPLD;
    所述根据预配置的硬件指示信号确定所述偏移地址,包括:Determining the offset address according to the pre-configured hardware indication signal, including:
    读取所述EPLD中的寄存器值,将所述寄存器值作为所述偏移地址的取值。The register value in the EPLD is read, and the register value is taken as the value of the offset address.
  7. 根据权利要求2-5任一项所述的启动Boot的方法,其特征在于,A method of booting a boot according to any one of claims 2 to 5, characterized in that
    所述CPU设置有用于接收所述硬件指示信号的管脚;The CPU is provided with a pin for receiving the hardware indication signal;
    所述根据预配置的硬件指示信号确定所述偏移地址,包括:Determining the offset address according to the pre-configured hardware indication signal, including:
    读取所述单板向所述管脚输入的二进制代码;Reading a binary code input by the board to the pin;
    根据所述二进制代码确定所述偏移地址。The offset address is determined based on the binary code.
  8. 根据权利要求7所述的启动Boot的方法,其特征在于,所述CPU的片内启动逻辑定义至少两个备选偏移地址;The method for booting according to claim 7, wherein the on-chip boot logic of the CPU defines at least two candidate offset addresses;
    所述根据所述二进制代码确定所述偏移地址,包括:The determining the offset address according to the binary code includes:
    根据所述二进制代码,从所述至少两个备选偏移地址中确定其一 为所述偏移地址。Determining one of the at least two candidate offset addresses according to the binary code Is the offset address.
  9. 根据权利要求7或8所述的启动Boot的方法,其特征在于,所述根据所述二进制代码确定所述偏移地址,包括:The method for starting a boot according to claim 7 or 8, wherein the determining the offset address according to the binary code comprises:
    将所述二进制代码的取值作为所述偏置地址的取值。The value of the binary code is taken as the value of the offset address.
  10. 一种中央处理器CPU,所述CPU用于安装于单板上,所述单板包括存储器,所述存储器中存储有至少两个引导Boot备份,所述至少两个Boot备份中,相邻两个Boot备份的偏移地址为预设值,其中所述偏移地址为相邻两个Boot备份的起始地址之间的间隔;所述CPU包括:A central processing unit CPU, the CPU is configured to be installed on a single board, the single board includes a memory, and the memory stores at least two booting backups, and the at least two boot backups are adjacent to the two The offset address of the Boot Backup is a preset value, where the offset address is an interval between the start addresses of two adjacent Boot Backups; the CPU includes:
    确定单元,用于确定所述偏移地址;a determining unit, configured to determine the offset address;
    Boot启动控制单元,用于按照预设顺序逐一根据所述偏移地址启动所述至少两个Boot备份,直到有一个Boot备份启动成功。The boot startup control unit is configured to start the at least two boot backups according to the offset address one by one according to a preset sequence, until one boot backup is successfully started.
  11. 根据权利要求10所述的CPU,其特征在于,The CPU according to claim 10, characterized in that
    所述确定单元,具体用于根据预配置的硬件指示信号确定所述偏移地址。The determining unit is specifically configured to determine the offset address according to a pre-configured hardware indication signal.
  12. 根据权利要求10或11所述的CPU,其特征在于,A CPU according to claim 10 or 11, wherein
    启动Boot过程中,所述Boot启动控制单元访问的第一个Boot备份对应的起始地址不为0。The boot address corresponding to the first boot backup accessed by the boot startup control unit is not 0.
  13. 根据权利要求10-12任一项所述的CPU,其特征在于,所述至少两个Boot备份包括第一Boot备份和第二Boot备份;The CPU according to any one of claims 10 to 12, wherein the at least two boot backups comprise a first boot backup and a second boot backup;
    所述Boot启动控制单元,具体用于根据所述偏移地址确定第一地址,并对所述第一Boot备份进行校验;当所述第一Boot备份通过校验时,启动所述第一Boot备份;其中,所述第一地址为所述第一Boot备份的起始地址,所述第一地址为所述偏移地址的M倍,M为大于或者等于0的整数,且M为预设值;The booting control unit is configured to determine a first address according to the offset address, and perform verification on the first boot backup; when the first boot backup passes verification, start the first The boot backup; wherein the first address is a start address of the first boot backup, the first address is M times the offset address, M is an integer greater than or equal to 0, and M is a pre- Set value
    所述Boot启动控制单元,还用于当所述第一Boot备份未通过校验时,根据所述偏移地址确定第二地址,并根据所述第二地址对所述第二Boot备份进行校验,当所述第二Boot备份通过校验时,启动所述第二Boot备份;其中,所述第二地址为所述第二Boot备份的起始 地址,所述第二地址为所述偏移地址的N倍,N为大于或者等于0的整数,且N为不等于M的预设值。The booting control unit is further configured to: when the first boot backup fails the verification, determine the second address according to the offset address, and perform the second boot backup according to the second address. The second boot backup is started when the second boot backup passes the verification; wherein the second address is the start of the second boot backup An address, the second address is N times the offset address, N is an integer greater than or equal to 0, and N is a preset value that is not equal to M.
  14. 根据权利要求10-12任一项所述的CPU,其特征在于,所述至少两个Boot备份包括第一Boot备份和第二Boot备份;The CPU according to any one of claims 10 to 12, wherein the at least two boot backups comprise a first boot backup and a second boot backup;
    所述Boot启动控制单元,具体用于根据所述偏移地址确定第一地址,并启动所述第一Boot备份;其中,所述第一地址为所述第一Boot备份的起始地址,所述第一地址为所述偏移地址的M倍,M为大于或者等于0的整数,且M为预设值;The booting control unit is configured to determine a first address according to the offset address, and start the first boot backup, where the first address is a starting address of the first boot backup. The first address is M times the offset address, M is an integer greater than or equal to 0, and M is a preset value;
    所述Boot启动控制单元,还用当所述第一Boot备份启动失败时,根据所述偏移地址确定第二地址,并启动所述第二Boot备份;其中,所述第二地址为所述第二Boot备份的起始地址,所述第二地址为所述偏移地址的N倍,N为大于或者等于0的整数,且N为不等于M的预设值。The booting control unit further determines, when the first boot backup fails, determines a second address according to the offset address, and starts the second boot backup; wherein the second address is the The starting address of the second boot backup, the second address is N times the offset address, N is an integer greater than or equal to 0, and N is a preset value that is not equal to M.
  15. 根据权利要求11-14任一项所述的CPU,其特征在于,所述CPU外围设置有可擦除可编辑逻辑器件EPLD;The CPU according to any one of claims 11 to 14, wherein the CPU peripheral is provided with an erasable editable logic device EPLD;
    所述确定单元,具体用于读取所述EPLD中的寄存器值,将所述寄存器值作为所述偏移地址的取值。The determining unit is specifically configured to read a register value in the EPLD, and use the register value as a value of the offset address.
  16. 根据权利要求11-14任一项所述的CPU,其特征在于,所述CPU设置有用于接收所述硬件指示信号的管脚;The CPU according to any one of claims 11 to 14, wherein the CPU is provided with a pin for receiving the hardware indication signal;
    所述确定单元,具体用于读取所述单板向所述管脚输入的二进制代码,并根据所述二进制代码确定所述偏移地址。The determining unit is specifically configured to read a binary code input by the board to the pin, and determine the offset address according to the binary code.
  17. 根据权利要求16所述的CPU,其特征在于,所述CPU还包括存储单元,用于存储至少两个备选偏移地址;The CPU according to claim 16, wherein the CPU further comprises a storage unit for storing at least two candidate offset addresses;
    所述确定单元,具体用于根据所述二进制代码,从所述至少两个备选偏移地址中确定其一为所述偏移地址。The determining unit is specifically configured to determine, according to the binary code, one of the at least two candidate offset addresses as the offset address.
  18. 根据权利要求16或17所述的CPU,其特征在于,A CPU according to claim 16 or 17, wherein:
    所述确定单元,具体用于将所述二进制代码的取值作为所述偏置地址的取值。The determining unit is specifically configured to use a value of the binary code as a value of the offset address.
  19. 一种单板,其特征在于,所述单板包括中央处理器CPU以 及存储器;A single board, wherein the single board includes a central processing unit CPU And memory;
    其中,所述CPU为权利要求10-18任一项所述的CPU;Wherein the CPU is the CPU according to any one of claims 10-18;
    所述存储器中存储有至少两个引导Boot备份,所述至少两个Boot备份中,相邻两个Boot备份的偏移地址为预设值,所述偏移地址为相邻两个Boot备份的起始地址之间的间隔。At least two boot backups are stored in the memory. In the at least two boot backups, offset addresses of two adjacent boot backups are preset values, and the offset addresses are adjacent to two boot backups. The interval between the starting addresses.
  20. 根据权利要求19所述的单板,其特征在于,所述至少两个引导Boot备份包括第一Boot备份、第二Boot备份以及第三Boot备份;The board of claim 19, wherein the at least two boot backups comprise a first boot backup, a second boot backup, and a third boot backup;
    当所述第一Boot备份启动失败,且所述第二Boot备份启动后,所述第二Boot用于对所述第三Boot备份进行校验,当所述第三Boot备份通过校验时,指示所述第三Boot备份启动。After the first boot backup fails, and the second boot backup is started, the second boot is used to check the third boot backup, and when the third boot backup passes the check, Instructing the third boot backup to start.
  21. 根据权利要求20所述的单板,其特征在于,The veneer according to claim 20, wherein
    所述第一Boot备份以及所述第三Boot备份为新版本Boot备份,所述第二Boot备份为出厂版本Boot备份。The first boot backup and the third boot backup are new version Boot backups, and the second boot backup is a factory version boot backup.
  22. 根据权利要求19-21任一项所述的单板,其特征在于,A veneer according to any one of claims 19 to 21, wherein
    所述存储器包括至少一个闪存芯片,所述至少两个Boot备份存储于所述至少一个闪存芯片内;其中所述至少一个闪存芯片中,一个闪存芯片内存储有至少一个Boot备份;The memory includes at least one flash memory chip, and the at least two boot backups are stored in the at least one flash memory chip; wherein, among the at least one flash memory chip, at least one boot backup is stored in one flash memory chip;
    所述单板还包括闪存控制逻辑电路,所述CPU通过所述闪存控制逻辑电路访问所述至少一个闪存芯片。 The board also includes flash control logic circuitry, the CPU accessing the at least one flash chip through the flash control logic.
PCT/CN2016/074331 2016-02-23 2016-02-23 Method, cpu and single board for starting boot WO2017143513A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2016/074331 WO2017143513A1 (en) 2016-02-23 2016-02-23 Method, cpu and single board for starting boot
CN201680082286.XA CN108701036A (en) 2016-02-23 2016-02-23 A kind of method, CPU and veneer starting Boot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/074331 WO2017143513A1 (en) 2016-02-23 2016-02-23 Method, cpu and single board for starting boot

Publications (1)

Publication Number Publication Date
WO2017143513A1 true WO2017143513A1 (en) 2017-08-31

Family

ID=59685793

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/074331 WO2017143513A1 (en) 2016-02-23 2016-02-23 Method, cpu and single board for starting boot

Country Status (2)

Country Link
CN (1) CN108701036A (en)
WO (1) WO2017143513A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610415A (en) * 2022-03-23 2022-06-10 北京经纬恒润科技股份有限公司 Program starting method, system, storage medium and electronic equipment

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110007971A (en) * 2019-03-25 2019-07-12 联想(北京)有限公司 A kind of information processing method and device, equipment, storage medium
CN111143131B (en) * 2019-12-26 2022-08-12 中国电子科技集团公司第五十八研究所 System for backup hot start of operating system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030140A (en) * 2006-03-02 2007-09-05 中兴通讯股份有限公司 Device and method for on-line updating fastener programm
CN102509047A (en) * 2011-11-09 2012-06-20 北京赛科世纪数码科技有限公司 Method and system for verifying program code in set-top box
CN102736933A (en) * 2012-05-16 2012-10-17 中兴通讯股份有限公司 BOOT file loading method and device
CN103116511A (en) * 2013-01-29 2013-05-22 烽火通信科技股份有限公司 Double-booting method based on single FLASH storage chip

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1295903C (en) * 2002-11-18 2007-01-17 华为技术有限公司 A safe system starting method
CN102135891B (en) * 2010-01-21 2013-06-26 杭州华三通信技术有限公司 System capable of realizing bootload, bootload control device and method
CN102135927B (en) * 2011-04-29 2013-02-13 杭州华三通信技术有限公司 Method and device for system booting based on NAND FLASH
WO2012149774A1 (en) * 2011-09-27 2012-11-08 华为技术有限公司 Method and apparatus for activating processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030140A (en) * 2006-03-02 2007-09-05 中兴通讯股份有限公司 Device and method for on-line updating fastener programm
CN102509047A (en) * 2011-11-09 2012-06-20 北京赛科世纪数码科技有限公司 Method and system for verifying program code in set-top box
CN102736933A (en) * 2012-05-16 2012-10-17 中兴通讯股份有限公司 BOOT file loading method and device
CN103116511A (en) * 2013-01-29 2013-05-22 烽火通信科技股份有限公司 Double-booting method based on single FLASH storage chip

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610415A (en) * 2022-03-23 2022-06-10 北京经纬恒润科技股份有限公司 Program starting method, system, storage medium and electronic equipment
CN114610415B (en) * 2022-03-23 2024-01-16 北京经纬恒润科技股份有限公司 Program starting method, system, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN108701036A (en) 2018-10-23

Similar Documents

Publication Publication Date Title
KR102026393B1 (en) Patching boot code of read-only memory
JP5540155B2 (en) Providing platform independent memory logic
JP7022809B2 (en) Computer systems, their safety management methods, and computer software products
US7900036B2 (en) System and method for implementing boot/recovery on a data processing sysem
US10909247B2 (en) Computing device having two trusted platform modules
US11182148B2 (en) System and method for automated BIOS recovery after BIOS corruption
US11567844B2 (en) Nonvolatile memory devices, systems and methods for fast, secure, resilient system boot
US11163886B2 (en) Information handling system firmware bit error detection and correction
US20150199190A1 (en) System and method for updating firmware
CN109614265B (en) Double-backup system of intelligent inertial navigation sensing system and configuration starting method thereof
CN107015878B (en) System repair method and system for computer
WO2017143513A1 (en) Method, cpu and single board for starting boot
JP6622337B2 (en) Safe reset technology for microcontroller systems in safety-related applications
US20130080751A1 (en) Method and device for updating bios program for computer system
US9298554B2 (en) Method and apparatus for booting processor
US8719646B2 (en) Non-volatile memory (NVM) reset sequence with built-in read check
US9594623B2 (en) System on chip and method of updating program code on a system on chip
US7490321B2 (en) Method for updating firmware via determining program code
CN109189457B (en) Firmware upgrading system and method of intelligent inertial navigation sensing system
WO2021012170A1 (en) Firmware booting method and device, and computer-readable storage medium
CN113590209B (en) Chip starting control method, chip and electronic equipment
KR101844095B1 (en) Method and apparatus for executing bootloader
CN113297010A (en) Firmware recovery method, device and system based on system on chip and storage medium
US11775284B2 (en) Electronic device and code patching method
CN118276985B (en) RISC-V chip starting method, equipment and medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16890967

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16890967

Country of ref document: EP

Kind code of ref document: A1