Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: rockchip: describe clk_gmac using the new muxgrf type on rk3328

With the newly introduced clk type for muxes in the grf we now can
describe some missing clocks, like the clk_gmac2io and clk_gmac2phy
that selects between clk_mac2io_src and gmac_clkin based on a bit
set in the general register files.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>

authored by

Elaine Zhang and committed by
Heiko Stuebner
9bb4db62 4d00542b

+9
+9
drivers/clk/rockchip/clk-rk3328.c
··· 20 20 #include <dt-bindings/clock/rk3328-cru.h> 21 21 #include "clk.h" 22 22 23 + #define RK3328_GRF_SOC_CON4 0x410 23 24 #define RK3328_GRF_SOC_STATUS0 0x480 24 25 #define RK3328_GRF_MAC_CON1 0x904 25 26 #define RK3328_GRF_MAC_CON2 0x908 ··· 215 214 "gmac_clkin" }; 216 215 PNAME(mux_mac2phy_src_p) = { "clk_mac2phy_src", 217 216 "phy_50m_out" }; 217 + PNAME(mux_mac2io_ext_p) = { "clk_mac2io", 218 + "gmac_clkin" }; 218 219 219 220 static struct rockchip_pll_clock rk3328_pll_clks[] __initdata = { 220 221 [apll] = PLL(pll_rk3328, PLL_APLL, "apll", mux_pll_p, ··· 683 680 COMPOSITE(SCLK_MAC2IO_OUT, "clk_mac2io_out", mux_2plls_p, 0, 684 681 RK3328_CLKSEL_CON(27), 15, 1, MFLAGS, 8, 5, DFLAGS, 685 682 RK3328_CLKGATE_CON(3), 5, GFLAGS), 683 + MUXGRF(SCLK_MAC2IO, "clk_mac2io", mux_mac2io_src_p, CLK_SET_RATE_NO_REPARENT, 684 + RK3328_GRF_MAC_CON1, 10, 1, MFLAGS), 685 + MUXGRF(SCLK_MAC2IO_EXT, "clk_mac2io_ext", mux_mac2io_ext_p, CLK_SET_RATE_NO_REPARENT, 686 + RK3328_GRF_SOC_CON4, 14, 1, MFLAGS), 686 687 687 688 COMPOSITE(SCLK_MAC2PHY_SRC, "clk_mac2phy_src", mux_2plls_p, 0, 688 689 RK3328_CLKSEL_CON(26), 7, 1, MFLAGS, 0, 5, DFLAGS, ··· 698 691 COMPOSITE_NOMUX(SCLK_MAC2PHY_OUT, "clk_mac2phy_out", "clk_mac2phy", 0, 699 692 RK3328_CLKSEL_CON(26), 8, 2, DFLAGS, 700 693 RK3328_CLKGATE_CON(9), 2, GFLAGS), 694 + MUXGRF(SCLK_MAC2PHY, "clk_mac2phy", mux_mac2phy_src_p, CLK_SET_RATE_NO_REPARENT, 695 + RK3328_GRF_MAC_CON2, 10, 1, MFLAGS), 701 696 702 697 FACTOR(0, "xin12m", "xin24m", 0, 1, 2), 703 698