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: 61879 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp968010lbl; Fri, 12 Feb 2016 09:50:00 -0800 (PST) X-Received: by 10.66.63.104 with SMTP id f8mr3874049pas.109.1455299399883; Fri, 12 Feb 2016 09:49:59 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16si21238754pfa.129.2016.02.12.09.49.59; Fri, 12 Feb 2016 09:49:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752500AbcBLRt6 (ORCPT + 6 others); Fri, 12 Feb 2016 12:49:58 -0500 Received: from mail-lf0-f44.google.com ([209.85.215.44]:33247 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311AbcBLRtH (ORCPT ); Fri, 12 Feb 2016 12:49:07 -0500 Received: by mail-lf0-f44.google.com with SMTP id m1so56564663lfg.0 for ; Fri, 12 Feb 2016 09:49:06 -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=TPnB4ghj+RoaqTB/Fs/ZBVsVuJ3QzDS8vdeoHEYPq+xAFPs5GN8kZs4VYqx6JHGnAO vZKmH+KkuAwZkVLhi9sOyBM3yiDuI/OUML9iIokpkNAOw55yuwocQlxSJYeLsZceCOSa RPNmSm+Bl7asdycoKXGnEjL2NgzmEGHvBp2wgsSr1KidKa/0zkdNjYVwv1XTSdv2mIig qKgT7tUzBRshLCaBCSHhAnnt3cJ2urNL4OIyY8Ca6uKjHv7vIYbaRixEbTgjG4uRigtw Ir1Jy1mVtXL02eKR9/1LPzifaK3nWLgtKfkNfF/JP9Ve9rNcqf8q5onZWjuuMcLMcNP7 +GyQ== X-Gm-Message-State: AG10YORhK7PcpTZx+dd/1JQsoK90p6oy7UDXyl+1K/n6rwAWecBTC2bEraCMP2kcOLObk2M+ 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 Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aleksey Makarov , Russell King , Greg Kroah-Hartman , "Rafael J . Wysocki" , Leif Lindholm , Graeme Gregory , Al Stone , Christopher Covington , Jiri Slaby 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> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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(+) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,