]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: stmmac: dwmac-loongson: Init ref and PTP clocks rate
authorYanteng Si <siyanteng@loongson.cn>
Wed, 7 Aug 2024 13:48:02 +0000 (21:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:37:17 +0000 (16:37 +0200)
[ Upstream commit c70f3163681381c15686bdd2fe56bf4af9b8aaaa ]

Reference and PTP clocks rate of the Loongson GMAC devices is 125MHz.
(So is in the GNET devices which support is about to be added.) Set
the respective plat_stmmacenet_data field up in accordance with that
so to have the coalesce command and timestamping work correctly.

Fixes: 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson")
Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
Signed-off-by: Yinggang Gu <guyinggang@loongson.cn>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Acked-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c

index 9e40c28d453ab190d2c3150df27baa52d745a98d..ee3604f58def52ce99a14ff0ee37819f2aab1aac 100644 (file)
@@ -35,6 +35,9 @@ static int loongson_default_data(struct plat_stmmacenet_data *plat)
        /* Disable RX queues routing by default */
        plat->rx_queues_cfg[0].pkt_route = 0x0;
 
+       plat->clk_ref_rate = 125000000;
+       plat->clk_ptp_rate = 125000000;
+
        /* Default to phy auto-detection */
        plat->phy_addr = -1;