All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chan Kim" <ckim@etri.re.kr>
To: "U-Boot Mailing List" <u-boot@lists.denx.de>,
	<qemu-discuss@nongnu.org>, <kernelnewbies@kernelnewbies.org>
Subject: Running u-boot and linux on qemu arm64 virt machine, linux shell does not respond..
Date: Fri, 2 Jun 2023 18:28:10 +0900	[thread overview]
Message-ID: <02f001d99534$8c164cd0$a442e670$@etri.re.kr> (raw)

Hello all,

 

I'm trying to run u-boot and linux on qemu arm64 virt machine preferably
without changing any source code.

(u-boot v2022.07, linux 5.15.68, qemu 6.2.0, busybox 1.32.1)

I have built u-boot using qemu_arm64_defconfig and I got u-boot(elf) and
u-boot.bin.

I built linux using defconfig but later I removed many CONFIG_* to reduce
compile time and got Image(binary).

Also, I built busybox and made ramdisk.

 

Now this is the qemu command I used. 

(I referenced u-boot's include/configs/qemu-arm.h to determine the load
addresses, set CONFIG_BOOTCOMMAND=" booti 0x40400000 0x44000000 0x40000000")

 

../temp/qemu-6.2.0/build/aarch64-softmmu/qemu-system-aarch64 -machine
virt,gic-version=max,secure=on,virtualization=true -cpu max -m 4G -nographic
-bios u-boot/u-boot.bin -device
loader,file=../temp/linux-5.15.68/arch/arm64/boot/Image,addr=0x40400000
-device loader,file=initrd.img,addr=0x44000000

 

u-boot runs and automatically boots linunx and it boots OK to the shell
prompt.

But at the linux shell prompt, it doesn't respond to my keyboard input.

It looks like the symptom I saw last year when system counter is not
working(for real board only).

(I added system counter device in our qemu virtual machine just to not cause
panic during the system counter access with the same driver. The qemu
machine for our board runs ok using u-boot-spl and linux after booting
including shell program and simple driver test. I'm trying to use u-boot
proper now).

 

Also last year I had to power-on the GICR(for virtual machine and real
board).

So I tried adding the code to power up GICR but it is the same. (this part
is missing in u-boot, but I saw it is in the arm-tf S/W).

For your reference this is the change in u-boot's arch/arm/lib/gic_64.S.

 

/* x9: ReDistributor Base Address of Current CPU */

2:  mov w10, #~0x2

    ldr w11, [x9, GICR_WAKER]

    and w11, w11, w10       /* Clear ProcessorSleep */

    str w11, [x9, GICR_WAKER]

    dsb st

    isb

==>

/* x9: ReDistributor Base Address of Current CPU */

2:  // gicr power on, ckim

    mov w10, 2

    str w10, [x9, GICR_PWRR]

5:  ldr w10, [x9, GICR_PWRR]

    tbnz    w10, #1, 5b     /* Wait Children be Alive */

    mov w10, #~0x2

    ldr w11, [x9, GICR_WAKER]

    and w11, w11, w10       /* Clear ProcessorSleep */

    str w11, [x9, GICR_WAKER]

    dsb st

    isb

 

Can anyone suggest what I can try to solve this problem? (I mean, the
problem of linux shell not responding in qemu virtual machine)

I would appreciate it for any comment or help.

 

Thank you.

Chan Kim

 


WARNING: multiple messages have this Message-ID (diff)
From: "Chan Kim" <ckim@etri.re.kr>
To: "U-Boot Mailing List" <u-boot@lists.denx.de>,
	<qemu-discuss@nongnu.org>, <kernelnewbies@kernelnewbies.org>
Subject: Running u-boot and linux on qemu arm64 virt machine, linux shell does not respond..
Date: Fri, 2 Jun 2023 18:28:10 +0900	[thread overview]
Message-ID: <02f001d99534$8c164cd0$a442e670$@etri.re.kr> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2577 bytes --]

Hello all,

 

I'm trying to run u-boot and linux on qemu arm64 virt machine preferably
without changing any source code.

(u-boot v2022.07, linux 5.15.68, qemu 6.2.0, busybox 1.32.1)

I have built u-boot using qemu_arm64_defconfig and I got u-boot(elf) and
u-boot.bin.

I built linux using defconfig but later I removed many CONFIG_* to reduce
compile time and got Image(binary).

Also, I built busybox and made ramdisk.

 

Now this is the qemu command I used. 

(I referenced u-boot's include/configs/qemu-arm.h to determine the load
addresses, set CONFIG_BOOTCOMMAND=" booti 0x40400000 0x44000000 0x40000000")

 

../temp/qemu-6.2.0/build/aarch64-softmmu/qemu-system-aarch64 -machine
virt,gic-version=max,secure=on,virtualization=true -cpu max -m 4G -nographic
-bios u-boot/u-boot.bin -device
loader,file=../temp/linux-5.15.68/arch/arm64/boot/Image,addr=0x40400000
-device loader,file=initrd.img,addr=0x44000000

 

u-boot runs and automatically boots linunx and it boots OK to the shell
prompt.

But at the linux shell prompt, it doesn't respond to my keyboard input.

It looks like the symptom I saw last year when system counter is not
working(for real board only).

(I added system counter device in our qemu virtual machine just to not cause
panic during the system counter access with the same driver. The qemu
machine for our board runs ok using u-boot-spl and linux after booting
including shell program and simple driver test. I'm trying to use u-boot
proper now).

 

Also last year I had to power-on the GICR(for virtual machine and real
board).

So I tried adding the code to power up GICR but it is the same. (this part
is missing in u-boot, but I saw it is in the arm-tf S/W).

For your reference this is the change in u-boot's arch/arm/lib/gic_64.S.

 

/* x9: ReDistributor Base Address of Current CPU */

2:  mov w10, #~0x2

    ldr w11, [x9, GICR_WAKER]

    and w11, w11, w10       /* Clear ProcessorSleep */

    str w11, [x9, GICR_WAKER]

    dsb st

    isb

==>

/* x9: ReDistributor Base Address of Current CPU */

2:  // gicr power on, ckim

    mov w10, 2

    str w10, [x9, GICR_PWRR]

5:  ldr w10, [x9, GICR_PWRR]

    tbnz    w10, #1, 5b     /* Wait Children be Alive */

    mov w10, #~0x2

    ldr w11, [x9, GICR_WAKER]

    and w11, w11, w10       /* Clear ProcessorSleep */

    str w11, [x9, GICR_WAKER]

    dsb st

    isb

 

Can anyone suggest what I can try to solve this problem? (I mean, the
problem of linux shell not responding in qemu virtual machine)

I would appreciate it for any comment or help.

 

Thank you.

Chan Kim

 


[-- Attachment #1.2: Type: text/html, Size: 8990 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

             reply	other threads:[~2023-06-02  9:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02  9:28 Chan Kim [this message]
2023-06-02  9:28 ` Running u-boot and linux on qemu arm64 virt machine, linux shell does not respond Chan Kim

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='02f001d99534$8c164cd0$a442e670$@etri.re.kr' \
    --to=ckim@etri.re.kr \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=qemu-discuss@nongnu.org \
    --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 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.