From patchwork Fri Dec 9 13:34:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Voevodin X-Patchwork-Id: 130389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0423A1007D7 for ; Sat, 10 Dec 2011 01:17:17 +1100 (EST) Received: from localhost ([::1]:41207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZ0cS-0006cn-Im for incoming@patchwork.ozlabs.org; Fri, 09 Dec 2011 08:36:08 -0500 Received: from eggs.gnu.org ([140.186.70.92]:34586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZ0br-0004rP-SE for qemu-devel@nongnu.org; Fri, 09 Dec 2011 08:35:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZ0bk-0000Zr-Uw for qemu-devel@nongnu.org; Fri, 09 Dec 2011 08:35:31 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:27622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZ0bk-0000Zh-PT for qemu-devel@nongnu.org; Fri, 09 Dec 2011 08:35:24 -0500 Received: from euspt2 (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0LVX001IFV2ZA0@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 09 Dec 2011 13:35:23 +0000 (GMT) Received: from evvoevodinPC.rnd.samsung.ru ([106.109.8.48]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LVX00MANV28B5@spt2.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 09 Dec 2011 13:35:23 +0000 (GMT) Date: Fri, 09 Dec 2011 17:34:39 +0400 From: Evgeny Voevodin In-reply-to: <1323437682-28792-1-git-send-email-e.voevodin@samsung.com> To: qemu-devel@nongnu.org Message-id: <1323437682-28792-13-git-send-email-e.voevodin@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.4.1 Content-type: TEXT/PLAIN Content-transfer-encoding: 7BIT References: <1323437682-28792-1-git-send-email-e.voevodin@samsung.com> X-detected-operating-system: by eggs.gnu.org: Solaris 9.1 X-Received-From: 210.118.77.11 Cc: m.kozlov@samsung.com, d.solodkiy@samsung.com, Evgeny Voevodin Subject: [Qemu-devel] [PATCH 12/15] hw/exynos4210.c: Add LAN support for SMDKC210. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org SMDKC210 uses lan9215 chip, but lan9118 in 16-bit mode seems to be enough. Signed-off-by: Evgeny Voevodin --- hw/exynos4210.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/hw/exynos4210.c b/hw/exynos4210.c index 8d8a12c..5b18b68 100644 --- a/hw/exynos4210.c +++ b/hw/exynos4210.c @@ -26,6 +26,8 @@ #include "sysemu.h" #include "sysbus.h" #include "arm-misc.h" +#include "net.h" +#include "devices.h" #include "exec-memory.h" #include "exynos4210.h" @@ -224,6 +226,8 @@ static void exynos4210_init(ram_addr_t ram_size, SysBusDevice *busdev; ram_addr_t mem_size; int n; + NICInfo *nd; + int done_nic = 0; switch (board_type) { case BOARD_EXYNOS4210_NURI: @@ -444,6 +448,20 @@ static void exynos4210_init(ram_addr_t ram_size, exynos4210_uart_create(addr, fifo_size, channel, NULL, uart_irq); } + /*** LAN adapter: this should be a 9215 but the 9118 is close enough ***/ + if (board_type == BOARD_EXYNOS4210_SMDKC210) { + for (n = 0; n < nb_nics; n++) { + nd = &nd_table[n]; + + if (!done_nic && (!nd->model || + strcmp(nd->model, "lan9118") == 0)) { + dev = lan9118_init(nd, 0x05000000, + qemu_irq_invert(irq_table[exynos4210_get_irq(37, 1)])); + qdev_prop_set_uint32(dev, "mode_16bit", 1); + done_nic = 1; + } + } + } /*** Load kernel ***/