From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH v3 07/11] ARM: i.MX: Add minimal imx7-ccm-regs.h
Date: Fri, 28 Jul 2017 07:44:23 -0700 [thread overview]
Message-ID: <20170728144427.14007-8-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20170728144427.14007-1-andrew.smirnov@gmail.com>
Add minimal imx7-ccm-regs.h that contains bare minimum definitions
needed for early UART setup.
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/mach-imx/include/mach/imx7-ccm-regs.h | 32 ++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 arch/arm/mach-imx/include/mach/imx7-ccm-regs.h
diff --git a/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h b/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h
new file mode 100644
index 000000000..a4217cca5
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h
@@ -0,0 +1,32 @@
+#ifndef __MACH_IMX7_CCM_REGS_H__
+#define __MACH_IMX7_CCM_REGS_H__
+
+/* 0 <= n <= 190 */
+#define CCM_CCGRn_SET(n) (0x4004 + 16 * (n))
+#define CCM_CCGRn_CLR(n) (0x4008 + 16 * (n))
+
+#define CCM_CCGR_UART1 148
+
+#define CCM_CCGR_SETTINGn(n, s) ((s) << ((n) * 4))
+#define CCM_CCGR_SETTINGn_NOT_NEEDED(n) CCM_CCGR_SETTINGn(n, 0b00)
+#define CCM_CCGR_SETTINGn_NEEDED_RUN(n) CCM_CCGR_SETTINGn(n, 0b01)
+#define CCM_CCGR_SETTINGn_NEEDED_RUN_WAIT(n) CCM_CCGR_SETTINGn(n, 0b10)
+#define CCM_CCGR_SETTINGn_NEEDED(n) CCM_CCGR_SETTINGn(n, 0b11)
+
+/* 0 <= n <= 120 */
+#define CCM_TARGET_ROOTn(n) (0x8000 + 128 * (n))
+
+#define CCM_TARGET_ROOTn_MUX(x) ((x) << 24)
+#define CCM_TARGET_ROOTn_ENABLE BIT(28)
+
+#define CLOCK_ROOT_INDEX(x) (((x) - 0x8000) / 128)
+
+/*
+ * Taken from "Table 5-11. Clock Root Table" from i.MX7 Dual Processor
+ * Reference Manual
+ */
+#define UART1_CLK_ROOT CLOCK_ROOT_INDEX(0xaf80)
+#define UART1_CLK_ROOT__OSC_24M CCM_TARGET_ROOTn_MUX(0b000)
+
+
+#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-28 14:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 14:44 [PATCH v3 00/11] i.MX7 SabreSD support Andrey Smirnov
2017-07-28 14:44 ` [PATCH v3 01/11] gpiolib: Fix buggy flag detection code Andrey Smirnov
2017-07-28 14:44 ` [PATCH v3 02/11] gpiolib: Simplify code of gpio_request_one() Andrey Smirnov
2017-07-28 14:44 ` [PATCH v3 03/11] clk: i.MX7: Remove unused UART clocks array Andrey Smirnov
2017-07-28 14:44 ` [PATCH v3 04/11] ARM: i.MX: Import mx7d_pins.h from U-Boot Andrey Smirnov
2017-07-28 14:44 ` [PATCH v3 05/11] ARM: i.MX: Add mx7_setup_pad() Andrey Smirnov
2017-07-28 14:44 ` [PATCH v3 06/11] ARM: i.MX: Add imx7_uart_setup_ll() Andrey Smirnov
2017-07-28 14:44 ` Andrey Smirnov [this message]
2017-07-28 14:44 ` [PATCH v3 08/11] ARM: i.MX: Add ARCH_HAD_FEC_IMX to ARCH_IMX7 Andrey Smirnov
2017-07-28 14:44 ` [PATCH v3 09/11] ARM: i.MX: Import imx7-iomuxc-gpr.h from Linux kernel Andrey Smirnov
2017-07-28 14:44 ` [PATCH v3 10/11] include: Add phy-id-list.h Andrey Smirnov
2017-07-28 14:44 ` [PATCH v3 11/11] ARM: i.MX: Add support for NXP i.MX7 SABRESD board Andrey Smirnov
2017-08-01 18:46 ` [PATCH v3 00/11] i.MX7 SabreSD support Uwe Kleine-König
2017-08-01 19:49 ` Andrey Smirnov
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=20170728144427.14007-8-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