]> git.karo-electronics.de Git - karo-tx-linux.git/commit
stmmac: Define MDC clock selection macros
authorDeepak SIKRI <deepak.sikri@st.com>
Wed, 4 Apr 2012 04:33:22 +0000 (04:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Apr 2012 22:39:23 +0000 (18:39 -0400)
commitfaeae3fa0f3a243f677cf606aa87d0d99c225165
tree72a644c8bafee340fb190578f25af3de6b6abcd4
parent38912bdbde5f39aa00dfc6228ef580ff79b46bd3
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>
include/linux/stmmac.h