From patchwork Mon Jan 28 23:06:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Menefy X-Patchwork-Id: 10785071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03BC413B4 for ; Mon, 28 Jan 2019 23:07:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E730B2B47D for ; Mon, 28 Jan 2019 23:07:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D93332B510; Mon, 28 Jan 2019 23:07:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 598282B47D for ; Mon, 28 Jan 2019 23:07:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727094AbfA1XHV (ORCPT ); Mon, 28 Jan 2019 18:07:21 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53253 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727079AbfA1XHU (ORCPT ); Mon, 28 Jan 2019 18:07:20 -0500 Received: by mail-wm1-f66.google.com with SMTP id d15so15852830wmb.3 for ; Mon, 28 Jan 2019 15:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mathembedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=egv6emcP5TnKL00UbLnsrc1J1nfr4/QWyMkgTL2mFxM=; b=YB2OIZUMbjAFDTvKh5Mt0OO6FfBjkd2kCBGvkgEqAT9tcEN4eVGRvgxWcUrIc51JLx TC9pA+IvN1xcef1X/Out3Cx8MuhdzuKizFFkmDSKdB5d3MBNMEVewi3Zr2ZWx/p1RLyg bbkbq9OuAZCOdWojQTxdxswEWOYWAUM5o0Ge6Nh3IOHOG80AtQYyA8C4Z32L3GrH0Q3X kHU5ktIStlsomVl1ZYfcUFENOh4D3XEFEr3c+alJK7jftPHg7jtCe02bmf9enB79xtCO Z2geXZu5ISPkWlxMY/C4cP2VgPcfMZHQcaZACAIPFowuNcThCM/ATo2Zlmb/eIc8koFF Wksw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=egv6emcP5TnKL00UbLnsrc1J1nfr4/QWyMkgTL2mFxM=; b=VTppmHxle7X/YKgu+pl3TsaPqyKozvZAPY/DARp8Cc+CLhsf/G122l0wUnofHaP3x2 DRp/mQWXpBybB7E4F98zJwfFEYLDXflEe35NlPFwq1+hXTK6wzXVYyN8AOURFO8kTAbu cJIdwmAFDc7lCF946eT0istsZ5/wsiYz9HXM70zNIjaGX5p3P+3FL13WCJCJUlLgpCB9 1g8appvHA/3KfbrXj0d609M/r+sjaaoxxTC8qCcdxN6IniLIcD1yS7v6Hkf3ONHdFt7B gXeb3cDWj4YoMzPorKiZ453fevblBd/PTIXQVoo/uYZZNPADsU6wATi+Uoum3nZbFAN9 otSA== X-Gm-Message-State: AJcUukcsLFSWL1JwXKLkAfEEfNodqUpVXO8pI/JdfLD9ygr/bW6kAXSj UB5yPatAEhld3ffmRc0O/2nEf46sSCE7pw== X-Google-Smtp-Source: ALg8bN6AUeRT44BklklHKLCM3f1aMcdClcJ6F2ZhS/o6+i45XK1XKnglKitD0xgGUt4VWtOm9t5ltw== X-Received: by 2002:a1c:1a43:: with SMTP id a64mr17890409wma.136.1548716838024; Mon, 28 Jan 2019 15:07:18 -0800 (PST) Received: from diamond.mathembedded.com (host86-176-243-190.range86-176.btcentralplus.com. [86.176.243.190]) by smtp.gmail.com with ESMTPSA id o64sm506765wmo.47.2019.01.28.15.07.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 15:07:17 -0800 (PST) From: Stuart Menefy To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 15/17] pinctrl: samsung: Add support for pad retention control for Exynos5260 Date: Mon, 28 Jan 2019 23:06:58 +0000 Message-Id: <20190128230700.7325-16-stuart.menefy@mathembedded.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190128230700.7325-1-stuart.menefy@mathembedded.com> References: <20190128230700.7325-1-stuart.menefy@mathembedded.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support for retention control for Exynos5260 SoC. Signed-off-by: Stuart Menefy --- .../bindings/pinctrl/samsung-pinctrl.txt | 2 ++ arch/arm/boot/dts/exynos5260.dtsi | 2 +- drivers/pinctrl/samsung/pinctrl-exynos-arm.c | 25 ++++++++++++++++++++++ drivers/pinctrl/samsung/pinctrl-exynos.c | 21 ++++++++++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt index 70659c917bdc..548d5786c400 100644 --- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt @@ -163,6 +163,8 @@ B. External Wakeup Interrupts: For supporting external wakeup interrupts, a found on Samsung S5Pv210 SoCs, - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller found on Samsung Exynos4210 and S5PC110/S5PV210 SoCs. + - samsung,exynos5260-wakeup-eint: represents wakeup interrupt controller + found on Samsung Exynos5260 SoCs. - samsung,exynos7-wakeup-eint: represents wakeup interrupt controller found on Samsung Exynos7 SoC. - interrupts: interrupt used by multiplexed wakeup interrupts. diff --git a/arch/arm/boot/dts/exynos5260.dtsi b/arch/arm/boot/dts/exynos5260.dtsi index e8a5c8715b94..8b46f7078d5d 100644 --- a/arch/arm/boot/dts/exynos5260.dtsi +++ b/arch/arm/boot/dts/exynos5260.dtsi @@ -296,7 +296,7 @@ interrupts = ; wakeup-interrupt-controller { - compatible = "samsung,exynos4210-wakeup-eint"; + compatible = "samsung,exynos5260-wakeup-eint"; interrupt-parent = <&gic>; interrupts = ; }; diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c index 44c6b753f692..997b938eecb2 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c @@ -605,6 +605,28 @@ static const struct samsung_pin_bank_data exynos5260_pin_banks2[] __initconst = EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04), }; +/* PMU pad retention groups registers for Exynos5260 */ +static const u32 exynos5260_retention_regs[] = { + EXYNOS5260_PAD_RETENTION_LPDDR3_OPTION, + EXYNOS5260_PAD_RETENTION_JTAG_OPTION, + EXYNOS5260_PAD_RETENTION_MMC2_OPTION, + EXYNOS5260_PAD_RETENTION_TOP_OPTION, + EXYNOS5260_PAD_RETENTION_UART_OPTION, + EXYNOS5260_PAD_RETENTION_MMC0_OPTION, + EXYNOS5260_PAD_RETENTION_MMC1_OPTION, + EXYNOS5260_PAD_RETENTION_SPI_OPTION, + EXYNOS5260_PAD_RETENTION_MIF_OPTION, + EXYNOS5260_PAD_RETENTION_BOOTLDO_OPTION, +}; + +static const struct samsung_retention_data exynos5260_retention_data __initconst = { + .regs = exynos5260_retention_regs, + .nr_regs = ARRAY_SIZE(exynos5260_retention_regs), + .value = EXYNOS_WAKEUP_FROM_LOWPWR, + .refcnt = &exynos_shared_retention_refcnt, + .init = exynos_retention_init, +}; + /* * Samsung pinctrl driver data for Exynos5260 SoC. Exynos5260 SoC includes * three gpio/pin-mux/pinconfig controllers. @@ -618,6 +640,7 @@ static const struct samsung_pin_ctrl exynos5260_pin_ctrl[] __initconst = { .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos5260_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos5260_pin_banks1, @@ -625,6 +648,7 @@ static const struct samsung_pin_ctrl exynos5260_pin_ctrl[] __initconst = { .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos5260_retention_data, }, { /* pin-controller instance 2 data */ .pin_banks = exynos5260_pin_banks2, @@ -632,6 +656,7 @@ static const struct samsung_pin_ctrl exynos5260_pin_ctrl[] __initconst = { .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos5260_retention_data, }, }; diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index f49ea3d92aa1..c11343967632 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -372,6 +372,25 @@ static const struct exynos_irq_chip s5pv210_wkup_irq_chip __initconst = { .eint_wake_mask_reg = S5PV210_EINT_WAKEUP_MASK, }; +static const struct exynos_irq_chip exynos5260_wkup_irq_chip __initconst = { + .chip = { + .name = "exynos5260_wkup_irq_chip", + .irq_unmask = exynos_irq_unmask, + .irq_mask = exynos_irq_mask, + .irq_ack = exynos_irq_ack, + .irq_set_type = exynos_irq_set_type, + .irq_set_wake = exynos_wkup_irq_set_wake, + .irq_request_resources = exynos_irq_request_resources, + .irq_release_resources = exynos_irq_release_resources, + }, + .eint_con = EXYNOS_WKUP_ECON_OFFSET, + .eint_mask = EXYNOS_WKUP_EMASK_OFFSET, + .eint_pend = EXYNOS_WKUP_EPEND_OFFSET, + .eint_wake_mask_value = EXYNOS_EINT_WAKEUP_MASK_DISABLED, + /* Only difference with exynos4210_wkup_irq_chip: */ + .eint_wake_mask_reg = EXYNOS5260_EINT_WAKEUP_MASK, +}; + static const struct exynos_irq_chip exynos4210_wkup_irq_chip __initconst = { .chip = { .name = "exynos4210_wkup_irq_chip", @@ -412,6 +431,8 @@ static const struct exynos_irq_chip exynos7_wkup_irq_chip __initconst = { static const struct of_device_id exynos_wkup_irq_ids[] = { { .compatible = "samsung,s5pv210-wakeup-eint", .data = &s5pv210_wkup_irq_chip }, + { .compatible = "samsung,exynos5260-wakeup-eint", + .data = &exynos5260_wkup_irq_chip }, { .compatible = "samsung,exynos4210-wakeup-eint", .data = &exynos4210_wkup_irq_chip }, { .compatible = "samsung,exynos7-wakeup-eint",