All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 06/11] efi_loader: Decouple EFI input/output from stdin/stdout
Date: Thu, 12 Oct 2017 18:25:03 +0200	[thread overview]
Message-ID: <265D0A19-C602-4857-BA37-9E8D4C0C06E5@suse.de> (raw)
In-Reply-To: <68d93c60d41a42ed@bloch.sibelius.xs4all.nl>



Am 12.10.2017 um 18:00 schrieb Mark Kettenis <mark.kettenis@xs4all.nl>:

>> From: Rob Clark <robdclark@gmail.com>
>> Date: Thu, 12 Oct 2017 10:28:43 -0400
>> 
>>> On Thu, Oct 12, 2017 at 9:50 AM, Alexander Graf <agraf@suse.de> wrote:
>>>> On 10/12/2017 03:40 PM, Rob Clark wrote:
>>>> 
>>>> On Thu, Oct 12, 2017 at 9:05 AM, Heinrich Schuchardt <xypron.glpk@gmx.de>
>>>> wrote:
>>>>> 
>>>>> 
>>>>>> On 10/12/2017 02:48 PM, Rob Clark wrote:
>>>>>> 
>>>>>>> On Thu, Oct 12, 2017 at 3:15 AM, Alexander Graf <agraf@suse.de> wrote:
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>> On 12.10.17 00:07, Rob Clark wrote:
>>>>>>>> 
>>>>>>>> On Wed, Oct 11, 2017 at 10:45 AM, Alexander Graf <agraf@suse.de>
>>>>>>>> wrote:
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>> On 10.10.17 14:23, Rob Clark wrote:
>>>>>>>>>> 
>>>>>>>>>> In some cases, it is quite useful to have (for example) EFI on
>>>>>>>>>> screen
>>>>>>>>>> but u-boot on serial port.
>>>>>>>>>> 
>>>>>>>>>> This adds two new optional environment variables, "efiin" and
>>>>>>>>>> "efiout",
>>>>>>>>>> which can be used to set EFI console input/output independently of
>>>>>>>>>> u-boot's input/output.  If unset, EFI console will default to stdin/
>>>>>>>>>> stdout as before.
>>>>>>>>>> 
>>>>>>>>>> Signed-off-by: Rob Clark <robdclark@gmail.com>
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> With this patch, we lose the ability to have the efi in/out go to
>>>>>>>>> both
>>>>>>>>> graphical and serial console, right? This is critical functionality
>>>>>>>>> to
>>>>>>>>> have, since we don't necessarily know which output/input a user ends
>>>>>>>>> up
>>>>>>>>> using.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> I'll think about how to support iomux.. but some things like console
>>>>>>>> size are just not going to work properly there.  And as long as we fix
>>>>>>> 
>>>>>>> 
>>>>>>> Yeah, those probably would need to get special cased.
>>>>>>> 
>>>>>>>> the stdout shenanigans (ie. what I was seeing w/ qemu-x86) you can
>>>>>>>> simply not set efiout var and have things working as before, so you
>>>>>>>> don't loose any existing functionality (although, like I said, if the
>>>>>>>> two different consoles have different sizes things aren't going to
>>>>>>>> work properly for anything other than simple cases).
>>>>>>>> 
>>>>>>>> In most cases, the display driver should be able to detect whether a
>>>>>>>> display is connected.. this is what I've done on dragonboard410c, so
>>>>>>>> if no display plugged in, 'efiout=vidconsole' fails and you fall back
>>>>>>>> to serial, else you get efi on screen like you would on a "real"
>>>>>>>> computer.  For boards that have a display driver that isn't able to do
>>>>>>>> the basic check of whether a cable is plugged in, just don't set
>>>>>>>> "efiout" (or fix the display driver) ;-)
>>>>>>> 
>>>>>>> 
>>>>>>> Are you sure that's what happens on a "real" computer? As far as I
>>>>>>> remember from all ARM servers running edk2 based firmware that I've
>>>>>>> touched so far, the default is always to display on serial *and*
>>>>>>> graphical output at the same time.
>>>>>> 
>>>>>> 
>>>>>> Well, I suppose some of the arm64 server vendors have done a better
>>>>>> job than others on firmware.. you'd hope they would probe EDID, and
>>>>>> report correct console dimensions based on display resolution, etc.
>>>>>> 
>>>>>> Doing both serial and display works for simple stuff, but it goes
>>>>>> badly once the efi payload starts trying to change the cursor position
>>>>>> and write to specific parts of the screen (which both Shell.efi and
>>>>>> grub try to do).
>>>>>> 
>>>>>> BR,
>>>>>> -R
>>>>>> 
>>>>> Hello Rob,
>>>>> 
>>>>> I do not know which program you use for connecting to your serial
>>>>> console. I
>>>>> use minicom which is a Debian/Ubuntu package. I had no problem using
>>>>> grub,
>>>>> vim, nano or any other console program.
>>>>> 
>>>>> Minicom just provides a VT100 emulation and that is close enough to what
>>>>> Linux expects.
>>>> 
>>>> fwiw, I generally use kermit so my terminal emulator is whatever
>>>> "xterm" type app I'm using.  (Currently a big fan of Tilix).. but that
>>>> isn't so much the issue..
>>>> 
>>>>> So I would not see what should be so special about Shell.efi.
>>>> 
>>>> I'm not explaining the problem well, but you can see basically the
>>>> same issue if you resize your terminal emulator to something smaller
>>>> than what grub/shell/etc think you are using.
>>>> 
>>>> I guess if they just fall back to assuming 80x25 like agraf mentioned,
>>>> that would kind of work.  It just means shell or grub will only use
>>>> the tiny upper-left corner of your monitor.
>>>> 
>>>>> My U-Boot system all have video but I never have a monitor connected.
>>>>> 
>>>>> So being able to use serial even if video is available is a necessity.
>>>> 
>>>> If the video driver doesn't detect that it is unconnected, someone
>>>> should really fix that, otherwise you'll have problems booting an
>>>> image where grub tries to use gfxterm if GOP is present (but we are
>>>> really getting off topic here)
>>>> 
>>>> Either way, you still have the option of not setting efiout (or
>>>> setting it to serial)
>>>> 
>>>> But for end users (at least of boards that I care about), if they plug
>>>> in a monitor they should get grub on screen.  Not everyone has a
>>>> serial cable attached.
>>> 
>>> 
>>> I fully agree there. The same applies the other way around too. Even if they
>>> have a monitor attached, they should get grub on serial if serial is a valid
>>> output :). Just attaching a monitor doesn't mean you only use that monitor
>>> to control the system.
>> 
>> We could, I suppose, try probing the serial console's size, as an
>> approximation of hotplug detect for serial.  If we timeout without
>> getting a response, assume no serial console.
> 
> By spitting out random control characters and hope they match the
> terminal emulation on the other end?  Sounds like a bad idea to me to
> do that by default.

We actually do exactly that today already :).

> 
> Or would you only do it for EFI payload that uses more than just the
> EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL?  That might be acceptable.

Simply only to the first call that wants to know the screen size ;)

Alex

> 
> 

  reply	other threads:[~2017-10-12 16:25 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 12:22 [U-Boot] [PATCH 00/11] efi_loader: patches for Shell.efi Rob Clark
2017-10-10 12:22 ` [U-Boot] [PATCH 01/11] efi_loader: Initial EFI_DEVICE_PATH_UTILITIES_PROTOCOL Rob Clark
2017-10-11  0:03   ` Heinrich Schuchardt
2017-10-11 14:07   ` Alexander Graf
2017-10-11 20:32     ` Rob Clark
2017-10-12  6:51       ` Heinrich Schuchardt
2017-10-10 12:22 ` [U-Boot] [PATCH 02/11] efi_loader: Initial HII protocols Rob Clark
2017-10-11 14:30   ` Alexander Graf
2017-10-11 22:02     ` Rob Clark
2017-10-12  7:13       ` Alexander Graf
2017-10-12  9:55         ` Rob Clark
2017-10-12  9:59           ` Alexander Graf
2018-09-22 10:34   ` Heinrich Schuchardt
2018-09-23 10:11     ` Alexander Graf
2018-10-03  7:39       ` AKASHI, Takahiro
2018-10-05  8:52         ` AKASHI, Takahiro
2018-10-05  9:49           ` Leif Lindholm
2018-10-05 13:06             ` Alexander Graf
2018-10-09  7:24               ` AKASHI, Takahiro
2018-10-09 17:19                 ` Heinrich Schuchardt
2018-10-10  0:54                   ` AKASHI, Takahiro
2018-10-05 16:24             ` Heinrich Schuchardt
2017-10-10 12:22 ` [U-Boot] [PATCH 03/11] efi_loader: Initial EFI_UNICODE_COLLATION_PROTOCOL Rob Clark
2017-10-11 14:36   ` Alexander Graf
2017-10-11 20:30     ` Rob Clark
2017-10-11 20:47       ` Alexander Graf
2017-10-12 11:54         ` Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 04/11] efi_loader: SIMPLE_TEXT_INPUT_EX plus wire up objects properly Rob Clark
2017-10-11 14:39   ` Alexander Graf
2018-09-04 14:07   ` [U-Boot] [U-Boot, " Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 05/11] efi_loader: console support for color attributes Rob Clark
2017-10-10 23:41   ` Heinrich Schuchardt
2017-10-11 14:41   ` Alexander Graf
2017-10-12 15:24   ` [U-Boot] [U-Boot, " Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 06/11] efi_loader: Decouple EFI input/output from stdin/stdout Rob Clark
2017-10-11 14:45   ` Alexander Graf
2017-10-11 22:07     ` Rob Clark
2017-10-12  7:15       ` Alexander Graf
2017-10-12 12:48         ` Rob Clark
2017-10-12 13:05           ` Heinrich Schuchardt
2017-10-12 13:40             ` Rob Clark
2017-10-12 13:50               ` Alexander Graf
2017-10-12 14:28                 ` Rob Clark
2017-10-12 14:31                   ` Alexander Graf
2017-10-12 16:00                   ` Mark Kettenis
2017-10-12 16:25                     ` Alexander Graf [this message]
2017-10-12 22:38                   ` Heinrich Schuchardt
2017-10-12 21:26                     ` Rob Clark
2017-10-12 23:48                       ` Heinrich Schuchardt
2017-10-13  0:41                         ` Rob Clark
2017-10-12 13:11           ` Alexander Graf
2017-10-12 13:42             ` Rob Clark
2017-10-12 13:44           ` Mark Kettenis
2017-10-12 14:24             ` Rob Clark
2017-10-10 12:23 ` [U-Boot] [PATCH 07/11] efi_loader: fix events Rob Clark
2017-10-10 22:40   ` Heinrich Schuchardt
2017-10-11 14:49   ` Alexander Graf
2017-10-11 22:09     ` Rob Clark
2017-10-13  5:24   ` Heinrich Schuchardt
2017-10-13 14:08     ` Rob Clark
2017-10-10 12:23 ` [U-Boot] [PATCH 08/11] efi_loader: implement SetWatchdogTimer Rob Clark
2017-10-11 14:55   ` Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 09/11] efi_loader: Fix disk dp's for pre-DM/legacy devices Rob Clark
2017-10-11 14:56   ` Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 10/11] efi_loader: Add mem-mapped for fallback Rob Clark
2017-10-10 22:31   ` Heinrich Schuchardt
2017-10-11 14:59   ` Alexander Graf
2017-10-11 22:14     ` Rob Clark
2017-10-12 15:24   ` [U-Boot] [U-Boot, " Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 11/11] efi_loader: exclude openrd devices Rob Clark
2017-10-10 22:28   ` Heinrich Schuchardt
2017-10-10 22:50     ` Rob Clark
2017-10-11  7:07       ` Stefan Roese
2017-10-11  7:22         ` Alexander Graf
2017-10-11  0:24 ` [U-Boot] [PATCH 00/11] efi_loader: patches for Shell.efi Heinrich Schuchardt

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=265D0A19-C602-4857-BA37-9E8D4C0C06E5@suse.de \
    --to=agraf@suse.de \
    --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.