blob: 49eeeb7f8d8374ca7afd00ac7c4221828e96e7ae [file] [log] [blame]
David Brazdil7a462ec2019-08-15 12:27:47 +01001#!/usr/bin/env python
2#
3# Copyright 2019 The Hafnium Authors.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# https://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17"""Wrapper around Device Tree Compiler (dtc)"""
18
19import argparse
20import os
21import subprocess
22import sys
23
24DTC = "dtc"
25
26def main():
27 parser = argparse.ArgumentParser()
28 parser.add_argument("input_file")
29 parser.add_argument("output_file")
30 args = parser.parse_args()
31
32 return subprocess.call([
33 DTC,
34 "-I", "dts", "-O", "dtb",
35 "-o", args.output_file,
36 "--out-version", "17",
37 args.input_file
38 ])
39
40if __name__ == "__main__":
41 sys.exit(main())