All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Sandoval <lsandova@redhat.com>
To: grub-devel@gnu.org
Subject: [PATCH v3 03/16] ieee1275: Disable GRUB video support for IBM power machines
Date: Thu, 10 Oct 2024 15:43:21 -0600	[thread overview]
Message-ID: <20241010214334.1749167-4-lsandova@redhat.com> (raw)
In-Reply-To: <20241010214334.1749167-1-lsandova@redhat.com>

From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>

GRUB gets the display card node address from OpenFirmware, however this address
is truncated to 32-bits (OpenFirmware works on 32-bits, so GRUB) effectively
getting an invalid address. This change disables the video support on IBM power
machines. More details can be found at [1].

[1] https://bugzilla.redhat.com/show_bug.cgi?id=973205

Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
 grub-core/kern/ieee1275/cmain.c  | 5 ++++-
 grub-core/video/ieee1275.c       | 9 ++++++---
 include/grub/ieee1275/ieee1275.h | 2 ++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c
index e74de3248..810a089a9 100644
--- a/grub-core/kern/ieee1275/cmain.c
+++ b/grub-core/kern/ieee1275/cmain.c
@@ -89,7 +89,10 @@ grub_ieee1275_find_options (void)
   }
 
   if (rc >= 0 && grub_strncmp (tmp, "IBM", 3) == 0)
-    grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS);
+    {
+      grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS);
+      grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT);
+    }
 
   /* Old Macs have no key repeat, newer ones have fully working one.
      The ones inbetween when repeated key generates an escaoe sequence
diff --git a/grub-core/video/ieee1275.c b/grub-core/video/ieee1275.c
index ca3d3c3b2..5592e4bb7 100644
--- a/grub-core/video/ieee1275.c
+++ b/grub-core/video/ieee1275.c
@@ -351,9 +351,12 @@ static struct grub_video_adapter grub_video_ieee1275_adapter =
 
 GRUB_MOD_INIT(ieee1275_fb)
 {
-  find_display ();
-  if (display)
-    grub_video_register (&grub_video_ieee1275_adapter);
+  if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT))
+    {
+      find_display ();
+      if (display)
+        grub_video_register (&grub_video_ieee1275_adapter);
+    }
 }
 
 GRUB_MOD_FINI(ieee1275_fb)
diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h
index 4f6e6aaa0..db0ec5f4c 100644
--- a/include/grub/ieee1275/ieee1275.h
+++ b/include/grub/ieee1275/ieee1275.h
@@ -145,6 +145,8 @@ enum grub_ieee1275_flag
   GRUB_IEEE1275_FLAG_POWER_VM,
 
   GRUB_IEEE1275_FLAG_POWER_KVM,
+
+  GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT
 };
 
 extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag);
-- 
2.46.2


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

  parent reply	other threads:[~2024-10-10 21:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 21:43 [PATCH v3 00/16] First Distro-agnostic series taken from Fedora Rawhide Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 01/16] ieee1275/openfw: IBM client architecture (CAS) reboot support Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 02/16] term/terminfo: for ppc, reset console display attr when clear screen Leo Sandoval
2024-10-10 21:43 ` Leo Sandoval [this message]
2024-10-10 21:43 ` [PATCH v3 04/16] configure.ac: Move bash completion script Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 05/16] misc: Make "exit" take a return code Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 06/16] efi/init: Make efi machines load an env block from a variable Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 07/16] 20_ppc_terminfo.in: Migrate ieee1275/PPC from Yaboot to Grub2 Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 08/16] normal: Add fw_path variable (revised) Leo Sandoval
2024-10-15  5:23   ` Michael Chang via Grub-devel
2024-10-15  9:01     ` Vladimir 'phcoder' Serbinenko
2024-10-10 21:43 ` [PATCH v3 09/16] commands: Pass "\x[[:hex:]][[:hex:]]" straight through unmolested Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 10/16] 10_linux.in: Add devicetree loading Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 11/16] Makefile.common: Add .eh_frame to list of relocations stripped Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 12/16] 10_linux.in: Don't require a password to boot entries generated by grub-mkconfig Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 13/16] normal/main: fw_path prefix when fallback searching for grub config Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 14/16] normal/main: Try mac/guid/etc before grub.cfg on tftp config files Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 15/16] 10_linux.in: Generate OS and CLASS in 10_linux from /etc/os-release Leo Sandoval
2024-10-10 21:43 ` [PATCH v3 16/16] normal/main: Try $prefix if $fw_path doesn't work Leo Sandoval
2024-10-30 16:39 ` [PATCH v3 00/16] First Distro-agnostic series taken from Fedora Rawhide Daniel Kiper
2024-10-30 17:03   ` Leo Sandoval
     [not found] <mailman.5684.1728596634.1206.grub-devel@gnu.org>
2024-11-08 11:30 ` [PATCH v3 03/16] ieee1275: Disable GRUB video support for IBM power machines avnish

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=20241010214334.1749167-4-lsandova@redhat.com \
    --to=lsandova@redhat.com \
    --cc=grub-devel@gnu.org \
    /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.