qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, "Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v6 4/4] tests/qtest/boot-serial-test: Initialize PL011 Control register
Date: Fri, 03 Jan 2025 12:00:57 -0300	[thread overview]
Message-ID: <878qrs7xhy.fsf@suse.de> (raw)
In-Reply-To: <20250102105822.43532-5-philmd@linaro.org>

Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> The tests using the PL011 UART of the virt and raspi machines
> weren't properly enabling the UART and its transmitter previous
> to sending characters. Follow the PL011 manual initialization
> recommendation by setting the proper bits of the control register.
>
> Update the ASM code prefixing:
>
>   *UART_CTRL = UART_ENABLE | TX_ENABLE;
>
> to:
>
>   while (true) {
>       *UART_DATA = 'T';
>   }
>
> Note, since commit 51b61dd4d56 ("hw/char/pl011: Warn when using
> disabled transmitter") incomplete PL011 initialization can be
> logged using the '-d guest_errors' command line option.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  tests/qtest/boot-serial-test.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c
> index bcfa504826c..6ea7e62e076 100644
> --- a/tests/qtest/boot-serial-test.c
> +++ b/tests/qtest/boot-serial-test.c
> @@ -70,15 +70,20 @@ static const uint8_t kernel_plml605[] = {
>  };
>  
>  static const uint8_t bios_raspi2[] = {
> -    0x08, 0x30, 0x9f, 0xe5,                 /*        ldr     r3, [pc, #8]   Get &UART0 */
> +    0x10, 0x30, 0x9f, 0xe5,                 /*        ldr     r3, [pc, #8]   Get &UART0 */

The comment needs updating, no?

> +    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,                 /* loop:  strb    r2, [r3]       *TXDAT = 'T' */
>      0xff, 0xff, 0xff, 0xea,                 /*        b       -4             (loop) */
>      0x00, 0x10, 0x20, 0x3f,                 /* UART0: 0x3f201000 */
> +    0x01, 0x01, 0x00, 0x00,                 /* CR:    0x101 = UARTEN|TXE */
>  };
>  
>  static const uint8_t kernel_aarch64[] = {
>      0x02, 0x20, 0xa1, 0xd2,                 /*        mov    x2, #0x9000000  Load UART0 */
> +    0x21, 0x20, 0x80, 0x52,                 /*        mov    w1, 0x101       CR = UARTEN|TXE */
> +    0x41, 0x60, 0x00, 0x79,                 /*        strh   w1, [x2, #48]   Set CR */
>      0x81, 0x0a, 0x80, 0x52,                 /*        mov    w1, #'T' */
>      0x41, 0x00, 0x00, 0x39,                 /* loop:  strb   w1, [x2]        *TXDAT = 'T' */
>      0xff, 0xff, 0xff, 0x17,                 /*        b      -4              (loop) */


  reply	other threads:[~2025-01-03 15:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02 10:58 [PATCH v6 0/4] tests/qtest: Update tests using PL011 UART Philippe Mathieu-Daudé
2025-01-02 10:58 ` [PATCH v6 1/4] tests/qtest/boot-serial-test: Improve ASM comments of PL011 tests Philippe Mathieu-Daudé
2025-01-03 14:20   ` Fabiano Rosas
2025-01-02 10:58 ` [PATCH v6 2/4] tests/qtest/boot-serial-test: Reduce for() loop in " Philippe Mathieu-Daudé
2025-01-03 14:23   ` Fabiano Rosas
2025-01-02 10:58 ` [PATCH v6 3/4] tests/qtest/boot-serial-test: Reorder pair of instructions in PL011 test Philippe Mathieu-Daudé
2025-01-03 14:24   ` Fabiano Rosas
2025-01-02 10:58 ` [PATCH v6 4/4] tests/qtest/boot-serial-test: Initialize PL011 Control register Philippe Mathieu-Daudé
2025-01-03 15:00   ` Fabiano Rosas [this message]
2025-01-03 15:08     ` Philippe Mathieu-Daudé
2025-01-02 15:02 ` [PATCH v6 0/4] tests/qtest: Update tests using PL011 UART Richard Henderson

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=878qrs7xhy.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).