From patchwork Fri Apr 26 11:04:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 16419 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 953772397A for ; Fri, 26 Apr 2013 11:07:33 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id w16sf6857111vbb.2 for ; Fri, 26 Apr 2013 04:06:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=lm53J+CN1zh6Dd1C231xdItSVUG9ECoLxrE/cI0NbKo=; b=m3DAlepU5hZON7nZmQ4xf/Eb3gYVNCkXoNdSEPGggV1Gu+66t4SQwuEfOgVOYTcTqS 5rwrN5q/QQBwF9VuDjFWGBnk3FLZJJRTt6sMZOGodvo7QBr9v0RkWJasuDniZj7SfmT5 j2LnFW1r1UgMFj8N47WxLHPkLyE8wRNxsJx5oHLIhUq5fTfMTaaje9K2o3rlA/DdUVlt ZP1nn6PTSOAxWIVU2AYlEFjNOb/4gIfLNk0E/A3oFtuvN1OQWmOvAfxomfcfk2W3lsPp gc/5cXD6Qbgynz2RW8pLJ9TnaTpETkhMrmjS4vNZnObOHnJBb0OV0kVdCUM9Xn4b0fVM 1+KQ== X-Received: by 10.58.132.163 with SMTP id ov3mr14608092veb.17.1366974398062; Fri, 26 Apr 2013 04:06:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.118.106 with SMTP id kl10ls1812527qeb.34.gmail; Fri, 26 Apr 2013 04:06:37 -0700 (PDT) X-Received: by 10.58.224.101 with SMTP id rb5mr29061866vec.17.1366974397844; Fri, 26 Apr 2013 04:06:37 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id da5si5164693vdc.63.2013.04.26.04.06.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 04:06:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id m17so3714320vca.11 for ; Fri, 26 Apr 2013 04:06:37 -0700 (PDT) X-Received: by 10.52.71.4 with SMTP id q4mr24399559vdu.8.1366974397651; Fri, 26 Apr 2013 04:06:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp63310veb; Fri, 26 Apr 2013 04:06:37 -0700 (PDT) X-Received: by 10.66.147.103 with SMTP id tj7mr29907532pab.82.1366974396658; Fri, 26 Apr 2013 04:06:36 -0700 (PDT) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by mx.google.com with ESMTPS id iv6si10535245pac.212.2013.04.26.04.06.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 04:06:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.169 is neither permitted nor denied by best guess record for domain of pranavkumar@linaro.org) client-ip=209.85.192.169; Received: by mail-pd0-f169.google.com with SMTP id 10so2409812pdc.14 for ; Fri, 26 Apr 2013 04:06:36 -0700 (PDT) X-Received: by 10.68.221.200 with SMTP id qg8mr58138954pbc.58.1366974396180; Fri, 26 Apr 2013 04:06:36 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.72.18.82]) by mx.google.com with ESMTPSA id l4sm11310280pbo.6.2013.04.26.04.06.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 04:06:35 -0700 (PDT) From: Pranavkumar Sawargaonkar To: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, rusty@rustcorp.com.au, linaro-kernel@lists.linaro.org, patches@linaro.org, anup.patel@linaro.org, Pranavkumar Sawargaonkar Subject: [PATCH 1/2] virtio: console: Add early writeonly register to config space Date: Fri, 26 Apr 2013 16:34:55 +0530 Message-Id: <1366974299-17877-2-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1366974299-17877-1-git-send-email-pranavkumar@linaro.org> References: <1366974299-17877-1-git-send-email-pranavkumar@linaro.org> X-Gm-Message-State: ALoCoQkwPk0FLXE8QMTSIMLvXwcVUnYkNZumcvlIC0w+ap+fhDcBZ9jGmTzTIb7WYdRw9WQukXqW X-Original-Sender: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch adds a early_wr register (writeonly) in config space of virtio console device which can be used for debugging. The patch also updates virtio-spec in Documentation to reflect this feature addition in virtio console. Signed-off-by: Pranavkumar Sawargaonkar Signed-off-by: Anup Patel --- Documentation/virtual/virtio-spec.txt | 13 +++++++++++-- include/uapi/linux/virtio_console.h | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Documentation/virtual/virtio-spec.txt b/Documentation/virtual/virtio-spec.txt index 0d6ec85..bc4e8b5 100644 --- a/Documentation/virtual/virtio-spec.txt +++ b/Documentation/virtual/virtio-spec.txt @@ -1927,11 +1927,18 @@ Ports 2 onwards only if VIRTIO_CONSOLE_F_MULTIPORT is set ports; configuration fields nr_ports and max_nr_ports are valid and control virtqueues will be used. + VIRTIO_CONSOLE_F_EARLY_WRITE(2) Device has support for early + write. Configuration field early_wr is valid. + Device configuration layout The size of the console is supplied in the configuration space if the VIRTIO_CONSOLE_F_SIZE feature is set. Furthermore, if the VIRTIO_CONSOLE_F_MULTIPORT feature is set, the maximum number of ports supported by the device can - be fetched.struct virtio_console_config { + be fetched. If VIRTIO_CONSOLE_F_EARLY_WRITE is set then one can + use early write to output single character without initializing + virtio queues. + + struct virtio_console_config { u16 cols; @@ -1941,7 +1948,9 @@ Ports 2 onwards only if VIRTIO_CONSOLE_F_MULTIPORT is set u32 max_nr_ports; -}; + u32 early_wr; + + }; Device Initialization diff --git a/include/uapi/linux/virtio_console.h b/include/uapi/linux/virtio_console.h index ee13ab6..7cd84b5 100644 --- a/include/uapi/linux/virtio_console.h +++ b/include/uapi/linux/virtio_console.h @@ -38,6 +38,7 @@ /* Feature bits */ #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ #define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */ +#define VIRTIO_CONSOLE_F_EARLY_WRITE 2 /* Does host support early write? */ #define VIRTIO_CONSOLE_BAD_ID (~(u32)0) @@ -48,6 +49,8 @@ struct virtio_console_config { __u16 rows; /* max. number of ports this device can hold */ __u32 max_nr_ports; + /* early write register */ + __u32 early_wr; } __attribute__((packed)); /*