From patchwork Wed Dec 23 14:19:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 7912911 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 38A8B9F318 for ; Wed, 23 Dec 2015 14:24:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 31F3A20421 for ; Wed, 23 Dec 2015 14:24:44 +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 5B278203EC for ; Wed, 23 Dec 2015 14:24:43 +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 1aBkK9-0001iS-1c; Wed, 23 Dec 2015 14:23:29 +0000 Received: from mail-lf0-x232.google.com ([2a00:1450:4010:c07::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aBkJL-00014Y-0F for linux-arm-kernel@lists.infradead.org; Wed, 23 Dec 2015 14:22:41 +0000 Received: by mail-lf0-x232.google.com with SMTP id y184so147616909lfc.1 for ; Wed, 23 Dec 2015 06:22:18 -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=mVbeFgKxI3SetVf6GOdUxku9smw7Fwu2xXmaveW42Fg=; b=M/XD33RyHOtPzzpEGyrk5LNE++8kWT/uq5yGN+qOx+CbL0dn1ZHDU5x6cAmImYE3Ma GfizQ0rGX4OmXn0uQc6qA9YZ5rDYIFGaxsKVl1emS2xheNvnbTveCTx0/zI8SWY2VU+r kMB+ggKOfFvqipHBuMwG38a/11toyYaYC5Yus= 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=mVbeFgKxI3SetVf6GOdUxku9smw7Fwu2xXmaveW42Fg=; b=S4tggA4rEICnMMdXDyEg5KMoF7URpYqMI+qwXTGjfQGtCP/qzlo988pKd13+xZlscW dwWF4q8ajf54erdu85GsGYDLK0O+k8vF1lgrJSKnbe8/r1R7iOATYs9pWoedrbjuSzsU byQInP1TKT9kJwC0/E3nmce2O6M0FdH5k3w9S7Aug6dulTjBlOoyI+jBrWsDuFqfB6km hwzc9k5lyTEBb6RN9ULQtrCV67mcdH9jpYr/GfwsMcwkGvRGaEDLWuLGg3Fh1d2PUYPf 1qCPJkUgSIXWhkWdBY9EcPZpVHZtV1Ek0dmZsm2lg6rJshKfakhOyg18bloFa8MaGzOb VRRw== X-Gm-Message-State: ALoCoQk5fYtv6UUm2P2at32pWIVxvr995t6/BYWfVXVvzI/np+ryTzJBeJAzTJKuqkpavIWRhyue7cozmoGFOV/iV/Vlw+phPw== X-Received: by 10.25.144.5 with SMTP id s5mr10795695lfd.154.1450880536890; Wed, 23 Dec 2015 06:22:16 -0800 (PST) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id a75sm6693381lfe.34.2015.12.23.06.22.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Dec 2015 06:22:15 -0800 (PST) From: Aleksey Makarov To: linux-acpi@vger.kernel.org Subject: [PATCH v4 3/3] serial: amba-pl011: add ACPI support to AMBA probe Date: Wed, 23 Dec 2015 17:19:42 +0300 Message-Id: <1450880383-29560-4-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1450880383-29560-1-git-send-email-aleksey.makarov@linaro.org> References: <1450880383-29560-1-git-send-email-aleksey.makarov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151223_062239_479018_E581F571 X-CRM114-Status: GOOD ( 14.59 ) 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 , Andy Shevchenko , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Vladimir Zapolskiy , Aleksey Makarov , Shannon Zhao , linux-serial@vger.kernel.org, Jiri Slaby , 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.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 From: Graeme Gregory In ACPI this device is only defined in SBSA mode so if we are coming from ACPI use this mode. Signed-off-by: Graeme Gregory Signed-off-by: Aleksey Makarov --- drivers/tty/serial/amba-pl011.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 899a771..974cb9e 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2368,18 +2368,33 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) if (!uap) return -ENOMEM; - uap->clk = devm_clk_get(&dev->dev, NULL); - if (IS_ERR(uap->clk)) - return PTR_ERR(uap->clk); - - uap->vendor = vendor; - uap->lcrh_rx = vendor->lcrh_rx; - uap->lcrh_tx = vendor->lcrh_tx; - uap->fifosize = vendor->get_fifosize(dev); - uap->port.irq = dev->irq[0]; - uap->port.ops = &amba_pl011_pops; + /* ACPI only defines SBSA variant */ + if (has_acpi_companion(&dev->dev)) { + /* + * According to ARM ARMH0011 is currently the only mapping + * of pl011 in ACPI and it's mapped to SBSA UART mode + */ + uap->vendor = &vendor_sbsa; + uap->fifosize = 32; + uap->port.ops = &sbsa_uart_pops; + uap->fixed_baud = 115200; - snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev)); + snprintf(uap->type, sizeof(uap->type), "SBSA"); + } else { + uap->clk = devm_clk_get(&dev->dev, NULL); + if (IS_ERR(uap->clk)) + return PTR_ERR(uap->clk); + + uap->vendor = vendor; + uap->lcrh_rx = vendor->lcrh_rx; + uap->lcrh_tx = vendor->lcrh_tx; + uap->fifosize = vendor->get_fifosize(dev); + uap->port.ops = &amba_pl011_pops; + + snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", + amba_rev(dev)); + } + uap->port.irq = dev->irq[0]; ret = pl011_setup_port(&dev->dev, uap, &dev->res, portnr); if (ret)