HOST DEVICE, STORAGE DEVICE, AND METHOD FOR ACCESSING STORAGE DEVICE
A host device is connected to a storage device via a bus and reads and writes data in the storage device. The host device includes a command transmitter that sequentially transmits a command in a command sequence, which includes a set of commands which do not change data stored in the storage device, and a response receptor that accepts a response from the storage device for each command transmission from the command transmitter and determines whether or not an error exists. An acceptable/unacceptable access determiner provided in the host device enables access to the storage device when a normal response is identified by the response receptor and otherwise determines that access to the storage device is unacceptable. The normal response is when the responses received from the storage device for the transmissions of all commands in the command sequence do not include an error.
Latest Panasonic Patents:
This is a divisional application of pending U.S. patent application Ser. No. 11/571,592, filed Jan. 3, 2007, which is a National Stage of International Patent Application No. PCT/JP05/011799 filed Jun. 28, 2005 which claims priority under 35 U.S.C. §119 of Japanese Application No. 2004-201511 filed on Jul. 8, 2004 the disclosures of which are expressly incorporated by reference herein in their entireties.
TECHNICAL FIELDThe present invention relates to a host device, storage device, and method for accessing the storage device that execute the initialization of the storage device and data transmission/reception with use of a command, wherein the storage device is connected to the host device.
BACKGROUND ARTIn devices (referred to as host devices below) that control digital data such as a digital camera, movie, and portable music player, there is a memory card, as a storage device for retaining digital information, mounting a non-volatile memory. In order to realize compatibility between memory cards manufactured by multiple makers and host devices, a scheme for the host device to access a memory card is standardized. A version of the standard is upgraded along with enlargement of capacity and addition of functions of a memory card. A method for making a host device to execute access by showing different storage capacities to each host device with use of multiple ways of capacity reference is proposed (for example, see Patent document 1).
- Patent document 1: Unexamined Patent Publication 2004-86505.
However, the conventional technique described above has following problems. That is to say, there is such a problem that a host device of an old version may destroy data written by a host device of a new version because host devices which are in different versions can access the same storage area. Also, there is such a problem that internal configuration and control of a memory card becomes complex since multiple areas are provided in a memory card and access control based on a host device is executed.
In view of the above mentioned problem, the present invention is designed to provide a host device, storage device, and method for accessing a storage device which can execute access control in simple configuration and control.
Means to Solve the ProblemsTo solve the problem, a host device which is connected to a storage device via a bus and reads and writes data in the storage device comprising: a command transmission unit for sequentially transmitting a command in a command sequence composed of a set of commands which does not cause change on data stored in the storage device; a response reception unit for accepting a response from the storage device for each command transmission from the command transmission unit and determining whether an error exists or not; and an acceptable/unacceptable access determination unit for enabling access when normal reception is identified by the response reception unit after each command transmission from the command transmission unit and otherwise determining that access to the storage device is unacceptable.
To solve the problem, a storage device which is connected to a host device via a bus and stores and reads data based on a command from the host device comprising: a memory for retaining data given from the host device; a memory control unit for controlling data-reading and data-writing to the memory; a command reception unit for receiving a command issued from the host device and executing processing in accordance with each command; a response transmission unit for returning a response in the case of a predetermined command every time when the command reception unit receives each command; and an access determination unit for determining whether a command received by the command reception unit is a predetermined command sequence or not and accepting access when the command sequence is the predetermined command sequence.
To solve the problem, a method for accessing a storage device by a host device which is connected to the storage device via a bus and reads and writes data in the storage device comprising: sequentially transmitting a command in a command sequence composed of a set of commands which does not cause change on data stored in the storage device; accepting a response from the storage device for each command transmission and determining whether an error exists or not; and enabling access when normal reception is determined after each command transmission and otherwise determining that access to the storage device is unacceptable.
Effectiveness of the InventionIn the present invention, a host device, storage device, and method for accessing a storage device which can execute access control in simple configuration and under simple control can be provided since the storage device determines a sequence of a transmission command from the host device and determines access from the host device as acceptable when the sequence is identical with a predetermined sequence.
- 1 Host device
- 101 CPU
- 102 ROM
- 103 RAM
- 104 Interface
- 101a Command transmission unit
- 101b Response reception unit
- 101c Access determination unit
- 2 Storage device
- 201 Interface
- 202 Control unit
- 203 Memory control unit
- 204 Memory
- 202a Command reception unit
- 202b Response transmission unit
- 202c Access determination unit
- 3 Bus
The storage device 2 includes an interface 201, control unit 202, memory control unit 203, and memory 204. The interface 201 receives a command and data from the host device 1 and transmits a response. In addition, the control unit 202 includes a command reception unit 202a, response transmission unit 202b, and access determination unit 202c. The command reception unit 202a receives a command issued from the host device and executes processing corresponding to each command. The reception transmission unit 202b, each time the command reception unit receives a command, determines whether the command is based on a predetermined command sequence or not, and normally responds in the case of the command of the predetermined command sequence. In addition, the access determination unit 202c determines whether the command received by the command reception unit is the predetermined command sequence or not, and executes processing for accepting access in the case of the predetermined command sequence. The memory control unit 203 controls reading and writing of data from and to the memory 204 and the memory 204 retains data given from the host device. The storage device 2 checks whether a command sequence transmitted from the host device 1 is a predetermined sequence or not and determines access from the host device 1 is acceptable in the case of the predetermined command sequence.
The commands CMD_A, CMD_B, and CMD_C used for the command sequence herein can be any commands which do not change data of the memory 204 in the storage device 2. For instance, a command for accessing a register or command for reading ID of the storage device 2 can be used. A command only for detecting whether normal access to the storage device is possible or not may be used.
The host device 1 may use only a specific command sequence, for example, a host device meeting a standard of an old version may use one of the command sequences of
On the other hand, when the commands do not meet the predetermined sequence, an error response is made (S411). In
When a command is not the CMD_A in S502, it is checked whether the command is the CMD_C or not. When the command is the CMD_C, the storage device responds at S513 after executing the command and waits for a command at step S514. When the command is received, it is determined whether the command is the command CMD_B (S515) or not, when the command is the CMD_B, the storage device executes necessary processing and responds (S516). When a further command is received (S517), it is determined whether the command is the CMD_A (S518) or not. When the command is the CMD_A, the storage device executes necessary processing, responds (S519), and accepts access by a host device (S510). In addition, since the accepted command sequence is different from that in S509, access may be accepted as a command sequence having a different function on the storage device side at step S519. When the command sequence is different from the predetermined sequence in steps S512 to S518, the storage device executes an error response or does not respond (S520). Thus the storage device 2 can determine a plurality of command sequences. That is, the storage device 2 accepts access from the host device transmitting a command in the first or second sequence shown in
Next, a method for increasing kinds of command sequences with use of three commands will be explained.
A flowchart on the side of the storage device 2 corresponding to the third command sequence will be explained with use of
Subsequent processing of S705 to S711 are the same as that of above described S404 to s410 of
Next,
Access programs to the storage device 2 in the host device of
In the embodiment described here, a different sequence is shown by combining the commands CMD_A, CMD_B, or CMD_C, however, an additional other command may be used and commands constructing a sequence may be different from the commands of the combination. In addition, a command sequence transmitting commands in a predetermined number of times is not limited to the third and fourth method and, for example, the host device 1 may combine the determination of the sequence of
In the storage device 2, a plurality of command sequences may be acceptable as shown in
In the storage device 2, an acceptable command sequence may be transmitted in making an error response. An operation on the host device in the foregoing case that the acceptable command sequence is transmitted will be described.
According to the present invention, the storage device determines a command sequence transmitted by the host device, and determines that access from the host device is acceptable only when the command sequence is identical with a predetermined command sequence. As a result, access control can be executed by simple structure and control and it is useful in a storage device such as a memory card and various sorts of host devices using the storage device.
Claims
1. A host device which is connected to a storage device via a bus and reads and writes data in the storage device, the host device comprising:
- a command transmitter that sequentially transmits a command in a command sequence, which comprises a set of commands which do not change data stored in the storage device;
- a response receptor that accepts a response from the storage device for each command transmission from said command transmitter and determines whether or not an error exists; and
- an acceptable/unacceptable access determiner that enables access to the storage device when a normal response is identified by said response receptor and otherwise determines that access to the storage device is unacceptable, the normal response being when the responses received from the storage device for the transmissions of all commands in the command sequence do not include an error.
2. The host device according to claim 1, wherein
- said command transmitter of said host device issues a plurality of command sequences.
3. The host device according to claim 2, wherein
- said acceptable/unacceptable access determiner selects a command sequence that is different from the command sequence transmitted from said command transmitter, when it is determined that access is unacceptable.
4. The host device according to claim 3, wherein
- said acceptable/unacceptable access determiner selects an acceptable command sequence that is transmitted from the storage device, when it is determined that access is unacceptable.
5. A method for accessing a storage device by a host device, which is connected to the storage device via a bus and reads and writes data in the storage device, the method comprising:
- sequentially transmitting a command in a command sequence, which comprises a set of commands which do not change data stored in the storage device;
- accepting a response from the storage device for each command transmission and determining whether or not an error exists; and
- enabling access to the storage device when a normal response is determined and otherwise determining that access to the storage device is unacceptable, the normal response being when the responses received from the storage device for the transmissions of all commands in the command sequence do not include an error.
6. The method for accessing a storage device according to claim 5, further comprising:
- selecting a command sequence to be transmitted, which is different from the command sequence previously transmitted, when it is determined that access is unacceptable.
7. The method for accessing a storage device according to claim 6, further comprising:
- selecting an acceptable command sequence transmitted from the storage device, when it is determined that access is unacceptable.
Type: Application
Filed: Jan 27, 2011
Publication Date: May 26, 2011
Applicant: PANASONIC CORPORATION (Osaka)
Inventors: Masayuki TOYAMA (Osaka), Takuji MAEDA (Osaka), Tomoaki IZUMI (Osaka), Shouichi TSUJITA (Kyoto), Masahiro NAKANISHI (Kyoto), Shinji INOUE (Osaka)
Application Number: 13/014,875
International Classification: G06F 3/01 (20060101);