Vengineerの戯言

人生は短いけど、長いです。人生を楽しみましょう!

Apple M1機の USB 3.0/Thunderbolt 4

@Vengineerの戯言 : Twitter
SystemVerilogの世界へようこそすべては、SystemC v0.9公開から始まった 

はじめに

Apple M1機には、USB Type-C/Thunderbolt 4 のコネクタが2つ付いています。

IFIXITの M1 MacBook Teardowns: Something Old, Something New には、

  • Intel JHL8040R Thunderbolt 4 Retimer (x2) (basically a Thunderbolt 4 extender/repeater)

というのがあります。

以下、簡単ですが、この2つのチップについて調べました。

Universal USB Type-C and Power Delivery (PD) 3.0 controller

dtsファイル の中を見ると、I2C に 2つの TI の TPS6598 が繋がっているのが分かります。

        i2c0: i2c0@20a110000 {
            compatible = "apple,i2c-v0";
            reg = <0x2 0x35010000 0x0 0x4000>;
            interrupts = <0 627 4>;
            clocks = <&i2c0_clk>;
            pinctrl-0 = <&i2c0_pins>;
            pinctrl-names = "default";
            #address-cells = <0x1>;
            #size-cells = <0x0>;

            hpm0: hpm0@38 {
                compatible = "ti,tps6598x";
                reg = <0x38>;
                interrupt-parent = <&gpio>;
                interrupts = <106 8>;

                no-long-writes;

                typec0: connector {
                    compatible = "usb-c-connector";
                    label = "USB-C A";
                    power-role = "source";
                    data-role = "host";
                };
            };

            hpm1: hpm1@3f {
                compatible = "ti,tps6598x";
                reg = <0x3f>;
                interrupt-parent = <&gpio>;
                interrupts = <106 8>;

                no-long-writes;

                typec1: connector {
                    compatible = "usb-c-connector";
                    label = "USB-C B";
                    power-role = "source";
                    data-role = "host";
                };
            };
        };

TI のサイトで調べたら、TPS65983B : Universal USB Type-C™ and Power Delivery (PD) 3.0 controller でした。ブロック図を見ると、I2Cのインターフェースが付いているようです。

Thunderbolt 4 Retimer

下図は、USB4で採用した3つの新機能、高速化には「あの部品」が不可欠にからの引用です。

f:id:Vengineer:20210213133511p:plain

M1 SoC から この Thunderbolt 4 Retimer を経由して、コネクタに繋がっているんですね。

もっと具体的には、ここ にブロック図がありました。引用します。

f:id:Vengineer:20210213134126p:plain

USB IP

USB IP は、下記のように、Synopsys の DWC3 ですね。モードとしては、Host として使っています。Apple M1 にはこれが2つ載っています。

        usb_drd0: usb_drd0@382280000 {
            compatible = "apple,dwc3-m1";
            clocks = <&atc0_usb>;
            clock-names = "usbclk";
            reg = <0x3 0x80000000 0x0 0x1000000   0x3 0x82000000 0x0 0x1000000>;
            reg-names = "atcphy", "usbcore";
            #address-cells = <2>;
            #size-cells = <2>;
            ranges;

            usbdrd_dwc3_0: dwc3@382280000 {
                compatible = "snps,dwc3";
                reg = <0x3 0x82280000 0x0 0x100000>;
                interrupts = <0 777 4>;
                iommus = <&usb_dart0 1>;
                dr_mode = "host";
            };
        };

デバイスドライバ (apple,dwc3-m1) は、ここ にあります。

Apple M1機では、USB 2.0 は繋がっているのだろうか? ここ を見た感じでは、USB 2.0 もつながっているようですね。

Synopsys の DesignWare USB 3.0 Digital Controller IP の説明を眺めたら、

  • USB 3.0 PIPE and USB 2.0 UTMI/UTMI+ interfaces for PHYs

とあるので、USB 3.0 と USB 2.0 の両方繋がるんですね。

終わりに

USB 3.0 Host Controller と言えば、やっぱり、Synopsys なんですね。接続テストとか考えると、デファクトスタンダートなものを使うのが一番いいですからね。