mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
net: ti: icssg-prueth: Adjust IPG configuration for SR1.0
Correctly adjust the IPG based on the Silicon Revision. Based on the work of Roger Quadros, Vignesh Raghavendra and Grygorii Strashko in TI's 5.10 SDK [1]. [1]: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/?h=ti-linux-5.10.y Co-developed-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Diogo Ivo <diogo.ivo@siemens.com> Reviewed-by: Roger Quadros <rogerq@kernel.org> Reviewed-by: MD Danish Anwar <danishanwar@ti.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
8623dea207
commit
95c2e68933
|
|
@ -20,6 +20,8 @@
|
|||
/* IPG is in core_clk cycles */
|
||||
#define MII_RT_TX_IPG_100M 0x17
|
||||
#define MII_RT_TX_IPG_1G 0xb
|
||||
#define MII_RT_TX_IPG_100M_SR1 0x166
|
||||
#define MII_RT_TX_IPG_1G_SR1 0x1a
|
||||
|
||||
#define ICSSG_QUEUES_MAX 64
|
||||
#define ICSSG_QUEUE_OFFSET 0xd00
|
||||
|
|
@ -202,23 +204,29 @@ void icssg_config_ipg(struct prueth_emac *emac)
|
|||
{
|
||||
struct prueth *prueth = emac->prueth;
|
||||
int slice = prueth_emac_slice(emac);
|
||||
u32 ipg;
|
||||
|
||||
switch (emac->speed) {
|
||||
case SPEED_1000:
|
||||
icssg_mii_update_ipg(prueth->mii_rt, slice, MII_RT_TX_IPG_1G);
|
||||
ipg = emac->is_sr1 ? MII_RT_TX_IPG_1G_SR1 : MII_RT_TX_IPG_1G;
|
||||
break;
|
||||
case SPEED_100:
|
||||
icssg_mii_update_ipg(prueth->mii_rt, slice, MII_RT_TX_IPG_100M);
|
||||
ipg = emac->is_sr1 ? MII_RT_TX_IPG_100M_SR1 : MII_RT_TX_IPG_100M;
|
||||
break;
|
||||
case SPEED_10:
|
||||
/* Firmware hardcodes IPG for SR1.0 */
|
||||
if (emac->is_sr1)
|
||||
return;
|
||||
/* IPG for 10M is same as 100M */
|
||||
icssg_mii_update_ipg(prueth->mii_rt, slice, MII_RT_TX_IPG_100M);
|
||||
ipg = MII_RT_TX_IPG_100M;
|
||||
break;
|
||||
default:
|
||||
/* Other links speeds not supported */
|
||||
netdev_err(emac->ndev, "Unsupported link speed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
icssg_mii_update_ipg(prueth->mii_rt, slice, ipg);
|
||||
}
|
||||
|
||||
static void emac_r30_cmd_init(struct prueth_emac *emac)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user