From patchwork Fri Feb 12 17:43:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 8294531 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9A0269F6E4 for ; Fri, 12 Feb 2016 17:52:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBCE02041F for ; Fri, 12 Feb 2016 17:52:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFA9820212 for ; Fri, 12 Feb 2016 17:52:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUHro-0001R4-1K; Fri, 12 Feb 2016 17:50:52 +0000 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUHqS-0007jp-2W for linux-arm-kernel@lists.infradead.org; Fri, 12 Feb 2016 17:49:29 +0000 Received: by mail-lf0-x22f.google.com with SMTP id 78so56288909lfy.3 for ; Fri, 12 Feb 2016 09:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=witF+n+79SsXVSqelCW9Pa/kOVZCPR8WeXSM+oqfNBw=; b=ccE/6Y/A1gJ6nQX36+4Jwj2nTPX4toTTJQHZPxPpkHHRLJ0TvZmLEgw29zidpwABL1 g0SQbJAd2/ZqImBRmJHd8PdNODKhncyQ92QQnMACJtFTzcOwYV+n5JiW8pdijSLOaRLj R5sof2GB+iXCMw6B2+vbw5+VrFP2lNhre/nUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=witF+n+79SsXVSqelCW9Pa/kOVZCPR8WeXSM+oqfNBw=; b=JSgyu/G/iB8ezD2gLHhel6TPAqZaDptUCm3mnnIeznvOJQUerMK3L4SPmqtqO99lba 0VxM3UlKIyCMyHRdnOXJrPXzD8y7hIU3HZn/nzDf28IstqH9QQo8yXfpwJw5bQYUp1Af e/QfRazZss/IXQVZRMeukVWhUhiw/nHla403EyjQ5O1TImCv8nGrYOwDC2SRr9FBxk/0 xAydXlpLRWwDPVuy67R70EZigFt2IAyjZzoZosG3Cgr+HAfhj9nAzyCP612/wofMbN96 sqeVgrI3p6Az5Rj14vwrmlZ/FhutKv5+Zjn1BQKGcYwga3LQB/ZijvGoJg9vnJiQXhLB DgZg== X-Gm-Message-State: AG10YOTyeqGeAEaLUwW1CJsN+R0EXqvRF2iViHAtFvlmgV68djuWuahY/C4JR3cevuNvvOQv X-Received: by 10.25.79.16 with SMTP id d16mr1004827lfb.73.1455299346157; Fri, 12 Feb 2016 09:49:06 -0800 (PST) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id ei4sm2017549lbb.18.2016.02.12.09.49.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 09:49:05 -0800 (PST) From: Aleksey Makarov To: linux-acpi@vger.kernel.org Subject: [PATCH v2 7/9] serial: pl011: add acpi_match Date: Fri, 12 Feb 2016 20:43:38 +0300 Message-Id: <1455299022-11641-8-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455299022-11641-1-git-send-email-aleksey.makarov@linaro.org> References: <1455299022-11641-1-git-send-email-aleksey.makarov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160212_094928_370061_B8BA992A X-CRM114-Status: GOOD ( 11.73 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , Graeme Gregory , Greg Kroah-Hartman , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Leif Lindholm , Aleksey Makarov , Christopher Covington , linux-serial@vger.kernel.org, Jiri Slaby , Al Stone , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add an implementation of acpi_match() to the pl011 driver. It allows console to check if it matches the console specified by ACPI SPCR table. Signed-off-by: Aleksey Makarov Tested-by: Christopher Covington --- drivers/tty/serial/amba-pl011.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 500232a..f613bff 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2285,12 +2285,34 @@ static int __init pl011_console_setup(struct console *co, char *options) return uart_set_options(&uap->port, co, baud, parity, bits, flow); } +static int __init pl011_console_acpi_match(struct console *co, + struct acpi_table_spcr *spcr) +{ + struct uart_amba_port *uap = amba_ports[co->index < 0 ? 0 : co->index]; + + if (uap->vendor->access_32b) { + if (spcr->interface_type != ACPI_DBG2_ARM_SBSA_32BIT) + return -ENODEV; + } else { + if (spcr->interface_type != ACPI_DBG2_ARM_PL011 && + spcr->interface_type != ACPI_DBG2_ARM_SBSA_GENERIC) + return -ENODEV; + } + + if (spcr->serial_port.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY || + spcr->serial_port.address != (u64)uap->port.mapbase) + return -ENODEV; + + return 0; +} + static struct uart_driver amba_reg; static struct console amba_console = { .name = "ttyAMA", .write = pl011_console_write, .device = uart_console_device, .setup = pl011_console_setup, + .acpi_match = pl011_console_acpi_match, .flags = CON_PRINTBUFFER, .index = -1, .data = &amba_reg,