freebsd-dev/sys/mips
Adrian Chadd c572da7f10 Allow the MDIO bus frequency to be selected.
The MDIO bus frequency is configured as a divisor off of the MDIO bus
reference clock.  For the AR9344 and later, the MDIO bus frequency can
be faster than normal (ie, up to 100MHz) and thus a static divisor may
not be very applicable.

So, for those boards that may require an actual frequency to be selected
regardless of what crazy stuff the vendor throws in uboot, one can now
set the MDIO bus frequency.  It uses the MDIO frequency and the target
frequency to choose a divisor that doesn't exceed the target frequency.

By default it will choose:

* DIV_28 on everything; except
* DIV_58 on the AR9344 to be conservative.

Whilst I'm here, add some comments about the defaults being not quite
right.  For the other internal switch devices (like the AR933x, AR724x)
the divisor can be higher - it's internal and the reference MDIO clock
is much lower than 100MHz.

The divisor tables and loop code is inspired from Linux/OpenWRT.  It's very
simple; I didn't feel that reimplementing it would yield a substantially
different solution.

Tested:

* AR9331 (mips24k)
* AR9344 (mips74k)

Obtained from:	Linux/OpenWRT
2013-10-16 19:36:50 +00:00
..
adm5120 Fix low-level uart drivers that set their fifo sizes in the softc too late. 2013-04-01 00:44:20 +00:00
alchemy Merge from vmobj-rwlock branch: 2013-02-26 01:00:11 +00:00
atheros Allow the MDIO bus frequency to be selected. 2013-10-16 19:36:50 +00:00
beri Merge from vmobj-rwlock branch: 2013-02-26 01:00:11 +00:00
cavium Snapshot. This passes the build test, but has not yet been finished or debugged. 2013-10-04 06:55:06 +00:00
conf Now that all of the on-chip switch and basic platform support is updated, 2013-10-16 04:22:26 +00:00
gxemul Add 32-bit support for Gxemul's oldtestmips machine emulation 2013-09-04 20:34:36 +00:00
idt Merge from vmobj-rwlock branch: 2013-02-26 01:00:11 +00:00
include Elminate NON_LEAF and use NESTED instead to unify our assembler 2013-10-15 04:45:09 +00:00
malta YAMON is 32-bit application and uses 32-bit pointers to pass kernel 2013-08-31 01:24:05 +00:00
mips Elminate NON_LEAF and use NESTED instead to unify our assembler 2013-10-15 04:45:09 +00:00
nlm Fixes for the Netlogic XLP on-chip RSA block driver 2013-10-04 11:11:51 +00:00
rmi MFcalloutng: 2013-02-28 13:46:03 +00:00
rt305x Fix undefined behaviour in several gpio_pin_setflags() routines (under 2013-04-13 21:21:13 +00:00
sentry5 Merge from vmobj-rwlock branch: 2013-02-26 01:00:11 +00:00
sibyte Replace kernel virtual address space allocation with vmem. This provides 2013-08-07 06:21:20 +00:00