Vengineerの妄想

公開情報の断片から、AI半導体の実装と次の一手を妄想します。

Tenstorrent Blackhole の tt-zephyr-platforms (その2)

TenstorrentのBlackholeには、4個のARC CPUが搭載されています。このARC上で動いているのが、tt-zephyr-platforms のようです。

今回は、公開されている tt-zephyr-platforms の中を覗いてみます。

tt-zephyr-platforms

今回は、Board の dts (P150) を見てみます。

Board の dts

Board は、P150 と P300

P150

チップの周りには、

  • asic_reset (GPIO-B0, Active Low)
  • spi_reset (GPIO-C7, Active Low)
  • pgood (Power Good, GPIO-C14, Pull-down)
  • therm_trip (温度, GPIO-C13, Active-high)
  • flash memory
  • spiの切り替え(GPIO-B5, Active-low)

があるようですね。

 chip0: chip0 {
        compatible = "tenstorrent,bh-chip";

        asic_reset {
            compatible = "zephyr,gpio-line";
            label = "Line to asic reset";
            gpios = <&gpiob 0 GPIO_ACTIVE_LOW>;
        };

        spi_reset {
            compatible = "zephyr,gpio-line";
            label = "Line to spi reset";
            gpios = <&gpioc 7 GPIO_ACTIVE_LOW>;
        };

        pgood {
            compatible = "zephyr,gpio-line";
            label = "Power good indicator";
            gpios = <&gpioc 14 GPIO_PULL_DOWN>;
        };

        therm_trip {
            compatible = "zephyr,gpio-line";
            label = "Thermal trip indicator";
            gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
        };

        flash = <&flash1>;
        spi_mux {
            compatible = "zephyr,gpio-line";
            label = "Line to spi mux, drive low to enable dmfw -> eeprom";
            gpios = <&gpiob 5 GPIO_ACTIVE_LOW>;
        };

        arc = <&chip0_arc>;
    };

他にも

  • prset_trigger (GPIO-A0, Active-Low | Pull-up), Input
  • board_fault_led (GPIO-C15, Active-High), Output
  • psu_sense0 (GPIO-A6, Active-High), Input
  • psu_sense1 (GPIO-B9, Active-High), Input
  • board_id0 (GPIO-A2, Active-High), Input
 preset_trigger {
        compatible = "zephyr,gpio-line";
        label = "Input from PCIe card edge triggering an asic reset";
        gpios = <&gpioa 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
    };

    board_fault_led {
        compatible = "zephyr,gpio-line";
        label = "LED Output to board fault indicator";
        gpios = <&gpioc 15 GPIO_ACTIVE_HIGH>;
    };

    psu_sense0 {
        compatible = "zephyr,gpio-line";
        label = "PSU Sense 0 from 12V-2x6 connector";
        gpios = <&gpioa 6 GPIO_ACTIVE_HIGH>;
    };

    psu_sense1 {
        compatible = "zephyr,gpio-line";
        label = "PSU Sense 1 from 12V-2x6 connector";
        gpios = <&gpiob 9 GPIO_ACTIVE_HIGH>;
    };

    board_id0 {
        compatible = "zephyr,gpio-line";
        label = "Board ID 0 indicator";
        gpios = <&gpioa 2 GPIO_ACTIVE_HIGH>;
    };

クロック

clk_hsi の PLL の設定もしている

&clk_lsi {
    clock-frequency = <DT_FREQ_K(32)>;
    status = "okay";
};

&clk_hsi {
    clock-frequency = <DT_FREQ_M(16)>;
    status = "okay";
};

&pll {
    clocks = <&clk_hsi>;
    div-m = <1>;
    mul-n = <8>;
    div-r = <2>;
    div-q = <2>;
    div-p = <2>;
    status = "okay";
};


&rcc {
    clocks = <&pll>;
    clock-frequency = <DT_FREQ_M(64)>;
    ahb-prescaler = <1>;
    apb1-prescaler = <1>;
};

I2C

i2c1, i2c2, i2c3 の内、使っているのは、i2c1 と i2c3 ?

  • i2c1 : ina228, gpio, gpio, gpio
  • i2c3 : eeprom, eeprom
&i2c1 {
    pinctrl-0 = <&i2c1_scl_pa9 &i2c1_sda_pa10>;
    pinctrl-names = "default";
    status = "okay";
    clock-frequency = <I2C_BITRATE_FAST>;

    ina228: ina228@40 {
        compatible = "ti,ina228";
        reg = <0x40>;
        status = "okay";
        /* max_current / (2^19) */
        current-lsb-microamps = <210>;
        rshunt-micro-ohms = <1000>;
    };

    gpiox0: gpio@38 {
        compatible = "nxp,pca9554";
        reg = <0x38>;
        status = "okay";
        ngpios = <8>;
        /* external pull-up to 1.8V */
        int-gpios = <&gpioa 1 GPIO_ACTIVE_LOW>;

        gpio-controller;
        #gpio-cells = <2>;
    };

    gpiox1: gpio@39 {
        compatible = "nxp,pca9554";
        reg = <0x39>;
        status = "okay";
        ngpios = <8>;
        /* external pull-up to 1.8V */
        int-gpios = <&gpioa 1 GPIO_ACTIVE_LOW>;

        gpio-controller;
        #gpio-cells = <2>;
    };

    gpiox2: gpio@3a {
        compatible = "nxp,pca9554";
        reg = <0x3a>;
        status = "okay";
        ngpios = <8>;
        /* external pull-up to 1.8V */
        int-gpios = <&gpioa 1 GPIO_ACTIVE_LOW>;

        gpio-controller;
        #gpio-cells = <2>;
    };

    gpiox3: gpio@3b {
        compatible = "nxp,pca9554";
        reg = <0x3b>;
        status = "okay";
        ngpios = <8>;
        /* external pull-up to 1.8V */
        int-gpios = <&gpioa 1 GPIO_ACTIVE_LOW>;

        gpio-controller;
        #gpio-cells = <2>;
    };
};

&i2c3 {
    pinctrl-0 = <&i2c3_scl_pa7 &i2c3_sda_pb4>;
    pinctrl-names = "default";
    status = "okay";
    clock-frequency = <I2C_BITRATE_FAST>;
    compatible = "st,tt-stm32-i2c";

    scl-gpios = <&gpioa 7 GPIO_OPEN_DRAIN>;
    sda-gpios = <&gpiob 4 GPIO_OPEN_DRAIN>;

    bh_arc: i2c@54 {
        compatible = "zephyr,i2c-target-eeprom";
        reg = <0x54>;
        status = "okay";
    };

    aardvark: eeprom@55 {
        compatible = "zephyr,i2c-target-eeprom";
        reg = <0x55>;
        status = "okay";
    };
};

SPI

SPIのリセットは、GPIO-C7 (Active-Low | Pull-Up)

&spi1 {
    pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pb3
             &spi1_miso_pa11 &spi1_mosi_pa12>;
    pinctrl-names = "default";
    status = "okay";

    flash1: flash@0 {
        /* base properties */
        compatible = "jedec,spi-nor";
        status = "okay";

        reset-gpios = <&gpioc 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;

        /* spi-device properties */
        reg = <0>;
        spi-max-frequency = <7999999>;
        spi-cpol;
        spi-cpha;

        /* jedec,spi-nor properties */
        size = <DT_SIZE_M(512)>; /* Size in bits */

        /* jedec,spi-nor-common properties */
        has-dpd;
        t-enter-dpd = <3000>;
        t-exit-dpd = <30000>;
        jedec-id = [20 bb 20];
    };
};

FLASHの設定

&flash0 {
    /* TODO:
     * Move slot1_partition to spi flash.
     * Ensure main flash erase size agrees with minimal subsector erase size of SPI flash,
     * i.e. 4096 bytes. Currently sectors are 2048 bytes on stm32g071rb and this value is
     * likely hard-coded in several places.
     */
    /* erase-block-size = <4096>; */

    partitions {
        compatible = "fixed-partitions";
        #address-cells = <1>;
        #size-cells = <1>;

        boot_partition: partition@0 {
            label = "mcuboot";
            reg = <0x00000000 DT_SIZE_K(48)>;
            read-only;
        };

        slot0_partition: partition@c000 {
            label = "image-0";
            reg = <0x0000c000 (DT_SIZE_K(230) + DT_SIZE_K(2))>;
        };

        slot1_partition: partition@46000 {
            label = "image-1";
            reg = <0x00046000 (DT_SIZE_K(230))>;
        };
    };
};

おわりに

今回は、P150 の dts を見てみました、次回は、P300 の dts を見てみます。