kernel: 5.10: Backport pending Armada 3720 comphy patches
Backport 5 pending patches [1] for Armada 3720 comphy driver and one patch for device tree, applied to mvebu-dt64, but pending to appear in Linus' tree [2]. These patches makes the driver work correctly even with older, buggy versions of TF-A firmware. [1] http://lists.infradead.org/pipermail/linux-phy/2022-January/002598.html [2] http://lists.infradead.org/pipermail/linux-phy/2021-December/002279.html Signed-off-by: Marek Behún <kabel@kernel.org>
This commit is contained in:
		 Marek Behún
					Marek Behún
				
			
				
					committed by
					
						 Christian Lamparter
						Christian Lamparter
					
				
			
			
				
	
			
			
			 Christian Lamparter
						Christian Lamparter
					
				
			
						parent
						
							cf3a6e62a1
						
					
				
				
					commit
					bf991fa357
				
			| @@ -0,0 +1,222 @@ | |||||||
|  | From a719f7ba7fcba05d85801c6f0267f389a21627c1 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org> | ||||||
|  | Date: Fri, 24 Sep 2021 13:03:02 +0200 | ||||||
|  | Subject: [PATCH] phy: marvell: phy-mvebu-a3700-comphy: Remove port from driver | ||||||
|  |  configuration | ||||||
|  | MIME-Version: 1.0 | ||||||
|  | Content-Type: text/plain; charset=UTF-8 | ||||||
|  | Content-Transfer-Encoding: 8bit | ||||||
|  |  | ||||||
|  | Port number is encoded into argument for SMC call. It is zero for SATA, | ||||||
|  | PCIe and also both USB 3.0 PHYs. It is non-zero only for Ethernet PHY | ||||||
|  | (incorrectly called SGMII) on lane 0. Ethernet PHY on lane 1 also uses zero | ||||||
|  | port number. | ||||||
|  |  | ||||||
|  | So construct "port" bits for SMC call argument can be constructed directly | ||||||
|  | from PHY type and lane number. | ||||||
|  |  | ||||||
|  | Change driver code to always pass zero port number for non-ethernet PHYs | ||||||
|  | and for ethernet PHYs determinate port number from lane number. This | ||||||
|  | simplifies the driver. | ||||||
|  |  | ||||||
|  | As port number from DT PHY configuration is not used anymore, remove whole | ||||||
|  | driver code which parses it. This also simplifies the driver. | ||||||
|  |  | ||||||
|  | Signed-off-by: Pali Rohár <pali@kernel.org> | ||||||
|  | Signed-off-by: Marek Behún <kabel@kernel.org> | ||||||
|  | Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> | ||||||
|  | --- | ||||||
|  |  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 62 +++++++++----------- | ||||||
|  |  1 file changed, 29 insertions(+), 33 deletions(-) | ||||||
|  |  | ||||||
|  | diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c | ||||||
|  | index 6781488cfc58..dbb2d4308851 100644 | ||||||
|  | --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c | ||||||
|  | +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c | ||||||
|  | @@ -20,7 +20,6 @@ | ||||||
|  |  #include <linux/platform_device.h> | ||||||
|  |   | ||||||
|  |  #define MVEBU_A3700_COMPHY_LANES		3 | ||||||
|  | -#define MVEBU_A3700_COMPHY_PORTS		2 | ||||||
|  |   | ||||||
|  |  /* COMPHY Fast SMC function identifiers */ | ||||||
|  |  #define COMPHY_SIP_POWER_ON			0x82000001 | ||||||
|  | @@ -45,51 +44,47 @@ | ||||||
|  |  #define COMPHY_FW_NET(mode, idx, speed)		(COMPHY_FW_MODE(mode) | \ | ||||||
|  |  						 ((idx) << 8) |	\ | ||||||
|  |  						 ((speed) << 2)) | ||||||
|  | -#define COMPHY_FW_PCIE(mode, idx, speed, width)	(COMPHY_FW_NET(mode, idx, speed) | \ | ||||||
|  | +#define COMPHY_FW_PCIE(mode, speed, width)	(COMPHY_FW_NET(mode, 0, speed) | \ | ||||||
|  |  						 ((width) << 18)) | ||||||
|  |   | ||||||
|  |  struct mvebu_a3700_comphy_conf { | ||||||
|  |  	unsigned int lane; | ||||||
|  |  	enum phy_mode mode; | ||||||
|  |  	int submode; | ||||||
|  | -	unsigned int port; | ||||||
|  |  	u32 fw_mode; | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | -#define MVEBU_A3700_COMPHY_CONF(_lane, _mode, _smode, _port, _fw)	\ | ||||||
|  | +#define MVEBU_A3700_COMPHY_CONF(_lane, _mode, _smode, _fw)		\ | ||||||
|  |  	{								\ | ||||||
|  |  		.lane = _lane,						\ | ||||||
|  |  		.mode = _mode,						\ | ||||||
|  |  		.submode = _smode,					\ | ||||||
|  | -		.port = _port,						\ | ||||||
|  |  		.fw_mode = _fw,						\ | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  | -#define MVEBU_A3700_COMPHY_CONF_GEN(_lane, _mode, _port, _fw) \ | ||||||
|  | -	MVEBU_A3700_COMPHY_CONF(_lane, _mode, PHY_INTERFACE_MODE_NA, _port, _fw) | ||||||
|  | +#define MVEBU_A3700_COMPHY_CONF_GEN(_lane, _mode, _fw) \ | ||||||
|  | +	MVEBU_A3700_COMPHY_CONF(_lane, _mode, PHY_INTERFACE_MODE_NA, _fw) | ||||||
|  |   | ||||||
|  | -#define MVEBU_A3700_COMPHY_CONF_ETH(_lane, _smode, _port, _fw) \ | ||||||
|  | -	MVEBU_A3700_COMPHY_CONF(_lane, PHY_MODE_ETHERNET, _smode, _port, _fw) | ||||||
|  | +#define MVEBU_A3700_COMPHY_CONF_ETH(_lane, _smode, _fw) \ | ||||||
|  | +	MVEBU_A3700_COMPHY_CONF(_lane, PHY_MODE_ETHERNET, _smode, _fw) | ||||||
|  |   | ||||||
|  |  static const struct mvebu_a3700_comphy_conf mvebu_a3700_comphy_modes[] = { | ||||||
|  |  	/* lane 0 */ | ||||||
|  | -	MVEBU_A3700_COMPHY_CONF_GEN(0, PHY_MODE_USB_HOST_SS, 0, | ||||||
|  | +	MVEBU_A3700_COMPHY_CONF_GEN(0, PHY_MODE_USB_HOST_SS, | ||||||
|  |  				    COMPHY_FW_MODE_USB3H), | ||||||
|  | -	MVEBU_A3700_COMPHY_CONF_ETH(0, PHY_INTERFACE_MODE_SGMII, 1, | ||||||
|  | +	MVEBU_A3700_COMPHY_CONF_ETH(0, PHY_INTERFACE_MODE_SGMII, | ||||||
|  |  				    COMPHY_FW_MODE_SGMII), | ||||||
|  | -	MVEBU_A3700_COMPHY_CONF_ETH(0, PHY_INTERFACE_MODE_2500BASEX, 1, | ||||||
|  | +	MVEBU_A3700_COMPHY_CONF_ETH(0, PHY_INTERFACE_MODE_2500BASEX, | ||||||
|  |  				    COMPHY_FW_MODE_2500BASEX), | ||||||
|  |  	/* lane 1 */ | ||||||
|  | -	MVEBU_A3700_COMPHY_CONF_GEN(1, PHY_MODE_PCIE, 0, | ||||||
|  | -				    COMPHY_FW_MODE_PCIE), | ||||||
|  | -	MVEBU_A3700_COMPHY_CONF_ETH(1, PHY_INTERFACE_MODE_SGMII, 0, | ||||||
|  | +	MVEBU_A3700_COMPHY_CONF_GEN(1, PHY_MODE_PCIE, COMPHY_FW_MODE_PCIE), | ||||||
|  | +	MVEBU_A3700_COMPHY_CONF_ETH(1, PHY_INTERFACE_MODE_SGMII, | ||||||
|  |  				    COMPHY_FW_MODE_SGMII), | ||||||
|  | -	MVEBU_A3700_COMPHY_CONF_ETH(1, PHY_INTERFACE_MODE_2500BASEX, 0, | ||||||
|  | +	MVEBU_A3700_COMPHY_CONF_ETH(1, PHY_INTERFACE_MODE_2500BASEX, | ||||||
|  |  				    COMPHY_FW_MODE_2500BASEX), | ||||||
|  |  	/* lane 2 */ | ||||||
|  | -	MVEBU_A3700_COMPHY_CONF_GEN(2, PHY_MODE_SATA, 0, | ||||||
|  | -				    COMPHY_FW_MODE_SATA), | ||||||
|  | -	MVEBU_A3700_COMPHY_CONF_GEN(2, PHY_MODE_USB_HOST_SS, 0, | ||||||
|  | +	MVEBU_A3700_COMPHY_CONF_GEN(2, PHY_MODE_SATA, COMPHY_FW_MODE_SATA), | ||||||
|  | +	MVEBU_A3700_COMPHY_CONF_GEN(2, PHY_MODE_USB_HOST_SS, | ||||||
|  |  				    COMPHY_FW_MODE_USB3H), | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | @@ -98,7 +93,6 @@ struct mvebu_a3700_comphy_lane { | ||||||
|  |  	unsigned int id; | ||||||
|  |  	enum phy_mode mode; | ||||||
|  |  	int submode; | ||||||
|  | -	int port; | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  |  static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane, | ||||||
|  | @@ -120,7 +114,7 @@ static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane, | ||||||
|  |  	} | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -static int mvebu_a3700_comphy_get_fw_mode(int lane, int port, | ||||||
|  | +static int mvebu_a3700_comphy_get_fw_mode(int lane, | ||||||
|  |  					  enum phy_mode mode, | ||||||
|  |  					  int submode) | ||||||
|  |  { | ||||||
|  | @@ -132,7 +126,6 @@ static int mvebu_a3700_comphy_get_fw_mode(int lane, int port, | ||||||
|  |   | ||||||
|  |  	for (i = 0; i < n; i++) { | ||||||
|  |  		if (mvebu_a3700_comphy_modes[i].lane == lane && | ||||||
|  | -		    mvebu_a3700_comphy_modes[i].port == port && | ||||||
|  |  		    mvebu_a3700_comphy_modes[i].mode == mode && | ||||||
|  |  		    mvebu_a3700_comphy_modes[i].submode == submode) | ||||||
|  |  			break; | ||||||
|  | @@ -153,7 +146,7 @@ static int mvebu_a3700_comphy_set_mode(struct phy *phy, enum phy_mode mode, | ||||||
|  |  	if (submode == PHY_INTERFACE_MODE_1000BASEX) | ||||||
|  |  		submode = PHY_INTERFACE_MODE_SGMII; | ||||||
|  |   | ||||||
|  | -	fw_mode = mvebu_a3700_comphy_get_fw_mode(lane->id, lane->port, mode, | ||||||
|  | +	fw_mode = mvebu_a3700_comphy_get_fw_mode(lane->id, mode, | ||||||
|  |  						 submode); | ||||||
|  |  	if (fw_mode < 0) { | ||||||
|  |  		dev_err(lane->dev, "invalid COMPHY mode\n"); | ||||||
|  | @@ -172,9 +165,10 @@ static int mvebu_a3700_comphy_power_on(struct phy *phy) | ||||||
|  |  	struct mvebu_a3700_comphy_lane *lane = phy_get_drvdata(phy); | ||||||
|  |  	u32 fw_param; | ||||||
|  |  	int fw_mode; | ||||||
|  | +	int fw_port; | ||||||
|  |  	int ret; | ||||||
|  |   | ||||||
|  | -	fw_mode = mvebu_a3700_comphy_get_fw_mode(lane->id, lane->port, | ||||||
|  | +	fw_mode = mvebu_a3700_comphy_get_fw_mode(lane->id, | ||||||
|  |  						 lane->mode, lane->submode); | ||||||
|  |  	if (fw_mode < 0) { | ||||||
|  |  		dev_err(lane->dev, "invalid COMPHY mode\n"); | ||||||
|  | @@ -191,17 +185,18 @@ static int mvebu_a3700_comphy_power_on(struct phy *phy) | ||||||
|  |  		fw_param = COMPHY_FW_MODE(fw_mode); | ||||||
|  |  		break; | ||||||
|  |  	case PHY_MODE_ETHERNET: | ||||||
|  | +		fw_port = (lane->id == 0) ? 1 : 0; | ||||||
|  |  		switch (lane->submode) { | ||||||
|  |  		case PHY_INTERFACE_MODE_SGMII: | ||||||
|  |  			dev_dbg(lane->dev, "set lane %d to SGMII mode\n", | ||||||
|  |  				lane->id); | ||||||
|  | -			fw_param = COMPHY_FW_NET(fw_mode, lane->port, | ||||||
|  | +			fw_param = COMPHY_FW_NET(fw_mode, fw_port, | ||||||
|  |  						 COMPHY_FW_SPEED_1_25G); | ||||||
|  |  			break; | ||||||
|  |  		case PHY_INTERFACE_MODE_2500BASEX: | ||||||
|  |  			dev_dbg(lane->dev, "set lane %d to 2500BASEX mode\n", | ||||||
|  |  				lane->id); | ||||||
|  | -			fw_param = COMPHY_FW_NET(fw_mode, lane->port, | ||||||
|  | +			fw_param = COMPHY_FW_NET(fw_mode, fw_port, | ||||||
|  |  						 COMPHY_FW_SPEED_3_125G); | ||||||
|  |  			break; | ||||||
|  |  		default: | ||||||
|  | @@ -212,8 +207,7 @@ static int mvebu_a3700_comphy_power_on(struct phy *phy) | ||||||
|  |  		break; | ||||||
|  |  	case PHY_MODE_PCIE: | ||||||
|  |  		dev_dbg(lane->dev, "set lane %d to PCIe mode\n", lane->id); | ||||||
|  | -		fw_param = COMPHY_FW_PCIE(fw_mode, lane->port, | ||||||
|  | -					  COMPHY_FW_SPEED_5G, | ||||||
|  | +		fw_param = COMPHY_FW_PCIE(fw_mode, COMPHY_FW_SPEED_5G, | ||||||
|  |  					  phy->attrs.bus_width); | ||||||
|  |  		break; | ||||||
|  |  	default: | ||||||
|  | @@ -247,17 +241,20 @@ static struct phy *mvebu_a3700_comphy_xlate(struct device *dev, | ||||||
|  |  					    struct of_phandle_args *args) | ||||||
|  |  { | ||||||
|  |  	struct mvebu_a3700_comphy_lane *lane; | ||||||
|  | +	unsigned int port; | ||||||
|  |  	struct phy *phy; | ||||||
|  |   | ||||||
|  | -	if (WARN_ON(args->args[0] >= MVEBU_A3700_COMPHY_PORTS)) | ||||||
|  | -		return ERR_PTR(-EINVAL); | ||||||
|  | - | ||||||
|  |  	phy = of_phy_simple_xlate(dev, args); | ||||||
|  |  	if (IS_ERR(phy)) | ||||||
|  |  		return phy; | ||||||
|  |   | ||||||
|  |  	lane = phy_get_drvdata(phy); | ||||||
|  | -	lane->port = args->args[0]; | ||||||
|  | + | ||||||
|  | +	port = args->args[0]; | ||||||
|  | +	if (port != 0 && (port != 1 || lane->id != 0)) { | ||||||
|  | +		dev_err(lane->dev, "invalid port number %u\n", port); | ||||||
|  | +		return ERR_PTR(-EINVAL); | ||||||
|  | +	} | ||||||
|  |   | ||||||
|  |  	return phy; | ||||||
|  |  } | ||||||
|  | @@ -302,7 +299,6 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev) | ||||||
|  |  		lane->mode = PHY_MODE_INVALID; | ||||||
|  |  		lane->submode = PHY_INTERFACE_MODE_NA; | ||||||
|  |  		lane->id = lane_id; | ||||||
|  | -		lane->port = -1; | ||||||
|  |  		phy_set_drvdata(phy, lane); | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  | --  | ||||||
|  | 2.34.1 | ||||||
|  |  | ||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -0,0 +1,36 @@ | |||||||
|  | From 66c51c39fd4bf05e99debf0e71de5704231c57dc Mon Sep 17 00:00:00 2001 | ||||||
|  | From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org> | ||||||
|  | Date: Thu, 23 Sep 2021 19:26:26 +0200 | ||||||
|  | Subject: [PATCH] arm64: dts: marvell: armada-37xx: Add xtal clock to comphy | ||||||
|  |  node | ||||||
|  | MIME-Version: 1.0 | ||||||
|  | Content-Type: text/plain; charset=UTF-8 | ||||||
|  | Content-Transfer-Encoding: 8bit | ||||||
|  |  | ||||||
|  | Kernel driver phy-mvebu-a3700-comphy.c needs to know the rate of the | ||||||
|  | reference xtal clock. So add missing xtal clock source into comphy device | ||||||
|  | tree node. If the property is not present, the driver defaults to 25 MHz | ||||||
|  | xtal rate (which, as far as we know, is used by all the existing boards). | ||||||
|  |  | ||||||
|  | Signed-off-by: Pali Rohár <pali@kernel.org> | ||||||
|  | Signed-off-by: Marek Behún <kabel@kernel.org> | ||||||
|  | --- | ||||||
|  |  arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 ++ | ||||||
|  |  1 file changed, 2 insertions(+) | ||||||
|  |  | ||||||
|  | diff --git a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi | ||||||
|  | index 2a2015a15362..a7262d2591dc 100644 | ||||||
|  | --- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi | ||||||
|  | +++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi | ||||||
|  | @@ -265,6 +265,8 @@ comphy: phy@18300 { | ||||||
|  |  					    "lane2_sata_usb3"; | ||||||
|  |  				#address-cells = <1>; | ||||||
|  |  				#size-cells = <0>; | ||||||
|  | +				clocks = <&xtalclk>; | ||||||
|  | +				clock-names = "xtal"; | ||||||
|  |   | ||||||
|  |  				comphy0: phy@0 { | ||||||
|  |  					reg = <0>; | ||||||
|  | --  | ||||||
|  | 2.34.1 | ||||||
|  |  | ||||||
| @@ -0,0 +1,70 @@ | |||||||
|  | From 750bb44dbbe9dfb4ba3e1f8a746b831b39ba3cd9 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org> | ||||||
|  | Date: Thu, 23 Sep 2021 19:35:57 +0200 | ||||||
|  | Subject: [PATCH] Revert "ata: ahci: mvebu: Make SATA PHY optional for Armada | ||||||
|  |  3720" | ||||||
|  | MIME-Version: 1.0 | ||||||
|  | Content-Type: text/plain; charset=UTF-8 | ||||||
|  | Content-Transfer-Encoding: 8bit | ||||||
|  |  | ||||||
|  | This reverts commit 45aefe3d2251e4e229d7662052739f96ad1d08d9. | ||||||
|  |  | ||||||
|  | Armada 3720 PHY driver (phy-mvebu-a3700-comphy.c) does not return | ||||||
|  | -EOPNOTSUPP from phy_power_on() callback anymore. | ||||||
|  |  | ||||||
|  | So remove AHCI_HFLAG_IGN_NOTSUPP_POWER_ON flag from Armada 3720 plat data. | ||||||
|  |  | ||||||
|  | AHCI_HFLAG_IGN_NOTSUPP_POWER_ON is not used by any other ahci driver, so | ||||||
|  | remove this flag completely. | ||||||
|  |  | ||||||
|  | Signed-off-by: Pali Rohár <pali@kernel.org> | ||||||
|  | Signed-off-by: Marek Behún <kabel@kernel.org> | ||||||
|  | Acked-by: Miquel Raynal <miquel.raynal@bootlin.com> | ||||||
|  | --- | ||||||
|  |  drivers/ata/ahci.h             | 2 -- | ||||||
|  |  drivers/ata/ahci_mvebu.c       | 2 +- | ||||||
|  |  drivers/ata/libahci_platform.c | 2 +- | ||||||
|  |  3 files changed, 2 insertions(+), 4 deletions(-) | ||||||
|  |  | ||||||
|  | diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h | ||||||
|  | index d1f284f0c83d..3a3e67350e50 100644 | ||||||
|  | --- a/drivers/ata/ahci.h | ||||||
|  | +++ b/drivers/ata/ahci.h | ||||||
|  | @@ -240,8 +240,6 @@ enum { | ||||||
|  |  							as default lpm_policy */ | ||||||
|  |  	AHCI_HFLAG_SUSPEND_PHYS		= (1 << 26), /* handle PHYs during | ||||||
|  |  							suspend/resume */ | ||||||
|  | -	AHCI_HFLAG_IGN_NOTSUPP_POWER_ON	= (1 << 27), /* ignore -EOPNOTSUPP | ||||||
|  | -							from phy_power_on() */ | ||||||
|  |  	AHCI_HFLAG_NO_SXS		= (1 << 28), /* SXS not supported */ | ||||||
|  |   | ||||||
|  |  	/* ap->flags bits */ | ||||||
|  | diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c | ||||||
|  | index 3ad46d26d9d5..d4bba3ace45d 100644 | ||||||
|  | --- a/drivers/ata/ahci_mvebu.c | ||||||
|  | +++ b/drivers/ata/ahci_mvebu.c | ||||||
|  | @@ -227,7 +227,7 @@ static const struct ahci_mvebu_plat_data ahci_mvebu_armada_380_plat_data = { | ||||||
|  |   | ||||||
|  |  static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = { | ||||||
|  |  	.plat_config = ahci_mvebu_armada_3700_config, | ||||||
|  | -	.flags = AHCI_HFLAG_SUSPEND_PHYS | AHCI_HFLAG_IGN_NOTSUPP_POWER_ON, | ||||||
|  | +	.flags = AHCI_HFLAG_SUSPEND_PHYS, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  |  static const struct of_device_id ahci_mvebu_of_match[] = { | ||||||
|  | diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c | ||||||
|  | index 0910441321f7..250b82e30aa3 100644 | ||||||
|  | --- a/drivers/ata/libahci_platform.c | ||||||
|  | +++ b/drivers/ata/libahci_platform.c | ||||||
|  | @@ -59,7 +59,7 @@ int ahci_platform_enable_phys(struct ahci_host_priv *hpriv) | ||||||
|  |  		} | ||||||
|  |   | ||||||
|  |  		rc = phy_power_on(hpriv->phys[i]); | ||||||
|  | -		if (rc && !(rc == -EOPNOTSUPP && (hpriv->flags & AHCI_HFLAG_IGN_NOTSUPP_POWER_ON))) { | ||||||
|  | +		if (rc) { | ||||||
|  |  			phy_exit(hpriv->phys[i]); | ||||||
|  |  			goto disable_phys; | ||||||
|  |  		} | ||||||
|  | --  | ||||||
|  | 2.34.1 | ||||||
|  |  | ||||||
| @@ -0,0 +1,175 @@ | |||||||
|  | From 9f0dfb279b1dd505d5e10b10e4a78a62030978d8 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org> | ||||||
|  | Date: Thu, 23 Sep 2021 19:40:06 +0200 | ||||||
|  | Subject: [PATCH] Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for | ||||||
|  |  Armada 3720" | ||||||
|  | MIME-Version: 1.0 | ||||||
|  | Content-Type: text/plain; charset=UTF-8 | ||||||
|  | Content-Transfer-Encoding: 8bit | ||||||
|  |  | ||||||
|  | This reverts commit 3241929b67d28c83945d3191c6816a3271fd6b85. | ||||||
|  |  | ||||||
|  | Armada 3720 phy driver (phy-mvebu-a3700-comphy.c) does not return | ||||||
|  | -EOPNOTSUPP from phy_power_on() callback anymore. | ||||||
|  |  | ||||||
|  | So remove XHCI_SKIP_PHY_INIT flag from xhci_mvebu_a3700_plat_setup() and | ||||||
|  | then also whole xhci_mvebu_a3700_plat_setup() function which is there just | ||||||
|  | to handle -EOPNOTSUPP for XHCI_SKIP_PHY_INIT. | ||||||
|  |  | ||||||
|  | xhci plat_setup callback is not used by any other xhci plat driver, so | ||||||
|  | remove this callback completely. | ||||||
|  |  | ||||||
|  | Signed-off-by: Pali Rohár <pali@kernel.org> | ||||||
|  | Signed-off-by: Marek Behún <kabel@kernel.org> | ||||||
|  | Acked-by: Miquel Raynal <miquel.raynal@bootlin.com> | ||||||
|  | --- | ||||||
|  |  drivers/usb/host/xhci-mvebu.c | 42 ----------------------------------- | ||||||
|  |  drivers/usb/host/xhci-mvebu.h |  6 ----- | ||||||
|  |  drivers/usb/host/xhci-plat.c  | 20 +---------------- | ||||||
|  |  drivers/usb/host/xhci-plat.h  |  1 - | ||||||
|  |  4 files changed, 1 insertion(+), 68 deletions(-) | ||||||
|  |  | ||||||
|  | diff --git a/drivers/usb/host/xhci-mvebu.c b/drivers/usb/host/xhci-mvebu.c | ||||||
|  | index 8ca1a235d164..60651a50770f 100644 | ||||||
|  | --- a/drivers/usb/host/xhci-mvebu.c | ||||||
|  | +++ b/drivers/usb/host/xhci-mvebu.c | ||||||
|  | @@ -8,7 +8,6 @@ | ||||||
|  |  #include <linux/mbus.h> | ||||||
|  |  #include <linux/of.h> | ||||||
|  |  #include <linux/platform_device.h> | ||||||
|  | -#include <linux/phy/phy.h> | ||||||
|  |   | ||||||
|  |  #include <linux/usb.h> | ||||||
|  |  #include <linux/usb/hcd.h> | ||||||
|  | @@ -75,47 +74,6 @@ int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd) | ||||||
|  |  	return 0; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd) | ||||||
|  | -{ | ||||||
|  | -	struct xhci_hcd *xhci = hcd_to_xhci(hcd); | ||||||
|  | -	struct device *dev = hcd->self.controller; | ||||||
|  | -	struct phy *phy; | ||||||
|  | -	int ret; | ||||||
|  | - | ||||||
|  | -	/* Old bindings miss the PHY handle */ | ||||||
|  | -	phy = of_phy_get(dev->of_node, "usb3-phy"); | ||||||
|  | -	if (IS_ERR(phy) && PTR_ERR(phy) == -EPROBE_DEFER) | ||||||
|  | -		return -EPROBE_DEFER; | ||||||
|  | -	else if (IS_ERR(phy)) | ||||||
|  | -		goto phy_out; | ||||||
|  | - | ||||||
|  | -	ret = phy_init(phy); | ||||||
|  | -	if (ret) | ||||||
|  | -		goto phy_put; | ||||||
|  | - | ||||||
|  | -	ret = phy_set_mode(phy, PHY_MODE_USB_HOST_SS); | ||||||
|  | -	if (ret) | ||||||
|  | -		goto phy_exit; | ||||||
|  | - | ||||||
|  | -	ret = phy_power_on(phy); | ||||||
|  | -	if (ret == -EOPNOTSUPP) { | ||||||
|  | -		/* Skip initializatin of XHCI PHY when it is unsupported by firmware */ | ||||||
|  | -		dev_warn(dev, "PHY unsupported by firmware\n"); | ||||||
|  | -		xhci->quirks |= XHCI_SKIP_PHY_INIT; | ||||||
|  | -	} | ||||||
|  | -	if (ret) | ||||||
|  | -		goto phy_exit; | ||||||
|  | - | ||||||
|  | -	phy_power_off(phy); | ||||||
|  | -phy_exit: | ||||||
|  | -	phy_exit(phy); | ||||||
|  | -phy_put: | ||||||
|  | -	of_phy_put(phy); | ||||||
|  | -phy_out: | ||||||
|  | - | ||||||
|  | -	return 0; | ||||||
|  | -} | ||||||
|  | - | ||||||
|  |  int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd) | ||||||
|  |  { | ||||||
|  |  	struct xhci_hcd	*xhci = hcd_to_xhci(hcd); | ||||||
|  | diff --git a/drivers/usb/host/xhci-mvebu.h b/drivers/usb/host/xhci-mvebu.h | ||||||
|  | index 01bf3fcb3eca..3be021793cc8 100644 | ||||||
|  | --- a/drivers/usb/host/xhci-mvebu.h | ||||||
|  | +++ b/drivers/usb/host/xhci-mvebu.h | ||||||
|  | @@ -12,7 +12,6 @@ struct usb_hcd; | ||||||
|  |   | ||||||
|  |  #if IS_ENABLED(CONFIG_USB_XHCI_MVEBU) | ||||||
|  |  int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd); | ||||||
|  | -int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd); | ||||||
|  |  int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd); | ||||||
|  |  #else | ||||||
|  |  static inline int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd) | ||||||
|  | @@ -20,11 +19,6 @@ static inline int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd) | ||||||
|  |  	return 0; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -static inline int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd) | ||||||
|  | -{ | ||||||
|  | -	return 0; | ||||||
|  | -} | ||||||
|  | - | ||||||
|  |  static inline int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd) | ||||||
|  |  { | ||||||
|  |  	return 0; | ||||||
|  | diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c | ||||||
|  | index c1edcc9b13ce..4d34f6005381 100644 | ||||||
|  | --- a/drivers/usb/host/xhci-plat.c | ||||||
|  | +++ b/drivers/usb/host/xhci-plat.c | ||||||
|  | @@ -44,16 +44,6 @@ static void xhci_priv_plat_start(struct usb_hcd *hcd) | ||||||
|  |  		priv->plat_start(hcd); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -static int xhci_priv_plat_setup(struct usb_hcd *hcd) | ||||||
|  | -{ | ||||||
|  | -	struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); | ||||||
|  | - | ||||||
|  | -	if (!priv->plat_setup) | ||||||
|  | -		return 0; | ||||||
|  | - | ||||||
|  | -	return priv->plat_setup(hcd); | ||||||
|  | -} | ||||||
|  | - | ||||||
|  |  static int xhci_priv_init_quirk(struct usb_hcd *hcd) | ||||||
|  |  { | ||||||
|  |  	struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); | ||||||
|  | @@ -121,7 +111,6 @@ static const struct xhci_plat_priv xhci_plat_marvell_armada = { | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  |  static const struct xhci_plat_priv xhci_plat_marvell_armada3700 = { | ||||||
|  | -	.plat_setup = xhci_mvebu_a3700_plat_setup, | ||||||
|  |  	.init_quirk = xhci_mvebu_a3700_init_quirk, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | @@ -341,14 +330,7 @@ static int xhci_plat_probe(struct platform_device *pdev) | ||||||
|  |   | ||||||
|  |  	hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node); | ||||||
|  |  	xhci->shared_hcd->tpl_support = hcd->tpl_support; | ||||||
|  | - | ||||||
|  | -	if (priv) { | ||||||
|  | -		ret = xhci_priv_plat_setup(hcd); | ||||||
|  | -		if (ret) | ||||||
|  | -			goto disable_usb_phy; | ||||||
|  | -	} | ||||||
|  | - | ||||||
|  | -	if ((xhci->quirks & XHCI_SKIP_PHY_INIT) || (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))) | ||||||
|  | +	if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT)) | ||||||
|  |  		hcd->skip_phy_initialization = 1; | ||||||
|  |   | ||||||
|  |  	if (priv && (priv->quirks & XHCI_SG_TRB_CACHE_SIZE_QUIRK)) | ||||||
|  | diff --git a/drivers/usb/host/xhci-plat.h b/drivers/usb/host/xhci-plat.h | ||||||
|  | index 561d0b7bce09..1fb149d1fbce 100644 | ||||||
|  | --- a/drivers/usb/host/xhci-plat.h | ||||||
|  | +++ b/drivers/usb/host/xhci-plat.h | ||||||
|  | @@ -13,7 +13,6 @@ | ||||||
|  |  struct xhci_plat_priv { | ||||||
|  |  	const char *firmware_name; | ||||||
|  |  	unsigned long long quirks; | ||||||
|  | -	int (*plat_setup)(struct usb_hcd *); | ||||||
|  |  	void (*plat_start)(struct usb_hcd *); | ||||||
|  |  	int (*init_quirk)(struct usb_hcd *); | ||||||
|  |  	int (*suspend_quirk)(struct usb_hcd *); | ||||||
|  | --  | ||||||
|  | 2.34.1 | ||||||
|  |  | ||||||
| @@ -0,0 +1,41 @@ | |||||||
|  | From 9a352062b7e3857742389dff6f64393481dc755e Mon Sep 17 00:00:00 2001 | ||||||
|  | From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org> | ||||||
|  | Date: Thu, 23 Sep 2021 19:37:05 +0200 | ||||||
|  | Subject: [PATCH] Revert "PCI: aardvark: Fix initialization with old Marvell's | ||||||
|  |  Arm Trusted Firmware" | ||||||
|  | MIME-Version: 1.0 | ||||||
|  | Content-Type: text/plain; charset=UTF-8 | ||||||
|  | Content-Transfer-Encoding: 8bit | ||||||
|  |  | ||||||
|  | This reverts commit b0c6ae0f8948a2be6bf4e8b4bbab9ca1343289b6. | ||||||
|  |  | ||||||
|  | Armada 3720 phy driver (phy-mvebu-a3700-comphy.c) does not return | ||||||
|  | -EOPNOTSUPP from phy_power_on() callback anymore. | ||||||
|  |  | ||||||
|  | So remove dead code which handles -EOPNOTSUPP return value. | ||||||
|  |  | ||||||
|  | Signed-off-by: Pali Rohár <pali@kernel.org> | ||||||
|  | Signed-off-by: Marek Behún <kabel@kernel.org> | ||||||
|  | Acked-by: Miquel Raynal <miquel.raynal@bootlin.com> | ||||||
|  | --- | ||||||
|  |  drivers/pci/controller/pci-aardvark.c | 4 +--- | ||||||
|  |  1 file changed, 1 insertion(+), 3 deletions(-) | ||||||
|  |  | ||||||
|  | diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c | ||||||
|  | index 319dd830e36e..4e64142b9ec4 100644 | ||||||
|  | --- a/drivers/pci/controller/pci-aardvark.c | ||||||
|  | +++ b/drivers/pci/controller/pci-aardvark.c | ||||||
|  | @@ -1635,9 +1635,7 @@ static int advk_pcie_enable_phy(struct advk_pcie *pcie) | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  |  	ret = phy_power_on(pcie->phy); | ||||||
|  | -	if (ret == -EOPNOTSUPP) { | ||||||
|  | -		dev_warn(&pcie->pdev->dev, "PHY unsupported by firmware\n"); | ||||||
|  | -	} else if (ret) { | ||||||
|  | +	if (ret) { | ||||||
|  |  		phy_exit(pcie->phy); | ||||||
|  |  		return ret; | ||||||
|  |  	} | ||||||
|  | --  | ||||||
|  | 2.34.1 | ||||||
|  |  | ||||||
		Reference in New Issue
	
	Block a user