Skip to content

Commit

Permalink
lk2nd: scripts: dtbTool: Clean up QCDT entries for Samsung MSM8916
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stephan-gh committed Sep 3, 2023
1 parent 8fc9aed commit 629e93a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lk2nd/scripts/dtbTool
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,16 @@ def generate_records(f, pagesize):
x.pmic_id[2], x.pmic_id[3], 0, size, f,
version) for x in ids]

if f.endswith('/lk2nd/device/dts/msm8916/samsung.dtb'):
# 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.
records = filter(lambda r:
# Workaround for inconsistent qcom,board-id used on MSM8929
r.plat_id & 0xff == r.variant_id >> 24 if r.variant_id & 0xfffff == 0x1ff01
else r.plat_id in (r.variant_id >> 24, r.variant_id >> 20), records)

return records

def write_padding(f, pagesize):
Expand Down

0 comments on commit 629e93a

Please sign in to comment.