All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rahul Pathak <rpathak@ventanamicro.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>,
	Rahul Pathak <rpathakmailbox@gmail.com>,
	"open list:RISC-V" <qemu-riscv@nongnu.org>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: HSS Issue with GCC 10, Qemu Setup for microchip-icicle-kit
Date: Tue, 1 Jun 2021 08:41:22 +0530	[thread overview]
Message-ID: <CA+Oz1=b=wBCCVVHWic8UrJQY5aEB+9OYS2XVtn6FEA2R6wm5yw@mail.gmail.com> (raw)
In-Reply-To: <CAEUhbmWCvPVo5Jww0GPb6uX0xBfRKqZD6Jp-e54sU+v6R=m3gQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 6301 bytes --]

Hi BIn,Alistair,

I was passing the hss.elf file and it was strange that gdb after connecting
was not letting the target to continue from gdb.
what worked was to not pass anything and then connect the to target then
load the symbol file as hss.elf.
I followed the steps from the "Attaching the GDB" doc and was able to debug.


For the qemu command line from the doc, I made the "wait=off" then qemu was
not waiting for another serial connection
and launched the hss.


The problem remains is that I still do not have the u-boot and linux
booting. The unix\#serial1.sock remains offline always.
These are the HSS logs -

[0.115001] HSS_E51_Banner(): PolarFire(R) SoC Hart Software Services (HSS)
- version 0.99.15

(c) Copyright 2017-2020 Microchip Corporation.





[0.116234] HSS_E51_Banner(): incorporating OpenSBI - version 0.6


(c) Copyright 2019-2020 Western Digital Corporation.





[0.117071] HSS_PrintBuildId(): Build ID:
811342a39f80176f9e2086bf963a83224b3d3a2e

[0.117817] HSS_PrintToolVersions(): Built with the following tools:


 - riscv64-unknown-linux-gnu-gcc (GCC) 10.2.0


 - GNU ld (GNU Binutils) 2.36.1





[0.118760] HSS_MemTestDDRFast(): DDR size is 1 GiB


[0.130270] HSS_MMCInit(): Attempting to select SDCARD ... Passed


Press a key to enter CLI, ESC to skip


Timeout in 5 seconds

.....


[5.138747] HSS_TinyCLI_Parser(): CLI check timeout


[5.139371] IPI_QueuesInit(): Initializing IPI Queues (9000 bytes @
8000e40)...
[5.140435] HSS_PMP_Init(): Initializing PMPs


[5.141093] HSS_BootInit(): Initializing Boot Image..


[5.141787] getBootImageFromMMC_(): Preparing to copy from MMC to DDR ...


[5.142671] getBootImageFromMMC_(): Attempting to read image header (1552
bytes) ...

[5.144118] GPT_ValidateHeader(): Validated GPT Header ...


[5.153768] GPT_ValidatePartitionEntries(): Validated GPT Partition Entries
...

[5.155210] copyBootImageToDDR_(): Copying 436008 bytes to 0xA0000000


[5.407848] copyBootImageToDDR_(): Calculated CRC32 of image in DDR is
795fbbea

[5.412058] HSS_BootInit():  boot image passed CRC


[5.412407] HSS_BootInit(): Boot image set name: "PolarFire-SoC-HSS::U-Boot"


[5.412951] HSS_BootInit(): Boot Image registered...


[5.413376] HSS_Boot_RestartCore(): called for all harts


[5.414295] RunStateMachine(): boot_service(u54_1)::Init ->
boot_service(u54_1)::SetupPMP
[5.414812] RunStateMachine(): boot_service(u54_2)::Init ->
boot_service(u54_2)::SetupPMP

[5.415207] RunStateMachine(): boot_service(u54_3)::Init ->
boot_service(u54_3)::SetupPMP
[5.415631] RunStateMachine(): boot_service(u54_4)::Init ->
boot_service(u54_4)::SetupPMP

[5.416107] RunStateMachine(): usbdmsc_service::init ->
usbdmsc_service::idle

[5.417164] RunStateMachine(): boot_service(u54_1)::SetupPMP ->
boot_service(u54_1)::SetupPMPComplete

[5.417887] RunStateMachine(): boot_service(u54_2)::SetupPMP ->
boot_service(u54_2)::SetupPMPComplete

[5.418552] RunStateMachine(): boot_service(u54_3)::SetupPMP ->
boot_service(u54_3)::SetupPMPComplete

[5.419890] RunStateMachine(): boot_service(u54_4)::SetupPMP ->
boot_service(u54_4)::SetupPMPComplete
[23.955147] RunStateMachine(): boot_service(u54_1)::SetupPMPComplete ->
boot_service(u54_1)::ZeroInit
[23.955754] RunStateMachine(): boot_service(u54_2)::SetupPMPComplete ->
boot_service(u54_2)::ZeroInit
[23.956259] RunStateMachine(): boot_service(u54_3)::SetupPMPComplete ->
boot_service(u54_3)::ZeroInit
[23.956757] RunStateMachine(): boot_service(u54_4)::SetupPMPComplete ->
boot_service(u54_4)::ZeroInit
[23.957371] RunStateMachine(): boot_service(u54_1)::ZeroInit ->
boot_service(u54_1)::Download
[23.957876] RunStateMachine(): boot_service(u54_2)::ZeroInit ->
boot_service(u54_2)::Download
[23.958386] RunStateMachine(): boot_service(u54_3)::ZeroInit ->
boot_service(u54_3)::Download
[23.958856] RunStateMachine(): boot_service(u54_4)::ZeroInit ->
boot_service(u54_4)::Download
[23.960300] RunStateMachine(): boot_service(u54_2)::Download ->
boot_service(u54_2)::Idle
[23.960723] RunStateMachine(): boot_service(u54_3)::Download ->
boot_service(u54_3)::Idle
[23.961129] RunStateMachine(): boot_service(u54_4)::Download ->
boot_service(u54_4)::Idle
[23.983168] RunStateMachine(): boot_service(u54_1)::Download ->
boot_service(u54_1)::Wait
[23.983661] boot_download_chunks_onExit():
boot_service(u54_1)::u54_2:sbi_init 80200000
[23.984374] boot_download_chunks_onExit():
boot_service(u54_1)::u54_3:sbi_init 80200000
[23.985418] boot_download_chunks_onExit():
boot_service(u54_1)::u54_4:sbi_init 80200000
[23.986783] boot_download_chunks_onExit():
boot_service(u54_1)::u54_1:sbi_init 80200000
[23.989086] boot_wait_onEntry(): boot_service(u54_1)::Checking for IPI
ACKs: - -
[23.992106] boot_wait_handler(): boot_service(u54_1)::Checking for IPI
ACKs: ACK/IDLE ACK
[23.994062] RunStateMachine(): boot_service(u54_1)::Wait ->
boot_service(u54_1)::Idle


One thing I overlooked in the document is that we are preparing the *.wic
file after downloading
but passing the *.img in the qemu command. How to convert the wic to img. I
couldn't see much about
this on the internet ?
Since U-boot currently does not boot, it seems passing the wic file
directly is not right. Now sure here.

 qemu-system-riscv64 -M microchip-icicle-kit -smp 5 \
    -bios path/to/hss.bin -sd path/to/sdcard.img \
    -nic user,model=cadence_gem \
    -nic tap,ifname=tap,model=cadence_gem,script=no \
    -display none -serial stdio \
    -chardev socket,id=serial1,path=serial1.sock,server=on,wait=on \
    -serial chardev:serial1


Are there other ways in qemu icicle machine supported now to pass the
u-boot and kernel?

Thanks
Rahul



On Tue, Jun 1, 2021 at 8:06 AM Bin Meng <bmeng.cn@gmail.com> wrote:

> Hi Rahul,
>
> On Mon, May 31, 2021 at 10:43 PM Rahul Pathak <rpathakmailbox@gmail.com>
> wrote:
> >
> > On top of that, it seems I cannot connect with the target using gdb
> >
> > (gdb) target remote :1234
> > Remote debugging using :1234
> > bfd requires flen 8, but target has flen 0
> >
> > Though the ABI is lp64 and ISA is rv64imac when the hss was built.
> >
>
> Did you feed gdb the image you wanted to debug before "target remote:"?
>
> The PolarFire SoC has 1+4 HARTs and you should follow the instructions
> @ https://wiki.qemu.org/Documentation/Platforms/RISCV#Attaching_GDB to
> do the debug.
>
> Regards,
> Bin
>

[-- Attachment #2: Type: text/html, Size: 16346 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Rahul Pathak <rpathak@ventanamicro.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: Rahul Pathak <rpathakmailbox@gmail.com>,
	"open list:RISC-V" <qemu-riscv@nongnu.org>,
	 Alistair Francis <Alistair.Francis@wdc.com>,
	 "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: HSS Issue with GCC 10, Qemu Setup for microchip-icicle-kit
Date: Tue, 1 Jun 2021 08:41:22 +0530	[thread overview]
Message-ID: <CA+Oz1=b=wBCCVVHWic8UrJQY5aEB+9OYS2XVtn6FEA2R6wm5yw@mail.gmail.com> (raw)
In-Reply-To: <CAEUhbmWCvPVo5Jww0GPb6uX0xBfRKqZD6Jp-e54sU+v6R=m3gQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 6301 bytes --]

Hi BIn,Alistair,

I was passing the hss.elf file and it was strange that gdb after connecting
was not letting the target to continue from gdb.
what worked was to not pass anything and then connect the to target then
load the symbol file as hss.elf.
I followed the steps from the "Attaching the GDB" doc and was able to debug.


For the qemu command line from the doc, I made the "wait=off" then qemu was
not waiting for another serial connection
and launched the hss.


The problem remains is that I still do not have the u-boot and linux
booting. The unix\#serial1.sock remains offline always.
These are the HSS logs -

[0.115001] HSS_E51_Banner(): PolarFire(R) SoC Hart Software Services (HSS)
- version 0.99.15

(c) Copyright 2017-2020 Microchip Corporation.





[0.116234] HSS_E51_Banner(): incorporating OpenSBI - version 0.6


(c) Copyright 2019-2020 Western Digital Corporation.





[0.117071] HSS_PrintBuildId(): Build ID:
811342a39f80176f9e2086bf963a83224b3d3a2e

[0.117817] HSS_PrintToolVersions(): Built with the following tools:


 - riscv64-unknown-linux-gnu-gcc (GCC) 10.2.0


 - GNU ld (GNU Binutils) 2.36.1





[0.118760] HSS_MemTestDDRFast(): DDR size is 1 GiB


[0.130270] HSS_MMCInit(): Attempting to select SDCARD ... Passed


Press a key to enter CLI, ESC to skip


Timeout in 5 seconds

.....


[5.138747] HSS_TinyCLI_Parser(): CLI check timeout


[5.139371] IPI_QueuesInit(): Initializing IPI Queues (9000 bytes @
8000e40)...
[5.140435] HSS_PMP_Init(): Initializing PMPs


[5.141093] HSS_BootInit(): Initializing Boot Image..


[5.141787] getBootImageFromMMC_(): Preparing to copy from MMC to DDR ...


[5.142671] getBootImageFromMMC_(): Attempting to read image header (1552
bytes) ...

[5.144118] GPT_ValidateHeader(): Validated GPT Header ...


[5.153768] GPT_ValidatePartitionEntries(): Validated GPT Partition Entries
...

[5.155210] copyBootImageToDDR_(): Copying 436008 bytes to 0xA0000000


[5.407848] copyBootImageToDDR_(): Calculated CRC32 of image in DDR is
795fbbea

[5.412058] HSS_BootInit():  boot image passed CRC


[5.412407] HSS_BootInit(): Boot image set name: "PolarFire-SoC-HSS::U-Boot"


[5.412951] HSS_BootInit(): Boot Image registered...


[5.413376] HSS_Boot_RestartCore(): called for all harts


[5.414295] RunStateMachine(): boot_service(u54_1)::Init ->
boot_service(u54_1)::SetupPMP
[5.414812] RunStateMachine(): boot_service(u54_2)::Init ->
boot_service(u54_2)::SetupPMP

[5.415207] RunStateMachine(): boot_service(u54_3)::Init ->
boot_service(u54_3)::SetupPMP
[5.415631] RunStateMachine(): boot_service(u54_4)::Init ->
boot_service(u54_4)::SetupPMP

[5.416107] RunStateMachine(): usbdmsc_service::init ->
usbdmsc_service::idle

[5.417164] RunStateMachine(): boot_service(u54_1)::SetupPMP ->
boot_service(u54_1)::SetupPMPComplete

[5.417887] RunStateMachine(): boot_service(u54_2)::SetupPMP ->
boot_service(u54_2)::SetupPMPComplete

[5.418552] RunStateMachine(): boot_service(u54_3)::SetupPMP ->
boot_service(u54_3)::SetupPMPComplete

[5.419890] RunStateMachine(): boot_service(u54_4)::SetupPMP ->
boot_service(u54_4)::SetupPMPComplete
[23.955147] RunStateMachine(): boot_service(u54_1)::SetupPMPComplete ->
boot_service(u54_1)::ZeroInit
[23.955754] RunStateMachine(): boot_service(u54_2)::SetupPMPComplete ->
boot_service(u54_2)::ZeroInit
[23.956259] RunStateMachine(): boot_service(u54_3)::SetupPMPComplete ->
boot_service(u54_3)::ZeroInit
[23.956757] RunStateMachine(): boot_service(u54_4)::SetupPMPComplete ->
boot_service(u54_4)::ZeroInit
[23.957371] RunStateMachine(): boot_service(u54_1)::ZeroInit ->
boot_service(u54_1)::Download
[23.957876] RunStateMachine(): boot_service(u54_2)::ZeroInit ->
boot_service(u54_2)::Download
[23.958386] RunStateMachine(): boot_service(u54_3)::ZeroInit ->
boot_service(u54_3)::Download
[23.958856] RunStateMachine(): boot_service(u54_4)::ZeroInit ->
boot_service(u54_4)::Download
[23.960300] RunStateMachine(): boot_service(u54_2)::Download ->
boot_service(u54_2)::Idle
[23.960723] RunStateMachine(): boot_service(u54_3)::Download ->
boot_service(u54_3)::Idle
[23.961129] RunStateMachine(): boot_service(u54_4)::Download ->
boot_service(u54_4)::Idle
[23.983168] RunStateMachine(): boot_service(u54_1)::Download ->
boot_service(u54_1)::Wait
[23.983661] boot_download_chunks_onExit():
boot_service(u54_1)::u54_2:sbi_init 80200000
[23.984374] boot_download_chunks_onExit():
boot_service(u54_1)::u54_3:sbi_init 80200000
[23.985418] boot_download_chunks_onExit():
boot_service(u54_1)::u54_4:sbi_init 80200000
[23.986783] boot_download_chunks_onExit():
boot_service(u54_1)::u54_1:sbi_init 80200000
[23.989086] boot_wait_onEntry(): boot_service(u54_1)::Checking for IPI
ACKs: - -
[23.992106] boot_wait_handler(): boot_service(u54_1)::Checking for IPI
ACKs: ACK/IDLE ACK
[23.994062] RunStateMachine(): boot_service(u54_1)::Wait ->
boot_service(u54_1)::Idle


One thing I overlooked in the document is that we are preparing the *.wic
file after downloading
but passing the *.img in the qemu command. How to convert the wic to img. I
couldn't see much about
this on the internet ?
Since U-boot currently does not boot, it seems passing the wic file
directly is not right. Now sure here.

 qemu-system-riscv64 -M microchip-icicle-kit -smp 5 \
    -bios path/to/hss.bin -sd path/to/sdcard.img \
    -nic user,model=cadence_gem \
    -nic tap,ifname=tap,model=cadence_gem,script=no \
    -display none -serial stdio \
    -chardev socket,id=serial1,path=serial1.sock,server=on,wait=on \
    -serial chardev:serial1


Are there other ways in qemu icicle machine supported now to pass the
u-boot and kernel?

Thanks
Rahul



On Tue, Jun 1, 2021 at 8:06 AM Bin Meng <bmeng.cn@gmail.com> wrote:

> Hi Rahul,
>
> On Mon, May 31, 2021 at 10:43 PM Rahul Pathak <rpathakmailbox@gmail.com>
> wrote:
> >
> > On top of that, it seems I cannot connect with the target using gdb
> >
> > (gdb) target remote :1234
> > Remote debugging using :1234
> > bfd requires flen 8, but target has flen 0
> >
> > Though the ABI is lp64 and ISA is rv64imac when the hss was built.
> >
>
> Did you feed gdb the image you wanted to debug before "target remote:"?
>
> The PolarFire SoC has 1+4 HARTs and you should follow the instructions
> @ https://wiki.qemu.org/Documentation/Platforms/RISCV#Attaching_GDB to
> do the debug.
>
> Regards,
> Bin
>

[-- Attachment #2: Type: text/html, Size: 16346 bytes --]

  reply	other threads:[~2021-06-01  3:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0CAA9018-0C42-4140-82C1-EAC80D46D359@getmailspring.com>
2021-05-31  2:49 ` HSS Issue with GCC 10, Qemu Setup for microchip-icicle-kit Bin Meng
2021-05-31  9:16   ` Rahul Pathak
2021-05-31  9:16     ` Rahul Pathak
2021-05-31 14:43     ` Rahul Pathak
2021-05-31 14:43       ` Rahul Pathak
2021-05-31 22:48       ` Alistair Francis
2021-05-31 22:48         ` Alistair Francis
2021-06-01  2:36       ` Bin Meng
2021-06-01  2:36         ` Bin Meng
2021-06-01  3:11         ` Rahul Pathak [this message]
2021-06-01  3:11           ` Rahul Pathak
2021-06-01 14:09           ` Bin Meng
2021-06-01 14:09             ` Bin Meng
2021-06-01 14:18             ` Rahul Pathak
2021-06-01 14:18               ` Rahul Pathak
2021-06-01 18:36               ` Rahul Pathak
2021-06-01 18:36                 ` Rahul Pathak
2021-05-31 22:48     ` Alistair Francis
2021-05-31 22:48       ` Alistair Francis

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='CA+Oz1=b=wBCCVVHWic8UrJQY5aEB+9OYS2XVtn6FEA2R6wm5yw@mail.gmail.com' \
    --to=rpathak@ventanamicro.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=bmeng.cn@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=rpathakmailbox@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.