u-boot-brain/drivers
Luigi 'Comio' Mantellini 4ba31ab33a Rewrite the miiphybb (Bit-banged MII bus driver) in order to support an arbitrary number of mii buses.
This feature is useful when your board uses different mii buses for different
phys and all (or a part) of these buses are implemented via bit-banging mode.

The driver requires that the following macros should be defined into the board
configuration file:

CONFIG_BITBANGMII       - Enable the miiphybb driver
CONFIG_BITBANGMII_MULTI - Enable the multi bus support

If the CONFIG_BITBANGMII_MULTI is not defined, the board's config file needs
to define at least the following macros:

MII_INIT      - Generic code to enable the MII bus (optional)
MDIO_DECLARE  - Declaration needed to access to the MDIO pin (optional)
MDIO_ACTIVE   - Activate the MDIO pin as out pin
MDIO_TRISTATE - Activate the MDIO pin as input/tristate pin
MDIO_READ     - Read the MDIO pin
MDIO(v)       - Write v on the MDIO pin
MDC_DECLARE   - Declaration needed to access to the MDC pin (optional)
MDC(v)        - Write v on the MDC pin

The previous macros make the driver compatible with the previous version
(that didn't support the multi-bus).

When the CONFIG_BITBANGMII_MULTI is also defined, the board code needs to fill
the bb_miiphy_buses[] array with a record for each required bus and declare
the bb_miiphy_buses_num variable with the number of mii buses.
The record (struct bb_miiphy_bus) has the following fields/callbacks (see
miiphy.h for details):

char name[]            - The symbolic name that must be equal to the MII bus
                         registered name
int (*init)()          - Initialization function called at startup time (just
                         before the Ethernet initialization)
int (*mdio_active)()   - Activate the MDIO pin as output
int (*mdio_tristate)() - Activate the MDIO pin as input/tristate pin
int (*set_mdio)()      - Write the MDIO pin
int (*get_mdio)()      - Read the MDIO pin
int (*set_mdc)()       - Write the MDC pin
int (*delay)()         - Delay function
void *priv             - Private data used by board specific code

The board code will look like:

struct bb_miiphy_bus bb_miiphy_buses[] = {
 { .name = miibus#1, .init = b1_init, .mdio_active = b1_mdio_active, ... },
 { .name = miibus#2, .init = b2_init, .mdio_active = b2_mdio_active, ... },
 ...
int bb_miiphy_buses_num = sizeof(bb_miiphy_buses) /
                          sizeof(bb_miiphy_buses[0]);

Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-10-10 23:16:53 -07:00
..
bios_emulator Update Freescale copyrights to remove "All Rights Reserved" 2009-07-29 09:59:22 +02:00
block Misc SATA fixups 2009-09-04 21:53:37 +02:00
dma ColdFire: Fix compile warning messages 2009-08-26 03:44:31 -05:00
fpga fpga: Remove relocation fixups 2009-10-03 10:17:56 +02:00
gpio Kirkwood: add Marvell Kirkwood gpio driver 2009-07-23 00:19:28 +02:00
hwmon Misc ds1722 fixups 2009-09-04 21:54:52 +02:00
i2c fsl_i2c: Do not generate STOP after read. 2009-09-28 07:35:56 +02:00
input License cleanup: remove unintended "All Rights Reserved" notices. 2009-09-04 23:00:56 +02:00
misc ppc/85xx: get_law_entry isn't used in CONFIG_NAND_SPL 2009-09-30 08:42:12 -05:00
mmc Minor coding style cleanup. 2009-08-10 10:38:34 +02:00
mtd Conditionally perform common relocation fixups 2009-10-03 10:17:57 +02:00
net Rewrite the miiphybb (Bit-banged MII bus driver) in order to support an arbitrary number of mii buses. 2009-10-10 23:16:53 -07:00
pci ppc/85xx: Clean up p1_p2_rdb PCI setup 2009-09-24 12:04:58 -05:00
pcmcia Misc ti_pci1410a fixups 2009-09-04 21:54:04 +02:00
power OMAP3 Move twl4030 mmc function 2009-07-29 09:57:43 +02:00
qe net: uec: Fix uccf.h and uec.h headers to include headers they depend on 2009-09-25 18:25:50 -05:00
rtc rtc/ds1337.c: Allow to set TCR register 2009-09-24 00:20:33 +02:00
serial stdio/device: rework function naming convention 2009-07-18 00:27:46 +02:00
spi Coldfire: Consolidate DSPI driver 2009-07-14 09:46:09 -05:00
twserial drivers/twserial: Add protocol driver for "three wire serial" interface. 2009-03-30 09:38:36 +02:00
usb usb: bugfix driver/usb/host/ehci-hcd.c function ehci_submit_root 2009-07-23 23:27:06 +02:00
video bus_vcxk.c: fix warning: unused variable 'lineptr' 2009-08-09 22:49:16 +02:00
watchdog at91sam9: add watchdog support 2009-04-04 20:42:19 +02:00