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

On Tue, Jun 1, 2021 at 7:39 PM Bin Meng <bmeng...@gmail.com> wrote:

> Hi Rahul,
>
> On Tue, Jun 1, 2021 at 11:12 AM Rahul Pathak <rpat...@ventanamicro.com>
> wrote:
> >
> > 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.
>
> > 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.
>
> >
> > 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"
>
> >
> >
> > 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
>
> Yeah, this log indicates that GCC 10.x works with HSS :)
>
> >  - 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
> >
>
> 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?
>
> >
> > 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.
>
> > 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?
> >
>
> 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
>

Reply via email to