devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	loeliger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	David Gibson
	<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
Subject: [PATCH 1/4] Convert README to README.md
Date: Thu, 28 Jul 2022 17:53:45 +1000	[thread overview]
Message-ID: <20220728075348.174412-2-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20220728075348.174412-1-david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>

Let's move vaguely into the twenty-first century by converting our old
plain text README file to Markdown.  While we're updating the formatting,
make some small polish changes to the content.

Signed-off-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
---
 README    | 106 -----------------------------------------------
 README.md | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 120 insertions(+), 106 deletions(-)
 delete mode 100644 README
 create mode 100644 README.md

diff --git a/README b/README
deleted file mode 100644
index a48312a..0000000
--- a/README
+++ /dev/null
@@ -1,106 +0,0 @@
-The source tree contains the Device Tree Compiler (dtc) toolchain for
-working with device tree source and binary files and also libfdt, a
-utility library for reading and manipulating the binary format.
-
-DTC and LIBFDT are maintained by:
-
-David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
-Jon Loeliger <loeliger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
-
-
-Python library
---------------
-
-A Python library is also available. To build this you will need to install
-swig and Python development files. On Debian distributions:
-
-   sudo apt-get install swig python3-dev
-
-The library provides an Fdt class which you can use like this:
-
-$ PYTHONPATH=../pylibfdt python3
->>> import libfdt
->>> fdt = libfdt.Fdt(open('test_tree1.dtb', mode='rb').read())
->>> node = fdt.path_offset('/subnode@1')
->>> print(node)
-124
->>> prop_offset = fdt.first_property_offset(node)
->>> prop = fdt.get_property_by_offset(prop_offset)
->>> print('%s=%s' % (prop.name, prop.as_str()))
-compatible=subnode1
->>> node2 = fdt.path_offset('/')
->>> print(fdt.getprop(node2, 'compatible').as_str())
-test_tree1
-
-You will find tests in tests/pylibfdt_tests.py showing how to use each
-method. Help is available using the Python help command, e.g.:
-
-    $ cd pylibfdt
-    $ python3 -c "import libfdt; help(libfdt)"
-
-If you add new features, please check code coverage:
-
-    $ sudo apt-get install python3-coverage
-    $ cd tests
-    # It's just 'coverage' on most other distributions
-    $ python3-coverage run pylibfdt_tests.py
-    $ python3-coverage html
-    # Open 'htmlcov/index.html' in your browser
-
-
-The library can be installed with pip from a local source tree:
-
-    pip install . [--user|--prefix=/path/to/install_dir]
-
-Or directly from a remote git repo:
-
-    pip install git+git://git.kernel.org/pub/scm/utils/dtc/dtc.git@main
-
-The install depends on libfdt shared library being installed on the host system
-first. Generally, using --user or --prefix is not necessary and pip will use the
-default location for the Python installation which varies if the user is root or
-not.
-
-You can also install everything via make if you like, but pip is recommended.
-
-To install both libfdt and pylibfdt you can use:
-
-    make install [PREFIX=/path/to/install_dir]
-
-To disable building the python library, even if swig and Python are available,
-use:
-
-    make NO_PYTHON=1
-
-
-More work remains to support all of libfdt, including access to numeric
-values.
-
-
-Adding a new function to libfdt.h
----------------------------------
-
-The shared library uses libfdt/version.lds to list the exported functions, so
-add your new function there. Check that your function works with pylibfdt. If
-it cannot be supported, put the declaration in libfdt.h behind #ifndef SWIG so
-that swig ignores it.
-
-
-Tests
------
-
-Test files are kept in the tests/ directory. Use 'make check' to build and run
-all tests.
-
-If you want to adjust a test file, be aware that tree_tree1.dts is compiled
-and checked against a binary tree from assembler macros in trees.S. So
-if you change that file you must change tree.S also.
-
-
-Mailing list
-------------
-The following list is for discussion about dtc and libfdt implementation
-mailto:devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
-
-Core device tree bindings are discussed on the devicetree-spec list:
-mailto:devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..30212bc
--- /dev/null
+++ b/README.md
@@ -0,0 +1,120 @@
+# Device Tree Compiler and libfdt
+
+The source tree contains the Device Tree Compiler (dtc) toolchain for
+working with device tree source and binary files and also libfdt, a
+utility library for reading and manipulating the binary format.
+
+dtc and libfdt are maintained by:
+
+* [David Gibson `<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>`](mailto:david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org)
+* [Jon Loeliger `<loeliger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>`](mailto:loeliger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org)
+
+## Python library
+
+A Python library wrapping libfdt is also available. To build this you
+will need to install `swig` and Python development files. On Debian
+distributions:
+
+```
+$ sudo apt-get install swig python3-dev
+```
+
+The library provides an `Fdt` class which you can use like this:
+
+```
+$ PYTHONPATH=../pylibfdt python3
+>>> import libfdt
+>>> fdt = libfdt.Fdt(open('test_tree1.dtb', mode='rb').read())
+>>> node = fdt.path_offset('/subnode@1')
+>>> print(node)
+124
+>>> prop_offset = fdt.first_property_offset(node)
+>>> prop = fdt.get_property_by_offset(prop_offset)
+>>> print('%s=%s' % (prop.name, prop.as_str()))
+compatible=subnode1
+>>> node2 = fdt.path_offset('/')
+>>> print(fdt.getprop(node2, 'compatible').as_str())
+test_tree1
+```
+
+You will find tests in `tests/pylibfdt_tests.py` showing how to use each
+method. Help is available using the Python help command, e.g.:
+
+```
+$ cd pylibfdt
+$ python3 -c "import libfdt; help(libfdt)"
+```
+
+If you add new features, please check code coverage:
+
+```
+$ sudo apt-get install python3-coverage
+$ cd tests
+# It's just 'coverage' on most other distributions
+$ python3-coverage run pylibfdt_tests.py
+$ python3-coverage html
+# Open 'htmlcov/index.html' in your browser
+```
+
+The library can be installed with pip from a local source tree:
+
+```
+$ pip install . [--user|--prefix=/path/to/install_dir]
+```
+
+Or directly from a remote git repo:
+
+```
+$ pip install git+git://git.kernel.org/pub/scm/utils/dtc/dtc.git@main
+```
+
+The install depends on libfdt shared library being installed on the
+host system first. Generally, using `--user` or `--prefix` is not
+necessary and pip will use the default location for the Python
+installation which varies if the user is root or not.
+
+You can also install everything via make if you like, but pip is
+recommended.
+
+To install both libfdt and pylibfdt you can use:
+
+```
+$ make install [PREFIX=/path/to/install_dir]
+```
+
+To disable building the python library, even if swig and Python are available,
+use:
+
+```
+$ make NO_PYTHON=1
+```
+
+More work remains to support all of libfdt, including access to numeric
+values.
+
+
+## Adding a new function to libfdt.h
+
+The shared library uses `libfdt/version.lds` to list the exported
+functions, so add your new function there. Check that your function
+works with pylibfdt. If it cannot be supported, put the declaration in
+`libfdt.h` behind `#ifndef SWIG` so that swig ignores it.
+
+
+## Tests
+
+Test files are kept in the `tests/` directory. Use `make check` to build and run
+all tests.
+
+If you want to adjust a test file, be aware that `tree_tree1.dts` is compiled
+and checked against a binary tree from assembler macros in `trees.S`. So
+if you change that file you must change `tree.S` also.
+
+
+## Mailing lists
+
+* The [devicetree-compiler](mailto:devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
+  list is for discussion about dtc and libfdt implementation.
+* Core device tree bindings are discussed on the
+  [devicetree-spec](mailto:devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) list.
+
-- 
2.37.1


  parent reply	other threads:[~2022-07-28  7:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28  7:53 [PATCH 0/4] Updates to README file David Gibson
     [not found] ` <20220728075348.174412-1-david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
2022-07-28  7:53   ` David Gibson [this message]
2022-07-28  7:53   ` [PATCH 2/4] Remove Jon Loeliger from maintainers list David Gibson
2022-07-28  7:53   ` [PATCH 3/4] Split out information for contributors to CONTRIBUTING.md David Gibson
2022-07-28  7:53   ` [PATCH 4/4] Add description of Signed-off-by lines David Gibson
     [not found]     ` <20220728075348.174412-5-david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
2022-07-28 16:08       ` Uwe Kleine-König
     [not found]         ` <20220728160800.xiexlk52grqxre3j-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2022-07-29  2:57           ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220728075348.174412-2-david@gibson.dropbear.id.au \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=loeliger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).