]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Construct driver lists for each bus type
authorMichael Brown <mcb30@ipxe.org>
Wed, 11 Feb 2026 15:38:58 +0000 (15:38 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 11 Feb 2026 17:10:57 +0000 (17:10 +0000)
Include the underlying bus type (e.g. "pci" or "isa") within the lists
constructed to describe the available drivers, to allow for the
possibility that platforms may want to define a platform-specific
subset of drivers to be present in the all-drivers build.  For
example, non-x86 platforms such as RISC-V SBI do not need to include
the ISA network drivers since the corresponding hardware cannot ever
be present on a RISC-V system.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile
src/Makefile.efi
src/util/parserom.pl

index 6d7df0e2cf6c103fffe20c0580d3ace563abb0e1..e7acdd662b11bd5df5c3a26c8c6739d8dbee25a0 100644 (file)
@@ -243,12 +243,15 @@ version :
 
 # All drivers (excluding USB)
 #
-DRIVERS_ipxe   = $(DRIVERS_net) $(DRIVERS_infiniband) \
-                 $(DRIVERS_xen) $(DRIVERS_hyperv)
+DRIVERS_ipxe   += $(DRIVERS_isa_net)
+DRIVERS_ipxe   += $(DRIVERS_pci_net)
+DRIVERS_ipxe   += $(DRIVERS_pci_infiniband)
+DRIVERS_ipxe   += $(DRIVERS_pci_xen)
+DRIVERS_ipxe   += $(DRIVERS_hyperv)
 
 # Raspberry Pi
 #
-DRIVERS_rpi    = smsc95xx lan78xx
+DRIVERS_rpi    += smsc95xx lan78xx
 
 ###############################################################################
 #
index 0c42ce6bce59bc38f107131252b9a6f180958ac8..ec1c34cd5608915268e3520ab2ea6330530a92a9 100644 (file)
@@ -25,7 +25,8 @@ NON_AUTO_MEDIA        += efirom
 
 # Include SNP and MNP drivers in the all-drivers build
 #
-DRIVERS_net += snp mnp
+DRIVERS_efi_net        += snp mnp
+DRIVERS_ipxe   += $(DRIVERS_efi_net)
 
 # Rules for building EFI files
 #
index b516fd2e3e6b986a9a3ae59acddc524643a0ac60..6b3b0b7cce5e26255a94fc7dad0afbdcba6ab4ae 100755 (executable)
@@ -131,8 +131,9 @@ sub process_pci_rom {
     (my $image,  $decl) = extract_quoted_string($decl, 'IMAGE');
     (my $desc,   $decl) = extract_quoted_string($decl, 'DESCRIPTION');
     if ( $vendor and $device and $image and $desc ) {
-        print_make_rules( $state, "${vendor}${device}", $desc, $vendor, $device );
-        print_make_rules( $state, $image, $desc, $vendor, $device, 1 );
+        print_make_rules( $state, "pci", "${vendor}${device}", $desc,
+                          $vendor, $device );
+        print_make_rules( $state, "pci", $image, $desc, $vendor, $device, 1 );
     }
     else {
         log_debug("WARNING", "Malformed PCI_ROM macro on line $. of $state->{source_file}");
@@ -149,7 +150,7 @@ sub process_isa_rom {
     (my $image, $decl) = extract_quoted_string($decl, 'IMAGE');
     (my $desc,  $decl) = extract_quoted_string($decl, 'DESCRIPTION');
     if ( $image and $desc ) {
-        print_make_rules( $state, $image, $desc );
+        print_make_rules( $state, "isa", $image, $desc );
     }
     else {
         log_debug("WARNING", "Malformed ISA_ROM macro on line $. of $state->{source_file}");
@@ -159,11 +160,11 @@ sub process_isa_rom {
 
 # Output Makefile rules for the specified ROM declarations
 sub print_make_rules {
-    my ( $state, $image, $desc, $vendor, $device, $dup ) = @_;
+    my ( $state, $bus, $image, $desc, $vendor, $device, $dup ) = @_;
     unless ( $state->{'is_header_printed'} ) {
         print "# NIC\t\n";
         print "# NIC\tfamily\t$state->{family}\n";
-        print "DRIVERS_$state->{driver_class} += $state->{driver_name}\n";
+        print "DRIVERS_${bus}_$state->{driver_class} += $state->{driver_name}\n";
         print "DRIVERS += $state->{driver_name}\n";
         print "\n";
         $state->{'is_header_printed'} = 1;