Move all to deprecated folder.
This commit is contained in:
79
deprecated/firmware/buildroot/package/rpi-firmware/Config.in
Normal file
79
deprecated/firmware/buildroot/package/rpi-firmware/Config.in
Normal file
@@ -0,0 +1,79 @@
|
||||
config BR2_PACKAGE_RPI_FIRMWARE
|
||||
bool "rpi-firmware"
|
||||
depends on BR2_arm
|
||||
help
|
||||
RaspberryPi Firmware
|
||||
Pre-compiled binaries of the current bootloader and GPU firmware
|
||||
|
||||
https://github.com/raspberrypi/firmware
|
||||
|
||||
if BR2_PACKAGE_RPI_FIRMWARE
|
||||
|
||||
choice
|
||||
bool "Firmware to boot"
|
||||
default BR2_PACKAGE_RPI_FIRMWARE_DEFAULT
|
||||
help
|
||||
There are three different firmware files:
|
||||
- the default firmware, that enables standard GPU features;
|
||||
- the extended firmware, that enables additional GPU features
|
||||
(eg. more audio/video codecs);
|
||||
- the cut-down firmware, for emergency situations, with only
|
||||
features required to boot a Linux kernel.
|
||||
|
||||
config BR2_PACKAGE_RPI_FIRMWARE_DEFAULT
|
||||
bool "default"
|
||||
help
|
||||
The default firmware, that enables standard GPU features.
|
||||
|
||||
config BR2_PACKAGE_RPI_FIRMWARE_X
|
||||
bool "extended ('x', more codecs)"
|
||||
help
|
||||
The extended firmware, that enables additional GPU features
|
||||
(eg. more audio/video codecs).
|
||||
|
||||
config BR2_PACKAGE_RPI_FIRMWARE_CD
|
||||
bool "cut-down ('cd', emergency)"
|
||||
help
|
||||
The cut-down firmware, for emergency situations, with only
|
||||
features required to boot a Linux kernel.
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_PACKAGE_RPI_FIRMWARE_BOOT
|
||||
string
|
||||
default "" if BR2_PACKAGE_RPI_FIRMWARE_DEFAULT
|
||||
default "_x" if BR2_PACKAGE_RPI_FIRMWARE_X
|
||||
default "_cd" if BR2_PACKAGE_RPI_FIRMWARE_CD
|
||||
|
||||
config BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTBS
|
||||
bool "Install Device Tree Blobs (DTBs)"
|
||||
depends on !BR2_LINUX_KERNEL_DTS_SUPPORT
|
||||
default y
|
||||
help
|
||||
If you are using a Linux kernel <= 3.18, you should say 'y' here.
|
||||
|
||||
If you are using a Linux kernel >= 3.19, you should say 'n' here,
|
||||
and enable BR2_LINUX_KERNEL_DTS_SUPPORT to let the kernel build
|
||||
the DTB.
|
||||
|
||||
config BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS
|
||||
bool "Install DTB overlays"
|
||||
depends on BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTBS \
|
||||
|| BR2_LINUX_KERNEL_DTS_SUPPORT
|
||||
default y
|
||||
help
|
||||
Say 'y' here if you need to load one or more of the DTB overlays,
|
||||
to support HATs (Hardware Attached on Top, add-on modules).
|
||||
|
||||
config BR2_PACKAGE_RPI_FIRMWARE_INSTALL_VCDBG
|
||||
bool "vcdbg"
|
||||
depends on BR2_TOOLCHAIN_USES_GLIBC
|
||||
depends on BR2_INSTALL_LIBSTDCPP # rpi-userland
|
||||
select BR2_PACKAGE_RPI_USERLAND
|
||||
help
|
||||
Install vcdbg, to help debug communication with the GPU.
|
||||
|
||||
comment "vcdbg needs an (e)glibc toolchain w/ C++"
|
||||
depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP
|
||||
|
||||
endif # BR2_PACKAGE_RPI_FIRMWARE
|
||||
@@ -0,0 +1 @@
|
||||
root=/dev/mmcblk0p2 rootwait
|
||||
@@ -0,0 +1,20 @@
|
||||
# Please note that this is only a sample, we recommend you to change it to fit
|
||||
# your needs.
|
||||
# You should override this file using a post-build script.
|
||||
# See http://buildroot.org/manual.html#rootfs-custom
|
||||
# and http://elinux.org/RPiconfig for a description of config.txt syntax
|
||||
|
||||
kernel=zImage
|
||||
|
||||
# To use an external initramfs file
|
||||
#initramfs rootfs.cpio.gz
|
||||
|
||||
# Disable overscan assuming the display supports displaying the full resolution
|
||||
# If the text shown on the screen disappears off the edge, comment this out
|
||||
disable_overscan=1
|
||||
|
||||
# How much memory in MB to assign to the GPU on Pi models having
|
||||
# 256, 512 or 1024 MB total memory
|
||||
gpu_mem_256=100
|
||||
gpu_mem_512=100
|
||||
gpu_mem_1024=100
|
||||
299
deprecated/firmware/buildroot/package/rpi-firmware/mkknlimg
Normal file
299
deprecated/firmware/buildroot/package/rpi-firmware/mkknlimg
Normal file
@@ -0,0 +1,299 @@
|
||||
#!/usr/bin/env perl
|
||||
#
|
||||
# Originaly from: https://github.com/raspberrypi/tools/blob/master/mkimage/mkknlimg
|
||||
# Original cset : f5642106425d430e1f82ee064121a5fd0e05a386
|
||||
#
|
||||
# ----------------------------------------------------------------------
|
||||
# mkknlimg by Phil Elwell for Raspberry Pi
|
||||
# based on extract-ikconfig by Dick Streefland
|
||||
#
|
||||
# (c) 2009,2010 Dick Streefland <dick@streefland.net>
|
||||
# (c) 2014,2015 Raspberry Pi (Trading) Limited <info@raspberrypi.org>
|
||||
#
|
||||
# Licensed under the terms of the GNU General Public License.
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use integer;
|
||||
|
||||
use constant FLAG_PI => 1;
|
||||
use constant FLAG_DTOK => 2;
|
||||
use constant FLAG_DDTK => 4;
|
||||
use constant FLAG_283X => 8;
|
||||
|
||||
my $trailer_magic = 'RPTL';
|
||||
|
||||
my $tmpfile1 = "/tmp/mkknlimg_$$.1";
|
||||
my $tmpfile2 = "/tmp/mkknlimg_$$.2";
|
||||
|
||||
my $dtok = 0;
|
||||
my $ddtk = 0;
|
||||
my $is_283x = 0;
|
||||
|
||||
while (@ARGV && ($ARGV[0] =~ /^-/))
|
||||
{
|
||||
my $arg = shift(@ARGV);
|
||||
if ($arg eq '--dtok')
|
||||
{
|
||||
$dtok = 1;
|
||||
}
|
||||
elsif ($arg eq '--ddtk')
|
||||
{
|
||||
$ddtk = 1;
|
||||
}
|
||||
elsif ($arg eq '--283x')
|
||||
{
|
||||
$is_283x = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print ("* Unknown option '$arg'\n");
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
usage() if (@ARGV != 2);
|
||||
|
||||
my $kernel_file = $ARGV[0];
|
||||
my $out_file = $ARGV[1];
|
||||
|
||||
if (! -r $kernel_file)
|
||||
{
|
||||
print ("* File '$kernel_file' not found\n");
|
||||
usage();
|
||||
}
|
||||
|
||||
my $wanted_configs =
|
||||
{
|
||||
'CONFIG_BCM2708_DT' => FLAG_PI | FLAG_DTOK,
|
||||
'CONFIG_ARCH_BCM2835' => FLAG_PI | FLAG_DTOK | FLAG_283X,
|
||||
};
|
||||
|
||||
my $wanted_strings =
|
||||
{
|
||||
'bcm2708_fb' => FLAG_PI,
|
||||
'brcm,bcm2835-mmc' => FLAG_PI,
|
||||
'brcm,bcm2835-sdhost' => FLAG_PI,
|
||||
'brcm,bcm2708-pinctrl' => FLAG_PI | FLAG_DTOK,
|
||||
'brcm,bcm2835-gpio' => FLAG_PI | FLAG_DTOK,
|
||||
'brcm,bcm2835-pm-wdt' => FLAG_PI | FLAG_DTOK | FLAG_283X,
|
||||
'of_overlay_apply' => FLAG_DTOK | FLAG_DDTK,
|
||||
};
|
||||
|
||||
my $res = try_extract($kernel_file, $tmpfile1);
|
||||
$res ||= try_decompress('\037\213\010', 'xy', 'gunzip', 0,
|
||||
$kernel_file, $tmpfile1, $tmpfile2);
|
||||
$res ||= try_decompress('\3757zXZ\000', 'abcde', 'unxz --single-stream', -1,
|
||||
$kernel_file, $tmpfile1, $tmpfile2);
|
||||
$res ||= try_decompress('BZh', 'xy', 'bunzip2', 0,
|
||||
$kernel_file, $tmpfile1, $tmpfile2);
|
||||
$res ||= try_decompress('\135\0\0\0', 'xxx', 'unlzma', 0,
|
||||
$kernel_file, $tmpfile1, $tmpfile2);
|
||||
$res ||= try_decompress('\211\114\132', 'xy', 'lzop -d', 0,
|
||||
$kernel_file, $tmpfile1, $tmpfile2);
|
||||
$res ||= try_decompress('\002\041\114\030', 'xy', 'lz4 -d', 1,
|
||||
$kernel_file, $tmpfile1, $tmpfile2);
|
||||
|
||||
my $append_trailer;
|
||||
my $trailer;
|
||||
my $kver = '?';
|
||||
|
||||
$append_trailer = $dtok;
|
||||
|
||||
if ($res)
|
||||
{
|
||||
$kver = $res->{'kver'} || '?';
|
||||
my $flags = $res->{'flags'};
|
||||
print("Version: $kver\n");
|
||||
|
||||
if ($flags & FLAG_PI)
|
||||
{
|
||||
$append_trailer = 1;
|
||||
$dtok ||= ($flags & FLAG_DTOK) != 0;
|
||||
$is_283x ||= ($flags & FLAG_283X) != 0;
|
||||
$ddtk ||= ($flags & FLAG_DDTK) != 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
print ("* This doesn't look like a Raspberry Pi kernel. In pass-through mode.\n");
|
||||
}
|
||||
}
|
||||
elsif (!$dtok)
|
||||
{
|
||||
print ("* Is this a valid kernel? In pass-through mode.\n");
|
||||
}
|
||||
|
||||
if ($append_trailer)
|
||||
{
|
||||
printf("DT: %s\n", $dtok ? "y" : "n");
|
||||
printf("DDT: %s\n", $ddtk ? "y" : "n");
|
||||
printf("283x: %s\n", $is_283x ? "y" : "n");
|
||||
|
||||
my @atoms;
|
||||
|
||||
push @atoms, [ $trailer_magic, pack('V', 0) ];
|
||||
push @atoms, [ 'KVer', $kver ];
|
||||
push @atoms, [ 'DTOK', pack('V', $dtok) ];
|
||||
push @atoms, [ 'DDTK', pack('V', $ddtk) ];
|
||||
push @atoms, [ '283x', pack('V', $is_283x) ];
|
||||
|
||||
$trailer = pack_trailer(\@atoms);
|
||||
$atoms[0]->[1] = pack('V', length($trailer));
|
||||
|
||||
$trailer = pack_trailer(\@atoms);
|
||||
}
|
||||
|
||||
my $ofh;
|
||||
my $total_len = 0;
|
||||
|
||||
if ($out_file eq $kernel_file)
|
||||
{
|
||||
die "* Failed to open '$out_file' for append\n"
|
||||
if (!open($ofh, '>>', $out_file));
|
||||
$total_len = tell($ofh);
|
||||
}
|
||||
else
|
||||
{
|
||||
die "* Failed to open '$kernel_file'\n"
|
||||
if (!open(my $ifh, '<', $kernel_file));
|
||||
die "* Failed to create '$out_file'\n"
|
||||
if (!open($ofh, '>', $out_file));
|
||||
|
||||
my $copybuf;
|
||||
while (1)
|
||||
{
|
||||
my $bytes = sysread($ifh, $copybuf, 64*1024);
|
||||
last if (!$bytes);
|
||||
syswrite($ofh, $copybuf, $bytes);
|
||||
$total_len += $bytes;
|
||||
}
|
||||
close($ifh);
|
||||
}
|
||||
|
||||
if ($trailer)
|
||||
{
|
||||
# Pad to word-alignment
|
||||
syswrite($ofh, "\x000\x000\x000", (-$total_len & 0x3));
|
||||
syswrite($ofh, $trailer);
|
||||
}
|
||||
|
||||
close($ofh);
|
||||
|
||||
exit($trailer ? 0 : 1);
|
||||
|
||||
END {
|
||||
unlink($tmpfile1) if ($tmpfile1);
|
||||
unlink($tmpfile2) if ($tmpfile2);
|
||||
}
|
||||
|
||||
|
||||
sub usage
|
||||
{
|
||||
print ("Usage: mkknlimg [--dtok] [--283x] <vmlinux|zImage|bzImage> <outfile>\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
sub try_extract
|
||||
{
|
||||
my ($knl, $tmp) = @_;
|
||||
|
||||
my $ver = `strings "$knl" | grep -a -E "^Linux version [1-9]"`;
|
||||
|
||||
return undef if (!$ver);
|
||||
|
||||
chomp($ver);
|
||||
|
||||
my $res = { 'kver'=>$ver };
|
||||
$res->{'flags'} = strings_to_flags($knl, $wanted_strings) |
|
||||
configs_to_flags($knl, $tmp, $wanted_configs);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
sub try_decompress
|
||||
{
|
||||
my ($magic, $subst, $zcat, $idx, $knl, $tmp1, $tmp2) = @_;
|
||||
|
||||
my $pos = `tr "$magic\n$subst" "\n$subst=" < "$knl" | grep -abo "^$subst"`;
|
||||
if ($pos)
|
||||
{
|
||||
chomp($pos);
|
||||
$pos = (split(/[\r\n]+/, $pos))[$idx];
|
||||
return undef if (!defined($pos));
|
||||
$pos =~ s/:.*[\r\n]*$//s;
|
||||
my $cmd = "tail -c+$pos \"$knl\" | $zcat > $tmp2 2> /dev/null";
|
||||
my $err = (system($cmd) >> 8);
|
||||
return undef if (($err != 0) && ($err != 2));
|
||||
|
||||
return try_extract($tmp2, $tmp1);
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
sub strings_to_flags
|
||||
{
|
||||
my ($knl, $strings) = @_;
|
||||
my $string_pattern = '^('.join('|', keys(%$strings)).')$';
|
||||
my $flags = 0;
|
||||
|
||||
my @matches = `strings \"$knl\" | grep -E \"$string_pattern\"`;
|
||||
foreach my $match (@matches)
|
||||
{
|
||||
chomp($match);
|
||||
$flags |= $strings->{$match};
|
||||
}
|
||||
|
||||
return $flags;
|
||||
}
|
||||
|
||||
sub configs_to_flags
|
||||
{
|
||||
my ($knl, $tmp, $configs) = @_;
|
||||
my $config_pattern = '^('.join('|', keys(%$configs)).')=(.*)$';
|
||||
my $cf1 = 'IKCFG_ST\037\213\010';
|
||||
my $cf2 = '0123456789';
|
||||
my $flags = 0;
|
||||
|
||||
my $pos = `tr "$cf1\n$cf2" "\n$cf2=" < "$knl" | grep -abo "^$cf2"`;
|
||||
if ($pos)
|
||||
{
|
||||
$pos =~ s/:.*[\r\n]*$//s;
|
||||
$pos += 8;
|
||||
my $err = (system("tail -c+$pos \"$knl\" | zcat > $tmp 2> /dev/null") >> 8);
|
||||
if (($err == 0) || ($err == 2))
|
||||
{
|
||||
if (open(my $fh, '<', $tmp))
|
||||
{
|
||||
while (my $line = <$fh>)
|
||||
{
|
||||
chomp($line);
|
||||
if (($line =~ /$config_pattern/) &&
|
||||
(($2 eq 'y') || ($2 eq 'm')))
|
||||
{
|
||||
$flags |= $configs->{$1};
|
||||
}
|
||||
}
|
||||
|
||||
close($fh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $flags;
|
||||
}
|
||||
|
||||
sub pack_trailer
|
||||
{
|
||||
my ($atoms) = @_;
|
||||
my $trailer = pack('VV', 0, 0);
|
||||
for (my $i = $#$atoms; $i>=0; $i--)
|
||||
{
|
||||
my $atom = $atoms->[$i];
|
||||
$trailer .= pack('a*x!4Va4', $atom->[1], length($atom->[1]), $atom->[0]);
|
||||
}
|
||||
return $trailer;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
################################################################################
|
||||
#
|
||||
# rpi-firmware
|
||||
#
|
||||
################################################################################
|
||||
|
||||
RPI_FIRMWARE_VERSION = 22d8c910f4c53118f9cf85c038d7d8e307efc110
|
||||
RPI_FIRMWARE_SITE = $(call github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION))
|
||||
RPI_FIRMWARE_LICENSE = BSD-3c
|
||||
RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom
|
||||
RPI_FIRMWARE_INSTALL_TARGET = NO
|
||||
RPI_FIRMWARE_INSTALL_IMAGES = YES
|
||||
|
||||
RPI_FIRMWARE_DEPENDENCIES += host-rpi-firmware
|
||||
|
||||
ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTBS),y)
|
||||
define RPI_FIRMWARE_INSTALL_DTB
|
||||
$(INSTALL) -D -m 0644 $(@D)/boot/bcm2708-rpi-b.dtb $(BINARIES_DIR)/rpi-firmware/bcm2708-rpi-b.dtb
|
||||
$(INSTALL) -D -m 0644 $(@D)/boot/bcm2708-rpi-b-plus.dtb $(BINARIES_DIR)/rpi-firmware/bcm2708-rpi-b-plus.dtb
|
||||
$(INSTALL) -D -m 0644 $(@D)/boot/bcm2709-rpi-2-b.dtb $(BINARIES_DIR)/rpi-firmware/bcm2709-rpi-2-b.dtb
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS),y)
|
||||
define RPI_FIRMWARE_INSTALL_DTB_OVERLAYS
|
||||
for ovldtb in $(@D)/boot/overlays/*.dtb; do \
|
||||
$(INSTALL) -D -m 0644 $${ovldtb} $(BINARIES_DIR)/rpi-firmware/overlays/$${ovldtb##*/} || exit 1; \
|
||||
done
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_INSTALL_VCDBG),y)
|
||||
define RPI_FIRMWARE_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -d -m 0700 $(@D)/$(if BR2_ARM_EABIHF,hardfp/)opt/vc/bin/vcdbg \
|
||||
$(TARGET_DIR)/usr/sbin/vcdbg
|
||||
endef
|
||||
endif # INSTALL_VCDBG
|
||||
|
||||
define RPI_FIRMWARE_INSTALL_IMAGES_CMDS
|
||||
$(INSTALL) -D -m 0644 $(@D)/boot/bootcode.bin $(BINARIES_DIR)/rpi-firmware/bootcode.bin
|
||||
$(INSTALL) -D -m 0644 $(@D)/boot/start$(BR2_PACKAGE_RPI_FIRMWARE_BOOT).elf $(BINARIES_DIR)/rpi-firmware/start.elf
|
||||
$(INSTALL) -D -m 0644 $(@D)/boot/fixup$(BR2_PACKAGE_RPI_FIRMWARE_BOOT).dat $(BINARIES_DIR)/rpi-firmware/fixup.dat
|
||||
$(INSTALL) -D -m 0644 package/rpi-firmware/config.txt $(BINARIES_DIR)/rpi-firmware/config.txt
|
||||
$(INSTALL) -D -m 0644 package/rpi-firmware/cmdline.txt $(BINARIES_DIR)/rpi-firmware/cmdline.txt
|
||||
$(RPI_FIRMWARE_INSTALL_DTB)
|
||||
$(RPI_FIRMWARE_INSTALL_DTB_OVERLAYS)
|
||||
endef
|
||||
|
||||
# We have no host sources to get, since we already
|
||||
# bundle the script we want to install.
|
||||
HOST_RPI_FIRMWARE_SOURCE =
|
||||
HOST_RPI_FIRMWARE_DEPENDENCIES =
|
||||
|
||||
define HOST_RPI_FIRMWARE_INSTALL_CMDS
|
||||
$(INSTALL) -D -m 0755 package/rpi-firmware/mkknlimg $(HOST_DIR)/usr/bin/mkknlimg
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
$(eval $(host-generic-package))
|
||||
Reference in New Issue
Block a user