Skip to content

Commit 7833a07

Browse files
committed
lk2nd: scripts: dtbTool: Clean up QCDT entries for Samsung MSM8916
The msm8916 samsung.dts results in a lot of QCDT entries (records) because each qcom,msm-id is combined with each qcom,board-id. However, each board-id is actually only valid for one particular msm-id, so we can save quite some space by cleaning them up here. This is a bit of a hack but since this is a custom copy of dtbTool anyway it's not much of a problem. Also, reverting this (or using the standard dtbTool) would not result in a functional difference, just a larger build result.
1 parent 2008249 commit 7833a07

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lk2nd/scripts/dtbTool

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,16 @@ def generate_records(f, pagesize):
409409
x.pmic_id[2], x.pmic_id[3], 0, size, f,
410410
version) for x in ids]
411411

412+
if f.endswith('/lk2nd/device/dts/msm8916/samsung.dtb'):
413+
# The msm8916 samsung.dts results in a lot of QCDT entries (records)
414+
# because each qcom,msm-id is combined with each qcom,board-id. However,
415+
# each board-id is actually only valid for one particular msm-id,
416+
# so we can save quite some space by cleaning them up here.
417+
records = filter(lambda r:
418+
# Workaround for inconsistent qcom,board-id used on MSM8929
419+
r.plat_id & 0xff == r.variant_id >> 24 if r.variant_id & 0xfffff == 0x1ff01
420+
else r.plat_id in (r.variant_id >> 24, r.variant_id >> 20), records)
421+
412422
return records
413423

414424
def write_padding(f, pagesize):

0 commit comments

Comments
 (0)