Commit graph

34 commits

Author SHA1 Message Date
Martí Bolívar 6f35d3bd16 doc: write documentation about DT-based device instantiation
Add more HOWTO information for the two current devicetree-based device
instantiation styles, and a bit more information on how to create
devices that depend on others.

Point to this from the Kconfig tips page, since it is meant as a
replacement for existing Kconfig practice.

Update macros.bnf.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-08 19:37:18 -05:00
Stephanos Ioannidis 0e6ede8929 kconfig: Rename CONFIG_FLOAT to CONFIG_FPU
This commit renames the Kconfig `FLOAT` symbol to `FPU`, since this
symbol only indicates that the hardware Floating Point Unit (FPU) is
used and does not imply and/or indicate the general availability of
toolchain-level floating point support (i.e. this symbol is not
selected when building for an FPU-less platform that supports floating
point operations through the toolchain-provided software floating point
library).

Moreover, given that the symbol that indicates the availability of FPU
is named `CPU_HAS_FPU`, it only makes sense to use "FPU" in the name of
the symbol that enables the FPU.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-27 19:03:44 +02: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
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
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 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
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
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
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
Marti Bolivar 27e5dd131f doc: s/device tree/devicetree/
DTSpec writes this as a single word, presumably to make it easier to
grep for / more precise. Follow along in the rest of the docs now that
our main DT docs page agrees with this usage.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-10-08 11:53:40 +02:00
David Lechner f6fd8a7dab doc: fix dead kconfig links
Links to Linux kernel Kconfig documentation are broken, so replace them
with working ones.

Signed-off-by: David Lechner <david@lechnology.com>
2019-09-27 23:11:14 -04:00
Kumar Gala 5735397b9b kconfig: Add new functions to kconfigfunctions to use EDT
Add a new set of functions that utilize EDT so we can move away from the
generated .conf file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-13 11:42:34 -05:00
Ulf Magnusson fde86da6f5 doc: kconfig: Fix typo in documentation for 'optional' on choices
Like for other choices, it's the prompt that gets displayed within the
parentheses, not the symbol name.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-23 20:34:54 -04:00
Ulf Magnusson e5cca102a5 doc: kconfig: Encourage dropping 'Enable ...' from most prompts
Usually, it's clear from context, and it makes things consistent.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-23 20:34:54 -04:00
Ulf Magnusson 3e69a0e465 doc: kconfig: Explain the 'menuconfig' keyword and good uses for it
Takes a while to figure out what it's there for, so explain what it does
and give an example of a good use for it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-23 20:34:54 -04:00
Ulf Magnusson 7c8bcf0772 doc: kconfig: Clarify that 'depends on' works for string/int/hex
Seems people are a bit hazy on this, so explain how it works.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-23 20:34:54 -04:00
Ulf Magnusson 605a390633 doc: kconfig: Fix accidental SPDX-License-Identifier in generated doc
RST uses '..' for comments, not '#'. The license line currently shows up
on https://docs.zephyrproject.org/latest/guides/kconfig/index.html

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-18 12:13:17 -05:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Ulf Magnusson ddf9193934 doc: kconfig: Encourage using menuconfig as a sanity check
Some people never use the menuconfig, but it makes a good sanity check
when making Kconfig changes, so encourage it for that. Mention a few
things that can be checked in it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-11 16:36:20 -07:00
Ulf Magnusson e6a2b157f3 doc: kconfig: Add section on (lack of) conditional includes
Add a section on how 'if' works to the 'Kconfig - Tips and Best
Practices' page, especially when combined with 'source'.

There seems to have been some confusion here that lead to a bunch of
duplicated dependencies. It's probably simpler than most people assume.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-11 16:36:20 -07:00
Erwan Gouriou 7fce83ff8e kconfigfunctions: Disambiguate reference to DTS generated database
Documentation for kconfigfunctions, mentions they look up elements
in "the DTS generated "conf" style database". This indication
could be cryptic for new zephyr users. Adding the exact name and
path of the file for disambiguation.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-12 11:37:53 -06:00
David B. Kinder 1cc8bbb4ae doc: fix misspelling in kconfig doc
Fix typos introduced by PR #13186

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-02-08 16:33:09 -06:00
Kumar Gala f2ef52f122 kconfig: kconfigfunctions: update dt_str_val
Clarify the docs for dt_str_val that if the name isn't found we return
and empty string.  Also cleanup the code slightly as we don't need to
escape the double quote.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 12:02:18 -06:00
Kumar Gala 2579adea1e kconfig: kconfigfunctions: Add dt_str_val function
Add dt_str_val to extract a string from the dt conf database.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 10:29:57 -06:00
Anas Nashif d6f72a67fc doc: introduce final structure
Move guides and APIs into separate directories and cleanup naming
introducing index files rather than named section files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 07:04:40 -05:00