Commit graph

15 commits

Author SHA1 Message Date
John Moon
b148d78706 build: Add BUILD.bazel file
Currently, the dtc project builds with Make.

As some consumers of this project use Bazel, and eventually all of
AOSP will need to move to Bazel anyway, add a a Bazel build
definition.

Bug: 251879933
Change-Id: I62ea59ee306eda58b764df2a9e5f2f33778e4b5c
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
2023-04-28 09:19:45 -07:00
Mike McTernan
09bf0ed096 Fix 'make check' target so it builds.
Test: make check
Test: build android
Change-Id: I8e998651402f8243ee4d222a5a2518adeeb4ace7
2022-07-25 06:41:04 +01:00
Rob Herring
23b56cb7e1 pylibfdt: Move setup.py to the top level
Using 'pip' and several setup.py sub-commands currently don't work with
pylibfdt. The primary reason is Python packaging has opinions on the
directory structure of repositories and one of those appears to be the
inability to reference source files outside of setup.py's subtree. This
means a sdist cannot be created with all necessary source components
(i.e. libfdt headers). Moving setup.py to the top-level solves these
problems.

With this change. the following commands now work:

Creating packages for pypi.org:
./setup.py sdist bdist_wheel

Using pip for installs:
pip install .
pip install git+http://github.com/robherring/dtc.git@pypi-v2

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20211111011135.2386773-5-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-11-11 14:34:51 +11:00
Viresh Kumar
183df9e9c2 gitignore: Ignore the swp files
Ignore the temporary .*.swp files.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Message-Id: <15496f8669ac2bb3b4b61a1a7c978947623cb7c3.1612346186.git.viresh.kumar@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-02-03 21:19:53 +11:00
Viresh Kumar
0db6d09584 gitignore: Add cscope files
Add cscope files in gitignore.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Message-Id: <3c39a6324ef2be64f839e6e6205f4afc63486216.1612338199.git.viresh.kumar@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-02-03 21:17:58 +11:00
David Gibson
e4ce227e89 tests: Properly clean up .bak file from tests
One of our testcases creates a .bak file from invoking sed.  Fix that to be
removed by make clean, and also ignore it in git to avoid clutter.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-04 16:05:31 +11:00
David Gibson
c575d8059f Add fdtoverlay to .gitignore
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-09-27 20:00:10 +10:00
Simon Glass
d59b8078bd .gitignore: Add rule for *.patch
Ignore any patch files that we find, since these are likely to be
used when sending patches upstream.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2013-01-27 14:21:44 -06:00
David Gibson
9cf26ffa4a Add quilt files to .gitignore
For the benefit of quilt users (such as myself, sometimes) have git
ignore the quilt control and patches files.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2012-02-03 08:34:27 -06:00
Simon Glass
1ede50c355 Add fdtput utility to write property values to a device tree
This simple utility allows writing of values into a device tree from the
command line. It aimes to be the opposite of fdtget.

What is it for:
- Updating fdt values when a binary blob already exists
   (even though source may be available it might be easier to use this
    utility rather than sed, etc.)
- Writing machine-specific fdt values within a build system

To use it, specify the fdt binary file on command line followed by the node
and property to set. Then, provide a list of values to put into that
property. Often there will be just one, but fdtput also supports arrays and
string lists.

fdtput does not try to guess the type of the property based on looking at
the arguments. Instead it always assumes that an integer is provided. To
indicate that you want to write a string, use -ts. You can also provide
hex values with -tx.

The command line arguments are joined together into a single value. For
strings, a nul terminator is placed between each string when it is packed
into the property. To avoid this, pass the string as a single argument.

Usage:
	fdtput <options> <dt file> <<node> <property> [<value>...]
Options:
	-t <type>	Type of data
	-v		Verbose: display each value decoded from command line
	-h		Print this help

<type>	s=string, i=int, u=unsigned, x=hex
	Optional modifier prefix:
		hh or b=byte, h=2 byte, l=4 byte (default)

To read from stdin and write to stdout, use - as the file. So you can do:

cat somefile.dtb | fdtput -ts - /node prop "My string value" > newfile.dtb

This commit also adds basic tests to verify the major features.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-01-21 15:08:39 -06:00
Simon Glass
68d057f20d Add fdtget utility to read property values from a device tree
This simply utility makes it easy for scripts to read values from the device
tree. It is written in C and uses the same libfdt as the rest of the dtc
package.

What is it for:
- Reading fdt values from scripts
- Extracting fdt information within build systems
- Looking at particular values without having to dump the entire tree

To use it, specify the fdt binary file on command line followed by a list of
node, property pairs. The utility then looks up each node, finds the property
and displays the value.

Each value is printed on a new line.

fdtget tries to guess the type of each property based on its contents. This
is not always reliable, so you can use the -t option to force fdtget to decode
the value as a string, or byte, etc.

To read from stdin, use - as the file.

Usage:
	fdtget <options> <dt file> [<node> <property>]...
Options:
	-t <type>	Type of data
	-h		Print this help

<type>	s=string, i=int, u=unsigned, x=hex
	Optional modifier prefix:
		hh or b=byte, h=2 byte, l=4 byte (default)

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-01-21 15:08:36 -06:00
Mike Frysinger
8f459c5d72 fdtdump: rename from ftdump
The freetype package already installs a binary named "ftdump", so the dtc
package conflicts with that.  So rename the newer dtc tool to "fdtdump".
This even makes a bit more sense:
	ftdump: [F]lat device [T]ree [dump]
	fdtdump: [F]lat [D]evice [T]ree [dump]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2011-10-26 08:07:51 -05:00
Grant Likely
9dfb495f80 Update .gitignore files
Filter out all the generated bits from git revision control

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-02-25 11:47:58 -06:00
David Gibson
12578976fe Merge libfdt into dtc.
Having pulled the libfdt repository into dtc, merge the makefiles and
testsuites so that they build together usefully.
2007-06-14 15:05:55 +10:00
David Gibson
8f1bc85611 Add a .gitignore file. 2005-10-21 17:28:42 +10:00