Method for initializing bus device

In a method used for initializing a first bus device and a second bus device sharing a common transmission engine of a bus, a first link of the first bus device and a second link of the second bus device to the common transmission engine are disabled when the computer system is booted. Next, the first link and the second link are enabled in order. Then, a first state updating signal from the first bus device is issued after the first link to the common transmission engine is established. Finally, a second state updating signal from the second bus device is issued after the first state updating signal is received and the second link to the common transmission engine is established.

FIELD OF THE INVENTION

The present invention relates to a method for initializing a bus device in a computer system, and more particularly to a method for initializing an additional bus device in a personal computer system.

BACKGROUND OF THE INVENTION

A SATA (Serial Advanced Technology Attachment) bus is a new generation of advanced technology attachment (ATA) bus, which is faster in data transmission speed and more efficient in power consumption than the conventional PATA (parallel ATA) bus. Nowadays, the SATA bus is adapted to a high-speed HDD (hard disc drive), and generally works under a scheme as shown inFIG. 1.

In the computer system shown inFIG. 1, the HDD13coupled to the SATA bus12will actively issue a state updating signal, e.g. a D2H FIS signal, when the computer system is booted. The state updating signal is transmitted through the physical layer device123, data link layer device122and transmission engine121of the SATA bus12, and then sent to the SATA host controller111disposed in the core logic chip11via the SATA host controller interface14to undergo state coordination and state updating operations. After the state coordination/updating operations have been confirmed by the computer system, the HDD13completes initialization and starts its normal work.

In a master/slave mode, a transmission engine121can be shared by two hard disc drives23and24, as illustrated inFIG. 2, and both hard disc drivers23and24may issue respective state updating signals (D2H FIS signals) when the computer system is booted. The state updating signals are transmitted to the transmission engine121via respective physical layers123and125and data link layer devices122and124. However, only one of the state updating signals will be acknowledged by the computer system because the transmission engine121is generally set to link to only a certain one of the HDDs when the computer system is booted, and thus the operation of the unlinked HDD might have problem. For example, the transmission engine121is set to link to the hard disc23so as to receive the state updating signal from the HDD23via the data link layer device122and the physical layer123upon the computer system is booted. Therefore, the computer system will respond to the HDD23only. On the other hand, the HDD24, which waits too long for response from the computer system due to failure in transmitting its state updating signal to the transmission engine121, might not enter the normal operational state. As such, the computer system may crash.

SUMMARY OF THE INVENTION

Therefore, the present invention provides an initializing method capable of initializing the additional HDD.

In an embodiment, the present invention relates to a method for initializing a first bus device and a second bus device sharing a common transmission engine of a bus. The method includes the following steps. At first, a first link of the first bus device and a second link of the second bus device to the common transmission engine are disabled when the computer system is booted. Next, a first state updating signal from the first bus device is issued after the first link to the common transmission engine is established. Finally, a second state updating signal from the second bus device is issued after the first state updating signal is received and the second link to the common transmission engine is established.

The present invention also relates to a method for initializing a plurality of bus devices sharing a common transmission engine of a bus used in a computer system. The method includes the following steps. At first, all the links of the bus devices to the common transmission engine are disabled when the computer system is booted. Next, respective state updating signals are issued in order from corresponding bus devices after a plurality of according links to the common transmission engine are established. Finally, an operating system of the computer system is loaded after all the bus devices are initialized.

Moreover, a method for initializing a first bus device and a second bus device sharing a common transmission engine of a bus used in a computer system according to the present invention is disclosed. The method includes the following step. At first, a first link of the first bus device to the common transmission engine is enabled while a second link of the second bus device to the common transmission engine is disabled. Next, a first state updating signal is transmitted from the first bus device to the computer system for initializing the first bus device. Finally, a data indicating a state of the bus is checked after the first state updating signal is transmitted. Sequentially, the second link of the second bus device to the common transmission engine is enabled when the data inform the computer system that the bus is not busy. And then, a second state updating signal is transmitted from the second bus device to the computer system for initializing the second bus device.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

The bus-device initializing method according to the present invention is applicable to various computer architectures with more than one bus devices sharing a common transmission engine.FIG. 3exemplifies a computer system3including two transmission engines, each serving two HDDs, to illustrate the present invention. As shown inFIG. 3, a first HDD331, a second HDD332, a third HDD333and a fourth HDD334are coupled to a core logic chip31and a CPU30via a SATA bus32. The SATA bus32includes physical layer devices327,328,329and320, data link layer devices323,324,325and326, a first transmission engine321and a second transmission engine322. The first transmission engine321serves the first HDD331and the second HDD332, while the second transmission engine322serves the third HDD333and the fourth HDD334. In addition, a SATA host controller310is disposed in the core logic chip31to control the SATA bus and bus devices via a SATA host controller interface34.

An embodiment of the bus-device initializing method according to the present invention will be described hereinafter with the example ofFIG. 3and the flowchart ofFIG. 4. When the computer system is booted, the SATA host controller310disables the linking operations of all the first HDD331, the second HDD332, the third HDD333and the fourth HDD334at first (Step41). Then, a first link of a first bus device to a common transmission engine is established, wherein the first bus device is selected from one of the first HDD331, the second HDD332, the third HDD333and the fourth HDD334, and the common transmission engine is correspondingly selected from one of the transmission engines321and322of the SATA bus32(Step42). Under this circumstance, only a first state updating signal issued from the first bus device can be transmitted to the SATA host controller310through the common transmission engine via corresponding physical layer device and data link layer device. After the computer system acknowledges the first state updating signal, the first bus device completes state coordination and state updating operations (Step43). Then, the state of the first bus device is read for initialization (Step44). Afterwards, a specific data stored in a state register (not shown) to indicate the state of the SATA bus32is checked. If the specific data is a certain bit value, e.g. BSY bit=0, it means that the SATA bus32is not busy and the first state updating signal from the first bus device has been successfully transmitted by the SATA bus32for initializing the first bus device. Subsequently, by initializing a second bus device, a second link of the second bus device, which is different from the first bus device, to a common transmission engine is established, wherein the second bus device is selected from one of the first HDD331, the second HDD332, the third HDD333and the fourth HDD334, and the common transmission engine is correspondingly selected from one of the transmission engines321and322of the SATA bus42(Step45). Likewise, only a second state updating signal issued from the second bus device can be transmitted to the SATA host controller310through the common transmission engine via corresponding physical layer device and data link layer device. The data stored in the state register is checked again and next initializing step is performed for the second bus device through the common transmission engine when the data is the bit value “0” indicating that the SATA bus32is not busy (BSY bit=0). In this manner, all the HDDs can be initialized one by one.

For example, the first HDD331is first initialized by establishing the link of the first HDD331to the SATA bus32while keeping the links of the second HDD332, the third HDD333and the fourth HDD334disabled so that the state updating signal from the first HDD331can be transmitted to the SATA host controller310via the physical layer device327, data link layer device323and transmission engine321. Then the state-indicative data is checked to determine whether the state updating signal has been successfully transmitted. If yes, it is the turn to initialize the second HDD332by establishing the link of the second HDD332to the SATA bus32while keeping the links of the third HDD333and the fourth HDD334disabled so that the state updating signal from the second HDD332can be transmitted to the SATA host controller310via the physical layer device328, data link layer device324and transmission engine321. Then the state-indicative data is checked to determine whether the state updating signal has been successfully transmitted. If yes, it is the turn to initialize the third HDD333by establishing the link of the third HDD333to the SATA bus32while keeping the link of the fourth HDD334disabled so that the state updating signal from the third HDD333can be transmitted to the SATA host controller310via the physical layer device329, data link layer device325and transmission engine322. Finally, after the state-indicative data indicates the transmission of the state updating signal has completed, the link of the fourth HDD334to the SATA bus32is established, and the state updating signal from the fourth HDD334can be transmitted to the SATA host controller310via the physical layer device320, data link layer device326and transmission engine322, thereby initializing the fourth HDD334.

After all the bus devices have been initialized successfully (Step46), bus commands can be transmitted normally (Step47), and the operating system and subsequent programs can be loaded and executed (Step48).

According to the present invention, all the bus devices are disabled in the beginning. The disabling effect, for example, can be achieved by enabling respective staggered spin-up commands having been defined in the SATA specifications. Subsequently, the staggered spin-up commands are disabled to establish the links, respectively. Aside from, there could be alternative ways to disable and establish the link. For example, the hardware of the HDD can be designed to do no active linking operation. The linking operation is then performed in response to a software command.

Although the embodiment of the present invention is exemplified as above with HDDs serving as bus devices coupled to the SATA bus, the present initializing method can also be applied to any other suitable bus device(s), e.g. optical disc drive, coupled to a SATA (Serial Advanced Technology Attachment) bus, an ATA (Advanced Technology Attachment) bus or an ATAPI (Advanced Technology Attachment Packet Interface) bus. By using the present method, the bus devices can be initialized normally.