From: Anson Huang <anson.huang@nxp.com> To: "mturquette@baylibre.com" <mturquette@baylibre.com>, "sboyd@kernel.org" <sboyd@kernel.org>, "shawnguo@kernel.org" <shawnguo@kernel.org>, "s.hauer@pengutronix.de" <s.hauer@pengutronix.de>, "kernel@pengutronix.de" <kernel@pengutronix.de>, "festevam@gmail.com" <festevam@gmail.com>, "l.stach@pengutronix.de" <l.stach@pengutronix.de>, Aisheng Dong <aisheng.dong@nxp.com>, "pp@emlix.com" <pp@emlix.com>, "tiny.windzz@gmail.com" <tiny.windzz@gmail.com>, "colin.didier@devialet.com" <colin.didier@devialet.com>, "robh@kernel.org" <robh@kernel.org>, Jacky Bai <ping.bai@nxp.com>, Leonard Crestez <leonard.crestez@nxp.com>, "hofrat@osadl.org" <hofrat@osadl.org>, "michael@amarulasolutions.com" <michael@amarulasolutions.com>, "stefan@agner.ch" <stefan@agner.ch>, Abel Vesa <abel.vesa@nxp.com>, "linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> Cc: dl-linux-imx <linux-imx@nxp.com> Subject: [PATCH 1/2] clk: imx: Add common API for masking MMDC handshake Date: Sun, 5 May 2019 06:18:48 +0000 [thread overview] Message-ID: <1557036830-13567-1-git-send-email-Anson.Huang@nxp.com> (raw) All i.MX6 SoCs need to mask unused MMDC channel's handshake for low power modes, this patch provides common API for masking the MMDC channel passed from caller. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> --- drivers/clk/imx/clk.c | 14 ++++++++++++++ drivers/clk/imx/clk.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index 1efed86..6f9bcee 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -6,8 +6,22 @@ #include <linux/spinlock.h> #include "clk.h" +#define CCM_CCDR 0x4 +#define CCDR_MMDC_CH0_MASK BIT(17) +#define CCDR_MMDC_CH1_MASK BIT(16) + DEFINE_SPINLOCK(imx_ccm_lock); +void __init imx_mmdc_mask_handshake(void __iomem *ccm_base, + unsigned int chn) +{ + unsigned int reg; + + reg = readl_relaxed(ccm_base + CCM_CCDR); + reg |= chn == 0 ? CCDR_MMDC_CH0_MASK : CCDR_MMDC_CH1_MASK; + writel_relaxed(reg, ccm_base + CCM_CCDR); +} + void __init imx_check_clocks(struct clk *clks[], unsigned int count) { unsigned i; diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 8639a8f..6dcdc91 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -10,6 +10,7 @@ extern spinlock_t imx_ccm_lock; void imx_check_clocks(struct clk *clks[], unsigned int count); void imx_check_clk_hws(struct clk_hw *clks[], unsigned int count); void imx_register_uart_clocks(struct clk ** const clks[]); +void imx_mmdc_mask_handshake(void __iomem *ccm_base, unsigned int chn); extern void imx_cscmr1_fixup(u32 *val); -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: Anson Huang <anson.huang@nxp.com> To: "mturquette@baylibre.com" <mturquette@baylibre.com>, "sboyd@kernel.org" <sboyd@kernel.org>, "shawnguo@kernel.org" <shawnguo@kernel.org>, "s.hauer@pengutronix.de" <s.hauer@pengutronix.de>, "kernel@pengutronix.de" <kernel@pengutronix.de>, "festevam@gmail.com" <festevam@gmail.com>, "l.stach@pengutronix.de" <l.stach@pengutronix.de>, Aisheng Dong <aisheng.dong@nxp.com>, "pp@emlix.com" <pp@emlix.com>, "tiny.windzz@gmail.com" <tiny.windzz@gmail.com>, "colin.didier@devialet.com" <colin.didier@devialet.com>, "robh@kernel.org" <robh@kernel.org>, Jacky Bai <ping.bai@nxp.com>, Leonard Crestez <leonard.crestez@nxp.com>, "hofrat@osadl.org" <hofrat@osadl.org>, "michael@amarulasolutions.com" <michael@amarulasolutions.com>, "stefan@agner.ch" <stefan@agner.ch>, Abel Vesa <abel.vesa@nxp.com>, "linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> Cc: dl-linux-imx <linux-imx@nxp.com> Subject: [PATCH 1/2] clk: imx: Add common API for masking MMDC handshake Date: Sun, 5 May 2019 06:18:48 +0000 [thread overview] Message-ID: <1557036830-13567-1-git-send-email-Anson.Huang@nxp.com> (raw) All i.MX6 SoCs need to mask unused MMDC channel's handshake for low power modes, this patch provides common API for masking the MMDC channel passed from caller. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> --- drivers/clk/imx/clk.c | 14 ++++++++++++++ drivers/clk/imx/clk.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index 1efed86..6f9bcee 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -6,8 +6,22 @@ #include <linux/spinlock.h> #include "clk.h" +#define CCM_CCDR 0x4 +#define CCDR_MMDC_CH0_MASK BIT(17) +#define CCDR_MMDC_CH1_MASK BIT(16) + DEFINE_SPINLOCK(imx_ccm_lock); +void __init imx_mmdc_mask_handshake(void __iomem *ccm_base, + unsigned int chn) +{ + unsigned int reg; + + reg = readl_relaxed(ccm_base + CCM_CCDR); + reg |= chn == 0 ? CCDR_MMDC_CH0_MASK : CCDR_MMDC_CH1_MASK; + writel_relaxed(reg, ccm_base + CCM_CCDR); +} + void __init imx_check_clocks(struct clk *clks[], unsigned int count) { unsigned i; diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 8639a8f..6dcdc91 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -10,6 +10,7 @@ extern spinlock_t imx_ccm_lock; void imx_check_clocks(struct clk *clks[], unsigned int count); void imx_check_clk_hws(struct clk_hw *clks[], unsigned int count); void imx_register_uart_clocks(struct clk ** const clks[]); +void imx_mmdc_mask_handshake(void __iomem *ccm_base, unsigned int chn); extern void imx_cscmr1_fixup(u32 *val); -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2019-05-05 6:19 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-05-05 6:18 Anson Huang [this message] 2019-05-05 6:18 ` [PATCH 1/2] clk: imx: Add common API for masking MMDC handshake Anson Huang 2019-05-05 6:18 ` [PATCH 2/2] clk: imx: Use imx_mmdc_mask_handshake() API for masking MMDC channel Anson Huang 2019-05-05 6:18 ` Anson Huang 2019-05-05 6:33 ` Aisheng Dong 2019-05-05 6:33 ` Aisheng Dong 2019-05-05 6:32 ` [PATCH 1/2] clk: imx: Add common API for masking MMDC handshake Aisheng Dong 2019-05-05 6:32 ` Aisheng Dong
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1557036830-13567-1-git-send-email-Anson.Huang@nxp.com \ --to=anson.huang@nxp.com \ --cc=abel.vesa@nxp.com \ --cc=aisheng.dong@nxp.com \ --cc=colin.didier@devialet.com \ --cc=festevam@gmail.com \ --cc=hofrat@osadl.org \ --cc=kernel@pengutronix.de \ --cc=l.stach@pengutronix.de \ --cc=leonard.crestez@nxp.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-clk@vger.kernel.org \ --cc=linux-imx@nxp.com \ --cc=linux-kernel@vger.kernel.org \ --cc=michael@amarulasolutions.com \ --cc=mturquette@baylibre.com \ --cc=ping.bai@nxp.com \ --cc=pp@emlix.com \ --cc=robh@kernel.org \ --cc=s.hauer@pengutronix.de \ --cc=sboyd@kernel.org \ --cc=shawnguo@kernel.org \ --cc=stefan@agner.ch \ --cc=tiny.windzz@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.