mirror of
https://github.com/ipxe/ipxe
synced 2026-05-14 20:00:42 +03:00
[dt] Add DT_ROM() and DT_ID() macros
Add DT_ROM() and DT_ID() macros following the pattern for PCI_ROM() and PCI_ID(), to allow for the possibility of including devicetree network devices within the "all-drivers" build of iPXE. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
+19
-1
@@ -36,7 +36,7 @@ if ( $debug ) {
|
||||
my %RE = (
|
||||
'parse_driver_class' => qr{ drivers/ (\w+?) / }x,
|
||||
'parse_family' => qr{^ (?:\./)? (.*) \..+? $}x,
|
||||
'find_rom_line' => qr/^ \s* ( (PCI|ISA|USB)_ROM \s*
|
||||
'find_rom_line' => qr/^ \s* ( (PCI|ISA|USB|DT)_ROM \s*
|
||||
\( \s* (.*?) \s* \) \s* ) [,;]/msx,
|
||||
'find_secboot' => qr/^ \s* FILE_SECBOOT \s*
|
||||
\( \s* PERMITTED \s* \) \s* ; \s* $/mx,
|
||||
@@ -121,6 +121,7 @@ sub process_rom_decl {
|
||||
return process_pci_rom($state, $rom_decl) if $rom_type eq "PCI";
|
||||
return process_isa_rom($state, $rom_decl) if $rom_type eq "ISA";
|
||||
return process_usb_rom($state, $rom_decl) if $rom_type eq "USB";
|
||||
return process_dt_rom($state, $rom_decl) if $rom_type eq "DT";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -180,6 +181,23 @@ sub process_usb_rom {
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Extract values from DT_ROM declaration lines and dispatch to
|
||||
# Makefile rule generator
|
||||
sub process_dt_rom {
|
||||
my ($state, $decl) = @_;
|
||||
return unless defined $decl;
|
||||
return unless length $decl;
|
||||
(my $image, $decl) = extract_quoted_string($decl, 'IMAGE');
|
||||
(my $desc, $decl) = extract_quoted_string($decl, 'DESCRIPTION');
|
||||
$image =~ s/,/-/;
|
||||
if ( $image and $desc ) {
|
||||
print_make_rules( $state, $image, $desc );
|
||||
} else {
|
||||
log_debug("WARNING", "Malformed DT_ROM macro on line $. of $state->{source_file}");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Output Makefile rules for the specified ROM declarations
|
||||
sub print_make_rules {
|
||||
my ( $state, $image, $desc, $vendor, $device, $dup ) = @_;
|
||||
|
||||
Reference in New Issue
Block a user