From patchwork Thu Jul 25 16:59:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 18593 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4C72825DF6 for ; Thu, 25 Jul 2013 17:00:12 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r9sf773782yen.3 for ; Thu, 25 Jul 2013 10:00:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to: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=bF5fGQDi3ApgIQyKd9wAxVl1WLzCKWt4jTfcSNSvyOs=; b=inAE0nEZHNHdvDBFHNoBTRgjQOQJ825ShRqEJ4WaVBp32tpLQYnyroWVsogN5hRSsl talZWmtkepSAs1S5OD+DqgBskfFOU4kNtmIWk1mdQ2uCNn/wphyQhBCz8QtQQAm6Pd1d EBuY9HES+f43+7Q2Jt8h+6VXeKH8YXLY0vGLLpPUzQPpgVuJr4VaFgvX9BheV21wD/MH nj0xJl7CnjntZqtet9zVLLaR0tXAZ46iIanSBmnaXGoKzHlBb6PKlHXtIx1vppODjr+i NTw/VlxaD6sryFRak0rZBniYgXYpIFW4IcZmNuL+lGUyhPYOC6A+ZdS8BDNL863mg2xL TCUA== X-Received: by 10.236.92.7 with SMTP id i7mr23202603yhf.52.1374771611973; Thu, 25 Jul 2013 10:00:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.116.197 with SMTP id jy5ls745019qeb.10.gmail; Thu, 25 Jul 2013 10:00:11 -0700 (PDT) X-Received: by 10.52.231.130 with SMTP id tg2mr14776190vdc.84.1374771611866; Thu, 25 Jul 2013 10:00:11 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id ex7si12641597vdb.109.2013.07.25.10.00.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 10:00:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id oz10so631035veb.3 for ; Thu, 25 Jul 2013 10:00:11 -0700 (PDT) X-Received: by 10.52.120.77 with SMTP id la13mr15304966vdb.23.1374771611769; Thu, 25 Jul 2013 10:00:11 -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.165.8 with SMTP id yu8csp87049veb; Thu, 25 Jul 2013 10:00:11 -0700 (PDT) X-Received: by 10.194.249.195 with SMTP id yw3mr30624229wjc.65.1374771610795; Thu, 25 Jul 2013 10:00:10 -0700 (PDT) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by mx.google.com with ESMTPS id f5si19065727wjx.46.2013.07.25.10.00.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 10:00:10 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.176 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.212.176; Received: by mail-wi0-f176.google.com with SMTP id ey16so5888175wid.3 for ; Thu, 25 Jul 2013 10:00:10 -0700 (PDT) X-Received: by 10.194.216.99 with SMTP id op3mr32404249wjc.52.1374771610164; Thu, 25 Jul 2013 10:00:10 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id nb12sm3150016wic.3.2013.07.25.10.00.08 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 10:00:08 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, Stefano.Stabellini@eu.citrix.com, patches@linaro.org, Julien Grall Subject: [PATCH 8/8] pl011: Implement serial_info callback Date: Thu, 25 Jul 2013 17:59:34 +0100 Message-Id: <1374771574-7848-9-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1374771574-7848-1-git-send-email-julien.grall@linaro.org> References: <1374771574-7848-1-git-send-email-julien.grall@linaro.org> X-Gm-Message-State: ALoCoQnOuqB9TVOi0+Hsq5tgdQOKMNzU1dquH8aGtQZClZXEBpyRd2YTrkV0MQ8X60TO3j9x3+gK X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.172 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: , Signed-off-by: Julien Grall --- xen/drivers/char/pl011.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c index fd87e68..352e5b2 100644 --- a/xen/drivers/char/pl011.c +++ b/xen/drivers/char/pl011.c @@ -36,6 +36,7 @@ static struct pl011 { void __iomem *regs; /* UART with IRQ line: interrupt-driven I/O. */ struct irqaction irqaction; + struct serial_info info; /* /\* UART with no IRQ line: periodically-polled I/O. *\/ */ /* struct timer timer; */ /* unsigned int timeout_ms; */ @@ -190,6 +191,13 @@ static const struct dt_irq __init *pl011_dt_irq(struct serial_port *port) return &uart->irq; } +static const struct serial_info *pl011_info(struct serial_port *port) +{ + struct pl011 *uart = port->uart; + + return &uart->info; +} + static struct uart_driver __read_mostly pl011_driver = { .init_preirq = pl011_init_preirq, .init_postirq = pl011_init_postirq, @@ -201,6 +209,7 @@ static struct uart_driver __read_mostly pl011_driver = { .getc = pl011_getc, .irq = pl011_irq, .dt_irq_get = pl011_dt_irq, + .info = pl011_info, }; /* TODO: Parse UART config from the command line */ @@ -248,6 +257,12 @@ static int __init pl011_uart_init(struct dt_device_node *dev, return res; } + uart->info.base_addr = addr; + uart->info.size = size; + uart->info.data_off = DR; + uart->info.status_off = FR; + uart->info.status = 0; + /* Register with generic serial driver. */ serial_register_uart(SERHND_DTUART, &pl011_driver, uart);