From patchwork Mon Dec 21 14:49:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 7896391 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 37C789F1AF for ; Mon, 21 Dec 2015 14:54:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 591C92055C for ; Mon, 21 Dec 2015 14:54:28 +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 7CEEC20502 for ; Mon, 21 Dec 2015 14:54:27 +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 1aB1pg-0004C2-2n; Mon, 21 Dec 2015 14:53:04 +0000 Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aB1p4-0003o6-2q for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2015 14:52:28 +0000 Received: by mail-lb0-x232.google.com with SMTP id bc4so16518999lbc.2 for ; Mon, 21 Dec 2015 06:52:05 -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=LENWXumG5Uc6zQ8Yu1zwH+hBjqvAWNaIOhaYkhZhmfo=; b=Sj46kf/cMa2IELQy79c86AO9jhUthztxYiB8YPkuRKxpwtdEZKp1TWFuYURxLbQBKJ LovAL+UGn42Afykff9hq83Jk73rI8DTk+39eVssfghdrUxSXPgmVDXPlP1/f6XSKveZN n69/18C2mpsH20tFwmqBp7PKxoRvN6Wmq8s7o= 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=LENWXumG5Uc6zQ8Yu1zwH+hBjqvAWNaIOhaYkhZhmfo=; b=Bf5ShqjfEo7JK1O+jD7Z+Hr4uQxe0Swjj0PKUiE6bc17lFsPGuf7+eXbJYdbtoDozC Izy2W1w04HNTWsdDMnXumvFQPHuSlQ8Z3GssrpX9/fP2ImXuw43cKs6qqRD+hfW5FQof O/nrfuVK7BNJz641PdXkJOeZdRCWpxCS0rDqbzvlgutDtzp6rB2O4bVSD2F+VrzRQW3J xpB81+siwogvFdvC3fNmiVqTJb2YEk7yxlur8JL3mT2Bl3bzBt4Z4MPr1RPp6yW57Bif /SRtVHfUPeE1/eux78MZ0H/J5CL8zzeb2FjLlQO0FBxbuVXJuA8LERtmgLQmsWfA9Zyv 5rNQ== X-Gm-Message-State: ALoCoQkYgu0tXxHt0pp4UFdIEbb2QNV/uKEz7in6tcxsrTqMs+Vz0diW1h3aA9IfS4prxzX33aLFO83IlurvPrxOoaLv0tlyyw== X-Received: by 10.112.219.98 with SMTP id pn2mr6504469lbc.93.1450709524184; Mon, 21 Dec 2015 06:52:04 -0800 (PST) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id y15sm5061874lfd.3.2015.12.21.06.52.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Dec 2015 06:52:03 -0800 (PST) From: Aleksey Makarov To: linux-acpi@vger.kernel.org Subject: [PATCH v2 3/3] serial: amba-pl011: add ACPI support to AMBA probe Date: Mon, 21 Dec 2015 17:49:57 +0300 Message-Id: <1450709399-7246-4-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1450709399-7246-1-git-send-email-aleksey.makarov@linaro.org> References: <1450709399-7246-1-git-send-email-aleksey.makarov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151221_065226_407057_04F645E0 X-CRM114-Status: GOOD ( 14.61 ) 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, 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..766ce4f 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 (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)