From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH v2 05/11] ARM: i.MX: Add mx7_setup_pad()
Date: Wed, 26 Jul 2017 09:31:14 -0700 [thread overview]
Message-ID: <20170726163120.25952-6-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20170726163120.25952-1-andrew.smirnov@gmail.com>
Add mx7_setup_pad() low-level convenience function for setting up
pinmux in PBL code.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/mach-imx/include/mach/iomux-mx7.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm/mach-imx/include/mach/iomux-mx7.h b/arch/arm/mach-imx/include/mach/iomux-mx7.h
index 378e73a74..2667dc3eb 100644
--- a/arch/arm/mach-imx/include/mach/iomux-mx7.h
+++ b/arch/arm/mach-imx/include/mach/iomux-mx7.h
@@ -1306,4 +1306,23 @@ enum {
MX7D_PAD_ENET1_COL__CSU_INT_DEB = IOMUX_PAD(0x04D8, 0x0268, 7, 0x0000, 0, 0),
};
+static inline void mx7_setup_pad(void __iomem *iomux, iomux_v3_cfg_t pad)
+{
+ unsigned int flags = 0;
+ uint32_t mode = IOMUX_MODE(pad);
+
+ if (mode & IOMUX_CONFIG_LPSR) {
+ mode &= ~IOMUX_CONFIG_LPSR;
+ flags = ZERO_OFFSET_VALID | IMX7_PINMUX_LPSR;
+ }
+
+ iomux_v3_setup_pad(iomux, flags,
+ IOMUX_CTRL_OFS(pad),
+ IOMUX_PAD_CTRL_OFS(pad),
+ IOMUX_SEL_INPUT_OFS(pad),
+ mode,
+ IOMUX_PAD_CTRL(pad),
+ IOMUX_SEL_INPUT(pad));
+}
+
#endif
--
2.13.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2017-07-26 16:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-26 16:31 [PATCH v2 00/11] i.MX7 SabreSD support Andrey Smirnov
2017-07-26 16:31 ` [PATCH v2 01/11] gpiolib: Fix buggy flag detection code Andrey Smirnov
2017-07-26 16:31 ` [PATCH v2 02/11] gpiolib: Simplify code of gpio_request_one() Andrey Smirnov
2017-07-26 16:31 ` [PATCH v2 03/11] clk: i.MX7: Remove unused UART clocks array Andrey Smirnov
2017-07-26 16:31 ` [PATCH v2 04/11] ARM: i.MX: Import mx7d_pins.h from U-Boot Andrey Smirnov
2017-07-26 16:31 ` Andrey Smirnov [this message]
2017-07-26 16:31 ` [PATCH v2 06/11] ARM: i.MX: Add imx7_uart_setup_ll() Andrey Smirnov
2017-07-26 16:31 ` [PATCH v2 07/11] ARM: i.MX: Add minimal imx7-ccm-regs.h Andrey Smirnov
2017-07-26 16:31 ` [PATCH v2 08/11] ARM: i.MX: Add ARCH_HAD_FEC_IMX to ARCH_IMX7 Andrey Smirnov
2017-07-26 16:31 ` [PATCH v2 09/11] ARM: i.MX: Import imx7-iomuxc-gpr.h from Linux kernel Andrey Smirnov
2017-07-26 16:31 ` [PATCH v2 10/11] include: Add phy-id-list.h Andrey Smirnov
2017-07-26 16:31 ` [PATCH v2 11/11] ARM: i.MX: Add support for NXP i.MX7 SABRESD board Andrey Smirnov
2017-07-26 16:55 ` Sam Ravnborg
2017-07-26 16:56 ` [PATCH v2 00/11] i.MX7 SabreSD support Sam Ravnborg
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=20170726163120.25952-6-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=barebox@lists.infradead.org \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox