summaryrefslogtreecommitdiff
path: root/include/fsl_lpuart.h
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2017-02-22 16:21:52 +0800
committerStefano Babic <sbabic@denx.de>2017-03-17 09:27:08 +0100
commit7edf5c45f0d7f78ba370013cf513e3e8356c5202 (patch)
treeddda2916c295e2bb02b54c368762a9132e6c44ab /include/fsl_lpuart.h
parentc40d612b1a6e1c63f27089d1d8fa3016164cacdb (diff)
downloadu-boot-7edf5c45f0d7f78ba370013cf513e3e8356c5202.tar.gz
serial: lpuart: add i.MX7ULP support
Add i.MX7ULP support. The buadrate calculation on i.MX7ULP is different,so add a new setbrg function for i.MX7ULP. Add a enum lpuart_devtype for runtime check for different platforms. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Cc: York Sun <york.sun@nxp.com> Cc: Shaohui Xie <Shaohui.Xie@nxp.com> Cc: Alison Wang <b18965@freescale.com>
Diffstat (limited to 'include/fsl_lpuart.h')
-rw-r--r--include/fsl_lpuart.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/include/fsl_lpuart.h b/include/fsl_lpuart.h
new file mode 100644
index 0000000000..4643ee79ee
--- /dev/null
+++ b/include/fsl_lpuart.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2016 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ */
+
+#ifdef CONFIG_ARCH_MX7ULP
+struct lpuart_fsl_reg32 {
+ u32 verid;
+ u32 param;
+ u32 global;
+ u32 pincfg;
+ u32 baud;
+ u32 stat;
+ u32 ctrl;
+ u32 data;
+ u32 match;
+ u32 modir;
+ u32 fifo;
+ u32 water;
+};
+#else
+struct lpuart_fsl_reg32 {
+ u32 baud;
+ u32 stat;
+ u32 ctrl;
+ u32 data;
+ u32 match;
+ u32 modir;
+ u32 fifo;
+ u32 water;
+};
+#endif
+
+struct lpuart_fsl {
+ u8 ubdh;
+ u8 ubdl;
+ u8 uc1;
+ u8 uc2;
+ u8 us1;
+ u8 us2;
+ u8 uc3;
+ u8 ud;
+ u8 uma1;
+ u8 uma2;
+ u8 uc4;
+ u8 uc5;
+ u8 ued;
+ u8 umodem;
+ u8 uir;
+ u8 reserved;
+ u8 upfifo;
+ u8 ucfifo;
+ u8 usfifo;
+ u8 utwfifo;
+ u8 utcfifo;
+ u8 urwfifo;
+ u8 urcfifo;
+ u8 rsvd[28];
+};
+
+/* Used on i.MX7ULP */
+#define LPUART_BAUD_BOTHEDGE_MASK (0x20000)
+#define LPUART_BAUD_OSR_MASK (0x1F000000)
+#define LPUART_BAUD_OSR_SHIFT (24)
+#define LPUART_BAUD_OSR(x) ((((uint32_t)(x)) << 24) & 0x1F000000)
+#define LPUART_BAUD_SBR_MASK (0x1FFF)
+#define LPUART_BAUD_SBR_SHIFT (0U)
+#define LPUART_BAUD_SBR(x) (((uint32_t)(x)) & 0x1FFF)
+#define LPUART_BAUD_M10_MASK (0x20000000U)
+#define LPUART_BAUD_SBNS_MASK (0x2000U)