mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] serial: cadence: move register definitions into header file
@ 2020-01-13 19:37 Lucas Stach
  2020-01-13 19:37 ` [PATCH 2/3] serial: cadence: add lowlevel init and putc functions Lucas Stach
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lucas Stach @ 2020-01-13 19:37 UTC (permalink / raw)
  To: barebox

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 drivers/serial/serial_cadence.c | 41 ++++-----------------------------
 include/serial/cadence.h        | 37 +++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 36 deletions(-)
 create mode 100644 include/serial/cadence.h

diff --git a/drivers/serial/serial_cadence.c b/drivers/serial/serial_cadence.c
index 6454888e3c5b..416800b84723 100644
--- a/drivers/serial/serial_cadence.c
+++ b/drivers/serial/serial_cadence.c
@@ -12,47 +12,16 @@
  * GNU General Public License for more details.
  *
  */
+
 #include <common.h>
 #include <driver.h>
 #include <init.h>
-#include <malloc.h>
-#include <notifier.h>
 #include <io.h>
-#include <linux/err.h>
 #include <linux/clk.h>
-
-#define CADENCE_UART_CONTROL		0x00
-#define CADENCE_UART_MODE		0x04
-#define CADENCE_UART_BAUD_GEN		0x18
-#define CADENCE_UART_CHANNEL_STS	0x2C
-#define CADENCE_UART_RXTXFIFO		0x30
-#define CADENCE_UART_BAUD_DIV		0x34
-
-#define CADENCE_CTRL_RXRES		(1 << 0)
-#define CADENCE_CTRL_TXRES		(1 << 1)
-#define CADENCE_CTRL_RXEN		(1 << 2)
-#define CADENCE_CTRL_RXDIS		(1 << 3)
-#define CADENCE_CTRL_TXEN		(1 << 4)
-#define CADENCE_CTRL_TXDIS		(1 << 5)
-#define CADENCE_CTRL_RSTTO		(1 << 6)
-#define CADENCE_CTRL_STTBRK		(1 << 7)
-#define CADENCE_CTRL_STPBRK		(1 << 8)
-
-#define CADENCE_MODE_CLK_REF		(0 << 0)
-#define CADENCE_MODE_CLK_REF_DIV	(1 << 0)
-#define CADENCE_MODE_CHRL_6		(3 << 1)
-#define CADENCE_MODE_CHRL_7		(2 << 1)
-#define CADENCE_MODE_CHRL_8		(0 << 1)
-#define CADENCE_MODE_PAR_EVEN		(0 << 3)
-#define CADENCE_MODE_PAR_ODD		(1 << 3)
-#define CADENCE_MODE_PAR_SPACE		(2 << 3)
-#define CADENCE_MODE_PAR_MARK		(3 << 3)
-#define CADENCE_MODE_PAR_NONE		(4 << 3)
-
-#define CADENCE_STS_REMPTY		(1 << 1)
-#define CADENCE_STS_RFUL		(1 << 2)
-#define CADENCE_STS_TEMPTY		(1 << 3)
-#define CADENCE_STS_TFUL		(1 << 4)
+#include <linux/err.h>
+#include <malloc.h>
+#include <notifier.h>
+#include <serial/cadence.h>
 
 /*
  * create default values for different platforms
diff --git a/include/serial/cadence.h b/include/serial/cadence.h
new file mode 100644
index 000000000000..014fb01203a9
--- /dev/null
+++ b/include/serial/cadence.h
@@ -0,0 +1,37 @@
+#ifndef __CADENCE_UART_H__
+#define __CADENCE_UART_H__
+
+#define CADENCE_UART_CONTROL		0x00
+#define CADENCE_UART_MODE		0x04
+#define CADENCE_UART_BAUD_GEN		0x18
+#define CADENCE_UART_CHANNEL_STS	0x2C
+#define CADENCE_UART_RXTXFIFO		0x30
+#define CADENCE_UART_BAUD_DIV		0x34
+
+#define CADENCE_CTRL_RXRES		(1 << 0)
+#define CADENCE_CTRL_TXRES		(1 << 1)
+#define CADENCE_CTRL_RXEN		(1 << 2)
+#define CADENCE_CTRL_RXDIS		(1 << 3)
+#define CADENCE_CTRL_TXEN		(1 << 4)
+#define CADENCE_CTRL_TXDIS		(1 << 5)
+#define CADENCE_CTRL_RSTTO		(1 << 6)
+#define CADENCE_CTRL_STTBRK		(1 << 7)
+#define CADENCE_CTRL_STPBRK		(1 << 8)
+
+#define CADENCE_MODE_CLK_REF		(0 << 0)
+#define CADENCE_MODE_CLK_REF_DIV	(1 << 0)
+#define CADENCE_MODE_CHRL_6		(3 << 1)
+#define CADENCE_MODE_CHRL_7		(2 << 1)
+#define CADENCE_MODE_CHRL_8		(0 << 1)
+#define CADENCE_MODE_PAR_EVEN		(0 << 3)
+#define CADENCE_MODE_PAR_ODD		(1 << 3)
+#define CADENCE_MODE_PAR_SPACE		(2 << 3)
+#define CADENCE_MODE_PAR_MARK		(3 << 3)
+#define CADENCE_MODE_PAR_NONE		(4 << 3)
+
+#define CADENCE_STS_REMPTY		(1 << 1)
+#define CADENCE_STS_RFUL		(1 << 2)
+#define CADENCE_STS_TEMPTY		(1 << 3)
+#define CADENCE_STS_TFUL		(1 << 4)
+
+#endif /* __CADENCE_UART_H__ */
-- 
2.24.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-14 11:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 19:37 [PATCH 1/3] serial: cadence: move register definitions into header file Lucas Stach
2020-01-13 19:37 ` [PATCH 2/3] serial: cadence: add lowlevel init and putc functions Lucas Stach
2020-01-13 19:37 ` [PATCH 3/3] ARM: zynq: zedboard: add PBL console support Lucas Stach
2020-01-14 11:07 ` [PATCH 1/3] serial: cadence: move register definitions into header file Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox