Skip to content

Conversation

krishnachaitanya-linux
Copy link

Fix the compilation error for pwrctrl driver tc9563.

Add a device tree binding for the Toshiba TC9563 PCIe switch, which
provides an Ethernet MAC integrated to the 3rd downstream port and
two downstream PCIe ports.

Link: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Krishna Chaitanya Chundru <[email protected]>
Reviewed-by: Rob Herring (Arm) <[email protected]>
First controller driver probes, enables link training and scans the
bus. When the PCI bridge is found, its child DT nodes will be scanned
and pwrctrl devices will be created if needed. By the time pwrctrl
driver probe gets called link training is already enabled by controller
driver.

Certain devices like TC956x which uses PCI pwrctl framework needs to
configure the device before PCI link is up.

As the controller driver already enables link training as part of
its probe, the moment device is powered on, controller and device
participates in the link training and link can come up immediately
and maynot have time to configure the device.

So we need to stop the link training by using stop_link() and enable
them back after device is configured by using start_link().

Link: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Krishna Chaitanya Chundru <[email protected]>
…or dwc glue drivers

Add host_start_link() and host_stop_link() functions to dwc glue drivers to
register with start_link() and stop_link() of pci ops, allowing for better
control over the link initialization and shutdown process.

Link: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Krishna Chaitanya Chundru <[email protected]>
Implement stop_link() and  start_link() function op for dwc drivers.

Link: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Krishna Chaitanya Chundru <[email protected]>
…nk()

Add support for host_stop_link() and host_start_link() for switches like
TC956x, which require configuration before the PCIe link is established.

Assert PERST# and disable LTSSM bit to prevent the PCIe controller from
participating in link training during host_stop_link(). De-assert PERST#
and enable LTSSM bit during host_start_link().

Introduce ltssm_disable function op to stop link training.
For the switches like TC956x, which needs to configure it before
the PCIe link is established.

Link: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Krishna Chaitanya Chundru <[email protected]>
…e link is active

Introduce a common API to check if the PCIe link is active, replacing
duplicate code in multiple locations.

Link: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Krishna Chaitanya Chundru <[email protected]>
Reviewed-by: Lukas Wunner <[email protected]>
TC9563 is a PCIe switch which has one upstream and three downstream
ports. To one of the downstream ports ethernet MAC is connected as endpoint
device. Other two downstream ports are supposed to connect to external
device. One Host can connect to TC9563 by upstream port. TC9563 switch
needs to be configured after powering on and before PCIe link was up.

The PCIe controller driver already enables link training at the host side
even before this driver probe happens, due to this when driver enables
power to the switch it participates in the link training and PCIe link
may come up before configuring the switch through i2c. Once the link is
up the configuration done through i2c will not have any affect.To prevent
the host from participating in link training, disable link training on the
host side to ensure the link does not come up before the switch is
configured via I2C.

Based up on dt property and type of the port, tc9563 is configured
through i2c.

Link: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Krishna Chaitanya Chundru <[email protected]>
Reviewed-by: Bjorn Andersson <[email protected]>
Reviewed-by: Bartosz Golaszewski <[email protected]>
Fix the compilation error for pwrctrl driver tc9563.

Signed-off-by: Krishna Chaitanya Chundru <[email protected]>
@shashim-quic
Copy link
Collaborator

@krishnachaitanya-linux is this PR still applicable ? Are you planning to drop PENDING ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants