From patchwork Thu Mar 19 19:29:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 46098 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1444B21515 for ; Thu, 19 Mar 2015 19:32:26 +0000 (UTC) Received: by lbdu10 with SMTP id u10sf9788152lbd.3 for ; Thu, 19 Mar 2015 12:32:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=TXsfUWukdFsZvs0t4/F9i9CJb5dkbWZyhHYM+z/HoL4=; b=gEjzdsvx02Jio/wtTO4+g1DuKW3D/v40mFL/D/M2y2j1Nr08ev+rDzqB0CIOQu+/NQ I2t9DiD5r5uyKb1bkMtWcIXCd7UFaYKV9q/D57qalcYqJj14JD0LluOmm5i1oBm7Yb37 Z/Toa25YSJ4rGHS/HMAxBf7B6D8eylLPX6/Sg4Gza3iNFk1ohXNr08Ov00+bUeH3ROOO fsKI8lYzX/wc0bCkVQotcjcILVIyNgJhtJi/kuNJvoOawgc/NrUgcKyvXU3rg8/uZjof SFvwsHOliVVzJtTVrJrsIr1Oo1QdoZMn3qVyauYiYX6sbnjEL4fNG0LyBO8y4XeIVah1 GqUg== X-Gm-Message-State: ALoCoQn9cw/Cr1joSQrz+Y3b025Pb/85Zs/Ekkm/ghyS2Y+KfOgK0UBc75PHUZWCQe1esJJSTa7b X-Received: by 10.112.125.67 with SMTP id mo3mr10593113lbb.6.1426793545032; Thu, 19 Mar 2015 12:32:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.34 with SMTP id ir2ls318688lac.84.gmail; Thu, 19 Mar 2015 12:32:24 -0700 (PDT) X-Received: by 10.152.179.139 with SMTP id dg11mr64387137lac.28.1426793544888; Thu, 19 Mar 2015 12:32:24 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id s4si1680755lbo.42.2015.03.19.12.32.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 12:32:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbsy1 with SMTP id sy1so60462508lbb.1 for ; Thu, 19 Mar 2015 12:32:24 -0700 (PDT) X-Received: by 10.152.22.67 with SMTP id b3mr68853877laf.117.1426793544778; Thu, 19 Mar 2015 12:32:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp597568lbj; Thu, 19 Mar 2015 12:32:24 -0700 (PDT) X-Received: by 10.52.250.137 with SMTP id zc9mr78390189vdc.10.1426793540356; Thu, 19 Mar 2015 12:32:20 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id fj3si1952900vdb.81.2015.03.19.12.32.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Mar 2015 12:32:20 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYgAH-0005jH-3C; Thu, 19 Mar 2015 19:31:33 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYgAD-0005ZV-Ht for xen-devel@lists.xenproject.org; Thu, 19 Mar 2015 19:31:29 +0000 Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id 1C/E1-14870-0142B055; Thu, 19 Mar 2015 19:31:28 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-14.tower-27.messagelabs.com!1426793487!14404379!1 X-Originating-IP: [74.125.82.177] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8608 invoked from network); 19 Mar 2015 19:31:27 -0000 Received: from mail-we0-f177.google.com (HELO mail-we0-f177.google.com) (74.125.82.177) by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 19 Mar 2015 19:31:27 -0000 Received: by weop45 with SMTP id p45so65636006weo.0 for ; Thu, 19 Mar 2015 12:31:27 -0700 (PDT) X-Received: by 10.194.121.68 with SMTP id li4mr155827532wjb.138.1426793487092; Thu, 19 Mar 2015 12:31:27 -0700 (PDT) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id hl8sm3203005wjb.38.2015.03.19.12.31.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2015 12:31:26 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 19 Mar 2015 19:29:59 +0000 Message-Id: <1426793399-6283-34-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> References: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v4 33/33] docs/misc: arm: Add documentation about non-PCI passthrough X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Note that the example is done on Midway whose SMMU driver is not supported on Xen upstream. Currently, I don't have other platform where I can test non-PCI passthrough. Signed-off-by: Julien Grall --- Changes in v4: - Patch added --- docs/misc/arm/passthrough.txt | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/misc/arm/passthrough.txt diff --git a/docs/misc/arm/passthrough.txt b/docs/misc/arm/passthrough.txt new file mode 100644 index 0000000..cf6cc61 --- /dev/null +++ b/docs/misc/arm/passthrough.txt @@ -0,0 +1,58 @@ +Passthrough a non-pci device to a guest +======================================= + +The example will use the secondary network card for the midway server. + +1) Mark the device to let Xen knowns the device will be used for passthrough. +This is done in the device tree node describing the device by adding the +property "xen,passthrough". The command to do it in U-Boot is: + + fdt set /soc/ethernet@fff51000 xen,passthrough + +2) Create the partial device tree describing the device. The IRQ are mapped +1:1 to the guest (i.e VIRQ == IRQ). For MMIO will have to find hole in the +guest memory layout (see xen/include/public/arch-arm.h, noted the layout +is not stable and can change between 2 releases version of Xen). + +/dts-v1/; + +/ { + /* #*cells are here to keep DTC happy */ + #address-cells = <2>; + #size-cells = <2>; + + aliases { + net = &mac0; + }; + + passthrough { + compatible = "simple-bus"; + ranges; + #address-cells = <2>; + #size-cells = <2>; + mac0: ethernet@10000000 { + compatible = "calxeda,hb-xgmac"; + reg = <0 0x10000000 0 0x1000>; + interrupts = <0 80 4 0 81 4 0 82 4>; + }; + }; +}; + +Note: + * The interrupt-parent property will be added by the toolstack in the + root node; + * The properties compatible, ranges, #address-cells and #size-cells + in /passthrough are mandatory. + +3) Compile the partial guest device with dtc (Device Tree Compiler). +For our purpose, the compiled file will be called guest-midway.dtb and +placed in /root in DOM0. + +3) Add the following options in the guest configuration file: + +device_tree = "/root/guest-midway.dtb" +dtdev = [ "/soc/ethernet@fff51000" ] +irqs = [ 112, 113, 114 ] +iomem = [ "0xfff51,1@0x10000" ] + +