Skip to content

Commit a43f72a

Browse files
committed
phy: cadence: Sierra: Change MAX_LANES of Sierra to 16
Sierra SERDES IP supports upto 16 lanes (though not all of it will be enabled in a platform). Allow Sierra driver to support a maximum of upto 16 lanes. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
1 parent adc4bd6 commit a43f72a

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

‎drivers/phy/cadence/phy-cadence-sierra.c‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
#define SIERRA_PHY_PLL_CFG 0xe
142142

143143
#define SIERRA_MACRO_ID 0x00007364
144-
#define SIERRA_MAX_LANES 4
144+
#define SIERRA_MAX_LANES 16
145145
#define PLL_LOCK_TIME 100000
146146

147147
static const struct reg_field macro_id_type =
@@ -199,6 +199,7 @@ struct cdns_sierra_phy {
199199
struct regmap_field *pllctrl_lock[SIERRA_MAX_LANES];
200200
struct clk *clk;
201201
int nsubnodes;
202+
u32 num_lanes;
202203
bool autoconf;
203204
};
204205

@@ -235,6 +236,18 @@ static struct regmap_config cdns_sierra_lane_cdb_config[] = {
235236
SIERRA_LANE_CDB_REGMAP_CONF("1"),
236237
SIERRA_LANE_CDB_REGMAP_CONF("2"),
237238
SIERRA_LANE_CDB_REGMAP_CONF("3"),
239+
SIERRA_LANE_CDB_REGMAP_CONF("4"),
240+
SIERRA_LANE_CDB_REGMAP_CONF("5"),
241+
SIERRA_LANE_CDB_REGMAP_CONF("6"),
242+
SIERRA_LANE_CDB_REGMAP_CONF("7"),
243+
SIERRA_LANE_CDB_REGMAP_CONF("8"),
244+
SIERRA_LANE_CDB_REGMAP_CONF("9"),
245+
SIERRA_LANE_CDB_REGMAP_CONF("10"),
246+
SIERRA_LANE_CDB_REGMAP_CONF("11"),
247+
SIERRA_LANE_CDB_REGMAP_CONF("12"),
248+
SIERRA_LANE_CDB_REGMAP_CONF("13"),
249+
SIERRA_LANE_CDB_REGMAP_CONF("14"),
250+
SIERRA_LANE_CDB_REGMAP_CONF("15"),
238251
};
239252

240253
static struct regmap_config cdns_sierra_common_cdb_config = {
@@ -548,6 +561,8 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
548561
}
549562
}
550563

564+
sp->num_lanes += sp->phys[node].num_lanes;
565+
551566
gphy = devm_phy_create(dev, child, &ops);
552567

553568
if (IS_ERR(gphy)) {
@@ -561,6 +576,11 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
561576
}
562577
sp->nsubnodes = node;
563578

579+
if (sp->num_lanes > SIERRA_MAX_LANES) {
580+
dev_err(dev, "Invalid lane configuration\n");
581+
goto put_child2;
582+
}
583+
564584
/* If more than one subnode, configure the PHY as multilink */
565585
if (!sp->autoconf && sp->nsubnodes > 1)
566586
regmap_field_write(sp->phy_pll_cfg_1, 0x1);

0 commit comments

Comments
 (0)