From patchwork Mon Jan 25 11:45:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 8107401 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 270289F440 for ; Mon, 25 Jan 2016 11:48:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 53B1A202F8 for ; Mon, 25 Jan 2016 11:48:13 +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 F1B5D20303 for ; Mon, 25 Jan 2016 11:48:11 +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 1aNfbf-0006cR-QM; Mon, 25 Jan 2016 11:46:51 +0000 Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aNfaw-00064z-KV for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2016 11:46:10 +0000 Received: by mail-lb0-x22c.google.com with SMTP id oh2so72425989lbb.3 for ; Mon, 25 Jan 2016 03:45:46 -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=n0ggAoEua4YpLNXxT44HxRWV5RJNU4KWbQuiDXlTHTA=; b=MUP525nZ92bjmw2HmAn13bk7/wl0vsNlRfkh4IWs+7vnimXhUQB8uuarobee8BZCBy C+LKHWQ+WjctXQCwr3qeds6ngPe0x3peh+IsWzQWWG2rEahagQnkjnFbNOCm1wifPFXm r6WIO88zl08rspBBW7GIJuqyUvaifpPimX+jA= 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=n0ggAoEua4YpLNXxT44HxRWV5RJNU4KWbQuiDXlTHTA=; b=iWO25L7nTFHWz2P2Ht15SKvqlvQUNFNuyA4fDgBri/nYeKBAAVqN7kUHoDF4mvw+co jLXkMG8MOyDcYWWdbqldFUxKP9dtgHODYL72CKz40dMkjLer28E3Vfu+s8bZbo5oJWHs PiIA5ygAwyjv0lAiLYOsffTPwqO7gPba45XPtjHIDMiIEfiaPVpKmQZ/rlIY7GdhO5Ej Jve9O7MFktVVJBZzWWp6Cfs4MgzeuWbxrPTp56yRVKtZAERxd/NVzQyfAtbr+u7asXKu LiyonTErQ74qNbTC+RgJzV45k1yJI1KGXt+VzxeZKthkBCzhr3YjDp6whJULbTlbXtF2 zywg== X-Gm-Message-State: AG10YOSRYNPy+YsBweZLzm+EyhFLP7+1Z1NBT6KnqvbENt1gxBYo1O/I09W1wXNBT9Uw1E1s X-Received: by 10.112.172.233 with SMTP id bf9mr6107708lbc.121.1453722344578; Mon, 25 Jan 2016 03:45:44 -0800 (PST) Received: from lemon.localdomain (host-2-60-44-52.pppoe.omsknet.ru. [2.60.44.52]) by smtp.gmail.com with ESMTPSA id jx8sm2662527lbc.29.2016.01.25.03.45.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Jan 2016 03:45:43 -0800 (PST) From: Aleksey Makarov To: linux-acpi@vger.kernel.org Subject: [PATCH 3/3] serial: pl011: add acpi_match for amba-pl011.c Date: Mon, 25 Jan 2016 17:45:23 +0600 Message-Id: <1453722324-22407-4-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453722324-22407-1-git-send-email-aleksey.makarov@linaro.org> References: <1453722324-22407-1-git-send-email-aleksey.makarov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160125_034607_063680_B9BFFEDD X-CRM114-Status: GOOD ( 12.17 ) 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" , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Leif Lindholm , Robert Moore , Aleksey Makarov , Lv Zheng , linux-serial@vger.kernel.org, Jiri Slaby , devel@acpica.org, linux-arm-kernel@lists.infradead.org, Len Brown 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 to check if the console matches one specified with ACPI SPCR table. Signed-off-by: Aleksey Makarov --- drivers/tty/serial/amba-pl011.c | 14 ++++++++++++++ include/acpi/actbl2.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 899a771..3f4aa1b 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2189,12 +2189,26 @@ 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]; + + if (spcr->interface_type == ACPI_DBG2_ARM_PL011 && + spcr->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY && + spcr->serial_port.address == (u64)uap->port.mapbase) + return 0; + + return -ENODEV; +} + 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, diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 6e28f54..ce4cb37 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -371,6 +371,10 @@ struct acpi_dbg2_device { #define ACPI_DBG2_16550_COMPATIBLE 0x0000 #define ACPI_DBG2_16550_SUBSET 0x0001 +#define ACPI_DBG2_ARM_PL011 0x0003 +#define ACPI_DBG2_ARM_SBSA_GENERIC 0x000e +#define ACPI_DBG2_ARM_DCC 0x000f +#define ACPI_DBG2_DCM2835 0x0010 #define ACPI_DBG2_1394_STANDARD 0x0000