[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V2 28/33] xen/arm: Don't use pl011 UART by default for early printk



On 05/09/2013 11:10 AM, Ian Campbell wrote:

> On Wed, 2013-05-08 at 03:33 +0100, Julien Grall wrote:
>> diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile
>> index 1ad3364..6af8ca3 100644
>> --- a/xen/arch/arm/arm32/Makefile
>> +++ b/xen/arch/arm/arm32/Makefile
>> @@ -5,4 +5,7 @@ obj-y += mode_switch.o
>>  obj-y += proc-ca15.o
>>
>>  obj-y += traps.o
>> -obj-y += domain.o
>> \ No newline at end of file
>> +obj-y += domain.o
>> +
>> +obj-$(EARLY_PRINTK) += debug.o
>> +obj-$(CONFIG_EARLY_PL011) += debug-pl011.o
> 
> Is this correct now that you are using debug-pl011.inc?


It comes from a bad merge. I will fix it on the next patch series.

>>  /* Print a 32-bit number in hex.  Specific to the PL011 UART.
>>   * r0: Number to print.
>> - * clobbers r0-r3 */
>> + * r11: Early UART base address
>> + * clobbers r1-r3 */
> 
> This still clobbers r0, via the lsl below.

Right will be fix on the next patch series.

>>  putn:
>>          adr   r1, hex
>>          mov   r3, #8
>> -1:      ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
>> -        tst   r2, #0x8               /* Check BUSY bit */
>> -        bne   1b                     /* Wait for the UART to be ready */
>> +1:
>> +        early_uart_ready r11, r2
>>          and   r2, r0, #0xf0000000    /* Mask off the top nybble */
>>          ldrb  r2, [r1, r2, lsr #28]  /* Convert to a char */
>> -        str   r2, [r11]              /* -> UARTDR (Data Register) */
>> +        early_uart_transmit r11, r2
>>          lsl   r0, #4                 /* Roll it through one nybble at a 
>> time */
>>          subs  r3, r3, #1
>>          bne   1b
>> @@ -329,51 +329,44 @@ fail:   PRINT("- Boot failed -\r\n")
>>  1:      wfe
>>          b     1b
>>
>> -#ifdef EARLY_UART_ADDRESS
>> +#ifdef EARLY_PRINTK
>>
>> -/* Bring up the UART. Specific to the PL011 UART.
>> - * Clobbers r0-r2 */
>> +/* Bring up the UART.
>> + * x23: Early UART base address
>> + * Clobbers x0-x1 */
> 
> Does it actually clobber x1?

Yes, by puts. init_uart will jump to this function at the end.

>>  init_uart:
>> -        mov   x1, #0x0
>> -        strh  w1, [x23, #0x24]       /* -> UARTIBRD (Baud divisor fraction) 
>> */
>> -        mov   x1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
>> -        strh  w1, [x23, #0x24]       /* -> UARTIBRD (Baud divisor integer) 
>> */
>> -        mov   x1, #0x60              /* 8n1 */
>> -        strh  w1, [x23, #0x24]       /* -> UARTLCR_H (Line control) */
>> -        ldr   x1, =0x00000301        /* RXE | TXE | UARTEN */
>> -        strh  w1, [x23, #0x30]       /* -> UARTCR (Control Register) */
>> +        early_uart_init x23, 0
>>          adr   x0, 1f
>> -        b     puts
>> +        b     puts                   /* Jump to puts */
>>  1:      .asciz "- UART enabled -\r\n"
>>          .align 4
> 
> 
> 


-- 
Julien

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.