Skip to content

Commit 8dc1fe2

Browse files
rustyxFugang Duan
andcommitted
MLK-10463-1 ARM: imx: init ENET RGMII tx clock source
Init ENET RGMII tx clock source, set GPR5[9] to select clock from internal PLL_enet. (cherry picked from commit: 05f69cb) Signed-off-by: Rustam Abdullaev <rustamabd@gmail.com> Co-authored-by: Fugang Duan <B38611@freescale.com>
1 parent df24f94 commit 8dc1fe2

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ static void __init imx6q_enet_phy_init(void)
7676
}
7777
}
7878

79+
static void __init imx6q_enet_clk_sel(void)
80+
{
81+
struct regmap *gpr;
82+
83+
gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
84+
if (!IS_ERR(gpr))
85+
regmap_update_bits(gpr, IOMUXC_GPR5,
86+
IMX6Q_GPR5_ENET_TX_CLK_SEL, IMX6Q_GPR5_ENET_TX_CLK_SEL);
87+
else
88+
pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n");
89+
}
90+
7991
static void __init imx6q_1588_init(void)
8092
{
8193
struct device_node *np;
@@ -211,6 +223,8 @@ static void __init imx6q_init_machine(void)
211223
imx_get_soc_revision());
212224

213225
imx6q_enet_phy_init();
226+
if (cpu_is_imx6q() && imx_get_soc_revision() >= IMX_CHIP_REVISION_2_0)
227+
imx6q_enet_clk_sel();
214228

215229
of_platform_default_populate(NULL, NULL, NULL);
216230

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)