mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/3] serial: cadence: move register definitions into header file
Date: Mon, 13 Jan 2020 20:37:14 +0100	[thread overview]
Message-ID: <20200113193716.133305-1-dev@lynxeye.de> (raw)

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

             reply	other threads:[~2020-01-13 19:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 19:37 Lucas Stach [this message]
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

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=20200113193716.133305-1-dev@lynxeye.de \
    --to=dev@lynxeye.de \
    --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