Commit graph

621 commits

Author SHA1 Message Date
Keith Packard 2c310d431f subsys/logging: Increase logging stack size for assert or spin_validate
These two options significantly increase the amount of stack space used
by the logging thread as these generate both additional logging and
generate deep stacks themselves. This fixes running the
tests/subsys/logging/log_core_additional/logging.add.log1 test on
riscv32 with THREAD_LOCAL_STORAGE enabled.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-04-28 11:09:01 +09:00
Peter Mitsis 79b57e2cbb logging: Enable Sys-T on ADSP backend
Enables the Sys-T formatting on the ADSP backend when the
SYST logging format is selected.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-04-20 10:25:16 -04:00
Ryan McClelland 1216f19a89 logging: fix LOG_TAG_MAX_LEN min warning
if CONFIG_LOG_TAG_MAX_LEN is 0, then a warning would be generated
on the MIN macro always being false, but as
CONFIG_LOG_TAG_MAX_LEN is a constant, then it is better to just
compile out the function if it's 0.

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2022-04-19 11:49:34 +02:00
Bartosz Bilas 6367075dfe logging: remove superfluous default n for boolean
bool symbols implicitly default to n so
there is no need to redundant those values.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2022-04-19 11:49:27 +02:00
Rihards Skuja d5b83a8c90 logging: disable Linux-style timestamp formatting by default
Fix a typo in #43934.

Signed-off-by: Rihards Skuja <rhssk@posteo.eu>
2022-04-15 10:33:15 -07:00
Piotr Golyzniak 00a4a94076 logging: remove obj character
Remove OBJECT REPLACEMENT CHARACTER U+FFFC from warning log messages.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2022-04-15 09:24:32 -04:00
Tom Burdick 02503c37c3 logging: backend_adsp: lock the output
Adds a lock around the output to prevent corruption, and sets the buffer
size of the output to size of the output buffer. This fixes the
corrupted log output as process() may be called from multiple contexts
from different CPUs. A background log processing thread may race against
the panic ISR log context also calling process() on an SMP system.

Additionally sets the buffer size to 80 such that the cavs trace_out.c
functionality and lock are useful for more than one character at a time
greatly reducing the chances of garbled output in a printk and log race
but does not entirely prevent it. CONFIG_LOG_PRINTK=y should be used
to avoid all races.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-13 17:41:27 -04:00
Krzysztof Chruscinski 33923014b9 logging: Kconfig cleanup of frontened related options
Cleanup in kconfig options in preparation for adding a
frontend that will use dictionary mode.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-13 13:45:36 -07:00
Krzysztof Chruscinski 8f919e41fa logging: Add UART dictionary frontend
Add frontend which dumps log messages in binary dictionary
mode.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-13 13:45:36 -07:00
Krzysztof Chruscinski 8b0d429bfd logging: Add timestamp getter function part of internal API
Expose timestamp getter so it can be used, e.g. in the frontend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-13 13:45:36 -07:00
Krzysztof Chruscinski 653cda5029 logging: Fix LOG_OVERRIDE_LEVEL option
When option is set whole logs shall be set to minimum
of CONFIG_LOG_OVERRIDE_LEVEL. However, module was not
registered when module specific level was set to NONE.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-06 10:59:57 +02:00
Daniel Leung ba488d14d4 logging: syst: add support for catalog messages
MIPI Sys-T catalog messages are similar to dictionary logging
where an ID is emitted instead of the format string. This allows
the format strings to be removed from the final binary to save
a few bytes. This adds the necessary bits to determine to emit
catalog messages when appropriate.

Note that this implementation copies the argument list as-is
with string arguments stitched together since the format strings
are assumed to have been removed and they cannot be examined
to properly convert the argument lists into catalog message
payloads. Because of this, various build asserts are there to
avoid building for configurations where they are known not to
work.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Daniel Leung f7d3d0268e logging: v2: add kconfig to always add indexes to msg packages
This adds a new CONFIG_LOG2_MSG_PKG_ALWAYS_ADD_RO_STRING_IDXS
kconfig. If enabled, the log message packages will always have
the indexes of read-only string arguments appended to the package.
This will be selected only by those backends requiring it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Daniel Leung 8610f9f019 logging: syst: v1/imm: remove temp buffer for sync string output
The MIPI Sys-T library can now take a format string with a variable
argument list so there is no need for the temporary buffer anymore.

This saves some stack space in v1 immediate mode.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Krzysztof Chruscinski b98f8e39fa logging: Adapt logging to use new cbprintf feature
Adapt logging to always use static packaging. Runtime packaging
is used only when configuration requires that. Static packaging
significantly speeds up logging when there are string arguments.

Update log_stack test to new stack usage.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-30 16:16:40 -04:00
Valerio Setti 45751e2a11 logging: fix for 64 bit timestamp + new timestamp format option
Timestamps can be 32 or 64 bit long based on the platform and
build configurations. The proper way to handle these timestamps
is to use the ad-hoc log_timestamp_t variable.
This patch fixes some timestamp's reference which were still
using uint32_t changing them to log_timestamp_t.

Moreover also a new config is added in order to print the
timestamp as the Linux's kernel format. This might be useful
in AMP platforms in which Linux's and Zephyr's logs must be
interleaved in order to get a more comprehensive log solution.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-03-29 12:34:58 -07:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Jordan Yates e65e261621 logging: backend_uart: configurable buffer size
Update the UART RAM buffer size to be user configurable from Kconfig.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-03-14 16:44:17 -05:00
Krzysztof Chruscinski f7b44a36f8 soc: xtensa: sample_controller: Cleanup backend config
Removing backend config from board Kconfig.defconfig and moving
it to xtensa_sim backend configuration in logging. Without this
change define persisted even when logging was not using backends
and that impacted what is compiled in.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-14 14:08:49 -04:00
Krzysztof Chruscinski 54ca1b36d7 boards: posix: Cleanup backend config for native_posix and nrf52_bsim
Removing backend config from board Kconfig.defconfig and moving
it to native_posix backend configuration in logging. Without this
change define persisted even when logging was not using backends
and that impacted what is compiled in.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-14 14:08:49 -04:00
Krzysztof Chruscinski 7c72b78660 logging: Add frontend support to v2
Extended logging v2 to support frontend api. Contrary to v1,
it is possible to have frontend and backends in the system.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-14 14:08:49 -04:00
Krzysztof Chruscinski c917e6c2ce lib: os: cbprintf: Extend API to support new packaging modes
Added new flags to packaging API:
- CBPRINTF_PACKAGE_ADD_RO_STR_IDXS - when set, read-only string
  locations are appended to the package
- CBPRINTF_PACKAGE_ADD_RW_STR_IDXS - when set, read-write string
  locations are appended to the package (instead of appending actual
  strings)
- CBPRINTF_PACKAGE_FIRST_RO_STR_CNT(n) - indicate that n first strings
  are known to be read only. Ignored in runtime packaging.

Add function for copying packages with optional appending strings.

Changed CBPRINTF_MUST_RUNTIME_PACKAGE to use same flags as packaging.

Aligned logging and test to those changes.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-14 11:16:14 +01:00
Gerard Marull-Paretas 95fb0ded6b kconfig: remove Enable from boolean prompts
According to Kconfig guidelines, boolean prompts must not start with
"Enable...". The following command has been used to automate the changes
in this patch:

sed -i "s/bool \"[Ee]nables\? \(\w\)/bool \"\U\1/g" **/Kconfig*

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 15:35:54 +01:00
Krzysztof Chruscinski 3cbfc505b3 logging: Add prompt to LOG2_ALWAYS_RUNTIME option
Prompt was removed by 154ca8526 to ensure that it is not
disable when it is required. That removed possibility of
manually enabling that option my the user. Bringing prompt
back and adding check to code to fail compilation if
LOG2_ALWAYS_RUNTIME is not set but is required.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-08 12:36:28 +01:00
Krzysztof Chruscinski 923e491db5 logging: Fix Kconfig dependency
Fix dependencies when enabling of legacy kconfig option

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-03 12:06:10 -05:00
Daniel Leung dc22617478 linker: add a utility func to check if an addr is in RO section
This adds a utility function to check if an address is within
read only section. This is extracted from logging subsys so
use the new func in logging. The one is cbprintf_packaged is
also replaced.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:53:02 +01:00
Daniel Leung e54b4faabc logging: v2: force LOG2_ALWAYS_RUNTIME if XCC
XCC is based on GCC 4.2.0 which doesn't support auto type.
So force CONFIG_LOG2_ALWAYS_RUNTIME to be enabled if XCC is
being used.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:52:51 +01:00
Krzysztof Chruscinski b74397db13 logging: Making format_table static const
Add static const to format_table.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-24 08:51:26 -08:00
Aastha Grover c0d7e10beb logging: Add support to backends to switch log format at runtime.
Adding mechanism to all the backends to switch the logging formats
at runtime while leveraging the function pointer table based upon
the Kconfigs which also cleans up the logging backend design.
Also demonstrate the working API with the changes
to syst sample. Clean up Kconfig for backends and add a standard
template to generate the Kconfigs for logging formats to be used
by all backends.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-02-23 14:12:22 -06:00
Aastha Grover 9fcbace639 logging: Add API's to switch logging formats at runtime.
Add support for new API's log_backend_format_set and
log_format_set_all_active_backends to switch the logging format
for one backend and for all the active backends respectively.
Using format_set function pointer in log_backend_api struct as a hook
to set the log format at runtime in the backends. Add function pointer
table with helper functions to be used as a way to select log format.
Add supported log format types as macros to use with the API.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-02-23 14:12:22 -06:00
Aastha Grover e4e675dc37 logging: Add API to get log_backend instance by name.
Added helper API to the logging backend interface to get the
log backend instance by name.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-02-23 14:12:22 -06:00
Krzysztof Chruscinski a662e69cad logging: Prevent multiple arguments evaluation
Logging v2 is utilizing complex preprocessing operations to
prepare message at compile time. Multiple operations are peformed
on log message arguments. However, it is expected that argument
will be evaluated only once (e.g. it can be a call to a function
with side effects). Adding additional layer which creates copies
of user arguments on stack and passes them to further processing.

Updated test for log_msg2 which is using internal macro which
got renamed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00
Krzysztof Chruscinski 154ca8526c logging: Use runtime packaging in immediate mode
Always use runtime packaging in immediate mode. Removing attempt to
package on stack if possible. It would be done only to speed up
logging but that is not a requirement in immediate mode where
packaging time is fractional compared to backend processing. Using
runtime packaging also reduces stack usage in the context which calls
log message.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00
Anas Nashif 49d08c25fe Revert "logging: Use spin lock"
This reverts commit dfe9561d9b.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-22 00:29:17 -05:00
Krzysztof Chruscinski dfe9561d9b logging: Use spin lock
Updated log_core to use spin lock instead of irq_lock.
Refactored z_log_msg_post_finalize function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-21 22:19:00 -05:00
Krzysztof Chruscinski 81ce6db313 logging: Add common api for getting memory usage
Logging v2 did not support getting memory usage data. Adding this
support by creating common api for getting current and maximum
usage. Tracking of maximum usage is optional and can be enabled
using CONFIG_LOG_MEM_UTILIZATION.

Updated shell command to use common API.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-21 20:41:17 -05:00
Daniel Leung 579829776a logging: syst: fix logging v2 with strings as arguments
The packaged string coming from logging subsys requires some
additional processing if there are string arguments.
These strings are actually embedded inside the package so
the string pointers inside the argument list must be
replaced with pointers to strings inside the package.
Without this extra step of processing, MIPI Sys-T's printf
function would process these arguments directly which may be
NULL pointers or invalid one pointing to somewhere.

This utilizes the new cbpprintf_external() for the processing
before feeding data to the MIPI library.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-04 11:14:55 +01:00
Krzysztof Chruscinski 157c48e4eb logging: log_output: Fix immediate output for big endian
Pointer to int was passed to a function which expected pointer to
uint8_t. There was an unexpected content for big endian as the
highest byte was read instead of the lowest which contained valid char.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-27 10:02:21 +01:00
Krzysztof Chruscinski a40ca6fd1c logging: printk: Fix LOG_PRINTK for v2
Fixed a dependency from printk.h to logging headers which in
certain configurations could lead to circular dependencies.
Cleaned up printk.c to call z_log_vprintk from vprintk.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-27 10:02:21 +01:00
Krzysztof Chruscinski 18165b1d49 logging: Fix tracking of buffered messages
Algorithm was failing in case when overflow mode was enabled
but allocation of new message failed. It could happen if message
size exceeded buffer size. Losing track of buffered messages
can lead to logging processing freeze.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-20 08:52:08 -05:00
Antony Pavlov 0369998e61 arch: add MIPS architecture support
MIPS (Microprocessor without Interlocked Pipelined Stages) is a
instruction set architecture (ISA) developed by MIPS Computer
Systems, now MIPS Technologies.

This commit provides MIPS architecture support to Zephyr. It is
compatible with the MIPS32 Release 1 specification.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2022-01-19 13:48:21 -05:00
Krzysztof Chruscinski aff9cfc65a logging: Add assert when wrong backend is used
Add assert when logging v2 is enabled but backend doesn't support it.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-17 15:49:10 -05:00
Krzysztof Chruscinski 262cc55609 logging: Deprecate v1, default to v2
Reduced logging mode selection to deferred, immediate, minimal and
frontend. Decoupled logging version from mode and created CONFIG_LOG1
which can be used to explicitly select deprecated version.

From now on, chosing CONFIG_LOG_MODE_{IMMEDIATE,DEFERRED} will result
in version2.

Deprecated CONFIG_LOG2_MODE_{IMMEDIATE,DEFERRED} with cmake warning.

Codebase adapted to those changes.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-17 15:49:10 -05:00
Daniel Leung 4b6eb55236 logging: output/syst: don't use raw output for hexdump
Hexdump via logging is supposed to be human-readable for
debug information. Therefore, it should actually print
in human-readable form (well... after some magical decoder
has processed the raw MIPI Sys-T output).

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-14 09:59:06 -05:00
Krzysztof Chruscinski c51aa88046 logging: Fix counting of buffered messages
When message is dropped then log_process is called with
bypass flag set and additionally z_log_dropped() is called.
In both functions counter of buffered messages was decremented.
That resulted in counter being decremented twice. It resulted
in logging misbehavior after messages being dropped (delayed
processing). Fixing it by decrementing the counter in log_process
only when bypass flag is not set.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-05 14:42:40 +01:00
Krzysztof Chruscinski 8c0a017cd3 logging: Improve algorithm for waking up the thread
Use value returned by atomic_inc to decide on action.
Previously direct value was used and that could lead to
delays in logging processing because thread waking up
could be mishandled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-05 14:42:40 +01:00
Aastha Grover a89fae798c logging: Add MIPI sys-t support for v2 logging subsystem.
Adding functions log_output_msg2_syst_process and hexdump2_print
to support v2 logging subsystem.

Updates west.yml to pick up a new version of the MIPI sys-t library that
supports vprintf.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-01-05 14:41:51 +01:00
Krzysztof Chruscinski 194c0acdfd logging: Add option to have tag which is prepended to all messages
Tag can be changed at runtime. Feature is enabled by setting
maximum tag length to positive value. Additionally, default
tag can be configured in Kconfig.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-04 14:57:31 -06:00
Krzysztof Chruscinski 94a01d0192 logging: Increase stack size when NO_OPTIMIZATIONS=y
Increase stack size when optimization is disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-12-21 09:36:09 +01:00
Robert Melchers 9c3ab333de log_backend_net: local_addrX may be used uninitialized
When CONFIG_NET_HOSTNAME_ENABLE=y, local_addrX may be used uninitialized
causing unexpected behaviour.

Signed-off-by: Robert Melchers <robert.melchers@taitradio.com>
2021-12-09 19:53:17 -05:00
Emil Lindqvist bd2eb48c05 logging: fix timestamp func overwrite on log2
When LOG2 is enabled, timestamp func which was just set
according to various conditions, is overwritten using sysclock.
Since sysclock is very fast, it will cause uint32_t to wrap very
fast and cause the time to start over from 0 often.

This commit combines the two statements doing the same thing,
to one statement.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-12-02 10:52:51 +01:00
Krzysztof Chruscinski 74015ef2a5 logging: uart: Add support for asynchronous API
Asynchronous API may utilize DMA and significantly reduce
CPU load during outputing to UART.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-12-01 10:02:28 +01:00
Krzysztof Chruscinski 059d2d0c0b logging: Fix tracking of active messages
A variable is tracking number of buffered messages. This is used
to trigger processing thread in certain cases. Counter was not
handled correctly when message was dropped. In certain cases that
can lead to hanging of log processing.

Added counter decrementation in the callback called whenever
message is dropped.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-11-29 21:13:44 +01:00
Krzysztof Chruscinski c0808e3f59 logging: Minimal mode configuration cleanup
Remove LOG_MINIMAL kconfig option which was confusing
since LOG_MODE_MINIMAL existed. LOG_MINIMAL was used to
force minimal mode but because of invalid dependencies
it was leading to issues.

Refactored code to use LOG_MODE_MINIMAL everywhere and
renamed LOG_MINIMAL to LOG_DEFAULT_MINIMAL which has impact
on defualt logging mode (which still can be later changed
in conf file or in menuconfig).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-11-20 11:58:40 -05:00
Christopher Friedt 5dc6686c63 logging: log_core: do not alias atomic_t
Previously, a `uint32_t` was aliased as an `atomic_t`. However,
with #39531, `atomic_t` is now a `long` under the hood, which
is 64-bit on 64-bit platforms.

Fixes #40369

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-17 12:25:10 +01:00
Emil Lindqvist f0af9275ed logging: typecast to stop signed-unsigned comparison
If source_id is -1, which is a valid value, it will be
converted to unsigned since it's compared with an unsigned
which means it will be huge and asserts will trigger. To avoid
this, we typecast the unsigned part to signed.

Resolves #40115

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-11-15 08:53:51 -05:00
Guillaume Lager 7eb74f3db5 logging: rtt: Fix compilation error when multithreading disable
Fixes #39538

RTT_UNLOCK() uses a variable defined in RTT_LOCK() making mandatory
to use both function in the same block

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2021-10-19 23:06:20 -04:00
Krzysztof Chruscinski a18bc0f4f7 logging: Cleaning references to tracing in logging
There were some leftovers in logging after attempt to use
logging as tracing backend. Removing all references since it
lead to test compilation failures.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-09-29 14:59:36 +02:00
Krzysztof Chruscinski abf8c741e4 logging: Prefix internal functions with z_
There are 2 function in log_internal that were not prefixed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-09-28 20:31:52 -04:00
Krzysztof Chruscinski 03165c914b logging: Cleanup in the internal headers
Added log_internal.h for internal APIs. Move functions out of
log_core.h. Log_core.h shall have only macros and functions related
to logging message creation. Log_core.h is included by log.h thus
number of dependencies in that headers must be limited to minimum
to allow including without risk of circular dependencies.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-09-28 20:31:52 -04:00
Marin Jurjević f4a5c7d680 logging: use green color for info log level
Info log messages don't have dedicated color which
makes them harder to separate from debug logs.

Introduce green color in log output for info level
so it stands out like error and warning messages do.

Signed-off-by: Marin Jurjević <marin.jurjevic@hotmail.com>
2021-09-28 20:10:41 -04:00
Emil Lindqvist f7dad07bb0 kconfig: add names to some choices
In order to be able to make a "choice" from any other
Kconfig.defconfig (-ish) file, the choice needs to be named.
This commit names a few choices.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-09-28 19:56:32 -04:00
Krzysztof Chruscinski ba60c94b48 lib: os: mpsc_pbuf: Add const qualifier to API calls
Add const qualifier where it was missing. Updating
relevant code.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-09-28 06:15:39 -04:00
Guillaume Lager a55a5b744d logging: rtt: Add overwrite mode
In this mode the oldest data is overwritten
when the buffer is full

Closes #36282

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2021-09-28 11:45:02 +02:00
Meng xianglin 10232b536e test: logging: improve test coverage for logging subsystem
Add some test point in existing test cases. Add some test
cases for usersapce.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2021-09-27 10:19:49 -04:00
Krzysztof Chruscinski b942aabe69 logging: Fixing coverity issue
Add casting to fix coverity report.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-09-27 10:15:51 -04:00
Bartosz Bilas 0a9e930fdc logging: log_core: add extra space in missed strdup err msg
It improves readability in an error message:

before: <err> log: argument 0 in source storage log message "val %s"
missinglog_strdup().

after: <err> log: argument 0 in source storage log message "val %s"
missing log_strdup().

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2021-09-13 05:54:13 -04:00
Kamil Gawor dc96f016a4 logging: Add choice name in template
This commit adds choice name in a logging subsystem
Kconfig template file.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2021-09-06 14:11:06 -04:00
Markus Fuchs 05a1a5c41d logging: fs: Remove littlefs dependency
Remove littlefs dependency as FS backend works with any file system as
long as it is (manually or automatically) mounted.

Fixes #36851

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2021-09-01 08:39:24 -04:00
Torsten Rasmussen c6aded2dcb linker: align _image_rodata and _image_rom start/end/size linker symbols
Cleanup and preparation commit for linker script generator.

Zephyr linker scripts provides start and end symbols for each larger
areas in the linker script.

The symbols _image_rom_start and _image_rom_end corresponds to the group
ROMABLE_REGION defined in the ld linker scripts.

The symbols _image_rodata_start and _image_rodata_end is not placed as
independent group but covers common-rom.ld, thread-local-storage.ld,
kobject-rom.ld and snippets-rodata.ld.

This commit align those names and prepares for generation of groups in
linker scripts.

The symbols describing the ROMABLE_REGION will be renamed to:
_image_rom_start -> __rom_region_start
_image_rom_end   -> __rom_region_end

The rodata will also use the group symbol notation as:
_image_rodata_start -> __rodata_region_start
_image_rodata_end   -> __rodata_region_end

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-28 08:48:03 -04:00
Johann Fischer e78b0785b3 console: remove device_get_binding(CONFIG_UART_CONSOLE_ON_DEV_NAME)
Remove device_get_binding(CONFIG_UART_CONSOLE_ON_DEV_NAME)
and use DEVICE_DT_GET(DT_CHOSEN(zephyr_console)) to get
chosen "zephyr,console" node.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Johann Fischer f460848002 net: ot: rework NCP interface configuration
Rework NCP interface configuration and NCP sample. Remove
CONFIG_OPENTHREAD_COPROCESSOR_SPINEL_ON_UART_DEV_NAME and
CONFIG_OPENTHREAD_COPROCESSOR_SPINEL_ON_UART_ACM Kconfig
options in favor of chosen node zephyr,ot-uart usage.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Emil Obalski 6f4f1dc230 logging: Add configurable logging thread delay
This patch adds confiugurable delay when starting log processing
thread.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2021-08-13 11:19:27 -04:00
Ryan Erickson e4dc8ed26b logging: Add log mem shell command
Add log mem shell command to determine memory pool
usage of logging system.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2021-08-12 11:06:32 -04:00
Andrew Hedin b52ad8f3e1 logging: Add strdup current use to shell cmd
Add the number of strdup buffers currently in use to the
`log strdup_utilization` shell command.

Signed-off-by: Andrew Hedin <andrew.hedin@lairdconnect.com>
2021-08-12 11:06:32 -04:00
Krzysztof Chruscinski 12f366c954 logging: Add resetting of dropped_cnt to init
It is mainly for testing purposes where logging is multiple times
reinitialized.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-03 16:11:49 -05:00
Krzysztof Chruscinski 6024bbc601 logging: Split log_core into two files
Extract functions which are managing logging sources
and backends into separate file: log_mgmt.

So far those functions were in log_core mixed with functions
specific to log message creation and log processing.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-30 19:58:13 -04:00
Evgeniy Paltsev f54d0b7aa5 ARC: 64BIT: increase LOG_PROCESS_THREAD stack size
Increase LOG_PROCESS_THREAD_STACK_SIZE for ARCv3 64 bit to
fix failing test
tests/subsys/logging/log_core_additional/logging.add.async
due to stack overflow.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-07-29 11:47:25 -04:00
Krzysztof Chruscinski 5d80cbae59 lib: os: cbprintf: Add support for conversion to fsc package
Added support for conversion from a standard package which contains
pointers to read only strings to fully self-contained (fsc) package.
Fsc package contains all strings associated with the package thus
access to read only strings is not needed to format a string.

In order to allow conversion to fsc package, standard package must
contain locations of all string pointers within the package. Appending
that information is optional and is controlled by flags parameter
which was added to packaging API. If option flag is set then
package contains header, arguments, locations of read only strings and
transient strings (each prefixed with string argument location).
Package header has been extended with field which contains number of
read only string locations.

A function for conversion to fsc package has been added
(cbprintf_fsc_package()).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-27 14:50:45 +02:00
Krzysztof Chruscinski 0b79661cff logging: log_backend_swo: Add support for logging v2
Added support for logging v2 backend API for SWO backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-23 16:06:37 -04:00
Marcin Niestroj 70bd03799c logging: fs: allow maximum file size to be 1GB
So far the maximum configurable file size was limited to 16KB (2^14).
This might be enough for small partitions on internal flash. For
external QSPI memories however, this is certainly too restrictive.

Change maximum configurable file size to be 1GB, which is 2^30. Such
value will prevent signed integers overflow on 32-bit platforms, while
giving user full flexibility on how big log files should be.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-20 19:57:50 -04:00
Marcin Niestroj eb0eb67481 logging: fs: fix leak of opened directories in check_log_file_exist()
Opened directory descriptor is leaked when returning 1. Fix that by
utilizing goto in function return path.

Fixes: 6b18e6992d ("subsys/loggin/log_backend_fs: added recovery after
  file lost")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-20 13:31:33 +02:00
Christopher Friedt 8e9d055d49 logging: use unsigned print format specifier
Even though it's highly unlikely that a component of time
would ever approach INT_MAX, use the unsigned specifier to mitigate
any unexpected behaviour.

Fixes #36814

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-07-19 20:04:03 -04:00
Marcin Niestroj 8e1a071725 logging: allow timestamp formatting for FS backend
FS backend is no different when it comes to producing human readable
timestamp. Allow to select it when FS is the only enabled logging
backend.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-19 12:02:43 +02:00
Elliot Revell-Nash 15318634b7 logging: count file with index 0 as log file too
Fixes #36667

If you had a single log file with index 0 created and you reboot
the log backend wasn't counting it and was overwiting it.
If you filled that file up before rebooting then it worked as
expected, creating a new file at the next index on each boot.

Signed-off-by: Elliot Revell-Nash <elliot.revell-nash@wdtl.com>
2021-07-16 21:55:55 -04:00
Krzysztof Chruscinski f7efacf441 logging: log_backend_spinel: Add support for logging v2
Added support for logging v2 backend API in spinel backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-14 11:06:46 -05:00
Krzysztof Chruscinski 940a54c6f6 logging: log_backend_xtensa_sim: Add support for logging v2
Added support for logging v2 backend API in xtensa_sim.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-14 11:05:15 -05:00
Krzysztof Chruscinski d90775a014 logging: Shell commands available when shell acts as log backend
Some commands shell not be present when shell is not acting as
a log backend. Use of them lead to crash in that case.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-13 10:12:27 -04:00
Krzysztof Chruscinski 28be4ba91d logging: log_backend_net: Add support for logging v2
Added support for logging v2 backend API in net backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-13 09:39:28 -04:00
Elliot Revell-Nash e4507ec6ee logging: dictionary format output to file
Add the option to send logs to fs backend using new dictionary
formatting
This can result in much better use of filesystem space

Signed-off-by: Elliot Revell-Nash <elliot.revell-nash@wdtl.com>
2021-06-09 05:44:03 -05:00
Maksim Masalski 366de7a890 logging: z_vrfy_log_filter_set: remove extra check
Variable "level" in function z_vrfy_log_filter_set() has type unsigned.
But it is been checked if "level >=LOG_LEVEL_NONE" and
LOG_LEVEL_NONE is 0. It means check if unsigned is ">= 0" in Z_OOPS().
That is logically wrong, because unsigned is ">=0" by default.
Remove that check, to avoid static analysis tool raise
violation

Found as a coding guideline violation (MISRA R14.3) by static
coding scanning tool.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2021-06-04 16:19:49 -05:00
Jennifer Williams d6a3679c97 logging: log_msg.c: fix coding guideline 15.7 missing comment
The final else {} in the if...else if is missing required
comment (non-empty, ';' is not sufficient). This adds a comment
to comply with CG 15.7.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-06-03 20:07:16 -05:00
Jennifer Williams 09ee9d6e29 logging: log_core.c: fix coding guideline 15.7 missing comment
The final else {} in the if...else if is missing required
comment (non-empty, ';' is not sufficient). This adds a comment
to comply with CG 15.7.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-06-03 20:07:16 -05:00
Krzysztof Chruscinski f98bc0c0bc logging: backend_rtt: Align to changes in RTT_LOCK/UNLOCK
RTT_LOCK/UNLOCK in certain configuration creates code block (curly
braces). In that case variables declared inside are local to that
block. Moved declaration of ret variable before the block. Updated
code to ensure that RTT_LOCK/UNLOCK are in the same code block.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-27 13:33:02 +02:00
Anas Nashif 108129cf7d tracing: fix conflict with RTT locking
Make custom RTT locking configurable and select it where it is needed.
When using RTT for tracing we want to use the default locking.

Update both segger and tracerecorder modules to support that.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-25 07:36:38 -05:00
Krzysztof Chruscinski f5be847e6d logging: Add missing va_end in log_msg2
Added missing va_end. Reported by coverity CID 232501

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-12 23:36:01 -05:00
Krzysztof Chruscinski 4c971d2c21 logging: Add panic flag reset to core initialization
Add panic_mode flag reset to log_core_init(). It allows full logging
reinitialization which is useful for testing.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Krzysztof Chruscinski d58ff39879 logging: Fix runtime filtering in immediate mode
Fixed immediate mode where runtime filter was not applied.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Krzysztof Chruscinski d9518ce4cc logging: Add optional context argument to LOG_BACKEND_DEFINE
Extended LOG_BACKEND_DEFINE to support optional context argument.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Robert Lubos 39aee39cf9 net: openthread: Align with the new NCP API
OpenThread modified its NCP API, so we need to align with these changes
in Zephyr.

One of the major changes was removal of UART from the platform APIs.
`openthread/platform/uart.h` header file was moved to
`examples/platforms/util/uart.h` so we need to use the new location in
Zephyr. This means that OpenThread no longer impose the UART API but for
the simplicity of the upmerge I've kept the UART APIs as they are for
now.

The NCP initialization function have now to register a send handler,
and the appropriate transport driver have to call NCP callbacks when
transmission/reception is done. For now, re-use the existing code of
the UART driver, just as the upstream NCP application does.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-04-30 12:55:02 -05:00
Krzysztof Chruscinski 7f1d4fdb5b logging: Enable MPSC_PBUF for legacy modes
Logging failed to compile when --no-gc-sections is used because
log_core is conditionally calling mpsc_pbuf.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-29 09:53:19 -04:00
Krzysztof Chruscinski a4af0ee2ec logging: Fix support for no multithreading
Fixed to ensure that semaphore is not used by the log core
when multithreading is disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-29 14:50:35 +02:00
Daniel Leung 8d0201f6eb logging: backend null check to use NULL...
...instead of numeric zero.

Using 0 instead of NULL is a violation of MISRA rule 11.9.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-04-29 07:16:37 -04:00
Daniel Leung 9b4ae26e70 logging: add UART backend for dictionary based logging
This adds a new UART backend for dictionary based logging,
where this can output binary data in both binary and
hexidecimal strings.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-04-28 22:25:42 +02:00
Daniel Leung a5ab1a7518 logging: add support for dictionary based logging
This adds dictionary based logging support. Dictionary based
logging is binary based where one big difference is that
static strings are stored as pointers instead of the whole
string. This results in reduced space requirements for
storing log messages in certain scenairos.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-04-28 22:25:42 +02:00
Daniel Leung 990919fb89 logging: simplify is_rodata() for NIOS2, RISC-V and SPARC
NIOS2, RISC-V and SPARC are using _image_rodata_start/_end in
their linker scripts to mark the boundaries of rodata. So
they no loner need special treatment.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-04-28 22:25:42 +02:00
Krzysztof Chruscinski 292a15be78 logging: Increase thread stack size when net backend in use
It has been seen that when net backend is enabled stack usage
is around 1080. Setting 1152 as the default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-26 14:14:34 -04:00
Andrés Manelli ecf89143da logging: Do not set CYCCNTENA to zero in swo backend
The log_backend_swo_init function sets the CYCCNTENA bit of the DWT
register to 0, disabling the counter (which is necessary for the timing
functions.
Avoid overwriting the CYCCNTENA bit.
Do not try to set read-only bits.

Fixes #34341

Signed-off-by: Andrés Manelli <am@toroid.io>
2021-04-22 09:14:44 +02:00
Marcin Niestroj 552028dd20 logging: add log_output_timestamp_to_us() helper function
So far we only have log_msg_timestamp_get() function, which returns
internal timestamp representation. This is either clock cycles or uptime
in ms, depending on main clock precision.

Introduce log_output_timestamp_to_us() helper function, which allows to
convert internal logging timestamp to us.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-04-20 18:21:26 -04:00
Flavio Ceolin 8cbda26cdd logging: log_minimal: Fix violations to rule 10.4
Logical AND operator accepts only unsigned type and operands.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-20 15:50:49 -04:00
Flavio Ceolin 3687021c83 logging: log_minimal: Fix violation to rule 14.4
Non-boolean essential type is being interpreted as a boolean.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-20 15:50:49 -04:00
Flavio Ceolin 8c5a9ffaab logging: log_minimal: Fix violations to 21.2 and 8.3
Just renaming the function parameter fix two violations, one is
caused because the parameter name is different from the declaration
the other violation is because the identifier was starting with
underscore.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-20 15:50:49 -04:00
Flavio Ceolin ed6e016251 logging: log_minimal: Fix violations to rule 10.4
Fix violations for the rule 10.4.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-20 15:50:49 -04:00
Krzysztof Chruscinski bb64419a29 logging: Adapt ADSP backend to v2
Added support for v2 backend interface to ADSP.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski da31e09f2b logging: Add v2 support to RTT backend
Add support for logging v2 to RTT backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski e767bf6377 logging: Add v2 support to native_posix backend
Add support for logging v2 to native_posix backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski 7ce3f7a25a logging: backend_uart: Adapt to support v2 api
Adapted to handle processing of v2 log messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski f1bb20f6b4 logging: Adapt logger to support both versions
Adapted to be able to switch between v1 and v2.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski 902ccd7235 logging: log_output: Extend to support log_msg2 parsing
Added parsing of log_msg2.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski f6a40ae183 logging: Add logging v2 implementation for log_msg
Added implementation of log_msg2 which is creating log messages
using cbprintf packaging and storing them in circular ring buffer
(mpsg_pbuf).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski ba1aa75c66 logging: Refactor in preparation for logging v2
Refactor and cleanup in preparation for v2.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Flavio Ceolin d0dac69fa9 logging: Fix 10.4 violations
Both operands of an operator in which the usual arithmetic
conversions are performed shall have the same essential
type category.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-10 09:59:37 -04:00
Jukka Rissanen b59f0e5057 log: Align the log_strdup_buf properly
The k_mem_slab_init() calls create_free_list() which checks
the slab block alignment. Noticed with Intel ehl_crb board,
which is 64-bit architecture, that the k_mem_slab_init() fails
because the log_strdup_buf items were not aligned properly.
This commit adds the alignment requirement to log_strdup_buf so
that the elements are alignment properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-08 09:57:42 +02:00
Flavio Ceolin 8153666a27 logging: Fix 14.4 guideline violation
The controlling expression of an if statement has to be an
essentially boolean type.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-06 10:25:24 -04:00
Anas Nashif 0ec3774bde userspace: rename _is_user_context -> k_is_user_context
This functions is being called across the tree, no reason why it should
not be a public API.

The current usage violates a few MISRA rules.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-01 05:34:17 -04:00
David Leach f2d8b4cc94 logging: log_backend_fs: Fix check for error on fs_sync() - coverity
Fixes #33791

Signed-off-by: David Leach <david.leach@nxp.com>
2021-04-01 04:52:10 -04:00
Carlo Caione 3539c2fbb3 arm/arm64: Make ARM64 a standalone architecture
Split ARM and ARM64 architectures.

Details:

- CONFIG_ARM64 is decoupled from CONFIG_ARM (not a subset anymore)
- Arch and include AArch64 files are in a dedicated directory
  (arch/arm64 and include/arch/arm64)
- AArch64 boards and SoC are moved to soc/arm64 and boards/arm64
- AArch64-specific DTS files are moved to dts/arm64
- The A72 support for the bcm_vk/viper board is moved in the
  boards/bcm_vk/viper directory

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-31 10:34:33 -05:00
Flavio Ceolin 9fd4ea91b7 coccinelle: Remove extra semicolon
coccicheck --mode=patch --cocci=semicolon.cocci

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-03-25 11:35:30 -05:00
Krzysztof Chruscinski 68fd304d19 logging: Increase default CONFIG_LOG_STRDUP_MAX_STRING to 2
In modes where string duplication is not used, the code is
still compiled. On some compilers it was failing due to calling
strncpy which will do nothing because n is 0. Increase
CONFIG_LOG_STRDUP_MAX_STRING to 2 to ensure that n is 1 in that
case

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-24 21:42:10 -04:00
Krzysztof Chruscinski 34decfd408 logging: Add name to the mode choice in kconfig
Adding name allows to modify default choice by other modules.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-23 13:00:33 +01:00
Anas Nashif 2976e12946 logging : do not reuse tag name log_output
Do not reuse tag name (misra rule 5.7).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-22 19:48:14 -04:00
Andrzej Puzdrowski eb9454628e logging/log_backend_fs: support any directory
Added procedure which is able to create nested log director.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-03-22 13:04:23 -04:00
Andrzej Puzdrowski 6b18e6992d subsys/loggin/log_backend_fs: added recovery after file lost
Added recovery for case when log file was lost somehow.
Back-end will try to create new file if possible.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-03-22 13:04:23 -04:00
Mateusz Syc fe5f602606 susbys: logging: Added logging to flash backend
New backend is based on littleFS. After init, there is created new file
with continuous numeration. When max size of file is reached, system
creates another one. File size is limited by Kconfig option.
There is possibility to overwrite old files or drop new ones.
FS backend logging to file if the FS location is available.
Otherwise log messages are drooped.

User can also change the name of log files.

Signed-off-by: Mateusz Syc <Mateusz.Syc@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <Andrzej.Puzdrowski@nordicsemi.no>
2021-03-22 13:04:23 -04:00
Krzysztof Chruscinski 1a5fce97b7 logging: swo: Add option to set custom reference frequency
Some devices may use different reference than cpu clock. Add
support for using swo-ref-frequency property when present.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-15 10:23:10 +01:00
Marek Pieta 7e469c2f94 log: Fix defining CONFIG_LOG_STRDUP_MAX_STRING
Change fixes an issue related to data access out of array bounds and
suppresses compiler warning.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2021-03-15 10:21:18 +01:00
Krzysztof Chruscinski 7e125fe7e4 logging: Add backend parameter to the init function
Added backend parameter to the backend init interface function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-12 09:24:54 -05:00
James Harris 97b5741ade logging: fix TOCTTOU issue in z_log_hexdump_from_user
Previously, a racing write to the provided metadata could result
in up to CONFIG_LOG_STRDUP_MAX_STRING-2 bytes after the
end of user-accessible memory being leaked into the strdup pool
or the resulting log.

For now, explicitly copy the metadata string. In an ideal world
this could directly copy from userspace into the strdup buffer, but
this obviously only works if strdup is enabled.

Signed-off-by: James Harris <james.harris@intel.com>
2021-03-10 06:09:38 -05:00
Spoorthy Priya Yerabolu 6d10db3ed6 Coding guideline: Fixing code violations for 21.13 Rule
Any value passed to a function in <ctype.h> shall be
representable as an unsigned char or be the value EOF.

So changed type of variable to unsigned char.

Signed-off-by: Spoorthy Priya Yerabolu <spoorthy.priya.yerabolu@intel.com>
2021-03-05 10:53:13 +03:00
Joakim Andersson 45da9d3962 Kconfig: logging: Improve defaults for Bluetooth
Improve default logging strdup buffer count and size.
The maximum string logged with Bluetooth is a 32-byte key in hex.
The strdup buffer is empty too often.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-04 14:20:25 +02:00
Krzysztof Chruscinski b4da16e81c logging: Refactor msg_finalize
Extract notifying about new log message into separate function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-02-28 17:12:29 -05:00
Krzysztof Chruscinski e0392c5a86 logging: Cleaning up log minimal
Removed printk.h include from log_core.h.

Since LOG_PRINTK cannot be enabled with LOG_MINIMAL removed
support for both.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-02-28 17:12:29 -05:00
Krzysztof Chruscinski 7f08061f0c logging: Revamp menuconfig
Clean up logging menuconfig by grouping configuration into
sections like: mode, processing configuration, backends.

Additionlly, removed LOG_ENABLE_FANCY_OUTPUT_FORMATTING which is no
longer in use.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-01-26 06:15:42 -05:00
Dominik Ermel 5a71644518 logging: Fix missing static to k_spinlock definition
The definition of lock, k_spinlock type, that has been used to guard
variables holding statistical data for log_strdup has been missing
static modifier, which caused the lock structure to be reallocated
on stack each time an execution entered the block.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-01-18 19:12:44 +01:00
Martin Åberg dc4e331e45 logging: improve string logging on 64-bit ABI
In std_print(), the log arguments were casted to uint32_t before
being sent further to the output function.

For integer types which can not be represented by uint32_t, the
degraded user experience may be acceptable.

However, for string arguments, the output function will eventually
dereference the pointer, so if the "char *" can not be represented
by uint32_t, bad things are going to happen. In practice you will see
this on 64-bit systems where sizeof (char *) is 8 byte and addresses
higher than 0x80000000.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2021-01-15 13:06:33 -05:00
Martin Åberg cda619996e logging: more default stack on RISC-V 64-bit
The default stack size of 768 is just too small for RISC-V 64-bit.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2021-01-15 13:06:33 -05:00
Martin Åberg 226f918289 logging: Reduce missinglog_strdup() on SPARC
is_rodata() can now determine if an object is the rodata section
on SPARC. This eliminates spurious run-time error messages about
"missinglog_strdup()".

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-14 11:23:34 +01:00
Jukka Rissanen cc528d37c2 net: syslog: Make sure CONFIG_LOG_IMMEDIATE is not set
The immediate logging option cannot be used with network logging
support CONFIG_LOG_BACKEND_NET as that would cause the generated
rsyslog messages to be malformed. The UDP packets would only have
one byte payloads which is not correct. So make sure that user is
not able to select a configuration with immediate mode and network
logging.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-12-04 15:46:42 +02:00
Markus Becker 638b5f389f net: openthread: OpenThread RCP mode integration into Zephyr
* Add RCP library.
* Conditionally remove non required libraries not required for RCP.
* Drop :option: marker for CONFIG_OPENTHREAD_NCP_SPINEL_ON_UART_ACM

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-11-19 12:34:14 +01:00
Andy Ross be2a5824f3 soc/intel_adsp: Unify trace backends
This platform had separate backends for the log subsystem and printk
handler, which was silly.  Unify them to use the same backend so they
don't clobber each other.

This patch appears to be a lot of lines, but it's really mostly code
motion and renaming.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-11-17 12:28:10 -08:00
Wentong Wu c85d353ca4 logging: add STP transport and raw data output support for syst
Add STP transport support for MIPI SyS-T with Kconfig MIPI_SYST_STP,
this is following SyS-T spec Section 7.
And with Kconfig MIPI_SYST_RAW_DATA, add raw data output support for
MIPI SyS-T protocol stack.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-11-17 10:09:19 -06:00
Martin Åberg 188efb5bfb logging: change default stack size on SPARC
The default stack size of 768 is just too small for SPARC.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Peter Bigot ee0b32682a logging: switch to cbprintf as basis for printf functionality
Replace use of z_prf with cbprintf.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-13 06:38:01 -05:00
Ehud Naim cea6fb7753 logging: fix cmd_log_self_disable argc checker
according to the comment "all if no modules specified"
to support "all" state, set to 1 number of parameters.

Signed-off-by: Ehud Naim <ehudn@marvell.com>
2020-11-06 13:16:39 -05:00
Anas Nashif 8873ade781 logging: mipi-sys-t: move platform.h to main tree
Move the platform.h from the module to the zephyr tree. This file is
zephyr sepcific and belongs in the zephyr tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-29 07:23:40 -04:00
Emil Hammarstrom 746ba2dd9c logging: make log_backend_std header public
Exported header oftenly used when creating a logging
backend that inpects the log 'stream'.
Enables use in external Zephyr modules implementing the
logging backend interface.

Signed-off-by: Emil Hammarstrom <emil.hammarstrom@assaabloy.com>
2020-10-21 10:21:05 -04:00
Andy Ross 544a38ee62 soc/xtensa/intel_adsp: Upstream updates
Significant rework of the Intel Audio DSP SoC/board layers.  Includes
code from the following upstream commits:

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Thu Jun 25 16:34:36 2020 +0100

    xtesna: adsp: use 50k ticks per sec for audio

    Audio needs high resolution scheduling so schedule to nearest 20uS.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andy Ross <andrew.j.ross@intel.com>
 Date:   Wed Jun 24 13:59:01 2020 -0700

    soc/xtensa/intel_adsp: Remove sof-config.h includes

    This header isn't used any more, and in any case shouldn't be included
    by SoC-layer Zephyr headers that need to be able to build without SOF.

    Signed-off-by: Andy Ross <andrew.j.ross@intel.com>

 Author: Andy Ross <andrew.j.ross@intel.com>
 Date:   Sat Jun 20 15:42:58 2020 -0700

    soc/intel_adsp: Leave interrupts disabled at MP startup

    This had some code that was pasted in from esp32 that was inexplicably
    enabling interrupts when starting an auxiliary CPU.  The original
    intent was that the resulting key would be passed down to the OS, but
    that's a legacy SMP mechanism and unused.  What it actually did was
    SET the resulting value in PS.INTLEVEL, enabling interrupts globally
    before the CPU is ready to handle them.

    Just remove.  The system doesn't need to enable interrupts until the
    entrance to the first user thread on this CPU, which will do it
    automatically as part of the context switch.

    Signed-off-by: Andy Ross <andrew.j.ross@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 23 13:57:54 2020 +0300

    dts: intel_cavs: Add required label

    Add required label fixing build for CAVS15, 20, 25.
    Fixes following errors:
    ...
    devicetree error: 'label' is marked as required in 'properties:' in
    bindings/interrupt-controller/intel,cavs-intc.yaml,
    but does not appear in
    ...

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 23 15:19:56 2020 +0300

    soc: cavs_v18: Remove dts_fixup and fix build

    Remove unused now dts_fixup.h and fix build with the recent code base.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 23 15:12:25 2020 +0300

    soc: cavs_v20: Remove dts_fixup and fix build

    Remove unused now dts_fixup.h and fix build with the recent code base.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 23 14:59:23 2020 +0300

    soc: cavs_v25: Remove dts_fixup fix build

    Remove unused now dts_fixup and fix build with the latest code base.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Fri Jun 12 12:29:06 2020 +0300

    soc: intel_adsp: Remove unused functions

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Jun 10 17:53:58 2020 +0300

    soc: intel_adsp: Clean up soc.h

    Remove unused or duplicated definitions.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Jun 10 17:02:23 2020 +0300

    soc: intel_adsp: De-duplicate soc.h

    Move soc.h to common SOC area.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Jun 10 15:54:19 2020 +0300

    soc: intel_adsp: Remove duplicated io.h

    Move duplicated io.h to common SOC area.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Fri Jun 12 12:39:46 2020 +0300

    cmake: Correct SOC_SERIES name for byt and bdw

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Fri Jun 12 12:39:02 2020 +0300

    soc: intel_adsp: Build bootloader only for specific SOCs

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Thu Jun 11 13:46:25 2020 +0100

    boards: xtensa: adsp: add byt and bdw boards WIP

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andy Ross <andrew.j.ross@intel.com>
 Date:   Wed Jun 10 10:01:29 2020 -0700

    soc/intel_adsp: Make the HDA timer the default always

    The CAVS_TIMER was originally written because the CCOUNT values are
    skewed between SMP CPUs, so it's the default when SMP=y.  But really
    it should be the default always, the 19.2 MHz timer is plenty fast
    enough to be the Zephyr cycle timer, and it's rate is synchronized
    across the whole system (including the host CPU), making it a better
    choice for timing-sensitive applications.

    Signed-off-by: Andy Ross <andrew.j.ross@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Jun 10 15:21:43 2020 +0300

    soc: cavs_v25: Enable general samples build

    Enables general samples build for SOC cavs_v25.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Jun 10 15:13:53 2020 +0300

    soc: cavs_v20: Enable general samples build

    Enable general sample build.

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Jun 10 14:35:13 2020 +0300

    soc: cavs_v18: Fix build general samples

    Fix building general samples for CAVS18.

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Jun 10 14:22:40 2020 +0300

    soc: intel_adsp: Add support for other SOCs

    Support other SOCs in the "ready" message to the Host.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Jun 10 13:25:39 2020 +0300

    soc: intel_adsp: Move adsp.c to common SOC area

    Move adsp.c to common and clean makefiles.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 9 17:18:18 2020 +0300

    boards: intel_adsp: Remove dependency on SOF

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Tue Jun 9 14:29:44 2020 +0100

    soc: xtensa: cavs: build now good for cavs20 + 25

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 9 15:57:01 2020 +0300

    soc: cavs_v15: Fix build for hello_world

    Fix build for other then audio/sof targets.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 9 14:50:12 2020 +0300

    sample: audio/sof: Remove old overlays

    Removing old overlays used to switch logging backend.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon Jun 8 15:02:01 2020 +0300

    soc: intel_adsp: Correct TEXT area

    Correct HEADER_SPACE and put TEXT to:
    (HP_SRAM_WIN0_BASE +  HP_SRAM_WIN0_SIZE + VECTOR_TBL_SIZE)

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 9 14:44:47 2020 +0300

    soc: intel_adsp: Trivial syntax cleanup

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 9 14:41:07 2020 +0300

    soc: intel_adsp: Fix bootloader script path

    Make it possible to find linker script if build is done not inside
    ZEPHYR_BASE.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Tue Jun 9 12:10:17 2020 +0100

    soc: xtensa: cavs20/25: fix build with new headers - WIP

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 9 13:35:38 2020 +0300

    soc: intel_adsp: Fix include headers

    Fixes include headers

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Tue Jun 9 10:38:50 2020 +0100

    soc: xtensa: cav18: updated headers- WIP

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andy Ross <andrew.j.ross@intel.com>
 Date:   Fri May 1 15:29:26 2020 -0700

    soc/xtensa/intel_adsp: Clean up MP config logic

    CONFIG_MP_NUM_CPUS is a platform value, indicating the number of CPUs
    for which the Zephyr image is built.  This is the value kernel and
    device code should use to predicate questions like "is there more than
    one CPU?"

    CONFIG_SMP is an application tunable, controlling whether or not the
    kernel schedules threads on CPUs other than the first one.  This is
    orthogonal to MP_NUM_CPUS: it's possible to build a "SMP" kernel on a
    uniprocessor system or have a UP kernel on a MP system if the other
    cores are used for non-thread application code.

    CONFIG_SCHED_IPI_SUPPORTED is a platform flag telling an SMP kernel
    whether or not it can synchronously signal other CPUs of scheduler
    state changes.  It should be inspected only inside the scheduler (or
    other code that uses the API).  This should be selected in kconfig by
    soc layer code, or by a driver that implements the feature.

    CONFIG_IPM_CAVS_IDC is a driver required to implement IPI on this
    platform.  This is what we should use as a predicate if we have
    dependence on the IPM driver for a platform feature.

    These were all being sort of borged together in code.  Split them up
    correctly, allowing the platform MP layer to be unit tested in the
    absence of SMP (c.f. tests/kernel/mp), and SMP kernels with only one
    CPU (which is pathlogical in practice, but also a very good unit test)
    to be built.

    Also removes some dead linker code for SMP-related sections that don't
    exist in Zephyr.

    Signed-off-by: Andy Ross <andrew.j.ross@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Jun 8 16:41:55 2020 +0100

    soc: xtensa: bootloader - use linker script

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Jun 8 16:26:18 2020 +0100

    soc: xtensa: further fix headers - WIP

    Simplify the directory structure, WIP for cavs20 and cavs25

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon Jun 8 12:59:30 2020 +0300

    soc: cavs_v15: Remove unneeded include

    Remove include fixing build.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Sun Jun 7 12:37:35 2020 +0100

    soc:xtensa: adsp: remove sof specific code from soc headers

    TODO: v1.8+

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Marc Herbert <marc.herbert@intel.com>
 Date:   Thu Jun 4 23:19:37 2020 -0700

    intel_adsp_*/doc: fix duplicate .rst labels

    Quick fix purely to make the build green again.

    Signed-off-by: Marc Herbert <marc.herbert@intel.com>

 Author: Marc Herbert <marc.herbert@intel.com>
 Date:   Thu Jun 4 22:34:40 2020 -0700

    samples/audio/sof: use OVERLAY_CONFIG to import apollolake_defconfig

    This reverts commit 21f16b5b1d29fca83d1b62b1b75683b5a1bc2935 that
    copied it here instead.

    Signed-off-by: Marc Herbert <marc.herbert@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Fri Jun 5 12:34:48 2020 +0300

    soc: intel_adsp: Move soc_mp to common

    Moving soc_mp to common SOC area, it still needs fixes for taking
    number of cores from Zephyr Kconfig, etc.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Thu Jun 4 16:05:06 2020 +0300

    soc: intel_adsp: Move memory.h from lib/

    For those files from SOF referencing platform/lib/memory.h we have
    include.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Thu Jun 4 15:20:09 2020 +0300

    soc: intel_adsp: Rename platform.h to soc.h

    Rename to prevent including it from SOF.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Thu Jun 4 11:47:55 2020 +0300

    soc: intel_adsp: Move headers

    Move headers to more convenient place

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Thu Jun 4 11:21:51 2020 +0300

    soc: intel_adsp: More SOC cleaning

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Marc Herbert <marc.herbert@intel.com>
 Date:   Mon Jun 1 15:31:34 2020 -0700

    samples/audio/sof: import sof/src/arch/xtensa/  apollolake_defconfig

    Import modules/audio/sof/src/arch/xtensa/configs/apollolake_defconfig
    into prj.conf and new boards/up_squared_adsp.conf

    Signed-off-by: Marc Herbert <marc.herbert@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed Jun 3 15:07:40 2020 +0100

    soc:xtensa: adsp: let SOF configure the DSP for audio

    Let SOF do this for the moment.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed Jun 3 15:06:20 2020 +0100

    soc: xtensa: cavs: remove headers similar to cavs15

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Jun 3 15:58:38 2020 +0300

    soc: intel_adsp: Move ipc header to common

    Remove duplicated headers from CAVS to common SOC part

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Jun 3 13:02:09 2020 +0300

    soc: cavs_v15: Remove unneeded headers

    Remove also from CAVS15.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 2 18:34:11 2020 +0300

    Remove more headers

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed Jun 3 14:12:09 2020 +0100

    soc: xtensa: remove cavs sod headers for drivers and trace.

    Duplicate cavs15 headers.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed Jun 3 14:05:12 2020 +0100

    samples: move sof dai, dma and clk configs to SOF

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 2 17:38:45 2020 +0300

    soc: intel_adsp: Remove more duplicated headers

    Remove more headers

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Tue Jun 2 15:50:03 2020 +0100

    samples: sof: remove pm realted files.

    Use the SOF versions.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 2 16:55:40 2020 +0300

    WIP: Strip lib from include path

    WIP, pushed for sync

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 2 14:44:33 2020 +0300

    soc: intel_adsp: Remove more headers

    Remove even more common headers

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Jun 2 14:00:47 2020 +0300

    soc: intel_adsp: Remove SOF headers

    The headers would be used by audio/sof app directly from SOF module.

 Author: Andy Ross <andrew.j.ross@intel.com>
 Date:   Sat May 30 11:01:26 2020 -0700

    soc/intel_adsp: Alternative log reading script

    This script speaks the same protocol and works with the same firmware,
    but:

    * Is a single file with no dependencies outside the python3 standard
      library and can be run out-of-tree (i.e. with setups where the
      firmware is not built on the device under test)

    * Operates in "tail" mode, where it will continue polling for more
      output, making it easier to watch a running process and acting more
      like a conventional console device.

    * Has no dependence on the diag_driver kernel module (it reads the DSP
      SRAM memory directly from the BAR mapping in the PCI device)

    * Is MUCH smaller than the existing tool.

    Signed-off-by: Andy Ross <andrew.j.ross@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Thu May 28 16:17:51 2020 +0300

    Decrease HEP pool size to 192000

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Fri May 29 10:27:00 2020 +0100

    soc: xtensa: cavs25: complete support for cavs25

    Builds, not tested on qmeu due to missing SOF ROM (TODO)

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Fri May 29 10:24:26 2020 +0100

    soc: xtensa: cavs20: complete cavs20 support

    Now boots on qemu.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Fri May 29 10:22:13 2020 +0100

    soc: xtensa: cavs18: complete boot support

    Now boots on qemu.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Fri May 29 10:19:23 2020 +0100

    soc: xtensa: cavs15: use cavs15 instead of apl as linker soc name

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Fri May 29 10:16:06 2020 +0100

    TODO: samples: sof: work  around missing trace symbols.

    Disable local trace.
    Needs trace updates finished before this can be removed.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed May 27 15:57:19 2020 +0100

    dts: xtensa: rename apl to cavs15 DTS

    This DTS is used by more than APL SOC. i.e. all CAVS15 SOCs

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed May 27 15:52:20 2020 +0100

    west: commands: sign: Add signing support for other CAVS targets

    Sign for CAVS15, CAVS18, CAVS20 and CAVS25 SOCs

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed May 27 15:50:07 2020 +0100

    boards: xtensa: cavs: used Zephyr mask macro

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed May 27 15:49:46 2020 +0100

    soc: xtensa: move code to SOF

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Tue May 26 11:40:36 2020 +0100

    soc: xtensa: use SOF versions of clk

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon May 25 18:38:45 2020 +0300

    soc: intel_adsp: Send FW ready for non SOF configuration

    Configure windows and send FW ready when used without SOF, should be
    loaded with fw_loader script.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon May 25 18:02:22 2020 +0300

    soc: intel_adsp: Use SOF version of the file

    Use exact copy from SOF module.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon May 25 17:47:27 2020 +0300

    soc: intel_adsp: Clean up include headers

    Remove SOF mentions from the SOC headers.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon May 25 17:43:05 2020 +0300

    soc: intel_adsp: Move SOF specific code to samples/audio/sof

    Move SOF specific code to the SOF sample.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon May 25 17:39:42 2020 +0300

    soc: intel_adsp: Use SOF module's version of mem_window.c

    Use exact copy from SOF module.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon May 25 17:36:41 2020 +0300

    soc: intel_adsp: Use exact copy from SOF module

    Use SOF module verion of the clk.c

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon May 25 14:03:35 2020 +0300

    soc: xtensa: Add {SOC_FAMILY}/common/include path

    Add ${SOC_DIR}/${ARCH}/${SOC_FAMILY}/common/include path if exist.
    Fixes issues for xtensa SOCs.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon May 25 16:18:50 2020 +0100

    soc: xtensa: cavs common: fix headers for build

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon May 25 16:10:57 2020 +0100

    soc: xtensa: adsp: add so_inthandlers.h for Intel platforms

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon May 25 16:08:26 2020 +0100

    cmake: xtensa: select correct compiler per CAVS target.

    TODO: what about XCC ?

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue May 19 14:59:26 2020 +0300

    boards: up_squared_adsp: Move SOF configuration to samples

    Move SOF-specific configuration to samples/audio/sof prj.

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Fri May 15 15:29:50 2020 +0300

    soc: intel_adsp: Move SOF code to modules/audio/sof

    Move SOF dependent code out of SOC area.

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Thu May 14 17:30:38 2020 +0300

    Move task_main_start() to audio/sof sample

    Start task_main_start() from main of audio/sof sample.

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed May 13 15:37:20 2020 +0300

    Rename up_xtreme_adsp to intel_adsp_cavs18

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon Apr 27 14:12:59 2020 +0300

    Add sample audio/sof for SOF initialization

    Add dedicated sample where we put SOF specific initialization.

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon May 11 18:49:36 2020 +0300

    WIP: soc: cavs_v18: Cleanup

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon May 11 15:44:06 2020 +0300

    soc: cavs_v15: Move soc init to common part

    Moving SOC init to the right place.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Mon May 11 15:02:28 2020 +0300

    soc: intel_adsp: Move common part to special dir

    Moving common part to common/adsp.c

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Fri May 8 14:37:50 2020 +0300

    boards: up_xtreme_adsp: Add initial up_xtreme_adsp board

    Add initial board copying existing up_squared_adsp board and using
    CAVS1.8 SOC family.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Thu May 7 15:30:51 2020 +0300

    soc: intel_adsp: Generalize bootloader

    Move bootloader to soc/xtensa/intel_adsp making it available for other
    boards.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Tue May 5 21:31:00 2020 +0100

    boards: xtensa: up_squared: Add support for all CAVS

    Add boot support for all CAVS versions. TODO: needs to be made common

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Tue May 5 21:25:34 2020 +0100

    soc: xtensa: intel_adsp: Manage cache for DMA descriptors

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon May 4 21:10:50 2020 +0100

    soc: xtensa: adsp: use 24M567 clock

    Use audio clock

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon May 4 10:04:01 2020 +0100

    xtensa: soc: adsp: enable system agent

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Sun May 3 15:03:07 2020 +0100

    soc: xtensa: intel_adsp: increase mem pool to 192k

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Sun May 3 15:02:31 2020 +0100

    soc: xtensa: intel_adsp: re-enable DMA trace

    Buffer will be empty (as trace items sent to Zephyr LOG) but
    logic is running.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Sun May 3 11:18:55 2020 +0100

    soc: xtensa: intel: dont use uncache region yet.

    Some code was still using this region. Use later.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Sun May 3 10:07:28 2020 +0100

    soc: xtensa: intel_adsp: fix notifier init

    Topology now loads.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Fri May 1 21:18:38 2020 +0100

    boards: up2: Need to use sof config for bootloader

    This will need uncoupled at some point. For testing today.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Fri May 1 21:16:38 2020 +0100

    boards: up2: increase heap to 128k

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Thu Apr 30 11:35:19 2020 +0300

    boards: up_squared_adsp: Use bigger HEAP

    Use HEAP from old demo.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Fri May 1 16:06:32 2020 +0100

    soc: xtensa: intel_adsp: Fix config.h naming collisions

    Rename sof version to sof-config.h

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Thu Apr 30 11:22:42 2020 +0300

    Small cleanups

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Apr 29 22:00:44 2020 +0300

    tests: sof/audio: Test ll scheduler

    Add more tests for scheduler.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Apr 29 18:38:35 2020 +0300

    tests: Add first schedule test

    Add initial test for testing scheduling.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed Apr 29 13:36:23 2020 +0100

    soc: xtensa: rmeove build warnings

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Apr 28 18:04:33 2020 +0300

    soc/intel_adsp: Register sof logging

    Register sof logging for tracing

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Apr 28 14:16:55 2020 +0300

    boards: up_squared_adsp: Define HEAP_MEM_POOL_SIZE

    Define HEAP_MEM_POOL_SIZE when SOF enabled.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Apr 28 10:09:20 2020 +0300

    tests: audio/sof: Add interrupt API for testing

    Add initial interrupt API for testing.

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Apr 27 15:54:28 2020 +0100

    soc: xtensa: adsp: Update linker script for SOF sections.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Apr 27 11:20:01 2020 +0100

    soc: xtensa: adsp: send SOF FW metadata as boot message

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Sun Apr 26 21:47:20 2020 +0100

    soc: xtensa: adsp: re-enable all SOF IP init.

    Do all SOF IP init.

    TODO: ATOMCTL, WFI on LX6

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Sat Apr 25 15:30:40 2020 +0100

    soc: xtensa: irq: Make sure IPC IRQ is registered.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Apr 22 20:56:09 2020 +0300

    tests: sof: Enable console

    Enable console for the test.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Apr 22 17:57:22 2020 +0300

    soc: cavs_v15: Fix XTENSA_KERNEL_CPU_PTR_SR

    Use correct value for XTENSA_KERNEL_CPU_PTR_SR.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Wed Apr 22 14:48:31 2020 +0300

    tests: audio/sof: Add tests for alloc API testing

    Add initial tests for allocation API testing. Can be extended for
    other later.

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Apr 21 17:49:32 2020 +0300

    logging: Enable xtensa simulator backend for ADSP

    Enable xtensa simulator backend for SOC_FAMILY_INTEL_ADSP.

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Apr 20 20:58:30 2020 +0100

    soc: xtensa: add common cpu logic

    Support for additional cores.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
 Date:   Tue Apr 21 10:11:07 2020 +0300

    Update west.yaml to point to the latest repo

    Update west.yaml

    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Apr 20 16:17:01 2020 +0100

    soc: xtensa: cavs: Fix build for clk.c on cavs18+

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Apr 20 16:05:31 2020 +0100

    soc: xtensa: cavs15: removed unused headers.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Apr 20 16:05:09 2020 +0100

    soc: xtensa: cavs25: align with SOF headers

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Apr 20 16:03:52 2020 +0100

    soc: xtensa: cavs20: align with SOF headers

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Apr 20 16:03:09 2020 +0100

    soc: xtensa: cavs18:  Align with SOF headers.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Apr 20 11:42:39 2020 +0100

    west: sof: Updated to latest version.

    Now builds, links and runs SOF code (but not to FW ready).

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Sun Apr 19 13:28:53 2020 +0100

    xtensa: intel adsp: build in SOF symbols if CONFIG_SOF

    Code now fully links against SOF. Needs to be run tested.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Daniel Leung <daniel.leung@intel.com>
 Date:   Wed Apr 15 10:19:28 2020 -0700

    DO NOT MERGE: temporarily add thesoftproject as remote for sof module

    Signed-off-by: Daniel Leung <daniel.leung@intel.com>

 Author: Daniel Leung <daniel.leung@intel.com>
 Date:   Wed Apr 15 10:33:40 2020 -0700

    ipm: cavs_idc: use the IPC/IDC definitions in SoC

    The SoC definitions have the necessary IPC/IDC bits so there is
    no need to define them separately.

    Signed-off-by: Daniel Leung <daniel.leung@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed Apr 15 14:30:20 2020 +0100

    TODO: config: Use static config for SOF module.

    TODO: needs to be generated as part of SOF kconfig

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Fri Apr 10 21:56:07 2020 +0100

    HACK: Add SOF into build

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed Apr 15 13:55:15 2020 +0100

    west: modules: Add SOF audio module.

    Add support for building SOF as a Zephyr module. This is the starting
    point for add SOF audio into Zephyr. Currently builds but does not use
    any symbols yet.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed Apr 15 13:48:48 2020 +0100

    WIP soc: adsp-cavs15: Use same include directory structure as SOF

    Use the same directory structure as SOF to simplify porting and allow
    SOF to build without Zephyr until porting work is complete.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed Apr 15 13:43:44 2020 +0100

    WIP soc: adsp-common: Use same include directory structure as SOF

    Use the same directory structure as SOF to simplify porting and allow
    SOF to build without Zephyr until porting work is complete.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Mar 16 14:36:32 2020 +0000

    WIP: soc: adsp-common: cache is common across all Intel ADSP platforms

    De-duplicate soc.h cache definitions.
    TODO: this needs done for other common functions.
    TODO: need to fix include path

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Mar 30 11:07:43 2020 -0700

    WIP: soc: cavs25: Import SOF SoC support

    SOF commit 2746df76b98f21d3e0b2c5cd4fe405c9a42014a4

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Mar 30 11:07:12 2020 -0700

    WIP: soc: cavs20: Import SOF SoC support

    SOF commit 2746df76b98f21d3e0b2c5cd4fe405c9a42014a4

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Mar 30 11:06:40 2020 -0700

    WIP: soc: cavs18: Import SOF SoC support

    SOF commit 2746df76b98f21d3e0b2c5cd4fe405c9a42014a4

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Daniel Leung <daniel.leung@intel.com>
 Date:   Mon Mar 30 12:37:17 2020 -0700

    soc: intel_adsp: use main_entry.S in common for cavs_v15

    The files are identical anyway.

    Signed-off-by: Daniel Leung <daniel.leung@intel.com>

 Author: Daniel Leung <daniel.leung@intel.com>
 Date:   Mon Mar 30 11:38:14 2020 -0700

    soc: intel_adsp/cavs_v15: link common code

    Let cavs_v15 link against the code compiled under common/.

    Signed-off-by: Daniel Leung <daniel.leung@intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Mar 16 13:08:28 2020 +0000

    WIP: soc: common: Import SOF SoC support

    SOF commit 2746df76b98f21d3e0b2c5cd4fe405c9a42014a4

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Mar 16 14:37:32 2020 +0000

    WIP soc: adsp-cavs15: build power down support

    Build the power down support for CAVS1.5

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Mar 16 12:40:17 2020 +0000

    WIP: soc: cavs15: Import SOF SoC support

    SOF commit 2746df76b98f21d3e0b2c5cd4fe405c9a42014a4

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Mar 16 14:30:08 2020 +0000

    soc: cavs15: Add missing SHIM registers.

    SOF commit 2746df76b98f21d3e0b2c5cd4fe405c9a42014a4

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Mon Mar 9 15:43:01 2020 +0000

    xtensa: intel_adsp/cavs_v15: fix usage of LP SRAM power gating

    Remove LSPGCTL as it can cause confusion, use SHIM_LSPGCTL instead.

    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
 Date:   Wed Feb 26 15:28:48 2020 +0000

    boards: up_squared_adsp: Use local xtensa HAL instead of SDK HAL

    SDK HAL is deprecated for Intel ADSP SoCs so fix and use local HAL
    module.

    Signed-off-by: Daniel Leung <daniel.leung@intel.com>
    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

 Author: Daniel Leung <daniel.leung@intel.com>
 Date:   Mon Mar 30 10:45:15 2020 -0700

    soc: add Intel Audio DSP SoC family

    This creates a SoC family for the audio DSPs on various
    Intel CPUs. The intel_apl_adsp is being moved into
    this family as well, since it is part of the CAVS v1.5
    series of DSPs.

    Signed-off-by: Daniel Leung <daniel.leung@intel.com>

 Author: Daniel Leung <daniel.leung@intel.com>
 Date:   Mon Mar 30 11:29:02 2020 -0700

    soc: xtensa: add CMakeLists.txt

    Add CMakeLists.txt under soc/xtensa so that CMakeLists.txt
    inside each SoC directory will be included, similar to
    what ARM and RISCV have.

    Signed-off-by: Daniel Leung <daniel.leung@intel.com>

 Author: Andy Ross <andrew.j.ross@intel.com>
 Date:   Wed Jun 17 12:30:43 2020 -0700

    Revert "boards: up_squared_adsp: Add flasher script"

    This reverts commit 80f295a9dd.

 Author: Andy Ross <andrew.j.ross@intel.com>
 Date:   Wed Jun 17 12:30:32 2020 -0700

    Revert "boards: up_squared_adsp: Update logtool tool"

    This reverts commit 7770d182c1.

 Author: Andy Ross <andrew.j.ross@intel.com>
 Date:   Wed Jun 17 12:30:23 2020 -0700

    Revert "soc: intel_adsp: Generalize bootloader"

    This reverts commit d6a33ef467.

 Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>

    soc: xtensa; intel: remove sof-config.h - SQUASH

    No longer used.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-21 06:38:53 -04:00
Andrei Emeltchenko c151f1768e subsys/logging: log_backend_rb: Clear memory, timestamps
Add option to clear memory slot before writing logs, making reading
logs more easy.

Add timestamp logging option

Add option to enable timestamp for ring buffer backend. Timestamp may
consume little memory we have for ring buffer.

Add timestamp logging option

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-10-21 06:38:53 -04:00
Jennifer Williams 5bda586c64 logging: fix if else if constructs missing final else
The logging subsytsem had if else if constructs without final
else statement. This commit adds else {} to comply with
coding guideline 15.7.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-10-07 23:05:18 -07:00
Xavier Chapron 824f423e54 misc: Replace assert include and calls by sys/__assert.h equivalent
Replace all calls to the assert macro that comes from libc by calls to
__ASSERT_NO_MSG(). This is usefull as the former might be different
depending on the libc used and the later can be customized to reduce
flash footprint.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2020-10-02 11:42:40 +02:00
Aastha Grover 83b9f69755 code-guideline: Fixing code violation 10.4 Rule
Both operands of an operator in the arithmetic conversions
performed shall have the same essential type category.

Changes are related to converting the integer constants to the
unsigned integer constants

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2020-10-01 17:13:29 -04:00
Peter Bigot b7a897ebd3 logging: avoid null pointer dereference in loop
An execution path could reach a loop that dereferences a pointer in
conditions where the pointer is null.  Add a check to the loop
condition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-23 13:08:18 -05:00
Guillaume Lager cb91977c48 logging: rtt: Do not retry on error in non blocking mode
Retry in non blocking mode can lead to a quite long (busy) wait.
Refs #28211

Signed-off-by: Guillaume Lager <guillaume.lager@gmail.com>
2020-09-11 09:34:54 -05:00
Tomasz Bursztyka cdf094a479 subsys: logging: Fix device instance const qualifier loss
Uart device is unique and thus does not need to be passed through the
logging context. Only the assert() requires a void * cast.

On log_output side, the device usage was removed. It is actually unclear
why it has been set like this since depending on the context, it can be
anything and not specifically a device.

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Christian Taedcke d026b5dd34 logging: net: Make autostart of backend configurable
In certain application configuration the networking log backend must not
be started, when the application starts. Starting it must be delayed
until routes to the logging server are established.

This commit introduces a new Kconfig setting to be able to control that
behaviour.

Fixes #27464

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-09-01 13:34:13 +02:00
Kamil Kasperczyk b07c2f8463 logging: Fix holding coherence of log levels in Spinel backend.
LOG_BACKEND_SPINEL_LEVEL turned out to be useless and was removed.
Also changes to keep coherence between Zephyr log level and OT log
level added by otPlatLog() were introduced.

Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
2020-08-20 09:19:12 +02:00
Christian Taedcke 819f4e00e6 logging: net: Modify ipv4 init code, so it compiles if ipv4 is disabled
In the function do_net_init() the paths for ipv6 and ipv4 now use the
same api to determine the source address.

Fixes #27428

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-08-14 18:51:28 -04:00
Marcin Niestroj fcabe3a506 logging: fix immediate logging with multiple backends
va_list was initialized once and passed to log_backend_put_sync_string()
for each logging backend. State of such va_list was changed in each
execution, resulting in different va_list state to be passed for
consecutive log_backend_put_sync_string() calls. This results in
undefined behavior and program crashes.

Use va_copy() to copy va_list state to temporary variable for each
logging backend and keep original va_list untouched. Pass such temporary
state to log_backend_put_sync_string() to make sure state for all
consecutive calls does not change.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-08-10 10:58:43 +02:00
Andrew Boie 8da93b136c logging: use kernel stack
The logging thread runs in supervisor mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-04 09:45:50 -05:00
Daniel Leung 3c2d0f37a3 logging: avoid identifier collisions
MISRA-C Rule 5.3 states that identifiers in inner scope should
not hide identifiers in outer scope.

The log output instances all named "log_output" in backends
collide with the "log_output" parameter of various functions.
This renames the variables in the backends to make them
more descriptive. Same goes for the buffers for some of
these instances as they are all named "buf", and "hostname"
being used in the network backend,  so they are renamed.

There are a few places where variables are overriden within
an inner scope (e.g. inside loop and if block) so they are
also renamed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-25 21:26:15 -04:00
Kamil Kasperczyk cb41255e3f logging: added new logging backend - Spinel protocol
New logging backend that can be used by NCP architecture.

Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
2020-07-21 15:11:55 +02:00
David D cf582284f7 logging: always add ids_print() to prefix even when using net backend
When using net log backend,
    adding severity and function name to log message.
    The log module name is a useful information when looking
    at log entries. This way remote log entries will
    contain the log module name.

Signed-off-by: David D <a8961713@gmail.com>
2020-07-21 15:09:13 +02:00
David D e023928e57 logging: Fixing timestamp calculation when using NEWLIB
corrected seconds value for gmtime() when using LOG_BACKEND_NET and
    NEWLIB_LIBC

Signed-off-by: David D <a8961713@gmail.com>
2020-07-21 10:29:04 +02:00
Tomasz Konieczny c73578f37a logging: enhanced external logsystems
Introduced interface for efficient logging from external logsystems:
Added handling of vaargs and automatic strdup to macros intended
to be used in logging interface function. Fast path to less then 4
arguments to speed up the execution. Made log_count_args external,
if external logsystem cannot count arguments.

Signed-off-by: Tomasz Konieczny <tomasz.konieczny@nordicsemi.no>
2020-06-17 17:08:12 +02:00
Krzysztof Chruscinski 29cab30d46 logging: Clarify that hexdump messages have no function prefix
It was not clear that hexdump messages does not support prepending
with function name. Added clarification.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-16 19:05:51 +02:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Andrew Fernandes 4653b4e63f logging: set 'log_backend_rtt:panic_mode' before 'log_backend_std_panic'
Set 'log_backend_rtt:panic_mode' before calling 'log_backend_std_panic',
because otherwise the RTT backend behaves as if the system is NOT
panicking and tries to do asynchronous writes via RTT_LOCK/UNLOCK.

Signed-Off-By: Andrew Fernandes <andrew@fernandes.org>
2020-05-28 11:45:42 +02:00
Xavier Chapron e5aaf21a73 subsys: Replace printf by printk when applicable
Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2020-05-09 21:25:33 +02:00
Wentong Wu ab8392fb8f logging: syst: enable protocol timestamp in SyS-T message
Enable protocol timestamp in SyS-T message.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-08 17:47:30 +02:00
Wentong Wu 450f21ff42 logging: syst: enable length field for SyS-T message
Enable generation of length field for SyS-T message.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-08 17:47:30 +02:00
Wentong Wu c3f38db5cb logging: add syst initialization code to zephyr tree
Add syst initialization code to zephyr tree.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-08 17:47:30 +02:00
Kumar Gala 8b6acb5e91 soc: arm: replace DT_CPU_CLOCK_FREQUENCY with new dt macros
Replace DT_CPU_CLOCK_FREQUENCY with a PATH based reference to cpu@0
(DT_PATH(cpus, cpu_0)) and than getting the clock_frequency property:

DT_CPU_CLOCK_FREQUENCY -> DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency)

This lets us remove DT_CPU_CLOCK_FREQUENCY from dts_fixup.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 23:55:37 -05:00
Joakim Andersson cd3a1f8ba3 logging: fix signed and unsigend comparison warnings
Fix instances of:
warning: comparison between signed and unsigned integer expressions
[-Wsign-compare]

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-03 18:06:59 -04:00
Jukka Rissanen ea1bed4744 logging: net: Avoid copying too much data
Use strncpy() in order to avoid copying extra data to hostname buffer.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-02 15:54:36 -04:00
Andy Ross 32bb2395c2 timeout: Fix up API usage
Kernel timeouts have always been a 32 bit integer despite the
existence of generation macros, and existing code has been
inconsistent about using them.  Upcoming commits are going to make the
timeout arguments opaque, so fix things up to be rigorously correct.
Changes include:

+ Adding a K_TIMEOUT_EQ() macro for code that needs to compare timeout
  values for equality (e.g. with K_FOREVER or K_NO_WAIT).

+ Adding a k_msleep() synonym for k_sleep() which can continue to take
  integral arguments as k_sleep() moves away to timeout arguments.

+ Pervasively using the K_MSEC(), K_SECONDS(), et. al. macros to
  generate timeout arguments.

+ Removing the usage of K_NO_WAIT as the final argument to
  K_THREAD_DEFINE().  This is just a count of milliseconds and we need
  to use a zero.

This patch include no logic changes and should not affect generated
code at all.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-03-31 19:40:47 -04:00
Oleg Zhurakivskyy b1e1f64d14 global: Replace BUILD_ASSERT_MSG() with BUILD_ASSERT()
Replace all occurences of BUILD_ASSERT_MSG() with BUILD_ASSERT()
as a result of merging BUILD_ASSERT() and BUILD_ASSERT_MSG().

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-31 07:18:06 +02:00
Carles Cufi 4b37a8f3a4 Revert "global: Replace BUILD_ASSERT_MSG() with BUILD_ASSERT()"
This reverts commit 8739517107.

Pull Request #23437 was merged by mistake with an invalid manifest.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-19 18:45:13 +01:00
Oleg Zhurakivskyy 8739517107 global: Replace BUILD_ASSERT_MSG() with BUILD_ASSERT()
Replace all occurences of BUILD_ASSERT_MSG() with BUILD_ASSERT()
as a result of merging BUILD_ASSERT() and BUILD_ASSERT_MSG().

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-19 15:47:53 +01:00
Andrei Emeltchenko 767d1bb6f9 logging: log_backend_rb: Use int for memory area size
Change "hex" to "int" for LOG_BACKEND_RB_MEM_SIZE.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-03-12 13:31:24 +02:00
Andrei Emeltchenko dbf1d5d87d logging: log_backend_rb: Make message buffer size configurable
Make slot size configurable making it easy to use with other
platforms.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-03-12 13:31:24 +02:00
Andrei Emeltchenko f4357837af logging: Make ring buffer backend more general
Ring buffer in memory backend does not depends on xtensa adsp board,
so make it general: remove to log_backend_rb and remove dependency on
up_squared_adsp.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-03-12 13:31:24 +02:00
Ulf Magnusson eddd98f811 kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.

There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.

The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).

Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.

Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.

Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.

The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.

(Everything above is true for choices, menus, and comments as well.)

Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 08:32:42 -05:00
Andrei Emeltchenko 05822fcd95 logging: log_backend_adsp: Cleanup logging
Fix syntax error in comments and remove unneeded headers.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-02-06 15:39:23 +02:00
Andrei Emeltchenko 18e58db3e4 log: Add Intel ADSP logging backend
Add logging backend for Intel Audio DSP.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-02-05 10:43:25 -05:00
Krzysztof Chruscinski 3e414b6ab4 logging: Add source name to error message about missing log_strdup
Added source name to help identifing which message caused the issue.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-02-01 08:09:26 -05:00
Carlo Caione 86a60475a4 arch: arm64: Fix logging test
We need a slightly bigger stack to be able to successfully pass the
logging test. Fix the stack size and enable back the test.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-02-01 08:08:43 -05:00
Andy Ross 9ec17d6556 subsys/logging: Fix xtensa simcall assembly
This construction was causing errors with recent gccs.  If you look
carefully, it's generating the sequence:

  simcall
  mov a2, a2
  mov a3, a3

...which is nonsensical.  And now gcc is complaining about it with:

    subsys/logging/log_backend_xtensa_sim.c:44:2:
        error: invalid hard register usage between output operands

Just emit a single simcall instruction and let the assembly
constraints do their job.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-02-01 08:08:19 -05:00
Krzysztof Chruscinski e0dcf56567 logging: Fix forcing printk processing with RTT
Printk should be processed by the logger if RTT logger backend is
used and RTT console. It is not necessary if console has different
transport.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-29 09:24:10 -08:00
Krzysztof Chruscinski 2b44eeb396 logging: rtt: Improve synchronous mode
RTT backend was treating synchronous mode (LOG_IMMEDIATE) and panic
mode in the same way. That lead to decreased bandwidth since after
each transfer operation backend was pending until RTT data is read by
the host. It is vital only in panic mode to ensure that device do not
reset before all data is read by the host. In synchronous mode that
degrades performance significantly.

Added distinction between those two modes.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-14 11:19:10 -05:00
Krzysztof Chruscinski ffbd48e2c1 logging: Fix false strdup buffer freeing
Algorithm for freeing strdup buffers was only checking if argument
matches address within strdup buffer pool and was attempting freeing
even if format specifier was different than string.

Added fix where also format specifier is checked.

Extended logger test to verify correctness of function which searches
for string format specifiers within a string.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-20 08:49:01 -05:00
Krzysztof Chruscinski 08a017a34b logging: Fix synchronous logging in thread context
Due to flipped logic is_irq_locked function was returning true then
interrupts were unlocked. Because of that CONFIG_LOG_BLOCK_IN_THREAD
feature was not working correctly and wasn't locking thread context
when log message buffer pool was empty.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-19 11:04:42 -05:00
Krzysztof Chruscinski 0e14a95f83 logging: Use single byte log_output buffer in an immediate mode
Ensure that RTT and xtensa_sim backends are using single byte
log_output buffer.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-18 13:08:46 -08:00
Krzysztof Chruscinski 117fab3004 logging: log_output: Improve immediate mode handling
When in immediate mode ensure that buffering is not used in log output.
Every byte is pushed to the transport.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-18 13:08:46 -08:00
Josh Gao 9f2916b943 logging: fix LOG_HEXDUMP_* in C++.
Previously, there were two issues when attempting to use LOG_HEXDUMP_*
from C++:

First, gcc and clang in C mode both allow implicit pointer conversion
by default, but require -fpermissive, which no one should ever use, in
C++ mode. Furthermore, -Wpointer-sign, the warning emitted in C for
convertion between pointers to types of different signedness (e.g. char*
vs u8_t*) is explicitly disabled in Zephyr. Switch the various hexdump
functions to void*, which is guaranteed to work in both languages.

Second, the soon-to-be-standardized C++20 version of designated
initializers requires that the designators appear in the same order as
they are declared in the type being initialized.

Signed-off-by: Josh Gao <josh@jmgao.dev>
2019-12-18 21:54:18 +01:00
Daniel Leung 218b45b749 logging: fix warning of array subscript having type char
In the count_s() function, with -Wchar-subscripts, GCC warns
about array subscript having type ‘char’ with the isalpha()
call. Since isalpha() takes an int, so do a type-cast there
to get rid of the warning.

This happens on XCC which is based on GCC 4.2.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-13 13:24:39 -05:00
Ulf Magnusson 87e917a925 kconfig: Remove redundant 'default n' and 'prompt' properties
Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.

Also replace some

    config
    	prompt "foo"
    	bool/int

with the more common shorthand

    config
    	bool/int "foo"

See the 'Style recommendations and shorthands' section in
https://docs.zephyrproject.org/latest/guides/kconfig/index.html.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 16:14:50 +01: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
Stephanos Ioannidis 2d7460482d headers: Refactor kernel and arch headers.
This commit refactors kernel and arch headers to establish a boundary
between private and public interface headers.

The refactoring strategy used in this commit is detailed in the issue

This commit introduces the following major changes:

1. Establish a clear boundary between private and public headers by
  removing "kernel/include" and "arch/*/include" from the global
  include paths. Ideally, only kernel/ and arch/*/ source files should
  reference the headers in these directories. If these headers must be
  used by a component, these include paths shall be manually added to
  the CMakeLists.txt file of the component. This is intended to
  discourage applications from including private kernel and arch
  headers either knowingly and unknowingly.

  - kernel/include/ (PRIVATE)
    This directory contains the private headers that provide private
   kernel definitions which should not be visible outside the kernel
   and arch source code. All public kernel definitions must be added
   to an appropriate header located under include/.

  - arch/*/include/ (PRIVATE)
    This directory contains the private headers that provide private
   architecture-specific definitions which should not be visible
   outside the arch and kernel source code. All public architecture-
   specific definitions must be added to an appropriate header located
   under include/arch/*/.

  - include/ AND include/sys/ (PUBLIC)
    This directory contains the public headers that provide public
   kernel definitions which can be referenced by both kernel and
   application code.

  - include/arch/*/ (PUBLIC)
    This directory contains the public headers that provide public
   architecture-specific definitions which can be referenced by both
   kernel and application code.

2. Split arch_interface.h into "kernel-to-arch interface" and "public
  arch interface" divisions.

  - kernel/include/kernel_arch_interface.h
    * provides private "kernel-to-arch interface" definition.
    * includes arch/*/include/kernel_arch_func.h to ensure that the
     interface function implementations are always available.
    * includes sys/arch_interface.h so that public arch interface
     definitions are automatically included when including this file.

  - arch/*/include/kernel_arch_func.h
    * provides architecture-specific "kernel-to-arch interface"
     implementation.
    * only the functions that will be used in kernel and arch source
     files are defined here.

  - include/sys/arch_interface.h
    * provides "public arch interface" definition.
    * includes include/arch/arch_inlines.h to ensure that the
     architecture-specific public inline interface function
     implementations are always available.

  - include/arch/arch_inlines.h
    * includes architecture-specific arch_inlines.h in
     include/arch/*/arch_inline.h.

  - include/arch/*/arch_inline.h
    * provides architecture-specific "public arch interface" inline
     function implementation.
    * supersedes include/sys/arch_inline.h.

3. Refactor kernel and the existing architecture implementations.

  - Remove circular dependency of kernel and arch headers. The
   following general rules should be observed:

    * Never include any private headers from public headers
    * Never include kernel_internal.h in kernel_arch_data.h
    * Always include kernel_arch_data.h from kernel_arch_func.h
    * Never include kernel.h from kernel_struct.h either directly or
     indirectly. Only add the kernel structures that must be referenced
     from public arch headers in this file.

  - Relocate syscall_handler.h to include/ so it can be used in the
   public code. This is necessary because many user-mode public codes
   reference the functions defined in this header.

  - Relocate kernel_arch_thread.h to include/arch/*/thread.h. This is
   necessary to provide architecture-specific thread definition for
   'struct k_thread' in kernel.h.

  - Remove any private header dependencies from public headers using
   the following methods:

    * If dependency is not required, simply omit
    * If dependency is required,
      - Relocate a portion of the required dependencies from the
       private header to an appropriate public header OR
      - Relocate the required private header to make it public.

This commit supersedes #20047, addresses #19666, and fixes #3056.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-11-06 16:07:32 -08:00
Ulf Magnusson bd6e04411e kconfig: Clean up header comments and make them consistent
Use this short header style in all Kconfig files:

    # <description>

    # <copyright>
    # <license>

    ...

Also change all <description>s from

    # Kconfig[.extension] - Foo-related options

to just

    # Foo-related options

It's clear enough that it's about Kconfig.

The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)

    git ls-files '*Kconfig*' | \
        xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Jan Van Winkel 0e59f6846f libc: Changed dependencies of NEWLIB_C into !MINIMAL_LIBC
Changed Kconfig dependencies of NEWLIB_C into !MINIMAL_LIBC

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-11-01 14:18:36 +01:00
Wentong Wu 73b83ed8b1 logging: add networking syst backend support.
add networking syst backend support.

Fixes: #19841.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-10-29 10:18:51 +01:00
Wentong Wu 211d5beaad logging: add RTT syst backend support.
add RTT syst backend support.

Fixes: #19841.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-10-29 10:18:51 +01:00
Wentong Wu 84809dbccf logging: add SWO syst backend support
add SWO syst backend support.

Fixes: #19841.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-10-29 10:18:51 +01:00
Wentong Wu 268e0f060c logging: add UART syst backend support
add UART syst backend support.

Fixes: #19841.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-10-29 10:18:51 +01:00
Wentong Wu dd9480913e logging: add syst format output
Add syst format output support for existing logging system.

Fixes: #19841.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-10-29 10:18:51 +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
Krzysztof Chruscinski 7b981e7372 logging: Fix lack of logging after startup
Commit ad28c2d6 introduced semaphore on which logger thread
pends. It is possible that log messages are created before
any backend is attached. In that case, logger thread pends
on semaphore with pending log messages and is not waken up
unless new log messages comes.

Fixed by setting semaphore when first backend is attached.
This wakes up logger thread and log messages can be processed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-16 10:43:31 -07:00
Jukka Rissanen dc7b307a47 logging: Print hexdumps with 16 bytes in one line
The hexdump was earlier printed using 8 bytes in one line like this

[00:00:00.131,143] <wrn> sample_instance.inst2: Example of hexdump:
01 02 03 04 05 06 07 08 |........
09 0a 0b 0c 0d 0e 0f 10 |........
11 12 13 14 15 16 17 18 |........
19 1a 1b 1c 1d 1e 1f 20 |.......
21 22                   |!"

This is not utilizing the width of the output best way possible.

Better utilization of the output is to print 16 bytes in one line
like this:

[00:00:00.131,136] <wrn> sample_instance.inst2: Example of hexdump:
01 02 03 04 05 06 07 08  09 0a 0b 0c 0d 0e 0f 10 |........ ........
11 12 13 14 15 16 17 18  19 1a 1b 1c 1d 1e 1f 20 |........ .......
21 22                                            |!"

In order to make it easier to find / calculate the bytes in the
output, print the output bytes in 8 byte groups.

This has the benefit that it is easier to map the Zephyr hex output
to Wireshark output which prints the bytes like this.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-11 17:53:50 +02:00
Peter Bigot ab91eef23b coccinelle: standardize kernel API timeout arguments
Use the int_literal_to_timeout Coccinelle script to convert literal
integer arguments for kernel API timeout parameters to the standard
timeout value representations.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-03 11:55:44 -07:00
Wentong Wu ad28c2d67a logging: wake up log process thread only when log message happen
Periodically wake up log process thread consume more power if system
already in sleep or deep sleep state. With the help of added logging
timer and semaphore, log process thread is woken up only when there
is logging message.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-10-02 10:28:05 -07:00
Krzysztof Chruscinski de057ba284 logging: Add log_output flushing to synchronous processing
Even though interrupts are locked before processing in synchronous
call, it is still possible that they will be interrupted by NMI.
In that case log_output module may assert because of buffer
overwritting.

Added flushing of log_output buffer before starting the process to
ensure that output buffer is always in reset state at the beginning.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-01 18:11:39 -04:00
Andrew Boie 7e29c9da0b logging: add minimal implementation
The log mechanism, even in immediate mode, adds somewhere
between 1K-2K of footprint to applications that use it.

We want to standardize the logging APIs for all logging
within the kernel, but need to not let platforms with
very constrained RAM/ROM in the dust.

This patch introduces CONFIG_LOG_MINIMAL, which is a very
thin wrapper to printk(). It supports the APIs expressed
in logging/log.h.

This will be the new default for test cases.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 09:24:02 -04:00
Andrew Boie d6d3f152b3 logging: remove return value from log_printk()
printk() doesn't return a value, this doesn't need to
either.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 09:24:02 -04:00
Krzysztof Chruscinski cc5094b3bf logging: Add option to block in thread context
Added CONIFG_LOG_BLOCK_IN_THREAD option to block until buffer for
log message is available. When log message is called in the thread
and there is no buffer available in the pool, thread will block with
configurable timeout (CONFIG_LOG_BLOCK_IN_THREAD_TIMEOUT_MS). If
buffer cannot be allocated by that time, message will be dropped.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-09-23 22:04:42 -07:00
Charles E. Youse e6a874d515 subsys/logging: change default stack size on x86 in long mode
The default stack size of 768 is just too small.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-23 17:50:09 -07:00
Andrew Boie 06c6b424b6 log_core: always build stubs when !userspace
These functions get called from various places and
we were observing linker errors. Always build the stubs
when userspace is disabled, gc-sections will discard them
if unused anyway.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-09-12 05:17:39 -04:00
Andy Ross 4723def90d tests/kernel/mem_protect/syscalls: Add cases to test 64 bit arguments
Add some simple tests of the new code generation for syscalls with 64
bit arguments.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-09-12 11:31:50 +08:00
Piotr Zięcik 892ab4e356 logging: Add basic userspace support
This commit adds basic userspace support to the logging subsystem.
With this change, the following API could be called from user mode:
- LOG_*()
- LOG_INST_*(),
- LOG_HEXDUMP_*(),
- LOG_HEXDUMP_INST_*(),
- LOG_PANIC(), LOG_PROCESS(),
- log_printk(), log_generic(), log_buffrered_cnt(),
- log_filter_set(NULL, ...)

With userspace disabled, the logger behavior and performance
is not affected. With userspace enabled, the calls from kernel
space have an additional overhead introduced by _is_user_context().

The logger behavior changes when it is called from the user context.
All strings logged using LOG_*() and LOG_INST_*() API from userspace
are rendered in place for security reasons and then placed in
log_strdup() memory pool, which should be large enough to hold bursts
of log messages.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-08-27 14:29:21 -04:00
Peter Bigot 1498ac3c07 logging: avoid buffer overrun extracting arguments
The number of arguments for a format string is approximated by the
number of conversion specifications.  This count may exceed the maximum
supported argument count.  Limit the extraction to the available space.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-08-19 12:23:28 +02:00
Nicolas Pitre 1f4b5ddd0f riscv32: rename to riscv
With the upcoming riscv64 support, it is best to use "riscv" as the
subdirectory name and common symbols as riscv32 and riscv64 support
code is almost identical. Then later decide whether 32-bit or 64-bit
compilation is wanted.

Redirects for the web documentation are also included.

Then zephyrbot complained about this:

"
New files added that are not covered in CODEOWNERS:

dts/riscv/microsemi-miv.dtsi
dts/riscv/riscv32-fe310.dtsi

Please add one or more entries in the CODEOWNERS file to cover
those files
"

So I assigned them to those who created them. Feel free to readjust
as necessary.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-02 13:54:48 -07:00
Krzysztof Chruscinski fce2692bcc logging: Clean up log.h dependencies
Cleaning up log.h include dependencies to allow log.h including in base
headers (e.g. kernel.h).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-08-01 14:42:40 +02:00
Piotr Zięcik 09b64467a9 logging: log_backend_swo: Get clock frequency from DTS
The log_backend_swo used system clock frequency
as a base for SWO clock calculation. This commit
corrects that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik ec857d0e4a logging: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
On some SoCs the frequency of the system clock is obtained at run time
as the exact configuration of the hardware is not known at compile time.
On such platforms using CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC define
directly introduces timing errors.

This commit replaces CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC by the call
to inline function sys_clock_hw_cycles_per_sec() which always returns
correct frequency of the system clock.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Krzysztof Chruscinski 1f046f9943 logging: Removing redundant code from xtensa sim backend
Refactored xtensa sim backend to use standard backend functions

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-18 18:16:39 -04:00
Krzysztof Chruscinski 20483961a8 logging: Removing redundant code from UART backend
Refactored UART backend to use standard backend functions

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-18 18:16:39 -04:00
Krzysztof Chruscinski 65b47f89c2 logging: Removing redundant code from SWO backend
Refactored SWO backend to use standard backend functions

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-18 18:16:39 -04:00
Krzysztof Chruscinski 9768f7826b logging: Removing redundant code from RTT backend
Refactored RTT backend to use standard backend functions

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-18 18:16:39 -04:00
Krzysztof Chruscinski 519c77d1e2 logging: Add qemu_x86_64 backend
Added backend for qemu_x86_64

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-18 18:16:39 -04:00
Krzysztof Chruscinski 9fa60f0307 logging: Add header with common log backend functions
Simple backends, like UART or RTT, implementation is very similar.
Header has functions which can be reused by simple backends and
remove redundant code.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-18 18:16:39 -04:00
Marcin Szymczyk a0c0996170 logging: add frontend calls in log_core
Call frontend instead of processing if CONFIG_LOG_FRONTEND is enabled.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-07-18 11:50:52 +02:00
Krzysztof Chruscinski 09993873bd logging: Fix corruption in log panic when scheduler was active
Logger had false assumption that once log_panic is called then
context switch will never occur and was not protecting against
reentrancy in panic mode. Added interrupt locking when accessing
unprotected part.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-09 11:59:49 +02:00
Anas Nashif 9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif d1b2718687 cleanup: include/: move uart.h to drivers/uart.h
move uart.h to drivers/uart.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif e1e05a2eac cleanup: include/: move atomic.h to sys/atomic.h
move atomic.h to sys/atomic.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
David Leach 70f25eb329 logging: Fix misspelled CONFIG_RISCV32
The conditional CONFIG_RISCV32 was misspelled in is_rodata() resulting
in the test failing all strings that are in RODATA section.
Additionally, it was using wrong section names for riscv.

Fixes #17065

Signed-off-by: David Leach <david.leach@nxp.com>
2019-06-26 09:07:01 -04:00
Nicolas Pitre 6987937582 log facility: make its records 64-bit compatible
Log records may store either data or pointers to more records. In both
cases they must have the same size. With 64-bit pointers, the amount
of data that can occupy the same space as a pointer has to be adjusted.
And storage alignment has to accommodate actual pointers not u32_t.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-24 08:58:52 +02:00
Nicolas Pitre 0567f161d8 log facility: make its arguments 64-bit compatible
Log arguments were hardcoded to u32_t values. On 64-bit systems, this
is rather restrictive. To make things clear, arguments now have their
own type, log_arg_t, which now can be adjusted in only one location
if need be.  It is currently defined as unsigned long whose effective
width is equivalent to u32_t on 32-bit systems, and u64_t on 64-bit
systems.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-24 08:58:52 +02:00
Anas Nashif f2cb20c772 docs: fix misspelling across the tree
Found a few annoying typos and figured I better run script and
fix anything it can find, here are the results...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-19 15:34:13 -05:00
Krzysztof Chruscinski aabe964b98 logging: Fix log_strdup detection on non-standard messages
Detection of missing log_strdup call was applied to every message
while it applies only to standard messages (string + arguments).
Appling it to hexdump messages could lead to fault as seen on
nrf9160_pca10090ns board.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-06-14 05:43:46 -04:00