Vengineerの妄想(準備期間)

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

Google Tensor (G1/G2/G3) の PCIe Controller は、Synopsys ベース?

はじめに

Google Tensor (G1/G2/G3) の PCIe Controller のデバイスドライバーを調べてみました。

Google Tensor (G1/G2/G3) の PCIe Controller は、Samsung製かな?と思いましたが、Kconfig を見たら、PCIE_DW_HOST というキーワードがあるので、どうも Synopsys の PCIe Controller IP ペースっぽい。

config PCI_EXYNOS_GS
    tristate "Exynos GS PCIe controller"
    depends on PCI
    depends on OF
    depends on PCI_MSI_IRQ_DOMAIN
    select PCIEPORTBUS
    select PCIE_DW_HOST
    help
      Enables support for the PCIe controller in the Samsung Exynos SoCs
      for GS101 to work in host mode. The PCI controller is based on the
      DesignWare hardware and therefore the driver re-uses the DesignWare
      core functions to implement the driver.

The PCI controller is based on the DesignWare hardware and therefore the driver re-uses the DesignWare core functions to implement the driver.

とあります。

PCIE_DW_HOST

PCIE_DW_HOST は、LinuxデバイスドライバMakefileを見ると、

obj-$(CONFIG_PCIE_DW) += pcie-designware.o
obj-$(CONFIG_PCIE_DW_HOST) += pcie-designware-host.o

とあり、pcie-designware-host.c では、

/*
 * Synopsys DesignWare PCIe host controller driver
 *
 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
 *     https://www.samsung.com
 *
 * Author: Jingoo Han <jg1.han@samsung.com>
 */

とありました。あ、Samsung が Synopsys DesignWave PCIe host controller driver を書いているんですね。

G1とG2は同じで、G3は新しくなった

G1, G2 は、2つの PCIE x2 lanes が載っているようです。

G3 の dtsi を覗いてみたら、

x2 lane + x1 lane のようです。

G1, G2 の reg_names は、

  • reg-names = "elbi", "phy", "sysreg", "dbi", "pcs", "config", "ia";

で、G3 の reg_names は、

  • reg-names = "elbi", "soc", "udbg", "phy", "sysreg", "dbi", "pcs", "config", "ia";

になっていて、soc, udbg のレジスタ空間が増えたので、一部のレジスタ空間のサイズが増えています。Android 14 のデバイスドライバにも、soc, udbg は追加されていますね。

Android 13 のデバイスドライバでは、soc のレジスタ空間はないですね。

おわりに

今回、Linux の Synopsys の PCIe Controller (RC) は Samsung製で、SamsungのPCIe Controller RC は Synopsys の PCIe Controller ベースということが分かりました。