Re: [PATCH] drivers: char: hvc: add arm JTAG DCC console support

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stephen Boyd
Date: Wednesday, December 1, 2010 - 1:20 pm

On 12/01/2010 10:54 AM, Daniel Walker wrote:

Just marking __dcc_getstatus volatile gives me

00000038 <hvc_dcc_get_chars>:
  38:   ee10fe11        mrc     14, 0, pc, cr0, cr1, {0}
  3c:   1afffffd        bne     38 <hvc_dcc_get_chars>
  40:   ee103e15        mrc     14, 0, r3, cr0, cr5, {0}
  44:   e3a00000        mov     r0, #0  ; 0x0
  48:   e6ef3073        uxtb    r3, r3
  4c:   ea000004        b       64 <hvc_dcc_get_chars+0x2c>
  50:   ee10ce11        mrc     14, 0, ip, cr0, cr1, {0}
  54:   e31c0101        tst     ip, #1073741824 ; 0x40000000
  58:   012fff1e        bxeq    lr
  5c:   e7c13000        strb    r3, [r1, r0]
  60:   e2800001        add     r0, r0, #1      ; 0x1
  64:   e1500002        cmp     r0, r2
  68:   bafffff8        blt     50 <hvc_dcc_get_chars+0x18>
  6c:   e12fff1e        bx      lr

Seems the compiler keeps the value of __dcc_getchar() in r3 for the
duration of the loop. So we need to mark that one volatile too. I don't
think __dcc_putchar() needs to be marked volatile but it probably
doesn't hurt.


Definitely for TX since it seems like a redundant loop, but I agree RX
code has changed. Instead of

If RX buffer full
Poll for RX buffer full
Read character from RX buffer

we would have

If RX buffer full
Read character from RX buffer

which doesn't seem all that different assuming the RX buffer doesn't go
from full to empty between the If and Poll steps. Hopefully Tony knows more.


Yes, it's much clearer that way.

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] drivers: char: hvc: add arm JTAG DCC console s ..., Stephen Boyd, (Wed Dec 1, 1:20 pm)
[PATCH] hvc_dcc: Simplify assembly for v6 and v7 ARM, Stephen Boyd, (Fri Dec 17, 10:16 pm)
Re: [PATCH] hvc_dcc: Simplify assembly for v6 and v7 ARM, Daniel Walker, (Mon Dec 20, 10:51 am)
Re: [PATCH] hvc_dcc: Simplify assembly for v6 and v7 ARM, Stephen Boyd, (Mon Dec 20, 11:39 am)
Re: [PATCH] hvc_dcc: Simplify assembly for v6 and v7 ARM, Nicolas Pitre, (Mon Dec 20, 11:46 am)
[PATCH 0/3] hvc_dcc cleanups and fixes, Stephen Boyd, (Mon Dec 20, 1:08 pm)