Can't enable uart for Ubuntu SOS


ZhangShuai
 

Hello,
        We have a development board with i5-7300U and tried to install acrn sos. We generated the board and scenario xmls using ACRN Configuration Tool, builded the acrn Hypervisor with RELEASE=0. When boot into ubuntu-service-vm, the system got stuck with HDMI show "loading ACRN..."
        There is a serial port on the board, so we want to output the boot log. The setting of the uart is as fellows. The serial works ok when boot into the Ubuntu without acrn kernel(native boot?) ; but there is nothing output when boot into  ubuntu-service-vm.  Is this configuration correct? or should I do something else?

$ dmesg | grep tty
[   13.399735] dw-apb-uart.2: ttyS4 at MMIO 0xb151b000 (irq = 20, base_baud = 115200) is a 16550A
[   13.399769] printk: console [ttyS4] enabled

$ vi /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "ACRN Multiboot Ubuntu Service VM" --id ubuntu-service-vm {
  load_video
  insmod gzio
  insmod part_gpt
  insmod ext2

  search --no-floppy --fs-uuid --set 9efd748b-88fc-4082-b2f9-2e91b6e3dc07
  echo 'loading ACRN...'
  multiboot2 /boot/acrn/acrn.bin  root=PARTUUID="41d2eeec-fd7b-4479-9ae0-3a41845d25ff" uart=mmio@0xb151b000
  module2 /boot/bzImage Linux_bzImage
}


Best Regards
zhangshuai


------------------------- 
Xi'an R&D Center Computerized Numerical Control R&D Dept.  Shuai Zhang 
Tel : 029-84503040-8360 
E-mail :  zhangshuai@...     Web :  www.jingdiao.com


Victor Sun
 

Hi Shuai,

First of all, make sure your grub has below commit:

http://git.savannah.gnu.org/cgit/grub.git/commit/?id=0f3f5b7c13fa9b677a64cf11f20eca0f850a2b20 multiboot2: Set min address for mbi allocation to 0x1000

 

If the issue still occurs, please post your board file and scenario file.

 

BR,

Victor

 

From: acrn-users@... <acrn-users@...> On Behalf Of "西安研发中心-数控研发部-张帅
Sent: Thursday, February 4, 2021 10:26 AM
To: acrn-users@...
Subject: [acrn-users] Can't enable uart for Ubuntu SOS

 

Hello,
        We have a development board with i5-7300U and tried to install acrn sos. We generated the board and scenario xmls using ACRN Configuration Tool, builded the acrn Hypervisor with RELEASE=0. When boot into ubuntu-service-vm, the system got stuck with HDMI show "loading ACRN..."
        There is a serial port on the board, so we want to output the boot log. The setting of the uart is as fellows. The serial works ok when boot into the Ubuntu without acrn kernel(native boot?) ; but there is nothing output when boot into  ubuntu-service-vm.  Is this configuration correct? or should I do something else?

$ dmesg | grep tty
[   13.399735] dw-apb-uart.2: ttyS4 at MMIO 0xb151b000 (irq = 20, base_baud = 115200) is a 16550A
[   13.399769] printk: console [ttyS4] enabled

$ vi /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "ACRN Multiboot Ubuntu Service VM" --id ubuntu-service-vm {
  load_video
  insmod gzio
  insmod part_gpt
  insmod ext2

  search --no-floppy --fs-uuid --set 9efd748b-88fc-4082-b2f9-2e91b6e3dc07
  echo 'loading ACRN...'
  multiboot2 /boot/acrn/acrn.bin  root=PARTUUID="41d2eeec-fd7b-4479-9ae0-3a41845d25ff" uart=mmio@0xb151b000
  module2 /boot/bzImage Linux_bzImage
}


Best Regards
zhangshuai

 

------------------------- 
Xi'an R&D Center Computerized Numerical Control R&D Dept.  Shuai Zhang 
Tel : 029-84503040-8360 
E-mail :  zhangshuai@...     Web :  www.jingdiao.com


ligang@jingdiao.com
 

张帅:
        后面在一些开源项目里面提问,可以把大家都抄送上。


ligang@...

 
From: Victor Sun
Date: 2021-02-04 10:37
Subject: Re: [acrn-users] Can't enable uart for Ubuntu SOS

Hi Shuai,

First of all, make sure your grub has below commit:

http://git.savannah.gnu.org/cgit/grub.git/commit/?id=0f3f5b7c13fa9b677a64cf11f20eca0f850a2b20 multiboot2: Set min address for mbi allocation to 0x1000

 

If the issue still occurs, please post your board file and scenario file.

 

BR,

Victor

 

From: acrn-users@... <acrn-users@...> On Behalf Of "西安研发中心-数控研发部-张帅
Sent: Thursday, February 4, 2021 10:26 AM
To: acrn-users@...
Subject: [acrn-users] Can't enable uart for Ubuntu SOS

 

Hello,
        We have a development board with i5-7300U and tried to install acrn sos. We generated the board and scenario xmls using ACRN Configuration Tool, builded the acrn Hypervisor with RELEASE=0. When boot into ubuntu-service-vm, the system got stuck with HDMI show "loading ACRN..."
        There is a serial port on the board, so we want to output the boot log. The setting of the uart is as fellows. The serial works ok when boot into the Ubuntu without acrn kernel(native boot?) ; but there is nothing output when boot into  ubuntu-service-vm.  Is this configuration correct? or should I do something else?

$ dmesg | grep tty
[   13.399735] dw-apb-uart.2: ttyS4 at MMIO 0xb151b000 (irq = 20, base_baud = 115200) is a 16550A
[   13.399769] printk: console [ttyS4] enabled

$ vi /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "ACRN Multiboot Ubuntu Service VM" --id ubuntu-service-vm {
  load_video
  insmod gzio
  insmod part_gpt
  insmod ext2

  search --no-floppy --fs-uuid --set 9efd748b-88fc-4082-b2f9-2e91b6e3dc07
  echo 'loading ACRN...'
  multiboot2 /boot/acrn/acrn.bin  root=PARTUUID="41d2eeec-fd7b-4479-9ae0-3a41845d25ff" uart=mmio@0xb151b000
  module2 /boot/bzImage Linux_bzImage
}


Best Regards
zhangshuai

 

------------------------- 
Xi'an R&D Center Computerized Numerical Control R&D Dept.  Shuai Zhang 
Tel : 029-84503040-8360 
E-mail :  zhangshuai@...     Web :  www.jingdiao.com


ZhangShuai
 

Hi Victor,
        update the grub2.05 according to this https://projectacrn.github.io/latest/tutorials/using_grub.html?#installing-self-built-grub, copy the grubx64.efi to /boot/efi/EFI/ubuntu . But grub cannot boot ubuntu to startup. Is the file in the wrong place?


Thanks and Best Regards,
zhangshuai

--

Xi'an R&D Center Computerized Numerical Control R&D Dept. Shuai Zhang
Tel : 029-84503040-8360
E-mail :zhangshuai@jingdiao.com Web :www.jingdiao.com


Geoffroy Van Cutsem
 

Hi Zhangshuai,

What is your version of Ubuntu? I'm running Ubuntu 20.04 on a machine and did not have to update Grub to install ACRN.

This is the right location, do you see the Grub menu at all after updating the Grub binary? If not, can you get to the EFI shell and manually start it from there? Make sure you have secure boot turned off in your bios as well.

Back to your question about the UART, can you also try to use the bdf info instead, i.e.:
# lspci | grep UART
00:18.0 . Series HSUART Controller #1 (rev 0b)
00:18.1 . Series HSUART Controller #2 (rev 0b)

Which translates into uart=bdf@00:18.1 (if you want to use the second one for example).

One last thing, make sure you have flow control (HW and SW) turned off in your serial port program (e.g. minicom).

Geoffroy

-----Original Message-----
From: acrn-users@lists.projectacrn.org <acrn-users@lists.projectacrn.org>
On Behalf Of "??????-?????-??
Sent: Thursday, February 4, 2021 10:27 AM
To: acrn-users@lists.projectacrn.org
Cc: ligang@jingdiao.com; wumengkui@jingdiao.com; lijia@jingdiao.com;
hujunke@jingdiao.com; hudongjiang@jingdiao.com
Subject: Re: [acrn-users] Can't enable uart for Ubuntu SOS

Hi Victor,
        update the grub2.05 according to this
https://projectacrn.github.io/latest/tutorials/using_grub.html?#installing-
self-built-grub,
copy the grubx64.efi to /boot/efi/EFI/ubuntu . But grub cannot boot ubuntu
to startup. Is the file in the wrong place?


Thanks and Best Regards,
zhangshuai

--

Xi'an R&D Center Computerized Numerical Control R&D Dept. Shuai Zhang
Tel : 029-84503040-8360
E-mail :zhangshuai@jingdiao.com Web :www.jingdiao.com





Victor Sun
 

hi Shuai,

If you follows https://projectacrn.github.io/latest/tutorials/using_grub.html?#installing-self-built-grub

then you should not replace grubx64.efi to /boot/efi/EFI/ubuntu since grub-mkimge -p parameter is incorrect. Ubuntu GRUB is built with its own build script and parameters.

please put efi application to your "-p" specified folder, (maybe you can try "grub-mkimage -p /EFI/grub ..." to replace your Ubuntu grub efi but I am not sure it can work, depends on your ubuntu version.)


BR,

Victor

On 2/4/2021 5:27 PM, "西安研发中心-数控研发部-张帅 wrote:
Hi Victor,
        update the grub2.05 according to this https://projectacrn.github.io/latest/tutorials/using_grub.html?#installing-self-built-grub, copy the grubx64.efi to /boot/efi/EFI/ubuntu . But grub cannot boot ubuntu to startup. Is the file in the wrong place?


Thanks and Best Regards,
zhangshuai


Liu, Fuzhong
 

Hi zhangshuai

Could you please try "make install" instead of copy the grubx64.efi?

It works for my setup:
root@acrn-OptiPlex-9010:/home/acrn/work/grub-2.04# make install
root@acrn-OptiPlex-9010:/home/acrn/work/grub-2.04# grub-install -V
grub-install (GRUB) 2.02-2ubuntu8.17
root@acrn-OptiPlex-9010:/home/acrn/work/grub-2.04# reboot
root@acrn-OptiPlex-9010:/home/acrn# grub-install -V
grub-install (GRUB) 2.04


BR.
Fuzhong

-----Original Message-----
From: acrn-users@lists.projectacrn.org <acrn-users@lists.projectacrn.org> On Behalf Of "??????-?????-??
Sent: Thursday, February 4, 2021 5:27 PM
To: acrn-users@lists.projectacrn.org
Cc: ligang@jingdiao.com; wumengkui@jingdiao.com; lijia@jingdiao.com; hujunke@jingdiao.com; hudongjiang@jingdiao.com
Subject: Re: [acrn-users] Can't enable uart for Ubuntu SOS

Hi Victor,
        update the grub2.05 according to this https://projectacrn.github.io/latest/tutorials/using_grub.html?#installing-self-built-grub,
copy the grubx64.efi to /boot/efi/EFI/ubuntu . But grub cannot boot ubuntu to startup. Is the file in the wrong place?


Thanks and Best Regards,
zhangshuai

--

Xi'an R&D Center Computerized Numerical Control R&D Dept. Shuai Zhang Tel : 029-84503040-8360
E-mail :zhangshuai@jingdiao.com Web :www.jingdiao.com