2008-08-05 19:14:15 +04:00
/ * arch/ a r m / m a c h - m s m 7 2 0 0 / i n c l u d e / m a c h / d e b u g - m a c r o . S
2007-11-26 15:11:43 +03:00
*
* Copyright ( C ) 2 0 0 7 G o o g l e , I n c .
* Author : Brian S w e t l a n d < s w e t l a n d @google.com>
*
* This s o f t w a r e i s l i c e n s e d u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c
* License v e r s i o n 2 , a s p u b l i s h e d b y t h e F r e e S o f t w a r e F o u n d a t i o n , a n d
* may b e c o p i e d , d i s t r i b u t e d , a n d m o d i f i e d u n d e r t h o s e t e r m s .
*
* This p r o g r a m i s d i s t r i b u t e d i n t h e h o p e t h a t i t w i l l b e u s e f u l ,
* but W I T H O U T A N Y W A R R A N T Y ; without even the implied warranty of
* MERCHANTABILITY o r F I T N E S S F O R A P A R T I C U L A R P U R P O S E . S e e t h e
* GNU G e n e r a l P u b l i c L i c e n s e f o r m o r e d e t a i l s .
*
* /
2009-11-02 13:48:29 +03:00
2008-08-05 19:14:15 +04:00
# include < m a c h / h a r d w a r e . h >
# include < m a c h / m s m _ i o m a p . h >
2007-11-26 15:11:43 +03:00
2010-10-28 00:04:58 +04:00
# if d e f i n e d ( C O N F I G _ H A S _ M S M _ D E B U G _ U A R T _ P H Y S ) & & ! d e f i n e d ( C O N F I G _ M S M _ D E B U G _ U A R T _ N O N E )
2010-07-06 14:30:06 +04:00
.macro addruart, r p , r v
ldr \ r p , =MSM_DEBUG_UART_PHYS
ldr \ r v , =MSM_DEBUG_UART_BASE
2007-11-26 15:11:43 +03:00
.endm
.macro senduart,r d ,r x
2008-09-11 01:00:53 +04:00
teq \ r x , #0
strne \ r d , [ \ r x , #0x0C ]
2007-11-26 15:11:43 +03:00
.endm
.macro waituart,r d ,r x
@ wait for TX_READY
2009-11-02 13:48:29 +03:00
1001 : ldr \ r d , [ \ r x , #0x08 ]
2007-11-26 15:11:43 +03:00
tst \ r d , #0x04
2009-11-02 13:48:29 +03:00
beq 1 0 0 1 b
.endm
2010-10-28 02:25:59 +04:00
# else
.macro addruart, r p , r v
mov \ r v , #0xff000000
orr \ r v , \ r v , #0x00f00000
.endm
2007-11-26 15:11:43 +03:00
2010-10-28 02:25:59 +04:00
.macro senduart,r d ,r x
.endm
.macro waituart,r d ,r x
2007-11-26 15:11:43 +03:00
.endm
2010-07-06 14:30:06 +04:00
# endif
2010-10-28 02:25:59 +04:00
.macro busyuart,r d ,r x
.endm