From d6b11799454e9d1077543cb1768de459e12562c8 Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Mon, 16 May 2016 17:08:36 -0700 Subject: [PATCH 01/10] .gitignore: Add a few more common ignore patterns Signed-off-by: Mitchel Humpherys --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index a05eb0d..09f3fb9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ b/ config.sh .* +/kobj/ +/kernel/ +*.img From eb123f9c2670bf2202fd5ebc6416e828ec136730 Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Mon, 13 Jun 2016 17:42:02 -0700 Subject: [PATCH 02/10] README: Add libfdt package name for Arch Signed-off-by: Mitchel Humpherys --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 6bc04ff..f39fe71 100644 --- a/README +++ b/README @@ -17,6 +17,7 @@ To use dtbTool you should have libfdt installed. libfdt-dev (debian) libfdt-devel (redhat) sys-apps/dtc (gentoo) + community/dtc (arch) Background ---------- From c5038475180f231d9e63dfdc3fe12a2fcc47cd8b Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Mon, 16 May 2016 18:14:23 -0700 Subject: [PATCH 03/10] mkbootimg: Python3 compatibility Python3 is more strict about distinguishing un-encoded ascii strings from bytes and encoded strings. Jump the necessary hoops to make python3 happy. Verified that a boot image built with python3 shows no diff with one built with python2. Signed-off-by: Mitchel Humpherys [sboyd@codeaurora.org: Drop unused codecs import] Signed-off-by: Stephen Boyd --- mkbootimg | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mkbootimg b/mkbootimg index 69cfa7d..0f0cf0c 100755 --- a/mkbootimg +++ b/mkbootimg @@ -38,7 +38,7 @@ def write_padding(f, pagesize): count = pagesize - (f.tell() % pagesize) # Write padding as long as we aren't already aligned to a page if count != pagesize: - output.write("".join(['\x00' for x in xrange(count)])) + output.write(b'\x00' * count) if __name__ == "__main__": usage = ("""%prog [options]""") @@ -101,13 +101,12 @@ if __name__ == "__main__": kernel_size = os.fstat(kernel.fileno()).st_size dtb_size = 0 if options.devicetree: - of_dt_header = 0xd00dfeed magic = devicetree.read(4) devicetree.seek(0) - if int(magic.encode('hex'),16) == of_dt_header: + if magic == b'\xd0\x0d\xfe\xed': # 0xd00dfeed append_dtb = True kernel_size += os.fstat(devicetree.fileno()).st_size - elif magic == 'QCDT': + elif magic == b'QCDT': append_dtb = False dtb_size = os.fstat(devicetree.fileno()).st_size else: @@ -115,7 +114,7 @@ if __name__ == "__main__": hdr_format = "<8sIIIIIIII2I16s512s8I" output.write(pack(hdr_format, - "ANDROID!", + b"ANDROID!", kernel_size, options.base + 0x8000, os.fstat(ramdisk.fileno()).st_size, @@ -124,8 +123,8 @@ if __name__ == "__main__": tags, options.pagesize, dtb_size, 0, - "", - options.cmdline, + b"", + options.cmdline.encode(), 123456, 123456, 123456, 123456, 123456, 123456, 0, 0)) write_padding(output, pagesize) From 0333cbfc8983811da180c36a1b39a4605bd4c9e5 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Mon, 11 Jul 2016 11:37:21 -0700 Subject: [PATCH 04/10] dtbTool: Add msm8996sg SoC id Signed-off-by: Stephen Boyd --- dtbTool | 1 + 1 file changed, 1 insertion(+) diff --git a/dtbTool b/dtbTool index 42f772e..4be0c35 100755 --- a/dtbTool +++ b/dtbTool @@ -78,6 +78,7 @@ soc_ids = { 'msm8216' : 248, 'ipq4019' : 273, 'apq8096' : 291, + 'msm8996sg' : 305, } platform_type = { From 6eac9e943de53c4aaaede3697e9226a47686fe25 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Tue, 9 Aug 2016 12:27:27 -0700 Subject: [PATCH 05/10] dtbTool: Add msm8994/msm8992 and variant ids Signed-off-by: Stephen Boyd --- dtbTool | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dtbTool b/dtbTool index 4be0c35..a3cf539 100755 --- a/dtbTool +++ b/dtbTool @@ -60,6 +60,7 @@ soc_ids = { 'ipq8064' : 202, 'ipq8066' : 203, 'msm8916' : 206, + 'msm8994' : 207, 'apq8074_aa' : 208, 'apq8074_ab' : 209, 'apq8074_pro' : 210, @@ -76,6 +77,9 @@ soc_ids = { 'msm8996' : 246, 'apq8016' : 247, 'msm8216' : 248, + 'msm8992' : 251, + 'apq8092' : 252, + 'apq8094' : 253, 'ipq4019' : 273, 'apq8096' : 291, 'msm8996sg' : 305, From cfc313d3f5568db12214276b82307c06f2ffe4d3 Mon Sep 17 00:00:00 2001 From: Joonwoo Park Date: Wed, 24 Aug 2016 15:40:27 -0700 Subject: [PATCH 06/10] skales: use/support compressed ARM64 kernel image Make compressed kernel image as ARM64 default while keeping 8916 to use uncompressed image as 8916's bootloader doesn't support compressed kernel. Signed-off-by: Joonwoo Park --- boards/8916 | 1 + boards/8996 | 33 ++++++++++++++++++++++++++++++++- package | 11 +++++++++-- 3 files changed, 42 insertions(+), 3 deletions(-) mode change 120000 => 100644 boards/8996 diff --git a/boards/8916 b/boards/8916 index c677c96..b0ae3a9 100644 --- a/boards/8916 +++ b/boards/8916 @@ -30,3 +30,4 @@ cmdline="console=ttyMSM0,115200,n8" base=0x00000000 dtbs=qcom/ arch=arm64 +image=Image diff --git a/boards/8996 b/boards/8996 deleted file mode 120000 index e486d4f..0000000 --- a/boards/8996 +++ /dev/null @@ -1 +0,0 @@ -8916 \ No newline at end of file diff --git a/boards/8996 b/boards/8996 new file mode 100644 index 0000000..b0b3b3f --- /dev/null +++ b/boards/8996 @@ -0,0 +1,32 @@ +# Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +cmdline="console=ttyMSM0,115200,n8" +base=0x00000000 +dtbs=qcom/ +arch=arm64 diff --git a/package b/package index 9e3908b..c8dd762 100755 --- a/package +++ b/package @@ -74,7 +74,14 @@ then usage fi -image=zImage pagesize=2048 cmdline= base= initrd= needs_fixup= dtb= modules= +if test "$arch" = "arm" +then + image=zImage +else + image=Image.gz +fi + +pagesize=2048 cmdline= base= initrd= needs_fixup= dtb= modules= extra_dir= dtbs= dtarg= arch= uImage= dirty= verbose= target="$1" @@ -211,7 +218,7 @@ then dtdir1=arch/arm/boot/dts/ dtdir2=arch/arm/boot/ else - image=arch/arm64/boot/Image + image=arch/arm64/boot/$image dtdir1=arch/arm64/boot/dts/ dtdir2=arch/arm64/boot/dts/ fi From 9e8a4ebdf078b95bd259e17badf79775eed59520 Mon Sep 17 00:00:00 2001 From: Joonwoo Park Date: Wed, 24 Aug 2016 15:59:38 -0700 Subject: [PATCH 07/10] skales: Add msm8998 support Add board configuration file and SoC id to dtbTool to support msm8998. Signed-off-by: Joonwoo Park --- boards/8998 | 32 ++++++++++++++++++++++++++++++++ dtbTool | 1 + 2 files changed, 33 insertions(+) create mode 100644 boards/8998 diff --git a/boards/8998 b/boards/8998 new file mode 100644 index 0000000..5385405 --- /dev/null +++ b/boards/8998 @@ -0,0 +1,32 @@ +# Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +cmdline="" +base=0x00000000 +dtb=qcom/msm8998-mtp.dtb +arch=arm64 diff --git a/dtbTool b/dtbTool index 4be0c35..09fac96 100755 --- a/dtbTool +++ b/dtbTool @@ -78,6 +78,7 @@ soc_ids = { 'msm8216' : 248, 'ipq4019' : 273, 'apq8096' : 291, + 'msm8998' : 292, 'msm8996sg' : 305, } From e315fbce16a2dbbcf51c6e030a2594b361ef248b Mon Sep 17 00:00:00 2001 From: Joonwoo Park Date: Fri, 5 Aug 2016 11:38:49 -0700 Subject: [PATCH 08/10] boards/8998: add clk_ignore_unused to kernel commandline msm8998 clock driver is unstable at present hence needs this. Signed-off-by: Joonwoo Park --- boards/8998 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/8998 b/boards/8998 index 5385405..d32ccd9 100644 --- a/boards/8998 +++ b/boards/8998 @@ -26,7 +26,7 @@ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -cmdline="" +cmdline="clk_ignore_unused" base=0x00000000 dtb=qcom/msm8998-mtp.dtb arch=arm64 From d6963899bdbaffb25b3c89dd3ae4a31421a69c85 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Fri, 4 Nov 2016 11:57:29 -0700 Subject: [PATCH 09/10] package: Evaluate arch later If we evaluate arch here it isn't set to anything because it's populated from the boards/* files. Let's evaluate after the target is parsed so we can get the proper image variable set for the arch. Signed-off-by: Stephen Boyd --- package | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package b/package index c8dd762..9b03a9e 100755 --- a/package +++ b/package @@ -74,13 +74,6 @@ then usage fi -if test "$arch" = "arm" -then - image=zImage -else - image=Image.gz -fi - pagesize=2048 cmdline= base= initrd= needs_fixup= dtb= modules= extra_dir= dtbs= dtarg= arch= uImage= dirty= verbose= target="$1" @@ -99,6 +92,13 @@ case "$target" in ;; esac +if test "$arch" = "arm" +then + image=zImage +else + image=Image.gz +fi + shift while test $# != 0 From 1ccd3e924f6955b1c9d5f921e5311c8db8411787 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Mon, 19 Dec 2016 15:26:12 -0800 Subject: [PATCH 10/10] mkbootimg: Always pad out the image Failure to pad out the image to the end makes it impossible to flash the boot.img on devices that expect that padding (e.g. UFS type devices). Add it. Signed-off-by: Stephen Boyd --- mkbootimg | 1 + 1 file changed, 1 insertion(+) diff --git a/mkbootimg b/mkbootimg index 0f0cf0c..8e50259 100755 --- a/mkbootimg +++ b/mkbootimg @@ -136,3 +136,4 @@ if __name__ == "__main__": write_padding(output, pagesize) if options.devicetree and not append_dtb: output.write(devicetree.read()) + write_padding(output, pagesize)