Commit graph

318 commits

Author SHA1 Message Date
Erwan Gouriou 6c8617a5ed scripts/dts: gen_defines: Generates _EXISTS for names and index macros
Add generation of the following macros:
DT_N_<node-id>_P_<prop-id>_NAME_<NAME>_EXISTS
DT_N_<node-id>_P_<prop-id>_IDX_<idx>_EXISTS
This will be useful to check availability of named or indexed
property like dmas/dma-names.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-13 07:37:11 -05:00
Anas Nashif b90fafd6a0 kernel: remove unused offload workqueue option
Those are used only in tests, so remove them from kernel Kconfig and set
them in the tests that use them directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-12 18:42:27 -04:00
Peter A. Bigot c790783c2e cmake: add support for user-defined board aliases
Zephyr board names must be globally unique which requires that they
encode all necessary information to identify a specific target.
Typing in these names can be inconvenient to developers working on
multiple targets within a single workspace.

Extend the cmake infrastructure to read an optional board aliases file
that will map custom aliases to the corresponding canonical Zephyr
board name.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-04-09 14:38:36 +02:00
Martí Bolívar 488294368f doc: west: link to modules page instead of source code
When this west doc page was written, we didn't have any documentation
for modules. We do now, so point to it instead of CMake.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-08 12:00:44 -05:00
Martí Bolívar 63d5529a0d devicetree: re-work DT_INST_FOREACH()
Due to the use of UTIL_EVAL*() macros, the UTIL_LISTIFY() macro used
by DT_INST_FOREACH(foo) can cause long build errors when there is a
build error in the expansion for "foo". More than a thousand lines of
build error output have been observed for an error in a single line of
faulty C.

To improve the situation, re-work the implementation details so the
errors are a bit shorter and easier to read. The use of COND_CODE_1
still makes the error messages quite long, due to GCC generating notes
for various intermediate expansions (__DEBRACKET,
__GET_ARG_2_DEBRACKET, __COND_CODE, Z_COND_CODE_1, COND_CODE1), but
it's better than the long list of UTIL_EVAL notes.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-08 09:00:38 -05:00
Carles Cufi 6656214af2 boards: nrf52_pca10040: Rename to nrf52dk_nrf52832
The board name for the nRF52 DK, so far known as nrf52_pca10040, is
renamed to nrf52dk_nrf52832.  Its documentation and all references
to its name in the tree are updated accordingly. Overlay and
configuration files specific to this board are also renamed, to
match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Martí Bolívar 8d5b998582 doc: west: add FAQ for requires_workspace issue #373
This is also a common problem.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-01 13:36:49 +02:00
Martí Bolívar 1c39ed8129 doc: west: add FAQ for missing extension command
"why can't I run west build" is a common enough question to add an FAQ
item for it in the troubleshooting page.

Even if people don't read it, we can still link to it on Slack etc.
when the question gets asked.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-01 13:36:49 +02:00
Martí Bolívar a3fae2f153 devicetree: add DT_COMPAT_ON_BUS()
And implement DT_ANY_INST_ON_BUS() in terms of it.

This makes some error messages quite a bit shorter by avoiding
UTIL_LISTIFY(), which has a nasty temper and tends to explode if not
treated gently.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-31 21:11:13 -05:00
Torsten Rasmussen db0b4e15e9 doc: Update documentation to describe use of find_package(Zephyr)
This commit changes the current boilerplate include description and
instead describes the use of find_package(Zephyr)

It also add a section covering additional possibilities when using
find_package(Zephyr).

- Search order
- Zephyr repository application description
- Zephyr workspace application description
- Zephyr freestanding application description
- Environment ZEPHYR_BASE setting
- Multiple Zephyr and preference setting

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Andrzej Głąbek 4253eae005 boards: nrf52840_pca10056: Rename board to nrf52840dk_nrf52840
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_nrf52840.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-27 09:14:08 +01:00
Ioannis Papamanoglou 03700763e6 doc: dts: update devicetree howto to use DT_INST_FOREACH
Updated howto "create struct devices in a driver" section to use
DT_INST_FOREACH instead of manual per-instance macros.

Signed-off-by: Ioannis Papamanoglou <iopapamanoglou@gmail.com>
2020-03-26 11:15:38 -05:00
Martí Bolívar fc40757441 doc: dts: property deletion example fix
Improve the text and delete an unnecessary comment.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-26 11:04:29 -05:00
Martí Bolívar e3e296084a doc: dts: add missing word
Trivial fix.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-26 03:29:01 -05:00
Martí Bolívar 06f609cd56 doc: dts: fix DT_PROP_LEN for reg / interrupts
The documentation was not updated following a change to the way
DT_PROP_LEN works which was made in review. Fix it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-26 03:29:01 -05:00
Martí Bolívar 0206feb6bc doc: west: add pointer to board porting guide for flash/debug
The board porting guide now has useful information on supporting
flash/debug commands. Link to it from the top of the page describing
these commands to hopefully make it easier to find.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-25 19:43:30 +01:00
Martí Bolívar 6e57b42758 doc: dts: revisit documentation
This is joint work with Kumar Gala (see signed-off-by).

Document the changes to the generated node macros in macros.bnf,
moving the old file to legacy-macros.bnf and putting it in its own
section.

The actual generated macros are now a low-level detail, so rewrite the
foregoing sections as examples in terms of the new <devicetree.h> APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-24 10:11:20 -05:00
Sebastian Bøe 55894dde58 doc: Kconfig: Document how whitespace is used in Kconfig sources
Document how whitespace is used in Kconfig sources. This serves as an
authoritative reference in code review.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2020-03-18 15:16:29 -05:00
Carles Cufi bf41dd943b doc: reference: Clean up and restructure a bit
Name all subsystem reference consistently with an '_api' postfix and
clean up naming and folder structure in some cases.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-18 11:47:24 +01:00
Andrew Boie 28be793cb6 kernel: delete separate logic for priv stacks
This never needed to be put in a separate gperf table.
Privilege mode stacks can be generated by the main
gen_kobject_list.py logic, which we do here.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-03-17 20:11:27 +02:00
Andrew Boie 2dc2ecfb60 kernel: rename struct _k_object
Private type, internal to the kernel, not directly associated
with any k_object_* APIs. Is the return value of z_object_find().
Rename to struct z_object.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-03-17 20:11:27 +02:00
Erwan Gouriou 5b2d17ab42 doc: board_porting: Provide guideline on MPU activation
Provide a rule to settle on MPU activation by default.
Request is to activate it by default if board resources allow.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-03-12 11:28:58 +02:00
Martí Bolívar fe6107f2b3 doc: finish reworking the board porting guide
Now that the west parts of this file are in better shape, it seems a
shame not to flesh out the rest a bit more.

It's been a while since we looked at this document, as it's still
referring to boards (like Arduino 101) that are no longer supported by
Zephyr, and is generally lacking in concrete, step-by-step advice
for going from zero to working board.

Let's fix that.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-06 19:31:06 +02:00
Martí Bolívar 180cbf1a00 doc: more board porting improvements
Incorporate more feedback suggested in #23080.

Suggested-by: Lucian Copeland <hierophect@gmail.com>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-04 22:37:52 +02:00
Carles Cufi f80164525f samples: blinky: Improve documentation
Improve the documentation of the blinky sample, fixing typos, adding
links to the relevant DT documentation and cleaning up a bit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-04 21:50:43 +02:00
Martí Bolívar f2469ce576 doc: board_porting: add link to west flash/debug info
Makes this page a little more visible to porters.

Suggested-by: Lucian Copeland <hierophect@gmail.com>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-03 09:30:32 +02:00
Martí Bolívar 647fe7a47a doc: dts/macros.rst: "clocks" macro fixes
The "fixed-clock" value referenced in the documentation is actually a
compatible value, not a property name. Fix that.

Harden the "expected to have a clock-frequency property" language to
use "must" instead of "expected". The scripts error out if a node with
fixed-clock compatible is missing a clock-frequency property; it's not
a soft expectation.

Be explicit about clock-frequency units.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-28 12:50:36 +02:00
Alexander Wachter 57bd09186b boards: Remove "supported: -hwinfo" from all boards
Remove all "supported: -hwinfo" definitions from the boards
yaml files and documentation. hwinfo can generally be tested
on every board because it returns -ENOTSUP if not supported.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Martí Bolívar 90edd01644 doc: west: 'west installation' is now 'west workspace'
This nomenclature change was done in west 0.7 because it seems to be a
lot easier for people to understand. Propagate it to all the west
documentation.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-25 23:08:02 +02:00
Martí Bolívar c3ddea01f2 doc: west: update structure page
The main change is that west 0.7 is not a namespace package anymore.
Make some other improvements while here.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-25 23:08:02 +02:00
Martí Bolívar 62c5b3d198 doc: west: add examples for each topology
Add example west.yml files showing how to build west workspaces of
each type. Split these into separate sections as a result since
they're longer.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-25 23:08:02 +02:00
Martí Bolívar 8f740f9edf doc: dts/howtos.rst tweaks
A couple of tweaks and a TODO. I think this page could still use some
more love.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-21 12:42:40 -06:00
Martí Bolívar 9fbe872172 doc: dts/macros.rst improvements
Syntax highlight all the DTS fragments, add more internal
cross-referencing to making jumping around the HTML easier, and tweak
the language, filling in a missing piece here and there.

Fix a couple of DTS syntax errors caught by adding highlighting.

Add an ABNF grammar for the macros generated by DT, along with
some comments about why the current grammar is not ideal from a
generality point of view.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-21 12:42:40 -06:00
Martí Bolívar 0bcf84b155 doc: dts/intro.rst improvements
Syntax highlight all the DTS fragments and add some more explanatory
text.

Split the content about important properties into its own section, and
add a similar section about unit addresses.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-21 12:42:40 -06:00
Martí Bolívar 98c1828254 doc: dts/bindings.rst improvements
Add more cross-references, improve section titles, syntax highlight
DTS fragments, and improve some descriptions.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-21 12:42:40 -06:00
Martí Bolívar 93237fcdde doc: dts: pacify checkpatch in macros.rst
This is old text, but checkpatch is complaining since it was
introduced into itso wn file.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-20 12:15:27 +02:00
Martí Bolívar 3a2417443f doc: dts: add design goals defining the scope of DT
Add a page describing the high-level design goals for how Zephyr
should use DT, with examples and counter-examples from current
practice.

Add a TBD section for code generation. It's not clear (to me at least)
where the discussion on that has landed.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-20 12:15:27 +02:00
Martí Bolívar a20241540b doc: dts: clean up introduction
Combine various bits of information that were formerly scattered about
into a logical order, and fix a few mistakes.

Make some policy changes, e.g. discouraging the use of fixup macros.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-20 12:15:27 +02:00
Martí Bolívar 51b885019e doc: split devicetree docs into multiple pages
The one page on devicetree is too long. Split it into multiple pages
to make it easier to digest and more squintable. This is basically
just moving content around; minimal changes have been made apart from
redoing some transitions and adding a couple of introductory paragraphs.

Rename the 'device-tree' Sphinx :ref: target while we are here.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-20 12:15:27 +02:00
Piotr Mienkowski 62fc80deea doc: Update "Linking Zephyr Within a Partition" section
The method used to link code partition, as defined by
zephyr,code-partition has been modified in Zephyr 1.14. Update the
"Linking Zephyr Within a Partition" section to reflect the change.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-19 07:30:43 -06:00
Ulf Magnusson 47963cae3f doc: dts: Add lots of documentation for generated macros
Add detailed documentation for macros that get generated by
gen_defines.py. Covers properties, interrupts, phandle-arrays, clocks,
buses, flash partitions, SPI, etc.

Should be relatively complete now, though there might be overlooked
details.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Co-Authored-By: Kumar Gala <kumar.gala@linaro.org>
Co-Authored-By: Marti Bolivar <marti.bolivar@nordicsemi.no>
2020-02-18 15:24:59 -06:00
Anas Nashif 9961b89b17 doc: fixed path for ctf metadata
Point to new location of metadata file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-07 15:58:05 -05:00
Anas Nashif 73008b427c tracing: move headers under include/tracing
Move tracing.h to include/tracing/ to align with subsystem reorg.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-07 15:58:05 -05:00
Anas Nashif fab2d788ae doc: add a note about required lcov version
Add a note about min. version of lcov required with intermediate text
format support.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-07 15:14:24 -05:00
Martí Bolívar b4fde33243 doc: west: 0.7.0 documentation
Reflect changes in the APIs made since 0.6.0. These will also need to
be added to the release notes.

Some automatic directives weren't generating the desired output, so
either do it by hand or let new 0.7.0 docstrings supply the information.

Try to better group the content into sections.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-07 07:25:41 -06:00
Martí Bolívar c20a081423 doc: west: document manifest import feature
West now supports importing other manifest files. Document the basic
behavior.

Add a local table of contents for HTML output, to get a quick index of
the subsections of the "Manifest Imports" section.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-07 07:25:41 -06:00
Martí Bolívar 957476ccae doc: west: add "git." prefix to URL hosts
By request, for clarity.

Suggested-by: Carles Cufí <carles.cufi@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-07 07:25:41 -06:00
Martí Bolívar 9008578e4f doc: west: add docs for west manifest --validate
This is supported but undocumented.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-07 07:25:41 -06:00
Martí Bolívar 1dafe7aa9c doc: west: move manifest command docs to manifest.rst
This is just a prep work commit for documenting ``west manifest
--merge``.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-07 07:25:41 -06:00
Wentong Wu 10a669ea87 tracing: ctf: adapt ctf implementation to tracing infrastructure
Adapt ctf implementation to tracing infrastructure.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-02-05 23:54:26 -05:00
Andrei Gansari 820f2bf467 doc: device tree - document pre_dt_board.cmake
Document pre_dt_board.cmake file usage.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-02-05 13:04:44 -06:00
Anas Nashif e0e31eb296 doc: fix links to www.zephyrproject.org
Lots of broken links after the website update. Fix them or point to
alternatives.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-03 17:22:18 -05:00
Ulf Magnusson 6648fe428a doc: devicetree: Update outdated diagram and mention zephyr.dts
zephyr_dt_inputs_outputs.svg still shows the output from dtc being used,
but dtc is unused (except for finding warnings/errors) after the old
devicetree scripts were removed in commit c8c35f76ab ("scripts: dts:
Remove deprecated extract_dts_includes.py script").

Update zephyr_dt_inputs_outputs.svg to show how things are done now.
Also include the new zephyr.dts debugging aid in it. Tweak the
formatting a bit too.

Add zephyr.dts to the diagram in the build overview section too, and
mention zephyr.dts in the text of the devicetree and build overview
pages.

Remove zephyr_dt_inputs_outputs.png and use zephyr_dt_inputs_outputs.svg
directly. Many other places the documentation include SVGs directly, and
there haven't been any complaints, so it probably works fine. The .png
and .svg versions had also drifted out of sync.

Piggyback a link from the devicetree page to the build overview page, to
make it easier to discover.

(I used draw.io to update the diagrams.)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-30 04:27:39 -06:00
Ulf Magnusson 31822c6d5b doc: kconfig: Explain why zephyr/.config assigns promptless symbols
I think a lot of the confusion with promptless symbols being assigned
might come from opening zephyr/.config, seeing that it assigns a bunch
of promptless symbols, and assuming that Kconfig must respect those
assignments, even though it doesn't.

Explain why zephyr/.config assigns promptless symbols (it's because it
doubles as configuration output). That should clarify things a bit.

Also mention what "invisible" means for symbols early on in the page.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-23 12:32:42 +01:00
Ulf Magnusson dbed9027ba doc: build overview: Improve diagram, fix errors/stale info, misc.
Diagram and text improvements:

 - Redraw the configuration phase diagram to better reflect the actual
   logic. Remove some misleading arrows, like from devicetree.h to
   Kconfig. Kconfig uses the devicetree scripts directly.

 - After the old devicetree scripts were removed in commit c8c35f76ab
   ("scripts: dts: Remove deprecated extract_dts_includes.py script"),
   the dtc compiler is only run to catch any high-level warnings and
   errors from it. The output is unused.

   Update the diagram and descriptions to explain how dtc is used.

 - Mention kconfigfunctions.py and explain better how devicetree and
   Kconfig interact

 - Clarify that 'cpp' is the C preprocessor. People often confuse it
   with C++.

 - Fix a typo'd devicetree_fixups.h in the text

 - Use the :file: role for files instead of italic text

 - Add links to the devicetree and Kconfig sections of the manual, and
   use the :zephyr_file: role to turn more files into direct links

 - Make the text generic re. Make vs. Ninja

 - Lots of other minor tweaks and clarifications

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-21 22:36:35 -05:00
Andrzej Puzdrowski 68f51f66c6 doc: cleanup after NFFS removal
Patch introduce references to LittleFS instead of NFFS where it
was suitable. In other places NFFS mentions were removed

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Ulf Magnusson c08565dad4 doc: Link to Documentation Generation from Documentation Guidelines
Gerson Fernando Budke missed the Documentation Generation page. Nice to
link to it from the Documentation Guidelines page, in case people are
looking for documentation information and find it first.

Maybe the two pages could be put under a common Documentation section
too, though it's nice to have Documentation Generation clearly visible
in the top-level User Guides index.

Co-authored-by: Gerson Fernando Budke <nandojve@gmail.com>
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-20 10:12:19 -05:00
Ulf Magnusson 1810840afe doc: Move Documentation Guidelines right after Documentation Generation
List Documentation Guidelines right after Documentation Generation in
the index for User and Developer Guides. Makes it easier to spot.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-20 10:12:19 -05:00
Ulf Magnusson 4e85006ba4 dts: Rename generated_dts_board*.{h,conf} to devicetree*.{h,conf}
generated_dts_board.h is pretty redundant and confusing as a name. Call
it devicetree.h instead.

dts.h would be another option, but DTS stands for "devicetree source"
and is the source code format, so it's a bit confusing too.

The replacement was done by grepping for 'generated_dts_board' and
'GENERATED_DTS_BOARD'.

Two build diagram and input-output SVG files were updated as well, along
with misc. documentation.

hal_ti, mcuboot, and ci-tools updates are included too, in the west.yml
update.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-17 17:57:59 +01:00
Ulf Magnusson a8fe2964ee boards: kconfig: Fix enabling USE_SEGGER_RTT for various boards
HAS_SEGGER_RTT is assigned by various Nordic boards, but assignments
have no effect on promptless symbols. This symbol is enabled through
being select'ed by SOC_SERIES_NRF52X.

Holyiot, nRF52833-PCA10100, nRF52840-PCA10056, and nRF52-PCA10040 only
assign HAS_SEGGER_RTT without assigning USE_SEGGER_RTT. They probably
meant to enable USE_SEGGER_RTT, so do that instead.

Also add a help text to HAS_SEGGER_RTT and a warning re. HAS_SEGGER_RTT
vs. USE_SEGGER_RTT to the documentation.

Flagged by https://github.com/zephyrproject-rtos/zephyr/pull/20742.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-17 17:03:40 +01:00
Ulf Magnusson 699b28a089 doc: dts: Remove 'title:' from binding example
'title:' was deprecated in commit 2934ee2cda ("dts: bindings: Remove
'title:' and put all info. into 'description:'"). Overlooked leftover.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-15 14:02:51 +01:00
Ulf Magnusson d3bdb67cd7 doc: dts: Use definition list for compatible/label/ref
See https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html.
Gives neater output compared to a bullet list.

Also tweak the text a bit.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 16:53:12 -05:00
Ulf Magnusson 0ddc7b819b doc: dts: Say <BOARD> instead of BOARD
Makes it clearer that it's not meant literally.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 16:53:12 -05:00
Ulf Magnusson 8d8b06978c dts: Remove generation of <BOARD>.dts_compiled
Unused after the old devicescript were removed in commit c8c35f76ab
("scripts: dts: Remove deprecated extract_dts_includes.py script"). The
old scripts relied on parsing the output of 'dts -Odts', which replaces
e.g. phandle references. The new scripts parse the DTS files directly.

Keep running the dtc compiler just to catch any warnings/errors from it.

The edit to doc/guides/build/build-config-phase.svg is to remove the box
with '*.dts_compiled' in it (and the arrows to/from it). https://draw.io
can be used to edit it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 16:53:12 -05:00
Ulf Magnusson 9f18df0274 doc: dts: Add more details, implementation notes, and examples
Rewrite most of the 'Input and output files' section to add more details
and implementation notes, and to make some description more more
concrete:

 - Mention dtlib, edtlib, and gen_defines.py, and explain what they do

 - Add an example of how macros get generated from the devicetree, and
   explain the DT_<node>_<property> format of the generated identifiers.

   Merge the 'Include files generation' section into the 'Input and
   output files' section at the same time.

 - Explain that the base devicetree and the overlays just get
   concatenated, and why this works

 - Add more details on how dts_fixup.h files work

 - Mention that the C dtc compiler is only run to catch errors and
   warnings from it

 - Mention that the concatenated devicetree appears in
   zephyr/<BOARD>.dts.pre.tmp

 - Mention /include/, which is the native DTS mechanism for including
   other files

 - Misc. other minor tweaks

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 16:53:12 -05:00
Ulf Magnusson 0ce04d66c4 doc: dts: Linkify Kconfig syms and explain a Kconfig reference gotcha
Turn the CONFIG_* identifiers in the /chosen table into links to the
Kconfig reference.

Also explain why devicetree information doesn't show up in the Kconfig
reference.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-09 15:20:58 +01:00
Ulf Magnusson 5b497cf7ce doc: dts: Explain better how devicetree and Kconfig fit together
It's cryptic that some identifiers for devicetree-related stuff start
with DT_*, while others start with CONFIG_*. Explain what's going on,
and link to the Kconfig preprocessor documentation.

Also remove an early mention of bindings that might be confusing.
Bindings are much more about checking devicetree conformance than about
controlling output, though they do some of that too.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-09 15:20:58 +01:00
Ulf Magnusson ca0c6a79d6 doc: dts: Add missing documentation for some /chosen properties
Not all /chosen properties were documented. Add the missing ones along
with the macros generated for them.

Found with some grepping for '\<zephyr,.*='.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-09 15:20:58 +01:00
Ulf Magnusson 51e7c55967 doc: dts: Fix outdated list of generated macro names
The *_ON_DEV_NAME macros generated from /chosen properties changed
prefix from DT_* to CONFIG_* in commit 8ce0cf0126 ("kconfig: Convert
device tree chosen properties to new kconfigfunctions"), but the
devicetree documentation still lists the old names. Update the
documentation with the correct anmes.

Also remove an outdated reference to
DT_SRAM_SIZE/DT_SRAM_BASE_REFERENCE, and give a complete list of
generated macros.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-09 15:20:58 +01:00
David B. Kinder 17299f0734 doc: document python build scripts
We have a collection of python scripts that are part of our build
system.  This PR collects docstring comments added to these scripts into
a summary document.  Previous references to just the script name in
other documentation are updated to point to this build tool
documentation.

Some of the scripts needed an update to be processed (via include
directives) consistently.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-02 17:09:29 -05:00
Erwan Gouriou 9055cfe57e doc/guides: shields: Document shield conditional configuration
Update doc with new Kconfig.shield files.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-02 17:02:41 -05:00
Erwan Gouriou 7533a65797 doc/guides: shields: Document possibility to enable several shields
It is actually possible to use several shields in the same project.
Reflect it in the shields documentation.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-02 17:02:41 -05:00
Carlo Caione aec9a8c4be arch: arm: Move ARM code to AArch32 sub-directory
Before introducing the code for ARM64 (AArch64) we need to relocate the
current ARM code to a new AArch32 sub-directory. For now we can assume
that no code is shared between ARM and ARM64.

There are no functional changes. The code is moved to the new location
and the file paths are fixed to reflect this change.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-12-20 11:40:59 -05:00
Ulf Magnusson 379145ffce scripts: edtlib: Rename 'child-bus:'/'parent-bus:' to 'bus:'/'on-bus:'
I keep mixing these up, so that's probably a sign that the names are
bad. The root of the problem is that "parent-bus" can be read as both
"this is the parent bus" and as "the parent bus is this".

Use 'bus:' for the bus "provider" and 'on-bus:' for nodes on the bus
instead, which is less confusing.

Support the old keys for backwards compatibility, along with a
deprecation warning.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-19 11:02:28 +01:00
Ulf Magnusson e9cf3e9963 doc: kconfig: Mention guiconfig on tips page
Mention guiconfig as well wherever menuconfig is mentioned.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-18 11:53:36 +01:00
Ulf Magnusson 28487d088f doc: kconfig: Cover a common gotcha related to "stuck" symbol values
Explain a common subtle Kconfig gotcha where it might appear that
symbols with prompts are incorrectly "stuck" to a particular value in
the menuconfig interface. I've seen it come up several times now, e.g.
in the discussion that lead to
https://github.com/zephyrproject-rtos/zephyr/pull/20702. I also suspect
it's what's causing
https://github.com/zephyrproject-rtos/zephyr/issues/20673.

Also give suggestions for how to make things behave as intended.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-18 11:53:36 +01:00
Anas Nashif c7ef4f0506 doc: modules: document out-of-tree samples/tests
Document how to configure out-of-tree tests/samples and boards in the
module.yml file to be used by sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-16 18:56:28 +01:00
Josh Gao 88ac292f77 doc: s/devicetree/device tree/
Commit 27e5dd13 fixed a bunch of uses of "device tree" in the
documentation, but accidentally hit the part of the documentation
that stated that "devicetree" should be preferred over "device tree".

Signed-off-by: Josh Gao <josh@jmgao.dev>
2019-12-13 18:47:23 +01:00
Ulf Magnusson 984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00
Martí Bolívar 0186eade51 scripts: add new west build "build.cmake-args" config option
This option, if set, will add arguments to CMake whenever a new build
system is being generated.

It doesn't affect other invocations of CMake, such as when cmake(1) is
run in build tool mode to actually compile the application.

See the documentation changes for details.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2019-12-10 16:19:18 +01:00
Anas Nashif 21847528a9 tests: document test identifier rules
Document test identifier rules.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-09 15:53:44 -05:00
Ulf Magnusson 05281b5b0d doc: kconfig: Add Kconfig intro to index page
Put a short Kconfig overview on the index page that links to the other
Kconfig documentation.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 17:33:36 +01:00
Ulf Magnusson e32686d0d6 doc: kconfig: Put all documentation on setting symbols on a new page
Add a new 'Setting Kconfig configuration values' page in the new Kconfig
section in 'User and Developer Guides'. Move all the information on
setting Kconfig symbols from 'Application Development' and the board
porting guide into it. The same page now covers both configuration files
and Kconfig.defconfig files.

Add links to the new page in various places to make it easy to find.
Also add some more references to the top-level Kconfig page and other
Kconfig pages.

A lot of stuff was rewritten while moving it over (the CONF_FILE
documentation has been cleaned up in particular). Some new information
has been added as well, like a tip re. minimal configurations being
helpful when making Kconfig settings permanent, and a warning re.
dependencies being ORed rather than ANDed when defining a symbol in
multiple locations.

Fixes: #20915

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 17:33:36 +01:00
Ulf Magnusson 4461bc7c54 doc: kconfig: Move menuconfig/guiconfig docs to user guide
Move the documentation for the menuconfig and guiconfig interfaces from
Application Development to a new Interactive Kconfig Interfaces page in
User and Developer Guides.

Also tweak Application Development to mention the configuration
interfaces earlier. It's good to encourage people to try things out in
menuconfig, because dependencies often get lost when people seldom run
it and just hand-edit files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 17:33:36 +01:00
Ulf Magnusson 5c7f2a3667 doc: kconfig: Move extension docs from porting guide to user guide
The Kconfiglib Kconfig extensions are documented in the porting guide,
which is a pretty weird place to document them. Document them under a
new page in the Kconfig section of User and Developer Guides instead.

Also remove the section about the old Zephyr Kconfig behavior for
defaults (tried last-to-first instead of first-to-last). The behavior
was changed 16 months ago (and was undocumented before that), so it
might not be that useful to mention anymore.

Piggyback misc. small language cleanups and organization nits.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 17:33:36 +01:00
Ulf Magnusson 4255bf948c doc: kconfig: Touch up preprocessor docs and put it on a separate page
Touch up the Kconfig preprocessor function documentation a bit and add
some more details to the example. Use the Kconfig preprocessor call
syntax instead of Python syntax in the function synopses.

Also move the preprocessor docs to a separate page, and add a top-level
Kconfig section to User and Developer Guides that links to the Kconfig
tips page and the preprocessor page.

Trying to avoid the Kconfig tips page becoming a dumping ground for
random Kconfig documentation.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 17:33:36 +01:00
David B. Kinder 416a174ac2 doc: fix misspellings in docs
Fix misspellings in docs (and Kconfig and headers processed into docs)
missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-12-04 14:12:53 -06:00
Erwan Gouriou bbcb352a92 doc/guides: Add clarifications to board porting guidelines
Additions:
- Provide clear description of a typical board port on zephyr
- Add a clear statement that peripherals should be disabled by
default (unless clearly specified)
- Add clear mentions on peripheral that should actually be enabled

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-12-02 20:01:29 -05:00
David B. Kinder 0a0c34fe77 doc: add recent documentation writing features
We've added some new capabilities for documentation writers such as the
tabbed interface and numbered instruction steps, as used in the updated
Getting Started Guide.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-11-24 13:32:49 +01:00
Anas Nashif 12d8cce8b7 sanitycheck: fix documentation of --discard-report
The discard report is now generated for every run as
sanity-out/sanitycheck_discard.csv, the option --discard-report was
dropped.

Fixes #20804

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-20 14:01:34 -05:00
Flavio Ceolin 05cb5b3ef0 docs: guide: Add build system information
A detailed overview of Zephyr's build system. This is a
thorough view of the low level build process starting from CMake and
using Make as the build system tool. Things missing here that will be
further documented:

- west
- external modules/libraries

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-11-15 14:58:51 -05:00
David B. Kinder 331214704c doc: New developer getting started guide
As presented to the TSC, Zephyr's out-of-box experience for new
developers is, well, complicated.  A number of suggestions were
presented including simplifying the getting started material to present
a straight-forward path through the setup and installation steps through
to getting a sample application built, flashed, and running.

This PR is a work-in-progress towards addressing this OOB experience
with a minimal-distractions version of the GSG. Alternatives, warnings,
and material that could lead the developer astray were moved to
alternative/advanced instruction documents (based on the previous
separate Linux/macOS/Windows setup guides) and a new "Beyond the GSG"
document.

We do take advantage of a sphinx-tabs extension for synchronized tabs to
present OS-specific instructions: clicking on one tab will display all
same-named tabs throughout the doc.

We hope (and will continue evaluating) that this new GSG gets developers
set up quickly and then we can send them along to other documents to
continue learning about Zephyr and trying other sample apps.

Thanks for all your previous feedback that I've worked
into this new version.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-11-13 14:05:47 -06:00
Andrew Boie 553f30c7a6 doc: add auto-generated architecture interface
This is primarily of interest to people doing architecture ports.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-07 15:21:46 -08:00
Andrew Boie 4f77c2ad53 kernel: rename z_arch_ to arch_
Promote the private z_arch_* namespace, which specifies
the interface between the core kernel and the
architecture code, to a new top-level namespace named
arch_*.

This allows our documentation generation to create
online documentation for this set of interfaces,
and this set of interfaces is worth treating in a
more formal way anyway.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-07 15:21:46 -08:00
Ulf Magnusson a328c5190d kconfig: Add linting script
Add a cleaned-up version of a script I used to find a bunch of unused
symbols and some other Kconfig issues. It's set up to be run directly,
with few environment dependencies.

West is required, because the checks need to see Kconfig files and
source code from all modules.

Checks so far:

 - Symbols that can never be anything but n/empty

 - Symbols that look unused

 - menuconfig symbols with empty menus

 - Symbols only defined in Kconfig.defconfig files

See the help strings for the command-line flags for more information.

Some of these checks could probably be checked in CI later, though the
always-n and unused-symbol checks are a bit heuristic and might need a
lot of whitelisting.

Another reason I want to get this in is to have a clean standalone
reference for how to set up the environment for parsing the Kconfig
files. It's gotten trickier over time.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-07 15:32:50 +01:00
Kumar Gala 07e5d89d86 kconfig: Add dt_chosen_enabled function
Add function that will return 'y' or 'n' if a node pointed to by a
chosen property exists and is enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-05 12:04:33 +01:00
Ulf Magnusson 1d7155cb4b doc: kconfig: Document recommended header format
Might help keep things consistent.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
David B. Kinder 9b66efc858 doc: fix misspellings in rst docs
Fix some misspellings missed during regular reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-29 06:01:13 +01:00
Daniel Leung b7eb04b300 x86: consolidate x86_64 architecture, SoC and boards
There are two set of code supporting x86_64: x86_64 using x32 ABI,
and x86 long mode, and this consolidates both into one x86_64
architecture and SoC supporting truly 64-bit mode.

() Removes the x86_64:x32 architecture and SoC, and replaces
   them with the existing x86 long mode arch and SoC.
() Replace qemu_x86_64 with qemu_x86_long as qemu_x86_64.
() Updates samples and tests to remove reference to
   qemu_x86_long.
() Renames CONFIG_X86_LONGMODE to CONFIG_X86_64.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-10-25 17:57:55 -04:00
Kumar Gala 22e7449b73 kconfig: Introduce typed dt kconfig functions
Replace:
  dt_chosen_reg_addr
  dt_chosen_reg_size
  dt_node_reg_addr
  dt_node_reg_size

with:
  dt_chosen_reg_addr_int
  dt_chosen_reg_size_int
  dt_chosen_reg_addr_hex
  dt_chosen_reg_size_hex
  dt_node_reg_addr_int
  dt_node_reg_size_int
  dt_node_reg_addr_hex
  dt_node_reg_size_hex

So that we get the proper formatted string for the type of symbol.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-24 08:51:06 -05:00