Lines Matching +full:sun7i +full:- +full:a20 +full:- +full:gmac
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright 2013 Chen-Yu Tsai
7 * Chen-Yu Tsai <wens@csie.org>
10 #include <linux/clk-provider.h>
29 * sun7i_a20_gmac_clk_setup - Setup function for A20/A31 GMAC clock module
34 * MII TX clock from PHY >-----|___________ _________|----> to GMAC core
35 * GMAC Int. RGMII TX clk >----|___________\__/__gate---|----> to PHY
36 * Ext. 125MHz RGMII TX clk >--|__divider__/ |
39 * The external 125 MHz reference is optional, i.e. GMAC can use its
40 * internal TX clock just fine. The A31 GMAC clock module does not have
43 * To keep it simple, let the GMAC use either the MII TX clock for MII mode,
44 * and its internal TX clock for GMII and RGMII modes. The GMAC driver should
47 * Only the GMAC should use this clock. Altering the clock so that it doesn't
48 * match the GMAC's operation parameters will result in the GMAC not being
49 * able to send traffic out. The GMAC driver should set the clock rate and
51 * driver then responds by auto-reparenting the clock.
58 const char *clk_name = node->name; in sun7i_a20_gmac_clk_setup()
62 if (of_property_read_string(node, "clock-output-names", &clk_name)) in sun7i_a20_gmac_clk_setup()
74 /* gmac clock requires exactly 2 parents */ in sun7i_a20_gmac_clk_setup()
83 gate->reg = reg; in sun7i_a20_gmac_clk_setup()
84 gate->bit_idx = SUN7I_A20_GMAC_GPIT; in sun7i_a20_gmac_clk_setup()
85 gate->lock = &gmac_lock; in sun7i_a20_gmac_clk_setup()
86 mux->reg = reg; in sun7i_a20_gmac_clk_setup()
87 mux->mask = SUN7I_A20_GMAC_MASK; in sun7i_a20_gmac_clk_setup()
88 mux->table = sun7i_a20_gmac_mux_table; in sun7i_a20_gmac_clk_setup()
89 mux->lock = &gmac_lock; in sun7i_a20_gmac_clk_setup()
93 &mux->hw, &clk_mux_ops, in sun7i_a20_gmac_clk_setup()
95 &gate->hw, &clk_gate_ops, in sun7i_a20_gmac_clk_setup()
112 CLK_OF_DECLARE(sun7i_a20_gmac, "allwinner,sun7i-a20-gmac-clk",