diff options
author | Deepak SIKRI <deepak.sikri@st.com> | 2012-04-04 00:33:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-04 18:39:23 -0400 |
commit | faeae3fa0f3a243f677cf606aa87d0d99c225165 (patch) | |
tree | 72a644c8bafee340fb190578f25af3de6b6abcd4 /include/linux/stmmac.h | |
parent | 38912bdbde5f39aa00dfc6228ef580ff79b46bd3 (diff) |
stmmac: Define MDC clock selection macros
The patch adds the macros to be used for MDC clock selection. The MDC clock
frequency is based on scaled system clock, and has to be confined to a range
of 1-2.5 MHz. Based on the input CSR clock, the scaling factor has to be
selected.
The platform specific code will provide the default value of this scaling
factor, based on the input CSR clock.
There is an option to set MDC clock higher than the IEEE 802.3 specified
frequency limit of 2.5 MHz. This applies for the interfacing chips that
support higher MDC clocks. The resultant higher clock of 12.5 MHz requires
additional Macros to be defined for the clock divider corresponding to the
to the following selection.
-----------------------------------------
Selection MDC Clock
-----------------------------------------
1000 clk_csr_i/4
1001 clk_csr_i/6
1010 clk_csr_i/8
1011 clk_csr_i/10
1100 clk_csr_i/12
1101 clk_csr_i/14
1110 clk_csr_i/16
1111 clk_csr_i/18
This support has to be added both in the include file, as well as driver. The
driver need to program the registers based on the interfacing chips. This would
be more board specific information and needs to be passed through the platform
code to the driver. This work would be carried out in the future patch set
release.
Signed-off-by: Deepak Sikri <deepak.sikri@st.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/stmmac.h')
-rw-r--r-- | include/linux/stmmac.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index a9b4d6cb96e9..e5292828b684 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -32,6 +32,34 @@ | |||
32 | #define STMMAC_RX_COE_TYPE1 1 | 32 | #define STMMAC_RX_COE_TYPE1 1 |
33 | #define STMMAC_RX_COE_TYPE2 2 | 33 | #define STMMAC_RX_COE_TYPE2 2 |
34 | 34 | ||
35 | /* Define the macros for CSR clock range parameters to be passed by | ||
36 | * platform code. | ||
37 | * This could also be configured at run time using CPU freq framework. */ | ||
38 | |||
39 | /* MDC Clock Selection define*/ | ||
40 | #define STMMAC_CSR_60_100M 0 /* MDC = clk_scr_i/42 */ | ||
41 | #define STMMAC_CSR_100_150M 1 /* MDC = clk_scr_i/62 */ | ||
42 | #define STMMAC_CSR_20_35M 2 /* MDC = clk_scr_i/16 */ | ||
43 | #define STMMAC_CSR_35_60M 3 /* MDC = clk_scr_i/26 */ | ||
44 | #define STMMAC_CSR_150_250M 4 /* MDC = clk_scr_i/102 */ | ||
45 | #define STMMAC_CSR_250_300M 5 /* MDC = clk_scr_i/122 */ | ||
46 | |||
47 | /* FIXME: The MDC clock could be set higher than the IEEE 802.3 | ||
48 | * specified frequency limit 0f 2.5 MHz, by programming a clock divider | ||
49 | * of value different than the above defined values. The resultant MDIO | ||
50 | * clock frequency of 12.5 MHz is applicable for the interfacing chips | ||
51 | * supporting higher MDC clocks. | ||
52 | * The MDC clock selection macros need to be defined for MDC clock rate | ||
53 | * of 12.5 MHz, corresponding to the following selection. | ||
54 | * 1000 clk_csr_i/4 | ||
55 | * 1001 clk_csr_i/6 | ||
56 | * 1010 clk_csr_i/8 | ||
57 | * 1011 clk_csr_i/10 | ||
58 | * 1100 clk_csr_i/12 | ||
59 | * 1101 clk_csr_i/14 | ||
60 | * 1110 clk_csr_i/16 | ||
61 | * 1111 clk_csr_i/18 */ | ||
62 | |||
35 | /* Platfrom data for platform device structure's platform_data field */ | 63 | /* Platfrom data for platform device structure's platform_data field */ |
36 | 64 | ||
37 | struct stmmac_mdio_bus_data { | 65 | struct stmmac_mdio_bus_data { |