Skip to content

Commit 6c1d637

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
scripts/mkknlimg: Improve ARCH_BCM2835 detection
The board support code contains sufficient strings to be able to distinguish 2708 vs. 2835 builds, so remove the check for bcm2835-pm-wdt which could exist in either. Also, since the canned configuration is no longer built in (it's a module), remove the config string checking. See: #1157
1 parent c7158fd commit 6c1d637

File tree

1 file changed

+5
-36
lines changed

1 file changed

+5
-36
lines changed

scripts/mkknlimg

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,15 @@ if (! -r $kernel_file)
5050
usage();
5151
}
5252

53-
my @wanted_config_lines =
54-
(
55-
'CONFIG_BCM2708_DT',
56-
'CONFIG_ARCH_BCM2835'
57-
);
58-
5953
my @wanted_strings =
6054
(
6155
'bcm2708_fb',
6256
'brcm,bcm2835-mmc',
6357
'brcm,bcm2835-sdhost',
6458
'brcm,bcm2708-pinctrl',
6559
'brcm,bcm2835-gpio',
66-
'brcm,bcm2835-pm-wdt'
60+
'brcm,bcm2835',
61+
'brcm,bcm2836'
6762
);
6863

6964
my $res = try_extract($kernel_file, $tmpfile1);
@@ -98,12 +93,11 @@ if ($res)
9893
config_bool($res, 'brcm,bcm2835-mmc') ||
9994
config_bool($res, 'brcm,bcm2835-sdhost'))
10095
{
101-
$dtok ||= config_bool($res, 'CONFIG_BCM2708_DT');
102-
$dtok ||= config_bool($res, 'CONFIG_ARCH_BCM2835');
10396
$dtok ||= config_bool($res, 'brcm,bcm2708-pinctrl');
10497
$dtok ||= config_bool($res, 'brcm,bcm2835-gpio');
105-
$is_283x ||= config_bool($res, 'CONFIG_ARCH_BCM2835');
106-
$is_283x ||= config_bool($res, 'brcm,bcm2835-pm-wdt');
98+
$is_283x ||= config_bool($res, 'brcm,bcm2835');
99+
$is_283x ||= config_bool($res, 'brcm,bcm2836');
100+
$dtok ||= $is_283x;
107101
$append_trailer = 1;
108102
}
109103
else
@@ -205,31 +199,6 @@ sub try_extract
205199
$res->{$match} = 1;
206200
}
207201

208-
my $config_pattern = '^('.join('|', @wanted_config_lines).')=(.*)$';
209-
my $cf1 = 'IKCFG_ST\037\213\010';
210-
my $cf2 = '0123456789';
211-
212-
my $pos = `tr "$cf1\n$cf2" "\n$cf2=" < "$knl" | grep -abo "^$cf2"`;
213-
if ($pos)
214-
{
215-
$pos =~ s/:.*[\r\n]*$//s;
216-
$pos += 8;
217-
my $err = (system("tail -c+$pos \"$knl\" | zcat > $tmp 2> /dev/null") >> 8);
218-
if (($err == 0) || ($err == 2))
219-
{
220-
if (open(my $fh, '<', $tmp))
221-
{
222-
while (my $line = <$fh>)
223-
{
224-
chomp($line);
225-
$res->{$1} = $2 if ($line =~ /$config_pattern/);
226-
}
227-
228-
close($fh);
229-
}
230-
}
231-
}
232-
233202
return $res;
234203
}
235204

0 commit comments

Comments
 (0)