From patchwork Thu Apr 9 15:09:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 46971 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E078021416 for ; Thu, 9 Apr 2015 15:22:00 +0000 (UTC) Received: by lamp14 with SMTP id p14sf27872935lam.3 for ; Thu, 09 Apr 2015 08:21:59 -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:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=AGudYpUx49lyJRDnwnPDfB3pdPZaVu6tjZfgo1JayWU=; b=Bw1dDgDRdjGuVbrMugJ4mAz4zr0RArbna7qWVqqyMT/OoKSU1me831UXWz0fUjSBxr PZiY9JkpoUmQvBNOTosUa4cBR2ZNTfZJfqCVO1AE0BzMD1KYdmYNoR3ptol0vgvKoe/X SARDWKM1/sO0ZmKQZam7aKBigdiLrvrN8ECayPGFotO+AhOlmr7FYX2f8+9NfYSVLNFm 0Jj06rCSJK5cSnGc+aUhuRVZQdkK/W8arO6vTunWJ7MmYT1RM+PNMUnNc9oBx8ya97iV kqGutO4gheXYRCBrRj64ncWWBf37ZEL6s3eUGgDp+W3p+2yYdPIK5wOvque1zZnRETXH s70w== X-Gm-Message-State: ALoCoQn/uYlydDGrCSzGg1hFs7r+4+KNs+c0Sk2MVvetJ7o8r6Jsd+7WSerNFayZZ1NQ1tt2bfpI X-Received: by 10.180.74.197 with SMTP id w5mr709074wiv.5.1428592919882; Thu, 09 Apr 2015 08:21:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.227 with SMTP id t3ls338167laj.72.gmail; Thu, 09 Apr 2015 08:21:59 -0700 (PDT) X-Received: by 10.112.72.132 with SMTP id d4mr10486904lbv.1.1428592919746; Thu, 09 Apr 2015 08:21:59 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id f7si11707433lbs.25.2015.04.09.08.21.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Apr 2015 08:21:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by laat2 with SMTP id t2so85048848laa.1 for ; Thu, 09 Apr 2015 08:21:59 -0700 (PDT) X-Received: by 10.112.204.6 with SMTP id ku6mr14258030lbc.73.1428592919593; Thu, 09 Apr 2015 08:21:59 -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.67.65 with SMTP id l1csp537362lbt; Thu, 9 Apr 2015 08:21:58 -0700 (PDT) X-Received: by 10.52.163.81 with SMTP id yg17mr23916941vdb.97.1428592918147; Thu, 09 Apr 2015 08:21:58 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id wb8si441076vdc.94.2015.04.09.08.21.57 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 09 Apr 2015 08:21:58 -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 1YgEH0-0003NX-2e; Thu, 09 Apr 2015 15:21:42 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YgEGy-0003Mr-8C for xen-devel@lists.xenproject.org; Thu, 09 Apr 2015 15:21:40 +0000 Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id 31/68-29893-30996255; Thu, 09 Apr 2015 15:21:39 +0000 X-Env-Sender: julien.grall@citrix.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1428592892!16715287!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 6.13.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7962 invoked from network); 9 Apr 2015 15:21:37 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 9 Apr 2015 15:21:37 -0000 X-IronPort-AV: E=Sophos;i="5.11,550,1422921600"; d="scan'208";a="253569342" From: Julien Grall To: Date: Thu, 9 Apr 2015 16:09:45 +0100 Message-ID: <1428592185-18581-20-git-send-email-julien.grall@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1428592185-18581-1-git-send-email-julien.grall@citrix.com> References: <1428592185-18581-1-git-send-email-julien.grall@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v5 p2 19/19] docs/misc: arm: Add documentation about Device Tree 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: , 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: patch@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.215.49 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: From: Julien Grall 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 Device Tree passthrough. Signed-off-by: Julien Grall --- Changes in v5: - Drop references to "non-PCI" in favor of "Device Tree" - Typoes and update the docs Changes in v4: - Patch added --- docs/misc/arm/passthrough.txt | 61 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 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..93da99c --- /dev/null +++ b/docs/misc/arm/passthrough.txt @@ -0,0 +1,61 @@ +Passthrough a device described in the Device Tree to a guest +============================================================ + +The example will use the secondary network card for the midway server. + +1) Mark the device to let Xen know 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 a partial device tree describing the device. The IRQ are mapped +1:1 to the guest (i.e VIRQ == IRQ). For MMIO, you will have to find a hole +in the guest memory layout (see xen/include/public/arch-arm.h, note that +the layout is not stable and can change between versions 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 following properies are mandatory with the /passthrough node: + - compatible: It should always contain "simple-bus" + - ranges + - #address-cells + - #size-cells + +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" ] + +