Signed-off-by: Lucas Stach <dev@xxxxxxxxxx> --- 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@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox