Commit Graph

43 Commits

Author SHA1 Message Date
Kyle Evans
67b60a1b7d dtc(1): Update to 0892ec7; HACKING and implicit header fixes
Fixes courtesy of arichardson and jmg:
- HACKING was pointing to the wrong place
- Added headers were being relied on implicitly, but libstdc++ did not
  comply with the unspoken wishes of dtc.

MFC after:	1 week
2018-08-23 02:26:40 +00:00
John-Mark Gurney
9d58ffcf21 minor grammar nit, to what? between them.. 2018-08-21 15:11:43 +00:00
Kyle Evans
1a36f105a4 dtc(1): Update to 97d2d5715eeb45108cc60367fdf6bd5b2046b050
Notable fixes:
- Overlays may now be generated properly without -@
- /__local_fixups__ were not including unit address in their structure
- The error reporting a magic token was misleading, reporting
  "Bad magic token in header.  Got d00dfeed expected 0xd00dfeed"
  if the token was missing. This has been split out into a separate message.

MFC after:	1 week
2018-08-17 13:24:48 +00:00
Kyle Evans
e69f393430 dtc(1): Update to upstream 006664a
Highlights:

- Passing "-" to -o will now cause output to go to stdout
- Path-based syntactic sugar for overlays is now accepted. This looks like:

/dts-v1/;
/plugin/;

&{/soc} {
    sid: eeprom@1c14000 {
        compatible = "allwinner,sun8i-h3-sid";
        reg = <0x1c14000 0x400>;
        status = "okay";
    };
};

MFC after:	3 days
2018-04-13 18:04:51 +00:00
Kyle Evans
839bbb1c21 dtc(1): Revert WARNS change from r328173
WARNS > 3 breaks xtoolchain builds to varying degrees. Revert it.

Reported by:	lwhsu, jhb
MFC after:	3 days
2018-01-31 22:20:33 +00:00
Kyle Evans
ca84c67cd0 dtc(1): Update to upstream ea3c233
Highlights of this update:
- /__local_fixups__ is now generated to be GPL dtc and libfdt compliant
- Compiling with -@ will now cause dtc to assign phandles to all labelled
  nodes
- /include/ and /incbin/ now handle absolute paths correctly
- The manpage now has information about overlays, including how to apply
  them and how to generate them
- Syntactic sugar for overlays is now supported, allowing an overlay DTS
  like:

=
/dts-v1/;
/plugin/;

&foo {
    foo,status = "okay";
};
=

to generate a fragment targetting <&foo>.
2018-01-19 21:20:24 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Emmanuel Vadot
b2dba1f64b dtc: Update to upstream 9ce35ff8
- Add "compatible with gpl dtc X.Y.Z" to version output so U-Boot doesn't complain
 - Fix cross reference node

This fixes some Allwinner DTS (and probably others).
2017-06-23 20:21:53 +00:00
Emmanuel Vadot
8b4debd261 dtc: Update to upstream 917526
- Add missing "typename" in divmod's  "using" of binary_operator_base::result.
2017-06-20 18:29:01 +00:00
Ed Maste
21d5d37ba4 dtc: update to upstream 227d6a3
- Report missing includes at the correct location.
- Add initial support for the -@ option emitting a symbol table.
- Add support for running tests with and without -@
- Add support for generating __fixups__ and __local_fixups__
- Attach the to-string transform to the node path.
2017-04-17 17:23:19 +00:00
Ed Maste
654fdfe87a dtc: remove unused (since r306806) string.hh 2017-04-17 17:18:49 +00:00
Dimitry Andric
23cba92bd3 Fix build of BSD dtc when NDEBUG is defined (MK_ASSERT_DEBUG=no):
* Initialize correct parent in binary_operator's constructor.
* Include <errno.h> explicitly, otherwise errno is undefined (without
  NDEBUG, this is accidentally 'fixed' by including <iostream>).

Reported by:	matteo
MFC after:	3 days
2017-02-13 20:56:53 +00:00
Raphael Kubo da Costa
be5d5a33e6 fdt: Expect strchr() to return a const char*
In C, strchr(3) returns a char*, whereas C++ defines two overloads:
* const char *strchr(const char*, int)
* char *strchr(char*, int)

Building fdt.cc (with the WITHOUT_GPL_DTC knob set) with libc++ 3.9.0 (imported
in r309124) was failing because libc++ r260377 added the first overload to
string.h, leading to failures such as:

    fdt.cc:1638:8: error: cannot initialize a variable of type 'char *' with an
    rvalue of type 'const char *'

Just define val as a const char* to fix it.

Upstreamed in https://github.com/davidchisnall/dtc/pull/14

Reviewed by:	emaste
Approved by:	emaste
2016-11-26 12:36:11 +00:00
Ed Maste
bbe31b709a Improvements to BSD-licensed DTC.
- Numerous crash and bug fixes
- Improved warning and error messages
- Permit multiple labels on nodes and properties
- Fix node@address references
- Add support for /delete-node/
- Consume whitespace after a node
- Read the next token before the second /memreserve/
- Fix parsing of whitespace
- Clean up /delete-node/ and add support for /delete-property/
- Handle /delete-node/ specifying a unit address

Obtained from:	https://github.com/davidchisnall/dtc @df5ede4
2016-10-07 12:57:35 +00:00
David Chisnall
c64a3eaf92 Improvements to BSD-licensed DTC.
- Added an expression parser so that expressions from headers are now working
- Fixed missing null terminators on cross references
- Disabled exceptions / RTTI in the build for smaller binaries
- Changed phandle order generation to be identical to GPL'd dtc
2015-12-29 16:29:42 +00:00
Bryan Drewery
b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
David Chisnall
70d7ec6737 Update some obsolete information in the HACKING document.
Reported by:	bapt
2015-10-26 11:02:57 +00:00
David Chisnall
e713ba26f2 Ensure that dtc is built in C++11 mode.
Reported by:	George Abdelmalik
2015-10-26 10:37:17 +00:00
David Chisnall
a0706eb457 Lots of improvements to the BSD-licensed dtc
- Various fixes to includes (including recursive includes)
- Lots of testing that the output exactly matches GPL'd dtc
- Lots of bug fixes to merging
- Fix incorrect mmap usage
- Ad-hoc memory management replaced with C++11 unique_ptr and similar

Patrick Wildt has successfully run many (all?) of the GPL dtc test suite.
2015-10-25 14:52:16 +00:00
Eitan Adler
463a577b27 Fix a ton of speelling errors
arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337
2015-10-21 05:37:09 +00:00
Rui Paulo
7f78c17319 dtc: ignore lines starting with #.
This is necessary because we use the C pre-processor to parse #include lines
and cpp adds line markings that start with #.
2014-06-10 06:16:34 +00:00
Rui Paulo
23afbfa96e dtc: don't crash if the argument is a directory. 2014-06-10 06:04:25 +00:00
Rui Paulo
b60aab0101 The, currently undocumented, -i option takes an argument. 2014-06-10 05:58:46 +00:00
Warner Losh
dbb83b6af0 Fix cut-and-paste error message. 2014-03-15 00:58:08 +00:00
David Chisnall
aaeeeec365 Fix parsing multiple roots with whitespace between them.
Patch by:   Patrick Wildt
2014-02-23 21:13:07 +00:00
David Chisnall
e00bea9e62 Some more cleanups and bug fixes in dtc for property printing / parsing.
Submitted by:	Patrick Wildt
2013-12-12 08:55:24 +00:00
David Chisnall
ae893e1ad9 Fix the version string in dts emission.
Reported by:	Patrick Wildt
MFC after:	1 week
2013-12-12 08:48:45 +00:00
David Chisnall
5ad287fa88 When writing DTS to a file, don't write some of it to stderr.
Reported by:	ray
2013-11-05 14:07:30 +00:00
Joel Dahl
a0b4f76799 Remove EOL whitespace. 2013-08-22 16:01:20 +00:00
David Chisnall
88169e0388 Add support for parameterised device tree sources to the device tree compiler.
Reviewed by:	brooks
Sponsored by:	DARPA, AFRL
2013-08-19 12:37:13 +00:00
David Chisnall
8d9c809950 Make carets line up in dtc diagnostics if the line starts with a tab. 2013-08-14 14:34:02 +00:00
David Chisnall
3334a61716 Report error for out-of-range numerical inputs. Requested by brooks. 2013-07-10 10:57:09 +00:00
David Chisnall
95b63ba99b Fix bug in destructor for checker manager in DTC that caused segfaults on
exit.
2013-06-18 10:26:22 +00:00
David Chisnall
e29c18df28 Add a checker to dtc, based on a feature request from rwatson / brooks.
This checks that every node that has children specifies their register sizes.
This is not enabled by default, as the default sizes are sometimes required
(including by some DTS in the tree), but can help when writing new device
trees so that you can check that you actually meant the defaults.
2013-06-17 15:34:22 +00:00
Ulrich Spörlein
eaef137cbe dtc: fix bootstrapping from 8.2-STABLE
MFC after:	1 week
Approved by:	theraven
2013-02-19 18:28:25 +00:00
David Chisnall
03d37d34cc Fix style nit in dtc man page: sentences should start on new lines.
Reported By:	joel
2013-01-25 08:34:38 +00:00
David Chisnall
009f7b425d Explicitly include headers that are implicitly included by libstdc++. Fixes
building dtc with libc++.
2013-01-23 08:54:34 +00:00
Joel Dahl
3917cbe067 Remove EOL whitespace. 2013-01-22 18:35:42 +00:00
Joel Dahl
2d943d5b94 Minor mdoc fixes. 2013-01-22 18:33:31 +00:00
David Chisnall
b5383b7b85 Fix the missing sentence that ended in the middle in the man page for dtc (also
spotted by gavin).
2013-01-22 18:15:43 +00:00
David Chisnall
45688d5d5f Fix logic error in explicitly specified dtb versions spotted by gavin. 2013-01-22 18:12:31 +00:00
David Chisnall
af0dd31fc4 Import new (BSDL) device tree compiler. Now built by default, so that it can't
be used on the host system (and not installed on the device, if required).  The
GPL'd one is still available if there are any devices that need it (make
universe passes with it, including kernels that use fdt, but there may be some
out-of-tree ones).  WITH_GPL_DTC can be used to select the old one, for now.

Probably won't be MFC'd, but we'll remove the GPL'd version in head after the
new one has had a lot more testing and ship it in 10.0.
2013-01-22 17:49:51 +00:00