Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c77ee2c
BACKPORT: gpio: tc9563: Add support for the embedded GPIO controller
alexelder Sep 9, 2026
ccd9b3f
BACKPORT: dt-bindings: PCI: toshiba,tc9563: Document embedded GPIO co…
LorenzoBianconi Sep 9, 2026
af24aa0
BACKPORT: PCI/pwrctrl: tc9563: Take i2c adapter module reference
jhovold Jul 16, 2026
386da38
BACKPORT: PCI/pwrctrl: tc9563: Fix parsing the integrated Ethernet MA…
Mani-Sadhasivam Jul 25, 2026
c7f2ffa
BACKPORT: PCI/pwrctrl: tc9563: Power off only the external ports in t…
Mani-Sadhasivam Jul 25, 2026
9e9ee26
BACKPORT: PCI/pwrctrl: tc9563: Skip Tx amplitude and DFE tuning for DSP3
Mani-Sadhasivam Jul 25, 2026
148ea9f
BACKPORT: PCI/pwrctrl: tc9563: Rename DSP3 to VDSP
Mani-Sadhasivam Jul 25, 2026
cc5b80a
BACKPORT: dt-bindings: Fix phandle-array constraints, again
robherring May 7, 2026
c7ede54
BACKPORT: PCI/pwrctrl: tc9563: Move Integrated MAC Endpoint out of 't…
Mani-Sadhasivam Jul 25, 2026
b0e677b
BACKPORT: PCI/pwrctrl: tc9563: Rely on regmap APIs
LorenzoBianconi Jul 29, 2026
a9297b7
BACKPORT: PCI/pwrctrl: tc9563: Use devm-managed I2C dummy device allo…
LorenzoBianconi Jul 29, 2026
7abafc5
BACKPORT: PCI/pwrctrl: tc9563: Allow RESX reset assertion to sleep
Aug 25, 2026
528d12f
BACKPORT: PCI/pwrctrl: tc9563: Add GPIO auxiliary device support
LorenzoBianconi Sep 9, 2026
554dd6a
PENDING: PCI/pwrctrl: tc9563: Re-sync endpoint reset GPIO direction a…
hariharan-sree Nov 25, 2026
c96bedf
PENDING: PCI: qcom: Allow downstream PCIe devices to provide PERST# G…
hariharan-sree Nov 25, 2026
ecf1c31
PENDING: arm64: configs: qcom: Enable TC9563 embedded GPIO controller
hariharan-sree Nov 25, 2026
b5f2181
PENDING: arm64: dts: qcom: talos-lyra-evk: Use TC9563 embedded GPIO c…
hariharan-sree Nov 25, 2026
eb0fa9c
PENDING: dt-bindings: PCI: toshiba,tc9563: Document reset-gpios and g…
hariharan-sree Nov 25, 2026
e402fca
PENDING: arm64: dts: qcom: talos-lyra-evk: Disable ASPM L1 for TC9563…
hariharan-sree Nov 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ properties:
reg:
maxItems: 1

'#gpio-cells':
const: 2

resx-gpios:
maxItems: 1
description:
GPIO controlling the RESX# pin.

gpio-controller: true

'#gpio-cells':
const: 2

vdd18-supply: true

vdd09-supply: true
Expand All @@ -52,8 +54,9 @@ properties:
A phandle to the parent I2C node and the slave address of the device
used to configure tc9563 to change FTS, tx amplitude etc.
items:
- description: Phandle to the I2C controller node
- description: I2C slave address
- items:
- description: Phandle to the I2C controller node
- description: I2C slave address

patternProperties:
"^pcie@[1-3],0$":
Expand All @@ -76,6 +79,14 @@ $defs:
Specify the TC9563 GPIO used to reset the endpoint
connected to the particular TC9563 downstream port.

reset-gpios:
maxItems: 1
description:
TC9563 GPIO, provided by the embedded GPIO controller, that
resets the endpoint connected to the downstream port. The PCIe
host controller drives it together with its own PERST# when it
keeps the switch powered across system suspend.

ep-pwr-en-gpio:
description:
Specify the TC9563 GPIO used for enabling power to
Expand Down Expand Up @@ -117,7 +128,7 @@ examples:
#address-cells = <3>;
#size-cells = <2>;

tc9563: pcie@0 {
pcie@0 {
device_type = "pci";
reg = <0x0 0x0 0x0 0x0 0x0>;

Expand All @@ -126,13 +137,14 @@ examples:
ranges;
bus-range = <0x01 0xff>;

pcie@0,0 {
tc9563: pcie@0,0 {
compatible = "pci1179,0623";

reg = <0x10000 0x0 0x0 0x0 0x0>;
device_type = "pci";
#address-cells = <3>;
#size-cells = <2>;
gpio-controller;
#gpio-cells = <2>;
ranges;
bus-range = <0x02 0xff>;
Expand All @@ -157,6 +169,8 @@ examples:
ranges;
bus-range = <0x03 0xff>;

reset-gpios = <&tc9563 2 GPIO_ACTIVE_LOW>;

toshiba,no-dfe-support;
};

Expand All @@ -170,7 +184,6 @@ examples:
bus-range = <0x04 0xff>;

ep-pwr-en-gpio = <&tc9563 2 GPIO_ACTIVE_HIGH>;
ep-reset-gpio = <&tc9563 5 GPIO_ACTIVE_HIGH>;
};

pcie@3,0 {
Expand Down
12 changes: 11 additions & 1 deletion arch/arm64/boot/dts/qcom/talos-lyra-evk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,14 @@
reg = <0x10000 0x0 0x0 0x0 0x0>;
#address-cells = <3>;
#size-cells = <2>;
gpio-controller;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split into logical atomic commits. This is a mixture of everything.

@hariharan-sree Hariharan Sreedhar (hariharan-sree) Nov 26, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the whole changes into atomic commits

#gpio-cells = <2>;
device_type = "pci";
ranges;
bus-range = <0x2 0xff>;

aspm-no-l1;

vddc-supply = <&vreg_0p9>;
vdd18-supply = <&vreg_1p8>;
vdd09-supply = <&vreg_0p9>;
Expand All @@ -320,8 +323,10 @@
ranges;
bus-range = <0x3 0xff>;

aspm-no-l1;

ep-pwr-en-gpio = <&tc9563 2 GPIO_ACTIVE_HIGH>;
ep-reset-gpio = <&tc9563 5 GPIO_ACTIVE_HIGH>;
reset-gpios = <&tc9563 5 GPIO_ACTIVE_LOW>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there two GPIO specs using the same GPIO and opposite active flags?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed redundant ep-reset-gpio


port {
tc9563_pcie1_ep: endpoint {};
Expand All @@ -336,8 +341,11 @@
ranges;
bus-range = <0x4 0xff>;

aspm-no-l1;

ep-pwr-en-gpio = <&tc9563 4 GPIO_ACTIVE_HIGH>;
ep-reset-gpio = <&tc9563 3 GPIO_ACTIVE_HIGH>;
reset-gpios = <&tc9563 3 GPIO_ACTIVE_LOW>;
};

pcie@3,0 {
Expand All @@ -348,6 +356,8 @@
ranges;
bus-range = <0x5 0xff>;

aspm-no-l1;

pci@0,0 {
reg = <0x50000 0x0 0x0 0x0 0x0>;
#address-cells = <3>;
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/qcom.config
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ CONFIG_EDAC_QCOM=m
CONFIG_EXPERT=y
CONFIG_FW_LOADER_COMPRESS=y
CONFIG_FW_LOADER_COMPRESS_ZSTD=y
CONFIG_GPIO_TC9563=y
CONFIG_GUNYAH_WATCHDOG=y
CONFIG_I2C_QCOM_GENI=y
CONFIG_I6300ESB_WDT=y
Expand Down
27 changes: 27 additions & 0 deletions drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,33 @@ config GPIO_WM8994

endmenu

menu "Auxiliary Bus GPIO drivers"
depends on AUXILIARY_BUS

config GPIO_LTC4283
tristate "Analog Devices LTC4283 GPIO support"
depends on SENSORS_LTC4283
help
If you say yes here you want the GPIO function available in Analog
Devices LTC4283 Negative Voltage Hot Swap Controller.

This driver can also be built as a module. If so, the module will
be called gpio-ltc4283.

endmenu

config GPIO_TC9563
tristate "Toshiba TC9563 GPIO support"
depends on PCI_PWRCTRL_TC9563 || COMPILE_TEST
default m if ARCH_QCOM
select AUXILIARY_BUS
select GPIO_REGMAP
help
This enables support for the GPIO controller embedded in the Toshiba
TC9563 (and Qualcomm QPS615). This device connects to the host
via PCIe port, which is the upstream port on an internal PCIe
switch.

menu "PCI GPIO expanders"
depends on PCI

Expand Down
1 change: 1 addition & 0 deletions drivers/gpio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ obj-$(CONFIG_GPIO_SYSCON) += gpio-syscon.o
obj-$(CONFIG_GPIO_TANGIER) += gpio-tangier.o
obj-$(CONFIG_GPIO_TB10X) += gpio-tb10x.o
obj-$(CONFIG_GPIO_TC3589X) += gpio-tc3589x.o
obj-$(CONFIG_GPIO_TC9563) += gpio-tc9563.o
obj-$(CONFIG_GPIO_TEGRA186) += gpio-tegra186.o
obj-$(CONFIG_GPIO_TEGRA) += gpio-tegra.o
obj-$(CONFIG_GPIO_THUNDERX) += gpio-thunderx.o
Expand Down
92 changes: 92 additions & 0 deletions drivers/gpio/gpio-tc9563.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2026 by RISCstar Solutions Corporation. All rights reserved.
*/

/*
* The Toshiba TC9563 implements a PCIe Gen 3 switch that connects an
* upstream x4 port to two downstream PCIe x2 ports. It incorporates
* an internal endpoint on a internal PCIe port that implements two
* Synopsys XGMAC Ethernet interfaces.
*
* 37 GPIOs are also implemented by an embedded GPIO controller. Three
* registers control the first 32 GPIOs (other than 20 and 21, which are
* reserved). Three other registers control GPIOs 32 through 36. GPIOs
* 22-24, 27-28, 31, and 34 are treated as "input only".
*
*/

#include <linux/auxiliary_bus.h>
#include <linux/gpio/driver.h>
#include <linux/gpio/regmap.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/soc/qcom/tc9563.h>

/*
* There are two sets of registers, each representing (up to) 32 GPIOs with a
* stride of 4 bytes (IN1 is 4 bytes past IN0, EN1 is 4 bytes past EN0, etc.).
*/
#define TC9563_GPIO_COUNT 37
#define TC9563_GPIO_PER_REG 32
#define TC9563_GPIO_REG_STRIDE 4

static int tc9563_gpio_init_valid_mask(struct gpio_chip *gc,
unsigned long *valid_mask,
unsigned int ngpios)
{
/* GPIOs 20 and 21 are reserved */
bitmap_fill(valid_mask, ngpios);
bitmap_clear(valid_mask, 20, 2);

return 0;
}

static int tc9563_gpio_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *id)
{
struct gpio_regmap_config config = {
.parent = &adev->dev,
.ngpio = TC9563_GPIO_COUNT,
.reg_stride = TC9563_GPIO_REG_STRIDE,
.ngpio_per_reg = TC9563_GPIO_PER_REG,
.reg_dat_base = GPIO_REGMAP_ADDR(TC9563_GPIO_IN0_OFFSET),
.reg_set_base = GPIO_REGMAP_ADDR(TC9563_GPIO_OUT0_OFFSET),
.reg_dir_in_base = GPIO_REGMAP_ADDR(TC9563_GPIO_EN0_OFFSET),
.init_valid_mask = tc9563_gpio_init_valid_mask,
};

config.regmap = dev_get_platdata(&adev->dev);
if (!config.regmap)
return -EINVAL;

/*
* GPIOs 22, 23, 24, 27, 28, 31, and 34 are input-only, but this
* kernel's gpio-regmap core only supports a single, chip-wide
* fixed_direction_output bitmap, with no way to leave the
* remaining GPIOs under reg_dir_in_base control. Rely on
* reg_dir_in_base for direction on all valid GPIOs instead;
* the input-only lines simply never get switched to output.
*/

return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(&adev->dev, &config));
};

static const struct auxiliary_device_id tc9563_gpio_ids[] = {
{ "pci_pwrctrl_tc9563." TC9563_GPIO_DEV_NAME },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(auxiliary, tc9563_gpio_ids);

static struct auxiliary_driver tc9563_gpio_driver = {
.name = TC9563_GPIO_DEV_NAME,
.probe = tc9563_gpio_probe,
.id_table = tc9563_gpio_ids,
};
module_auxiliary_driver(tc9563_gpio_driver);

MODULE_AUTHOR("Alex Elder <elder@riscstar.com>");
MODULE_AUTHOR("Daniel Thompson <daniel@riscstar.com>");
MODULE_AUTHOR("Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>");
MODULE_DESCRIPTION("Toshiba TC9563 GPIO Driver");
MODULE_LICENSE("GPL");
Loading