- Remove clock gating code to be compatible with A1 silicon
- Remove PLL deinitialization code out of soc file
Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
The issue was introduced by commit-id 27bdb83.
RTC_DIVIDER used to be 0 by default, now it's 1.
Fixes#8098
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The logic for using _Static_assert() was a little broken. We were
using it when on GCC 4.6+ AND when __STDC_VERSION__ said we were on
C99 or better. But it's not a C99 feature, it's a C11 feature. And
if GCC provides it as an extension, that's unrelated to a particular
language version. This should have been "GCC 4.6+ OR C11+".
This actually broke on the ESP-32 IDF toolchain, where (when using
-std=c99) the compiler was actually defining a C99 macro instead of
the C11 one, and choosing to use the wrong (and independently broken)
handling incorrectly. Fixes#8093.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Layer code mask is 0x7FF so obviously 0x802 is not valid (as it will
always set the synchronous bit).
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
GPIO API was not shown in doxygen output and on website because the
defgroup was closed prematurely. The closing brackets are still present
on the end of the file, so the additional closing can be safely deleted.
Fixes#8142
Signed-off-by: Johannes Hutter <johannes@proglove.de>
The old way of erasing was not completely moved to the new SPI access
function, thus always sending useless dummy bytes that could lead to
error (aka: erasing more than requested).
Fixes#8065
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
ETHERNET option was from first network stack (a fork of uIP). This
option is now called NET_L2_ETHERNET.
Fixes#7798
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
We are using _is_thread_prevented_from_running() to see if the
_current thread can be preempted in should_preempt(). The idea
being that even if the _current thread is a high priority coop
thread, we can still preempt it when it's pending, suspended,
etc.
This does not take into account if the thread is sleeping.
k_sleep() merely removes the thread from the ready_q and calls
Swap(). The scheduler will swap away from the thread temporarily
and then on the next cycle get stuck to the sleeping thread for
however long the sleep timeout is, doing exactly nothing because
other functions like _ready_thread() use _is_thread_ready() as a
check before proceeding.
We should use !_is_thread_ready() to take into account when threads
are waiting on a timer, and let other threads run in the meantime.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Previously, the stack buffer array wasn't being page-aligned.
If private kernel data was stored after the stack buffer in
the same page, the current thread would incorrectly have
access to it. Round stack sizes up on x86 to prevent this
problem.
Fixes#8118
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
True stack sizes may be rounded up, instead of using a multiplier
just fetch the true stack size and add one to it, just one byte
over should produce an error.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
It's not possible to enforce that K_THREAD_STACK_SIZEOF()
returns the original number passed to K_THREAD_STACK_DEFINE().
Some arches need to round this number up in order to satisfy
alignment constraints.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Commit 4ef36a4b54 ("tests/kernel/mem_slab: Fix memory overcommit")
caught this error, but missed the fact that there are two slabs that
need to be resized. I also failed to properly explain (or, to be
honestly, fully understand) the deadlock condition, so add a nice big
comment explaining it.
Basically: you have a bunch of threads that can allocate all but one
of their blocks before trying to allocate their last one and pending.
There must be at least one block left so all the threads don't
symmetrically go to sleep waiting on each other.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Use k_uptime_get() to compute both tv_sec and tv_nsec members
of timespec structure.
Fixes#8009
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Each driver seemed to use their own Kconfig option to set the name for
their drivers. This makes writing example/test code difficult as each
one of them will have to special case for each of the supported
platforms.
Use a consistent CONFIG_WDT_0_NAME option in all drivers.
Fixes#8094.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Instead of relying on CONFIG_WDT_ESP32_DISABLE_AT_BOOT, use
CONFIG_WDT_DISABLE_AT_BOOT that's available for all watchdog timers.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
In this fix we are asserting the return value of pthread_attr_init.
Resolves#7084
Coverity-CID: 185280
Signed-off-by: Sritej Kanakadandi Venkata Rama <sritej.kvr@gmail.com>
This commit moves the bit timing (PROP, BS1, BS2 segments and SWJ)
from Kconfig to the device-tree and fixes issue #7933
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
The r7 register is used as a frame pointer on ARM Thumb. As result, it
cannot be modified by the assembly code in functions using stack frame.
This commit replaces r7 by r8, which is a general purpose register.
Also it fixes#7704.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
Make sure the name string is NULL terminated in the readdir().
CID: 186037
Fixes Issue #7733
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
The file boards/common/intel_s1000_crb.board.cmake is not common at
all; it is specific to this board. Move its contents into the board's
board.cmake.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Fix the runner invocation for intel_s1000 board by getting
rid of board-dir, gdb and kernel-elf parameters.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Someone doing bisects on Zephyr will have to have both older
ZEPHYR_GCC_VARIANT and newer ZEPHYR_TOOLCHAIN_VARIANT environment
variables defined. Then warning about ZEPHYR_GCC_VARIANT is
confusing. Issue it if only ZEPHYR_GCC_VARIANT is defined, and
ZEPHYR_TOOLCHAIN_VARIANT isn't.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Sphinx defaults to Python highlighting, but a Kconfig lexer is available
as well
(http://pygments.org/docs/lexers/#pygments.lexers.configs.KconfigLexer).
Use it.
This only highlights Kconfig definitions without links (references to
other symbols), as Sphinx doesn't highlight '.. parsed-literal::' blocks
with links. It's an improvement over Python stuff getting highlighted at
least.
Side note: '.. highlight:: none' still gives '.. parsed-literal::'
blocks without links a different background color, for whatever reason.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
All other checks of thread_state use a bit wise & operator incase
there are other flags attached to the thread_state. Let's fix
the only outlier in _check_stack_sentinel() to be the same.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Tests failed on the target because flash area reserved
for fcb data storage was to small.
This path add dts overlay file for nrf52_pac10040 board which
increases this flash area to proper size.
Fixes#8038
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Add bit definitions and set M/N divider ownership in
i2s_initialize.
Changes to comply with coding guidelines
Changes to address review comments
Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
Added support for fractional division of reference clock to obtain
I2S bit clocks
For example:
If reference clock is 38.4MHz and
if the I2S format is 2ch, 32bits per channel, 48KHz sample rate,
the bit clock frequency has to be 2*32*48K = 3.072MHz
38.4MHz/3.072MHz = 12.5 (a fraction)
Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
Added a function to obtain the reference clock frequency value based on
SoC's bootstraps.
Added M/N divider base address in SoC header file
Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
Call k_thread_foreach only once from _sys_soc_suspend()
otherwise it will flood the console with stack dumps. As per
the test implementation, the one time call happens through
test_call_stacks_analyze_idle test case.
Also removed the the stack size comparision logic from
thread_callback() as the actual size allocated could be
different from what is requested based on the Kconfig option
CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT
Fixes Issue #7858
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
ARC only supports only 2 priority levels so make sure
the IRQ priority is not greather than 1.
The test was passing in previous build because the ASSERT was
not enabled.
Fixes Issue #8099
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
STM32 GPIO device initialization priority was set to
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT
Following introduction of __ZEPHYR_SUPERVISOR__ macro (#6835),
drivers intialization order have been reordered which blocks
some use cases now.
Increase GPIO init priority to get it initialized before SPI
and avoid a deadlock.
Fixes#7663
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The should_preempt() code was catching some of the "unrunnable" cases
but not all of them, opening the possibility of failing to preempt a
just-pended thread and thus waking it up synchronously. There are
reports of this causing spin loops over k_poll() in the network stack
work queues (see #8049).
Note that the previous _is_dummy() call is folded into (the somewhat
verbosely named) _is_thread_prevented_from_running(), and that the
order of tests has been changed/optimized to hopefully catch common
cases earlier.
Suggested-by: Michael Scott <michael@opensourcefoundries.com>
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit fixes some minor function documentation issues
and comments' style in the NXP_MPU driver.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit inserts sanity checks every time we are performing
a (re)-configuration of one or multiple MPU regions, ensuring
that we do not attempt to configure an invalid region number.
Particulary for arm_mpu_config(), called during pre-kernel
initialization phase, we add a system ASSERT if we attempt
to initialize more regions that what is supported by hardware.
We do this to ensure the misconfiguration is detected early and
the system boot is aborted.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit adds an internal function to disable an MPU region.
The function includes an assert that the requested MPU region
number is a valid one. arm_mpu.c is refactor to use this
function in all cases where an MPU region needs to be disabled.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit enhaces the documentation of internal functions
in arm_mpu.c by explicitly stating that the caller needs to
ensure the validity of the supplied MPU region index. The
warning is required as these functions modify the ARM MPU_RNR
register, without checking themselves the validity of the
provided region number.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit fixes some minor issues with coding style
and comment syntax in arm_mpu.c
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Change the zero latency interrupt priority level from 2 to 1.
This is the priority level that the kernel has reserved for the
zero latency IRQ feature by the _IRQ_PRIO_OFFSET constant.
The zero latency IRQ will now not be masked by the irq_lock function.
Update comments to reflect the priority levels reserved by the kernel.
Fixes: #8073
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This test spawned 4 threads all of which try to allocate 3 blocks from
the same mem_slab before freeing any, leading to a maximum of 12
in-flight allocations. But the slab contained only 3 blocks!
Most of the time it passed, but CI caught it failing on occasion,
possibly more often now due to recent scheduler changes. Fixes#8069
(hopefully).
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>