Re: pinebook pro video console not active

From: Jesper Schmitz Mouridsen <jsm_at_FreeBSD.org>
Date: Sun, 30 Jan 2022 20:58:04 UTC

On 26.01.2022 12.35, Jesper Schmitz Mouridsen wrote:
> Hi
> 
> On 26.01.2022 11.54, Emmanuel Vadot wrote:
>> On Wed, 26 Jan 2022 00:44:33 +0100
>> Jesper Schmitz Mouridsen <jsm@FreeBSD.org> wrote:
>>
>>> Hi
>>>
>>> On Pinebook Pro 14-current with console="efi,comconsole" in
>>> /boot/loader.conf
>>> vidcontrol -i active < /dev/console is not working because serial stays
>>> primary. Reverting 123b5b8763778e83b6816ad9db62a9b956055c32 fixes that
>>> for me. Can someone share some light on why that is?
>>   You also need boot_multicons=YES in loader.conf for this to work (at
>> least on amd64).
>>   Maybe imp@ knows more about this behavior.
>>
> Yes I have that set as well, my loader.conf is
> 
> hw.regulator.disable_unused="0"
> boot_multicons="YES"
> console="efi,comconsole"
> beastie_disable="NO"
> loader_color="YES"
> ums_load=YES
> 
>>> console kit relies on /dev/console beeing active so it is an annoying
>>> bug..
>>> the original review is here https://reviews.freebsd.org/D32992
>>>
>>>
>>> Thanks
>>> /jsm
>>>
>>
> 
A little more information, with above with with frame_style ascii and 
123b5b8763778e83b6816ad9db62a9b956055c32 reverted, I see both on efi and 
audio jack serial printing "console comconsole failed to initialize."
 From line 268..

     263                         if (active != 0) {
     264                                 /*
     265                                  * If no consoles have 
initialised we
     266                                  * wouldn't see this.
     267                                  */
     268                                 printf("console %s failed to 
initialize\n",
     269                                     consoles[cons]->c_name);
     270                         }



in efi/loader/efiserialio.c line 489 comc_port->sio is NULL in my 
testing. My u-boot is from freebsd ports unmodified.

I have not read all the code but could it be an explanation that 
comconsole fails and falls back to efi, but that serial is actually 
initial primary despite the setting console="efi,comconsole"...?

when reverted the commit does set comconsole as console... Just thinking 
out loud, not sure it makes sense...

efiserialio.c:

comc_setup(void)
{
         EFI_STATUS status;
         UINT32 control;

         /* port is not usable */
         if (comc_port->sio == NULL

Thanks
/jsm