From patchwork Wed Nov 9 08:12:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 81447 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp77401qge; Wed, 9 Nov 2016 00:14:07 -0800 (PST) X-Received: by 10.99.103.198 with SMTP id b189mr25285121pgc.81.1478679247145; Wed, 09 Nov 2016 00:14:07 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id al9si34117538pad.337.2016.11.09.00.14.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Nov 2016 00:14:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c4Nzs-0002NB-2f; Wed, 09 Nov 2016 08:12:40 +0000 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c4Nzn-0002DZ-MC for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2016 08:12:37 +0000 Received: by mail-lf0-x229.google.com with SMTP id b14so157969715lfg.2 for ; Wed, 09 Nov 2016 00:12:14 -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; bh=GCwF6O/Na4zljZQc//M8FUEKtk1gsrU4uU3MZnCUoPQ=; b=IXevuzZod+klOSwUqPuHZUnqNhqWHz/DHnHelmy+WUpW7013DSvDJmt0s0QTw4CAuA v6YvxcPdVb3yl5NWi6qNtA3Nmx9wY3RxZiTNT0Wl51RGENApCr01kzHyLWtz9+FPTOIb PT1XqGvgKUmaOhOLoCSEGwIpsQito/rCpj70w= 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; bh=GCwF6O/Na4zljZQc//M8FUEKtk1gsrU4uU3MZnCUoPQ=; b=OAbJnCk20yX7IUSKkbxHkLxxYcK7tZxgSjGxX2jg70m1QxBba8uFdloHchiYL2Lx9J 3in7llqQc4pNhLMYw+h7lKZSpvg3QATHpsicTuN3kT3ZA6bm1/8R6tjNz82yM0hdjFcX NYhg8mm6eseGt4FWXVeXmelZ370ep403lUyiSPoWAr4zflkEpRrERS5Jah5RU7fWEl8l B/BGP04MW9IhqdkV6q65mRQkc8t+fmP+Uoh4pEfj6Ur9fomgprFlmdHnjF/KxJPTRAPs xStt7nF7g9fpLqTbOWufKGW9zmLwqyHRjNbvcciOhCMoPh4ruzj2yWhB64SyiAURT33V De3Q== X-Gm-Message-State: ABUngveoMdhM6MomO2ABGCElYgDDP/r9CFkLJmnKusPr8+kDvPKYmVWPKk6nQtyiK6/vnHid X-Received: by 10.25.23.154 with SMTP id 26mr9408150lfx.86.1478679132386; Wed, 09 Nov 2016 00:12:12 -0800 (PST) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 69sm6889360lfq.39.2016.11.09.00.12.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Nov 2016 00:12:11 -0800 (PST) From: Linus Walleij To: arm@kernel.org Subject: [PATCH] ARM: integrator: drop EBI access use syscon Date: Wed, 9 Nov 2016 09:12:06 +0100 Message-Id: <1478679126-5460-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161109_001235_970456_C367447F X-CRM114-Status: GOOD ( 19.71 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: Linus Walleij , Russell King , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The EBI lookup is not longer in use: this has been moved to the NAND chip driver. The syscon node is better accessed indirectly using the regmap like the NAND chip driver does, so let's use the syscon to set the modem control signals RTS/CTS through the dedicated syscon register. We also migrate the decoder status "SC_DEC" register that enumerate the logic modules using syscon. Cc: Russell King Signed-off-by: Linus Walleij --- ARM SoC folks: please apply this patch directly to the tree wherever it fits. I do not plan to send more Integrator patches this merge window. --- arch/arm/mach-integrator/integrator_ap.c | 54 ++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 24 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 23b98fd414bf..a1af634f8709 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include @@ -37,11 +39,8 @@ #include "pci_v3.h" #include "lm.h" -/* Base address to the AP system controller */ -void __iomem *ap_syscon_base; -/* Base address to the external bus interface */ -static void __iomem *ebi_base; - +/* Regmap to the AP system controller */ +static struct regmap *ap_syscon_map; /* * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx @@ -125,6 +124,7 @@ static void integrator_uart_set_mctrl(struct amba_device *dev, { unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask; u32 phybase = dev->res.start; + int ret; if (phybase == INTEGRATOR_UART0_BASE) { /* UART0 */ @@ -146,8 +146,17 @@ static void integrator_uart_set_mctrl(struct amba_device *dev, else ctrls |= dtr_mask; - __raw_writel(ctrls, ap_syscon_base + INTEGRATOR_SC_CTRLS_OFFSET); - __raw_writel(ctrlc, ap_syscon_base + INTEGRATOR_SC_CTRLC_OFFSET); + ret = regmap_write(ap_syscon_map, + INTEGRATOR_SC_CTRLS_OFFSET, + ctrls); + if (ret) + pr_err("MODEM: unable to write PL010 UART CTRLS\n"); + + ret = regmap_write(ap_syscon_map, + INTEGRATOR_SC_CTRLC_OFFSET, + ctrlc); + if (ret) + pr_err("MODEM: unable to write PL010 UART CRTLC\n"); } struct amba_pl010_data ap_uart_data = { @@ -178,35 +187,32 @@ static const struct of_device_id ap_syscon_match[] = { { }, }; -static const struct of_device_id ebi_match[] = { - { .compatible = "arm,external-bus-interface"}, - { }, -}; - static void __init ap_init_of(void) { - unsigned long sc_dec; + u32 sc_dec; struct device_node *syscon; - struct device_node *ebi; + int ret; int i; + of_platform_default_populate(NULL, ap_auxdata_lookup, NULL); + syscon = of_find_matching_node(NULL, ap_syscon_match); if (!syscon) return; - ebi = of_find_matching_node(NULL, ebi_match); - if (!ebi) + ap_syscon_map = syscon_node_to_regmap(syscon); + if (IS_ERR(ap_syscon_map)) { + pr_crit("could not find Integrator/AP system controller\n"); return; + } - ap_syscon_base = of_iomap(syscon, 0); - if (!ap_syscon_base) - return; - ebi_base = of_iomap(ebi, 0); - if (!ebi_base) + ret = regmap_read(ap_syscon_map, + INTEGRATOR_SC_DEC_OFFSET, + &sc_dec); + if (ret) { + pr_crit("could not read from Integrator/AP syscon\n"); return; + } - of_platform_default_populate(NULL, ap_auxdata_lookup, NULL); - - sc_dec = readl(ap_syscon_base + INTEGRATOR_SC_DEC_OFFSET); for (i = 0; i < 4; i++) { struct lm_device *lmdev;