HSS Issue with GCC 10, Qemu Setup for microchip-icicle-kit
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Rahul,
Quoted 4 lines · Rahul Pathak
Hi Bin,
I was reading a github issue which you raised for the issue with HSS because of GCC 10.1. Its pretty old and not sure what has changed so I thought to ask you over email for help.
The HSS issue of GCC 10.1 was already fixed in the HSS mainline.
Quoted 1 line
I myself is trying to make a setup to boot the microchip-icicle-kit Qemu machine with HSS and Yocto linux image. Currently it does not work.
Could you please elaborate which part does not work? Is that Linux, HSS, or U-Boot?
Quoted 3 lines
Do you know what is the right setup to make microchip-icicle-kit machine with HSS.bin and Yocto linux work on Qemu?. Probably there will be a working combination of HSS, Linux releases plus the toolchain version which makes this setup work.
I have not tried Yocto Linux yet with Microchip Icicle Kit on QEMU. I only tested the Linux images released by Microchip.
Could you please follow the instructions @
https://qemu.readthedocs.io/en/latest/system/riscv/microchip-icicle-kit.html
to see which step might be wrong on your side?
Regards,
Bin
I followed the same link. I will elaborate what is happening at my end -
*First* -
Used the same versions as per the doc. Built HSS 2020.12 and used core-image-minimal-dev-icicle-kit-es-sd-20201009141623.rootfs.wic. Upon executing the qemu launch command as per the doc, it's just waits for the connection on another serial console -
info: QEMU waiting for connection on: disconnected:unix :serial1.sock,server=on
Even if I open sudo minicom -D unix\#serial1.sock, which remains offline always.
*Second* -
If I remove the "-chardev socket,id=serial1,path=serial1.sock,server=on,wait=on -serial chardev:serial1" from the
qemu launch command then HSS boots but stops after sbi_init on all the cores and put the cores in Idle -
[5.443011] boot_download_chunks_onExit(): boot_service(u54_1)::u54_1:sbi_init 80200000 [5.444960] boot_wait_onEntry(): boot_service(u54_1)::Checking for IPI ACKs: - - [5.447962] boot_wait_handler(): boot_service(u54_1)::Checking for IPI ACKs: ACK/IDLE ACK [5.449343] RunStateMachine(): boot_service(u54_1)::Wait ->
boot_service(u54_1)::Idle
*Third -*
If I take the latest release of HSS 2021.04 and build with gcc10, it does not boot at all even if I remove the serial1 like in the second case.
Thanks
Rahul
Quoted 36 lines · Bin Meng
Hi Rahul,
Quoted 4 lines · Rahul Pathak
Hi Bin,
I was reading a github issue which you raised for the issue with HSS
because of GCC 10.1. Its pretty old and not sure what has changed so I thought to ask you over email for help.
The HSS issue of GCC 10.1 was already fixed in the HSS mainline.
Quoted 1 line
I myself is trying to make a setup to boot the microchip-icicle-kit
Qemu machine with HSS and Yocto linux image. Currently it does not work.
Could you please elaborate which part does not work? Is that Linux, HSS, or U-Boot?
Quoted 2 lines
Do you know what is the right setup to make microchip-icicle-kit
machine with HSS.bin and Yocto linux work on Qemu?. Probably there will be a working combination of HSS, Linux releases plus the toolchain version which makes this setup work.
Quoted 1 line
I have not tried Yocto Linux yet with Microchip Icicle Kit on QEMU. I only tested the Linux images released by Microchip.
Could you please follow the instructions @https://qemu.readthedocs.io/en/latest/system/riscv/microchip-icicle-kit.html
to see which step might be wrong on your side?Regards,
Bin
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.
Quoted 77 lines · Rahul Pathak
I followed the same link. I will elaborate what is happening at my end -
*First* -
Used the same versions as per the doc. Built HSS 2020.12 and used core-image-minimal-dev-icicle-kit-es-sd-20201009141623.rootfs.wic. Upon executing the qemu launch command as per the doc, it's just waits for the connection on another serial console -info: QEMU waiting for connection on: disconnected:unix :serial1.sock,server=on
Even if I open sudo minicom -D unix\#serial1.sock, which remains offline always.
*Second* -
If I remove the "-chardev socket,id=serial1,path=serial1.sock,server=on,wait=on -serial chardev:serial1" from the
qemu launch command then HSS boots but stops aftersbi_initon all the cores and put the cores in Idle -[5.443011] boot_download_chunks_onExit(): boot_service(u54_1)::u54_1:sbi_init 80200000 [5.444960] boot_wait_onEntry(): boot_service(u54_1)::Checking for IPI ACKs: - - [5.447962] boot_wait_handler(): boot_service(u54_1)::Checking for IPI ACKs: ACK/IDLE ACK [5.449343] RunStateMachine(): boot_service(u54_1)::Wait ->boot_service(u54_1)::Idle
*Third -*
If I take the latest release of HSS 2021.04 and build with gcc10, it does not boot at all even if I remove the serial1 like in the second case.Thanks
RahulQuoted 36 lines · Bin Meng
Hi Rahul,
Quoted 4 lines · Rahul Pathak
Hi Bin,
I was reading a github issue which you raised for the issue with HSS
because of GCC 10.1. Its pretty old and not sure what has changed so I thought to ask you over email for help.
The HSS issue of GCC 10.1 was already fixed in the HSS mainline.
Quoted 1 line
I myself is trying to make a setup to boot the microchip-icicle-kit
Qemu machine with HSS and Yocto linux image. Currently it does not work.
Could you please elaborate which part does not work? Is that Linux, HSS, or U-Boot?
Quoted 2 lines
Do you know what is the right setup to make microchip-icicle-kit
machine with HSS.bin and Yocto linux work on Qemu?. Probably there will be a working combination of HSS, Linux releases plus the toolchain version which makes this setup work.
Quoted 1 line
I have not tried Yocto Linux yet with Microchip Icicle Kit on QEMU. I only tested the Linux images released by Microchip.
Could you please follow the instructions @https://qemu.readthedocs.io/en/latest/system/riscv/microchip-icicle-kit.html
to see which step might be wrong on your side?Regards,
Bin
Quoted 8 lines · Rahul Pathak
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 0Though the ABI is lp64 and ISA is rv64imac when the hss was built.
Strange, how are you building GDB?
Alistair
Quoted 58 lines · Rahul Pathak
Quoted 56 lines
I followed the same link. I will elaborate what is happening at my end -
First -
Used the same versions as per the doc. Built HSS 2020.12 and used core-image-minimal-dev-icicle-kit-es-sd-20201009141623.rootfs.wic. Upon executing the qemu launch command as per the doc, it's just waits for the connection on another serial console -info: QEMU waiting for connection on: disconnected:unix:serial1.sock,server=on
Even if I open sudo minicom -D unix\#serial1.sock, which remains offline always.
Second -
If I remove the "-chardev socket,id=serial1,path=serial1.sock,server=on,wait=on -serial chardev:serial1" from the qemu launch command then HSS boots but stops aftersbi_initon all the cores and put the cores in Idle -[5.443011] boot_download_chunks_onExit(): boot_service(u54_1)::u54_1:sbi_init 80200000 [5.444960] boot_wait_onEntry(): boot_service(u54_1)::Checking for IPI ACKs: - - [5.447962] boot_wait_handler(): boot_service(u54_1)::Checking for IPI ACKs: ACK/IDLE ACK [5.449343] RunStateMachine(): boot_service(u54_1)::Wait -> boot_service(u54_1)::IdleThird -
If I take the latest release of HSS 2021.04 and build with gcc10, it does not boot at all even if I remove the serial1 like in the second case.Thanks
RahulQuoted 28 lines · Bin Meng
Hi Rahul,
Quoted 4 lines · Rahul Pathak
Hi Bin,
I was reading a github issue which you raised for the issue with HSS because of GCC 10.1. Its pretty old and not sure what has changed so I thought to ask you over email for help.
The HSS issue of GCC 10.1 was already fixed in the HSS mainline.
Quoted 1 line
I myself is trying to make a setup to boot the microchip-icicle-kit Qemu machine with HSS and Yocto linux image. Currently it does not work.
Could you please elaborate which part does not work? Is that Linux, HSS, or U-Boot?
Quoted 3 lines
Do you know what is the right setup to make microchip-icicle-kit machine with HSS.bin and Yocto linux work on Qemu?. Probably there will be a working combination of HSS, Linux releases plus the toolchain version which makes this setup work.
I have not tried Yocto Linux yet with Microchip Icicle Kit on QEMU. I only tested the Linux images released by Microchip.
Could you please follow the instructions @
https://qemu.readthedocs.io/en/latest/system/riscv/microchip-icicle-kit.html
to see which step might be wrong on your side?Regards,
Bin
Hi Rahul,
Quoted 9 lines · Rahul Pathak
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 0Though 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
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:serial1Are there other ways in qemu icicle machine supported now to pass the u-boot and kernel?
Thanks
Rahul
Quoted 23 lines · Bin Meng
Hi Rahul,
Quoted 9 lines · Rahul Pathak
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 0Though 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
Hi Rahul,
Quoted 4 lines · Rahul Pathak
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.
This is the expected behavior if you pass an image to gdb before connecting to the target, as gdb will assume the debug contexts are the same, but it's not the case for PolarFire which has 1+4 hybrid configuration.
Quoted 3 lines
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.
Yes, that's the correct way to debug PolarFire.
Quoted 3 lines
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.
You need to connect to the other serial connection otherwise QEMU does not start the emulation when "wait=on"
Quoted 6 lines
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
Quoted 8 lines
(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
Yeah, this log indicates that GCC 10.x works with HSS :)
Quoted 42 lines
- GNU ld (GNU Binutils) 2.36.1
[0.118760] HSS_MemTestDDRFast(): DDR size is 1 GiB [0.130270] HSS_MMCInit(): Attempting to select SDCARD ... PassedPress 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
Quoted 9 lines
[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
Based on the above log, HSS successfully boots U-Boot already. The U-Boot console is on the other serial console, which I guess you might turn it off?
Quoted 4 lines
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 ?
The *.wic image is the raw image. Just use it as it is.
Quoted 11 lines
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
Quoted 2 lines
Are there other ways in qemu icicle machine supported now to pass the u-boot and kernel?
Yes, it has. The capability to direct boot kernel (can be U-Boot or an OS kernel) without HSS is currently in the Alistair's riscv-next tree and should land on qemu/master soon.
Regards,
Bin
Hi Bin,
Thanks for the response.
I think the issue currently is that if I keep the "wait=on" and launch minicom on "unix\#serial1.sock" then nothing happens.
Qemu keeps waiting for the connection on serial1 and no logs for uboot and Kernel appears on the serial1.
Thanks
Rahul
Quoted 172 lines · Bin Meng
Hi Rahul,
Quoted 4 lines · Rahul Pathak
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.
This is the expected behavior if you pass an image to gdb before connecting to the target, as gdb will assume the debug contexts are the same, but it's not the case for PolarFire which has 1+4 hybrid configuration.
Quoted 1 line
what worked was to not pass anything and then connect the to target then
load the symbol file as hss.elf.
Quoted 1 line
I followed the steps from the "Attaching the GDB" doc and was able to
debug.
Quoted 1 line
Yes, that's the correct way to debug PolarFire.
Quoted 2 lines
For the qemu command line from the doc, I made the "wait=off" then qemu
was not waiting for another serial connection
Quoted 1 line
and launched the hss.
You need to connect to the other serial connection otherwise QEMU does not start the emulation when "wait=on"
Quoted 3 lines
The problem remains is that I still do not have the u-boot and linux
booting. The unix\#serial1.sock remains offline always.
Quoted 3 lines
These are the HSS logs -
[0.115001] HSS_E51_Banner(): PolarFire(R) SoC Hart Software Services(HSS) - version 0.99.15
Quoted 6 lines
(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:
811342a39f80176f9e2086bf963a83224b3d3a2eQuoted 2 lines
[0.117817] HSS_PrintToolVersions(): Built with the following tools: - riscv64-unknown-linux-gnu-gcc (GCC) 10.2.0Yeah, this log indicates that GCC 10.x works with HSS :)
Quoted 10 lines
- GNU ld (GNU Binutils) 2.36.1
[0.118760] HSS_MemTestDDRFast(): DDR size is 1 GiB [0.130270] HSS_MMCInit(): Attempting to select SDCARD ... PassedPress 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)...
Quoted 4 lines
[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 (1552bytes) ...
Quoted 2 lines
[5.144118] GPT_ValidateHeader(): Validated GPT Header ... [5.153768] GPT_ValidatePartitionEntries(): Validated GPT PartitionEntries ...
Quoted 2 lines
[5.155210] copyBootImageToDDR_(): Copying 436008 bytes to 0xA0000000 [5.407848] copyBootImageToDDR_(): Calculated CRC32 of image in DDR is
795fbbeaQuoted 2 lines
[5.412058] HSS_BootInit(): boot image passed CRC [5.412407] HSS_BootInit(): Boot image set name:"PolarFire-SoC-HSS::U-Boot"
Quoted 3 lines
[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
Quoted 1 line
[5.414812] RunStateMachine(): boot_service(u54_2)::Init ->boot_service(u54_2)::SetupPMP
Quoted 1 line
[5.415207] RunStateMachine(): boot_service(u54_3)::Init ->boot_service(u54_3)::SetupPMP
Quoted 1 line
[5.415631] RunStateMachine(): boot_service(u54_4)::Init ->boot_service(u54_4)::SetupPMP
Quoted 1 line
[5.416107] RunStateMachine(): usbdmsc_service::init ->
usbdmsc_service::idleQuoted 1 line
[5.417164] RunStateMachine(): boot_service(u54_1)::SetupPMP ->boot_service(u54_1)::SetupPMPComplete
Quoted 1 line
[5.417887] RunStateMachine(): boot_service(u54_2)::SetupPMP ->boot_service(u54_2)::SetupPMPComplete
Quoted 1 line
[5.418552] RunStateMachine(): boot_service(u54_3)::SetupPMP ->boot_service(u54_3)::SetupPMPComplete
Quoted 1 line
[5.419890] RunStateMachine(): boot_service(u54_4)::SetupPMP ->boot_service(u54_4)::SetupPMPComplete
Quoted 1 line
[23.955147] RunStateMachine(): boot_service(u54_1)::SetupPMPComplete ->boot_service(u54_1)::ZeroInit
Quoted 1 line
[23.955754] RunStateMachine(): boot_service(u54_2)::SetupPMPComplete ->boot_service(u54_2)::ZeroInit
Quoted 1 line
[23.956259] RunStateMachine(): boot_service(u54_3)::SetupPMPComplete ->boot_service(u54_3)::ZeroInit
Quoted 1 line
[23.956757] RunStateMachine(): boot_service(u54_4)::SetupPMPComplete ->boot_service(u54_4)::ZeroInit
Quoted 1 line
[23.957371] RunStateMachine(): boot_service(u54_1)::ZeroInit ->boot_service(u54_1)::Download
Quoted 1 line
[23.957876] RunStateMachine(): boot_service(u54_2)::ZeroInit ->boot_service(u54_2)::Download
Quoted 1 line
[23.958386] RunStateMachine(): boot_service(u54_3)::ZeroInit ->boot_service(u54_3)::Download
Quoted 1 line
[23.958856] RunStateMachine(): boot_service(u54_4)::ZeroInit ->boot_service(u54_4)::Download
Quoted 1 line
[23.960300] RunStateMachine(): boot_service(u54_2)::Download ->boot_service(u54_2)::Idle
Quoted 1 line
[23.960723] RunStateMachine(): boot_service(u54_3)::Download ->boot_service(u54_3)::Idle
Quoted 1 line
[23.961129] RunStateMachine(): boot_service(u54_4)::Download ->boot_service(u54_4)::Idle
Quoted 1 line
[23.983168] RunStateMachine(): boot_service(u54_1)::Download ->boot_service(u54_1)::Wait
Quoted 1 line
[23.983661] boot_download_chunks_onExit():boot_service(u54_1)::u54_2:sbi_init 80200000
Quoted 1 line
[23.984374] boot_download_chunks_onExit():boot_service(u54_1)::u54_3:sbi_init 80200000
Quoted 1 line
[23.985418] boot_download_chunks_onExit():boot_service(u54_1)::u54_4:sbi_init 80200000
Quoted 1 line
[23.986783] boot_download_chunks_onExit():boot_service(u54_1)::u54_1:sbi_init 80200000
Quoted 1 line
[23.989086] boot_wait_onEntry(): boot_service(u54_1)::Checking for IPIACKs: - -
Quoted 1 line
[23.992106] boot_wait_handler(): boot_service(u54_1)::Checking for IPIACKs: ACK/IDLE ACK
Quoted 1 line
[23.994062] RunStateMachine(): boot_service(u54_1)::Wait ->boot_service(u54_1)::Idle
Quoted 1 line
Based on the above log, HSS successfully boots U-Boot already. The U-Boot console is on the other serial console, which I guess you might turn it off?
Quoted 2 lines
One thing I overlooked in the document is that we are preparing the
*.wic file after downloading
Quoted 1 line
but passing the *.img in the qemu command. How to convert the wic to
img. I couldn't see much about
Quoted 1 line
this on the internet ?
The *.wic image is the raw image. Just use it as it is.
Quoted 1 line
Since U-boot currently does not boot, it seems passing the wic file
directly is not right. Now sure here.
Quoted 11 lines
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:serial1Are there other ways in qemu icicle machine supported now to pass the
u-boot and kernel?
Quoted 1 line
Yes, it has. The capability to direct boot kernel (can be U-Boot or an OS kernel) without HSS is currently in the Alistair's riscv-next tree and should land on qemu/master soon.
Regards,
Bin
I swapped the serial_hd() index between the MMUART0 and MMUART1 , so my default qemu console is the MMUART1.
I can see the U-Boot and Kernel logs now.
I still need both serial consoles for HSS and UBoot/Kernel and will need your help to make the original qemu command line work with unix\#serial1.sock.
I am unable to figure out what's wrong with unix\#serial1.sock
Quoted 187 lines · Rahul Pathak
Hi Bin,
Thanks for the response.
I think the issue currently is that if I keep the "wait=on" and launch minicom on "unix\#serial1.sock" then nothing happens.
Qemu keeps waiting for the connection on serial1 and no logs for uboot and Kernel appears on the serial1.Thanks
RahulQuoted 172 lines · Bin Meng
Hi Rahul,
Quoted 4 lines · Rahul Pathak
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.
This is the expected behavior if you pass an image to gdb before connecting to the target, as gdb will assume the debug contexts are the same, but it's not the case for PolarFire which has 1+4 hybrid configuration.
Quoted 1 line
what worked was to not pass anything and then connect the to target
then load the symbol file as hss.elf.
Quoted 1 line
I followed the steps from the "Attaching the GDB" doc and was able to
debug.
Quoted 1 line
Yes, that's the correct way to debug PolarFire.
Quoted 2 lines
For the qemu command line from the doc, I made the "wait=off" then qemu
was not waiting for another serial connection
Quoted 1 line
and launched the hss.
You need to connect to the other serial connection otherwise QEMU does not start the emulation when "wait=on"
Quoted 3 lines
The problem remains is that I still do not have the u-boot and linux
booting. The unix\#serial1.sock remains offline always.
Quoted 3 lines
These are the HSS logs -
[0.115001] HSS_E51_Banner(): PolarFire(R) SoC Hart Software Services(HSS) - version 0.99.15
Quoted 6 lines
(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:
811342a39f80176f9e2086bf963a83224b3d3a2eQuoted 2 lines
[0.117817] HSS_PrintToolVersions(): Built with the following tools: - riscv64-unknown-linux-gnu-gcc (GCC) 10.2.0Yeah, this log indicates that GCC 10.x works with HSS :)
Quoted 10 lines
- GNU ld (GNU Binutils) 2.36.1
[0.118760] HSS_MemTestDDRFast(): DDR size is 1 GiB [0.130270] HSS_MMCInit(): Attempting to select SDCARD ... PassedPress 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)...
Quoted 4 lines
[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) ...
Quoted 2 lines
[5.144118] GPT_ValidateHeader(): Validated GPT Header ... [5.153768] GPT_ValidatePartitionEntries(): Validated GPT PartitionEntries ...
Quoted 2 lines
[5.155210] copyBootImageToDDR_(): Copying 436008 bytes to 0xA0000000 [5.407848] copyBootImageToDDR_(): Calculated CRC32 of image in DDR is
795fbbeaQuoted 2 lines
[5.412058] HSS_BootInit(): boot image passed CRC [5.412407] HSS_BootInit(): Boot image set name:"PolarFire-SoC-HSS::U-Boot"
Quoted 3 lines
[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
Quoted 1 line
[5.414812] RunStateMachine(): boot_service(u54_2)::Init ->boot_service(u54_2)::SetupPMP
Quoted 1 line
[5.415207] RunStateMachine(): boot_service(u54_3)::Init ->boot_service(u54_3)::SetupPMP
Quoted 1 line
[5.415631] RunStateMachine(): boot_service(u54_4)::Init ->boot_service(u54_4)::SetupPMP
Quoted 1 line
[5.416107] RunStateMachine(): usbdmsc_service::init ->
usbdmsc_service::idleQuoted 1 line
[5.417164] RunStateMachine(): boot_service(u54_1)::SetupPMP ->boot_service(u54_1)::SetupPMPComplete
Quoted 1 line
[5.417887] RunStateMachine(): boot_service(u54_2)::SetupPMP ->boot_service(u54_2)::SetupPMPComplete
Quoted 1 line
[5.418552] RunStateMachine(): boot_service(u54_3)::SetupPMP ->boot_service(u54_3)::SetupPMPComplete
Quoted 1 line
[5.419890] RunStateMachine(): boot_service(u54_4)::SetupPMP ->boot_service(u54_4)::SetupPMPComplete
Quoted 1 line
[23.955147] RunStateMachine(): boot_service(u54_1)::SetupPMPComplete ->boot_service(u54_1)::ZeroInit
Quoted 1 line
[23.955754] RunStateMachine(): boot_service(u54_2)::SetupPMPComplete ->boot_service(u54_2)::ZeroInit
Quoted 1 line
[23.956259] RunStateMachine(): boot_service(u54_3)::SetupPMPComplete ->boot_service(u54_3)::ZeroInit
Quoted 1 line
[23.956757] RunStateMachine(): boot_service(u54_4)::SetupPMPComplete ->boot_service(u54_4)::ZeroInit
Quoted 1 line
[23.957371] RunStateMachine(): boot_service(u54_1)::ZeroInit ->boot_service(u54_1)::Download
Quoted 1 line
[23.957876] RunStateMachine(): boot_service(u54_2)::ZeroInit ->boot_service(u54_2)::Download
Quoted 1 line
[23.958386] RunStateMachine(): boot_service(u54_3)::ZeroInit ->boot_service(u54_3)::Download
Quoted 1 line
[23.958856] RunStateMachine(): boot_service(u54_4)::ZeroInit ->boot_service(u54_4)::Download
Quoted 1 line
[23.960300] RunStateMachine(): boot_service(u54_2)::Download ->boot_service(u54_2)::Idle
Quoted 1 line
[23.960723] RunStateMachine(): boot_service(u54_3)::Download ->boot_service(u54_3)::Idle
Quoted 1 line
[23.961129] RunStateMachine(): boot_service(u54_4)::Download ->boot_service(u54_4)::Idle
Quoted 1 line
[23.983168] RunStateMachine(): boot_service(u54_1)::Download ->boot_service(u54_1)::Wait
Quoted 1 line
[23.983661] boot_download_chunks_onExit():boot_service(u54_1)::u54_2:sbi_init 80200000
Quoted 1 line
[23.984374] boot_download_chunks_onExit():boot_service(u54_1)::u54_3:sbi_init 80200000
Quoted 1 line
[23.985418] boot_download_chunks_onExit():boot_service(u54_1)::u54_4:sbi_init 80200000
Quoted 1 line
[23.986783] boot_download_chunks_onExit():boot_service(u54_1)::u54_1:sbi_init 80200000
Quoted 1 line
[23.989086] boot_wait_onEntry(): boot_service(u54_1)::Checking for IPIACKs: - -
Quoted 1 line
[23.992106] boot_wait_handler(): boot_service(u54_1)::Checking for IPIACKs: ACK/IDLE ACK
Quoted 1 line
[23.994062] RunStateMachine(): boot_service(u54_1)::Wait ->boot_service(u54_1)::Idle
Quoted 1 line
Based on the above log, HSS successfully boots U-Boot already. The U-Boot console is on the other serial console, which I guess you might turn it off?
Quoted 2 lines
One thing I overlooked in the document is that we are preparing the
*.wic file after downloading
Quoted 1 line
but passing the *.img in the qemu command. How to convert the wic to
img. I couldn't see much about
Quoted 1 line
this on the internet ?
The *.wic image is the raw image. Just use it as it is.
Quoted 1 line
Since U-boot currently does not boot, it seems passing the wic file
directly is not right. Now sure here.
Quoted 11 lines
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:serial1Are there other ways in qemu icicle machine supported now to pass the
u-boot and kernel?
Quoted 1 line
Yes, it has. The capability to direct boot kernel (can be U-Boot or an OS kernel) without HSS is currently in the Alistair's riscv-next tree and should land on qemu/master soon.
Regards,
Bin
Quoted 8 lines · Rahul Pathak
I followed the same link. I will elaborate what is happening at my end -
First -
Used the same versions as per the doc. Built HSS 2020.12 and used core-image-minimal-dev-icicle-kit-es-sd-20201009141623.rootfs.wic. Upon executing the qemu launch command as per the doc, it's just waits for the connection on another serial console -info: QEMU waiting for connection on: disconnected:unix:serial1.sock,server=on
That seems like you are passing an argument to QEMU to expose a socket. You don't need to do that and can instead use stdio.
For the runqemu command in OE you can do that with runqemu nographic
Alistair
Quoted 48 lines
Even if I open sudo minicom -D unix\#serial1.sock, which remains offline always.
Second -
If I remove the "-chardev socket,id=serial1,path=serial1.sock,server=on,wait=on -serial chardev:serial1" from the qemu launch command then HSS boots but stops aftersbi_initon all the cores and put the cores in Idle -[5.443011] boot_download_chunks_onExit(): boot_service(u54_1)::u54_1:sbi_init 80200000 [5.444960] boot_wait_onEntry(): boot_service(u54_1)::Checking for IPI ACKs: - - [5.447962] boot_wait_handler(): boot_service(u54_1)::Checking for IPI ACKs: ACK/IDLE ACK [5.449343] RunStateMachine(): boot_service(u54_1)::Wait -> boot_service(u54_1)::IdleThird -
If I take the latest release of HSS 2021.04 and build with gcc10, it does not boot at all even if I remove the serial1 like in the second case.Thanks
RahulQuoted 28 lines · Bin Meng
Hi Rahul,
Quoted 4 lines · Rahul Pathak
Hi Bin,
I was reading a github issue which you raised for the issue with HSS because of GCC 10.1. Its pretty old and not sure what has changed so I thought to ask you over email for help.
The HSS issue of GCC 10.1 was already fixed in the HSS mainline.
Quoted 1 line
I myself is trying to make a setup to boot the microchip-icicle-kit Qemu machine with HSS and Yocto linux image. Currently it does not work.
Could you please elaborate which part does not work? Is that Linux, HSS, or U-Boot?
Quoted 3 lines
Do you know what is the right setup to make microchip-icicle-kit machine with HSS.bin and Yocto linux work on Qemu?. Probably there will be a working combination of HSS, Linux releases plus the toolchain version which makes this setup work.
I have not tried Yocto Linux yet with Microchip Icicle Kit on QEMU. I only tested the Linux images released by Microchip.
Could you please follow the instructions @
https://qemu.readthedocs.io/en/latest/system/riscv/microchip-icicle-kit.html
to see which step might be wrong on your side?Regards,
Bin