From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W51kk-0008Gn-Me for qemu-devel@nongnu.org; Sun, 19 Jan 2014 18:26:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W51kc-00071b-90 for qemu-devel@nongnu.org; Sun, 19 Jan 2014 18:26:06 -0500 Received: from mail-ea0-x22f.google.com ([2a00:1450:4013:c01::22f]:44713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W51kc-0006yr-0t for qemu-devel@nongnu.org; Sun, 19 Jan 2014 18:25:58 -0500 Received: by mail-ea0-f175.google.com with SMTP id z10so2747714ead.20 for ; Sun, 19 Jan 2014 15:25:56 -0800 (PST) From: Beniamino Galvani Date: Mon, 20 Jan 2014 00:25:17 +0100 Message-Id: <1390173920-23410-1-git-send-email-b.galvani@gmail.com> Subject: [Qemu-devel] [PATCH v3 0/2] hw/arm: add ethernet support to Allwinner A10 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Beniamino Galvani , Peter Maydell , Peter Crosthwaite , Li Guang , Stefan Hajnoczi 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