JP4127071B2 - Data transfer control device, electronic device, and data transfer control method - Google Patents

Data transfer control device, electronic device, and data transfer control method Download PDF

Info

Publication number
JP4127071B2
JP4127071B2 JP2003041562A JP2003041562A JP4127071B2 JP 4127071 B2 JP4127071 B2 JP 4127071B2 JP 2003041562 A JP2003041562 A JP 2003041562A JP 2003041562 A JP2003041562 A JP 2003041562A JP 4127071 B2 JP4127071 B2 JP 4127071B2
Authority
JP
Japan
Prior art keywords
transfer
data
controller
pipe area
pipe
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
JP2003041562A
Other languages
Japanese (ja)
Other versions
JP2003316735A (en
JP2003316735A5 (en
Inventor
伸之 ▲斎▼藤
慎介 久保田
洋昭 下野
邦昭 松田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2003041562A priority Critical patent/JP4127071B2/en
Publication of JP2003316735A publication Critical patent/JP2003316735A/en
Publication of JP2003316735A5 publication Critical patent/JP2003316735A5/ja
Application granted granted Critical
Publication of JP4127071B2 publication Critical patent/JP4127071B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、データ転送制御装置、電子機器及びデータ転送制御方法に関する。
【0002】
【背景技術及び発明が解決しようとする課題】
HS(High Speed)モードをサポートするUSB(Universal Serial Bus)2.0の市場が順調に拡大しているなか、USB Implementers Forum(USB−IF)によって、USB On−The−Go(OTG)と呼ばれるインターフェース規格が策定された。USB2.0を拡張する形で策定されたOTG規格(OTG1.0)は、USBインターフェースの新たな付加価値を生む可能性を秘めており、その特質を生かしたアプリケーションの登場が待たれている。
【0003】
このOTGによれば、これまでUSBを介してホスト(パーソナルコンピュータ等)に接続されていたペリフェラル(周辺機器)に、ホスト機能を持たせることができる。これにより、ペリフェラル同士をUSBで接続してデータを転送することが可能になり、例えばデジタルカメラとプリンタとをダイレクトに接続して、デジタルカメラの画像を印刷することが可能になる。また、デジタルカメラやデジタルビデオカメラをストレージ装置に接続して、データを保存することが可能になる。
【0004】
しかしながら、OTGによりホスト機能を持たせるペリフェラルには、低性能のCPU(処理部)が組み込まれているのが一般的である。従って、ホスト機能の追加により、ペリフェラルが有するCPU(ファームウェア)の処理負荷が重くなったり、処理が複雑化すると、他の処理に支障が生じたり、機器の設計期間が長期化するなどの問題が生じる。
【0005】
本発明は、以上のような技術的課題に鑑みてなされたものであり、その目的とするところは、処理部の処理負荷の軽減等を図ることができるデータ転送制御装置、電子機器及びデータ転送制御方法を提供することにある。
【0006】
【課題を解決するための手段】
本発明は、バスを介したデータ転送のためのデータ転送制御装置であって、各エンドポイントに対応して各パイプ領域が確保され、各エンドポイントとの間で転送されるデータが各パイプ領域に記憶される複数のパイプ領域を有するパケットバッファに対して、アクセス制御を行うバッファコントローラと、各パイプ領域と各エンドポイントとの間でのデータ転送の転送条件情報が各転送条件レジスタに設定される複数の転送条件レジスタを含むレジスタ部と、転送条件レジスタに設定された転送条件情報に基づいて、エンドポイントに対するトランザクションを自動発生し、パイプ領域と、そのパイプ領域に対応するエンドポイントとの間で、データを自動転送する転送コントローラとを含むデータ転送制御装置に関係する。
【0007】
本発明では、パケットバッファに対して複数のパイプ領域(バッファ領域)が確保(allocate)される。この場合に、各パイプ領域は、バスの各エンドポイントに対応して確保される。また、各パイプ領域には、それに対応する各エンドポイントとの間で転送(送信、受信)されるデータが記憶(バッファリング)される。バッファコントローラは、このようなパイプ領域が確保されたパケットバッファ(バッファ)のアクセス制御(領域管理)を行う。
【0008】
そして本発明では、各パイプ領域と各エンドポイントとの間でのデータ転送の転送条件情報(エンドポイント情報、パイプ情報)が各転送条件レジスタ(パイプレジスタ)に設定される。そして、転送コントローラは、各転送条件レジスタに設定された転送条件情報に基づいて、各エンドポイントに対するトランザクションを自動発生し、各パイプ領域と各エンドポイントとの間でデータを自動転送する。これにより、データ転送制御装置の制御等を行う処理部の処理負荷の軽減等を図れる。
【0009】
また本発明では、前記転送条件レジスタに設定される転送条件情報が、エンドポイントとの間で転送されるデータのトータルサイズと、マックスパケットサイズと、データの転送方向とを含み、前記転送コントローラが、前記トータルサイズのデータを、前記マックスパケットサイズのペイロードのパケットを用いて、前記転送方向で指定される方向で、パイプ領域とそのパイプ領域に対応するエンドポイントとの間で自動転送してもよい。
【0010】
このようにすれば、転送条件レジスタに、トータルサイズ、マックスパケットサイズ、転送方向などの転送条件情報を設定するだけで、データを自動転送できるようになり、処理部の処理負荷の軽減等を図れる。
【0011】
また本発明では、前記転送条件レジスタに設定される転送条件情報が、データ転送の転送種別を含み、前記転送コントローラが、各パイプ領域のデータを、各転送条件レジスタに設定される転送種別のデータ転送により、自動転送してもよい。
【0012】
このようにすれば、各パイプ領域のデータを、任意の転送種別のデータ転送(例えば、アイソクロナス、インタラプトなどの周期転送、バルク、コントロールなどの非周期転送)で転送できるようになる。
【0013】
また本発明では、前記転送条件レジスタに設定される転送条件情報が、複数のパイプ領域間の転送比率情報を含み、前記転送コントローラが、前記転送比率情報で設定される転送比率で、各パイプ領域のデータを自動転送してもよい。
【0014】
このようにすれば、複数のパイプ領域のデータを、任意の転送比率で転送できるようになり、データ転送の効率的なスケジューリングが可能になる。
【0015】
また本発明では、前記転送比率情報が、各パイプ領域のトランザクションの連続実行回数であってもよい。
【0016】
このようにすれば、例えば、第Kのパイプ領域のデータ転送のトランザクションを複数回連続して実行(発生)した後に、第K+1のパイプ領域のデータ転送のトランザクションを実行できるようになる。
【0017】
また本発明では、前記転送条件レジスタに設定される転送条件情報が、インタラプト転送におけるトークン発行周期を含み、前記転送コントローラが、転送条件レジスタに設定される前記トークン発行周期で、インタラプト転送のトークンパケットを自動転送してもよい。
【0018】
このようにすれば、2分木構造のディスクリプタ等を用いることなく、インタラプト転送のトークンパケットを発行できるようになる。
【0019】
また本発明では、前記パイプ領域が、コントロール転送のエンドポイントに専用のパイプ領域と、任意のエンドポイントに割り当て可能な汎用のパイプ領域を含んでもよい。
【0020】
このようにすれば、例えば、パイプ領域とエンドポイントとの対応づけを動的に変化させることなどが可能になり、データ転送の効率的なスケジューリングが可能になる。
【0021】
また本発明では、前記バスとは異なる他のバスとパケットバッファとの間でのデータ転送を行うインターフェース回路を含み、前記インターフェース回路、前記転送コントローラに対して、処理部がデータ転送の開始を指示した場合に、前記インターフェース回路が他のバスを介したデータ転送を行うと共に、前記転送コントローラがバスを介したデータ転送を行い、データ転送が終了した場合に、前記転送コントローラが、処理部に対して割り込みを発生してもよい。
【0022】
このようにすれば、処理部は、転送条件を設定し、バス及び他のバス(処理部のバス又はシステムメモリのバス等)を介したデータ転送の開始を指示した後は、割り込みが発生するまで、データ転送制御装置の制御に関わらなくて済むようになる。これにより、処理部の処理負荷の軽減等を図れる。
【0023】
また本発明では、ホストの役割として動作するホスト動作のステートと、ペリフェラルの役割として動作するペリフェラル動作のステートを含む複数のステートの制御を行うステートコントローラを含み、前記転送コントローラが、ホスト動作時において、ホストとしてのデータ転送を行うホストコントローラと、ペリフェラル動作時において、ペリフェラルとしてのデータ転送を行うペリフェラルコントローラとを含み、ホスト動作時において、パケットバッファに対して複数のパイプ領域が確保され、前記ホストコントローラが、確保されたパイプ領域とそのパイプ領域に対応するエンドポイントとの間で、データを自動転送してもよい。
【0024】
本発明によれば、例えば、ステートコントローラにより制御されるステートが、ホスト動作のステートになると、ホストコントローラにより、ホストの役割としてのデータ転送が行われる。また、ステートコントローラにより制御されるステートが、ペリフェラル動作のステートになると、ペリフェラルコントローラにより、ペリフェラルの役割としてのデータ転送が行われる。これにより、いわゆるデュアルロール・デバイス機能を実現できるようになる。
【0025】
そして本発明では、ホスト動作時において、パケットバッファに対して複数のパイプ領域が確保され、確保されたパイプ領域とエンドポイントとの間でデータが自動転送される。これにより、デュアルロール・デバイス機能を実現できると共に、ホスト動作時における処理部の処理負荷の軽減等を図れる。
【0026】
また本発明では、USB(Universal Serial Bus)のOTG(On−The−Go)規格に準拠したデータ転送を行ってもよい。
【0027】
また本発明は、上記のいずれかのデータ転送制御装置と、前記データ転送制御装置及びバスを介して転送されるデータの出力処理又は取り込み処理又は記憶処理を行う装置と、前記データ転送制御装置のデータ転送を制御する処理部とを含むことを特徴とする電子機器に関係する。
【0028】
また本発明は、バスを介したデータ転送のためのデータ転送制御方法であって、各エンドポイントとの間で転送されるデータが各パイプ領域に記憶される複数のパイプ領域を、パケットバッファに確保し、各パイプ領域と各エンドポイントとの間でのデータ転送の転送条件情報を、複数の転送条件レジスタの各転送条件レジスタに設定し、転送条件レジスタに設定された転送条件情報に基づいて、エンドポイントに対するトランザクションを自動発生し、パイプ領域と、そのパイプ領域に対応するエンドポイントとの間で、データを自動転送するデータ転送制御方法に関係する。
【0029】
【発明の実施の形態】
以下、本実施形態について説明する。
【0030】
なお、以下に説明する本実施形態は、特許請求の範囲に記載された本発明の内容を不当に限定するものではない。また本実施形態で説明される構成の全てが本発明の解決手段として必須であるとは限らない。
【0031】
1.OTG
まず、OTG(USB On−The−Go)について簡単に説明する。
【0032】
1.1 Aデバイス、Bデバイス
OTGでは、コネクタの規格として、図1(A)に示すようなMini-Aプラグ、Mini-Bプラグが定義されている。また、これらのMini-Aプラグ、Mini−Bプラグ(広義にはケーブルの第1、第2のプラグ)の両方を接続できるコネクタとして、Mini-ABレセプタクル(receptacle)が定義されている。
【0033】
そして例えば図1(B)のように、USBケーブルのMini-Aプラグに電子機器Pが接続され、Mini-Bプラグに電子機器Qが接続されると、電子機器PはAデバイスに設定され、電子機器QはBデバイスに設定される。一方、図1(C)に示すように、Mini-Bプラグ、Mini-Aプラグが電子機器P、Qに接続されると、電子機器P、Qは、各々、Bデバイス、Aデバイスに設定される。
【0034】
Mini-Aプラグ内ではIDピンがGNDに接続されており、Mini-Bプラグ内ではIDピンはフローティング状態になっている。電子機器は、内蔵するプルアップ抵抗回路を用いて、このIDピンの電圧レベルを検出することで、自身がMini-Aプラグに接続されたのか、或いはMini-Bプラグに接続されたのかを判断する。
【0035】
OTGでは、Aデバイス(マスター)が、電源(VBUS)を供給する側(供給元)になり、Bデバイス(スレイブ)が、電源の供給を受ける側(供給先)になる。また、Aデバイスは、デフォルトのステートがホストになり、Bデバイスは、デフォルトのステートがペリフェラル(周辺機器)になる。
【0036】
1.2 デュアルロール・デバイス
OTGでは、ホスト(簡易ホスト)としての役割とペリフェラルとしての役割の両方を持つことができるデュアルロール・デバイス(Dual-Role Device)が定義されている。
【0037】
デュアルロール・デバイスは、ホストにもペリフェラルにもなれる。そして、デュアルロール・デバイスに接続された相手が、従来のUSB規格におけるホストやペリフェラルである場合には、デュアルロール・デバイスの役割は一意に定まる。つまり、接続相手がホストであれば、デュアルロール・デバイスはペリフェラルになり、接続相手がペリフェラルであれば、デュアルロール・デバイスはホストになる。
【0038】
一方、接続相手がデュアルロール・デバイスである場合には、両方のデュアルロール・デバイスは、お互いにホストとペリフェラルの役割を交換できる。
【0039】
1.3 SRP、HNP
デュアルロール・デバイスは、図2(A)、(B)に示すようなセッション開始要求手順SRP(Session Request Protocol)やホスト交換手順HNP(Host Negotiation Protocol)の機能を持つ。
【0040】
ここでセッション開始要求手順SRPは、BデバイスがAデバイスに対して、VBUS(電源)の供給を要求するプロトコルである。
【0041】
バスを使用しない場合にOTGでは、AデバイスはVBUSの供給を停止できる。これにより、Aデバイスが例えば小型の携帯機器であった場合に、無駄な電力消費を防止できる。そして、AデバイスがVBUSの供給を停止した後に、BデバイスがVBUSを供給してもらいたい場合には、このSRPを使用して、Aデバイスに対してVBUSの供給の再開を要求する。
【0042】
図2(A)にSRPの流れを示す。図2(A)に示すように、Bデバイスは、データ・ライン・パルシングとVBUSパルシングを行うことで、Aデバイスに対してVBUSの供給を要求する。そして、AデバイスによるVBUSの供給の開始後に、Bデバイスのペリフェラル動作(peripheral operation)と、Aデバイスのホスト動作(host operation)が開始する。
【0043】
図1(A)〜図1(C)で説明したように、デュアルロール・デバイス同士の接続では、Mini-Aプラグが接続された側であるAデバイスがデフォルトのホストとなり、Mini-Bプラグが接続された側であるBデバイスがデフォルトのペリフェラルになる。そして、OTGでは、プラグの抜き差しを行わなくても、ホストとペリフェラルの役割を交換できる。HNPは、このホストとペリフェラルの役割を交換するためのプロトコルである。
【0044】
HNPの流れを図2(B)に示す。デフォルトのホストとして動作するAデバイスが、バスの使用を終了すると、バスがアイドル状態になる。その後に、Bデバイスがデータ信号線DP(D+)のプルアップ抵抗を無効にすると、AデバイスがDPのプルアップ抵抗を有効にする。これにより、Aデバイスの役割はホストからペリフェラルに変わり、ペリフェラルとしての動作を開始する。また、Bデバイスの役割はペリフェラルからホストに変わり、ホストとしての動作を開始する。
【0045】
その後、Bデバイスが、バスの使用を終了し、AデバイスがDPのプルアップ抵抗を無効にすると、Bデバイスが、DPのプルアップ抵抗を有効にする。これにより、Bデバイスの役割はホストからペリフェラルに戻り、ペリフェラルとしての動作を再開する。また、Aデバイスの役割はペリフェラルからホストに戻り、ホストとしての動作を再開する。
【0046】
以上に説明したOTGによれば、携帯電話やデジタルカメラなどの携帯機器をUSBのホストとして動作させ、携帯機器同士をピア・ツー・ピアで接続してデータ転送を行うことが可能になる。これにより、USBインターフェースに新たな付加価値を生むことができ、これまでには存在しなかったアプリケーションを創出できる。
【0047】
2.OHCI
さて、従来のUSBでは、ホストであるパーソナルコンピュータが有するデータ転送制御装置(ホストコントローラ)は、マイクロソフト社が提唱したOHCI(Open Host Controller Interface)や、UHCI(Universal Host Controller Interface)といった規格に準拠していた。また、使用されるOS(Operating System)も、マイクロソフト社のWindowsやアップル社のマッキントッシュのOSなどに限定されていた。
【0048】
しかしながら、OTGのターゲット・アプリケーションである小型携帯機器では、組み込まれるCPUのアーキテクチャや、使用されるOSは千差万別である。更に、パーソナルコンピュータのホストコントローラ向けに規格化されたOHCIやUHCIは、USBホストとしての機能をフルに実装することを前提としており、小型携帯機器への実装に最適であるとは言い難い。
【0049】
例えば、図3(A)に、OHCIで使用されるリスト構造のデスクリプタの一例を示す。
【0050】
図3(A)において、エンドポイントディスクリプタED1、ED2、ED3は、リンクポインタによりリンクされており、エンドポイント1、2、3とのコミュニケーションに必要な情報が含まれている。そして、これらのED1、ED2、ED3には、転送ディスクリプタTD11〜TD13、TD21、TD31〜TD32がリンクポインタにより更にリンクされている。そして、これらの転送ディスクリプタには、エンドポイント1、2、3との間で転送するパケットデータに必要な情報が含まれている。
【0051】
図3(A)のリスト構造のディスクリプタは、図3(B)のCPU610(広義には処理部)上で動作するファームウェア(ホストコントローラ・ドライバ)が作成し、システムメモリ620に書き込む。即ち、ファームウェアは、システム中のエンドポイントに対してエンドポイントディスクリプタを割り当て、エンドポイント情報等に基づいてエンドポイントディスクリプタ、転送ディスクリプタを作成する。そして、これらのディスクリプタをリンクポインタでリンクさせて、システムメモリ620に書き込む。
【0052】
データ転送制御装置600(ホストコントローラ)は、システムメモリ620に書き込まれたリスト構造のディスクリプタを読み出し、エンドポイントディスクリプタや転送ディスクリプタに記述される情報に基づいて、データ転送を実行する。
【0053】
具体的には、データ転送制御装置600(ホストコントローラ)は、ED1に基づいてエンドポイント1の情報を設定し、ED1にリンクされるTD11に基づいて、エンドポイント1との間でデータ転送を行う。次に、ED2に基づいてエンドポイント2の情報を設定し、ED2にリンクされるTD21に基づいて、エンドポイント2との間でデータ転送を行う。同様にして、データ転送制御装置600は、TD31、TD12、TD32、TD13に基づいてデータ転送を実行する。
【0054】
インタラプト転送を行う場合には、CPU610上で動作するファームウェア(ホストコントローラ・ドライバ)は、図4に示すような2分木(binary tree)構造のディスクリプタを作成する。例えば、1ms毎にインタラプト転送のポーリングを行うエンドポイントについては、そのディスクリプタを図4のプレイスホルダ(placeholder)700に設定する。同様に、2ms毎にポーリングを行うエンドポイントについては、そのディスクリプタをプレイスホルダ701、702に設定し、4ms毎にポーリングを行うエンドポインタについては、プレイスホルダ703、704、705、706に設定する。
【0055】
そして、ポーリングを行う際には、インタラプトヘッドポインタのインデックスにしたがって、最下位層のプレイスホルダから順に2分木探索を行う。即ち、図4の経路710に示すように、まずインデックス0について最下位層から2分木探索を行う。次に、経路711に示すように、インデックス1について2分木探索を行う。同様にしてインデックス2〜31について2分木探索を行う。これにより、プレイスホルダ700に対応するエンドポイントについては1ms(1フレーム)毎に、701、702に対応するエンドポイントについては2ms毎に、703〜706に対応するエンドポイントについては4ms毎にインタラプト転送が行われるようになる。
【0056】
以上のように、OHCI準拠のデータ転送制御装置(ホストコントローラ)では、CPU上で動作するファームウェア(ホストコントローラ・ドライバ)が、図3(A)、図4に示すような複雑な構造のディスクリプタを作成しなければならない。従って、CPUの処理負荷が非常に重い。
【0057】
この場合、従来のUSBでは、ホストの役割が割り当てられるのはパーソナルコンピュータだけであり、このパーソナルコンピュータは高性能のCPUを有している。従って、図3(A)、図4に示すような複雑な構造のディスクリプタの作成も、余裕を持って行うことが可能であった。
【0058】
ところが、OTGのターゲットアプリケーションである小型携帯機器(デジタルカメラ、携帯電話等)に組み込まれるCPU(embedded CPU)は、パーソナルコンピュータのCPUに比べて、性能が格段に低いのが一般的である。従って、携帯機器にOTGのホスト動作を行わせると、携帯機器に組み込まれるCPUに過大な負荷がかかり、他の処理に支障が生じたり、データ転送のパフォーマンスが低下するなどの問題が生じる。
【0059】
3.構成例
図5に、以上のような問題を解決できる本実施形態のデータ転送制御装置の構成例を示す。なお、本実施形態のデータ転送制御装置は、図5の全ての回路ブロックを含む必要はなく、その一部の回路ブロックを省略してもよい。
【0060】
トランシーバ10(以下、適宜Xcvrと呼ぶ)は、差動データ信号DP、DMを用いてUSB(広義にはバス)のデータを送受信する回路であり、USBの物理層(PHY)回路12を含む。より具体的にはトランシーバ10は、DP、DMのラインステート(J、K、SE0等)の生成、シリアル/パラレル変換、パラレル/シリアル変換、ビットスタッフィング、ビットアンスタッフィング、NRZIデコード、NRZIエンコードなどを行う。なお、トランシーバ10をデータ転送制御装置の外部に設けるようにしてもよい。
【0061】
OTGコントローラ20(広義にはステートコントローラ。以下、適宜OTGCと呼ぶ)は、OTGのSRP機能やHNP機能(図2(A)、(B)参照)を実現するための種々の処理を行う。即ち、OTGコントローラ20は、ホストの役割として動作するホスト動作のステートや、ペリフェラルの役割として動作するペリフェラル動作のステートなどを含む複数のステートの制御を行う。
【0062】
より具体的には、OTG規格には、デュアルロール・デバイスのAデバイス時(図1(B)、(C)参照)のステート遷移やBデバイス時のステート遷移が定義されている。OTGコントローラ20は、これらのステート遷移を実現するためのステートマシーンを含む。また、OTGコントローラ20は、USBのデータラインステートや、VBUSレベルや、IDピンのステートを検出(監視)する回路を含む。そして、OTGコントローラ20が含むステートマシーンは、これらの検出情報に基づいて、そのステート(例えば、ホスト、ペリフェラル、サスペンド又はアイドルなどのステート)を変化させる。この場合のステートの遷移は、ハードウェア回路により実現してもよいし、ファームウェアがステートコマンドをレジスタに設定することで実現してもよい。そして、ステートが遷移すると、OTGコントローラ20は、遷移後のステートに基づいて、VBUSを制御したり、DP、DMのプルアップ抵抗/プルダウン抵抗の接続/非接続を制御する。また、ホストコントローラ50(以下、適宜HCと呼ぶ)、ペリフェラルコントローラ60(以下、適宜PCと呼ぶ)のイネーブル/ディスエーブルを制御する。
【0063】
HC/PC切り替え回路30(HC/PC・コモン回路)は、トランシーバ10と、ホストコントローラ50又はペリフェラルコントローラ60との間の接続の切り替え制御を行う。また、USBのデータ(DP、DM)のラインステートの生成の指示をトランシーバ10に対して行う。なお、接続の切り替え制御は、HC/PCセレクタ32により実現され、ラインステートの生成指示は、ラインステートコントローラ34により実現される。
【0064】
例えばOTGコントローラ20が、ホスト動作時(ホストステート時)にHCイネーブル信号をアクティブにすると、HC/PC切り替え回路30(HC/PCセレクタ32)は、トランシーバ10とホストコントローラ50を接続する。一方、OTGコントローラ20が、ペリフェラル動作時(ペリフェラルステート時)にPCイネーブル信号をアクティブにすると、HC/PC切り替え回路30は、トランシーバ10とペリフェラルコントローラ60を接続する。このようにすることで、ホストコントローラ50とペリフェラルコントローラ60とを排他的に動作させることが可能になる。
【0065】
転送コントローラ40は、USB(広義にはバス)を介したデータ転送を制御する回路であり、ホストコントローラ50(HC)とペリフェラルコントローラ60(PC)を含む。
【0066】
ここでホストコントローラ50は、ホスト動作時(OTGコントローラ20からのHCイネーブル信号のアクティブ時)に、ホストの役割としてのデータ転送制御を行う回路である。
【0067】
即ち、ホストコントローラ50は、ホスト動作時に、HC/PC切り替え回路30によりトランシーバ10に接続される。そしてホストコントローラ50は、レジスタ部70の転送条件レジスタ部72に設定された転送条件情報に基づいて、エンドポイントに対するトランザクションを自動発生する。そして、パケットバッファ100に確保(allocate)されたパイプ領域(PIPE0〜PIPEe。以下、適宜PIPEと呼ぶ)と、そのパイプ領域に対応するエンドポイントとの間で、データ(パケット)の自動転送(処理部が介在しないハードウェア回路によるデータ転送)を行う。
【0068】
より具体的にはホストコントローラ50は、複数のパイプ転送間の調停、フレームにおける時間管理、転送のスケジューリング、再送の管理などを行う。また、パイプ転送の転送条件情報(オペレーション情報)をレジスタ部70を介して管理する。また、トランザクションの管理を行ったり、パケットを生成/分解したり、サスペンド/レジューム/リセット状態生成の指示を行う。
【0069】
一方、ペリフェラルコントローラ60は、ペリフェラル動作時(OTGコントローラ20からのPCイネーブル信号のアクティブ時)に、ペリフェラルの役割としてのデータ転送制御を行う回路である。
【0070】
即ち、ペリフェラルコントローラ60は、ペリフェラル動作時に、HC/PC切り替え回路30によりトランシーバ10に接続される。そして、レジスタ部70の転送条件レジスタ部72に設定された転送条件情報に基づいて、パケットバッファ100に確保されたエンドポイント領域(EP0〜EPe。以下適宜EPと呼ぶ)とホストとの間でデータを転送する。
【0071】
より具体的には、ペリフェラルコントローラ60は、エンドポイント転送の転送条件情報(オペレーション情報)をレジスタ部70を介して管理する。また、トランザクションの管理を行ったり、パケットを生成/分解したり、リモート・ウェイクアップ信号生成の指示を行う。
【0072】
なお、エンドポイントは、ユニークなアドレスを割り当てることができる、ペリフェラル(デバイス)上のポイント(部分)である。ホストとペリフェラル(デバイス)との間でのデータ転送は、全て、このエンドポイントを経由して行われる。また、トランザクションは、トークンパケットと、オプショナルなデータパケットと、オプショナルなハンドシェークパケットにより構成される。
【0073】
レジスタ部70は、データ転送(パイプ転送、エンドポイント転送)制御、バッファアクセス制御、バッファ管理、割り込み制御、ブロック制御、或いはDMA制御などを行うための種々のレジスタを含む。なお、レジスタ部70が含むレジスタは、RAMなどのメモリにより実現してもよいし、Dフリップフロップなどにより実現してもよい。また、レジスタ部70のレジスタは、1つにまとめずに、各ブロック(HC、PC、OTGC、Xcvr等)に分散して配置してもよい。
【0074】
レジスタ部70は、転送条件レジスタ部72を含む。そして、この転送条件レジスタ部72は、ホスト動作時にパケットバッファ100に確保されるパイプ領域(PIPE0〜PIPEe)とエンドポイントとの間でのデータ転送の転送条件情報(転送制御情報)を記憶するレジスタを含む。これらの各転送条件レジスタは、パケットバッファ100の各パイプ領域に対応して設けられる。
【0075】
なお、ペリフェラル動作時には、パケットバッファ100にはエンドポイント領域(EP0〜EPe)が確保される。そして、転送条件レジスタ部72に設定された転送条件情報に基づいて、データ転送制御装置とホストとの間でのデータ転送が行われる。
【0076】
バッファコントローラ80(FIFOマネージャ)は、パケットバッファ100に対するアクセス(リード/ライト)制御や領域管理を行う。より具体的には、CPU(広義には処理部)、DMA(Direct Memory Access)、USBによるパケットバッファ100へのアクセス・アドレスを生成・管理する。また、CPU、DMA、USBによるパケットバッファ100へのアクセスの調停を行う。
【0077】
例えば、ホスト動作時には、バッファコントローラ80は、インターフェース回路110(CPU又はDMA)とパケットバッファ100の間のデータ転送経路と、パケットバッファ100とホストコントローラ50(USB)の間のデータ転送経路を設定(確立)する。
【0078】
一方、ペリフェラル動作時には、バッファコントローラ80は、インターフェース回路110(CPU又はDMA)とパケットバッファ100の間のデータ転送経路と、パケットバッファ100とペリフェラルコントローラ60(USB)の間のデータ転送経路を設定する。
【0079】
パケットバッファ100(FIFO、パケットメモリ、バッファ)は、USBを介して転送されるデータ(送信データ又は受信データ)を一時的に記憶(バッファリング)するものである。このパケットバッファ100は、例えばRAM(Random Access Memory)などにより構成できる。なお、パケットバッファ100をデータ転送制御装置の外部に設けてもよい(外付けメモリにしてもよい)。
【0080】
ホスト動作時には、パケットバッファ100はパイプ転送用のFIFO(First-In First-Out)として使用される。即ち、パケットバッファ100には、USB(バス)の各エンドポイントに対応するように、パイプ領域PIPE0〜PIPEe(広義にはバッファ領域)が確保される。また、各パイプ領域PIPE0〜PIPEeには、それに対応する各エンドポイントとの間で転送されるデータ(送信データ又は受信データ)が記憶される。
【0081】
一方、ペリフェラル動作時には、パケットバッファ100はエンドポイント転送用のFIFOとして使用される。即ち、パケットバッファ100には、エンドポイント領域EP0〜EPe(広義にはバッファ領域)が確保される。また、各エンドポイント領域EP0〜EPeには、ホストとの間で転送されるデータ(送信データ又は受信データ)が記憶される。
【0082】
なお、パケットバッファ100に確保されるバッファ領域(ホスト動作時にパイプ領域に設定され、ペリフェラル動作時にエンドポイント領域に設定される領域)は、先に入力された情報が先に出力されるような記憶領域(FIFO領域)に設定されている。
【0083】
また、PIPE0は、コントロール転送用のエンドポイント0に専用のパイプ領域であり、PIPEa〜PIPEeは、任意のエンドポイントに割り当て可能な汎用のパイプ領域である。
【0084】
即ち、USBでは、エンドポイント0がコントロール転送に専用のエンドポイントに設定される。従って、本実施形態のようにPIPE0をコントロール転送に専用のパイプ領域にすることで、ユーザが混乱するのを防止できる。また、PIPEa〜PIPEeを、任意のエンドポイントに割り当て可能なパイプ領域にすることで、エンドポイントに対応するパイプ領域を動的に変化させることが可能になる。これにより、パイプ転送のスケジューリングの自由度を向上でき、データ転送の効率化を図れる。
【0085】
なお本実施形態では、バッファ領域(パイプ領域又はエンドポイント領域)は、マックスパケットサイズMaxPktSize(広義にはページサイズ)とページ数BufferPageにより、その領域サイズRSizeが設定される(RSize=MaxPktSize×BufferPage)。このようにすることで、バッファ領域の領域サイズや面数(ページ数)を任意に設定できるようになり、パケットバッファ100のリソースの有効利用を図れる。
【0086】
インターフェース回路110は、USBとは異なる他のバスであるDMA(システムメモリ)バスやCPUバスと、パケットバッファ100との間でのデータ転送を行うための回路である。このインターフェース回路110は、パケットバッファ100と外部のシステムメモリとの間で、DMA転送を行うためのDMAハンドラ回路112を含む。また、パケットバッファ100と外部のCPUとの間で、PIO(Parallel I/O)転送を行うためのCPUインターフェース回路114を含む。なお、CPU(処理部)をデータ転送制御装置に内蔵させてもよい。
【0087】
クロックコントローラ120は、内蔵PLL又は外部入力クロックに基づいて、データ転送制御装置の内部で使用する各種のクロックを生成する。
【0088】
4.パイプ領域
本実施形態では図6(A)に示すように、ホスト動作時に、パケットバッファ100にパイプ領域PIPE0〜PIPEeが確保(allocate)される。そして、この各パイプ領域PIPE0〜PIPEeとペリフェラルの各エンドポイントの間で、データが転送される。
【0089】
ここで、本実施形態のパイプ領域の「パイプ」は、USBで定義される「パイプ」(デバイス上のエンドポイントとホスト上のソフトウェアとの間の関連を表す論理的な抽象化、論理的な経路)とは若干意味合いが異なる。
【0090】
本実施形態のパイプ領域は、図6(A)に示すように、USB(バス)に接続されるペリフェラルが有する各エンドポイントに対応して、パケットバッファ100上に確保される。例えば図6(A)において、パイプ領域PIPEaはペリフェラル1のエンドポイント1(バルクIN)に対応し、PIPEbはペリフェラル1のエンドポイント2(バルクOUT)に対応する。また、PIPEcはペリフェラル2のエンドポイント1(バルクIN)に対応し、PIPEdはペリフェラル2のエンドポイント2(バルクOUT)に対応する。また、PIPEeはペリフェラル3のエンドポイント1(インタラプトIN)に対応する。なお、PIPE0は、コントロール転送のエンドポイント0に専用のパイプ領域である。
【0091】
そして図6(A)の例では、パイプ領域PIPEaとペリフェラル1のエンドポイント1との間でUSBのバルクIN転送が行われ、PIPEbとペリフェラル1のエンドポイント2との間ではバルクOUT転送が行われる。また、PIPEcとペリフェラル2のエンドポイント1との間ではバルクIN転送が行われ、PIPEdとペリフェラル2のエンドポイント2との間ではバルクOUT転送が行われる。また、PIPEeとペリフェラル3のエンドポイント1との間ではインタラプトIN転送が行われる。
【0092】
このように本実施形態では、パイプ領域(汎用)とそれに対応するエンドポイントとの間では、任意のデータ転送(アイソクロナス転送、バルク転送、インタラプト転送)を行うことができる。
【0093】
そして本実施形態では、パイプ領域とそれに対応するエンドポイントの間では、所与のデータ単位(トータルサイズで指定されるデータ単位)のデータが転送される。この場合のデータ単位としては、例えばIRP(I/Oリクエストパケット)により転送要求されるデータ単位又はそれを適当なサイズに分割したデータ単位などを考えることができる。エンドポイントに対するこのデータ単位のデータ転送(一連のトランザクション)を、本実施形態における「パイプ」と呼ぶことができる。そして、そのような「パイプ」のデータ(送信データ、受信データ)を記憶する領域がパイプ領域になる。
【0094】
パイプ領域を用いた所与のデータ単位の転送が終了すると、そのパイプ領域は解放することができる。そして、解放されたパイプ領域は、任意のエンドポイントに割り当てることができる。このように本実施形態では、パイプ領域とエンドポイントとの対応づけを、動的に変化させることができる。
【0095】
また本実施形態では図6(B)に示すように、ペリフェラル動作時には、パケットバッファ100にエンドポイント領域EP0〜EPeが確保(設定)される。そして、この各エンドポイント領域EP0〜EPeとホスト(ホストコントローラ、システムメモリ)との間で、データが転送される。
【0096】
このように本実施形態では、パケットバッファ100のバッファ領域を、ホスト動作時にはパイプ領域に割り当て、ペリフェラル動作時にはエンドポイント領域に割り当てている。これにより、ホスト動作時とペリフェラル動作時とでパケットバッファ100のリソースを共用(兼用)することが可能になり、パケットバッファ100の使用記憶容量を節約できる。
【0097】
なおパイプ領域、エンドポイント領域の個数は6個に限定されず任意である。
【0098】
5.転送条件レジスタ(共用レジスタ)
本実施形態では図7に示すように、ホスト動作時には、パイプ領域PIPE0〜PIPEeとエンドポイントとの間で行われるデータ転送の転送条件情報が、転送条件レジスタTREG0〜TREGeに設定される。即ち、PIPE0、PIPEa、PIPEb、PIPEc、PIPEd、PIPEeの転送条件情報は、各々、TREG0、TREGa、TREGb、TREGc、TREGd、TREGeに設定(記憶)される。この設定は、例えばファームウェア(CPU)により行われる。
【0099】
そしてホストコントローラ50(広義には転送コントローラ)は、転送条件レジスタTREG0〜TREGeに設定された転送条件情報に基づいて、エンドポイントに対するトランザクションを発生する。そして、パイプ領域とそれに対応するエンドポイントとの間で、データ(パケット)を自動転送する。
【0100】
このように本実施形態では、各パイプ領域(バッファ領域)に対応して各転送条件レジスタが設けられ、この各転送条件レジスタに設定された転送条件情報に基づいて、各パイプ領域のパイプ転送(所与のデータ単位の転送)がホストコントローラ50により自動的に行われる。従って、ファームウェア(ドライバ、ソフトウェア)は、転送条件レジスタに転送条件情報を設定した後は、データ転送が完了するまで、データ転送制御に関わらなくて済むようになる。そして、所与のデータ単位のパイプ転送が完了すると割り込みが発生し、転送の完了がファームウェアに伝えられる。これにより、ファームウェア(CPU)の処理負荷を格段に低減できる。
【0101】
なお、本実施形態では図8に示すようにペリフェラル動作時には、エンドポイント領域EP0〜EPeとホストとの間で行われるデータ転送の転送条件情報が、転送条件レジスタTREG0〜TREGeに設定される。そしてペリフェラルコントローラ60(広義には転送コントローラ)は、転送条件レジスタTREG0〜TREGeに設定された転送条件情報に基づいて、エンドポイント領域とホストとの間でのデータ転送を行う。
【0102】
このように本実施形態では、転送条件レジスタTREG0〜TREGeが、ホスト動作時とペリフェラル動作時とで共用(兼用)される。これにより、レジスタ部70のリソースを節約でき、データ転送制御装置を小規模化できる。
【0103】
図9に、レジスタ部70のレジスタ構成例を示す。なお、レジスタ部70のレジスタの一部を、各ブロック(OTGC、HC、PC、Xcvr等)内に含ませてもよい。
【0104】
図9に示すように、レジスタ部70の転送条件レジスタ(TREG0〜TREGeの各々)は、ホスト動作時(HC、PIPE)とペリフェラル動作時(PC、EP)で共用されるHC/PC共用レジスタ(共用転送条件レジスタ)を含む。また、ホスト動作時にのみ使用されるHC(PIPE)用レジスタ(ホスト用転送条件レジスタ)を含む。また、ペリフェラル動作時にのみ使用されるPC(EP)用レジスタ(ペリフェラル用転送条件レジスタ)を含む。また、パケットバッファ(FIFO)のアクセス制御などを行うためのレジスタであり、ホスト動作時とペリフェラル動作時で共用されるアクセス制御レジスタを含む。
【0105】
例えば、デュアルロール・デバイスのホスト動作時に、ホストコントローラ50(HC)は、HC/PC共用レジスタとHC用レジスタに設定される転送条件情報に基づいて、データ(パケット)を転送する。
【0106】
一方、ペリフェラル動作時には、ペリフェラルコントローラ60(PC)は、HC/PC共用レジスタとPC用レジスタに設定される転送条件情報に基づいて、データ(パケット)を転送する。
【0107】
また、ホスト動作時、ペリフェラル動作時の両方において、バッファコントローラ80は、共用アクセス制御レジスタに基づいて、パケットバッファ100へのアクセス制御(リード/ライト・アドレスの発生、データのリード/ライト、アクセスの調停等)を行うことになる。
【0108】
図9のHC/PC共用レジスタには、データの転送方向(IN、OUT又はSETUP等)、転送種別(アイソクロナス、バルク、インタラプト、コントロールなどのトランザクションの種別)、エンドポイント番号(各USBデバイスのエンドポイントに関連づけられる番号)、マックスパケットサイズ(エンドポイントが送信又は受信可能なパケットの最大ペイロードサイズ。ページサイズ)が設定される。また、バッファ領域(パイプ領域、エンドポイント領域)のページ数(バッファ領域の面数)が設定される。また、DMA接続の有無(図5のDMAハンドラ回路112によるDMA転送の使用の有無)を指示する情報が設定される。
【0109】
HC(PIPE)用レジスタには、インタラプト転送のトークン発行周期(インタラプト・トランザクションを起動する周期、インターバル)が設定される。また、トランザクションの連続実行回数(パイプ領域間の転送比率を設定する情報。各パイプ領域のトランザクションの連続実行回数)が設定される。また、ファンクションアドレス(エンドポイントを有するファンクションのUSBアドレス)、転送データのトータルサイズ(各パイプ領域を介して転送されるデータのトータルサイズ。IRPなどのデータ単位)が設定される。また、自動トランザクションの開始指示(ホストコントローラに対する自動トランザクション処理の開始指示)が設定される。また、自動コントロール転送モードの指示(コントロール転送のセットアップステージ、データステージ、ステータスステージのトランザクションを自動発生するモードの指示)が設定される。
【0110】
PC(EP)用レジスタには、エンドポイントイネーブル(エンドポイントのイネーブルやディスエーブルの指示)、ハンドシェーク指定(各トランザクションで行われるハンドシェークの指定)が設定される。
【0111】
パケットバッファ(FIFO)用の共用アクセス制御レジスタには、バッファ・I/Oポート(CPUによりPIO転送を行う場合のI/Oポート)が設定される。また、バッファ・フル/エンプティ(各バッファ領域のフル、エンプティの通知)、バッファ・残りデータサイズ(各バッファ領域の残りデータサイズ)が設定される。
【0112】
レジスタ部70は、インタラプト系レジスタ、ブロック系レジスタ、DMA制御レジスタなども含む。
【0113】
インタラプト系レジスタは、割り込みのステータス(要因)をCPUに対して示すためのインタラプト・ステータスレジスタ、割り込みのイネーブル、ディスエーブル(非マスク、マスク)を設定するインタラプト・イネーブルレジスタを含む。なお、割り込みには、OTGコントローラ20系、ホストコントローラ50系、ペリフェラルコントローラ60系の割り込みがある。
【0114】
ブロック系レジスタは、ブロック間で共用されるブロック間共用レジスタや、各ブロック(Xcvr、OTGC、HC、PC)内で使用されるブロック用レジスタを含む。
【0115】
ブロック間共用レジスタには、各ブロックのリセットを指示するレジスタなどがある。ブロック用レジスタには、トランシーバ10(Xcvr)を制御するためのレジスタや、OTGコントローラ20(OTGC)のステートコマンドレジスタや、ホストコントローラ50(HC)のステートコマンドレジスタや、フレーム番号を設定するレジスタなどがある。
【0116】
以上のように本実施形態では、ホスト動作時とペリフェラル動作時で共用されるレジスタ(HC/PC共用レジスタ、共用アクセス制御レジスタ)をレジスタ部70に設けている。これにより、ホスト動作時用のレジスタとペリフェラル動作時用のレジスタを全く別個に設ける場合に比べて、レジスタ部70を小規模化できる。また、CPU上で動作するファームウェア(ドライバ)から見た共用レジスタのアクセスアドレスを、ホスト動作時とペリフェラル動作時とで同一にできる。従って、ファームウェアは、これらの共用レジスタを同一アドレスで管理できるようになり、ファームウェア処理を簡素化できる。
【0117】
また、HC用レジスタや、PC用レジスタを設けることで、ホスト動作時(PIPE)の転送やペリフェラル動作時(EP)の転送に特有の転送条件を設定できる。例えば、トークン発行周期を設定することで、図4で説明した手法を用いることなく、ホスト動作時にインタラプト転送のトークンを所望の周期で発行することが可能になる。また、連続実行回数を設定することで、ホスト動作時にパイプ領域間の転送比率を任意に設定できる。また、トータルサイズを設定することで、ホスト動作時にパイプ領域を介して自動転送されるデータのサイズを任意に設定できる。またファームウェアは、ホスト動作時に、自動トランザクションの開始を指示したり、自動コントロール転送モードのオン/オフを指示できるようになる。
【0118】
なお、図10に、汎用の転送条件(PIPE/EP)レジスタTREGa〜TREGe(TREGx:x=a〜e)のレジスタマップの詳細例を示し、図11に、コントロール転送用の転送条件レジスタTREG0のレジスタマップの詳細例を示す。また、図12(A)、(B)、図13に、これらの転送条件レジスタの各ビットフィールドに設定される転送条件情報(JoinDMA,FIFOClr,ToggleMode,AutoZeroLen,BufferPage,DirPID,TranType,EPNumber,MaxPktSize等)の概要を示す。
【0119】
例えば図10において、ホスト動作時とペリフェラル動作時とで、共用レジスタxConfig_0,xConfig_1,xMaxPktSize_H,xMaxPktSize_Lのアクセスアドレス0x0,0x1,0x2,0x3は同一になる。またホスト動作時とペリフェラル動作時とで、これらのレジスタには同内容の情報がファームウェアにより設定されることになる。
【0120】
6.自動トランザクション
図14に、ホストコントローラ50の自動トランザクション(IN、OUT)処理時におけるファームウェア処理のフローチャート例を示す。
【0121】
まず、ファームウェア(処理部、ドライバ)は、図9等で説明した転送条件レジスタに転送条件情報(パイプ情報)を設定する(ステップS1)。より具体的には、転送データのトータルサイズ、マックスパケットサイズ(MaxPktSize)、ページ数(BufferPage)、転送方向(IN、OUT又はSETUP)、転送種別(アイソクロナス、バルク、コントロール、インタラプト)、エンドポイント番号、パイプ領域のトランザクションの連続実行回数(転送比率)、インタラプト転送のトークン発行周期などを、転送条件レジスタに設定する。
【0122】
次に、外部のシステムメモリとパケットバッファ100の間に転送経路を設定する(ステップS2)。即ち図5のDMAハンドラ回路112を介したDMA転送経路を設定する。
【0123】
次に、ファームウェアは、DMA転送の開始指示を行う(ステップS3)。即ち、図9のDMA制御レジスタのDMA転送開始指示ビットをアクティブにする。なお、CPUによる転送では、図9のバッファ・I/Oポートにアクセスすることで、パケットバッファ100にアクセスすることが可能になる。
【0124】
次に、ファームウェアは、自動トランザクションの開始指示を行う(ステップS4)。即ち、図9のHC用レジスタ(パイプレジスタ)の自動トランザクション開始指示ビットをアクティブにする。これにより、ホストコントローラ50による、自動トランザクション処理、パケット処理(パケットの生成、分解)、スケジューリング処理が行われる。即ち、ホストコントローラ50は、トータルサイズで指定されるデータを、マックスパケットサイズのペイロードのパケットを用いて、転送方向で指定される方向(IN、OUT)で、自動転送する。
【0125】
なお、ステップS3、S4の処理の順序は問わず、自動トランザクション開始指示の後にDMA転送の開始指示を行ってもよい。
【0126】
次に、ファームウェアは、パイプ転送の完了を知らせる割り込みが発生するのを待つ(ステップS5)。そして、割り込みが発生すると、ファームウェアは、図9のインタラプト系レジスタの割り込みステータス(要因)を調べる。そして、処理が正常完了又はエラー終了する(ステップS6)。
【0127】
このように本実施形態によれば、ファームウェアは、各パイプ領域毎に転送条件情報を設定し(ステップS1)、DMA転送開始の指示(ステップS3)と自動トランザクション開始の指示(ステップS4)を行うだけで、その後のデータ転送処理はホストコントローラ50のハードウェア回路により自動的に行われるようになる。従って、図3(A)、(B)、図4で説明したOHCI準拠の手法に比べて、ファームウェアの処理負荷が軽減され、低性能のCPUが組み込まれる携帯機器に最適なデータ転送制御装置を提供できる。
【0128】
図15、図16に、ホストコントローラ50による自動トランザクション処理時の信号波形例を示す。なお、これらの図において、「H→P」は「ホストからペリフェラルにパケットが転送されること」を表し、「P→H」は「ペリフェラルからホストにパケットが転送されること」を表す。
【0129】
図15は、INトランザクションの場合(転送種別がINの場合)の信号波形例である。
【0130】
図14のステップS4で、ファームウェアが自動トランザクションの開始指示を行うと、図15のC1に示すように、PipeXTranGo(PipeXについてのファームウェアからの転送要求信号)がアクティブになる。これにより、そのPipeX(X=0〜e)についての、ホストコントローラ50による自動トランザクション処理が開始する。
【0131】
そして、C2に示すようにPipeTranGo(ホストコントローラ50内のHCシーケンス管理回路からの転送要求信号)がアクティブになると、C3に示すように、ホストコントローラ50がINトークンパケットを生成して、USBを介してペリフェラルに転送する。そして、C4に示すようにペリフェラルからホストコントローラ50にINデータパケットが転送されると、ホストコントローラ50は、C5に示すようにハンドシェークパケット(ACK)を生成して、ペリフェラルに転送する。これにより、C6に示すようにTranCmpACKがアクティブになる。
【0132】
同様にして、C7に示すようにPipeTranGoがアクティブになると、C8、C9、C10に示すパケット転送が行われ、C11に示すようにTranCmpACKがアクティブになる。そして、C12に示すようにPipeXTranComp(ファームウェアへのIRPのデータ単位の転送終了通知信号)がアクティブになる。このPipeXTranCompによる割り込みにより、ファームウェアは、そのパイプについての転送が完了したことを知ることができる。
【0133】
なお、PipeXTranCompがアクティブになると、C13に示すようにPipeXTranGoが非アクティブになり、そのパイプが非転送状態であることが示されるようになる。
【0134】
図16は、OUTトランザクションの場合(転送種別がOUTの場合)の信号波形例である。
【0135】
ファームウェアが自動トランザクションの開始指示を行うと、E1に示すようにPipeXTranGoがアクティブになり、E2に示すようにPipeTranGoがアクティブになる。すると、ホストコントローラ50は、E3に示すようにOUTトークンパケットをペリフェラルに転送し、E4に示すようにOUTデータパケットを転送する。そして、E5に示すようにペリフェラルからハンドシェークパケット(ACK)が返ってくると、E6に示すようにTranCmpACKがアクティブになる。
【0136】
同様にして、E7に示すようにPipeTranGoがアクティブになると、E8、E9、E10に示すパケット転送が行われ、E11に示すようにTranCmpACKがアクティブになる。そして、E12に示すようにPipeXTranCompがアクティブになる。このPipeXTranCompによる割り込みにより、ファームウェアは、そのパイプについての転送が完了したことを知ることができる。なお、PipeXTranCompがアクティブになると、E13に示すようにPipeXTranGoが非アクティブになる。
【0137】
7.トランザクションの連続実行回数
本実施形態では、トランザクション(パイプ転送)の連続実行回数(広義には複数のパイプ領域間の転送比率情報)を転送条件レジスタに設定できる。具体的には図9で説明したように、この連続実行回数はHC用の転送条件レジスタに設定される。
【0138】
例えば図17(A)では、パイプ領域PIPEa、PIPEb、PIPEcのトランザクションの連続実行回数は「1」に設定されている。この場合には、PIPEa、PIPEb、PIPEc、PIPEa、PIPEb、PIPEc・・・・というように、同一の転送比率でパイプ領域のデータの自動転送が行われる。
【0139】
これに対して図17(B)では、PIPEa、PIPEcのトランザクションの連続実行回数が、各々、「3」、「2」に設定されている。この場合に本実施形態では、PIPEa、PIPEa、PIPEa、PIPEb、PIPEc、PIPEc、PIPEa、PIPEa、PIPEa・・・・というように、パイプ領域のデータの自動転送が行われる。即ち、PIPEa、PIPEb、PIPEcの転送比率(パイプ転送の相対的な割合)が3対1対2に設定される。
【0140】
これにより、例えば、PIPEa、PIPEcの転送データのトータルサイズがPIPEbよりも大きい場合に、PIPEa、PIPEcのデータを効率良く転送でき、効率的なスケジューリングが可能になる。
【0141】
なお、図17(B)の場合に、PIPEaやPIPEcのデータを連続して自動転送しないようにしてもよい。即ち、例えば、PIPEa、PIPEb、PIPEc、PIPEa、PIPEc、PIPEa・・・というような順序で、データを自動転送してもよい。このようにしても、PIPEa、PIPEb、PIPEcの転送比率を3対1対2に設定できる。
【0142】
8.インタラプト転送のトークン発行周期
USBには4種類の転送手法が定義されており、その一つであるインタラプト転送は、ホストが周期的にトークンを発行することで、ペリフェラル(デバイス)のポーリングを行うという転送である。
【0143】
そして、従来のOHCI準拠のデータ転送制御装置では、インタラプト転送のトークン発行周期を設定するために、図4に示すような2分木構造のディスクリプタをファームウェアが作成する必要があった。このため、ファームウェアの処理負荷が重くなるという問題があった。
【0144】
そこで本実施形態では、インタラプト転送のトークン発行周期を例えばフレームオーダ(ms)で直接に、転送条件レジスタに設定できるようにしている。具体的には図9で説明したように、このトークン発行周期はHC用の転送条件レジスタに設定される。
【0145】
そして、ファームウェア(処理部)が、転送条件レジスタにトークン発行周期を設定すると、ホストコントローラ50(転送コントローラ)は、設定されたトークン発行周期で、インタラプト転送のトークンパケットを自動生成して、ペリフェラルに転送する。
【0146】
即ち、本実施形態では、あるエンドポイントに対する転送を、1つの転送オーダであるパイプとして管理している。そして、ファームウェアはインタラプト転送を行うパイプを決定し、そのパイプの転送条件レジスタに、トークン発行周期を直接に数値で設定する。すると、ホストコントローラ50は、そのパイプ(パイプ領域)においては、その発行周期でインタラプト転送のトークンを発行するようになる。
【0147】
例えば図18(A)では、トークン発行周期レジスタ(転送条件レジスタの1つ)に、「1」が設定されている。すると、この場合には、1フレームのインターバルで、ホストコントローラ50によりインタラプト転送のトークンパケットが自動転送される。また、図18(B)、(C)では、トークン発行周期レジスタに、「2」、「4」が設定されており、この場合には、2フレーム、4フレームのインターバルでトークンパケットが自動転送される。
【0148】
このようにすることで、インタラプト転送を実現するために図4に示すような2分木構造のディスクリプタを作成する必要がなくなり、ファームウェアの処理負荷を軽減できる。
【0149】
特に、OHCIでは、USBに多数のエンドポイントが接続されている場合にも対応できるように、図4に示すような2分木構造のディスクリプタを採用している。
【0150】
ところが、OTGでは、多くの場合、ピア・ツー・ピアの接続が予定されており、図4に示すような2分木構造のディスクリプタを用いることは、処理の無駄になる。
【0151】
本実施形態では、このような処理の無駄に着目すると共に、パイプ領域毎に転送条件レジスタが用意されることに着目して、トークン発行周期を各転送条件レジスタに直接設定できるようにしたところに特徴がある。
【0152】
9.各ブロックの詳細な構成例
次に各ブロックの詳細な構成例について説明する。
【0153】
9.1 OTGコントローラ
図19に、OTGコントローラ20の構成例を示す。
【0154】
OTGコントローラ20は、OTGレジスタ部22を含む。このOTGレジスタ部22は、OTGコントローラ20のモニタレジスタや制御レジスタを含む。またファームウェア(CPU)により書き込まれるOTGステートコマンドをデコードする回路を含む。
【0155】
またOTGコントローラ20はOTG制御回路23を含む。そして、このOTG制御回路23は、OTGステートの管理を行うOTG管理回路24、IDピンの電圧レベルを検出するID検出回路25、VBUSの電圧レベルを検出するVBUS検出回路26、DP及びDMのラインステートを検出するラインステート検出回路27を含む。
【0156】
またOTGコントローラ20は、OTGステートの遷移判断条件の1つである時間を計測するタイマ28を含む。
【0157】
OTGステートを遷移させるために検出すべき情報は、ID、VBUSの電圧レベル、DP/DMのラインステートである。本実施形態のOTGコントローラ20は、これらの情報を検出し、モニタレジスタを介してファームウェア(CPU)に伝える。
【0158】
ファームウェアは、これらの検出情報に基づいて自身のステートを遷移させると共に、次に遷移すべきステートを、OTGステートコマンドを用いてOTGコントローラ20に伝える。
【0159】
OTGコントローラ20は、OTGステートコマンドをデコードし、そのデコード結果に基づいて、VBUSのドライブ制御、プルアップ/プルダウン抵抗の接続制御等を行い、図2(A)、(B)で説明したSRPやHNPを実現する。
【0160】
このように本実施形態では、ステート毎のOTG制御はOTGコントローラ20が担当し、ファームウェアはステートの遷移管理に専念できる。この結果、全てのステート制御をファームウェアで実現する場合に比べて、ファームウェア(CPU)の処理負荷を軽減できると共に、効率的なファームウェア開発が可能になる。
【0161】
なお、OTGのステート遷移の判断を、ファームウェアが行わずに、ハードウェア回路が行うようにしてもよい。或いは、OTGコントローラ20のほとんど全ての処理(例えばVBUS制御、プルアップ/プルダウン抵抗制御、ID検出、VBUS検出、ラインステート検出以外の処理)をファームウェア(ソフトウェア)により実現してもよい。
【0162】
9.2 ホストコントローラ、ペリフェラルコントローラ
図20(A)に、ホストコントローラ50の構成例を示す。
【0163】
ホストコントローラ50はHCシーケンス管理回路52を含む。このHCシーケンス管理回路52は、パイプ転送(パイプ領域を用いたデータ転送)の調停、時間管理、パイプ転送のスケジューリング、再送管理などを行う。
【0164】
より具体的にはHCシーケンス管理回路52は、フレーム番号のカウントや、SOF(Start-Of-Frame)パケットの送信指示を行う。また、アイソクロナス転送を各フレームの先頭で優先的に実行するための処理を行ったり、インタラプト転送をアイソクロナス転送の次に優先的に取り扱うための処理を行う。また、パイプ転送の順序にしたがって各パイプ転送を指示する処理を行う。また、トランザクションの連続実行回数を管理したり、残りフレーム時間の確認処理を行う。また、ペリフェラルから返ってきたハンドシェークパケット(ACK、NAK)に対する処理を行う。また、トランザクション実行時のエラー処理を行う。
【0165】
ホストコントローラ50はターゲットパイプ管理回路54を含む。このターゲットパイプ管理回路54は、レジスタ部70の転送条件レジスタに設定された転送条件情報のハンドリング処理などを行う。
【0166】
より具体的にはターゲットパイプ管理回路54は、転送条件情報の選択処理や、割り込み信号の生成処理を行う。また自動トランザクションの開始が指示された場合に、そのパイプ領域の転送データのトータルサイズをロードする。そして、残り転送データサイズのカウント(デクリメント)処理を行う。また、バッファコントローラ80へのデータの送受信の際にバッファ(FIFO)領域の状態を確認する処理を行う。また、トランザクション管理回路56への転送指示を行う。また、予期しないショートパケットの受信の判断処理や、マックスパケットサイズ以上のパケットの受信の判断処理を行う。また、零長パケットを自動転送するモードが設定されている場合には、最後の零長パケットの送信をトランザクション管理回路56に指示する。また、自動コントロール転送モードでのシーケンス管理を行う。
【0167】
ホストコントローラ50はトランザクション管理回路56を含む。このトランザクション管理回路56は、転送パケットの種類や転送順序の管理(トランザクションのシーケンス管理)を行う。また、タイムアウトの監視処理を行う。また、トランザクション終了の通知処理を行う。
【0168】
ホストコントローラ50はパケットハンドラ回路58を含む。このパケットハンドラ回路58は、パケットの生成、分解処理を行う。また、PIDのチェックやCRCのデコード、エンコードを行う。また、バッファ領域のパケットのペイロードのリード、ライト処理や、SOFパケットの送信処理を行う。また、送受信データのカウント処理を行う。
【0169】
図20(B)にペリフェラルコントローラ60の構成例を示す。
【0170】
ペリフェラルコントローラ60は、トランザクション管理回路62、パケットハンドラ回路64を含む。これらのトランザクション管理回路62、パケットハンドラ回路64は、ホストコントローラ50のトランザクション管理回路56、パケットハンドラ回路58とほぼ同様の処理を行う。
【0171】
9.3 バッファコントローラ
図21にバッファコントローラ80の構成例を示す。
【0172】
バッファコントローラ80は領域確保(allocation)回路82を含む。この領域確保回路82は、パケットバッファ100に、バッファ領域(ホスト動作時にパイプ領域に設定され、ペリフェラル動作時にエンドポイント領域に設定される領域)を確保する回路である。
【0173】
領域確保回路82は領域計算回路83を含む。この領域計算回路83は、マックスパケットサイズ(広義にはページサイズ)やページ数に基づいて、バッファ領域の領域サイズ、スタートアドレス、エンドアドレスなどを計算する回路である。
【0174】
例えば図22(A)に示すバッファ領域PIPE0/EP0、PIPEa/EPa、PIPEb/EPb、PIPEc/EPcでは、マックスパケットサイズ(MaxPktSize)が、各々、32、64、64、64バイトに設定され、ページ数(BufferPage)が、各々、1、1、3、2ページに設定されている。領域計算回路83は、これらのマックスパケットサイズ、ページ数などに基づいて、バッファ領域PIPE0/EP0〜PIPEc/EPcの領域サイズ、スタートアドレス、エンドアドレスを計算する。例えば図22(A)において、PIPE0/EP0、PIPEa/EPa、PIPEb/EPb、PIPEc/EPcの領域サイズは、各々、32(=32×1)、64(=64×1)、192(=64×3)、128(=64×2)バイトと計算されることになる。
【0175】
ポインタ割り当て回路84は、各バッファ領域の書き込みポインタWP(WP0、WPa、WPb、WPc)、読み出しポインタRP(RP0、RPa、RPb、RPc)を、DMA用ポインタ、CPU用ポインタ、USB用ポインタに割り当てる回路である。
【0176】
例えば図22(B)に示すように、データ送信時(DMA又はCPUからパケットバッファ100を介してUSB側にデータが転送される時)であり、且つ、DMA転送使用時には、そのバッファ領域の書き込みポインタWPはDMA(DMAアクセス)用のポインタに割り当てられ、読み出しポインタRPはUSB(USBアクセス)用のポインタに割り当てられる。また、データ送信時であり且つCPU(PIO)転送使用時には、そのバッファ領域の書き込みポインタWPはCPU(CPUアクセス)用のポインタに割り当てられ、読み出しポインタRPはUSB用のポインタに割り当てられる。
【0177】
一方、図22(C)に示すように、データ受信時(USBからパケットバッファ100を介してDMA又はCPU側にデータが転送される時)であり、且つ、DMA転送使用時には、そのバッファ領域の書き込みポインタWPはUSB用ポインタに割り当てられ、読み出しポインタRPはDMA用ポインタに割り当てられる。また、データ受信時であり且つCPU転送使用時には、そのバッファ領域の書き込みポインタWPはUSB用ポインタに割り当てられ、読み出しポインタRPはCPU用ポインタに割り当てられる。
【0178】
なお、各バッファ領域の書き込みポインタWP、読み出しポインタRPのポインタ情報(位置情報)は、レジスタ部70の各転送条件レジスタ(PIPE/EPレジスタ)に保持される。
【0179】
ポインタ管理回路86は、ポインタの更新を行いながら、パケットバッファ100にアクセスするための実アドレスを生成する回路である。
【0180】
ポインタ管理回路86は、CPU用アドレス生成回路87、DMA用アドレス生成回路88、USB用アドレス生成回路89を含む。これらの生成回路87、88、89は、各々、ポインタ割り当て回路84により割り当てられたCPU用ポインタ、DMA用ポインタ、USB用ポインタに基づいて、CPU用アドレス、DMA用アドレス、USB用アドレスを生成する。また、CPU(CPUインターフェース回路)、DMA(DMAハンドラ回路)からのアクセス毎に、或いはUSB(HC又はPC)のトランザクション終了(ACK、NAKなどのハンドシェーク送受信)毎に、ポインタを更新する処理を行う。なお、更新後のポインタの情報は、領域確保回路82を介してレジスタ部70の各転送条件レジスタに書き戻される。
【0181】
バッファ管理回路90は、パケットバッファ100へのアクセスを管理する回路である。
【0182】
バッファ管理回路90はバッファインターフェース回路92を含む。このバッファインターフェース回路92は、ポインタ管理回路86からのCPU用アドレス、DMA用アドレス、USB用アドレスなどを受け、パケットバッファ100へのデータの入出力や、アドレス、出力イネーブル、ライトイネーブル、リードイネーブルなどの出力を行う。
【0183】
バッファ管理回路90は調停回路93を含む。この調停回路93は、CPU(CPUインターフェース回路)、DMA(DMAハンドラ回路)、USB(ホストコントローラ又はペリフェラルコントローラ)からのアクセスを調停する回路である。この調停結果に基づいて、CPU用アドレス、DMA用アドレス、USB用アドレスのいずれかが、パケットバッファ100のアクセス・アドレスとして出力され、CPU、DMA又はUSBとパケットバッファ100との間のデータ転送経路が設定される。
【0184】
HC/PCセレクタ94は、バッファ管理回路90(バッファコントローラ80)とホストコントローラ50(HC)又はペリフェラルコントローラ60(PC)との間の接続の切り替え制御を行う。例えばホスト動作時には、ホストコントローラ50とバッファ管理回路90を接続し、ペリフェラル動作時には、ペリフェラルコントローラ60とバッファ管理回路90を接続する。なお、この接続の切り替え制御は、OTGコントローラ20(OTGC)からのHC/PCイネーブル信号に基づいて行う。
【0185】
10.ファームウェアの処理
次に、ファームウェア(処理部)の処理の詳細例について説明する。
【0186】
図23は、ホスト動作時におけるファームウェア処理のフローチャートである。
【0187】
まず、パイプ(バッファ)領域を既に確保しているか否かを確認し(ステップS11)、確保している場合にはパイプ領域のデータクリア指示[FIFOClr]を行う(ステップS12)。
【0188】
次に、エンドポイント(転送条件)情報を転送条件レジスタにセットする(ステップS13)。即ち、エンドポイント番号[EPNumber]、ファンクションアドレス[FuncAddr]、IN/OUT/SETUPなどの転送方向[DirPID]、アイソクロナス、バルク、コントロール、インタラプトなどの転送種別[TranType]、マックスパケットサイズ[MaxPktSize]などをセットする。
【0189】
次に、転送種別[TranType]を判断し(ステップS14)、転送種別がアイソクロナスの場合にはステップS18に移行する。転送種別がインタラプト転送の場合にはトークン発行周期[Interval]を指定すると共にトグルモード[ToggleMode]を指定する(ステップS15、S16)。転送種別が、アイソクロナスでもインタラプトでもない場合(バルク、コントロールの場合)には、HCのスケジューリング[連続実行回数:Continuity]を指定する(ステップS17)。
【0190】
次に、トグルビットの初期値[Toggle]をセットし、転送データのトータルサイズ[TotalSize]をセットする(ステップS18、S19)。なお、アイソクロナス転送の場合はトグルビットの初期値のセットは不要となる。また、ステップS13〜S19の設定順序は任意である。
【0191】
次に、パイプ(バッファ)領域のページ数[BufferPage]をセットし(ステップS20)、パイプ領域確保の指示[SetAllocation]を行う(ステップS21)。
【0192】
次に、DMAを用いるか否かを判断し、用いる場合にはDMAバスの接続指示[JoinDMA]を行う(ステップS22、S23)。また、自動トランザクションの開始指示[TranGo]を行う(ステップS24)。
【0193】
そして、割り込みが発生するのを待ち(ステップS25)、正常完了、STALL返答、ハンドシェーク待ちのタイムアウト処理などを行う(ステップS26)。
【0194】
図24は、ペリフェラル動作時におけるファームウェア処理のフローチャートである。
【0195】
まず、エンドポイント(バッファ)領域のデータクリア指示[FIFOClr]を行う(ステップS31)。そして、トグルビット初期値[Toggle]をセットする(ステップS32)。
【0196】
次にエンドポイント(転送条件)情報をセットする(ステップS33)。即ち、エンドポイント番号[EPNumber]、転送方向[DirPID]、転送種別[TranType]、マックスパケットサイズ[MaxPktSize]などをセットする。
【0197】
次に、エンドポイントイネーブル指示[EnEndPoint]を行う(ステップS34)。そして、転送種別[TranType]を判断し、インタラプト転送の場合にはトグルモード[ToggleMode]を指定する(ステップS35、S36)。
【0198】
次に、エンドポイント(バッファ)領域のページ数[BufferPage]をセットし(ステップS37)、エンドポイント領域確保の指示[SetAllocation]を行う(ステップS38)。
【0199】
次に、DMAを用いるか否かを判断し、DMAを用いる場合にはDMAバスの接続指示[JoinDMA]を行う(ステップS39、S40)。
【0200】
次に、ホストからのトークン受信の持ち状態になる(ステップS41)。そして、割り込みが発生するのを待ち(ステップS42)、正常完了(ACK受信)、NAK返信、STALL返信、ハンドシェーク待ちのタイムアウト処理などを行う(ステップS43)。
【0201】
11.電子機器
次に、本実施形態のデータ転送制御装置を含む電子機器の例について説明する。
【0202】
例えば図25(A)に電子機器の1つであるプリンタの内部ブロック図を示し、図26(A)にその外観図を示す。CPU510(処理部)はシステム全体の制御などを行う。操作部511はプリンタをユーザが操作するためのものである。ROM516には、制御プログラム、フォントなどが格納され、RAM517(システムメモリ)はCPU510のワーク領域として機能する。DMAC518は、CPU510を介さずにデータ転送を行うためのDMAコントローラである。表示パネル519はプリンタの動作状態をユーザに知らせるためのものである。
【0203】
USBを介してパーソナルコンピュータ、デジタルカメラ、デジタルビデオカメラなどの他の機器から送られてきたシリアルの印刷データ(印字データ、画像データ)は、データ転送制御装置500によりパラレルの印刷データに変換される。そして、変換後のパラレル印刷データは、CPU510又はDMAC518により、印刷処理部(プリンタエンジン)512に送られる。そして、印刷処理部512においてパラレル印刷データに対して所与の処理が施され、プリントヘッダなどからなる印刷部(データの出力処理を行う装置)514により紙に印刷されて出力される。
【0204】
図25(B)に電子機器の1つであるデジタルカメラの内部ブロック図を示し、図26(B)にその外観図を示す。CPU520はシステム全体の制御などを行う。操作部521(シャッターボタン、操作ボタン等)はデジタルカメラをユーザが操作するためのものである。ROM526には制御プログラムなどが格納され、RAM527はCPU520のワーク領域として機能する。DMAC528はDMAコントローラである。
【0205】
CCD、レンズなどからなる撮像部(データの取り込み処理を行う装置)522により画像が撮像され、撮像された画像のデータは画像処理部524により処理される。そして、処理後の画像データは、CPU520又はDMAC528によりデータ転送制御装置500に送られる。データ転送制御装置500は、このパラレルの画像データをシリアルデータに変換し、USBを介してプリンタ、ストレージ装置、パーソナルコンピュータなどの他の機器に送信する。
【0206】
図25(C)に電子機器の1つであるCD−RWドライブ(ストレージ装置)の内部ブロック図を示し、図26(C)にその外観図を示す。CPU530はシステム全体の制御などを行う。操作部531はCD−RWをユーザが操作するためのものである。ROM536には制御プログラムなどが格納され、RAM537はCPU530のワーク領域として機能する。DMAC538はDMAコントローラである。
【0207】
レーザ、モータ、光学系などからなる読み取り&書き込み部(データの取り込み処理を行う装置又はデータの記憶処理を行うための装置)533によりCD−RW532から読み取られたデータは、信号処理部534に入力され、エラー訂正処理などの所与の信号処理が施される。そして、信号処理が施されたデータが、CPU530又はDMAC538によりデータ転送制御装置500に送られる。データ転送制御装置500は、このパラレルのデータをシリアルデータに変換し、USBを介して他の機器に送信する。
【0208】
一方、USBを介して他の機器から送られてきたシリアルのデータは、データ転送制御装置500によりパラレルのデータに変換される。そして、このパラレルデータは、CPU530又はDMAC538により信号処理部534に送られる。そして、信号処理部534においてこのパラレルデータに対して所与の信号処理が施され、読み取り&書き込み部533によりCD−RW532に記憶される。
【0209】
なお、図25(A)、(B)、(C)において、CPU510、520、530の他に、データ転送制御装置500でのデータ転送制御のためのCPUを別に設けるようにしてもよい。
【0210】
本実施形態のデータ転送制御装置を電子機器に用いれば、OTG機能を有する電子機器を実現できる。即ち、電子機器にホストとしての役割を持たせたり、デバイスとしての役割を持たせることが可能になり、これまでに存在しなかったアプリケーションを創出できる。
【0211】
また本実施形態のデータ転送制御装置を電子機器に用いれば、電子機器に組み込まれるCPU(処理部)の処理負荷が軽減され、安価なCPUを用いることが可能になる。また、CPUが、データ転送制御処理以外の他の処理を余裕を持って行うことが可能になり、電子機器の性能向上や低コスト化を図れる。また、CPU上で動作するファームウェアのプログラムを簡素化でき、電子機器の開発期間の短縮化を図れる。
【0212】
なお本実施形態のデータ転送制御装置を適用できる電子機器としては、上記以外にも例えば、種々の光ディスクドライブ(CD−ROM、DVD)、光磁気ディスクドライブ(MO)、ハードディスクドライブ、デジタルビデオカメラ、携帯電話、スキャナ、TV、VTR、オーディオ機器、電話機、プロジェクタ、パーソナルコンピュータ、電子手帳、或いはワードプロセッサなど種々のものを考えることができる。
【0213】
なお、本発明は本実施形態に限定されず、本発明の要旨の範囲内で種々の変形実施が可能である。
【0214】
例えば、本発明のデータ転送制御装置の構成は、図5等で説明した構成に限定されるものではなく、種々の変形実施が可能である。
【0215】
また、データ転送制御装置の各ブロック(HC、PC、OTGC等)の構成も、本実施形態で説明したものに限定されず、種々の変形実施が可能である。
【0216】
また、転送条件レジスタに設定される転送条件情報も、本実施形態で説明した情報に限定されるものではない。
【0217】
また、明細書中の記載において広義な用語(ステートコントローラ、処理部、転送コントローラ、バス、転送比率情報、バッファ領域等)として引用された用語(OTGコントローラ、CPU・ファームウェア、ホストコントローラ・ペリフェラルコントローラ、USB、連続実行回数、パイプ領域・エンドポイント領域等)は、明細書中の他の記載においても広義な用語に置き換えることができる。
【0218】
また、本発明のうち従属請求項に係る発明においては、従属先の請求項の構成要件の一部を省略する構成とすることもできる。また、本発明の1の独立請求項に係る発明の要部を、他の独立請求項に従属させることもできる。
【0219】
また、本実施形態ではUSBのOTG規格への適用例を説明したが、本発明が適用されるのはOTG規格に限定されない。例えばOTG規格と同様の思想に基づく規格やOTG規格を発展させた規格におけるデータ転送にも本発明は適用できる。
【図面の簡単な説明】
【図1】 図1(A)、(B)、(C)は、USBのOTG規格について説明するための図である。
【図2】 図2(A)、(B)は、SRPやHNPの手順について説明するための図である。
【図3】 図3(A)、(B)は、OHCIのリスト構造のディスクリプタなどについて説明するための図である。
【図4】 OHCIの2分木構造のディスクリプタについて説明するための図である。
【図5】 本実施形態のデータ転送制御装置の構成例を示す図である。
【図6】 図6(A)、(B)は、パイプ領域、エンドポイント領域について説明するための図である。
【図7】 データ転送制御装置のホスト時の動作について説明するための図である。
【図8】 データ転送制御装置のペリフェラル時の動作について説明するための図である。
【図9】 レジスタ部について説明するための図である。
【図10】 汎用転送条件レジスタのレジスタマップの詳細例である。
【図11】 コントロール転送用転送条件レジスタのレジスタマップの詳細例である。
【図12】 図12(A)、(B)は、転送条件レジスタの各ビットフィールドに設定される転送条件情報の概要について示す図である。
【図13】 転送条件レジスタの各ビットフィールドに設定される転送条件情報の概要について示す図である。
【図14】 ファームウェアの処理例を説明するためのフローチャートである。
【図15】 INトランザクションでの自動トランザクション処理の信号波形例である。
【図16】 OUTトランザクションでの自動トランザクション処理の信号波形例である。
【図17】 図17(A)、(B)は、トランザクションの連続実行回数を設定する手法について説明するための図である。
【図18】 図18(A)、(B)、(C)は、インタラプト転送のトークン発行周期を設定する手法について説明するための図である。
【図19】 OTGコントローラの詳細な構成例を示す図である。
【図20】 図20(A)、(B)は、ホストコントローラ、ペリフェラルコントローラの詳細な構成例を示す図である。
【図21】 バッファコントローラの詳細な構成例を示す図である。
【図22】 図22(A)、(B)、(C)は、領域確保手法やポインタ割り当て手法について説明するための図である。
【図23】 ホスト動作時におけるファームウェアの詳細な処理例を示すフローチャートである。
【図24】 ペリフェラル動作時におけるファームウェアの詳細な処理例を示すフローチャートである。
【図25】 図25(A)、(B)、(C)は、種々の電子機器の内部ブロック図の例である。
【図26】 図26(A)、(B)、(C)は、種々の電子機器の外観図の例である。
【符号の説明】
PIPE0〜PIPEe パイプ(バッファ)領域、
EP0〜EPe エンドポイント(バッファ)領域、
TREG0〜TREGe 転送条件レジスタ(共用レジスタ)、
10 トランシーバ、 12 物理層回路、 20 OTGコントローラ(ステートコントローラ)、 30 HC/PC切り替え回路、 32 HC/PCセレクタ、 34 ラインステートコントローラ、 40 転送コントローラ、
50 ホストコントローラ、 60 ペリフェラルコントローラ、 70 レジスタ部、 72 転送条件レジスタ部(共用レジスタ)、 80 バッファコントローラ、 100 パケットバッファ(FIFO、RAM)、 110 インターフェース回路、 112 DMAハンドラ回路、 114 CPUインターフェース回路、 120 クロックコントローラ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a data transfer control device, an electronic device, and a data transfer control method.
[0002]
[Background Art and Problems to be Solved by the Invention]
Called USB On-The-Go (OTG) by the USB Implementers Forum (USB-IF) as the market for USB (Universal Serial Bus) 2.0 supporting HS (High Speed) mode is steadily expanding An interface standard was established. The OTG standard (OTG1.0) formulated in the form of extending USB 2.0 has the potential to create new added value of the USB interface, and the appearance of applications that take advantage of its characteristics is awaited.
[0003]
According to this OTG, a peripheral (peripheral device) that has been connected to a host (personal computer or the like) via a USB can be provided with a host function. As a result, it is possible to transfer data by connecting peripherals to each other via USB. For example, it is possible to directly connect a digital camera and a printer to print an image of the digital camera. In addition, data can be stored by connecting a digital camera or digital video camera to the storage device.
[0004]
However, a peripheral having a host function by OTG generally incorporates a low-performance CPU (processing unit). Therefore, if the CPU (firmware) processing load of the peripheral becomes heavy due to the addition of the host function or the processing becomes complicated, other processing may be hindered or the device design period may be prolonged. Arise.
[0005]
The present invention has been made in view of the technical problems as described above, and an object of the present invention is to provide a data transfer control device, an electronic apparatus, and a data transfer capable of reducing the processing load of the processing unit. It is to provide a control method.
[0006]
[Means for Solving the Problems]
The present invention is a data transfer control device for data transfer via a bus, in which each pipe area is secured corresponding to each end point, and data transferred between each end point is each pipe area The buffer controller that performs access control for the packet buffer having a plurality of pipe areas stored in the memory, and transfer condition information for data transfer between each pipe area and each endpoint are set in each transfer condition register. Automatically generates a transaction for the endpoint based on the transfer condition information set in the transfer condition register and a register section that includes a plurality of transfer condition registers, and between the pipe area and the endpoint corresponding to the pipe area. Thus, the present invention relates to a data transfer control device including a transfer controller for automatically transferring data.
[0007]
In the present invention, a plurality of pipe areas (buffer areas) are allocated for the packet buffer. In this case, each pipe area is secured corresponding to each end point of the bus. Each pipe area stores (buffers) data transferred (transmitted or received) to / from each corresponding endpoint. The buffer controller performs access control (area management) of the packet buffer (buffer) in which such a pipe area is secured.
[0008]
In the present invention, transfer condition information (endpoint information, pipe information) for data transfer between each pipe area and each endpoint is set in each transfer condition register (pipe register). The transfer controller automatically generates a transaction for each endpoint based on the transfer condition information set in each transfer condition register, and automatically transfers data between each pipe area and each endpoint. Thereby, it is possible to reduce the processing load of the processing unit that controls the data transfer control device.
[0009]
In the present invention, the transfer condition information set in the transfer condition register includes a total size of data transferred to and from an endpoint, a maximum packet size, and a data transfer direction. The total size data may be automatically transferred between a pipe area and an end point corresponding to the pipe area in a direction specified by the transfer direction using a packet having a payload of the maximum packet size. Good.
[0010]
In this way, data can be automatically transferred simply by setting transfer condition information such as the total size, the maximum packet size, and the transfer direction in the transfer condition register, and the processing load on the processing unit can be reduced. .
[0011]
In the present invention, the transfer condition information set in the transfer condition register includes a transfer type of data transfer, and the transfer controller sets the data of each pipe area to the transfer type data set in each transfer condition register. Automatic transfer may be performed by transfer.
[0012]
In this way, data in each pipe area can be transferred by data transfer of an arbitrary transfer type (for example, periodic transfer such as isochronous and interrupt, aperiodic transfer such as bulk and control).
[0013]
In the present invention, the transfer condition information set in the transfer condition register includes transfer ratio information between a plurality of pipe areas, and the transfer controller sets each pipe area at a transfer ratio set by the transfer ratio information. The data may be automatically transferred.
[0014]
In this way, data in a plurality of pipe areas can be transferred at an arbitrary transfer ratio, and efficient scheduling of data transfer becomes possible.
[0015]
In the present invention, the transfer ratio information may be the number of continuous executions of transactions in each pipe area.
[0016]
In this way, for example, after the data transfer transaction of the Kth pipe area is executed (generated) continuously a plurality of times, the data transfer transaction of the (K + 1) th pipe area can be executed.
[0017]
In the present invention, the transfer condition information set in the transfer condition register includes a token issue period in interrupt transfer, and the transfer controller uses the token issue period set in the transfer condition register to generate a token packet for interrupt transfer. May be forwarded automatically.
[0018]
In this way, an interrupt transfer token packet can be issued without using a binary tree structure descriptor or the like.
[0019]
In the present invention, the pipe area may include a pipe area dedicated to the control transfer endpoint and a general-purpose pipe area that can be assigned to any endpoint.
[0020]
In this way, for example, it is possible to dynamically change the correspondence between the pipe region and the end point, thereby enabling efficient scheduling of data transfer.
[0021]
The present invention also includes an interface circuit that transfers data between another bus different from the bus and the packet buffer, and the processing unit instructs the interface circuit and the transfer controller to start data transfer. When the interface circuit performs data transfer via another bus, the transfer controller performs data transfer via the bus, and when the data transfer is completed, the transfer controller May generate an interrupt.
[0022]
In this way, the processing unit sets a transfer condition and issues an interrupt after instructing the start of data transfer via the bus and other buses (such as the processing unit bus or the system memory bus). Until then, the control of the data transfer control device is not necessary. Thereby, the processing load of the processing unit can be reduced.
[0023]
Further, the present invention includes a state controller that controls a plurality of states including a host operation state that operates as a host role and a peripheral operation state that operates as a peripheral role. A host controller that performs data transfer as a host and a peripheral controller that performs data transfer as a peripheral during a peripheral operation, and a plurality of pipe areas are secured for a packet buffer during the host operation. The controller may automatically transfer data between the reserved pipe area and the endpoint corresponding to the pipe area.
[0024]
According to the present invention, for example, when the state controlled by the state controller becomes the host operation state, the host controller performs data transfer as the role of the host. When the state controlled by the state controller becomes a peripheral operation state, the peripheral controller performs data transfer as a role of the peripheral. As a result, a so-called dual-role device function can be realized.
[0025]
In the present invention, during host operation, a plurality of pipe areas are reserved for the packet buffer, and data is automatically transferred between the reserved pipe areas and the endpoints. As a result, a dual-role device function can be realized, and the processing load on the processing unit during host operation can be reduced.
[0026]
In the present invention, data transfer conforming to the USB (Universal Serial Bus) OTG (On-The-Go) standard may be performed.
[0027]
According to another aspect of the present invention, there is provided a data transfer control device according to any one of the above, an apparatus that performs an output process, a capture process, or a storage process of data transferred via the data transfer control apparatus and a bus, and the data transfer control apparatus. The present invention relates to an electronic device including a processing unit that controls data transfer.
[0028]
The present invention is also a data transfer control method for data transfer via a bus, wherein a plurality of pipe areas in which data transferred to and from each end point is stored in each pipe area are provided in a packet buffer. And transfer condition information for data transfer between each pipe area and each endpoint is set in each transfer condition register of a plurality of transfer condition registers, and based on the transfer condition information set in the transfer condition register The present invention relates to a data transfer control method for automatically generating a transaction for an endpoint and automatically transferring data between a pipe area and an endpoint corresponding to the pipe area.
[0029]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, this embodiment will be described.
[0030]
In addition, this embodiment demonstrated below does not unduly limit the content of this invention described in the claim. Further, not all of the configurations described in the present embodiment are essential as a solution means of the present invention.
[0031]
1. OTG
First, OTG (USB On-The-Go) will be briefly described.
[0032]
1.1 A device, B device
In OTG, a Mini-A plug and a Mini-B plug as shown in FIG. 1A are defined as connector standards. A Mini-AB receptacle is defined as a connector that can connect both the Mini-A plug and the Mini-B plug (first and second plugs of the cable in a broad sense).
[0033]
For example, as shown in FIG. 1B, when the electronic device P is connected to the Mini-A plug of the USB cable and the electronic device Q is connected to the Mini-B plug, the electronic device P is set to the A device, The electronic device Q is set as the B device. On the other hand, as shown in FIG. 1C, when the Mini-B plug and Mini-A plug are connected to the electronic devices P and Q, the electronic devices P and Q are set to the B device and the A device, respectively. The
[0034]
In the Mini-A plug, the ID pin is connected to GND, and in the Mini-B plug, the ID pin is in a floating state. The electronic device detects whether it is connected to the Mini-A plug or the Mini-B plug by detecting the voltage level of this ID pin using the built-in pull-up resistor circuit. To do.
[0035]
In OTG, the A device (master) is the side (supplier) that supplies power (VBUS), and the B device (slave) is the side that receives power (supplier). The default state of the A device is a host, and the default state of the B device is a peripheral (peripheral device).
[0036]
1.2 Dual-role device
In OTG, a dual-role device is defined which can have both a role as a host (simple host) and a role as a peripheral.
[0037]
Dual-role devices can be either hosts or peripherals. When the partner connected to the dual-role device is a host or peripheral in the conventional USB standard, the role of the dual-role device is uniquely determined. That is, if the connection partner is a host, the dual-role device becomes a peripheral, and if the connection partner is a peripheral, the dual-role device becomes a host.
[0038]
On the other hand, if the connection partner is a dual-role device, both dual-role devices can exchange host and peripheral roles with each other.
[0039]
1.3 SRP, HNP
The dual-role device has functions of a session start request procedure SRP (Session Request Protocol) and a host exchange procedure HNP (Host Negotiation Protocol) as shown in FIGS.
[0040]
Here, the session start request procedure SRP is a protocol in which the B device requests the A device to supply VBUS (power).
[0041]
In the case of not using the bus, in the OTG, the A device can stop supplying the VBUS. Thereby, when the A device is, for example, a small portable device, wasteful power consumption can be prevented. Then, when the B device wants the V device to supply the VBUS after the A device stops supplying the VBUS, this SRP is used to request the A device to resume the supply of the VBUS.
[0042]
FIG. 2A shows the flow of SRP. As shown in FIG. 2A, the B device requests the A device to supply VBUS by performing data line pulsing and VBUS pulsing. Then, after the supply of VBUS by the A device, the peripheral operation of the B device (peripheral operation) and the host operation of the A device (host operation) start.
[0043]
As described in FIGS. 1 (A) to 1 (C), in the connection between dual-role devices, the A device on the side to which the Mini-A plug is connected becomes the default host, and the Mini-B plug is The connected B device becomes the default peripheral. In OTG, the roles of the host and the peripheral can be exchanged without plugging and unplugging. HNP is a protocol for exchanging the roles of this host and peripheral.
[0044]
The flow of HNP is shown in FIG. When the A device operating as the default host finishes using the bus, the bus becomes idle. After that, when the B device disables the pull-up resistor of the data signal line DP (D +), the A device enables the DP pull-up resistor. As a result, the role of the A device is changed from the host to the peripheral, and the operation as the peripheral is started. In addition, the role of the B device is changed from the peripheral to the host, and the operation as the host is started.
[0045]
After that, when the B device finishes using the bus and the A device disables the DP pull-up resistor, the B device enables the DP pull-up resistor. Thereby, the role of the B device returns from the host to the peripheral, and the operation as the peripheral is resumed. Also, the role of the A device returns from the peripheral to the host and resumes the operation as the host.
[0046]
According to the OTG described above, a portable device such as a cellular phone or a digital camera can be operated as a USB host, and data can be transferred by connecting the portable devices with each other in a peer-to-peer manner. As a result, a new added value can be created in the USB interface, and an application that has not existed before can be created.
[0047]
2. OHCI
In the conventional USB, the data transfer control device (host controller) of the personal computer that is the host complies with standards such as OHCI (Open Host Controller Interface) and UHCI (Universal Host Controller Interface) proposed by Microsoft. It was. Also, the OS (Operating System) used is limited to Microsoft Windows and Apple Macintosh OS.
[0048]
However, in a small portable device that is a target application of OTG, the architecture of the CPU to be incorporated and the OS used are various. Furthermore, OHCI and UHCI standardized for personal computer host controllers are premised on the full implementation of USB host functions, and are not optimal for mounting on small portable devices.
[0049]
For example, FIG. 3A shows an example of a descriptor having a list structure used in OHCI.
[0050]
In FIG. 3A, endpoint descriptors ED1, ED2, and ED3 are linked by link pointers, and contain information necessary for communication with endpoints 1, 2, and 3. The transfer descriptors TD11 to TD13, TD21, and TD31 to TD32 are further linked to these ED1, ED2, and ED3 by link pointers. These transfer descriptors include information necessary for packet data transferred between the end points 1, 2, and 3.
[0051]
The descriptor having the list structure in FIG. 3A is created by firmware (host controller / driver) operating on the CPU 610 (processor in a broad sense) in FIG. 3B and written in the system memory 620. That is, the firmware assigns endpoint descriptors to endpoints in the system, and creates endpoint descriptors and transfer descriptors based on endpoint information and the like. These descriptors are linked by a link pointer and written to the system memory 620.
[0052]
The data transfer control device 600 (host controller) reads the descriptor having the list structure written in the system memory 620, and executes data transfer based on the information described in the endpoint descriptor and the transfer descriptor.
[0053]
Specifically, the data transfer control device 600 (host controller) sets information on the endpoint 1 based on ED1, and performs data transfer with the endpoint 1 based on TD11 linked to ED1. . Next, the information of the endpoint 2 is set based on the ED2, and the data is transferred to the endpoint 2 based on the TD21 linked to the ED2. Similarly, the data transfer control device 600 executes data transfer based on TD31, TD12, TD32, and TD13.
[0054]
When interrupt transfer is performed, the firmware (host controller / driver) operating on the CPU 610 creates a binary tree structure descriptor as shown in FIG. For example, for an endpoint that performs interrupt transfer polling every 1 ms, the descriptor is set in a placeholder 700 in FIG. Similarly, for an endpoint that polls every 2 ms, its descriptor is set in placeholders 701 and 702, and for an end pointer that polls every 4 ms, it is set in placeholders 703, 704, 705, and 706.
[0055]
When polling is performed, a binary tree search is sequentially performed from the placeholder of the lowest layer according to the index of the interrupt head pointer. That is, as shown by a path 710 in FIG. 4, first, a binary tree search is performed for the index 0 from the lowest layer. Next, as shown in the path 711, a binary tree search is performed for the index 1. Similarly, a binary tree search is performed for indexes 2 to 31. As a result, the endpoint corresponding to the placeholder 700 is interrupted every 1 ms (one frame), the endpoint corresponding to 701 and 702 is interrupted every 2 ms, and the endpoint corresponding to 703 to 706 is interrupted every 4 ms. Will be done.
[0056]
As described above, in the OHCI-compliant data transfer control device (host controller), the firmware (host controller / driver) operating on the CPU creates a descriptor having a complicated structure as shown in FIGS. Must be created. Therefore, the processing load on the CPU is very heavy.
[0057]
In this case, in the conventional USB, only a personal computer is assigned the host role, and this personal computer has a high-performance CPU. Accordingly, it is possible to create a descriptor having a complicated structure as shown in FIGS. 3A and 4 with a margin.
[0058]
However, a CPU (embedded CPU) incorporated in a small portable device (digital camera, mobile phone, etc.), which is an OTG target application, generally has a significantly lower performance than a personal computer CPU. Accordingly, if the OTG host operation is performed in the portable device, an excessive load is applied to the CPU incorporated in the portable device, which causes problems such as troubles in other processes and a decrease in data transfer performance.
[0059]
3. Configuration example
FIG. 5 shows a configuration example of the data transfer control device of this embodiment that can solve the above-described problems. Note that the data transfer control device of this embodiment does not need to include all the circuit blocks in FIG. 5, and some of the circuit blocks may be omitted.
[0060]
The transceiver 10 (hereinafter referred to as Xcvr as appropriate) is a circuit that transmits and receives USB (bus in a broad sense) data using differential data signals DP and DM, and includes a USB physical layer (PHY) circuit 12. More specifically, the transceiver 10 generates DP and DM line states (J, K, SE0, etc.), serial / parallel conversion, parallel / serial conversion, bit stuffing, bit unstuffing, NRZI decoding, NRZI encoding, and the like. Do. The transceiver 10 may be provided outside the data transfer control device.
[0061]
The OTG controller 20 (state controller in a broad sense, hereinafter referred to as OTGC as appropriate) performs various processes for realizing the STG function and the HNP function (see FIGS. 2A and 2B) of the OTG. That is, the OTG controller 20 controls a plurality of states including a host operation state operating as a host role and a peripheral operation state operating as a peripheral role.
[0062]
More specifically, the OTG standard defines a state transition at the time of the A device of the dual role device (see FIGS. 1B and 1C) and a state transition at the time of the B device. The OTG controller 20 includes a state machine for realizing these state transitions. The OTG controller 20 includes a circuit that detects (monitors) the USB data line state, the VBUS level, and the ID pin state. The state machine included in the OTG controller 20 changes its state (for example, a state such as a host, peripheral, suspend, or idle) based on the detection information. The state transition in this case may be realized by a hardware circuit, or may be realized by the firmware setting a state command in a register. When the state transitions, the OTG controller 20 controls VBUS or controls connection / disconnection of the pull-up / pull-down resistors DP and DM based on the state after the transition. It also controls enable / disable of the host controller 50 (hereinafter referred to as HC as appropriate) and the peripheral controller 60 (hereinafter referred to as PC as appropriate).
[0063]
The HC / PC switching circuit 30 (HC / PC / common circuit) controls switching of connection between the transceiver 10 and the host controller 50 or the peripheral controller 60. Also, the transceiver 10 is instructed to generate a line state of USB data (DP, DM). The connection switching control is realized by the HC / PC selector 32, and the line state generation instruction is realized by the line state controller.
[0064]
For example, when the OTG controller 20 activates the HC enable signal during host operation (in the host state), the HC / PC switching circuit 30 (HC / PC selector 32) connects the transceiver 10 and the host controller 50. On the other hand, when the OTG controller 20 activates the PC enable signal during the peripheral operation (in the peripheral state), the HC / PC switching circuit 30 connects the transceiver 10 and the peripheral controller 60. By doing so, the host controller 50 and the peripheral controller 60 can be operated exclusively.
[0065]
The transfer controller 40 is a circuit that controls data transfer via a USB (bus in a broad sense), and includes a host controller 50 (HC) and a peripheral controller 60 (PC).
[0066]
Here, the host controller 50 is a circuit that performs data transfer control as the role of the host when the host is operating (when the HC enable signal from the OTG controller 20 is active).
[0067]
That is, the host controller 50 is connected to the transceiver 10 by the HC / PC switching circuit 30 during host operation. Then, the host controller 50 automatically generates a transaction for the endpoint based on the transfer condition information set in the transfer condition register unit 72 of the register unit 70. Then, automatic transfer (processing) of data (packets) between the pipe area (PIPE0 to PIPEe, hereinafter referred to as PIPE as appropriate) allocated in the packet buffer 100 and an endpoint corresponding to the pipe area. Data transfer by a hardware circuit without intervening parts).
[0068]
More specifically, the host controller 50 performs arbitration between a plurality of pipe transfers, frame time management, transfer scheduling, retransmission management, and the like. Also, transfer condition information (operation information) for pipe transfer is managed via the register unit 70. It also manages transactions, generates / disassembles packets, and instructs suspend / resume / reset state generation.
[0069]
On the other hand, the peripheral controller 60 is a circuit that performs data transfer control as a role of the peripheral during the peripheral operation (when the PC enable signal from the OTG controller 20 is active).
[0070]
That is, the peripheral controller 60 is connected to the transceiver 10 by the HC / PC switching circuit 30 during the peripheral operation. Then, based on the transfer condition information set in the transfer condition register unit 72 of the register unit 70, data is transferred between the endpoint area (EP0 to EPe, hereinafter referred to as EP as appropriate) reserved in the packet buffer 100 and the host. Forward.
[0071]
More specifically, the peripheral controller 60 manages the transfer condition information (operation information) for endpoint transfer via the register unit 70. It also manages transactions, generates / disassembles packets, and gives instructions for generating remote wakeup signals.
[0072]
An end point is a point (part) on a peripheral (device) to which a unique address can be assigned. All data transfer between the host and the peripheral (device) is performed via this endpoint. The transaction is composed of a token packet, an optional data packet, and an optional handshake packet.
[0073]
The register unit 70 includes various registers for performing data transfer (pipe transfer, endpoint transfer) control, buffer access control, buffer management, interrupt control, block control, or DMA control. Note that the register included in the register unit 70 may be realized by a memory such as a RAM or a D flip-flop. In addition, the registers of the register unit 70 may be distributed in each block (HC, PC, OTGC, Xcvr, etc.) instead of being combined into one.
[0074]
The register unit 70 includes a transfer condition register unit 72. The transfer condition register unit 72 stores transfer condition information (transfer control information) for data transfer between the pipe area (PIPE0 to PIPEe) secured in the packet buffer 100 during host operation and the end point. including. Each of these transfer condition registers is provided corresponding to each pipe area of the packet buffer 100.
[0075]
During the peripheral operation, the endpoint area (EP0 to EPe) is secured in the packet buffer 100. Based on the transfer condition information set in the transfer condition register unit 72, data transfer is performed between the data transfer control device and the host.
[0076]
The buffer controller 80 (FIFO manager) performs access (read / write) control and area management for the packet buffer 100. More specifically, it generates and manages an access address to the packet buffer 100 by a CPU (processing unit in a broad sense), DMA (Direct Memory Access), and USB. Also, arbitration of access to the packet buffer 100 by the CPU, DMA, and USB is performed.
[0077]
For example, during host operation, the buffer controller 80 sets a data transfer path between the interface circuit 110 (CPU or DMA) and the packet buffer 100 and a data transfer path between the packet buffer 100 and the host controller 50 (USB) ( Establish.
[0078]
On the other hand, during the peripheral operation, the buffer controller 80 sets a data transfer path between the interface circuit 110 (CPU or DMA) and the packet buffer 100 and a data transfer path between the packet buffer 100 and the peripheral controller 60 (USB). .
[0079]
The packet buffer 100 (FIFO, packet memory, buffer) temporarily stores (buffers) data (transmission data or reception data) transferred via the USB. The packet buffer 100 can be composed of, for example, a RAM (Random Access Memory). The packet buffer 100 may be provided outside the data transfer control device (may be an external memory).
[0080]
During host operation, the packet buffer 100 is used as a pipe transfer FIFO (First-In First-Out). That is, in the packet buffer 100, pipe areas PIPE0 to PIPEe (buffer areas in a broad sense) are secured so as to correspond to the respective endpoints of the USB (bus). In each of the pipe areas PIPE0 to PIPEe, data (transmission data or reception data) transferred between the corresponding endpoints is stored.
[0081]
On the other hand, during the peripheral operation, the packet buffer 100 is used as a FIFO for endpoint transfer. That is, endpoint areas EP0 to EPe (buffer areas in a broad sense) are secured in the packet buffer 100. Each endpoint area EP0 to EPe stores data (transmission data or reception data) transferred with the host.
[0082]
Note that the buffer area secured in the packet buffer 100 (the area set in the pipe area during the host operation and the end point area during the peripheral operation) is stored such that the previously input information is output first. It is set in the area (FIFO area).
[0083]
PIPE0 is a pipe area dedicated to the control transfer endpoint 0, and PIPEa to PIPEe are general-purpose pipe areas that can be assigned to any endpoint.
[0084]
That is, in USB, the end point 0 is set as an end point dedicated for control transfer. Therefore, it is possible to prevent the user from being confused by making PIPE0 a pipe area dedicated for control transfer as in this embodiment. Also, by making PIPEa to PIPEe pipe areas that can be assigned to arbitrary endpoints, the pipe areas corresponding to the endpoints can be dynamically changed. As a result, the degree of freedom of scheduling for pipe transfer can be improved and the efficiency of data transfer can be improved.
[0085]
In this embodiment, the buffer area (pipe area or endpoint area) is set by the maximum packet size MaxPktSize (page size in a broad sense) and the number of pages BufferPage (RSize = MaxPktSize × BufferPage). . In this way, the area size and the number of pages (number of pages) of the buffer area can be arbitrarily set, and the resources of the packet buffer 100 can be effectively used.
[0086]
The interface circuit 110 is a circuit for transferring data between a DMA (system memory) bus or CPU bus, which is another bus different from USB, and the packet buffer 100. The interface circuit 110 includes a DMA handler circuit 112 for performing DMA transfer between the packet buffer 100 and an external system memory. Also included is a CPU interface circuit 114 for performing PIO (Parallel I / O) transfer between the packet buffer 100 and an external CPU. Note that a CPU (processing unit) may be incorporated in the data transfer control device.
[0087]
The clock controller 120 generates various clocks used inside the data transfer control device based on a built-in PLL or an external input clock.
[0088]
4). Pipe area
In this embodiment, as shown in FIG. 6A, pipe areas PIPE0 to PIPEe are allocated in the packet buffer 100 during host operation. Data is transferred between each of the pipe areas PIPE0 to PIPEe and each end point of the peripheral.
[0089]
Here, the “pipe” in the pipe area of this embodiment is a “pipe” defined by USB (a logical abstraction representing a relationship between an endpoint on a device and software on a host, a logical Route) is slightly different in meaning.
[0090]
As shown in FIG. 6A, the pipe area according to the present embodiment is secured on the packet buffer 100 in correspondence with each endpoint included in the peripheral connected to the USB (bus). For example, in FIG. 6A, the pipe region PIPEa corresponds to the end point 1 (bulk IN) of the peripheral 1, and PIPEb corresponds to the end point 2 (bulk OUT) of the peripheral 1. PIPEc corresponds to the end point 1 (bulk IN) of the peripheral 2, and PIPEd corresponds to the end point 2 (bulk OUT) of the peripheral 2. PIPEe corresponds to the end point 1 (interrupt IN) of the peripheral 3. Note that PIPE0 is a pipe area dedicated to the end point 0 of the control transfer.
[0091]
In the example of FIG. 6A, USB bulk IN transfer is performed between the pipe area PIPEa and the end point 1 of the peripheral 1, and bulk OUT transfer is performed between the PIPEb and the end point 2 of the peripheral 1. Is called. Also, bulk IN transfer is performed between PIPEc and the end point 1 of the peripheral 2, and bulk OUT transfer is performed between the PIPEd and the end point 2 of the peripheral 2. Further, interrupt IN transfer is performed between PIPEe and the end point 1 of the peripheral 3.
[0092]
As described above, in the present embodiment, arbitrary data transfer (isochronous transfer, bulk transfer, interrupt transfer) can be performed between a pipe area (general-purpose) and the corresponding endpoint.
[0093]
In this embodiment, data in a given data unit (a data unit specified by the total size) is transferred between the pipe area and the corresponding endpoint. As a data unit in this case, for example, a data unit requested to be transferred by an IRP (I / O request packet) or a data unit obtained by dividing the data unit into an appropriate size can be considered. This data unit data transfer (a series of transactions) to the endpoint can be called a “pipe” in the present embodiment. An area for storing such “pipe” data (transmission data, reception data) is a pipe area.
[0094]
When the transfer of a given data unit using the pipe area is completed, the pipe area can be released. The released pipe area can be assigned to an arbitrary endpoint. As described above, in this embodiment, the association between the pipe region and the end point can be dynamically changed.
[0095]
In the present embodiment, as shown in FIG. 6B, the endpoint areas EP0 to EPe are secured (set) in the packet buffer 100 during the peripheral operation. Data is transferred between the endpoint areas EP0 to EPe and the host (host controller, system memory).
[0096]
As described above, in this embodiment, the buffer area of the packet buffer 100 is assigned to the pipe area during the host operation, and is assigned to the endpoint area during the peripheral operation. As a result, the resources of the packet buffer 100 can be shared (shared) during the host operation and the peripheral operation, and the used storage capacity of the packet buffer 100 can be saved.
[0097]
The number of pipe regions and endpoint regions is not limited to six and is arbitrary.
[0098]
5. Transfer condition register (shared register)
In the present embodiment, as shown in FIG. 7, during host operation, transfer condition information for data transfer performed between the pipe areas PIPE0 to PIPEe and the endpoint is set in the transfer condition registers TREG0 to TREGe. That is, the transfer condition information of PIPE0, PIPEa, PIPEb, PIPEc, PIPEd, and PIPEe is set (stored) in TREG0, TREGa, TREGb, TREGc, TREGd, and TREGe, respectively. This setting is performed by, for example, firmware (CPU).
[0099]
The host controller 50 (transfer controller in a broad sense) generates a transaction for the endpoint based on the transfer condition information set in the transfer condition registers TREG0 to TREGe. Then, data (packets) is automatically transferred between the pipe area and the corresponding endpoint.
[0100]
As described above, in this embodiment, each transfer condition register is provided corresponding to each pipe area (buffer area). Based on the transfer condition information set in each transfer condition register, the pipe transfer ( Transfer of a given data unit) is automatically performed by the host controller 50. Therefore, after setting the transfer condition information in the transfer condition register, the firmware (driver, software) does not need to be involved in the data transfer control until the data transfer is completed. When the pipe transfer of a given data unit is completed, an interrupt is generated and the completion of the transfer is transmitted to the firmware. Thereby, the processing load of the firmware (CPU) can be significantly reduced.
[0101]
In the present embodiment, as shown in FIG. 8, during the peripheral operation, transfer condition information for data transfer performed between the endpoint areas EP0 to EPe and the host is set in the transfer condition registers TREG0 to TREGe. The peripheral controller 60 (transfer controller in a broad sense) performs data transfer between the endpoint area and the host based on the transfer condition information set in the transfer condition registers TREG0 to TREGe.
[0102]
As described above, in the present embodiment, the transfer condition registers TREG0 to TREGe are shared (shared) by the host operation and the peripheral operation. Thereby, the resource of the register unit 70 can be saved, and the data transfer control device can be reduced in size.
[0103]
FIG. 9 shows a register configuration example of the register unit 70. A part of the register of the register unit 70 may be included in each block (OTGC, HC, PC, Xcvr, etc.).
[0104]
As shown in FIG. 9, the transfer condition registers (TREG0 to TREGe) of the register unit 70 are HC / PC shared registers (HC, PIPE) and HC / PC shared registers (PC, EP) shared during the peripheral operation (PC, EP). Shared transfer condition register). It also includes an HC (PIPE) register (host transfer condition register) that is used only during host operation. It also includes a PC (EP) register (peripheral transfer condition register) used only during the peripheral operation. Further, it is a register for performing access control of the packet buffer (FIFO) and the like, and includes an access control register shared during host operation and peripheral operation.
[0105]
For example, during host operation of the dual role device, the host controller 50 (HC) transfers data (packets) based on transfer condition information set in the HC / PC shared register and the HC register.
[0106]
On the other hand, during the peripheral operation, the peripheral controller 60 (PC) transfers data (packets) based on transfer condition information set in the HC / PC shared register and the PC register.
[0107]
In both the host operation and the peripheral operation, the buffer controller 80 controls access to the packet buffer 100 (read / write address generation, data read / write, access access) based on the shared access control register. Mediation).
[0108]
The HC / PC shared register in FIG. 9 includes data transfer direction (IN, OUT, SETUP, etc.), transfer type (type of transaction such as isochronous, bulk, interrupt, control, etc.), endpoint number (end of each USB device) The number associated with the point) and the maximum packet size (maximum payload size of the packet that can be transmitted or received by the endpoint, page size) are set. In addition, the number of pages (the number of buffer areas) in the buffer area (pipe area, endpoint area) is set. Information indicating whether or not there is a DMA connection (whether or not DMA transfer is used by the DMA handler circuit 112 in FIG. 5) is set.
[0109]
In the HC (PIPE) register, a token issuing period (interrupt transaction start period, interval) for interrupt transfer is set. In addition, the number of continuous executions of a transaction (information for setting a transfer ratio between pipe areas. The number of continuous executions of transactions in each pipe area) is set. In addition, a function address (USB address of a function having an end point) and a total size of transfer data (total size of data transferred through each pipe area, data unit such as IRP) are set. In addition, an automatic transaction start instruction (an instruction to start automatic transaction processing for the host controller) is set. Also, an instruction for an automatic control transfer mode (an instruction for a mode for automatically generating a control transfer setup stage, data stage, and status stage transaction) is set.
[0110]
In the PC (EP) register, endpoint enable (endpoint enable / disable instruction) and handshake designation (handshake designation performed in each transaction) are set.
[0111]
In the shared access control register for the packet buffer (FIFO), a buffer I / O port (I / O port when PIO transfer is performed by the CPU) is set. Also, buffer full / empty (full notification of each buffer area, notification of empty) and buffer / remaining data size (remaining data size of each buffer area) are set.
[0112]
The register unit 70 includes an interrupt system register, a block system register, a DMA control register, and the like.
[0113]
The interrupt system registers include an interrupt status register for indicating an interrupt status (factor) to the CPU, and an interrupt enable register for setting interrupt enable / disable (non-mask, mask). The interrupt includes interrupts of the OTG controller 20 system, the host controller 50 system, and the peripheral controller 60 system.
[0114]
The block system register includes an inter-block shared register shared between blocks and a block register used in each block (Xcvr, OTGC, HC, PC).
[0115]
The inter-block shared register includes a register that instructs resetting of each block. The block register includes a register for controlling the transceiver 10 (Xcvr), a state command register of the OTG controller 20 (OTGC), a state command register of the host controller 50 (HC), a register for setting a frame number, etc. There is.
[0116]
As described above, in this embodiment, the register unit 70 is provided with a register (HC / PC shared register, shared access control register) shared during host operation and peripheral operation. This makes it possible to reduce the size of the register unit 70 as compared to the case where the register for host operation and the register for peripheral operation are provided completely separately. Further, the access address of the shared register viewed from the firmware (driver) operating on the CPU can be the same during the host operation and during the peripheral operation. Therefore, the firmware can manage these shared registers with the same address, and the firmware processing can be simplified.
[0117]
Also, by providing an HC register or a PC register, transfer conditions specific to host operation (PIPE) transfer and peripheral operation (EP) transfer can be set. For example, by setting the token issue cycle, it is possible to issue interrupt transfer tokens at a desired cycle during host operation without using the method described in FIG. Also, by setting the number of continuous executions, the transfer ratio between pipe areas can be arbitrarily set during host operation. Also, by setting the total size, it is possible to arbitrarily set the size of data that is automatically transferred through the pipe area during host operation. In addition, the firmware can instruct the start of an automatic transaction or the on / off of the automatic control transfer mode during host operation.
[0118]
FIG. 10 shows a detailed example of a register map of general-purpose transfer condition (PIPE / EP) registers TREGa to TREGe (TREGx: x = a to e), and FIG. 11 shows a transfer condition register TREG0 for control transfer. The detailed example of a register map is shown. 12A, 12B, and 13 show transfer condition information (JoinDMA, FIFOClr, ToggleMode, AutoZeroLen, BufferPage, DirPID, TranType, EPNumber, MaxPktSize) set in each bit field of these transfer condition registers. Etc.) is shown.
[0119]
For example, in FIG. 10, the access addresses 0x0, 0x1,0x2, and 0x3 of the shared registers xConfig_0, xConfig_1, xMaxPktSize_H, and xMaxPktSize_L are the same during the host operation and the peripheral operation. The same information is set in these registers by the firmware during the host operation and the peripheral operation.
[0120]
6). Automatic transaction
FIG. 14 shows an example of a flowchart of firmware processing at the time of automatic transaction (IN, OUT) processing of the host controller 50.
[0121]
First, the firmware (processing unit, driver) sets transfer condition information (pipe information) in the transfer condition register described with reference to FIG. 9 and the like (step S1). More specifically, the total size of transfer data, the maximum packet size (MaxPktSize), the number of pages (BufferPage), the transfer direction (IN, OUT or SETUP), the transfer type (isochronous, bulk, control, interrupt), the endpoint number The number of consecutive executions (transfer ratio) of the transactions in the pipe area, the interrupt issue token issuing period, and the like are set in the transfer condition register.
[0122]
Next, a transfer path is set between the external system memory and the packet buffer 100 (step S2). That is, a DMA transfer path through the DMA handler circuit 112 in FIG. 5 is set.
[0123]
Next, the firmware issues a DMA transfer start instruction (step S3). That is, the DMA transfer start instruction bit of the DMA control register of FIG. 9 is made active. In the transfer by the CPU, the packet buffer 100 can be accessed by accessing the buffer / I / O port of FIG.
[0124]
Next, the firmware gives an instruction to start an automatic transaction (step S4). That is, the automatic transaction start instruction bit of the HC register (pipe register) in FIG. 9 is activated. Thus, automatic transaction processing, packet processing (packet generation and decomposition), and scheduling processing are performed by the host controller 50. That is, the host controller 50 automatically transfers the data designated by the total size in the direction (IN, OUT) designated by the transfer direction, using the packet of the maximum packet size payload.
[0125]
Note that the order of processing in steps S3 and S4 is not limited, and a DMA transfer start instruction may be issued after an automatic transaction start instruction.
[0126]
Next, the firmware waits for an interrupt to notify completion of pipe transfer (step S5). When an interrupt occurs, the firmware checks the interrupt status (factor) of the interrupt register in FIG. Then, the process is completed normally or ends with an error (step S6).
[0127]
Thus, according to the present embodiment, the firmware sets transfer condition information for each pipe area (step S1), and issues a DMA transfer start instruction (step S3) and an automatic transaction start instruction (step S4). Thus, the subsequent data transfer processing is automatically performed by the hardware circuit of the host controller 50. Therefore, compared with the OHCI-compliant method described in FIGS. 3A, 3B, and 4, a data transfer control device optimal for a portable device in which the processing load of firmware is reduced and a low-performance CPU is incorporated. Can be provided.
[0128]
15 and 16 show examples of signal waveforms during automatic transaction processing by the host controller 50. FIG. In these drawings, “H → P” represents “a packet is transferred from the host to the peripheral”, and “P → H” represents “a packet is transferred from the peripheral to the host”.
[0129]
FIG. 15 shows an example of a signal waveform in the case of an IN transaction (when the transfer type is IN).
[0130]
When the firmware instructs to start an automatic transaction in step S4 in FIG. 14, PipeXTranGo (transfer request signal from the firmware for PipeX) becomes active as indicated by C1 in FIG. As a result, automatic transaction processing by the host controller 50 for the PipeX (X = 0 to e) is started.
[0131]
When PipeTranGo (transfer request signal from the HC sequence management circuit in the host controller 50) becomes active as shown at C2, the host controller 50 generates an IN token packet as shown at C3, via USB. To the peripheral. When the IN data packet is transferred from the peripheral to the host controller 50 as indicated by C4, the host controller 50 generates a handshake packet (ACK) as indicated by C5 and transfers it to the peripheral. As a result, TranCmpACK becomes active as indicated by C6.
[0132]
Similarly, when PipeTranGo becomes active as indicated by C7, packet transfer indicated by C8, C9, and C10 is performed, and TranCmpACK becomes active as indicated by C11. Then, as shown in C12, PipeXTranComp (transfer end notification signal of IRP data unit to firmware) becomes active. By this interruption by PipeXTranComp, the firmware can know that the transfer for the pipe has been completed.
[0133]
When PipeXTranComp becomes active, PipeXTranGo becomes inactive as indicated by C13, indicating that the pipe is in a non-transfer state.
[0134]
FIG. 16 is a signal waveform example in the case of an OUT transaction (when the transfer type is OUT).
[0135]
When the firmware gives an instruction to start an automatic transaction, PipeXTranGo becomes active as indicated by E1, and PipeTranGo becomes active as indicated by E2. Then, the host controller 50 transfers the OUT token packet to the peripheral as indicated by E3, and transfers the OUT data packet as indicated by E4. When a handshake packet (ACK) is returned from the peripheral as indicated by E5, TranCmpACK becomes active as indicated by E6.
[0136]
Similarly, when PipeTranGo becomes active as indicated by E7, packet transfer indicated by E8, E9 and E10 is performed, and TranCmpACK becomes active as indicated by E11. Then, PipeXTranComp becomes active as indicated by E12. By this interruption by PipeXTranComp, the firmware can know that the transfer for the pipe has been completed. When PipeXTranComp becomes active, PipeXTranGo becomes inactive as indicated by E13.
[0137]
7). Number of consecutive transaction executions
In this embodiment, the number of continuous executions of transactions (pipe transfer) (transfer ratio information between a plurality of pipe areas in a broad sense) can be set in the transfer condition register. Specifically, as described with reference to FIG. 9, the number of continuous executions is set in the transfer condition register for HC.
[0138]
For example, in FIG. 17A, the number of consecutive executions of transactions in the pipe areas PIPEa, PIPEb, and PIPEc is set to “1”. In this case, pipe area data is automatically transferred at the same transfer ratio, such as PIPEa, PIPEb, PIPEc, PIPEa, PIPEb, PIPEc...
[0139]
On the other hand, in FIG. 17B, the number of consecutive executions of the PIPEa and PIPEc transactions is set to “3” and “2”, respectively. In this case, in the present embodiment, pipe area data is automatically transferred as PIPEa, PIPEa, PIPEa, PIPEb, PIPEc, PIPEc, PIPEa, PIPEa, PIPEa,. In other words, the transfer ratio of PIPEa, PIPEb, and PIPEc (relative ratio of pipe transfer) is set to 3 to 1: 2.
[0140]
Thereby, for example, when the total size of the transfer data of PIPEa and PIPEc is larger than PIPEb, the data of PIPEa and PIPEc can be transferred efficiently and efficient scheduling becomes possible.
[0141]
In the case of FIG. 17B, PIPEa and PIPEc data may not be automatically transferred continuously. That is, for example, data may be automatically transferred in the order of PIPEa, PIPEb, PIPEc, PIPEa, PIPEc, PIPEa,. Even in this case, the transfer ratio of PIPEa, PIPEb, and PIPEc can be set to 3 to 1: 2.
[0142]
8). Interrupt transfer token issue cycle
Four types of transfer methods are defined for USB. One of them, interrupt transfer, is transfer in which a host (or device) is polled by periodically issuing a token.
[0143]
In the conventional OHCI-compliant data transfer control device, the firmware needs to create a binary tree structure descriptor as shown in FIG. 4 in order to set a token issuing period for interrupt transfer. For this reason, there has been a problem that the processing load of the firmware becomes heavy.
[0144]
Thus, in this embodiment, the token transfer period for interrupt transfer can be set directly in the transfer condition register, for example, in frame order (ms). Specifically, as described with reference to FIG. 9, this token issuing period is set in the transfer condition register for HC.
[0145]
When the firmware (processing unit) sets the token issuance period in the transfer condition register, the host controller 50 (transfer controller) automatically generates an interrupt transfer token packet at the set token issuance period and sends it to the peripheral. Forward.
[0146]
That is, in this embodiment, transfer to a certain endpoint is managed as a pipe that is one transfer order. Then, the firmware determines the pipe for interrupt transfer, and directly sets the token issuing period as a numerical value in the transfer condition register of the pipe. Then, the host controller 50 issues an interrupt transfer token in the issue cycle in the pipe (pipe area).
[0147]
For example, in FIG. 18A, “1” is set in the token issue cycle register (one of the transfer condition registers). In this case, an interrupt transfer token packet is automatically transferred by the host controller 50 at an interval of one frame. In FIGS. 18B and 18C, “2” and “4” are set in the token issue cycle register. In this case, token packets are automatically transferred at intervals of 2 frames and 4 frames. Is done.
[0148]
By doing so, it is not necessary to create a binary tree structure descriptor as shown in FIG. 4 in order to realize interrupt transfer, and the processing load of the firmware can be reduced.
[0149]
In particular, OHCI employs a binary tree structure descriptor as shown in FIG. 4 so as to be able to cope with a case where a large number of endpoints are connected to the USB.
[0150]
However, in OTG, in many cases, peer-to-peer connection is planned, and using a binary tree structure descriptor as shown in FIG. 4 is a waste of processing.
[0151]
In the present embodiment, attention is paid to such waste of processing, and attention is paid to the fact that a transfer condition register is prepared for each pipe area, so that the token issuing period can be directly set in each transfer condition register. There are features.
[0152]
9. Detailed configuration example of each block
Next, a detailed configuration example of each block will be described.
[0153]
9.1 OTG controller
FIG. 19 shows a configuration example of the OTG controller 20.
[0154]
The OTG controller 20 includes an OTG register unit 22. The OTG register unit 22 includes a monitor register and a control register of the OTG controller 20. It also includes a circuit that decodes the OTG state command written by the firmware (CPU).
[0155]
The OTG controller 20 includes an OTG control circuit 23. The OTG control circuit 23 includes an OTG management circuit 24 that manages the OTG state, an ID detection circuit 25 that detects the voltage level of the ID pin, a VBUS detection circuit 26 that detects the voltage level of the VBUS, and DP and DM lines. A line state detection circuit 27 for detecting the state is included.
[0156]
The OTG controller 20 includes a timer 28 that measures a time that is one of the transition determination conditions of the OTG state.
[0157]
Information to be detected in order to change the OTG state is ID, VBUS voltage level, and DP / DM line state. The OTG controller 20 of this embodiment detects these pieces of information and transmits them to the firmware (CPU) via the monitor register.
[0158]
The firmware changes its own state based on the detection information, and informs the OTG controller 20 of the next state to be changed using an OTG state command.
[0159]
The OTG controller 20 decodes the OTG state command, performs VBUS drive control, pull-up / pull-down resistor connection control, and the like based on the decoding result, and performs the SRP and the SRP described with reference to FIGS. Realize HNP.
[0160]
As described above, in this embodiment, the OTG controller 20 is in charge of OTG control for each state, and the firmware can concentrate on state transition management. As a result, the processing load of the firmware (CPU) can be reduced and efficient firmware development can be achieved as compared with the case where all state control is realized by firmware.
[0161]
The determination of the OTG state transition may be performed by a hardware circuit without the firmware. Alternatively, almost all the processing of the OTG controller 20 (for example, processing other than VBUS control, pull-up / pull-down resistance control, ID detection, VBUS detection, and line state detection) may be realized by firmware (software).
[0162]
9.2 Host controller and peripheral controller
FIG. 20A shows a configuration example of the host controller 50.
[0163]
The host controller 50 includes an HC sequence management circuit 52. The HC sequence management circuit 52 performs arbitration of pipe transfer (data transfer using a pipe region), time management, scheduling of pipe transfer, retransmission management, and the like.
[0164]
More specifically, the HC sequence management circuit 52 issues a frame number count or SOF (Start-Of-Frame) packet transmission instruction. Also, processing for preferentially executing isochronous transfer at the head of each frame is performed, or processing for preferentially handling interrupt transfer after isochronous transfer is performed. Also, processing for instructing each pipe transfer is performed in accordance with the order of pipe transfer. It also manages the number of consecutive executions of transactions and performs confirmation processing for the remaining frame time. Also, processing is performed on the handshake packet (ACK, NAK) returned from the peripheral. It also performs error handling during transaction execution.
[0165]
The host controller 50 includes a target pipe management circuit 54. The target pipe management circuit 54 performs handling processing of transfer condition information set in the transfer condition register of the register unit 70 and the like.
[0166]
More specifically, the target pipe management circuit 54 performs transfer condition information selection processing and interrupt signal generation processing. When the start of an automatic transaction is instructed, the total size of transfer data in the pipe area is loaded. Then, the remaining transfer data size is counted (decremented). In addition, processing for confirming the state of the buffer (FIFO) area is performed when data is transmitted to and received from the buffer controller 80. Also, a transfer instruction to the transaction management circuit 56 is given. In addition, a process for determining reception of an unexpected short packet or a process for determining reception of a packet larger than the maximum packet size is performed. If the mode for automatically transferring zero-length packets is set, the transaction management circuit 56 is instructed to transmit the last zero-length packet. Also, sequence management is performed in the automatic control transfer mode.
[0167]
The host controller 50 includes a transaction management circuit 56. The transaction management circuit 56 manages the type and transfer order of transfer packets (transaction sequence management). Also, a timeout monitoring process is performed. In addition, a transaction end notification process is performed.
[0168]
The host controller 50 includes a packet handler circuit 58. The packet handler circuit 58 performs packet generation and disassembly processing. Also, PID check, CRC decoding and encoding are performed. In addition, the buffer area packet payload read / write processing and SOF packet transmission processing are performed. Also, transmission / reception data count processing is performed.
[0169]
FIG. 20B shows a configuration example of the peripheral controller 60.
[0170]
The peripheral controller 60 includes a transaction management circuit 62 and a packet handler circuit 64. These transaction management circuit 62 and packet handler circuit 64 perform substantially the same processing as the transaction management circuit 56 and packet handler circuit 58 of the host controller 50.
[0171]
9.3 Buffer controller
FIG. 21 shows a configuration example of the buffer controller 80.
[0172]
The buffer controller 80 includes an area allocation circuit 82. The area securing circuit 82 is a circuit that secures a buffer area (an area set in the pipe area during the host operation and set as the endpoint area during the peripheral operation) in the packet buffer 100.
[0173]
The area securing circuit 82 includes an area calculation circuit 83. The area calculation circuit 83 is a circuit that calculates the area size, start address, end address, etc. of the buffer area based on the maximum packet size (page size in a broad sense) and the number of pages.
[0174]
For example, in the buffer areas PIPE0 / EP0, PIPEa / EPa, PIPEb / EPb, and PIPEc / EPc shown in FIG. 22A, the maximum packet size (MaxPktSize) is set to 32, 64, 64, and 64 bytes, respectively. The number (BufferPage) is set to 1, 1, 3, 2 pages, respectively. The area calculation circuit 83 calculates the area size, start address, and end address of the buffer areas PIPE0 / EP0 to PIPEc / EPc based on the maximum packet size and the number of pages. For example, in FIG. 22A, the area sizes of PIPE0 / EP0, PIPEa / EPa, PIPEb / EPb, and PIPEc / EPc are 32 (= 32 × 1), 64 (= 64 × 1), and 192 (= 64, respectively. × 3) and 128 (= 64 × 2) bytes.
[0175]
The pointer assignment circuit 84 assigns the write pointer WP (WP0, WPa, WPb, WPc) and the read pointer RP (RP0, RPa, RPb, RPc) of each buffer area to the DMA pointer, CPU pointer, and USB pointer. Circuit.
[0176]
For example, as shown in FIG. 22B, when data is transmitted (when data is transferred from the DMA or the CPU to the USB side via the packet buffer 100) and when DMA transfer is used, the buffer area is written. The pointer WP is assigned to a DMA (DMA access) pointer, and the read pointer RP is assigned to a USB (USB access) pointer. When data is transmitted and the CPU (PIO) transfer is used, the write pointer WP of the buffer area is assigned to a CPU (CPU access) pointer, and the read pointer RP is assigned to a USB pointer.
[0177]
On the other hand, as shown in FIG. 22C, when data is received (when data is transferred from the USB to the DMA or CPU side via the packet buffer 100) and when DMA transfer is used, the buffer area The write pointer WP is assigned to the USB pointer, and the read pointer RP is assigned to the DMA pointer. When data is received and CPU transfer is used, the write pointer WP of the buffer area is assigned to the USB pointer, and the read pointer RP is assigned to the CPU pointer.
[0178]
The pointer information (position information) of the write pointer WP and the read pointer RP of each buffer area is held in each transfer condition register (PIPE / EP register) of the register unit 70.
[0179]
The pointer management circuit 86 is a circuit that generates a real address for accessing the packet buffer 100 while updating the pointer.
[0180]
The pointer management circuit 86 includes a CPU address generation circuit 87, a DMA address generation circuit 88, and a USB address generation circuit 89. These generation circuits 87, 88, and 89 generate a CPU address, a DMA address, and a USB address based on the CPU pointer, DMA pointer, and USB pointer allocated by the pointer allocation circuit 84, respectively. . Also, the pointer is updated every time the CPU (CPU interface circuit) and DMA (DMA handler circuit) access, or every time the USB (HC or PC) transaction ends (handshake transmission / reception such as ACK and NAK). . The updated pointer information is written back to each transfer condition register of the register unit 70 via the area securing circuit 82.
[0181]
The buffer management circuit 90 is a circuit that manages access to the packet buffer 100.
[0182]
The buffer management circuit 90 includes a buffer interface circuit 92. The buffer interface circuit 92 receives a CPU address, a DMA address, a USB address, and the like from the pointer management circuit 86, and inputs / outputs data to / from the packet buffer 100, addresses, output enable, write enable, read enable, etc. Is output.
[0183]
The buffer management circuit 90 includes an arbitration circuit 93. The arbitration circuit 93 is a circuit that arbitrates accesses from the CPU (CPU interface circuit), DMA (DMA handler circuit), and USB (host controller or peripheral controller). Based on the arbitration result, one of the CPU address, DMA address, and USB address is output as the access address of the packet buffer 100, and the data transfer path between the CPU, DMA or USB and the packet buffer 100 Is set.
[0184]
The HC / PC selector 94 performs switching control of connection between the buffer management circuit 90 (buffer controller 80) and the host controller 50 (HC) or the peripheral controller 60 (PC). For example, the host controller 50 and the buffer management circuit 90 are connected during the host operation, and the peripheral controller 60 and the buffer management circuit 90 are connected during the peripheral operation. This connection switching control is performed based on the HC / PC enable signal from the OTG controller 20 (OTGC).
[0185]
10. Firmware processing
Next, a detailed example of processing of the firmware (processing unit) will be described.
[0186]
FIG. 23 is a flowchart of firmware processing during host operation.
[0187]
First, it is confirmed whether or not a pipe (buffer) area has already been secured (step S11). If the pipe area is secured, a pipe area data clear instruction [FIFOClr] is issued (step S12).
[0188]
Next, end point (transfer condition) information is set in the transfer condition register (step S13). In other words, endpoint number [EPNumber], function address [FuncAddr], transfer direction [DirPID] such as IN / OUT / SETUP, transfer type [TranType] such as isochronous, bulk, control, interrupt, Max packet size [MaxPktSize], etc. Set.
[0189]
Next, the transfer type [TranType] is determined (step S14). If the transfer type is isochronous, the process proceeds to step S18. When the transfer type is interrupt transfer, the token issue period [Interval] is specified and the toggle mode [ToggleMode] is specified (steps S15 and S16). If the transfer type is neither isochronous nor interrupt (bulk or control), HC scheduling [number of continuous executions: Continuity] is specified (step S17).
[0190]
Next, an initial value [Toggle] of toggle bits is set, and a total size [TotalSize] of transfer data is set (steps S18 and S19). In the case of isochronous transfer, it is not necessary to set the initial value of the toggle bit. The setting order of steps S13 to S19 is arbitrary.
[0191]
Next, the number of pages [BufferPage] in the pipe (buffer) area is set (step S20), and an instruction [SetAllocation] for securing the pipe area is performed (step S21).
[0192]
Next, it is determined whether or not DMA is used, and if it is used, a DMA bus connection instruction [JoinDMA] is issued (steps S22 and S23). Also, an automatic transaction start instruction [TranGo] is issued (step S24).
[0193]
Then, waiting for an interrupt to occur (step S25), normal completion, STALL response, handshake wait time-out processing, etc. are performed (step S26).
[0194]
FIG. 24 is a flowchart of the firmware process during the peripheral operation.
[0195]
First, a data clear instruction [FIFOClr] for the endpoint (buffer) area is issued (step S31). Then, the toggle bit initial value [Toggle] is set (step S32).
[0196]
Next, end point (transfer condition) information is set (step S33). That is, the endpoint number [EPNumber], the transfer direction [DirPID], the transfer type [TranType], the maximum packet size [MaxPktSize], and the like are set.
[0197]
Next, an endpoint enable instruction [EnEndPoint] is performed (step S34). Then, the transfer type [TranType] is determined, and in the case of interrupt transfer, the toggle mode [ToggleMode] is designated (steps S35 and S36).
[0198]
Next, the number of pages [BufferPage] in the endpoint (buffer) area is set (step S37), and an instruction [SetAllocation] for securing the endpoint area is issued (step S38).
[0199]
Next, it is determined whether or not DMA is used. When DMA is used, a DMA bus connection instruction [JoinDMA] is issued (steps S39 and S40).
[0200]
Next, a token reception state from the host is entered (step S41). Then, it waits for an interrupt to occur (step S42), performs normal completion (ACK reception), NAK reply, STALL reply, handshake wait time-out process, etc. (step S43).
[0201]
11. Electronics
Next, an example of an electronic device including the data transfer control device of this embodiment will be described.
[0202]
For example, FIG. 25A shows an internal block diagram of a printer which is one of electronic devices, and FIG. 26A shows an external view thereof. A CPU 510 (processing unit) controls the entire system. An operation unit 511 is used by a user to operate the printer. The ROM 516 stores control programs, fonts, and the like, and the RAM 517 (system memory) functions as a work area for the CPU 510. The DMAC 518 is a DMA controller for performing data transfer without going through the CPU 510. A display panel 519 is for informing the user of the operation state of the printer.
[0203]
Serial print data (print data, image data) sent from another device such as a personal computer, a digital camera, or a digital video camera via USB is converted into parallel print data by the data transfer control device 500. . The converted parallel print data is sent to the print processing unit (printer engine) 512 by the CPU 510 or the DMAC 518. A given process is performed on the parallel print data in the print processing unit 512, and the print unit (device that performs data output processing) 514 including a print header is printed on paper.
[0204]
FIG. 25B shows an internal block diagram of a digital camera which is one of electronic devices, and FIG. 26B shows an external view thereof. The CPU 520 controls the entire system. The operation unit 521 (shutter button, operation button, etc.) is for the user to operate the digital camera. The ROM 526 stores a control program and the like, and the RAM 527 functions as a work area for the CPU 520. The DMAC 528 is a DMA controller.
[0205]
An image is picked up by an image pickup unit (device that performs data fetching processing) 522 including a CCD, a lens, and the like, and data of the picked up image is processed by an image processing unit 524. Then, the processed image data is sent to the data transfer control device 500 by the CPU 520 or the DMAC 528. The data transfer control device 500 converts the parallel image data into serial data and transmits it to other devices such as a printer, a storage device, and a personal computer via the USB.
[0206]
FIG. 25C shows an internal block diagram of a CD-RW drive (storage device) which is one of electronic devices, and FIG. 26C shows an external view thereof. The CPU 530 controls the entire system. The operation unit 531 is for the user to operate the CD-RW. The ROM 536 stores a control program and the like, and the RAM 537 functions as a work area for the CPU 530. The DMAC 538 is a DMA controller.
[0207]
Data read from the CD-RW 532 by a reading and writing unit (a device for performing data fetching processing or a device for performing data storage processing) 533 including a laser, a motor, an optical system, and the like is input to the signal processing unit 534. Then, given signal processing such as error correction processing is performed. Then, the data subjected to the signal processing is sent to the data transfer control device 500 by the CPU 530 or the DMAC 538. The data transfer control device 500 converts this parallel data into serial data and transmits it to another device via the USB.
[0208]
On the other hand, serial data sent from another device via the USB is converted into parallel data by the data transfer control device 500. The parallel data is sent to the signal processing unit 534 by the CPU 530 or the DMAC 538. The signal processing unit 534 performs given signal processing on the parallel data, and the reading and writing unit 533 stores the data in the CD-RW 532.
[0209]
25A, 25B, and 25C, in addition to the CPUs 510, 520, and 530, a CPU for data transfer control in the data transfer control device 500 may be provided separately.
[0210]
If the data transfer control device of this embodiment is used in an electronic device, an electronic device having an OTG function can be realized. In other words, it becomes possible to give the electronic device a role as a host or a role as a device, and an application that has not existed before can be created.
[0211]
If the data transfer control device of this embodiment is used in an electronic device, the processing load on a CPU (processing unit) incorporated in the electronic device is reduced, and an inexpensive CPU can be used. Further, the CPU can perform processing other than the data transfer control processing with a margin, and the performance of the electronic device can be improved and the cost can be reduced. In addition, the firmware program operating on the CPU can be simplified, and the development period of the electronic device can be shortened.
[0212]
In addition to the above, the electronic apparatus to which the data transfer control device of the present embodiment can be applied includes, for example, various optical disk drives (CD-ROM, DVD), magneto-optical disk drives (MO), hard disk drives, digital video cameras, Various things such as a mobile phone, a scanner, a TV, a VTR, an audio device, a telephone, a projector, a personal computer, an electronic notebook, or a word processor can be considered.
[0213]
In addition, this invention is not limited to this embodiment, A various deformation | transformation implementation is possible within the range of the summary of this invention.
[0214]
For example, the configuration of the data transfer control device of the present invention is not limited to the configuration described with reference to FIG. 5 and the like, and various modifications can be made.
[0215]
Further, the configuration of each block (HC, PC, OTGC, etc.) of the data transfer control device is not limited to that described in the present embodiment, and various modifications can be made.
[0216]
Also, the transfer condition information set in the transfer condition register is not limited to the information described in the present embodiment.
[0217]
In addition, terms (OTG controller, CPU / firmware, host controller / peripheral controller) cited as broad terms (state controller, processing unit, transfer controller, bus, transfer ratio information, buffer area, etc.) in the description in the specification. USB, continuous execution count, pipe area / endpoint area, etc.) can be replaced by broad terms in other descriptions in the specification.
[0218]
In the invention according to the dependent claims of the present invention, a part of the constituent features of the dependent claims can be omitted. Moreover, the principal part of the invention according to one independent claim of the present invention may be made dependent on another independent claim.
[0219]
In this embodiment, the application example to the USB OTG standard has been described. However, the present invention is not limited to the OTG standard. For example, the present invention can be applied to data transfer in a standard based on the same idea as the OTG standard or a standard developed from the OTG standard.
[Brief description of the drawings]
FIGS. 1A, 1B, and 1C are diagrams for explaining a USB OTG standard. FIG.
FIGS. 2A and 2B are diagrams for explaining procedures of SRP and HNP.
FIGS. 3A and 3B are diagrams for explaining a descriptor having an OHCI list structure. FIG.
FIG. 4 is a diagram for explaining a descriptor having an OHCI binary tree structure;
FIG. 5 is a diagram illustrating a configuration example of a data transfer control device according to the present embodiment;
FIGS. 6A and 6B are diagrams for explaining a pipe region and an endpoint region.
FIG. 7 is a diagram for explaining an operation at the time of hosting of the data transfer control device;
FIG. 8 is a diagram for explaining an operation at the time of a peripheral of the data transfer control device;
FIG. 9 is a diagram for explaining a register unit;
FIG. 10 is a detailed example of a register map of a general-purpose transfer condition register.
FIG. 11 is a detailed example of a register map of a transfer condition register for control transfer.
FIGS. 12A and 12B are diagrams showing an outline of transfer condition information set in each bit field of the transfer condition register.
FIG. 13 is a diagram showing an outline of transfer condition information set in each bit field of the transfer condition register.
FIG. 14 is a flowchart for explaining an example of firmware processing;
FIG. 15 is a signal waveform example of automatic transaction processing in an IN transaction.
FIG. 16 is a signal waveform example of automatic transaction processing in an OUT transaction.
FIGS. 17A and 17B are diagrams for explaining a method of setting the number of continuous executions of a transaction.
FIGS. 18A, 18B, and 18C are diagrams for explaining a method of setting a token issuing period for interrupt transfer.
FIG. 19 is a diagram illustrating a detailed configuration example of an OTG controller.
20A and 20B are diagrams illustrating detailed configuration examples of a host controller and a peripheral controller.
FIG. 21 is a diagram illustrating a detailed configuration example of a buffer controller.
FIGS. 22A, 22B, and 22C are diagrams for explaining an area securing method and a pointer allocation method.
FIG. 23 is a flowchart illustrating a detailed processing example of firmware during host operation.
FIG. 24 is a flowchart illustrating a detailed processing example of the firmware during the peripheral operation.
FIGS. 25A, 25B, and 25C are examples of internal block diagrams of various electronic devices.
26A, 26B, and 26C are examples of external views of various electronic devices.
[Explanation of symbols]
PIPE0 to PIPEe Pipe (buffer) area,
EP0 to EPe Endpoint (buffer) area,
TREG0 to TREGe transfer condition register (shared register),
10 transceiver, 12 physical layer circuit, 20 OTG controller (state controller), 30 HC / PC switching circuit, 32 HC / PC selector, 34 line state controller, 40 transfer controller,
50 host controller, 60 peripheral controller, 70 register unit, 72 transfer condition register unit (shared register), 80 buffer controller, 100 packet buffer (FIFO, RAM), 110 interface circuit, 112 DMA handler circuit, 114 CPU interface circuit, 120 Clock controller

Claims (11)

USB(Universal Serial Bus)に接続される電子機器に組み込まれ、USBを介してデータを送受信するデータ転送制御装置であって、
エンドポイントに対応してパイプ領域をパケットバッファに確保し、パケットバッファに対してアクセス制御を行うバッファコントローラと、
パイプ領域とエンドポイントとの間でのデータ転送の転送条件情報が設定される転送条件レジスタを含むレジスタ部と、
転送条件レジスタに設定された転送条件情報に基づいて、エンドポイントに対するトランザクションを発生し、パイプ領域と、そのパイプ領域に対応するエンドポイントとの間で、データを転送する転送コントローラとを含み、
前記バッファコントローラは、
所与のデータ単位の転送が終了するとパイプ領域を解放し、
前記パイプ領域が解放された前記パケットバッファに、エンドポイントに対応してパイプ領域を再割り当てすることを特徴とするデータ転送制御装置。
A data transfer control device that is incorporated in an electronic device connected to a USB (Universal Serial Bus) and transmits / receives data via the USB,
A buffer controller that secures a pipe area in the packet buffer corresponding to the endpoint, and performs access control on the packet buffer;
A register unit including a transfer condition register in which transfer condition information for data transfer between the pipe area and the endpoint is set;
Based on the transfer condition information set in the transfer condition register, includes a transaction for the endpoint, and includes a pipe area and a transfer controller that transfers data between the endpoint corresponding to the pipe area,
The buffer controller
When the transfer of a given data unit is completed, the pipe area is released,
A data transfer control device, wherein a pipe area is reassigned to the packet buffer from which the pipe area has been released in correspondence with an end point.
請求項1において、
前記転送条件レジスタに設定される転送条件情報が、エンドポイントとの間で転送されるデータのトータルサイズと、マックスパケットサイズと、データの転送方向とを含み、
前記転送コントローラは、
前記トータルサイズのデータを、前記マックスパケットサイズのペイロードのパケットを用いて、前記転送方向で指定される方向で、パイプ領域とそのパイプ領域に対応するエンドポイントとの間で転送することを特徴とするデータ転送制御装置。
In claim 1,
The transfer condition information set in the transfer condition register includes the total size of data transferred to and from the endpoint, the maximum packet size, and the data transfer direction,
The transfer controller is
The total size data is transferred between a pipe area and an end point corresponding to the pipe area in a direction specified by the transfer direction, using a payload packet of the maximum packet size. Data transfer control device.
請求項1又は2において、
前記転送条件レジスタに設定される転送条件情報が、データ転送の転送種別を含み、
前記転送コントローラは、
パイプ領域のデータを、転送条件レジスタに設定される転送種別のデータ転送により、転送することを特徴とするデータ転送制御装置。
In claim 1 or 2,
The transfer condition information set in the transfer condition register includes a transfer type of data transfer,
The transfer controller is
A data transfer control device that transfers data in a pipe area by data transfer of a transfer type set in a transfer condition register.
請求項1乃至3のいずれかにおいて、
前記転送条件レジスタに設定される転送条件情報が、複数のパイプ領域間の転送比率情報を含み、
前記転送コントローラは、
前記転送比率情報で設定される転送比率で、パイプ領域のデータを転送することを特徴とするデータ転送制御装置。
In any one of Claims 1 thru | or 3,
The transfer condition information set in the transfer condition register includes transfer ratio information between a plurality of pipe regions,
The transfer controller is
A data transfer control device, wherein data in a pipe area is transferred at a transfer ratio set by the transfer ratio information.
請求項4において、
前記転送比率情報が、
パイプ領域のトランザクションの連続実行回数であることを特徴とするデータ転送制御装置。
In claim 4,
The transfer rate information is
A data transfer control device characterized in that the number of continuous executions of a pipe area transaction.
請求項1乃至5のいずれかにおいて、
前記転送条件レジスタに設定される転送条件情報が、インタラプト転送におけるトークン発行周期を含み、
前記転送コントローラは、
転送条件レジスタに設定される前記トークン発行周期で、インタラプト転送のトークンパケットを転送することを特徴とするデータ転送制御装置。
In any one of Claims 1 thru | or 5,
The transfer condition information set in the transfer condition register includes a token issue period in interrupt transfer,
The transfer controller is
A data transfer control device, wherein a token packet for interrupt transfer is transferred at the token issuing period set in a transfer condition register.
請求項1乃至6のいずれかにおいて、
前記パイプ領域が、
コントロール転送のエンドポイントに専用のパイプ領域と、任意のエンドポイントに割り当て可能な汎用のパイプ領域を含むことを特徴とするデータ転送制御装置。
In any one of Claims 1 thru | or 6.
The pipe region is
A data transfer control apparatus comprising: a dedicated pipe area for an end point of control transfer; and a general-purpose pipe area that can be assigned to an arbitrary end point.
請求項1乃至7のいずれかにおいて、
前記バスとは異なる他のバスとパケットバッファとの間でのデータ転送を行うインターフェース回路を含み、
前記インターフェース回路、前記転送コントローラに対して、処理部がデータ転送の開始を指示した場合に、前記インターフェース回路が他のバスを介したデータ転送を行うと共に、前記転送コントローラがバスを介したデータ転送を行い、データ転送が終了した場合に、前記転送コントローラが、処理部に対して割り込みを発生することを特徴とするデータ転送制御装置。
In any one of Claims 1 thru | or 7,
An interface circuit for transferring data between another buffer different from the bus and the packet buffer;
When the processing unit instructs the interface circuit and the transfer controller to start data transfer, the interface circuit performs data transfer via another bus, and the transfer controller performs data transfer via the bus. And when the data transfer ends, the transfer controller generates an interrupt to the processing unit.
請求項1乃至8のいずれかにおいて、
ホストの役割として動作するホスト動作のステートと、ペリフェラルの役割として動作するペリフェラル動作のステートを含む複数のステートの制御を行うステートコントローラを含み、
前記転送コントローラは、
ホスト動作時において、ホストとしてのデータ転送を行うホストコントローラと、
ペリフェラル動作時において、ペリフェラルとしてのデータ転送を行うペリフェラルコントローラとを含み、
ホスト動作時において、パケットバッファに対してパイプ領域が確保され、前記ホストコントローラが、確保されたパイプ領域とそのパイプ領域に対応するエンドポイントとの間で、データを転送することを特徴とするデータ転送制御装置。
In any one of Claims 1 thru | or 8.
It includes a state controller that controls multiple states including a host operation state that operates as a host role and a peripheral operation state that operates as a peripheral role.
The transfer controller is
A host controller that transfers data as a host during host operation;
Including a peripheral controller that transfers data as a peripheral during peripheral operation,
A pipe area is reserved for a packet buffer during host operation, and the host controller transfers data between the reserved pipe area and an endpoint corresponding to the pipe area. Transfer control device.
請求項1乃至9のいずれかのデータ転送制御装置と、
前記データ転送制御装置及びバスを介して転送されるデータの出力処理又は取り込み処理又は記憶処理を行う装置と、
前記データ転送制御装置のデータ転送を制御する処理部と、
を含むことを特徴とする電子機器。
A data transfer control device according to any one of claims 1 to 9,
An apparatus for performing an output process or a capture process or a storage process of data transferred via the data transfer control device and the bus;
A processing unit for controlling data transfer of the data transfer control device;
An electronic device comprising:
USB(Universal Serial Bus)を介してデータを送受信するためのデータ転送制御方法であって、
エンドポイントに対応してパイプ領域をパケットバッファに確保し、
パイプ領域とエンドポイントとの間でのデータ転送の転送条件情報を、転送条件レジスタに設定し、
転送条件レジスタに設定された転送条件情報に基づいて、エンドポイントに対するトランザクションを発生し、パイプ領域と、そのパイプ領域に対応するエンドポイントとの間で、データを転送すると共に、
所与のデータ単位の転送が終了するとパイプ領域を解放し、
前記パイプ領域が解放された前記パケットバッファに、エンドポイントに対応してパイプ領域を再割り当てすることを特徴とするデータ転送制御方法。
A data transfer control method for transmitting and receiving data via USB (Universal Serial Bus),
A pipe area is secured in the packet buffer corresponding to the endpoint,
Set transfer condition information for data transfer between the pipe area and the endpoint in the transfer condition register,
Based on the transfer condition information set in the transfer condition register, a transaction for the endpoint is generated, and data is transferred between the pipe area and the endpoint corresponding to the pipe area.
When the transfer of a given data unit is completed, the pipe area is released,
A data transfer control method, wherein a pipe area is reassigned to the packet buffer from which the pipe area has been released in accordance with an end point.
JP2003041562A 2003-02-19 2003-02-19 Data transfer control device, electronic device, and data transfer control method Expired - Fee Related JP4127071B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003041562A JP4127071B2 (en) 2003-02-19 2003-02-19 Data transfer control device, electronic device, and data transfer control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003041562A JP4127071B2 (en) 2003-02-19 2003-02-19 Data transfer control device, electronic device, and data transfer control method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2002118206A Division JP3636157B2 (en) 2002-04-19 2002-04-19 Data transfer control device, electronic device, and data transfer control method

Publications (3)

Publication Number Publication Date
JP2003316735A JP2003316735A (en) 2003-11-07
JP2003316735A5 JP2003316735A5 (en) 2005-09-29
JP4127071B2 true JP4127071B2 (en) 2008-07-30

Family

ID=29546030

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003041562A Expired - Fee Related JP4127071B2 (en) 2003-02-19 2003-02-19 Data transfer control device, electronic device, and data transfer control method

Country Status (1)

Country Link
JP (1) JP4127071B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5456434B2 (en) 2009-10-22 2014-03-26 ルネサスエレクトロニクス株式会社 Pipe arbitration circuit, pipe arbitration method

Also Published As

Publication number Publication date
JP2003316735A (en) 2003-11-07

Similar Documents

Publication Publication Date Title
JP3636157B2 (en) Data transfer control device, electronic device, and data transfer control method
US7349973B2 (en) Data transfer control device, electronic equipment, and data transfer control method
JP3649226B2 (en) Data transfer control device, electronic device, and data transfer control method
JP3632695B2 (en) Data transfer control device, electronic device, and data transfer control method
JP3726898B2 (en) Data transfer control device, electronic device, and data transfer control method
JP3870717B2 (en) Data transfer control device and electronic device
US7337382B2 (en) Data transfer control device, electronic instrument, and data transfer control method
JP3755594B2 (en) Data transfer control device and electronic device
JP3636158B2 (en) Data transfer control device and electronic device
JP2008502976A (en) Bus controller for processing split transactions
JP3636160B2 (en) Data transfer control device, electronic device, and data transfer control method
JP3614161B2 (en) Data transfer control device, electronic device, and data transfer control method
JP2005504392A (en) Bus system and bus interface
JP2005504393A (en) Bus system and bus interface
JP4127069B2 (en) Data transfer control device, electronic device, and data transfer control method
JP4127071B2 (en) Data transfer control device, electronic device, and data transfer control method
JP2003316734A (en) Data transfer control device, electronic equipment, and data transfer control method
JP2003323391A (en) Data transfer control device, electronic equipment and data transfer control method
JP2003323399A (en) Data transfer control device, electronic equipment and data transfer control method
JP2004021976A (en) Data transfer controller, electronic apparatus, and data transfer control method
JP2008204050A (en) Data transfer control device and electronic device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050418

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050509

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080422

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080505

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110523

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120523

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120523

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130523

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees