From nobody Thu Sep 24 23:32:00 2026 Received: from mail-qv2-f12.google.com (mail-qv2-f12.google.com [74.125.230.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDC24502559 for ; Fri, 18 Sep 2026 15:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.230.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789745230; cv=none; b=nYh4lhanAK9kJv82sLIwe38ls8cvzTo2M34et2LaROjNdXll4JUR5++snfomaBrbiilRXynXfZ7Fpq5H7sgXQsL5PraUJrzZbpyR90RKn5LtVkarEQ6pJidFt2r5+CNrUfHmjOpnW3uYWDrZJk0/H/Y1FZ4ONqbJqgLnClxf3JU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789745230; c=relaxed/simple; bh=DtwhmvfmmK5pIr/RR1hrMie23QMNX8VOipziXz4rrfQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CDwUKV+XKnmXR9sLXu8R0yCRJgyDXYLtGFdbeWN8ydkfznI6fiG5DI4Hd+Uxq7jtFc+1EEJ/jP3UIIaRiF/TTW6qVsL4p0y/bam0Rp9ii+wnnVLUJrXvgvIkhCr10zXV5TWWwB+Mnnv7FeF2MGk6/Kxbwlr5hbqVrgrTFxgoZdk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b=aBbFvpgF; arc=none smtp.client-ip=74.125.230.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="aBbFvpgF" Received: by mail-qv2-f12.google.com with SMTP id 6a1803df08f44-910537b51a0so7866976d6.3 for ; Fri, 18 Sep 2026 08:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1789745225; x=1790350025; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Yc71JJZaAOPgE/2sEPFAn2J0YmVKQfWX+0ylD9XYCsk=; b=aBbFvpgFvX/rl5MO6/YG5yp30+HVL644hPLFWGHC6r40PkZpoUdAhowqmonHvfzFhu OtuaN63BIpn9bFL+qlDt4GNhJZtE5ot4gi0V0Pgj5/trxR3i8T12KcFT0BemPPp+PQUF 6y5DXd0Xke4wZFs8YJW3nK3GEYgeJvDklKMrj2EUZXd0fWk+xbG3laF4H9xa63WF+xby Pt8yE+4FwOuR7WYWXvylGkvJKOWMzc9vNKbWz6vqP0Xjfqpol6Ph06Dej9YGumF0dFk3 0wFOWKyLYIA4H6CzcnnzexDGwIJVJNwVhiAADzWtogXzG+eXY6KHDMAXhtfOU6548dJX 6fWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789745225; x=1790350025; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Yc71JJZaAOPgE/2sEPFAn2J0YmVKQfWX+0ylD9XYCsk=; b=2s5av0mw8F4qvy/nxMd1wt5+8sPpvrUjaZce88MR+hrY9s/oDbM8xWylOsZcUtb72Y UhantnEQjitH6JIaoOxMnlVglTYYom0VrXvAtH+9SGihqN8YS4tyZUhipF5iKBGcqmXD vvxUiYPUEEbBI6wwXPg3+Dfq/DnengXuo8d/3RmW7w1fGCX9aVlSy1HSb7Arm2wPkRFB rglOh+KCpE3oCAbKWBqUmTMQOKmDM9HmE9szz6Gova7trw8Dl1EX7hvGvLAyWjg52wuJ 0k5D5XLvRLVosNvUnWraIGUYGzkNHddJONrV7EKvJr6UURxY8dpdOTRG189oE+kvhYcJ LGAA== X-Forwarded-Encrypted: i=1; AKwUvBz/oKTE/D9Qouxif/ExjP6HR1vteHhb/9dkKLTrDAKfl/qv+u251KaSb7IPNDPMdonT0bbcHOx8EGvD8Js=@vger.kernel.org X-Gm-Message-State: AFuF++muR8qWaGFgRygBJA3W615CNI5/E+JZeAAd4SYvlcOW3fo007cB /EcNSycWRQ0/bysqcOBFgDU5a/ffeZZD91tsMuRXENj1GyF8f3DsApXgTJdaBA5qzNA= X-Gm-Gg: AYBFou1Dg3q8Jt2MQ2dZUAqdRRsoKFsma6J90lCoxQDBzw5+0BTtU0E/aO2sZoyYGSi AKr2C5XyAjHW64SfuHcJqLa99qlQzZmui8e4ilNLXjG3kvae0ckwJw8qagyrOBBnH+ouWSSQByK x2BAn7cEiFIZ0AJKT5gjI/GgpVRJwg9WFtXKNFpV7ZmoWTafc8dGsgkKuLMoxqrH5q0FWPEZ8uk +Koq1iV2fmMuHa1QFJYgismk1kglYQn/GkH0kqmWQgaCqxa4Xv3Nj9m5Ju2ucoA3xa+FA9FHyc2 kCDqvYnDuCLkjOZNsAWcPcQuKEC/4sgynQ82I/uAW/bAR9ZkK2Lh3LZhqzp9G9E4w2eBgJLgc9c phD5Oz0MaC6qs8AUCsMwq833S+3B6TDXM5w8vnWmrWmehYqnMVOk14fHK2HlqpM5YOFLs1X3STE kt6lpHWISZ1bwOupP0XSUAQ3TmM8/NCfHvV0ZjA/uPNZCE+QCPCYx3T8rYLe2hmsB4Iyh7ScgvB Ks= X-Received: by 2002:a05:6214:80d6:10b0:90e:98c9:548 with SMTP id 6a1803df08f44-91254ba3a7dmr37466856d6.1.1789745225031; Fri, 18 Sep 2026 08:27:05 -0700 (PDT) Received: from zippy.localdomain ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-91257f326d8sm15099766d6.6.2026.09.18.08.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2026 08:27:04 -0700 (PDT) From: Alex Elder To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, bhelgaas@google.com, andersson@kernel.org, konradybcio@kernel.org, abelvesa@kernel.org Cc: daniel@riscstar.com, mohd.anwar@oss.qualcomm.com, lorenzo.bianconi@oss.qualcomm.com, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/3] dt-bindings: misc: introduce pci1179,0220.yaml Date: Fri, 18 Sep 2026 10:26:56 -0500 Message-ID: <20260918152659.413268-2-elder@riscstar.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260918152659.413268-1-elder@riscstar.com> References: <20260918152659.413268-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Define the binding for the Toshiba TC9564 PCI endpoint function device. The third downstream PCIe switch port within this chip has an embedded PCIe controller, and that implements two of these PCIe functions. Multiple internal components are accessed via PCI function BARs, as indicated in the diagram below. This is facilitated by the use of the devicetree pci-ep-bus mechanism, and is demonstrated in the example. Co-developed-by: Daniel Thompson Signed-off-by: Daniel Thompson Signed-off-by: Alex Elder --- v4: - Dropped pci-ep-bus@0 node from the example .../bindings/misc/pci1179,0220.yaml | 146 ++++++++++++++++++ MAINTAINERS | 6 + 2 files changed, 152 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/pci1179,0220.yaml diff --git a/Documentation/devicetree/bindings/misc/pci1179,0220.yaml b/Doc= umentation/devicetree/bindings/misc/pci1179,0220.yaml new file mode 100644 index 0000000000000..c92c8d3d33f76 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/pci1179,0220.yaml @@ -0,0 +1,146 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/pci1179,0220.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Toshiba TC9564 internal PCI endpoint function + +maintainers: + - Alex Elder + - Daniel Thompson + +description: > + The Toshiba TC9564 is specialized SoC that implements a PCIe switch + as well as an Ethernet AVB/TSN bridge. In addition to these, the SoC + implements other functions, including a reset and clock controller, + an address translation unit, and a few other devices. + + The PCI switch has three downstream ports. The first two are exposed + externally, while the third is used by an internal PCIe endpoint. The + internal endpoint implements two PCIe functions, and attached to each + of these is a 10 Gbps capable Synopsys Ethernet controller and an + interrupt controller that converts internal "wired" interrupts into + MSIs delivered to the host. + + PCIe BARs provide access to registers that manage almost all IP blocks. + The SoC is modeled using a PCI endpoint bus. The IP blocks are bound + to platform drivers that access the hardware using MMIO through the + PCI BARs. + + ------------------------------------ + | Host | + -----........---------------...----- + | | | | + | PCIe | |I2C| + | | | | + ----------+........+-------------+...+------------------------------- + | |upstream| | | ---------------- | + | Toshiba | Port 0 | | +-------+ PCIe pwrctrl | | + | TC9564 ----++---- | I2C | ---------------- | + | SoC || |controller| ---------------- | + | || | +-------+ GPIO | | + | || | | | controller | | + | ------++------ ------------ ---------------- | + | | US | | + | | | ---------------------------------------- | + | | DS3+=3D=3D=3D=3D+ downstream port 3 = | | + | | | |--------------------------------------| | + | | PCIe | | embedded PCIe endpoint | | + | | switch | |~~~~~~~~~~~~~~~~~~~++~~~~~~~~~~~~~~~~~| | + | | | | PCIe function 0 || PCIe function 1 | | + | | | |-------------------||-----------------| | + | | | | BAR || BAR || BAR || BAR | BAR | BAR | | + | | | | 0 || 2 || 4 || 0 | 2 | 4 | | + | | DS1 DS2 | ---.------.------.--++--------------.--- | + | --++------++-- : : : : | + | || || : ---.-- :....... : | + | || || : |SRAM| : : : | + | || || : ------ : ---.--- : | + | || || : ....: |clock| ....: | + | || || : : : ------- : : | + | || || ------.---- -.- : -.- : | + | || || |translate| |M| :....... |M| : | + | || || ----------- |S| : : |S| : | + | || || |I| : ---.--- |I| : | + | || || |G| : |reset| |G| : | + | || || |E| : ------- |E| : | + | --------++-- --++-------- |N| : |N| : | + | |downstream| |downstream| ------.---- ------.---- | + | | port 1 | | port 2 | | XGMAC 0 | | XGMAC 1 | | + --+..........+--+..........+----------+.......+-----------+.....+---- + | | | | + |USXGMII| |SGMII| + | | | | + --+.......+-- ---+.....+--- + | Ethernet | | Ethernet | + | PHY | | PHY | + ------------- ------------- + +allOf: + - $ref: /schemas/pci/pci-ep-bus.yaml + +properties: + compatible: + const: pci1179,0220 # Toshiba TC9564 (a.k.a. Qualcomm QPS615) + + reg: + maxItems: 1 + description: PCI Bus/Device/Function config space address + +unevaluatedProperties: false + +required: + - compatible + - reg + - '#address-cells' + - '#size-cells' + - ranges + +examples: + - | + pcie@0,0 { + reg =3D <0x0 0x0>; + #address-cells =3D <3>; + #size-cells =3D <2>; + device_type =3D "pci"; + ranges =3D <0x83000000 0x0 0x0 0x0 0x0 0x1fd00000>; + + dev@0,0 { + compatible =3D "pci1179,0220"; + reg =3D <0x0 0x0 0x0 0x0 0x0>; + #address-cells =3D <3>; + #size-cells =3D <2>; + /* Ranges will be updated dynamically */ + ranges =3D <0x0 0x0 0x0 0x83000000 0x0 0x0 0x0 0x4000>, + <0x2 0x0 0x0 0x83000000 0x0 0x4000 0x0 0x80000>, + <0x4 0x0 0x0 0x83000000 0x0 0x84000 0x0 0x200000>; + + pci-ep-bus@4 { + compatible =3D "simple-bus"; + #address-cells =3D <1>; + #size-cells =3D <1>; + /* Map 0x0-0x1fffff to BAR 4 */ + ranges =3D <0x0 0x4 0x0 0x0 0x200000>; + }; + }; + + dev@0,1 { + compatible =3D "pci1179,0220"; + reg =3D <0x100 0x0 0x0 0x0 0x0>; + #address-cells =3D <3>; + #size-cells =3D <2>; + /* Ranges will be updated dynamically */ + ranges =3D <0x0 0x0 0x0 0x83000100 0x0 0x0 0x0 0x4000>, + <0x2 0x0 0x0 0x83000100 0x0 0x4000 0x0 0x80000>, + <0x4 0x0 0x0 0x83000100 0x0 0x84000 0x0 0x200000>; + + pci-ep-bus@4 { + compatible =3D "simple-bus"; + #address-cells =3D <1>; + #size-cells =3D <1>; + /* Map 0x0-0x1fffff to BAR 4 */ + ranges =3D <0x0 0x4 0x0 0x0 0x200000>; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 6096dab7121e8..aa6b805e1ab2b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -27670,6 +27670,12 @@ F: Documentation/devicetree/bindings/media/i2c/tos= hiba,tc358743.txt F: drivers/media/i2c/tc358743* F: include/media/i2c/tc358743.h =20 +TOSHIBA TC9564 PCI DRIVER +M: Alex Elder +M: Daniel Thompson +S: Maintained +F: Documentation/devicetree/bindings/misc/pci1179,0220.yaml + TOSHIBA WMI HOTKEYS DRIVER M: Azael Avalos L: platform-driver-x86@vger.kernel.org --=20 2.53.0 From nobody Thu Sep 24 23:32:00 2026 Received: from mail-qk2-f43.google.com (mail-qk2-f43.google.com [74.125.230.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F06FF4F3ED4 for ; Fri, 18 Sep 2026 15:27:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.230.235 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789745233; cv=none; b=lKbJ4mZJoi0kjfc1mJbCTAH9vL0YJhC0Jr0UUCY6qQlcw9s4ix3NCaNiXrelEkOQw2dUFkhfsn0bSQW3w52gYvV3Dpw/BY75K1mNHpKkrgteKdkoYVGnhYd+fwfZLwLZoD4+5urDWjbMBwcRHH1frlVCEAFcOKPFOoDOLIjEsR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789745233; c=relaxed/simple; bh=COBOR/J1xKvdjdfhzkygn5/MMwImdCVq1tdwr8l5gi4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MmsnSjrZGBQsNsl5CoCXGfMOKfi4E0gjq3ydeIhWgXA+4QDzYL9j8FxAEXHQNpQ3yPNzkf1m50NPAEraTmf1zgXzRxma3F6ofL4F92n7SD6bal5Hvn5JdOTElthfi6IpTPCnCrCzfnMFe1GRv4jNHkWzFVCYKGpPt53akAF35Sk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b=k+dNFuLl; arc=none smtp.client-ip=74.125.230.235 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="k+dNFuLl" Received: by mail-qk2-f43.google.com with SMTP id af79cd13be357-939109f067cso90279685a.3 for ; Fri, 18 Sep 2026 08:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1789745226; x=1790350026; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=BnXYtnVnoVw2HAMCABb9i/9BDSRkcXebPIHKXClOGFU=; b=k+dNFuLlfdvprj8gM4eRBgOQRMHYhsrIWb6NfwKcwAJkUTig4/Ishbipb2pNUKfNGF r2BIUxyg91OBLBDv1puBQ0utEYuylT01j8xGvIK7UMHuFx5+vr15zv/8eiimYgvQdbX2 1yYx1+C9tuV2LqzxWHutgqJvouElnuYD9NnZNuyffmXNX0kuMeVtUsfsJcz0sS/mBI4h 4EzZA8ErHtpwsDOt5yMcsxMN5Hglos/F85l2/0EQeU1+bZEQPi2vJ6WlcbtZ3O+YpG9M 631xRn+RKakFWV4J5j51nhzxTy6clZH+Gqw2apJMUH0jeh0L4yEJH1cXBysQ7inmyVCb Ry+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789745226; x=1790350026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=BnXYtnVnoVw2HAMCABb9i/9BDSRkcXebPIHKXClOGFU=; b=n0TSUwtYDdRrK64rp99vDxJR1qOY0ySF2RaJbIoaA4uvFP3u532pRN6UmhuYicudeC 9KER6QHCUnRF2N6p1sC5DxWYGPs48kd51xonIYQ5iYnlIUrJBhk63Y2RYkzpvyMwj2xe V0fZTkG5MO3u+ZA3iIZFoHseCdcO37CO1EQFJiBzBAC2aFkU7PnVs0Svqabg9qcea3mt aABOwXx0y/iZjuxjR8XGgPwBk93fEVmvOd58Q7jnDpAXKGcP+aeaPv/SMycszL8xaerF FMvs+PgBkg9Oq+JwEZIM5NKBxzxMitU7C2yWhfYHkCwd97Db1yI5AfvqwnGafUuOgwVa Ynkg== X-Forwarded-Encrypted: i=1; AKwUvBwASL2lvQePQxXp39VM7RezrelZOkrd0Xx8avIWEe8POC8TLIwu4W5f8G/vqXTnpW8mamSN/XZTpCPWt9c=@vger.kernel.org X-Gm-Message-State: AFuF++lz6I7WbqsSgTklb1+P9pHrPcw+FoM9B0/WAwGDAhXrFDq8vUue OYyPmbX3FsKvl+rNbMQXSjIgv5hqyUOnYAZ2JorT/bSQdnWMLCVihlSCSHpgF6+KTZY= X-Gm-Gg: AYBFou0OhNMQNPCT6jsIW1p2mDIhg1h5WfTIa1ZJJE9dgKHBDDnyklvlH7hPXyiUfdL otceXLfilimqrNtM1vYXN6MWQIr/ISf7+5n4mPpy64Q7gu1ax1wdc1uqXcmYAQW05h/6SxC2pMN W3MM4HwVvNl9QOX/pM/bbfd5IoILOE4sSg3veanOFvIeJ9EQfmb0js+1/Oze7544QoduN1pfxMP h7RczxgP8GrFmMGry9dbj+gqE4BCOsfDW/ySh8uFUQV3CCn3C35UwL0pGoTlM4zVZ1nK6tikPHL 6l7GSO9axaL88XWPc3eYrudN17ZgWBzwdj3sC2+wowYkNCtNEKgKVrH5gW45wJJgwfqi22JT5Lh XeD+m82iZSHphSVmS9dLuSdCbunEXKXAmqRJWF4n0v5vacB9/sEXX30i8YRWLw+T+k6Cx2479By ehSYQpv4U/Fq0lmmlFyP8RFIjog71yIDRUCKZ8tmiVi/0lmWNp5CCgZVaRvsoXfr0cTxmUQWgrk 3U= X-Received: by 2002:a05:620a:254a:b0:93b:d79f:d951 with SMTP id af79cd13be357-93bdca433b5mr406199585a.70.1789745226375; Fri, 18 Sep 2026 08:27:06 -0700 (PDT) Received: from zippy.localdomain ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-91257f326d8sm15099766d6.6.2026.09.18.08.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2026 08:27:06 -0700 (PDT) From: Alex Elder To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, bhelgaas@google.com, andersson@kernel.org, konradybcio@kernel.org, abelvesa@kernel.org Cc: daniel@riscstar.com, mohd.anwar@oss.qualcomm.com, lorenzo.bianconi@oss.qualcomm.com, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/3] misc: tc9564: introduce base PCI driver Date: Fri, 18 Sep 2026 10:26:57 -0500 Message-ID: <20260918152659.413268-3-elder@riscstar.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260918152659.413268-1-elder@riscstar.com> References: <20260918152659.413268-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Toshiba TC9564 is small and highly-specialized SoC that implements a PCIe switch as well as an Ethernet AVB/TSN bridge. In addition to these, the SoC implements other functions, including a reset and clock controller, an address translation unit, and a few other devices. PCIe BARs provide access to registers that manage these IP blocks, and the SoC is modeled using a PCI endpoint bus in devicetree. This allows the IP blocks to be bound to platform drivers that do MMIO via the PCI BARs. Create a new PCI driver under drivers/misc that binds with the embedded PCI endpoint functions within the TC9564 SoC. Because these functions will use devicetree pci-ep-bus to provide access to other IP blocks within the TC9564 chip, the main purpose of this driver is to do basic PCI initialization, then call of_platform_default_populate() to scan for the any endpoint bus children, and probe all devices defined therein. Because we're using pci-ep-bus, we need to use the PCI quirks mechanism to have of_pci_make_dev_node() be called for each endpoint device in pci_bus_add_device() (via pci_fixup_device(pci_fixup_final, dev)). Co-developed-by: Daniel Thompson Signed-off-by: Daniel Thompson Signed-off-by: Alex Elder Acked-by: Bjorn Helgaas # quirks.c --- v4: - Refined the definition of the TC9564_PCI Kconfig entry - Now use pci_enable_device() rather than pcim_enable_device() MAINTAINERS | 1 + drivers/misc/Kconfig | 15 +++++++ drivers/misc/Makefile | 1 + drivers/misc/tc9564-pci.c | 84 +++++++++++++++++++++++++++++++++++++++ drivers/pci/quirks.c | 1 + 5 files changed, 102 insertions(+) create mode 100644 drivers/misc/tc9564-pci.c diff --git a/MAINTAINERS b/MAINTAINERS index aa6b805e1ab2b..cf846853fdc79 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -27675,6 +27675,7 @@ M: Alex Elder M: Daniel Thompson S: Maintained F: Documentation/devicetree/bindings/misc/pci1179,0220.yaml +F: drivers/misc/tc9564-pci.c =20 TOSHIBA WMI HOTKEYS DRIVER M: Azael Avalos diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 7364931dad3a1..9c5b1e9d672e8 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -568,6 +568,21 @@ config MCHP_LAN966X_PCI - lan966x-miim (MDIO_MSCC_MIIM) - lan966x-switch (LAN966X_SWITCH) =20 +config TC9564_PCI + tristate "Toshiba TC9564 PCI function support" + depends on OF + depends on PCI + select PCI_DYNAMIC_OF_NODES + select PCI_QUIRKS + default m + help + This enables support for two PCI functions implemented by the + embedded PCIe endpoint in the Toshiba TC9564 SoC. A platform + driver uses a pci-ep-bus node in devicetree to provide MMIO + access to other SoC devices through PCI function BARs. A PCI + quirk causes the ranges property in the endpoint's devicetree + node to be updated dynamically. + source "drivers/misc/c2port/Kconfig" source "drivers/misc/eeprom/Kconfig" source "drivers/misc/cb710/Kconfig" diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index e8d8d5d88c0df..7cc3d615d37a4 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -71,3 +71,4 @@ obj-y +=3D keba/ obj-y +=3D amd-sbi/ obj-$(CONFIG_MISC_RP1) +=3D rp1/ obj-$(CONFIG_INTEL_SSEI) +=3D issei/ +obj-$(CONFIG_TC9564_PCI) +=3D tc9564-pci.o diff --git a/drivers/misc/tc9564-pci.c b/drivers/misc/tc9564-pci.c new file mode 100644 index 0000000000000..e4d00dfecfca9 --- /dev/null +++ b/drivers/misc/tc9564-pci.c @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * Copyright (C) 2026 by RISCstar Solutions Corporation. All rights reser= ved. + */ + +/* + * The Toshiba TC9564 implements a PCIe Gen 3 switch that connects an + * upstream x4 port to three downstream PCIe ports. Two of the downstream + * ports are external, and the third is internal, implementing a PCIe + * endpoint which implements two PCIe functions. Each PCIe function drives + * a Synopsys XGMAC Ethernet interface capable of 10 Gbps operation. + * + * The TC9564 implements other functionality, including an embedded MCU, + * a UART, a GPIO controller, a reset controller, a clock controller, and + * interrupt handling. These features are separate from (and in some + * cases used by) both Ethernet XGMACs. Each Ethernet MAC must be + * attached to a working PHY for it to be functional, and for this + * reason either of them (or both!) might not be usable/used. + * + * This PCI driver binds to the Toshiba TC9564 (physical) PCI function + * (VID 0x1179, DID 0x0220). + */ + +#include +#include +#include +#include +#include + +static void tc9564_function_remove(struct pci_dev *pdev) +{ + of_platform_depopulate(&pdev->dev); + pci_clear_master(pdev); + pci_disable_device(pdev); +} + +static int +tc9564_function_probe(struct pci_dev *pdev, const struct pci_device_id *id) +{ + struct device *dev =3D &pdev->dev; + struct device_node *np; + int ret; + + /* Despite being a PCI device, we require devicetree */ + np =3D dev_of_node(dev); + if (!np) + return dev_err_probe(dev, -EINVAL, "no devicetree node\n"); + + ret =3D pci_enable_device(pdev); + if (ret) + return dev_err_probe(dev, ret, "failed to enable device\n"); + + pci_set_master(pdev); + + /* Scan for pci-ep-bus (simple-bus) nodes and probe their sub-devices */ + ret =3D of_platform_default_populate(np, NULL, dev); + if (ret) + goto err_depopulate; + + return 0; + +err_depopulate: + tc9564_function_remove(pdev); + + return dev_err_probe(dev, ret, "failed to populate platform bus\n"); +} + +static const struct pci_device_id tc9564_function_id_table[] =3D { + { PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA, 0x0220), }, + { }, +}; +MODULE_DEVICE_TABLE(pci, tc9564_function_id_table); + +static struct pci_driver tc9564_function_driver =3D { + .name =3D KBUILD_MODNAME, + .id_table =3D tc9564_function_id_table, + .probe =3D tc9564_function_probe, + .remove =3D tc9564_function_remove, +}; +module_pci_driver(tc9564_function_driver); + +MODULE_DESCRIPTION("Toshiba TC9564 PCIe Embedded Function Driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index de9bbccda21fd..54e310c4153df 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -6391,6 +6391,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5020,= of_pci_make_dev_node); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node= ); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005, of_pci_make_dev_node= ); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, 0x9660, of_pci_make_dev_node); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TOSHIBA, 0x0220, of_pci_make_dev_nod= e); =20 /* * Devices known to require a longer delay before first config space access --=20 2.53.0 From nobody Thu Sep 24 23:32:00 2026 Received: from mail-qk2-f42.google.com (mail-qk2-f42.google.com [74.125.230.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4222250276F for ; Fri, 18 Sep 2026 15:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.230.234 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789745234; cv=none; b=Tzz2R6VC2c4nN52SBNv77hmFjzReqphb3XQanXJ2f9kFm0EYUCFvqiixEnCgIihemgiaQCuynGKrYw/7HEhgBE6vJ8XKGMcQtrote1EU3v/BMAu/bBiOrAaIFvjAhO7pe5dK2rPzWoNGn1p2Zio2yH7sxVQTQTI/fTsGs1hdUOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789745234; c=relaxed/simple; bh=Yrg8axLPLWORg699bra798c8gsnBqtweBph1kEWPw3s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KPDW6B2yUZQPTzmIuVDI9KCsHKYkU/Z8zgY71dNEXq5fDnri08wTWoECbPOdYNPpTA6y7vdJsqrdq19S8i2HQvxk38qalDbeYvienuFSkAaPcdfdvUfFrzFHEnQOevZqL/+95m17BfhIHbmC2sfUsxtPtb+WTJShmEHY6p5siKA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b=RS+Df+lP; arc=none smtp.client-ip=74.125.230.234 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="RS+Df+lP" Received: by mail-qk2-f42.google.com with SMTP id d75a77b69052e-5329fc7e0bcso9918751cf.1 for ; Fri, 18 Sep 2026 08:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1789745228; x=1790350028; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=TOeSHivgGtBKP6OSBvHEzAeHzrnxsuhi0YKgz/54Wow=; b=RS+Df+lPU0Bch51mpyx2zIXy1mn308spz/kJd19Z3NzjbJs/ig8NhFZHaNN6C0p51c ky+XAYBIab87qUWlDoSudil7ChLeFbmpr/J5UZXXJMIrYW2HFOaXLDZK6vY89yIeZpvn lu8Yx/7YYsDzu9/ixJMhdG4dfea6njc8JQGY72MBWupNmxWQ1b2FaEOqnE07yR2EFRMa YwizgoVt6FpYq+/KcSvSmt9aBtE2JZA1yu5Zay/Nkt4wEfTRJhG9wq4cIxhopjdWHjtk YIptxyQcaNiqeZNKhzh2/4g7DrhbvnVaSHJjF0IJXMtHGNw5p7Tl/Q5y/hR2HpkLX8lX 3p5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789745228; x=1790350028; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=TOeSHivgGtBKP6OSBvHEzAeHzrnxsuhi0YKgz/54Wow=; b=xy0qBe0cZzF8nzI7OI8CHM++g23yaYOu4YRj0hr9VxpLV+tqhJR1QaQXno3IS8yWHc nEJg+JJi53Lhq8isEW/0ryiWLyHz2lfwhm5zRJDu1F9+a0y01XH9Nki7CmCCH/RtdKqz D9a0WgPzPC5LfRx5UMJCdvn20+QfwXpWQuQDhd/hAZfq/ANvV3u2HME220mB2MiJvXn/ To2+nvCp8HL+v9yA2j8/wjs2cHRDa0jDF5T1IHGPnCIIsGScSRz15ocC6vm2Z3nqlA+S lO8F+yfl0pRsGLMiFIWHxSd6bPZJAFxec5mEWLRDIbIiA382UxBiQmHNyCHxocyKrZw2 JFYw== X-Forwarded-Encrypted: i=1; AKwUvBznu7yPUUElYDMBIYZ2kD0rPDXv1czDsZ+yEnTMvq7iCDwXtycy9QQaIZkflBWu/CM/nnkNaCuAEqYIYwM=@vger.kernel.org X-Gm-Message-State: AFuF++lgFqr0xRQHmtuZAWmc4xcouA4+2zjRNOK17Fmmgy+QAq2A9l18 J2fLpOpwRUB0XDFTOiYBzXR2/oJMZBpp3JJVK49ZtjwgRgc1Fxgq08K/L5LqMvv+wKo= X-Gm-Gg: AYBFou04k2jLnBxgLMkV+Pm3+XN1Yj5nESkFXgsd0yedAEK0UqFBldp9zRJ0bmaQpw9 zEzKAh9Oa1k2teYC6SG9aDwfA10UMc2/7e0uq2t7ez6IvAFDk8qw4IdOQOtnaaTaFis5JTzAjcs 5K+1e8CNSBIjdxduPDzHnYWfZf6VNgT6Cy13xepzWyp6FKJw6gSN5EelmJNcEmbp1v2nac0YHDD porPqOTmDwWmRrt8V9cnxaWkOogrsHlXGB7Q1FMfMtjUhp2dAakTiiFNksVIXtcnioYRvT2+fXg YyzxrqnBtRMifVUKwRSiK8gqgBgk1MuapcZ/K9SHfpqHKR7l3kkOhBUIiydghtiexPq8KrG6BTl YS19KUV26jAISuDtuNeAPw27hJOcdwLHuSCUWBA8EYYc6SdZhHc700el/474hdVbfn2gfOWbwli QVcs8qcZ6Oeul/JrefM5/NtjAphuezHstoC8ACN1z67HMFVlVqI5UPUXIckg4KMsJm3rqLBv7KN zbh X-Received: by 2002:a05:622a:30a:b0:532:84d3:ac7 with SMTP id d75a77b69052e-5329e47ff64mr49202771cf.41.1789745227649; Fri, 18 Sep 2026 08:27:07 -0700 (PDT) Received: from zippy.localdomain ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-91257f326d8sm15099766d6.6.2026.09.18.08.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2026 08:27:07 -0700 (PDT) From: Alex Elder To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, bhelgaas@google.com, andersson@kernel.org, konradybcio@kernel.org, abelvesa@kernel.org Cc: daniel@riscstar.com, mohd.anwar@oss.qualcomm.com, lorenzo.bianconi@oss.qualcomm.com, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/3] arm64: dts: qcom: qcs6490-rb3gen2: add endpoint buses Date: Fri, 18 Sep 2026 10:26:58 -0500 Message-ID: <20260918152659.413268-4-elder@riscstar.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260918152659.413268-1-elder@riscstar.com> References: <20260918152659.413268-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The TC9564 SoC incorporates a PCIe switch, which is connected via the second PCI segment (0001) on the RB3gen2 platform. The third downstream port of that switch (pcie@3,0) has an embedded PCIe endpoint that implements two PCIe functions. The SoC implements other peripherals, and they will be accessed via PCI endpoint bus. Define the devicetree nodes representing these buses, including the mapping of each BAR's address range to its local address space. The endpoint's ranges property must be defined, but it will be updated dynamically to include all BARs. As a result of this update, the parent address portion of each range will reflect the specific address assigned to the BAR. Co-developed-by: Daniel Thompson Signed-off-by: Daniel Thompson Signed-off-by: Alex Elder --- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot= /dts/qcom/qcs6490-rb3gen2.dts index 3bb5fca8e2b13..5b7f5292a8864 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts @@ -955,11 +955,41 @@ pcie@3,0 { bus-range =3D <0x5 0xff>; =20 dev@0,0 { + compatible =3D "pci1179,0220"; reg =3D <0x50000 0x0 0x0 0x0 0x0>; + #address-cells =3D <3>; + #size-cells =3D <2>; + /* Ranges will be updated dynamically */ + ranges =3D <0x0 0x0 0x0 0x83050000 0x0 0x0 0x0 0x4000>, + <0x2 0x0 0x0 0x83050000 0x0 0x4000 0x0 0x80000>, + <0x4 0x0 0x0 0x83050000 0x0 0x84000 0x0 0x200000>; + + pci-ep-bus@4 { + compatible =3D "simple-bus"; + #address-cells =3D <1>; + #size-cells =3D <1>; + /* Map 0x0-0x1fffff to BAR 4 */ + ranges =3D <0x0 0x4 0x0 0x0 0x200000>; + }; }; =20 dev@0,1 { + compatible =3D "pci1179,0220"; reg =3D <0x50100 0x0 0x0 0x0 0x0>; + #address-cells =3D <3>; + #size-cells =3D <2>; + /* Ranges will be updated dynamically */ + ranges =3D <0x0 0x0 0x0 0x83050100 0x0 0x0 0x0 0x4000>, + <0x2 0x0 0x0 0x83050100 0x0 0x4000 0x0 0x80000>, + <0x4 0x0 0x0 0x83050100 0x0 0x84000 0x0 0x200000>; + + pci-ep-bus@4 { + compatible =3D "simple-bus"; + #address-cells =3D <1>; + #size-cells =3D <1>; + /* Map 0x0-0x1fffff to BAR 4 */ + ranges =3D <0x0 0x4 0x0 0x0 0x200000>; + }; }; }; }; --=20 2.53.0