]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
scripts: Add mkknlimg and knlinfo scripts from tools repo
authorPhil Elwell <phil@raspberrypi.org>
Mon, 11 May 2015 08:00:42 +0000 (09:00 +0100)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 9 Mar 2018 15:20:56 +0000 (12:20 -0300)
commit29048bce2018eeab9117f141e2cadcb6eb0335b3
tree425fa92d7f9337cd175754b828ab79a4e696a446
parentc4187da132e958f7c544e5e8d73e32276adcdb0b
scripts: Add mkknlimg and knlinfo scripts from tools repo

The Raspberry Pi firmware looks for a trailer on the kernel image to
determine whether it was compiled with Device Tree support enabled.
If the firmware finds a kernel without this trailer, or which has a
trailer indicating that it isn't DT-capable, it disables DT support
and reverts to using ATAGs.

The mkknlimg utility adds that trailer, having first analysed the
image to look for signs of DT support and the kernel version string.

knlinfo displays the contents of the trailer in the given kernel image.

scripts/mkknlimg: Add support for ARCH_BCM2835

Add a new trailer field indicating whether this is an ARCH_BCM2835
build, as opposed to MACH_BCM2708/9. If the loader finds this flag
is set it changes the default base dtb file name from bcm270x...
to bcm283y...

Also update knlinfo to show the status of the field.

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: https://github.com/raspberrypi/linux/issues/1157

scripts: Multi-platform support for mkknlimg and knlinfo

The firmware uses tags in the kernel trailer to choose which dtb file
to load. Current firmware loads bcm2835-*.dtb if the '283x' tag is true,
otherwise it loads bcm270*.dtb. This scheme breaks if an image supports
multiple platforms.

This patch adds '270X' and '283X' tags to indicate support for RPi and
upstream platforms, respectively. '283x' (note lower case 'x') is left
for old firmware, and is only set if the image only supports upstream
builds.

scripts/mkknlimg: Append a trailer for all input

Now that the firmware assumes an unsigned kernel is DT-capable, it is
helpful to be able to mark a kernel as being non-DT-capable.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
scripts/knlinfo: Decode DDTK atom

Show the DDTK atom as being a boolean.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
mkknlimg: Retain downstream-kernel detection

With the death of ARCH_BCM2708 and ARCH_BCM2709, a new way is needed to
determine if this is a "downstream" build that wants the firmware to
load a bcm27xx .dtb. The vc_cma driver is used downstream but not
upstream, making vc_cma_init a suitable predicate symbol.

mkknlimg: Find some more downstream-only strings

See: https://github.com/raspberrypi/linux/issues/1920

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
scripts/knlinfo [new file with mode: 0755]
scripts/mkknlimg [new file with mode: 0755]