mvebu: cp110: avoid pcie power on/off sequence when called from Linux
authorIgal Liberman <igall@marvell.com>
Thu, 15 Nov 2018 14:13:11 +0000 (16:13 +0200)
committerKonstantin Porotchkin <kostap@marvell.com>
Tue, 4 Dec 2018 12:09:44 +0000 (14:09 +0200)
commit55df84f974ea37abbb4f93f000f101f70cda5303
tree74c33588cb82230e87c23d9d426d2be41a1049a8
parent9cb6751d5988fe62d10b809469d4f6ec082730c6
mvebu: cp110: avoid pcie power on/off sequence when called from Linux

In Armada 8K DB boards, PCIe initialization can be executed only once
because PCIe reset performed during chip power on and it cannot be
executed via GPIO later.
This means that power on can be executed only once, when it's called
from the bootloader.
Power on:
Read bit 21 of the mode, it marks if the caller is
the bootloader or the Linux Kernel.
Power off:
Check if the comphy was already configured to PCIe, if yes,
check if the caller is bootloader, if both conditions are true
(PCIe mode and called by Linux) - skip the power-off.

In addition, fix incorrect documentation describing mode fields -
PCIe width is 3 bits, not 2.

NOTE: with this patch, please use LK4.14.76 (LK4.4.120 may not work
with it).

Change-Id: I4b929011f97a0a1869a51ba378687e78b3eca4ff
Signed-off-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
drivers/marvell/comphy/phy-comphy-common.h
drivers/marvell/comphy/phy-comphy-cp110.c
drivers/marvell/comphy/phy-comphy-cp110.h
plat/marvell/common/mrvl_sip_svc.c