public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Leo Liang <ycliang@andestech.com>
To: Kautuk Consul <kconsul@ventanamicro.com>
Cc: Bin Meng <bmeng.cn@gmail.com>, Rick Chen <rick@andestech.com>,
	<u-boot@lists.denx.de>, <peterlin@andestech.com>,
	<ycliang@andestech.com>
Subject: Re: [PATCH v5 0/3] Add riscv semihosting support in u-boot
Date: Fri, 2 Dec 2022 08:46:08 +0000	[thread overview]
Message-ID: <Y4m7UBtJMDqsc5dc@ubuntu01> (raw)
In-Reply-To: <CALwhnKDejMRAt0TUqKo2sS=6iRpiT1OzGT9JZgxteN3Z03XyfQ@mail.gmail.com>

Hi Kautuk,

Sorry for the late reply.
The CI failure still exists and
if tested on QEMU(7.0.0) without a gdb attached,
it is possible that we get weird output on console.[1]

Another thing is that with your patch,
QEMU could not exit with Ctrl a + x.
This might be the reason for CI failure (timeout).
Could you take a look at this?

Yet with a gdb attached, everything works as expected,
So maybe we could disable semihosting as default?

Best regards,
Leo

[1] The weird console output looks like below, 
it outputs random character without us typing anything. 

U-Boot 2022.10-rc5 (Dec 02 2022 - 16:27:43 +0800)
CPU:   rv64imafdcsuh
Model: riscv-virtio,qemu
DRAM:  2 GiB
Core:  35 devices, 15 uclasses, devicetree: board
Flash: 32 MiB
Loading Environment from nowhere... OK
In:    serial_semihosting
Out:   serial_semihosting
Err:   serial_semihosting
Net:   eth0: virtio-net#1
Hit any key to stop autoboot:  0
=> 55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555



On Tue, Nov 29, 2022 at 12:27:51PM +0530, Kautuk Consul wrote:
> I have tested it both on Qemu and Ventana's internal simulator.
> 
> On Tue, Nov 29, 2022 at 12:06 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> 
> > Hi Kautuk,
> >
> > On Tue, Nov 29, 2022 at 2:29 PM Kautuk Consul <kconsul@ventanamicro.com>
> > wrote:
> > >
> > > Hi,
> > >
> > > Can someone pick this patchset up ?
> > >
> > > It has been reviewed and there has been no comment on this in recent
> > days.
> > >
> > > Thanks.
> > >
> > > On Fri, Sep 23, 2022 at 12:33 PM Kautuk Consul <kconsul@ventanamicro.com>
> > wrote:
> > >>
> > >> Semihosting is a mechanism that enables code running on
> > >> a target to communicate and use the Input/Output
> > >> facilities on a host computer that is running a debugger.
> > >> This patchset adds support for semihosting in u-boot
> > >> for RISCV64 targets.
> > >>
> > >> CHANGES since v4:
> > >> -       Check arch dependencies for SEMIHOSTING as well as
> > SPL_SEMIHOSTING
> > >>         config options as per Sean's comment.
> > >> -       arch/riscv/lib/interrupts.c: Check for post and pre instructions
> > >>         of the ebreak statement whether they are as per the RISCV
> > >>         semihosting specification. Only then do a disable_semihosting
> > >>         and epc += 4 and return.
> > >>
> > >> Compilation and test commands for SPL and S-mode configurations
> > >> =================================================================
> > >>
> > >> U-Boot S-mode on QEMU virt
> > >> ----------------------------
> > >> // Compilation of S-mode u-boot
> > >> ARCH=riscv
> > >> CROSS_COMPILE=riscv64-unknown-linux-gnu-
> > >> make qemu-riscv64_smode_defconfig
> > >> make
> > >> // Run riscv 64-bit u-boot with opensbi on qemu
> > >> qemu-system-riscv64 -M virt -m 256M -display none -serial stdio -bios\
> > >> opensbi/build/platform/generic/firmware/fw_jump.bin -kernel\
> > >> u-boot/u-boot.bin
> > >>
> > >> U-Boot SPL on QEMU virt
> > >> ------------------------
> > >> // Compilation of u-boot-spl
> > >> ARCH=riscv
> > >> CROSS_COMPILE=riscv64-unknown-linux-gnu-
> > >> make qemu-riscv64_spl_defconfig
> > >> make OPENSBI=opensbi/build/platform/generic/firmware/fw_dynamic.bin
> > >> // Run 64-bit u-boot-spl in qemu
> > >> qemu-system-riscv64 -M virt -m 256M -display none -serial stdio -bios\
> > >> u-boot/spl/u-boot-spl.bin -device\
> > >> loader,file=u-boot/u-boot.itb,addr=0x80200000
> > >>
> >
> > Do you have instructions on how to actually test semihosting? Does it
> > require a JTAG debugger? But I see you are using QEMU?
> >
> > Regards,
> > Bin
> >

  reply	other threads:[~2022-12-02  8:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23  7:03 [PATCH v5 0/3] Add riscv semihosting support in u-boot Kautuk Consul
2022-09-23  7:03 ` [PATCH v5 1/3] lib: Add common semihosting library Kautuk Consul
2022-10-10 15:39   ` Sean Anderson
2022-09-23  7:03 ` [PATCH v5 2/3] arch/riscv: add semihosting support for RISC-V Kautuk Consul
2022-10-10 15:43   ` Sean Anderson
     [not found]   ` <HK0PR03MB2994013C655E85AF1F3D2CFBC1229@HK0PR03MB2994.apcprd03.prod.outlook.com>
2022-10-12  1:40     ` Rick Chen
2022-09-23  7:03 ` [PATCH v5 3/3] board: qemu-riscv: enable semihosting Kautuk Consul
2022-10-05  6:17   ` Leo Liang
2022-10-06  5:13     ` Kautuk Consul
     [not found]   ` <HK0PR03MB29949257906C387D549119EBC1229@HK0PR03MB2994.apcprd03.prod.outlook.com>
2022-10-12  1:33     ` Rick Chen
2022-12-03  4:14   ` Bin Meng
2022-12-05  5:51     ` Kautuk Consul
2022-12-05 13:54       ` Bin Meng
2022-12-05 15:16       ` Sean Anderson
2022-12-06  5:42         ` Kautuk Consul
2022-12-06 10:58           ` Leo Liang
2022-12-06 11:32             ` Kautuk Consul
2022-12-07  7:01               ` Leo Liang
2022-12-07 11:47                 ` Kautuk Consul
2022-12-06 15:16           ` Sean Anderson
2022-11-29  6:29 ` [PATCH v5 0/3] Add riscv semihosting support in u-boot Kautuk Consul
2022-11-29  6:36   ` Bin Meng
2022-11-29  6:57     ` Kautuk Consul
2022-12-02  8:46       ` Leo Liang [this message]
2022-12-02  9:52         ` Kautuk Consul
2022-12-02 12:01           ` Leo Liang
2022-12-03  4:28       ` Bin Meng
2022-12-03  6:01         ` Bin Meng
2022-12-05  5:50           ` Kautuk Consul

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=Y4m7UBtJMDqsc5dc@ubuntu01 \
    --to=ycliang@andestech.com \
    --cc=bmeng.cn@gmail.com \
    --cc=kconsul@ventanamicro.com \
    --cc=peterlin@andestech.com \
    --cc=rick@andestech.com \
    --cc=u-boot@lists.denx.de \
    /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