All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Glenn Washburn <development@efficientek.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>,
	Daniel Kiper <dkiper@net-space.pl>
Subject: Re: [PATCH] term/serial: Add support for PCI serial devices
Date: Thu, 25 Aug 2022 10:17:44 +0200	[thread overview]
Message-ID: <YwcwKK+S/DUfruvr@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20220824151355.6312d89d@crass-HP-ZBook-15-G2>

On Wed, Aug 24, 2022 at 03:13:55PM -0500, Glenn Washburn wrote:
> > Index: grub2-2.06/include/grub/pci.h
> > ===================================================================
> > --- grub2-2.06.orig/include/grub/pci.h
> > +++ grub2-2.06/include/grub/pci.h
> > @@ -83,6 +83,9 @@
> >  #define  GRUB_PCI_CLASS_SUBCLASS_VGA  0x0300
> >  #define  GRUB_PCI_CLASS_SUBCLASS_USB  0x0c03
> 
> These are inconsistent with the naming of the added macros below, but I
> prefer the more informative naming style below. Would you be
> interested in creating a second following patch in your v2 which
> changes these above to GRUB_PCI_CLASS_DISPLAY_VGA and
> GRUB_PCI_CLASS_SERIAL_USB?

Like, so eh? :-)

quilt new grub-rename-pci-class.patch;
git grep -l -e GRUB_PCI_CLASS_SUBCLASS_USB -e GRUB_PCI_CLASS_SUBCLASS_VGA | while read file;
do
	quilt add $file;
	sed -i -e 's/GRUB_PCI_CLASS_SUBCLASS_USB/GRUB_PCI_CLASS_SERIAL_USB/g' -e 's/GRUB_PCI_CLASS_SUBCLASS_VGA/GRUB_PCI_CLASS_DISPLAY_VGA/g' $file;
done

---
Index: grub/grub-core/kern/i386/qemu/init.c
===================================================================
--- grub.orig/grub-core/kern/i386/qemu/init.c
+++ grub/grub-core/kern/i386/qemu/init.c
@@ -168,11 +168,11 @@ enable_cards (grub_pci_device_t dev,
 
   class = (grub_pci_read (addr) >> 16) & 0xffff;
 
-  if (class == GRUB_PCI_CLASS_SUBCLASS_VGA)
+  if (class == GRUB_PCI_CLASS_DISPLAY_VGA)
     cmd |= GRUB_PCI_COMMAND_IO_ENABLED
       | GRUB_PCI_COMMAND_MEM_ENABLED;
 
-  if (class == GRUB_PCI_CLASS_SUBCLASS_USB)
+  if (class == GRUB_PCI_CLASS_SERIAL_USB)
     return 0;
 
   addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
Index: grub/grub-core/video/efi_uga.c
===================================================================
--- grub.orig/grub-core/video/efi_uga.c
+++ grub/grub-core/video/efi_uga.c
@@ -100,7 +100,7 @@ find_card (grub_pci_device_t dev, grub_p
   addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
   subclass = (grub_pci_read (addr) >> 16) & 0xffff;
 
-  if (subclass != GRUB_PCI_CLASS_SUBCLASS_VGA)
+  if (subclass != GRUB_PCI_CLASS_DISPLAY_VGA)
     return 0;
 
   /* Enable MEM address spaces */
Index: grub/grub-core/video/radeon_fuloong2e.c
===================================================================
--- grub.orig/grub-core/video/radeon_fuloong2e.c
+++ grub/grub-core/video/radeon_fuloong2e.c
@@ -72,7 +72,7 @@ find_card (grub_pci_device_t dev, grub_p
   addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
   class = grub_pci_read (addr);
 
-  if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA
+  if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_DISPLAY_VGA
       || pciid != 0x515a1002)
     return 0;
 
Index: grub/grub-core/video/radeon_yeeloong3a.c
===================================================================
--- grub.orig/grub-core/video/radeon_yeeloong3a.c
+++ grub/grub-core/video/radeon_yeeloong3a.c
@@ -71,7 +71,7 @@ find_card (grub_pci_device_t dev, grub_p
   addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
   class = grub_pci_read (addr);
 
-  if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA
+  if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_DISPLAY_VGA
       || pciid != 0x96151002)
     return 0;
 
Index: grub/grub-core/video/sis315pro.c
===================================================================
--- grub.orig/grub-core/video/sis315pro.c
+++ grub/grub-core/video/sis315pro.c
@@ -100,7 +100,7 @@ find_card (grub_pci_device_t dev, grub_p
   addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
   class = grub_pci_read (addr);
 
-  if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA
+  if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_DISPLAY_VGA
       || pciid != GRUB_SIS315PRO_PCIID)
     return 0;
 
Index: grub/grub-core/video/sm712.c
===================================================================
--- grub.orig/grub-core/video/sm712.c
+++ grub/grub-core/video/sm712.c
@@ -372,7 +372,7 @@ find_card (grub_pci_device_t dev, grub_p
   addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
   class = grub_pci_read (addr);
 
-  if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA
+  if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_DISPLAY_VGA
       || pciid != GRUB_SM712_PCIID)
     return 0;
 
Index: grub/include/grub/pci.h
===================================================================
--- grub.orig/include/grub/pci.h
+++ grub/include/grub/pci.h
@@ -81,8 +81,8 @@
 #define  GRUB_PCI_STATUS_DEVSEL_TIMING_SHIFT 9
 #define  GRUB_PCI_STATUS_DEVSEL_TIMING_MASK 0x0600
 
-#define  GRUB_PCI_CLASS_SUBCLASS_VGA  0x0300
-#define  GRUB_PCI_CLASS_SUBCLASS_USB  0x0c03
+#define  GRUB_PCI_CLASS_DISPLAY_VGA           0x0300
+#define  GRUB_PCI_CLASS_SERIAL_USB            0x0c03
 #define  GRUB_PCI_CLASS_COMMUNICATION_SERIAL  0x0700
 #define  GRUB_PCI_CLASS_COMMUNICATION_MODEM   0x0703
 


  parent reply	other threads:[~2022-08-25  8:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 11:28 [PATCH] term/serial: Add support for PCI serial devices Peter Zijlstra
2022-08-24 20:13 ` Glenn Washburn
2022-08-24 21:01   ` Peter Zijlstra
2022-08-24 23:36     ` Glenn Washburn
2022-08-25  7:36       ` Peter Zijlstra
2022-08-25  7:57       ` Peter Zijlstra
2022-08-25 15:51         ` Glenn Washburn
2022-08-25 19:33           ` Peter Zijlstra
2022-08-26  1:01             ` Glenn Washburn
2022-08-25  8:10       ` Peter Zijlstra
2022-08-25 19:23         ` Glenn Washburn
2022-08-25 19:59           ` Peter Zijlstra
2022-08-26  4:02             ` Glenn Washburn
2022-08-25  8:17   ` Peter Zijlstra [this message]
2022-08-25 15:46     ` Glenn Washburn
2022-08-25  8:03 ` Gerd Hoffmann

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=YwcwKK+S/DUfruvr@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=development@efficientek.com \
    --cc=dkiper@net-space.pl \
    --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.