Method for updating firmware in the control chip
A control chip for updating firmware in an optical disk drive by hardware. The control chip includes a microprocessor for controlling actions of the optical disk drive, a decoder controlled by the microprocessor and connected to an external buffer memory and a host interface, a controller controlled by the microprocessor and connected to the decoder to receive control signals and data of the optical disk drive, an extra memory connected to the microprocessor for storing an update program routine, a DMA unit controlled by the microprocessor to read data from the external buffer memory, and a macro unit controlled by the microprocessor to receive data output from the DMA unit and to write the data into the non-volatile memory. Because the firmware is updated into the flash memory in the hardware architecture, the speed is fast and the microprocessor can execute other works while updating.
Latest MEDIATEK INC. Patents:
- METHOD FOR FINDING AT LEAST ONE OPTIMAL POST-TRAINING QUANTIZATION MODEL AND A NON-TRANSITORY MACHINE-READABLE MEDIUM
- Controller integrated circuit and method for controlling storage device for host device with aid of queue auxiliary notification information
- Dynamic loading neural network inference at DRAM/on-bus SRAM/serial flash for power optimization
- Image adjusting method and image adjusting device
- SEMICONDUCTOR PACKAGE HAVING DISCRETE ANTENNA DEVICE
This application is a divisional of co-pending application Ser. No. 10/718,547, filed on Nov. 24, 2003, and for which priority is claimed under 35 U.S.C. §120; and this application claims priority of application No. 092100208 filed in Taiwan, R.O.C. on Jan. 3, 2003 under 35 U.S.C. §119; the entire contents of all are hereby incorporated by reference.
BACKGROUND OF THE INVENTION1. Field of the Invention
The invention relates to a control chip for an optical disk drive and a method for updating firmware in the control chip, and more particularly to a control chip for an optical disk drive, which executes firmware update actions by a macro unit and a DMA (Direct Memory Access) unit, and a method for updating firmware in the control chip.
2. Description of the Related Art
Because the computer industry is rapidly developed, hardware peripherals, such as optical drive, are also rapidly developed. In order to continuously update the function and operation of the optical drive, the firmware stored in the non-volatile memory is typically updated. Generally, when the firmware of the optical drive is updated, the update program routine being executed and the data being updated are stored in the non-volatile memory. However, this method reduces the usable space in the non-volatile memory and lengthens the time for updating the firmware.
In addition, U.S. Pat. No. 6,170,043, entitled “Method for controlling an optic disk” disclosed another update method.
In view of the above-mentioned problems, it is therefore an object of the invention to provide a control chip, which has a macro unit, for an optical disk drive and a method for updating firmware in the control chip. The update control of the firmware is performed using the macro unit by means of hardware control.
To achieve the above-mentioned object, the control chip for an optical disk drive includes a microprocessor for controlling actions of the optical disk drive, a decoder controlled by the microprocessor and connected to an external buffer memory and a host interface, a controller controlled by the microprocessor and connected to the decoder to receive control signals and data of the optical disk drive, an extra memory for storing an update program routine of the microprocessor and being connected to the microprocessor, a DMA unit controlled by the microprocessor to read data of the external buffer memory, and a macro unit controlled by the microprocessor to receive data output from the DMA unit and to write the data into the non-volatile memory.
When the control chip is updating the update program routine of the non-volatile memory, the extra memory serves as a buffer for the update program routine of the microprocessor, and the microprocessor outputs the control signals to the DMA unit and the macro unit. Data in the buffer memory is written to the non-volatile memory using the macro unit and the DMA unit by hardware.
Further scope of the applicability of the present invention will become apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating preferred embodiments of the invention, are given by way of illustration only, since various changes and modifications within the spirit and scope of the invention will become apparent to those skilled in the art from this detailed description.
BRIEF DESCRIPTION OF THE DRAWINGSThe present invention will become more fully understood from the detailed description given hereinbelow and the accompanying drawings which are given by way of illustration only, and thus are not limitative of the present invention, and wherein:
The control chip for an optical disk drive and a method for updating firmware in the control chip of the invention will be described with reference to the accompanying drawings.
The macro unit 310, which is controlled by the microprocessor 304, reads data in the buffer memory 212 via the DMA unit 312 when the firmware is updated, and writes the read data to the non-volatile memory 210 in a specific command sequence, such as an erase command, a read command, a write command, a compare command, and the like. The DMA unit 312, which is also controlled by the microprocessor 304, transfers the data in the buffer memory 212 to the macro unit 310 when the firmware is updated.
When the optical disk drive is updating the firmware, the optical disk drive temporarily stores an update program routine to be executed by the microprocessor 304 in the extra memory 302, and the firmware to be updated in the buffer memory 212. Thus, when the optical disk drive is updating the firmware, the microprocessor 304 executes the update program routine stored in the extra memory 302 and outputs control signals to the macro unit 310 and the DMA unit 312 so as to execute the update action of the firmware through the macro unit 310 and the DMA unit 312. When the macro unit 310 is executing the update action, the microprocessor 304 only needs to monitor the interior state of the macro unit 310. Thus, the microprocessor 304 may execute other actions with the host 216 at other time. Because the macro unit 310 and the DMA unit 312 read the update action of firmware, the executing speed is faster than that by calculating addresses by software.
The optical disk drive is switched to a firmware update mode, when the control chip is updating firmware into the non-volatile memory, other the optical disk drive is switched to a normal operation mode. In general, after the computer is booted and reset, the microprocessor 204 of the optical disk drive will initialize the optical disk drive, such as CD-ROM, and wait for the command of the host computer 216 requesting to read data from the disk 100. After the host computer 216 issues a command to request reading data of the disk 100, the microprocessor 304 outputs correct parameters to control the controller 308 and the decoder 306 in order to drive the motor and the optical pickup in the optical disk drive to read the data stored in the disk 100. The data in the disk 100 is decoded and corrected by the decoder 306, and is then stored in the buffer memory (DRAM) 212. Consequently, the computer 216 can read the data in the buffer memory 212 by the decoder 306 via a host interface 214. At this time, the extra memory 302 serves as a memory space for the general data, while the non-volatile memory 210 serves as a memory space for the update program routine of the system.
When the optical disk drive will update the firmware of the non-volatile memory 210, the update program routine of the special format data similar to a TOC (Table of Content) may be stored in a disk, which is placed in the optical disk drive. Alternately, the host computer 216 executes certain specific software for the update program routine. The content of the update program routine includes program codes and an update program routine. At this time, the extra memory 302 stores the update program routine loaded from the disk 100 or the computer 216, and the program codes are stored in the buffer memory 212.
The actions of the macro unit 310 includes reading program codes from the DMA unit 312, outputting the address, the program codes, and write control signals to the non-volatile memory 210.
Step S602: load an update program routine. The step is controlled by the microprocessor 304 or the host 216 to load the update program routine to the extra memory 302. Thus, the microprocessor 304 can execute the update program routine of the extra memory 302 during the update action.
Step S604: load program codes. The step is controlled by the microprocessor 304 or the host 216 to load the to-be-updated program codes (firmware) to the buffer memory 212.
Step S606: set the DMA unit 312 and the macro unit 310. The microprocessor 304 computes the start position of the program codes in the buffer memory 212 and the total length of the program codes, and transfers the setting information, including start position and length, to the DMA unit 312. In addition, the destination starting address of the non-volatile memory 210 is set in the macro unit 310.
Step S608: execute a program code write action. The microprocessor 304 generates and outputs an initialization signal to the macro unit 310 and the DMA unit 312. After the macro unit 310 and the DMA unit 312 receive the initialization signal, the DMA unit 312 reads the program codes from the buffer memory 212 and transfers them to the macro unit 310, which writes the program codes into the non-volatile memory 210.
Step S610: monitor the state of the macro unit. The microprocessor 304 monitors the interior state of the macro unit 310 so as to control the actions of the macro unit 310 at proper timing of, for example, when the macro unit 310 has an error or when the writing of the program codes is finished.
Step S612: switch the mode to a normal operation mode. When the writing of the program codes is finished, the microprocessor 304 generates a stop signal to the macro unit 310 and the DMA unit 312 so as to stop the actions of the macro unit 310 and the DMA unit 312 and to switch the mode to the normal operation mode.
In the above-mentioned step S608, because the writing action of the program codes is hardware-controlled by the macro unit 310 and the DMA unit 312, the speed is faster than that by software-calculating the address. Moreover, because the writing action of program codes is hardware-controlled by the macro unit 310 and the DMA unit 312, the microprocessor 304 can execute other works in addition to monitoring the state of the macro unit 310. For instance, the microprocessor 304 may transfer data via the host interface 214 and the host 216, or report the writing progress and state.
While certain exemplary embodiments have been described and shown in the accompanying drawings, it is to be understood that such embodiments are merely illustrative of and not restrictive on the broad invention, and that this invention not be limited to the specific construction and arrangement shown and described, since various other modifications may occur to those ordinarily skilled in the art.
Claims
1. A method for updating firmware of an optical disk drive, which is writing to-be-updated firmware from a buffer memory to a non-volatile memory through a macro unit and a DMA unit, the method comprising the steps of:
- loading an update program routine into an extra memory so as to enable a microprocessor to execute the update program routine in the extra memory when an update action is performed;
- loading program codes, in which the to-be-updated firmware is loaded into the buffer memory;
- setting the DMA unit and the macro unit, in which the microprocessor computes a start position of the firmware stored in the buffer memory and a length of the firmware, the start position and the length are output to the DMA unit, and a start address of the non-volatile memory is set in the macro unit;
- writing the program codes, in which the microprocessor generates and outputs an initialization signal to the macro unit and the DMA unit so as to enable the DMA unit to read data from the buffer memory and transfer the data to the macro unit, which writes the data into the non-volatile memory; and
- stopping the update action, in which when the data have been written completely, the microprocessor generates a stop signal to the macro unit and the DMA unit, so as to stop actions of the macro unit and the DMA unit and switch to a normal operation mode.
2. The method according to claim 1, further comprising a step of monitoring an interior state of the macro unit by the microprocessor.
Type: Application
Filed: Mar 30, 2006
Publication Date: Jul 27, 2006
Applicant: MEDIATEK INC. (Hsin Chu City)
Inventors: Ping-Sheng Chen (Chung Pu Hsiang), Hung-Cheng Kuo (Hsinchu)
Application Number: 11/392,710
International Classification: G06F 13/28 (20060101);