All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Add fdtget and fdtput for access to fdt from build system
@ 2011-09-07 19:54 Simon Glass
       [not found] ` <1315425260-2711-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  0 siblings, 1 reply; 28+ messages in thread
From: Simon Glass @ 2011-09-07 19:54 UTC (permalink / raw)
  To: Devicetree Discuss

This patch set adds two new utilities:

   fdtget for reading properties from a device tree binary file
   fdtput for updating the device tree binary file

These are useful in scripts where configuration or other information must be
passed to the running system from the build system or vice versa. For
example, fdtget can be used to obtain the LCD screen width/height for use
with preparing custom bitmap images for display on the screen. Going the
other way, fdtput can be used to set configuration parameters known only to
the build or manufacturing test system, for example a hardware ID or the
particular type of boot EEPROM used on this PCB.

It is desirable to use these utilities rather than parsing or updating the
device tree source file, since this parsing is already implemented in dtc and
it makes no sense to reimplement it in a script. It also means that the build
system and the run-time environment see the same device tree values, so that
parsing or updating bugs do not creap in.

I believe that these utilities belong with dtc rather than libfdt since they
are more useful in the build system context rather than at run-time. At
run-time it is easier and better to use the provided library rather than
these utiltiies. But for build scripts and production automation, these
uitilites are better.

Some effort has been made to add tests and the parameter format has been
revised after previous feedback.

Changes in v2:
- Adjust tests for new fdtput arguments
- Add test for multiple strings
- Add test for exhausting fdt space
- Separate arguments for node and property
- Remove limits on data size of property writting to fdt
- Remove use of getopt_long()
- Adjust tests for new fdtget arguments
- Merge two related commits into this one
- Use structure for storing display options
- Remove util_decode_key
- Add utilfdt_decode_type to be used by fdtget/put
- Remove limits on device tree binary size

Simon Glass (6):
  Add utilfdt for common functions
  ftdump: use util_read_fdt
  Add fdtget utility to read property values from device tree
  fdtget: Add basic tests
  Add new fdtput utility to write values to fdt
  fdtput: Add basic tests

 .gitignore              |    2 +
 Makefile                |   12 +++-
 Makefile.fdtget         |   12 +++
 Makefile.fdtput         |   12 +++
 Makefile.ftdump         |    3 +-
 fdtget.c                |  200 +++++++++++++++++++++++++++++++++++++++++++
 fdtput.c                |  217 +++++++++++++++++++++++++++++++++++++++++++++++
 ftdump.c                |   33 +------
 tests/fdtget-runtest.sh |   35 ++++++++
 tests/fdtput-runtest.sh |   55 ++++++++++++
 tests/run_tests.sh      |  105 ++++++++++++++++++++++-
 tests/tests.sh          |    2 +
 utilfdt.c               |  120 ++++++++++++++++++++++++++
 utilfdt.h               |   58 +++++++++++++
 14 files changed, 835 insertions(+), 31 deletions(-)
 create mode 100644 Makefile.fdtget
 create mode 100644 Makefile.fdtput
 create mode 100644 fdtget.c
 create mode 100644 fdtput.c
 create mode 100755 tests/fdtget-runtest.sh
 create mode 100644 tests/fdtput-runtest.sh
 create mode 100644 utilfdt.c
 create mode 100644 utilfdt.h

-- 
1.7.3.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2011-09-19 15:11 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-07 19:54 [PATCH v2 0/6] Add fdtget and fdtput for access to fdt from build system Simon Glass
     [not found] ` <1315425260-2711-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-07 19:54   ` [PATCH v2 1/6] Add utilfdt for common functions Simon Glass
     [not found]     ` <1315425260-2711-2-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-08  5:20       ` David Gibson
     [not found]         ` <20110908052028.GQ30278-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-08 12:37           ` Simon Glass
     [not found]             ` <CAPnjgZ1J0k93vo1A5ns5OxW5=nesr9pwLMMPAc+gyaOWmtmwuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-09  2:34               ` David Gibson
2011-09-07 19:54   ` [PATCH v2 2/6] ftdump: use util_read_fdt Simon Glass
2011-09-07 19:54   ` [PATCH v2 3/6] Add fdtget utility to read property values from device tree Simon Glass
     [not found]     ` <1315425260-2711-4-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-08  5:25       ` David Gibson
     [not found]         ` <20110908052547.GR30278-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-08 12:47           ` Simon Glass
     [not found]             ` <CAPnjgZ0qnr8VVOX7kCq6wEZ-OxAsxmHkPcTGE7wu1B_9ME_SPA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-09  4:49               ` David Gibson
     [not found]                 ` <20110909044945.GF21002-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-09  5:44                   ` Simon Glass
     [not found]                     ` <CAPnjgZ3xw7ByV4Yzeot3zgs4oo0zciX2OV_V4vfQ8tGsgLcPvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-12  0:53                       ` David Gibson
     [not found]                         ` <20110912005357.GI9025-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-12  4:34                           ` Simon Glass
     [not found]                             ` <CAPnjgZ1vevcwCQU+uyjAA3YZd--RhU9MgAF8O8G4Hr5e4CYo_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-16  8:18                               ` David Gibson
     [not found]                                 ` <20110916081804.GF9025-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-16 16:25                                   ` Simon Glass
     [not found]                                     ` <CAPnjgZ1LUPm9mRft5q=KHGe2h2+Masdh0kGXQ-7j1VTUDsMP7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-19  2:04                                       ` David Gibson
     [not found]                                         ` <20110919020440.GA15001-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-19  5:46                                           ` Simon Glass
     [not found]                                             ` <CAPnjgZ09mO06uruZtC=86BuitUWtQkGQfaHTf25HXK9KzoiD+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-19  8:05                                               ` David Gibson
     [not found]                                                 ` <20110919080557.GA29197-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-19 15:11                                                   ` Simon Glass
2011-09-07 19:54   ` [PATCH v2 4/6] fdtget: Add basic tests Simon Glass
     [not found]     ` <1315425260-2711-5-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-08  5:27       ` David Gibson
2011-09-07 19:54   ` [PATCH v2 5/6] Add new fdtput utility to write values to fdt Simon Glass
     [not found]     ` <1315425260-2711-6-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-08  5:32       ` David Gibson
     [not found]         ` <20110908053209.GT30278-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-08 12:51           ` Simon Glass
     [not found]             ` <CAPnjgZ2UNjxTz9=sWJ8JFq=AXF1NS4dG6C_BkyHvfDf=ZMVpmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-08 13:00               ` David Gibson
2011-09-07 19:54   ` [PATCH v2 6/6] fdtput: Add basic tests Simon Glass
     [not found]     ` <1315425260-2711-7-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-08  5:32       ` David Gibson
     [not found]         ` <20110908053235.GU30278-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-08 12:55           ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.