Skip to content

Commit 27f9f62

Browse files
committed
ARM: imx: init ENET RGMII tx clock source
Set GPR5[9] on imx6dp/qp to select clock from internal PLL_enet. Signed-off-by: Rustam Abdullaev <rustamabd@gmail.com>
1 parent df24f94 commit 27f9f62

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

arch/arm/mach-imx/mach-imx6q.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,18 @@ static void __init imx6q_1588_init(void)
119119
IMX6Q_GPR1_ENET_CLK_SEL_ANATOP :
120120
IMX6Q_GPR1_ENET_CLK_SEL_PAD;
121121
gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
122-
if (!IS_ERR(gpr))
122+
if (!IS_ERR(gpr)) {
123123
regmap_update_bits(gpr, IOMUXC_GPR1,
124124
IMX6Q_GPR1_ENET_CLK_SEL_MASK,
125125
clksel);
126-
else
126+
if (clksel == IMX6Q_GPR1_ENET_CLK_SEL_ANATOP &&
127+
cpu_is_imx6q() &&
128+
imx_get_soc_revision() >= IMX_CHIP_REVISION_2_0) {
129+
regmap_update_bits(gpr, IOMUXC_GPR5,
130+
IMX6Q_GPR5_ENET_TX_CLK_SEL,
131+
IMX6Q_GPR5_ENET_TX_CLK_SEL);
132+
}
133+
} else
127134
pr_err("failed to find fsl,imx6q-iomuxc-gpr regmap\n");
128135

129136
clk_put(enet_ref);

include/linux/mfd/syscon/imx6q-iomuxc-gpr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@
240240
#define IMX6Q_GPR4_IPU_RD_CACHE_CTL BIT(0)
241241

242242
#define IMX6Q_GPR5_L2_CLK_STOP BIT(8)
243+
#define IMX6Q_GPR5_ENET_TX_CLK_SEL BIT(9)
243244
#define IMX6Q_GPR5_SATA_SW_PD BIT(10)
244245
#define IMX6Q_GPR5_SATA_SW_RST BIT(11)
245246
#define IMX6Q_GPR5_PRE_PRG_SEL0_MASK (0x3 << 12)

0 commit comments

Comments
 (0)