This patch series adds support for the EMAC Fast Ethernet controller found on Allwinner SoCs to the Allwinner A10.
The main change in this version is the use of a single rx fifo instead of multiple per-packet fifos. I added functions to manipulate the rx fifo and, for consistency, also functions to manipulate tx fifo. Another difference from v2 is that the function can_receive() now can't really know if the next packet can be stored in the fifo because with a single fifo this depends on the size of packet. So the functions only checks if rx is enabled; if the packet can't be stored it will be dropped in receive(). Changelog: v3: Address comments from Peter Crosthwaite and Stefan Hajnoczi: * Use a single, big rx fifo instead of per-packet fifo * Remove link_ok field from PHY state * Call set_link() on post_load * Add missing PHY registers * Implement reset() method * Rename AwEmacMii -> RTL8201CPState * Rename mii_{read,write} -> aw_emac_mdio_{read,write} v2: Address Peter Crosthwaite's comments: * Make phy address customizable through a property * Call qemu_flush_queued_packets() when rx becomes possible * Always create EMAC instance in SoC * Use uint8 arrays for fifos * Minor cleanups Beniamino Galvani (2): hw/net: add support for Allwinner EMAC Fast Ethernet controller hw/arm/allwinner-a10: initialize EMAC default-configs/arm-softmmu.mak | 1 + hw/arm/allwinner-a10.c | 16 ++ hw/arm/cubieboard.c | 7 + hw/net/Makefile.objs | 1 + hw/net/allwinner_emac.c | 589 +++++++++++++++++++++++++++++++++++++++ include/hw/arm/allwinner-a10.h | 3 + include/hw/net/allwinner_emac.h | 222 +++++++++++++++ 7 files changed, 839 insertions(+) create mode 100644 hw/net/allwinner_emac.c create mode 100644 include/hw/net/allwinner_emac.h -- 1.7.10.4