FROMLIST: PCI: rockchip: Add system PM support
This patch adds system PM support for Rockchip's RC.
For pre S3, the EP is configured into D3 state which guarantees
the link state should be in L1. So we could send PME_Turn_Off message
to the EP and wait for its ACK to make the link state into L2 or L3
without the aux-supply. This could help save more power which I think
should be very important for mobile devices.
As note that there is a 5s timeout for RC to wait for the PMA_ACK
aftering send PME_Turn_Off. Technically it should depends on the
hierarchy of devices but seems PCIe core framework doesn't handle the
L2/3 for S3 at all. So that means we should presume to set a default
value for PME_ACK. From the bug report[1], we could find a statement that
Microsoft Windows versions typically wait for 5 seconds. So we are prone
to take 5s for this timeout here.
Change-Id: I3500911daaad07dfd632cda0f2f4b62cfc2909a2
[1] https://lists.launchpad.net/kernel-packages/msg123315.html
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/
9470515/)