]> asedeno.scripts.mit.edu Git - linux.git/commit
net: ftgmac100: Request clock and set speed
authorJoel Stanley <joel@jms.id.au>
Fri, 13 Oct 2017 04:16:38 +0000 (12:16 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Oct 2017 11:09:06 +0000 (12:09 +0100)
commit4b70c62b9eafcee0505b440732d2e00c50f3085d
treeca6718f6c58846349bbbecc6cb5a047d3662bc83
parent8a5f2166a6288ee4b5a393f1ebc8cfb26b0510f0
net: ftgmac100: Request clock and set speed

According to the ASPEED datasheet, gigabit speeds require a clock of
100MHz or higher. Other speeds require 25MHz or higher. This patch
configures a 100MHz clock if the system has a direct-attached
PHY, or 25MHz if the system is running NC-SI which is limited to 100MHz.

There appear to be no other upstream users of the FTGMAC100 driver it is
hard to know the clocking requirements of other platforms. Therefore a
conservative approach was taken with enabling clocks. If the platform is
not ASPEED, both requesting the clock and configuring the speed is
skipped.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Tested-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/faraday/ftgmac100.c