Format all cube packages to the same format before update to new
versions:
-Apply dos2unix
-Remove trailing white spaces
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
For now we've used range properties as a pass through. However range
properties can translate from one address space to another. This is
typically used one address spaces translate from one physical bus to
another (For example going from PCI address space to internal SoC memory
map). However, we can also use this for cases where we want to reduce
duplication (For example with ARMv8-M for secure v non-secure MMIO
registers).
'ranges' takes either the form of:
ranges; /* pass through translation */
or:
ranges = <child-bus-address parent-bus-address length>;
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
We use to walk to the full tree in search of addr/size cells. We should
only have to look at the parent of the node for these properties.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Given the path address to a node return the address/size cells. In
theory this should just be looking up the #{address,size}-cells in
the parent node, we'll make that cleanup next.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
In case of having more than one reg, aliases would not generate
properly. Number of register at the end of define was missing.
Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
This script detects cases where ARRAY_SIZE can be used such as
where there is a division of sizeof the array by the sizeof its first
element or by any indexed element or the element type. It replaces the
division of the two sizeofs by ARRAY_SIZE helper macro.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
'coccicheck' target is used to initiate Coccinelle checker. It
can be called via four different modes that generate different
output corresponding the mode.
The four modes are:
* 'patch' proposes a fix, when possible.
* 'report' generates a list in the following format:
file:line:column-column: message
* 'context' highlights lines of interest and their context in
a diff-like style. Lines of interest are indicated with '-'.
* 'org' generates a report in the Org mode format of Emacs.
The 'coccicheck' front-end can be called with suitable arguments:
* --mode=<mode>: specify the mode for processsing.
* --cocci=<path/to/foo.cocci>: specify the SmPL file to use.
* --verbose=<1>: enable verbose output.
Run `./scripts/coccicheck --help` for more detailed info
on various options available.
With the above arguments the coccinelle transformation engine
runs on the entire/part of the source code tree depending on
various options supplied to the coccicheck sanity checker.
More detailed documentation can be found at:
doc/application/coccinelle.rst
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
When the code partition is not at the beginning of the flash, the load
offset is wrongly computed. The address in the device tree is already
relative to the beginning of the parent node, ie the beginning of the
flash memory space. There is therefore no need to subtract it.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
The node name parsing for the _LABEL #define does not parse the unique
node portion in the same fashion between @<unit_address> and _<number>.
This change normalizes the two modes.
Signed-off-by: David Leach <david.leach@nxp.com>
Update Kconfiglib (and menuconfig, just to sync) to upstream revision
8087311cd91be to get the following fix in, for an issue reported by
pfalcon:
Give clearer errors for bad endchoice/endif/endmenu nesting
An endchoice/endif/endmenu with no corresponding choice/if/menu
generated a cryptic 'unrecognized construct' parse error. Improve
the error message so that the problem is pointed out explicitly:
kconfiglib.KconfigError: Kconfig:37: couldn't parse 'endmenu': no
corresponding 'menu'
Reported in https://github.com/ulfalizer/Kconfiglib/issues/56.
This update also adds support for user-defined preprocessor functions in
Python, which could potentially be handy for DTS/Kconfig integration.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
According C99 the first 31 characters of an identifier must be unique.
Shortening the namespace of the generated objects to achieve it.
C99 - 5.2.4.1
MISRA-C rule 5.1
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit touches the C codebase and the python syscall generator.
The Z_GENLIST-macros expand to whole functions. Once expanded by the
preprocessor we notice a semicolon is put after the function body. But
ISO C99 does not allow extra ‘;’ outside of a function. Though this is
accepted by GCC with GNU extensions, it is not by Clang.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
The $(readlink -f) call in scripts/west doesn't work on macOS.
Let's just ensure compatibility on all the platforms by moving
scripts/west-launcher.py to scripts/west, making it executable on
macOS and Linux, and launching it from the Windows doskey macro.
Signed-off-by: Marti Bolivar <marti@foundries.io>
Update to the latest west. This includes a new 'attach' command. There
are also multi-repo commands, but those won't get exposed to the user
unless they install Zephyr using "west init" + "west fetch" (and not,
say, "git clone").
Replace the launchers; they now detect whether zephyr is part of a
multi-repo installation, and run the west code in its own repository
if that is the case.
This also requires an update to:
- the flash/debug CMakeLists.txt, as the new west package is no longer
executable as a module and must have its main script run by the
interpreter instead.
- the documentation, to reflect a rename and with a hack to fix
the automodule directive in flash-debug.rst for now
Signed-off-by: Marti Bolivar <marti@foundries.io>
If size or address cells happened to be 2 we'd get the wrong value since
we where shift the least significant 32-bit's up. Adjust the math based
on the value of the cell amount to fix things.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Rename address / size cell variable to clarify that its the number
of address / size cells.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
reg class is updated to take into account whole use cases
of reg extraction so extract_reg_prop could be removed.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Parameter 'names' is provided as argument of several property
extract functions. Thought it is actually used only once.
Remove when not needed.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The size calculation for power of 2 MPUs were incorrect.
The calculation was not taking into account the amount of padding
the linker does when doing the required alignment. Hence the size
being calculated was completely incorrect.
With this patch the code now is optimized and the size of
partitions is now provided by the linker.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
New shell support features like:
- multi-instance
- command tree
- static and dynamic commands
- multiline
- help print function
- smart tab (autocompletion)
- meta-keys
- history, wildcards etc.
- generic transport (initially, uart present)
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
Make if statement using pointers explicitly check whether the value is
NULL or not.
The C standard does not say that the null pointer is the same as the
pointer to memory address 0 and because of this is a good practice
always compare with the macro NULL.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.
With have *many* violations on Zephyr's code, this commit is tackling
only the violations caused by headers guards. It also takes the
opportunity to normalize them using the filename in uppercase and
replacing dot with underscore. e.g file.h -> FILE_H
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Update menuconfig.py to upstream revision 35a60b786c646.
This fixes some minor graphical glitching, with parts of lines that
don't fit the terminal wrapping around to the next line, and some
headings disappearing.
This version also adds supports for custom style definitions,
contributed by Mitja Horvat (punkfluid). Colors can be specified both by
number and in #RRGGBB notation. Color accuracy varies depending on
terminal capabilities, but will usually be good.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.
The only directory excluded directory was ext/* since it contains
only imported code.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Some syscacll return value through parameters and for these functions
the return of _arch_syscall_invoke* are not used.
MISRA requires that all return values be checked.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
To avoid having to set it externally, set the SOC_DIR environment
variable directly in the compliance script.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Generate CONFIG_DT_COMPAT flags using available nodes
'compatible' property.
Store them in a bogus node_address key of defs dict so
duplicates could be removed.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
MISRA-C requires that every switch clause has a break instruction.
Changing gen_kobject_list script to generates compliance code.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
PyYAML 3.13 includes a fix necessary to install on Python 3.7:
3.13 (2018-07-05)
Rebuild wheels using latest Cython for Python 3.7 support.
Support it by accepting any PyYAML at least as recent as the current
version in requirements.txt, currently 3.12.
Signed-off-by: Marti Bolivar <marti@foundries.io>
The prefixes might be a leftover from the old 'option env="..."' symbols
(which are no longer needed). Since environment variables can be
referenced directly now, there's no point in having a prefix.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Update Kconfiglib to upstream revision 2be02fac78527 to add support for
expanding macros within symbol names, extending the existing Kconfig
preprocessor
(https://github.com/torvalds/linux/blob/master/Documentation/kbuild/
kconfig-macro-language.txt). Some minor optimizations are included as
well.
This makes it possible to add Kconfig templates to avoid code
repetition, e.g. like below:
Kconfig.log_template:
choice
prompt "Max compiled-in log level for $(module-str)"
config $(module)_LOG_LEVEL_OFF
bool "Off"
config $(module)_LOG_LEVEL_ERR
bool "Error"
config $(module)_LOG_LEVEL_WRN
bool "Warning"
config $(module)_LOG_LEVEL_INF
bool "Info"
config $(module)_LOG_LEVEL_DBG
bool "Debug"
endchoice
config $(module)_LOG_LEVEL
int
default 0 if $(module)_LOG_LEVEL_OFF
default 1 if $(module)_LOG_LEVEL_ERR
default 2 if $(module)_LOG_LEVEL_WRN
default 3 if $(module)_LOG_LEVEL_INF
default 4 if $(module)_LOG_LEVEL_DBG
Using the template:
module = FOO
module-str = foo
source "Kconfig.log_template"
...
module = BAR
module-str = bar
source "Kconfig.log_template"
This feature might create harder-to-read Kconfig files if abused, so it
should probably be used sparingly.
Fixes: #9761
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Before dtc 1.4.7 we'd get something like the following for an interrupt
property in which #interrupt-cells is 2.
interrupts = <1 2 3 4>;
After dtc 1.4.7 we get:
interrupts = <1 2>, <3 4>;
We should handle both cases in the extract interrupt handling code. So
if we see a list of lists, we flatten it to a single list to normalize
the property.
Fixes: #9558
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Since the warnings generated by this script are so spammy, it can be
difficult to tell where they start and end. Put a blank line before each
one to make it clearer.
Also put blank lines around the non-whitelisted-warning error.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
- Use Kconfig.unique_{defined_syms,choices} to avoid redundant checks
for symbols/choices defined in multiple locations. These were
recently added to Kconfiglib.
- Remove the comment about the alldefconfig starting state. It probably
isn't useful here.
- Print the messages about loading configuration files just before they
are actually loaded. That looks less confusing if one of them fails
to load.
- Line-wrap the error message about non-whitelisted warnings.
- Misc. other minor code cleanup.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
A node alias name should be applied to the all property names.
Before this patch, the alias name is applied erroneously
just for CLOCK_CONTROLLER, skipping the CLOCK_BITS and CLOCK_BUS
property names.
Signed-off-by: Istvan Bisz <istvan.bisz@t-online.hu>
We have been dropping lines after finding a fault which resulted in
missing information in the log. Make sure we continue and only report
failure at the end of the execution.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Do not close console after PASS is reported, wait a bit for any
remaining messages from the tests, sometimes we have faults that need to
be parsed.
This now works for Qemu handler, support for other handlers to follow.
Fixes#9646
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Update menuconfig (and Kconfiglib, just to sync) to upstream revision
78682a8e3c4fe to get the following fix in, which could cause certain
visible symbols to not show up in the menuconfig interface:
menuconfig: Always show implicit submenus with visible nodes
Currently, the symbol BAR below (which ends up indented in an
implicit submenu) is shown only if DEP is non-n (or if show-all mode
is enabled):
config FOO
bool "foo" if DEP
default y
config BAR
bool "bar" if FOO
This is bad, because it hides visible symbols from the interface.
The assumption was that an implicit submenu (which is only created
if the parent has a prompt) would never have visible items when the
parent item is invisible, but prompt-specific conditions and
select/imply can break that assumption.
Fix it by always showing implicit submenus with visible nodes, along
with the parent node. If the parent node is invisible, show it in
red, like in show-all mode (which happens automatically). That's
probably better than having mysteriously indented nodes when the
parent is invisible.
(Some other tweaks were made later to avoid showing red outside show-all
mode, because it might look confusing/broken.)
A new color scheme for the menuconfig has been added as well,
contributed by Mitja Horvat (pinkfluid). It can be enabled by setting
the environment variable MENUCONFIG_THEME to 'aquatic'.
The default theme has been tweaked to use bold text for the selected
item too.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This adds new targets to generate build documentation through
LaTEX to PDF.
There are a few notes:
1. pdflatex complains about the tex file generated by doxygen
so it needs to be fixed with a Python script before feeding
in through pdflatex.
2. SVG files are not recognized by pdflatex so they are converted
to known good format on the fly, only for producing PDF. This
uses the libRSVG's rsvg-convert tool.
Relates to #6782.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
In addtion to zephyr/dts/bindings als scan the dts/bindings
directory within the application source directory for bindings.
Allows to have application specific bindings and drivers.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>