From 7757c85199f57e71d5021670ff1d317e0c622f89 Mon Sep 17 00:00:00 2001 From: zachary Date: Fri, 28 Aug 2020 16:56:29 +0200 Subject: phy: marvell: a3700: add sata comphy on lane 2 with invert option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - This patch moves sata phy powerup from dedicate phy to compphy and adds invert option for sata powerup routine. Change-Id: I1b4e8753e2b2c14c6efa97bca2ffc7d2553d8a90 Signed-off-by: zachary Signed-off-by: Ken Ma Reviewed-on: http://vgitil04.il.marvell.com:8080/53601 Reviewed-by: Igal Liberman Tested-by: Igal Liberman [a.heider: adapt to mainline] Signed-off-by: Andre Heider Tested-by: Pali Rohár Reviewed-by: Stefan Roese --- drivers/phy/marvell/comphy_a3700.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/drivers/phy/marvell/comphy_a3700.c b/drivers/phy/marvell/comphy_a3700.c index dc188c44e0..4606de6f48 100644 --- a/drivers/phy/marvell/comphy_a3700.c +++ b/drivers/phy/marvell/comphy_a3700.c @@ -273,16 +273,23 @@ static void reg_set_indirect(u32 reg, u16 data, u16 mask) * * return: 1 if PLL locked (OK), 0 otherwise (FAIL) */ -static int comphy_sata_power_up(void) +static int comphy_sata_power_up(u32 invert) { int ret; + u32 data = 0; debug_enter(); /* - * 0. Swap SATA TX lines + * 0. Check the Polarity invert bits */ - reg_set_indirect(vphy_sync_pattern_reg, bs_txd_inv, bs_txd_inv); + if (invert & PHY_POLARITY_TXD_INVERT) + data |= bs_txd_inv; + + if (invert & PHY_POLARITY_RXD_INVERT) + data |= bs_rxd_inv; + + reg_set_indirect(vphy_sync_pattern_reg, data, bs_txd_inv | bs_rxd_inv); /* * 1. Select 40-bit data width width @@ -924,22 +931,6 @@ void comphy_dedicated_phys_init(void) } } - node = fdt_node_offset_by_compatible(blob, -1, - "marvell,armada-3700-ahci"); - if (node > 0) { - if (fdtdec_get_is_enabled(blob, node)) { - ret = comphy_sata_power_up(); - if (!ret) - printf("Failed to initialize SATA PHY\n"); - else - debug("SATA PHY init succeed\n"); - } else { - debug("SATA node is disabled\n"); - } - } else { - debug("No SATA node in DT\n"); - } - node = fdt_node_offset_by_compatible(blob, -1, "marvell,armada-8k-sdhci"); if (node <= 0) { @@ -1007,6 +998,10 @@ int comphy_a3700_init(struct chip_serdes_phy_config *chip_cfg, comphy_map->invert); break; + case PHY_TYPE_SATA0: + ret = comphy_sata_power_up(comphy_map->invert); + break; + default: debug("Unknown SerDes type, skip initialize SerDes %d\n", lane); -- cgit From 2f8cfd030e55bcee9c8bf1443a1312665f94ee10 Mon Sep 17 00:00:00 2001 From: Konstantin Porotchkin Date: Mon, 31 Aug 2020 08:48:04 +0200 Subject: defconfig: espressobin: Include support for Gigadevice SPI Include support for CONFIG_SPI_FLASH_GIGADEVICE for supporting newly produces EspressoBin boards (v7) Change-Id: I5d4b972cbe2ee5a9d52ce9908794ad4e1b59ee3b Signed-off-by: Konstantin Porotchkin Reviewed-on: http://vgitil04.il.marvell.com:8080/61236 Tested-by: iSoC Platform CI Reviewed-by: Igal Liberman Reviewed-by: Stefan Roese --- configs/mvebu_espressobin-88f3720_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig index 0c1c92d4ff..3ef557732a 100644 --- a/configs/mvebu_espressobin-88f3720_defconfig +++ b/configs/mvebu_espressobin-88f3720_defconfig @@ -55,6 +55,7 @@ CONFIG_SPI_FLASH_MACRONIX=y CONFIG_SPI_FLASH_SPANSION=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PHYLIB=y CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y -- cgit From 3e5420e99aa026cf4c6889d695e8e1e250c6d996 Mon Sep 17 00:00:00 2001 From: Konstantin Porotchkin Date: Mon, 31 Aug 2020 08:48:05 +0200 Subject: defconfig: espressobin: Add support for ISSI SPI flashes Enable support of ISSI SPI flashes found on EspressoBIN boards Change-Id: I6de61c48f108fb4f410f321b9db45887d23212e5 Signed-off-by: Konstantin Porotchkin Reviewed-on: http://vgitil04.il.marvell.com:8080/61455 Tested-by: iSoC Platform CI Reviewed-by: Grzegorz Jaszczyk Reviewed-by: Stefan Chulski Reviewed-by: Stefan Roese --- configs/mvebu_espressobin-88f3720_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig index 3ef557732a..ec32906408 100644 --- a/configs/mvebu_espressobin-88f3720_defconfig +++ b/configs/mvebu_espressobin-88f3720_defconfig @@ -56,6 +56,7 @@ CONFIG_SPI_FLASH_SPANSION=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_WINBOND=y CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_ISSI=y CONFIG_PHYLIB=y CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y -- cgit