qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	qemu-arm@nongnu.org,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Tong Ho" <tong.ho@amd.com>,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>
Subject: Re: [PATCH v5 09/16] tests/qtest: Update tests using PL011 UART
Date: Mon, 30 Dec 2024 16:17:13 +0100	[thread overview]
Message-ID: <626e4b64-bf09-4dec-b353-b9239ee6d7d3@linaro.org> (raw)
In-Reply-To: <CAFEAcA9QA3Kn3h_bwMSoht7KZa8DOpMXFDUWon1kc+iHy59-EQ@mail.gmail.com>

On 29/7/24 17:47, Peter Maydell wrote:
> On Fri, 19 Jul 2024 at 19:11, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> We weren't enabling the PL011 TX UART before using it
>> on the raspi and virt machines. Update the ASM code
>> prefixing:
>>
>>    *UART_CTRL = UART_ENABLE | TX_ENABLE;
>>
>> to:
>>
>>    while (true) {
>>        *UART_DATA = 'T';
>>    }
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   tests/qtest/boot-serial-test.c | 15 ++++++++++-----
>>   1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c
>> index 3b92fa5d50..5cb309ccf0 100644
>> --- a/tests/qtest/boot-serial-test.c
>> +++ b/tests/qtest/boot-serial-test.c
>> @@ -70,18 +70,23 @@ static const uint8_t kernel_plml605[] = {
>>   };
>>
>>   static const uint8_t bios_raspi2[] = {
>> -    0x08, 0x30, 0x9f, 0xe5,                 /* ldr   r3,[pc,#8]    Get base */
>> +    0x10, 0x30, 0x9f, 0xe5,                 /* ldr     r3,[pc,#8]    Get base */
> 
> The instruction bytes have changed but the disassembly comment has not...
> 
>> +    0x10, 0x20, 0x9f, 0xe5,                 /* ldr     r2,[pc,#8]    Get CR */
>> +    0xb0, 0x23, 0xc3, 0xe1,                 /* strh    r2,[r3, #48]  Set CR */
>>       0x54, 0x20, 0xa0, 0xe3,                 /* mov     r2,#'T' */
>> -    0x00, 0x20, 0xc3, 0xe5,                 /* strb    r2,[r3] */
>> -    0xfb, 0xff, 0xff, 0xea,                 /* b       loop */
>> +    0x00, 0x20, 0xc3, 0xe5,                 /* strb    r2,[r3]       loop: */
> 
> This placement of the "loop:" label is odd -- usually the label
> goes before the instruction that a branch to the label will
> start executing at.
> 
>> +    0xfd, 0xff, 0xff, 0xea,                 /* b       loop */
> 
> Here also the bytes changed but not the disassembly. Since
> 'b' is a relative branch, why does the offset change?

It felt simpler while single-stepping to just fill the TXDATA register
with the byte to send, and not reset the other registers with unchanged
values. Anyway you are right, I'll split the changes for clarity.

> 
>>       0x00, 0x10, 0x20, 0x3f,                 /* 0x3f201000 = UART0 base addr */
>> +    0x01, 0x01, 0x00, 0x00,                 /* 0x101      = CR UARTEN|TXE */
>>   };
>>
>>   static const uint8_t kernel_aarch64[] = {
>> -    0x81, 0x0a, 0x80, 0x52,                 /* mov     w1, #0x54 */
>>       0x02, 0x20, 0xa1, 0xd2,                 /* mov     x2, #0x9000000 */
>> +    0x21, 0x20, 0x80, 0x52,                 /* mov     w1, #0x101 */
>> +    0x41, 0x60, 0x00, 0x79,                 /* strh    w1, [x2, #48] */
>> +    0x81, 0x0a, 0x80, 0x52,                 /* mov     w1, #0x54 */
>>       0x41, 0x00, 0x00, 0x39,                 /* strb    w1, [x2] */
>> -    0xfd, 0xff, 0xff, 0x17,                 /* b       -12 (loop) */
>> +    0xff, 0xff, 0xff, 0x17,                 /* b       -4 (loop) */
> 
> Another unexplained offset change here.
> 
>>   };
>>
>>   static const uint8_t kernel_nrf51[] = {
>> --
>> 2.41.0
> 
> thanks
> -- PMM



  reply	other threads:[~2024-12-30 15:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-19 18:10 [PATCH v5 00/16] hw/char/pl011: Implement TX (async) FIFO to avoid blocking the main loop Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 01/16] tests/avocado: Add 'device:pl011' tag to tests exercising PL011 UART Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 02/16] hw/char/pl011: Remove unused 'readbuff' field Philippe Mathieu-Daudé
2024-07-29 15:39   ` Peter Maydell
2024-07-19 18:10 ` [PATCH v5 03/16] hw/char/pl011: Move pl011_put_fifo() earlier Philippe Mathieu-Daudé
2024-07-29 15:39   ` Peter Maydell
2024-07-19 18:10 ` [PATCH v5 04/16] hw/char/pl011: Move pl011_loopback_enabled|tx() around Philippe Mathieu-Daudé
2024-07-29 15:40   ` Peter Maydell
2024-07-19 18:10 ` [PATCH v5 05/16] hw/char/pl011: Split RX/TX path of pl011_reset_fifo() Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 06/16] hw/char/pl011: Extract pl011_write_txdata() from pl011_write() Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 07/16] hw/char/pl011: Extract pl011_read_rxdata() from pl011_read() Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 08/16] hw/char/pl011: Warn when using disabled transmitter Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 09/16] tests/qtest: Update tests using PL011 UART Philippe Mathieu-Daudé
2024-07-29 15:47   ` Peter Maydell
2024-12-30 15:17     ` Philippe Mathieu-Daudé [this message]
2024-07-19 18:10 ` [PATCH v5 10/16] hw/char/pl011: Check if receiver is enabled Philippe Mathieu-Daudé
2024-07-29 15:51   ` Peter Maydell
2025-01-02 15:45     ` Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 11/16] hw/char/pl011: Rename RX FIFO methods Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 12/16] hw/char/pl011: Add transmit FIFO to PL011State Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 13/16] hw/char/pl011: Introduce pl011_xmit() as GSource Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 14/16] hw/char/pl011: Consider TX FIFO overrun error Philippe Mathieu-Daudé
2024-07-19 18:10 ` [PATCH v5 15/16] hw/char/pl011: Drain TX FIFO when no backend connected Philippe Mathieu-Daudé
2024-07-19 18:10 ` [RFC PATCH v5 16/16] hw/char/pl011: Implement TX FIFO Philippe Mathieu-Daudé
2024-07-19 21:25   ` Mark Cave-Ayland
2024-07-22 11:47     ` Philippe Mathieu-Daudé
2024-09-07  5:42 ` [PATCH v5 00/16] hw/char/pl011: Implement TX (async) FIFO to avoid blocking the main loop Philippe Mathieu-Daudé
2024-09-07 10:38   ` Peter Maydell
2024-09-09 13:27     ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=626e4b64-bf09-4dec-b353-b9239ee6d7d3@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tong.ho@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).