Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caf migration/skales/master #1

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
b/
config.sh
.*
/kobj/
/kernel/
*.img
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down
1 change: 1 addition & 0 deletions boards/8916
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ cmdline="console=ttyMSM0,115200,n8"
base=0x00000000
dtbs=qcom/
arch=arm64
image=Image
1 change: 0 additions & 1 deletion boards/8996

This file was deleted.

32 changes: 32 additions & 0 deletions boards/8996
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions boards/8998
Original file line number Diff line number Diff line change
@@ -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="clk_ignore_unused"
base=0x00000000
dtb=qcom/msm8998-mtp.dtb
arch=arm64
6 changes: 6 additions & 0 deletions dtbTool
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ soc_ids = {
'ipq8064' : 202,
'ipq8066' : 203,
'msm8916' : 206,
'msm8994' : 207,
'apq8074_aa' : 208,
'apq8074_ab' : 209,
'apq8074_pro' : 210,
Expand All @@ -76,8 +77,13 @@ soc_ids = {
'msm8996' : 246,
'apq8016' : 247,
'msm8216' : 248,
'msm8992' : 251,
'apq8092' : 252,
'apq8094' : 253,
'ipq4019' : 273,
'apq8096' : 291,
'msm8998' : 292,
'msm8996sg' : 305,
}

platform_type = {
Expand Down
14 changes: 7 additions & 7 deletions mkbootimg
Original file line number Diff line number Diff line change
Expand Up @@ -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]""")
Expand Down Expand Up @@ -101,21 +101,20 @@ 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:
exit("dtb: %s is of unknown format" % options.devicetree)

hdr_format = "<8sIIIIIIII2I16s512s8I"
output.write(pack(hdr_format,
"ANDROID!",
b"ANDROID!",
kernel_size,
options.base + 0x8000,
os.fstat(ramdisk.fileno()).st_size,
Expand All @@ -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)
Expand All @@ -137,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)
11 changes: 9 additions & 2 deletions package
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ then
usage
fi

image=zImage pagesize=2048 cmdline= base= initrd= needs_fixup= dtb= modules=
pagesize=2048 cmdline= base= initrd= needs_fixup= dtb= modules=
extra_dir= dtbs= dtarg= arch= uImage= dirty= verbose=
target="$1"

Expand All @@ -92,6 +92,13 @@ case "$target" in
;;
esac

if test "$arch" = "arm"
then
image=zImage
else
image=Image.gz
fi

shift

while test $# != 0
Expand Down Expand Up @@ -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
Expand Down