Commit graph

67 commits

Author SHA1 Message Date
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
Sebastian Bøe
ba287d2b27 cmake: Fix bug where DTS_BINDINGS_DIRS could only have one entry
Fix a bug where DTS_BINDINGS_DIRS could only have one entry. When
there were more than one entry the command for invoking menuconfig
became corrupted.

This changes the separator of DTS_BINDINGS_DIR from a space to ? so
that the shell does not interpret the space as an argument separator.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-10-01 10:35:23 -07:00
Ulf Magnusson
73ac1466fb scripts: edtlib: Call nodes "nodes" instead of "devices"
edtlib.Device is just a devicetree node augmented with binding
information and some interpretation of properties. Rename it to
edtlib.Node to make that clearer. That also avoids calling things like
flash partition nodes "devices", which is a bit confusing.

I called it edtlib.Device instead of edtlib.Node originally to avoid
confusion with dtlib.Node, but in retrospect it probably makes it more
confusing on the whole. Something like edtlib.ENode might work too, but
it's probably overkill. Clients of edtlib.py only interact with
edtlib.Node, so the only potential for confusion is within edtlib.py
itself, and it doesn't get too bad there either.

Piggyback some documentation nits, and consistently write it
"devicetree" instead of "device tree", to match the spec.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-26 05:23:28 -07:00
Peter A. Bigot
372a4fe5be kconfig: support multiple DTS bindings directories
Some confluence of recent changes resulted in builds with
application-specific bindings being unable to find bindings present in
the system directory.  Add quotes and splits as necessary to propagate
multiple directories through the system.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-09-16 05:29:27 -05:00
Kumar Gala
1baf2f3e6f kconfig: Mark dt_{int,hex,str}_val as deprecated
As we work on removing the .conf file that is generated by the dt
scripts, mark dt_{int,hex,str}_val functions as deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-13 11:42:34 -05: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
86b0c22dc4 kconfig: Avoid potential issue parsing generated_dts_board.conf
Splitting a string like 'foo="bar=baz"' on '=' will give ['foo', '"bar',
'baz"'] instead of the intended ['foo', '"bar=baz"']. split() with
maxsplit=1 to avoid potential issues.

Not seen in practice. Just some future safety.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-04-18 08:49:46 -04:00
Ulf Magnusson
ba312fe844 scripts: Remove unnecessary () around if/while conditions in Python
Not needed in Python. Detected by check C0325 in pylint3.

Also replace an

  if len(tag):

with just

  if tag:

Empty strings, byte strings, lists, etc., are falsy in Python.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-26 07:59:59 -05:00
Carles Cufi
c2d5e7b01c kconfig: Don't load env var if in doc mode
Do not load the GENERATED_DTS_BOARD_CONF if in doc mode, since it will
not defined as it doesn't apply. No need to defined it to a dummy value.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-02-22 10:14:21 +01:00
Sebastian Bøe
1ca1075b20 cmake: kconfig: pass GENERATED_DTS_BOARD_CONF on to kconfig
Make kconfigfunctions.py agnostic to where GENERATED_DTS_BOARD_CONF is
located.

We don't want to encode the path of GENERATED_DTS_BOARD_CONF into more
places than necessary. Also, re-using GENERATED_DTS_BOARD_CONF makes
it easier to change where generated_dts_board.conf is located.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-02-12 20:16:47 -05:00
Sebastian Bøe
cd4354317e kconfig: Have Kconfig fail when PROJECT_BINARY_DIR is not set
kconfigfunctions.py will silently set all values to '0' when the
environment variable 'PROJECT_BINARY_DIR' is not set.

But PROJECT_BINARY_DIR not being set indicates an internal error, so
we should instead error out with an appropriate error message.

Silently failing is dangerous and increases debug time. It is better
to fail fast.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-02-12 20:16:47 -05: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
Carles Cufi
fa26ef02d2 doc: Add KCONFIG_DOC_MODE env var handling
Export a new KCONFIG_DOC_MODE environment variable when building the doc
and invoking Kconfig, so that the functions that expect a build folder
can accordingly return a hardcoded value.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-02-01 10:16:06 -06:00
Kumar Gala
87915cd36f dts: stop generating CONFIG_FLASH_LOAD_{OFFSET,SIZE}
As a step to completing removing use of Kconfig defines in dts files we
need to change how we configure/set CONFIG_FLASH_LOAD_{OFFSET,SIZE}.

Previously we would set them based on how the chosen property
'zephyr,code-partition' was set to.  If 'zephyr,code-partition' wasn't
set we would default the values to 0.  We had some generic overlay logic
which would define 'zephyr,code-partition' based on
CONFIG_BOOTLOADER_MCUBOOT.

Going forward if the DTS has 'zephyr,code-partition' set we will
generate DT_CODE_PARTITION_OFFSET & DT_CODE_PARTITION_SIZE defines.  We
will leave it to Kconfig to set CONFIG_FLASH_LOAD_OFFSET &
CONFIG_FLASH_LOAD_SIZE.

We introduce a python script that allows Kconfig to extract data from
the DTS and thus we can utilize DT_CODE_PARTITION_OFFSET and
DT_CODE_PARTITION_SIZE values to set defaults for
CONFIG_FLASH_LOAD_OFFSET & CONFIG_FLASH_LOAD_SIZE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-02-01 10:16:06 -06:00