aboutsummaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2018-08-17 12:58:51 +0200
committerStefan Roese <sr@denx.de>2018-09-19 08:59:26 +0200
commit4b8cb84327a448f16b276769e0ffbc7869d6de4a (patch)
tree5ffd78ce20819b00712a5d7ba31e35cb80f81dbf /drivers/phy
parent2fd4284051e33763e3424cbd7e106e0a75dfd16e (diff)
downloadu-boot-4b8cb84327a448f16b276769e0ffbc7869d6de4a.zip
u-boot-4b8cb84327a448f16b276769e0ffbc7869d6de4a.tar.gz
u-boot-4b8cb84327a448f16b276769e0ffbc7869d6de4a.tar.bz2
phy: marvell: Support changing SERDES map in board file
This adds a weak definition of comphy_update_map to comphy_core, which does nothing. If this function is defined elsewhere, for example in board file, the board file can change some parameters of SERDES configuration. This is needed on Turris Mox, where the SERDES speed on lane 1 has to be set differently when SFP module is connected and when Topaz Switch module is connected. This is a temporary solution. When the comphy driver for armada-3720 will be added to the kernel, the comphy driver in u-boot shall also be updated and this should be done differently then. Signed-off-by: Marek Behun <marek.behun@nic.cz> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/marvell/comphy_a3700.h2
-rw-r--r--drivers/phy/marvell/comphy_core.c12
-rw-r--r--drivers/phy/marvell/comphy_core.h (renamed from drivers/phy/marvell/comphy.h)16
-rw-r--r--drivers/phy/marvell/comphy_cp110.c2
-rw-r--r--drivers/phy/marvell/comphy_mux.c2
5 files changed, 18 insertions, 16 deletions
diff --git a/drivers/phy/marvell/comphy_a3700.h b/drivers/phy/marvell/comphy_a3700.h
index a14767d..b0941ff 100644
--- a/drivers/phy/marvell/comphy_a3700.h
+++ b/drivers/phy/marvell/comphy_a3700.h
@@ -6,7 +6,7 @@
#ifndef _COMPHY_A3700_H_
#define _COMPHY_A3700_H_
-#include "comphy.h"
+#include "comphy_core.h"
#include "comphy_hpipe.h"
#define MVEBU_REG(offs) \
diff --git a/drivers/phy/marvell/comphy_core.c b/drivers/phy/marvell/comphy_core.c
index c6e2cc8..9c24692 100644
--- a/drivers/phy/marvell/comphy_core.c
+++ b/drivers/phy/marvell/comphy_core.c
@@ -11,7 +11,7 @@
#include <linux/errno.h>
#include <asm/io.h>
-#include "comphy.h"
+#include "comphy_core.h"
#define COMPHY_MAX_CHIP 4
@@ -66,6 +66,11 @@ void comphy_print(struct chip_serdes_phy_config *chip_cfg,
}
}
+__weak int comphy_update_map(struct comphy_map *serdes_map, int count)
+{
+ return 0;
+}
+
static int comphy_probe(struct udevice *dev)
{
const void *blob = gd->fdt_blob;
@@ -76,6 +81,7 @@ static int comphy_probe(struct udevice *dev)
int lane;
int last_idx = 0;
static int current_idx;
+ int res;
/* Save base addresses for later use */
chip_cfg->comphy_base_addr = (void *)devfdt_get_addr_index(dev, 0);
@@ -143,6 +149,10 @@ static int comphy_probe(struct udevice *dev)
lane++;
}
+ res = comphy_update_map(comphy_map_data, chip_cfg->comphy_lanes_count);
+ if (res < 0)
+ return res;
+
/* Save CP index for MultiCP devices (A8K) */
chip_cfg->cp_index = current_idx++;
/* PHY power UP sequence */
diff --git a/drivers/phy/marvell/comphy.h b/drivers/phy/marvell/comphy_core.h
index b588ae4..12ab921 100644
--- a/drivers/phy/marvell/comphy.h
+++ b/drivers/phy/marvell/comphy_core.h
@@ -3,11 +3,11 @@
* Copyright (C) 2015-2016 Marvell International Ltd.
*/
-#ifndef _COMPHY_H_
-#define _COMPHY_H_
+#ifndef _COMPHY_CORE_H_
+#define _COMPHY_CORE_H_
-#include <dt-bindings/comphy/comphy_data.h>
#include <fdtdec.h>
+#include <mvebu/comphy.h>
#if defined(DEBUG)
#define debug_enter() printf("----> Enter %s\n", __func__);
@@ -80,14 +80,6 @@ struct comphy_mux_data {
struct comphy_mux_options mux_values[MAX_LANE_OPTIONS];
};
-struct comphy_map {
- u32 type;
- u32 speed;
- u32 invert;
- bool clk_src;
- bool end_point;
-};
-
struct chip_serdes_phy_config {
struct comphy_mux_data *mux_data;
int (*ptr_comphy_chip_init)(struct chip_serdes_phy_config *,
@@ -183,5 +175,5 @@ void comphy_pcie_config_detect(u32 comphy_max_count,
struct comphy_map *serdes_map);
void comphy_pcie_unit_general_config(u32 pex_index);
-#endif /* _COMPHY_H_ */
+#endif /* _COMPHY_CORE_H_ */
diff --git a/drivers/phy/marvell/comphy_cp110.c b/drivers/phy/marvell/comphy_cp110.c
index b0d5d5c..6a60da3 100644
--- a/drivers/phy/marvell/comphy_cp110.c
+++ b/drivers/phy/marvell/comphy_cp110.c
@@ -9,7 +9,7 @@
#include <asm/arch/cpu.h>
#include <asm/arch/soc.h>
-#include "comphy.h"
+#include "comphy_core.h"
#include "comphy_hpipe.h"
#include "sata.h"
#include "utmi_phy.h"
diff --git a/drivers/phy/marvell/comphy_mux.c b/drivers/phy/marvell/comphy_mux.c
index 1f757d8..c67ba99 100644
--- a/drivers/phy/marvell/comphy_mux.c
+++ b/drivers/phy/marvell/comphy_mux.c
@@ -6,7 +6,7 @@
#include <common.h>
#include <asm/io.h>
-#include "comphy.h"
+#include "comphy_core.h"
#include "comphy_hpipe.h"
/*