All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] efi_loader: allow to disable GOP support
@ 2021-06-15 21:10 Icenowy Zheng
  2021-06-16  4:59 ` Heinrich Schuchardt
  0 siblings, 1 reply; 10+ messages in thread
From: Icenowy Zheng @ 2021-06-15 21:10 UTC (permalink / raw)
  To: Heinrich Schuchardt, Alexander Graf; +Cc: u-boot, Icenowy Zheng

Sometimes EFI GOP support may be not wanted (e.g. because the operating
system cannot operate well with it) even if video support in U-Boot is
needed.

Allow to disable EFI GOP support with a Kconfig option.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 lib/efi_loader/Kconfig     |  8 ++++++++
 lib/efi_loader/Makefile    |  3 +--
 lib/efi_loader/efi_setup.c | 11 ++++++-----
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index 6242caceb7..5ba0ce6a44 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -282,6 +282,14 @@ config EFI_HAVE_RUNTIME_RESET
 	depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || \
 		   SANDBOX || SYSRESET_X86
 
+config EFI_GOP_PROTOCOL
+	bool "EFI_GOP_PROTOCOL support"
+	default y
+	depends on DM_VIDEO || LCD
+	help
+	  Provide a EFI_GOP_PROTOCOL implementation using the graphics
+	  hardware initialized by U-Boot.
+
 config EFI_GRUB_ARM32_WORKAROUND
 	bool "Workaround for GRUB on 32bit ARM"
 	default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU
diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index fd344cea29..826563d9a7 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -54,8 +54,7 @@ obj-$(CONFIG_EFI_VARIABLES_PRESEED) += efi_var_seed.o
 endif
 obj-y += efi_watchdog.o
 obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
-obj-$(CONFIG_LCD) += efi_gop.o
-obj-$(CONFIG_DM_VIDEO) += efi_gop.o
+obj-$(CONFIG_EFI_GOP_PROTOCOL) += efi_gop.o
 obj-$(CONFIG_PARTITIONS) += efi_disk.o
 obj-$(CONFIG_NET) += efi_net.o
 obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index 3c5cf9a435..98deb63777 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -254,11 +254,12 @@ efi_status_t efi_init_obj_list(void)
 	if (ret != EFI_SUCCESS)
 		goto out;
 
-#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
-	ret = efi_gop_register();
-	if (ret != EFI_SUCCESS)
-		goto out;
-#endif
+	if (IS_ENABLED(CONFIG_EFI_GOP_PROTOCOL)) {
+		ret = efi_gop_register();
+		if (ret != EFI_SUCCESS)
+			goto out;
+	}
+
 #ifdef CONFIG_NET
 	ret = efi_net_register();
 	if (ret != EFI_SUCCESS)
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] efi_loader: allow to disable GOP support
  2021-06-15 21:10 [PATCH] efi_loader: allow to disable GOP support Icenowy Zheng
@ 2021-06-16  4:59 ` Heinrich Schuchardt
  2021-06-16 12:19   ` Icenowy Zheng
  0 siblings, 1 reply; 10+ messages in thread
From: Heinrich Schuchardt @ 2021-06-16  4:59 UTC (permalink / raw)
  To: Icenowy Zheng, Alexander Graf; +Cc: u-boot

Am 15. Juni 2021 23:10:28 MESZ schrieb Icenowy Zheng <icenowy@aosc.io>:
>Sometimes EFI GOP support may be not wanted (e.g. because the operating
>system cannot operate well with it) even if video support in U-Boot is
>needed.

Which OS has which problem?
Why don't you fix the OS?

Best regards

Heinrich


>
>Allow to disable EFI GOP support with a Kconfig option.
>
>Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>---
> lib/efi_loader/Kconfig     |  8 ++++++++
> lib/efi_loader/Makefile    |  3 +--
> lib/efi_loader/efi_setup.c | 11 ++++++-----
> 3 files changed, 15 insertions(+), 7 deletions(-)
>
>diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
>index 6242caceb7..5ba0ce6a44 100644
>--- a/lib/efi_loader/Kconfig
>+++ b/lib/efi_loader/Kconfig
>@@ -282,6 +282,14 @@ config EFI_HAVE_RUNTIME_RESET
> 	depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || \
> 		   SANDBOX || SYSRESET_X86
> 
>+config EFI_GOP_PROTOCOL
>+	bool "EFI_GOP_PROTOCOL support"
>+	default y
>+	depends on DM_VIDEO || LCD
>+	help
>+	  Provide a EFI_GOP_PROTOCOL implementation using the graphics
>+	  hardware initialized by U-Boot.
>+
> config EFI_GRUB_ARM32_WORKAROUND
> 	bool "Workaround for GRUB on 32bit ARM"
> 	default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU
>diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
>index fd344cea29..826563d9a7 100644
>--- a/lib/efi_loader/Makefile
>+++ b/lib/efi_loader/Makefile
>@@ -54,8 +54,7 @@ obj-$(CONFIG_EFI_VARIABLES_PRESEED) += efi_var_seed.o
> endif
> obj-y += efi_watchdog.o
> obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
>-obj-$(CONFIG_LCD) += efi_gop.o
>-obj-$(CONFIG_DM_VIDEO) += efi_gop.o
>+obj-$(CONFIG_EFI_GOP_PROTOCOL) += efi_gop.o
> obj-$(CONFIG_PARTITIONS) += efi_disk.o
> obj-$(CONFIG_NET) += efi_net.o
> obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
>diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
>index 3c5cf9a435..98deb63777 100644
>--- a/lib/efi_loader/efi_setup.c
>+++ b/lib/efi_loader/efi_setup.c
>@@ -254,11 +254,12 @@ efi_status_t efi_init_obj_list(void)
> 	if (ret != EFI_SUCCESS)
> 		goto out;
> 
>-#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
>-	ret = efi_gop_register();
>-	if (ret != EFI_SUCCESS)
>-		goto out;
>-#endif
>+	if (IS_ENABLED(CONFIG_EFI_GOP_PROTOCOL)) {
>+		ret = efi_gop_register();
>+		if (ret != EFI_SUCCESS)
>+			goto out;
>+	}
>+
> #ifdef CONFIG_NET
> 	ret = efi_net_register();
> 	if (ret != EFI_SUCCESS)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] efi_loader: allow to disable GOP support
  2021-06-16  4:59 ` Heinrich Schuchardt
@ 2021-06-16 12:19   ` Icenowy Zheng
  2021-06-16 13:20     ` Heinrich Schuchardt
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Icenowy Zheng @ 2021-06-16 12:19 UTC (permalink / raw)
  To: Heinrich Schuchardt, Alexander Graf; +Cc: u-boot

在 2021-06-16星期三的 06:59 +0200,Heinrich Schuchardt写道:
> Am 15. Juni 2021 23:10:28 MESZ schrieb Icenowy Zheng
> <icenowy@aosc.io>:
> > Sometimes EFI GOP support may be not wanted (e.g. because the
> > operating
> > system cannot operate well with it) even if video support in U-Boot
> > is
> > needed.
> 
> Which OS has which problem?
> Why don't you fix the OS?

I'm trying RK3399 with Linux. EFIFB never works as intended (maybe it's
because IOMMU is reconfigured), and rockchipdrmfb will be fb1 (leave
non-working EFIFB as fb0), makes fbcon unusable.

The second problem has a proposed fix, but the first problem is
mystery.

> 
> Best regards
> 
> Heinrich
> 
> 
> > 
> > Allow to disable EFI GOP support with a Kconfig option.
> > 
> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > ---
> > lib/efi_loader/Kconfig     |  8 ++++++++
> > lib/efi_loader/Makefile    |  3 +--
> > lib/efi_loader/efi_setup.c | 11 ++++++-----
> > 3 files changed, 15 insertions(+), 7 deletions(-)
> > 
> > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> > index 6242caceb7..5ba0ce6a44 100644
> > --- a/lib/efi_loader/Kconfig
> > +++ b/lib/efi_loader/Kconfig
> > @@ -282,6 +282,14 @@ config EFI_HAVE_RUNTIME_RESET
> >         depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET ||
> > \
> >                    SANDBOX || SYSRESET_X86
> > 
> > +config EFI_GOP_PROTOCOL
> > +       bool "EFI_GOP_PROTOCOL support"
> > +       default y
> > +       depends on DM_VIDEO || LCD
> > +       help
> > +         Provide a EFI_GOP_PROTOCOL implementation using the
> > graphics
> > +         hardware initialized by U-Boot.
> > +
> > config EFI_GRUB_ARM32_WORKAROUND
> >         bool "Workaround for GRUB on 32bit ARM"
> >         default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU
> > diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
> > index fd344cea29..826563d9a7 100644
> > --- a/lib/efi_loader/Makefile
> > +++ b/lib/efi_loader/Makefile
> > @@ -54,8 +54,7 @@ obj-$(CONFIG_EFI_VARIABLES_PRESEED) +=
> > efi_var_seed.o
> > endif
> > obj-y += efi_watchdog.o
> > obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
> > -obj-$(CONFIG_LCD) += efi_gop.o
> > -obj-$(CONFIG_DM_VIDEO) += efi_gop.o
> > +obj-$(CONFIG_EFI_GOP_PROTOCOL) += efi_gop.o
> > obj-$(CONFIG_PARTITIONS) += efi_disk.o
> > obj-$(CONFIG_NET) += efi_net.o
> > obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
> > diff --git a/lib/efi_loader/efi_setup.c
> > b/lib/efi_loader/efi_setup.c
> > index 3c5cf9a435..98deb63777 100644
> > --- a/lib/efi_loader/efi_setup.c
> > +++ b/lib/efi_loader/efi_setup.c
> > @@ -254,11 +254,12 @@ efi_status_t efi_init_obj_list(void)
> >         if (ret != EFI_SUCCESS)
> >                 goto out;
> > 
> > -#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
> > -       ret = efi_gop_register();
> > -       if (ret != EFI_SUCCESS)
> > -               goto out;
> > -#endif
> > +       if (IS_ENABLED(CONFIG_EFI_GOP_PROTOCOL)) {
> > +               ret = efi_gop_register();
> > +               if (ret != EFI_SUCCESS)
> > +                       goto out;
> > +       }
> > +
> > #ifdef CONFIG_NET
> >         ret = efi_net_register();
> >         if (ret != EFI_SUCCESS)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] efi_loader: allow to disable GOP support
  2021-06-16 12:19   ` Icenowy Zheng
@ 2021-06-16 13:20     ` Heinrich Schuchardt
  2021-06-16 14:09       ` Icenowy Zheng
  2021-06-16 14:06     ` Peter Robinson
  2021-06-17 21:21     ` Javier Martinez Canillas
  2 siblings, 1 reply; 10+ messages in thread
From: Heinrich Schuchardt @ 2021-06-16 13:20 UTC (permalink / raw)
  To: Icenowy Zheng, Alexander Graf; +Cc: u-boot

Am 16. Juni 2021 14:19:41 MESZ schrieb Icenowy Zheng <icenowy@aosc.io>:
>在 2021-06-16星期三的 06:59 +0200,Heinrich Schuchardt写道:
>> Am 15. Juni 2021 23:10:28 MESZ schrieb Icenowy Zheng
>> <icenowy@aosc.io>:
>> > Sometimes EFI GOP support may be not wanted (e.g. because the
>> > operating
>> > system cannot operate well with it) even if video support in U-Boot
>> > is
>> > needed.
>> 
>> Which OS has which problem?
>> Why don't you fix the OS?
>
>I'm trying RK3399 with Linux. EFIFB never works as intended (maybe it's
>because IOMMU is reconfigured), and rockchipdrmfb will be fb1 (leave
>non-working EFIFB as fb0), makes fbcon unusable.

The GOP driver is not available after ExitBootServices. You can't use it after the EFI stub hands over to main Linux.

Shouldn't the Panfrost driver and Mesa be used for RK3399? https://wiki.debian.org/PanfrostLima , https://www.collabora.com/news-and-blog/blog/2019/08/06/rockpi-panfrost-wayland/

Best regards

Heinrich


>
>The second problem has a proposed fix, but the first problem is
>mystery.
>
>> 
>> Best regards
>> 
>> Heinrich
>> 
>> 
>> > 
>> > Allow to disable EFI GOP support with a Kconfig option.
>> > 
>> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>> > ---
>> > lib/efi_loader/Kconfig     |  8 ++++++++
>> > lib/efi_loader/Makefile    |  3 +--
>> > lib/efi_loader/efi_setup.c | 11 ++++++-----
>> > 3 files changed, 15 insertions(+), 7 deletions(-)
>> > 
>> > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
>> > index 6242caceb7..5ba0ce6a44 100644
>> > --- a/lib/efi_loader/Kconfig
>> > +++ b/lib/efi_loader/Kconfig
>> > @@ -282,6 +282,14 @@ config EFI_HAVE_RUNTIME_RESET
>> >         depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET ||
>> > \
>> >                    SANDBOX || SYSRESET_X86
>> > 
>> > +config EFI_GOP_PROTOCOL
>> > +       bool "EFI_GOP_PROTOCOL support"
>> > +       default y
>> > +       depends on DM_VIDEO || LCD
>> > +       help
>> > +         Provide a EFI_GOP_PROTOCOL implementation using the
>> > graphics
>> > +         hardware initialized by U-Boot.
>> > +
>> > config EFI_GRUB_ARM32_WORKAROUND
>> >         bool "Workaround for GRUB on 32bit ARM"
>> >         default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU
>> > diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
>> > index fd344cea29..826563d9a7 100644
>> > --- a/lib/efi_loader/Makefile
>> > +++ b/lib/efi_loader/Makefile
>> > @@ -54,8 +54,7 @@ obj-$(CONFIG_EFI_VARIABLES_PRESEED) +=
>> > efi_var_seed.o
>> > endif
>> > obj-y += efi_watchdog.o
>> > obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
>> > -obj-$(CONFIG_LCD) += efi_gop.o
>> > -obj-$(CONFIG_DM_VIDEO) += efi_gop.o
>> > +obj-$(CONFIG_EFI_GOP_PROTOCOL) += efi_gop.o
>> > obj-$(CONFIG_PARTITIONS) += efi_disk.o
>> > obj-$(CONFIG_NET) += efi_net.o
>> > obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
>> > diff --git a/lib/efi_loader/efi_setup.c
>> > b/lib/efi_loader/efi_setup.c
>> > index 3c5cf9a435..98deb63777 100644
>> > --- a/lib/efi_loader/efi_setup.c
>> > +++ b/lib/efi_loader/efi_setup.c
>> > @@ -254,11 +254,12 @@ efi_status_t efi_init_obj_list(void)
>> >         if (ret != EFI_SUCCESS)
>> >                 goto out;
>> > 
>> > -#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
>> > -       ret = efi_gop_register();
>> > -       if (ret != EFI_SUCCESS)
>> > -               goto out;
>> > -#endif
>> > +       if (IS_ENABLED(CONFIG_EFI_GOP_PROTOCOL)) {
>> > +               ret = efi_gop_register();
>> > +               if (ret != EFI_SUCCESS)
>> > +                       goto out;
>> > +       }
>> > +
>> > #ifdef CONFIG_NET
>> >         ret = efi_net_register();
>> >         if (ret != EFI_SUCCESS)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] efi_loader: allow to disable GOP support
  2021-06-16 12:19   ` Icenowy Zheng
  2021-06-16 13:20     ` Heinrich Schuchardt
@ 2021-06-16 14:06     ` Peter Robinson
  2021-06-16 14:11       ` Icenowy Zheng
  2021-06-17 21:21     ` Javier Martinez Canillas
  2 siblings, 1 reply; 10+ messages in thread
From: Peter Robinson @ 2021-06-16 14:06 UTC (permalink / raw)
  To: Icenowy Zheng; +Cc: Heinrich Schuchardt, Alexander Graf, u-boot

On Wed, Jun 16, 2021 at 1:20 PM Icenowy Zheng <icenowy@aosc.io> wrote:
>
> 在 2021-06-16星期三的 06:59 +0200,Heinrich Schuchardt写道:
> > Am 15. Juni 2021 23:10:28 MESZ schrieb Icenowy Zheng
> > <icenowy@aosc.io>:
> > > Sometimes EFI GOP support may be not wanted (e.g. because the
> > > operating
> > > system cannot operate well with it) even if video support in U-Boot
> > > is
> > > needed.
> >
> > Which OS has which problem?
> > Why don't you fix the OS?
>
> I'm trying RK3399 with Linux. EFIFB never works as intended (maybe it's
> because IOMMU is reconfigured), and rockchipdrmfb will be fb1 (leave
> non-working EFIFB as fb0), makes fbcon unusable.

It's due to bugs in Linux, it will be fixed in 5.14 with these patches
from our Fedora testing:
https://lists.freedesktop.org/archives/dri-devel/2021-May/306803.html

There's also this enhancement, also should land in 5.14, which is
dependent on the feature that's in the second link:

https://lists.freedesktop.org/archives/dri-devel/2021-May/306803.html
https://lists.freedesktop.org/archives/dri-devel/2021-April/303291.html

With that first patch it mostly works for me, the second two series
improves on that some more.

Peter

> The second problem has a proposed fix, but the first problem is
> mystery.
>
> >
> > Best regards
> >
> > Heinrich
> >
> >
> > >
> > > Allow to disable EFI GOP support with a Kconfig option.
> > >
> > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > > ---
> > > lib/efi_loader/Kconfig     |  8 ++++++++
> > > lib/efi_loader/Makefile    |  3 +--
> > > lib/efi_loader/efi_setup.c | 11 ++++++-----
> > > 3 files changed, 15 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> > > index 6242caceb7..5ba0ce6a44 100644
> > > --- a/lib/efi_loader/Kconfig
> > > +++ b/lib/efi_loader/Kconfig
> > > @@ -282,6 +282,14 @@ config EFI_HAVE_RUNTIME_RESET
> > >         depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET ||
> > > \
> > >                    SANDBOX || SYSRESET_X86
> > >
> > > +config EFI_GOP_PROTOCOL
> > > +       bool "EFI_GOP_PROTOCOL support"
> > > +       default y
> > > +       depends on DM_VIDEO || LCD
> > > +       help
> > > +         Provide a EFI_GOP_PROTOCOL implementation using the
> > > graphics
> > > +         hardware initialized by U-Boot.
> > > +
> > > config EFI_GRUB_ARM32_WORKAROUND
> > >         bool "Workaround for GRUB on 32bit ARM"
> > >         default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU
> > > diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
> > > index fd344cea29..826563d9a7 100644
> > > --- a/lib/efi_loader/Makefile
> > > +++ b/lib/efi_loader/Makefile
> > > @@ -54,8 +54,7 @@ obj-$(CONFIG_EFI_VARIABLES_PRESEED) +=
> > > efi_var_seed.o
> > > endif
> > > obj-y += efi_watchdog.o
> > > obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
> > > -obj-$(CONFIG_LCD) += efi_gop.o
> > > -obj-$(CONFIG_DM_VIDEO) += efi_gop.o
> > > +obj-$(CONFIG_EFI_GOP_PROTOCOL) += efi_gop.o
> > > obj-$(CONFIG_PARTITIONS) += efi_disk.o
> > > obj-$(CONFIG_NET) += efi_net.o
> > > obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
> > > diff --git a/lib/efi_loader/efi_setup.c
> > > b/lib/efi_loader/efi_setup.c
> > > index 3c5cf9a435..98deb63777 100644
> > > --- a/lib/efi_loader/efi_setup.c
> > > +++ b/lib/efi_loader/efi_setup.c
> > > @@ -254,11 +254,12 @@ efi_status_t efi_init_obj_list(void)
> > >         if (ret != EFI_SUCCESS)
> > >                 goto out;
> > >
> > > -#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
> > > -       ret = efi_gop_register();
> > > -       if (ret != EFI_SUCCESS)
> > > -               goto out;
> > > -#endif
> > > +       if (IS_ENABLED(CONFIG_EFI_GOP_PROTOCOL)) {
> > > +               ret = efi_gop_register();
> > > +               if (ret != EFI_SUCCESS)
> > > +                       goto out;
> > > +       }
> > > +
> > > #ifdef CONFIG_NET
> > >         ret = efi_net_register();
> > >         if (ret != EFI_SUCCESS)
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] efi_loader: allow to disable GOP support
  2021-06-16 13:20     ` Heinrich Schuchardt
@ 2021-06-16 14:09       ` Icenowy Zheng
  0 siblings, 0 replies; 10+ messages in thread
From: Icenowy Zheng @ 2021-06-16 14:09 UTC (permalink / raw)
  To: Heinrich Schuchardt, Alexander Graf; +Cc: u-boot

在 2021-06-16星期三的 15:20 +0200,Heinrich Schuchardt写道:
> Am 16. Juni 2021 14:19:41 MESZ schrieb Icenowy Zheng
> <icenowy@aosc.io>:
> > 在 2021-06-16星期三的 06:59 +0200,Heinrich Schuchardt写道:
> > > Am 15. Juni 2021 23:10:28 MESZ schrieb Icenowy Zheng
> > > <icenowy@aosc.io>:
> > > > Sometimes EFI GOP support may be not wanted (e.g. because the
> > > > operating
> > > > system cannot operate well with it) even if video support in U-
> > > > Boot
> > > > is
> > > > needed.
> > > 
> > > Which OS has which problem?
> > > Why don't you fix the OS?
> > 
> > I'm trying RK3399 with Linux. EFIFB never works as intended (maybe
> > it's
> > because IOMMU is reconfigured), and rockchipdrmfb will be fb1
> > (leave
> > non-working EFIFB as fb0), makes fbcon unusable.
> 
> The GOP driver is not available after ExitBootServices. You can't use
> it after the EFI stub hands over to main Linux.

I think Linux will remember a FB address before ExitBootServices, and
continue to use it then.

> 
> Shouldn't the Panfrost driver and Mesa be used for RK3399?   
> https://wiki.debian.org/PanfrostLima ,   
> https://www.collabora.com/news-and-blog/blog/2019/08/06/rockpi-panfrost-wayland/
> 

Well, you made a common error that thinks on embedded systems GPUs are
responsible for display. It's not, for display (not 3D rendering)
rockchipdrm is the driver.

> Best regards
> 
> Heinrich
> 
> 
> > 
> > The second problem has a proposed fix, but the first problem is
> > mystery.
> > 
> > > 
> > > Best regards
> > > 
> > > Heinrich
> > > 
> > > 
> > > > 
> > > > Allow to disable EFI GOP support with a Kconfig option.
> > > > 
> > > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > > > ---
> > > > lib/efi_loader/Kconfig     |  8 ++++++++
> > > > lib/efi_loader/Makefile    |  3 +--
> > > > lib/efi_loader/efi_setup.c | 11 ++++++-----
> > > > 3 files changed, 15 insertions(+), 7 deletions(-)
> > > > 
> > > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> > > > index 6242caceb7..5ba0ce6a44 100644
> > > > --- a/lib/efi_loader/Kconfig
> > > > +++ b/lib/efi_loader/Kconfig
> > > > @@ -282,6 +282,14 @@ config EFI_HAVE_RUNTIME_RESET
> > > >         depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET
> > > > ||
> > > > \
> > > >                    SANDBOX || SYSRESET_X86
> > > > 
> > > > +config EFI_GOP_PROTOCOL
> > > > +       bool "EFI_GOP_PROTOCOL support"
> > > > +       default y
> > > > +       depends on DM_VIDEO || LCD
> > > > +       help
> > > > +         Provide a EFI_GOP_PROTOCOL implementation using the
> > > > graphics
> > > > +         hardware initialized by U-Boot.
> > > > +
> > > > config EFI_GRUB_ARM32_WORKAROUND
> > > >         bool "Workaround for GRUB on 32bit ARM"
> > > >         default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU
> > > > diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
> > > > index fd344cea29..826563d9a7 100644
> > > > --- a/lib/efi_loader/Makefile
> > > > +++ b/lib/efi_loader/Makefile
> > > > @@ -54,8 +54,7 @@ obj-$(CONFIG_EFI_VARIABLES_PRESEED) +=
> > > > efi_var_seed.o
> > > > endif
> > > > obj-y += efi_watchdog.o
> > > > obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
> > > > -obj-$(CONFIG_LCD) += efi_gop.o
> > > > -obj-$(CONFIG_DM_VIDEO) += efi_gop.o
> > > > +obj-$(CONFIG_EFI_GOP_PROTOCOL) += efi_gop.o
> > > > obj-$(CONFIG_PARTITIONS) += efi_disk.o
> > > > obj-$(CONFIG_NET) += efi_net.o
> > > > obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
> > > > diff --git a/lib/efi_loader/efi_setup.c
> > > > b/lib/efi_loader/efi_setup.c
> > > > index 3c5cf9a435..98deb63777 100644
> > > > --- a/lib/efi_loader/efi_setup.c
> > > > +++ b/lib/efi_loader/efi_setup.c
> > > > @@ -254,11 +254,12 @@ efi_status_t efi_init_obj_list(void)
> > > >         if (ret != EFI_SUCCESS)
> > > >                 goto out;
> > > > 
> > > > -#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
> > > > -       ret = efi_gop_register();
> > > > -       if (ret != EFI_SUCCESS)
> > > > -               goto out;
> > > > -#endif
> > > > +       if (IS_ENABLED(CONFIG_EFI_GOP_PROTOCOL)) {
> > > > +               ret = efi_gop_register();
> > > > +               if (ret != EFI_SUCCESS)
> > > > +                       goto out;
> > > > +       }
> > > > +
> > > > #ifdef CONFIG_NET
> > > >         ret = efi_net_register();
> > > >         if (ret != EFI_SUCCESS)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] efi_loader: allow to disable GOP support
  2021-06-16 14:06     ` Peter Robinson
@ 2021-06-16 14:11       ` Icenowy Zheng
  2021-06-16 14:18         ` Peter Robinson
  0 siblings, 1 reply; 10+ messages in thread
From: Icenowy Zheng @ 2021-06-16 14:11 UTC (permalink / raw)
  To: Peter Robinson; +Cc: Heinrich Schuchardt, Alexander Graf, u-boot

在 2021-06-16星期三的 15:06 +0100,Peter Robinson写道:
> On Wed, Jun 16, 2021 at 1:20 PM Icenowy Zheng <icenowy@aosc.io>
> wrote:
> > 
> > 在 2021-06-16星期三的 06:59 +0200,Heinrich Schuchardt写道:
> > > Am 15. Juni 2021 23:10:28 MESZ schrieb Icenowy Zheng
> > > <icenowy@aosc.io>:
> > > > Sometimes EFI GOP support may be not wanted (e.g. because the
> > > > operating
> > > > system cannot operate well with it) even if video support in U-
> > > > Boot
> > > > is
> > > > needed.
> > > 
> > > Which OS has which problem?
> > > Why don't you fix the OS?
> > 
> > I'm trying RK3399 with Linux. EFIFB never works as intended (maybe
> > it's
> > because IOMMU is reconfigured), and rockchipdrmfb will be fb1
> > (leave
> > non-working EFIFB as fb0), makes fbcon unusable.
> 
> It's due to bugs in Linux, it will be fixed in 5.14 with these
> patches
> from our Fedora testing:
> https://lists.freedesktop.org/archives/dri-devel/2021-May/306803.html

I think this patch should get backported.

BTW a point of using EFI boot is to support existing distros, which
won't have this patch.

> 
> There's also this enhancement, also should land in 5.14, which is
> dependent on the feature that's in the second link:
> 
> https://lists.freedesktop.org/archives/dri-devel/2021-May/306803.html
> https://lists.freedesktop.org/archives/dri-devel/2021-April/303291.html
> 
> With that first patch it mostly works for me, the second two series
> improves on that some more.
> 
> Peter
> 
> > The second problem has a proposed fix, but the first problem is
> > mystery.
> > 
> > > 
> > > Best regards
> > > 
> > > Heinrich
> > > 
> > > 
> > > > 
> > > > Allow to disable EFI GOP support with a Kconfig option.
> > > > 
> > > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > > > ---
> > > > lib/efi_loader/Kconfig     |  8 ++++++++
> > > > lib/efi_loader/Makefile    |  3 +--
> > > > lib/efi_loader/efi_setup.c | 11 ++++++-----
> > > > 3 files changed, 15 insertions(+), 7 deletions(-)
> > > > 
> > > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> > > > index 6242caceb7..5ba0ce6a44 100644
> > > > --- a/lib/efi_loader/Kconfig
> > > > +++ b/lib/efi_loader/Kconfig
> > > > @@ -282,6 +282,14 @@ config EFI_HAVE_RUNTIME_RESET
> > > >         depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET
> > > > ||
> > > > \
> > > >                    SANDBOX || SYSRESET_X86
> > > > 
> > > > +config EFI_GOP_PROTOCOL
> > > > +       bool "EFI_GOP_PROTOCOL support"
> > > > +       default y
> > > > +       depends on DM_VIDEO || LCD
> > > > +       help
> > > > +         Provide a EFI_GOP_PROTOCOL implementation using the
> > > > graphics
> > > > +         hardware initialized by U-Boot.
> > > > +
> > > > config EFI_GRUB_ARM32_WORKAROUND
> > > >         bool "Workaround for GRUB on 32bit ARM"
> > > >         default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU
> > > > diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
> > > > index fd344cea29..826563d9a7 100644
> > > > --- a/lib/efi_loader/Makefile
> > > > +++ b/lib/efi_loader/Makefile
> > > > @@ -54,8 +54,7 @@ obj-$(CONFIG_EFI_VARIABLES_PRESEED) +=
> > > > efi_var_seed.o
> > > > endif
> > > > obj-y += efi_watchdog.o
> > > > obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
> > > > -obj-$(CONFIG_LCD) += efi_gop.o
> > > > -obj-$(CONFIG_DM_VIDEO) += efi_gop.o
> > > > +obj-$(CONFIG_EFI_GOP_PROTOCOL) += efi_gop.o
> > > > obj-$(CONFIG_PARTITIONS) += efi_disk.o
> > > > obj-$(CONFIG_NET) += efi_net.o
> > > > obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
> > > > diff --git a/lib/efi_loader/efi_setup.c
> > > > b/lib/efi_loader/efi_setup.c
> > > > index 3c5cf9a435..98deb63777 100644
> > > > --- a/lib/efi_loader/efi_setup.c
> > > > +++ b/lib/efi_loader/efi_setup.c
> > > > @@ -254,11 +254,12 @@ efi_status_t efi_init_obj_list(void)
> > > >         if (ret != EFI_SUCCESS)
> > > >                 goto out;
> > > > 
> > > > -#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
> > > > -       ret = efi_gop_register();
> > > > -       if (ret != EFI_SUCCESS)
> > > > -               goto out;
> > > > -#endif
> > > > +       if (IS_ENABLED(CONFIG_EFI_GOP_PROTOCOL)) {
> > > > +               ret = efi_gop_register();
> > > > +               if (ret != EFI_SUCCESS)
> > > > +                       goto out;
> > > > +       }
> > > > +
> > > > #ifdef CONFIG_NET
> > > >         ret = efi_net_register();
> > > >         if (ret != EFI_SUCCESS)
> > 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] efi_loader: allow to disable GOP support
  2021-06-16 14:11       ` Icenowy Zheng
@ 2021-06-16 14:18         ` Peter Robinson
  2021-06-16 14:25           ` Heinrich Schuchardt
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Robinson @ 2021-06-16 14:18 UTC (permalink / raw)
  To: Icenowy Zheng; +Cc: Heinrich Schuchardt, Alexander Graf, u-boot

On Wed, Jun 16, 2021 at 3:11 PM Icenowy Zheng <icenowy@aosc.io> wrote:
>
> 在 2021-06-16星期三的 15:06 +0100,Peter Robinson写道:
> > On Wed, Jun 16, 2021 at 1:20 PM Icenowy Zheng <icenowy@aosc.io>
> > wrote:
> > >
> > > 在 2021-06-16星期三的 06:59 +0200,Heinrich Schuchardt写道:
> > > > Am 15. Juni 2021 23:10:28 MESZ schrieb Icenowy Zheng
> > > > <icenowy@aosc.io>:
> > > > > Sometimes EFI GOP support may be not wanted (e.g. because the
> > > > > operating
> > > > > system cannot operate well with it) even if video support in U-
> > > > > Boot
> > > > > is
> > > > > needed.
> > > >
> > > > Which OS has which problem?
> > > > Why don't you fix the OS?
> > >
> > > I'm trying RK3399 with Linux. EFIFB never works as intended (maybe
> > > it's
> > > because IOMMU is reconfigured), and rockchipdrmfb will be fb1
> > > (leave
> > > non-working EFIFB as fb0), makes fbcon unusable.
> >
> > It's due to bugs in Linux, it will be fixed in 5.14 with these
> > patches
> > from our Fedora testing:
> > https://lists.freedesktop.org/archives/dri-devel/2021-May/306803.html
>
> I think this patch should get backported.

I have no problems with that so feel free to propose it to the stable kernels.

> BTW a point of using EFI boot is to support existing distros, which
> won't have this patch.

Sure, but UEFI doesn't guarantee there aren't bugs in kernels or
firmware though, it certainly makes things more straight forward but
it's no silver bullet.

> >
> > There's also this enhancement, also should land in 5.14, which is
> > dependent on the feature that's in the second link:
> >
> > https://lists.freedesktop.org/archives/dri-devel/2021-May/306803.html
> > https://lists.freedesktop.org/archives/dri-devel/2021-April/303291.html
> >
> > With that first patch it mostly works for me, the second two series
> > improves on that some more.
> >
> > Peter
> >
> > > The second problem has a proposed fix, but the first problem is
> > > mystery.
> > >
> > > >
> > > > Best regards
> > > >
> > > > Heinrich
> > > >
> > > >
> > > > >
> > > > > Allow to disable EFI GOP support with a Kconfig option.
> > > > >
> > > > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > > > > ---
> > > > > lib/efi_loader/Kconfig     |  8 ++++++++
> > > > > lib/efi_loader/Makefile    |  3 +--
> > > > > lib/efi_loader/efi_setup.c | 11 ++++++-----
> > > > > 3 files changed, 15 insertions(+), 7 deletions(-)
> > > > >
> > > > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> > > > > index 6242caceb7..5ba0ce6a44 100644
> > > > > --- a/lib/efi_loader/Kconfig
> > > > > +++ b/lib/efi_loader/Kconfig
> > > > > @@ -282,6 +282,14 @@ config EFI_HAVE_RUNTIME_RESET
> > > > >         depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET
> > > > > ||
> > > > > \
> > > > >                    SANDBOX || SYSRESET_X86
> > > > >
> > > > > +config EFI_GOP_PROTOCOL
> > > > > +       bool "EFI_GOP_PROTOCOL support"
> > > > > +       default y
> > > > > +       depends on DM_VIDEO || LCD
> > > > > +       help
> > > > > +         Provide a EFI_GOP_PROTOCOL implementation using the
> > > > > graphics
> > > > > +         hardware initialized by U-Boot.
> > > > > +
> > > > > config EFI_GRUB_ARM32_WORKAROUND
> > > > >         bool "Workaround for GRUB on 32bit ARM"
> > > > >         default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU
> > > > > diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
> > > > > index fd344cea29..826563d9a7 100644
> > > > > --- a/lib/efi_loader/Makefile
> > > > > +++ b/lib/efi_loader/Makefile
> > > > > @@ -54,8 +54,7 @@ obj-$(CONFIG_EFI_VARIABLES_PRESEED) +=
> > > > > efi_var_seed.o
> > > > > endif
> > > > > obj-y += efi_watchdog.o
> > > > > obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
> > > > > -obj-$(CONFIG_LCD) += efi_gop.o
> > > > > -obj-$(CONFIG_DM_VIDEO) += efi_gop.o
> > > > > +obj-$(CONFIG_EFI_GOP_PROTOCOL) += efi_gop.o
> > > > > obj-$(CONFIG_PARTITIONS) += efi_disk.o
> > > > > obj-$(CONFIG_NET) += efi_net.o
> > > > > obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
> > > > > diff --git a/lib/efi_loader/efi_setup.c
> > > > > b/lib/efi_loader/efi_setup.c
> > > > > index 3c5cf9a435..98deb63777 100644
> > > > > --- a/lib/efi_loader/efi_setup.c
> > > > > +++ b/lib/efi_loader/efi_setup.c
> > > > > @@ -254,11 +254,12 @@ efi_status_t efi_init_obj_list(void)
> > > > >         if (ret != EFI_SUCCESS)
> > > > >                 goto out;
> > > > >
> > > > > -#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
> > > > > -       ret = efi_gop_register();
> > > > > -       if (ret != EFI_SUCCESS)
> > > > > -               goto out;
> > > > > -#endif
> > > > > +       if (IS_ENABLED(CONFIG_EFI_GOP_PROTOCOL)) {
> > > > > +               ret = efi_gop_register();
> > > > > +               if (ret != EFI_SUCCESS)
> > > > > +                       goto out;
> > > > > +       }
> > > > > +
> > > > > #ifdef CONFIG_NET
> > > > >         ret = efi_net_register();
> > > > >         if (ret != EFI_SUCCESS)
> > >
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] efi_loader: allow to disable GOP support
  2021-06-16 14:18         ` Peter Robinson
@ 2021-06-16 14:25           ` Heinrich Schuchardt
  0 siblings, 0 replies; 10+ messages in thread
From: Heinrich Schuchardt @ 2021-06-16 14:25 UTC (permalink / raw)
  To: Peter Robinson, Icenowy Zheng; +Cc: Alexander Graf, u-boot

Am 16. Juni 2021 16:18:35 MESZ schrieb Peter Robinson <pbrobinson@gmail.com>:
>On Wed, Jun 16, 2021 at 3:11 PM Icenowy Zheng <icenowy@aosc.io> wrote:
>>
>> 在 2021-06-16星期三的 15:06 +0100,Peter Robinson写道:
>> > On Wed, Jun 16, 2021 at 1:20 PM Icenowy Zheng <icenowy@aosc.io>
>> > wrote:
>> > >
>> > > 在 2021-06-16星期三的 06:59 +0200,Heinrich Schuchardt写道:
>> > > > Am 15. Juni 2021 23:10:28 MESZ schrieb Icenowy Zheng
>> > > > <icenowy@aosc.io>:
>> > > > > Sometimes EFI GOP support may be not wanted (e.g. because the
>> > > > > operating
>> > > > > system cannot operate well with it) even if video support in
>U-
>> > > > > Boot
>> > > > > is
>> > > > > needed.
>> > > >
>> > > > Which OS has which problem?
>> > > > Why don't you fix the OS?
>> > >
>> > > I'm trying RK3399 with Linux. EFIFB never works as intended
>(maybe
>> > > it's
>> > > because IOMMU is reconfigured), and rockchipdrmfb will be fb1
>> > > (leave
>> > > non-working EFIFB as fb0), makes fbcon unusable.
>> >
>> > It's due to bugs in Linux, it will be fixed in 5.14 with these
>> > patches
>> > from our Fedora testing:
>> >
>https://lists.freedesktop.org/archives/dri-devel/2021-May/306803.html
>>
>> I think this patch should get backported.
>
>I have no problems with that so feel free to propose it to the stable
>kernels.
>
>> BTW a point of using EFI boot is to support existing distros, which
>> won't have this patch.
>
>Sure, but UEFI doesn't guarantee there aren't bugs in kernels or
>firmware though, it certainly makes things more straight forward but
>it's no silver bullet.
>

https://passthroughpo.st/explaining-csm-efifboff-setting-boot-gpu-manually/ refers to a Linux command line parameter that could be used:

video=efifb:off

Best regards

Heinrich



>> >
>> > There's also this enhancement, also should land in 5.14, which is
>> > dependent on the feature that's in the second link:
>> >
>> >
>https://lists.freedesktop.org/archives/dri-devel/2021-May/306803.html
>> >
>https://lists.freedesktop.org/archives/dri-devel/2021-April/303291.html
>> >
>> > With that first patch it mostly works for me, the second two series
>> > improves on that some more.
>> >
>> > Peter
>> >
>> > > The second problem has a proposed fix, but the first problem is
>> > > mystery.
>> > >
>> > > >
>> > > > Best regards
>> > > >
>> > > > Heinrich
>> > > >
>> > > >
>> > > > >
>> > > > > Allow to disable EFI GOP support with a Kconfig option.
>> > > > >
>> > > > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>> > > > > ---
>> > > > > lib/efi_loader/Kconfig     |  8 ++++++++
>> > > > > lib/efi_loader/Makefile    |  3 +--
>> > > > > lib/efi_loader/efi_setup.c | 11 ++++++-----
>> > > > > 3 files changed, 15 insertions(+), 7 deletions(-)
>> > > > >
>> > > > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
>> > > > > index 6242caceb7..5ba0ce6a44 100644
>> > > > > --- a/lib/efi_loader/Kconfig
>> > > > > +++ b/lib/efi_loader/Kconfig
>> > > > > @@ -282,6 +282,14 @@ config EFI_HAVE_RUNTIME_RESET
>> > > > >         depends on ARCH_BCM283X || FSL_LAYERSCAPE ||
>PSCI_RESET
>> > > > > ||
>> > > > > \
>> > > > >                    SANDBOX || SYSRESET_X86
>> > > > >
>> > > > > +config EFI_GOP_PROTOCOL
>> > > > > +       bool "EFI_GOP_PROTOCOL support"
>> > > > > +       default y
>> > > > > +       depends on DM_VIDEO || LCD
>> > > > > +       help
>> > > > > +         Provide a EFI_GOP_PROTOCOL implementation using the
>> > > > > graphics
>> > > > > +         hardware initialized by U-Boot.
>> > > > > +
>> > > > > config EFI_GRUB_ARM32_WORKAROUND
>> > > > >         bool "Workaround for GRUB on 32bit ARM"
>> > > > >         default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU
>> > > > > diff --git a/lib/efi_loader/Makefile
>b/lib/efi_loader/Makefile
>> > > > > index fd344cea29..826563d9a7 100644
>> > > > > --- a/lib/efi_loader/Makefile
>> > > > > +++ b/lib/efi_loader/Makefile
>> > > > > @@ -54,8 +54,7 @@ obj-$(CONFIG_EFI_VARIABLES_PRESEED) +=
>> > > > > efi_var_seed.o
>> > > > > endif
>> > > > > obj-y += efi_watchdog.o
>> > > > > obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
>> > > > > -obj-$(CONFIG_LCD) += efi_gop.o
>> > > > > -obj-$(CONFIG_DM_VIDEO) += efi_gop.o
>> > > > > +obj-$(CONFIG_EFI_GOP_PROTOCOL) += efi_gop.o
>> > > > > obj-$(CONFIG_PARTITIONS) += efi_disk.o
>> > > > > obj-$(CONFIG_NET) += efi_net.o
>> > > > > obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
>> > > > > diff --git a/lib/efi_loader/efi_setup.c
>> > > > > b/lib/efi_loader/efi_setup.c
>> > > > > index 3c5cf9a435..98deb63777 100644
>> > > > > --- a/lib/efi_loader/efi_setup.c
>> > > > > +++ b/lib/efi_loader/efi_setup.c
>> > > > > @@ -254,11 +254,12 @@ efi_status_t efi_init_obj_list(void)
>> > > > >         if (ret != EFI_SUCCESS)
>> > > > >                 goto out;
>> > > > >
>> > > > > -#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
>> > > > > -       ret = efi_gop_register();
>> > > > > -       if (ret != EFI_SUCCESS)
>> > > > > -               goto out;
>> > > > > -#endif
>> > > > > +       if (IS_ENABLED(CONFIG_EFI_GOP_PROTOCOL)) {
>> > > > > +               ret = efi_gop_register();
>> > > > > +               if (ret != EFI_SUCCESS)
>> > > > > +                       goto out;
>> > > > > +       }
>> > > > > +
>> > > > > #ifdef CONFIG_NET
>> > > > >         ret = efi_net_register();
>> > > > >         if (ret != EFI_SUCCESS)
>> > >
>>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] efi_loader: allow to disable GOP support
  2021-06-16 12:19   ` Icenowy Zheng
  2021-06-16 13:20     ` Heinrich Schuchardt
  2021-06-16 14:06     ` Peter Robinson
@ 2021-06-17 21:21     ` Javier Martinez Canillas
  2 siblings, 0 replies; 10+ messages in thread
From: Javier Martinez Canillas @ 2021-06-17 21:21 UTC (permalink / raw)
  To: Icenowy Zheng; +Cc: Heinrich Schuchardt, Alexander Graf, u-boot

On Wed, Jun 16, 2021 at 2:20 PM Icenowy Zheng <icenowy@aosc.io> wrote:
>
> I'm trying RK3399 with Linux. EFIFB never works as intended (maybe it's
> because IOMMU is reconfigured), and rockchipdrmfb will be fb1 (leave
> non-working EFIFB as fb0), makes fbcon unusable.
>
> The second problem has a proposed fix, but the first problem is
> mystery.
>

I think that figured out the mystery for your second problem too (if I
understood what you meant correctly).

The problem is that u-boot initializes the display controller and
provides the setup framebuffer memory to the kernel as a GOP. But then
the kernel re-initializes the HW again and mess with the resources
needed by the display controller that were correctly setup by u-boot.
Part of that is the IOMMU as you said, but also the clocks and power
domains that Linux will disable because are "unused".

So to have a GOP framebuffer that will be available until the rockchip
DRM fb emulation takes over (with the patch mentioned by Peter), you
will need the following kernel command line options:

initcall_blacklist=rk_iommu_init clk_ignore_unused pd_ignore_unused

Best regards,
Javier

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-06-17 21:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 21:10 [PATCH] efi_loader: allow to disable GOP support Icenowy Zheng
2021-06-16  4:59 ` Heinrich Schuchardt
2021-06-16 12:19   ` Icenowy Zheng
2021-06-16 13:20     ` Heinrich Schuchardt
2021-06-16 14:09       ` Icenowy Zheng
2021-06-16 14:06     ` Peter Robinson
2021-06-16 14:11       ` Icenowy Zheng
2021-06-16 14:18         ` Peter Robinson
2021-06-16 14:25           ` Heinrich Schuchardt
2021-06-17 21:21     ` Javier Martinez Canillas

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.