From nobody Tue Sep 29 01:18:10 2026 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 EA40D3F5BD8 for ; Thu, 13 Aug 2026 22:29:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786660191; cv=none; b=LXjMV8xOeaG2BVVAxjVluAHepVy+xWtnmuuG5peD2F1nNRGXa/F9ZnYjPyksQh5lrbeZaFx//rBSikqfVCDTXoiE31Brl1ZfjMc97DDmHK9NMZ16CPfSCW3GKtvSCe9HcrGKDN9vV9FdmQeW6ke6mcbSrLG8NvAruGxe1nDFTUw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786660191; c=relaxed/simple; bh=Eol9WmL1O9f4MknTj6uP8Y6OkojPYS15FpPdbxYO2eg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tLc/q/5J9u502pjCN07bVxSAgy3dMl2k3R6ueWwKeSR0MvZfHCIi88I/Uch3Zu6r3afMHTrDnBLHIgJcV8bQFMsKLuHOBw7PjZx//9LIwd37xkHMBvyTKghVQ5902GnqXe2s4+6y+3CvdvSswXHa9mRqWf/feOhLZwwcfi4tWKM= 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=AAggATrq; arc=none smtp.client-ip=209.85.219.47 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="AAggATrq" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-8f032b47e3cso2059946d6.0 for ; Thu, 13 Aug 2026 15:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1786660189; x=1787264989; 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=nMqFoXd0sNHquHpZhWWDvUj9eRzJLL5tulsVnJoSaCk=; b=AAggATrqFgMAHTz0oU4WzmeMTq3qM765C8x1qVIQIzYEPuz5+bvRXlQuMPVmD4OxWv jket0ZTzgcYgfVvvF6XXx3lE7Z9h/0l2LhTWCxHNPZf0KoPHVlUumQnv4T33VQhP9VU6 gz5io2pk/Nt6m2JpChc8yoCaFp9lZ05Sr9H+t+pPqgezIcdUj8WUiXBfweo8BeJx+jwC e6Bm8c0QfxaUYsBbhNOGwpo+f58v1hChqKOI4DL/wkNm/yzIQv5Q9t0o2VN8i1FQZgaP kV26+pYdlGi6iNbopa/UGeP877M7XrXf2sbCH5zzdpvIUmUazZlGKsHutLUKnUhCblm1 Fxew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786660189; x=1787264989; 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=nMqFoXd0sNHquHpZhWWDvUj9eRzJLL5tulsVnJoSaCk=; b=Uxps39BwgTKCvwj87tDFM7WvoUX8qLHgPDpE068UgjAcAcASX2ISt0WjhIApY7IE6h ijnHE7xfWl2RJtbLkP9IjFErYbtYatLWj2exyER57QoCL/QeoQLWq2wNvk6YJ33zLogl PwZFaMCb+ViB69CvMGGG3gnjdCb1Esf1ncAJsfwjRbIaeZ4jumAKKHhDDCSmG0UQcDlU i/u+enzrd184HQe0233bF4aqLUfmIXQPuxJ0GEghSewmnhBJDl2H+MiZRnzGVuoI/dOh isjLv5ZI6fHQlRfsyzTbW+lCQwJUBDHVwVcWPC2b8dmthQ345ql1af73kJboeOe3nfda tSBA== X-Forwarded-Encrypted: i=1; AHgh+Rq2Jcfm2BhBFnNeZpuLQQGTEcITiFwXqCmEIpTj3uejNnRooebuRPzgUL0oI7ia565pGjSGHPNbsuUJ6cQ=@vger.kernel.org X-Gm-Message-State: AOJu0YznGvpiu8VF3xjyhf8VZJdabtRibJ3aB72lSyB4u/hV+9mywKGM IVjT/YcpEzrHJ/Ejd6PHYuAtphs4J1aZEBtGyfTmipCQFcdZFj+T0Qi6nL4Vkw37vMI= X-Gm-Gg: AR+sD13XvrFWzYoHfP5w7eOYSOs7tFB21khPGiLQEMFGdkMABtyiif207Mg2a1ia6rb qFzU1Esl1pr559m64rAaoXmmOzL0WDaPR/2UubtjZoiN5Pi1Tmh+xLt33SjISfT6bssKGqH3er5 JVkH9bglPCu1VrW+eg437pXQI81ByXqgYrW+EvAz8Q+MxNTTHEwqXdyy4aljobOP2S5z6sUMI1V 5+/bNcXl97nmUWMURtKtKEyoyiImW5T5/uI70cG9Ku2qQpFDSzkxcIst4v+jNPlXvIK1GmhQCb5 SFIIcfzHeioZ70Z6MHc/GnOVuTI2jPWLjZe+SargixnNOiwW+8bOGmkqlYsfiP839kt4Nfk90M6 WIHMWm/mES1GO02azkfuueOgh3loeh1RVhm2bN23Dimvk4kkPM85RMyAEb14vdaj1A0XwwJX6ih RA4Lz61clAcTatApxaCy7V+j0zRhEaV/i6nrYxOIWLRWlT7wpDNUxPxd9Dd2V0Owr5 X-Received: by 2002:ad4:5745:0:b0:907:c056:d648 with SMTP id 6a1803df08f44-90a91cfcd61mr13880936d6.2.1786660188696; Thu, 13 Aug 2026 15:29:48 -0700 (PDT) Received: from zippy.localdomain ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90a921ea2dbsm2367506d6.7.2026.08.13.15.29.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 15:29:47 -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 Cc: daniel@riscstar.com, mohdayaa@qti.qualcomm.com, lbiancon@qti.qualcomm.com, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] dt-bindings: misc: introduce pci1179,0220.yaml Date: Thu, 13 Aug 2026 17:29:41 -0500 Message-ID: <20260813222943.1655453-2-elder@riscstar.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260813222943.1655453-1-elder@riscstar.com> References: <20260813222943.1655453-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. Signed-off-by: Daniel Thompson Signed-off-by: Alex Elder --- .../bindings/misc/pci1179,0220.yaml | 150 ++++++++++++++++++ MAINTAINERS | 6 + 2 files changed, 156 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..30a76f377eec8 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/pci1179,0220.yaml @@ -0,0 +1,150 @@ +# 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 | | + | | | | 0 | | 4 | | 4 | | + | | DS1 DS2 | ----.---- ----.---- ----.---- | + | --++------++-- : ...: :... | + | || || : : : ------- : | | + | || || -------.--- -.- :...|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 TC96564 (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 { + reg =3D <0x0 0x0>; + #address-cells =3D <3>; + #size-cells =3D <2>; + device_type =3D "pci"; + ranges =3D <0x83000000 0x0 0x0 0x0 0x0 0x1fd00000>; + + pci@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 0x0 0x0 0x80000>, + <0x4 0x0 0x0 0x83000000 0x0 0x0 0x0 0x200000>; + + pci-ep-bus@0 { + compatible =3D "simple-bus"; + #address-cells =3D <1>; + #size-cells =3D <1>; + /* Map 0x0-0x3fff to BAR 0 */ + ranges =3D <0x0 0x0 0x0 0x0 0x4000>; + }; + + 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>; + }; + }; + + pci@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 0x0 0x0 0x80000>, + <0x4 0x0 0x0 0x83000100 0x0 0x0 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 15c7dc516f7cf..7b7966ad3dea5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -27615,6 +27615,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 Tue Sep 29 01:18:10 2026 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (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 497923FD12A for ; Thu, 13 Aug 2026 22:29:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786660194; cv=none; b=LxrR4oK1kwJh1A5GrrSBeEkzCfsQgnQ+d10W7P+AJxDXCEulOiAPu6la+ybXuyrIrWYvqa5hbMwUvQ7oG2P/pjEJDKP4z1hpFkWmg3GTd+tGrH+EAqI3wAkoFuPifpmfNUpW3zYGMcGjhZuxagtj2dpIHo5ULySsmUBBaoVa29U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786660194; c=relaxed/simple; bh=nSLOh0R2kDve7q5wgtB1h8VLnLESxogNNkvg+i0t6Wk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Hn/Hz1Jhi55Q+gimf1Zo6XnxARE6X4MZ4GPFcJW3yDrXVQO8g9cGrmmOI6iG6QxC5PBlAy/RKm09yMtUGRw45XiRnMAXihiUl2suawLIB2pHCTXtxSeyMPJFzddYr6PyvlbD8BkA+R4jv0Ymg/uypoi/Lnr69T0s6w7Iydiq1Hc= 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=0zTrz3Jj; arc=none smtp.client-ip=209.85.219.50 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="0zTrz3Jj" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-90898faf46dso1784616d6.1 for ; Thu, 13 Aug 2026 15:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1786660191; x=1787264991; 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=M3rOgdkqoqF1YP7KocOmlm1bhe3NA1tNbYdJmmyzt1o=; b=0zTrz3JjD+kahoThxOY1i6QW4Tfjj7UXXRPcq26xqakvqIM02VP5IcuReHJRPRmruN lK97DRgyUeP34tYMx6C98qf8hPdtV5RoD/1WfNwoYl1NoYKWQrSb/TV0/efnj4jjX3kF WnldauPtshngH2kK5594EPOkkvSIDswOM2Q9XZBSHoNkEXGFPqqS2JjVgSTAlVojX/Vo XMDuZEI+DLYaCF+1Fzkk53gM3F4HUyN+eOcdk89ZmrZxDqYqmlbpl3VpLdlKDpInp3jY R79XPTs3Rj6nmYOq0c/Spwj2P7Fkp+I6bkPwXMg1Dwc+I3JYE4TPKLPzzreq0zz6LPu1 lc5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786660191; x=1787264991; 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=M3rOgdkqoqF1YP7KocOmlm1bhe3NA1tNbYdJmmyzt1o=; b=TooDc5JYBhLv5gz+67TPL+h3o5vQ0seOThuF9Wk4T+kGyEebatDMfsm5G5L3MyvGao 2x4OoEk7H3SG2HIn5oVsEA8T1Forhcqkj8AE9L3L0yN1RONcy4oOSBB81QAeimJCvTvT A9XP+9EW8wAsMyADghIHvLStpjq1FrsARxEU5ftuOC6oOcUTj95wq+cCVPvHw/msqxO8 7IueslFijzrcyuvy5gDOzR/s1WAl+fY0Y1AxQcYzzOQGPPFoxxJ7YSk7cM6u27DqmD1u VuChdg94IW8VU5GzKq6IpfzV/v5kczOo7rruBDNo4R5HJsQbD52iigv2LdjaZxdAeEvq /tgA== X-Forwarded-Encrypted: i=1; AHgh+RrSdIuTQhiI2JTJwTXee3wzIunD3fbRjvBZEwdjHTlVP5/f7z4dZFE+WszCCzbUgRofChvKWJ0y8DMXouk=@vger.kernel.org X-Gm-Message-State: AOJu0YzxpAGw9Vt+WQKDhPRrKWelzWgqWdjQM3OOYXsxiu1pFZlSSxs+ KZe8xbVF1fsIk6XOY8X0E3T5kIFArIyZQ1F3U8e5VmQE914fn7tukS7QRYk3CRibcao= X-Gm-Gg: AR+sD10lStrR4aV5USX2mgDOVfZI9V7T3QFZpE7d4rT5pY17a4Vn0ekgNjKOx4snDnt cgq/jgasxvqmk8KBm8bzBe/LPSVyWAKBMQhI2K3vJfRNEAIs/qMyYam0tnMcroDT4ABLzR1U7fE Hvp9TvPqGiuzCB4coB+HZSdsTlZRtca4yvjvFnNYjnBzsW/BFYwEWOQEOD2JaMpaElyV8CWGaeS aLC46jU/TCQeJXtelVvvENUA83O89o3Sldmy4AQDbozhwApDVPxDDIVtfYohW0PGIe5X0j/ECcF NjYxod72tzcu1XyFPAmSAqVgseD56bN1iRRu31KEeciN5l0slDp4FShdD/nnpfL84/id7xDcvW2 xcTyjAaYD62fFSOWX+8YHg7OUTiwY1gsX/MwUrIG5GijzSIvcPWZolgXJGkSNHVyUcopqGcvp9o zIbnzxQZPp+4HsOFLTU7pT1T/D0ZZnAKrk3Dc35ull83Npw4NGpjjAuThgZJpHZJBe X-Received: by 2002:a05:6214:1316:b0:8f2:3472:5b33 with SMTP id 6a1803df08f44-90a91da5cd9mr13296916d6.23.1786660190035; Thu, 13 Aug 2026 15:29:50 -0700 (PDT) Received: from zippy.localdomain ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90a921ea2dbsm2367506d6.7.2026.08.13.15.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 15:29:49 -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 Cc: daniel@riscstar.com, mohdayaa@qti.qualcomm.com, lbiancon@qti.qualcomm.com, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] misc: tc9564: introduce base PCI driver Date: Thu, 13 Aug 2026 17:29:42 -0500 Message-ID: <20260813222943.1655453-3-elder@riscstar.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260813222943.1655453-1-elder@riscstar.com> References: <20260813222943.1655453-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 using MMIO through 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)). Signed-off-by: Daniel Thompson Signed-off-by: Alex Elder --- MAINTAINERS | 1 + drivers/misc/Kconfig | 10 +++++ drivers/misc/Makefile | 1 + drivers/misc/tc9564-pci.c | 89 +++++++++++++++++++++++++++++++++++++++ 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 7b7966ad3dea5..125fa60122c4e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -27620,6 +27620,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..91950d2928f07 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -568,6 +568,16 @@ 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 PCI + select REGMAP_MMIO + help + This enables support for the two PCI functions implemented by + the embedded PCIe endpoint in the Toshiba TC9564 SoC. This + driver uses a pci-ep-bus node in devicetree to provide MMIO + access to other SoC devices through PCI function BARs. + 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..d3ffcac1c522f --- /dev/null +++ b/drivers/misc/tc9564-pci.c @@ -0,0 +1,89 @@ +// 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 with 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 + +#define DRIVER_NAME "tc9564-pci" + +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 pcim_enable_device(pdev); + if (ret) + return ret; + + pci_set_master(pdev); + + /* Scan for pci-ep-bus nodes and probe their sub-devices */ + ret =3D of_platform_default_populate(np, NULL, dev); + if (ret) + goto err_clear_master; + + return 0; + +err_clear_master: + pci_clear_master(pdev); + + return dev_err_probe(dev, ret, "failed to populate platform bus\n"); +} + +static void tc9564_function_remove(struct pci_dev *pdev) +{ + of_platform_depopulate(&pdev->dev); + pci_clear_master(pdev); +} + +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 DRIVER_NAME, + .id_table =3D tc9564_function_id_table, + .probe =3D tc9564_function_probe, + .remove =3D tc9564_function_remove, + .driver =3D { + .name =3D DRIVER_NAME, + .owner =3D THIS_MODULE, + }, +}; +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 6501c949c5b76..b484f1b1d0e71 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -6388,6 +6388,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