Received: from eggs.gnu.org ([2001:4830:134:3::10]:42307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7XRm-0001ht-Id for qemu-devel@nongnu.org; Sun, 26 Jan 2014 16:41:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7XRe-0003WR-4c for qemu-devel@nongnu.org; Sun, 26 Jan 2014 16:40:54 -0500 Received: from mail-ee0-x22f.google.com ([2a00:1450:4013:c00::22f]:50541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7XRd-0003WN-TR for qemu-devel@nongnu.org; Sun, 26 Jan 2014 16:40:46 -0500 Received: by mail-ee0-f47.google.com with SMTP id d49so1894215eek.20 for ; Sun, 26 Jan 2014 13:40:45 -0800 (PST) From: Beniamino Galvani Date: Sun, 26 Jan 2014 22:39:49 +0100 Message-Id: <1390772392-4705-1-git-send-email-b.galvani@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] =?utf-8?q?=5BPATCH_v4_0/3=5D_hw/arm=3A_add_ethernet_?= =?utf-8?q?support_to_Allwinner_A10?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , Stefan Hajnoczi , Beniamino Galvani , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Li Guang This patch series adds support for the EMAC Fast Ethernet controller found on Allwinner SoCs to the Allwinner A10. Changelog: v4: Address comments from Peter Crosthwaite and Andreas Färber: * Add functions for multiple bytes push/pop to Fifo8 * Get rid of custom fifo implementation and use generic one for both tx and rx * Rename aw_emac_mdio_read -> RTL8201CP_mdio_read * Allow reception of new packets from net layer only when there is space for a full size frame * Change TYPE_AW_EMAC from "allwinner_emac" to "allwinner-emac" * Property "phyaddr" -> "phy-addr" * Remove trailing newlines from error_report() messages 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 (3): util/fifo8: implement push/pop of multiple bytes 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 | 11 +- hw/net/Makefile.objs | 1 + hw/net/allwinner_emac.c | 532 +++++++++++++++++++++++++++++++++++++++ include/hw/arm/allwinner-a10.h | 3 + include/hw/net/allwinner_emac.h | 211 ++++++++++++++++ include/qemu/fifo8.h | 43 ++++ util/fifo8.c | 44 ++++ 9 files changed, 860 insertions(+), 2 deletions(-) create mode 100644 hw/net/allwinner_emac.c create mode 100644 include/hw/net/allwinner_emac.h -- 1.7.10.4