The present invention relates to the field of boot loaders. More particularly, the invention relates to a method for patching boot code, loaded from ROM, with contents from a PROM (Programmable ROM).
Today, a variety of SoCs (System on Chip) are used in many processing devices. A SoC generally comprises a processor embedded on a chip which is coupled to a local bus on the chip. Included on this single chip are also the hardware components required for a specific application, as well as other processors. SoCs are usually more application-specific than general integrated circuits. Typically, the SoC requires a boot code upon powering up. The boot (i.e. bootstrapping) process starts the operating systems when the user powers up the SoC. A boot sequence is the initial set of operations that the SoC performs when it is powered.
The boot code is typically stored in ROM for quick access, low complexity, spatial efficiency, low cost, and security reasons. The ROM, otherwise known as a masked ROM, has its code hardwired internally at the FAB (a semiconductor fabrication plant) and thus cannot be reprogrammed later. Because ROM resides on the SoC and is programmed in manufacturing, unauthorized access to the code within the ROM is difficult. This allows greater security against reverse engineering of proprietary code and against cryptographic attacks.
Along with the advantages in the use of ROM on SoCs there are major drawbacks. One such drawback is that the ROM fabricated on the SoC cannot be modified easily. Nevertheless, frequently, errors or “bugs” in the ROM code are discovered after the ROM has been fabricated on the SoC, these bugs must be addressed and repaired in order to ensure the integrity of the code and of the overall functioning of the SoC.
One method for repairing bugs is to make the necessary corrections in the ROM code, program a new ROM, and then re-fabricate the SoC. This method results in either scrapping the SoCs with the old ROMs that contain bugs or selling these SoCs at a reduced price for use in limited applications (i.e., those in which the known bugs have an insignificant impact on the application). This method of repairing bugs can be very expensive and time consuming. In addition, subsequent testing of the re-fabricated SoC may reveal additional bugs requiring another re-fabrication and additional expenses and delays.
In addition to the difficulties involved in repairing bugs in the ROM code, it is also complicated to add new features to the ROM code. Such additional features may be determined by the system designer to be desirable after the ROM has already been programmed and fabricated within the SoC.
Another type of memory storage is the OTP (One-Time Programmable), which is a PROM (Programmable ROM), designed for programming only once and cannot be reprogrammed. PROMs may be programmed with exposure to UV light, electric shock, etc. Thus, programming of the PROM can be done after the production of the chip, in a typical electronics lab or in the field. PROMs have an advantage over masked ROMs for system design purposes since the system designer has control over the programming of the PROM and can provide upgraded ROMs more readily. Nonetheless, PROMs are more expensive and more time consuming.
It is an object of the present invention to provide a method for modifying a boot code loaded from ROM.
It is another object of the present invention to provide a method for fixing bugs in a boot code stored on ROM.
It is still another object of the present invention to provide a method, for modifying the boot process, which is cost effective and time efficient.
It is still another object of the present invention to provide a SoC system with a modifiable boot process.
Other objects and advantages of the invention will become apparent as the description proceeds.
The present invention relates to a method for patching a boot code stored on ROM comprising the steps of: (a) storing at least one patching command for said boot code in a PROM; (b) loading said boot code from said ROM to a memory; (c) reading said at least one patching command from said PROM; (d) patching at least one command of said boot code residing in said memory with said at least one patching command from said PROM; and (e) executing the patched boot code.
In one embodiment, the patching command includes two parameters: data and address.
In a different embodiment, the patching command includes three parameters: data, start address, and data-length.
Preferably, the PROM is an OTP.
In one embodiment the reading of the patching command(s) is preformed after starting to execute the boot code from the memory and as an execution command of said boot code.
The present invention also relates to a method for patching a boot code stored on ROM comprising the steps of: (a) storing at least one patching command for said boot code in a PROM; (b) storing a lookup table listing intended boot code address(es) of said at least one patching command in said PROM; (c) copying said lookup table from said PROM to a memory; (d) reading said lookup table from said memory; and (e) executing said boot code from ROM, while executing said at least one patching command from said PROM instead of at least one command of said boot code having said boot code address listed in said lookup table.
The present invention also relates to a method for patching a boot code stored on ROM comprising the steps of: (a) storing a lookup table, on a PROM, listing at least one patching command, and its intended boot code address, for patching said boot code; (b) copying said lookup table from said PROM to a memory; (c) reading said lookup table from said memory; and (d) executing said boot code from ROM, while executing said at least one patching command from said lookup table in memory instead of at least one command of said boot code having said boot code address listed in said lookup table.
The present invention also relates to a method for patching a boot code stored on ROM comprising the steps of: (a) storing a lookup table, on a PROM, listing at least one patching command, and its intended boot code address, for patching said boot code; (b) reading said lookup table from said PROM; and (c) executing said boot code from ROM, while executing said at least one patching command, from said lookup table in said PROM, instead of at least one command of said boot code having said boot code address listed in said lookup table.
The present invention also relates to a system for patching a boot code stored on ROM comprising: (a) a ROM for storing said boot code; (b) a PROM for storing patching commands; (c) a memory capable of storing said boot code and said patching commands; and (d) a controller for loading said boot code from said ROM to said memory, and for patching said boot code in said memory with patching commands from said PROM.
The present invention also relates to a system for patching a boot code stored on ROM comprising: (a) a ROM for storing said boot code; (b) a PROM for storing patching commands; (c) a memory capable of storing said boot code and said patching commands; (d) a controller for loading said boot code from said ROM to said memory; and (e) a processor for patching said boot code with said patching commands from said PROM and for executing the patched boot code.
In the drawings:
All referrals to the term “patching” hereinafter are meant to include any one or any combination thereof of the following: modifying, replacing, amending, substituting, altering, changing, rewriting, adding, deleting, or any other act of causing the system to perform in a deviation from the initial designed process.
In yet another embodiment, the process of patching a boot code is similar to the one described in relations to
In yet another embodiment, the process of patching a boot code is similar to the one described in relations to
In one of the embodiments the patching commands are stored each with two parameters, address and data; where each patching command has a corresponding address for specifying the intended location for patching with the patching data. In another embodiment the patching commands are stored each with three parameters in a format of start address, data-length and data. Thus each patching command, or a group of patching commands, has a start address and length for specifying their intended location and length for patching.
In a preferred embodiment PROM 200, as described in relations to
While some embodiments of the invention have been described by way of illustration, it will be apparent that the invention can be carried into practice with many modifications, variations and adaptations, and with the use of numerous equivalents or alternative solutions that are within the scope of persons skilled in the art, without departing from the invention or exceeding the scope of claims,