1 From f578216ec77548da230336549ed488dbdf4a42f3 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Thu, 8 Oct 2015 13:33:28 +0100
4 Subject: [PATCH 199/203] scripts/mkknlimg: Improve ARCH_BCM2835 detection
6 The board support code contains sufficient strings to be able to
7 distinguish 2708 vs. 2835 builds, so remove the check for
8 bcm2835-pm-wdt which could exist in either.
10 Also, since the canned configuration is no longer built in (it's
11 a module), remove the config string checking.
13 See: https://github.com/raspberrypi/linux/issues/1157
15 scripts/mkknlimg | 41 +++++------------------------------------
16 1 file changed, 5 insertions(+), 36 deletions(-)
18 --- a/scripts/mkknlimg
19 +++ b/scripts/mkknlimg
20 @@ -50,12 +50,6 @@ if (! -r $kernel_file)
24 -my @wanted_config_lines =
26 - 'CONFIG_BCM2708_DT',
27 - 'CONFIG_ARCH_BCM2835'
33 @@ -63,7 +57,8 @@ my @wanted_strings =
34 'brcm,bcm2835-sdhost',
35 'brcm,bcm2708-pinctrl',
37 - 'brcm,bcm2835-pm-wdt'
42 my $res = try_extract($kernel_file, $tmpfile1);
43 @@ -98,12 +93,11 @@ if ($res)
44 config_bool($res, 'brcm,bcm2835-mmc') ||
45 config_bool($res, 'brcm,bcm2835-sdhost'))
47 - $dtok ||= config_bool($res, 'CONFIG_BCM2708_DT');
48 - $dtok ||= config_bool($res, 'CONFIG_ARCH_BCM2835');
49 $dtok ||= config_bool($res, 'brcm,bcm2708-pinctrl');
50 $dtok ||= config_bool($res, 'brcm,bcm2835-gpio');
51 - $is_283x ||= config_bool($res, 'CONFIG_ARCH_BCM2835');
52 - $is_283x ||= config_bool($res, 'brcm,bcm2835-pm-wdt');
53 + $is_283x ||= config_bool($res, 'brcm,bcm2835');
54 + $is_283x ||= config_bool($res, 'brcm,bcm2836');
59 @@ -205,31 +199,6 @@ sub try_extract
63 - my $config_pattern = '^('.join('|', @wanted_config_lines).')=(.*)$';
64 - my $cf1 = 'IKCFG_ST\037\213\010';
65 - my $cf2 = '0123456789';
67 - my $pos = `tr "$cf1\n$cf2" "\n$cf2=" < "$knl" | grep -abo "^$cf2"`;
70 - $pos =~ s/:.*[\r\n]*$//s;
72 - my $err = (system("tail -c+$pos \"$knl\" | zcat > $tmp 2> /dev/null") >> 8);
73 - if (($err == 0) || ($err == 2))
75 - if (open(my $fh, '<', $tmp))
77 - while (my $line = <$fh>)
80 - $res->{$1} = $2 if ($line =~ /$config_pattern/);