summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2016-10-25 18:16:25 +0200
committerStefan Roese <sr@denx.de>2016-12-05 13:28:23 +0100
commite8c3156e8da94bd8ee651385cdd76bb7f842731e (patch)
treefec2b23cf9c02f583b3c0d420539966fbfe2fe6c /drivers/phy
parentd7dd358f93c03004ba42e054c95e21596a909de6 (diff)
downloadu-boot-imx-e8c3156e8da94bd8ee651385cdd76bb7f842731e.zip
u-boot-imx-e8c3156e8da94bd8ee651385cdd76bb7f842731e.tar.gz
u-boot-imx-e8c3156e8da94bd8ee651385cdd76bb7f842731e.tar.bz2
drivers/phy: marvell: Add support for the slave CP COMPHY device
With the support for the Armada 8k, a 2nd COMPHY controller now needs to get supported from the CP110 slave controller. This patch adds support for this 2nd contoller in the COMPHY driver. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Nadav Haklai <nadavh@marvell.com> Cc: Neta Zur Hershkovits <neta@marvell.com> Cc: Kostya Porotchkin <kostap@marvell.com> Cc: Omri Itach <omrii@marvell.com> Cc: Igal Liberman <igall@marvell.com> Cc: Haim Boot <hayim@marvell.com> Cc: Hanna Hawa <hannah@marvell.com>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/marvell/comphy.h2
-rw-r--r--drivers/phy/marvell/comphy_core.c15
2 files changed, 14 insertions, 3 deletions
diff --git a/drivers/phy/marvell/comphy.h b/drivers/phy/marvell/comphy.h
index df5b7d5..0a15692 100644
--- a/drivers/phy/marvell/comphy.h
+++ b/drivers/phy/marvell/comphy.h
@@ -69,7 +69,7 @@
(0x3 << DFX_DEV_GEN_PCIE_CLK_SRC_OFFSET)
#define MAX_LANE_OPTIONS 10
-#define MAX_UTMI_PHY_COUNT 2
+#define MAX_UTMI_PHY_COUNT 3
struct comphy_mux_options {
u32 type;
diff --git a/drivers/phy/marvell/comphy_core.c b/drivers/phy/marvell/comphy_core.c
index 651397d..bc2508b 100644
--- a/drivers/phy/marvell/comphy_core.c
+++ b/drivers/phy/marvell/comphy_core.c
@@ -112,6 +112,7 @@ static int comphy_probe(struct udevice *dev)
struct comphy_map comphy_map_data[MAX_LANE_OPTIONS];
int subnode;
int lane;
+ int last_idx = 0;
/* Save base addresses for later use */
chip_cfg->comphy_base_addr = (void *)dev_get_addr_index(dev, 0);
@@ -178,10 +179,20 @@ static int comphy_probe(struct udevice *dev)
/* PHY power UP sequence */
chip_cfg->ptr_comphy_chip_init(chip_cfg, comphy_map_data);
/* PHY print SerDes status */
+ if (of_machine_is_compatible("marvell,armada8040"))
+ printf("Comphy chip #%d:\n", chip_cfg->comphy_index);
comphy_print(chip_cfg, comphy_map_data);
- /* Initialize dedicated PHYs (not muxed SerDes lanes) */
- comphy_dedicated_phys_init();
+ /*
+ * Only run the dedicated PHY init code once, in the last PHY init call
+ */
+ if (of_machine_is_compatible("marvell,armada8040"))
+ last_idx = 1;
+
+ if (chip_cfg->comphy_index == last_idx) {
+ /* Initialize dedicated PHYs (not muxed SerDes lanes) */
+ comphy_dedicated_phys_init();
+ }
return 0;
}