2019-05-29 07:17:56 -07:00
/* SPDX-License-Identifier: GPL-2.0-only */
2012-11-19 10:16:01 -06:00
/ *
2011-06-20 11:47:27 -06:00
* Debugging m a c r o i n c l u d e h e a d e r
*
* Copyright ( C ) 2 0 1 1 X i l i n x
* /
2012-11-19 11:38:29 -06:00
# define U A R T _ C R _ O F F S E T 0 x00 / * C o n t r o l R e g i s t e r [ 8 : 0 ] * /
# define U A R T _ S R _ O F F S E T 0 x2 C / * C h a n n e l S t a t u s [ 1 1 : 0 ] * /
# define U A R T _ F I F O _ O F F S E T 0 x30 / * F I F O [ 1 5 : 0 ] o r [ 7 : 0 ] * /
2011-06-20 11:47:27 -06:00
2012-11-19 11:38:29 -06:00
# define U A R T _ S R _ T X F U L L 0 x00 0 0 0 0 1 0 / * T X F I F O f u l l * /
# define U A R T _ S R _ T X E M P T Y 0 x00 0 0 0 0 0 8 / * T X F I F O e m p t y * /
# define U A R T 0 _ P H Y S 0 x E 0 0 0 0 0 0 0
2016-02-15 10:17:47 +01:00
# define U A R T 0 _ V I R T 0 x F 0 8 0 0 0 0 0
2012-11-19 11:38:29 -06:00
# define U A R T 1 _ P H Y S 0 x E 0 0 0 1 0 0 0
2016-02-15 10:17:47 +01:00
# define U A R T 1 _ V I R T 0 x F 0 8 0 1 0 0 0
2012-11-19 11:38:29 -06:00
# if I S _ E N A B L E D ( C O N F I G _ D E B U G _ Z Y N Q _ U A R T 1 )
# define L L _ U A R T _ P A D D R U A R T 1 _ P H Y S
2014-05-14 16:46:00 +02:00
# define L L _ U A R T _ V A D D R U A R T 1 _ V I R T
2012-11-19 11:38:29 -06:00
# else
# define L L _ U A R T _ P A D D R U A R T 0 _ P H Y S
2014-05-14 16:46:00 +02:00
# define L L _ U A R T _ V A D D R U A R T 0 _ V I R T
2012-11-19 11:38:29 -06:00
# endif
2011-08-31 22:55:46 -04:00
.macro addruart, r p , r v , t m p
2011-06-20 11:47:27 -06:00
ldr \ r p , =LL_UART_PADDR @ physical
ldr \ r v , =LL_UART_VADDR @ virtual
.endm
.macro senduart,r d ,r x
2015-06-12 12:23:24 +05:30
strb \ r d , [ \ r x , #U A R T _ F I F O _ O F F S E T ] @ T X D A T A
2011-06-20 11:47:27 -06:00
.endm
2020-08-27 23:25:37 +01:00
.macro waituartcts,r d ,r x
.endm
.macro waituarttxrdy,r d ,r x
2014-02-03 17:36:23 +01:00
1001 : ldr \ r d , [ \ r x , #U A R T _ S R _ O F F S E T ]
2014-04-11 15:05:56 +02:00
ARM_ B E 8 ( r e v \ r d , \ r d )
2014-02-03 17:36:23 +01:00
tst \ r d , #U A R T _ S R _ T X E M P T Y
beq 1 0 0 1 b
2011-06-20 11:47:27 -06:00
.endm
.macro busyuart,r d ,r x
1002 : ldr \ r d , [ \ r x , #U A R T _ S R _ O F F S E T ] @ g e t s t a t u s r e g i s t e r
2014-04-11 15:05:56 +02:00
ARM_ B E 8 ( r e v \ r d , \ r d )
2011-06-20 11:47:27 -06:00
tst \ r d , #U A R T _ S R _ T X F U L L @
bne 1 0 0 2 b @ wait if FIFO is full
.endm