Commit graph

99049 commits

Author SHA1 Message Date
Carlos Stuart
48320433e9 lib: cmsis_rtos_v2: Dynamic memory pools
Implemented dynamic allocation of memory pools in a similar to manner to
what was already implemented for message queues. Added all the same
checks on size vs. maximum allowed and current heap.

Added an additional Kconfig variable to define the maximum size of a
dynamically allocated memory pool.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-06 10:20:17 -05:00
Carlos Stuart
17db516069 lib: cmsis_rtos_v2: Message queue checks
Added some additional checks when creating a message queue to ensure the
size of the queue does not exceed the size of the buffer passed in via
the optional attributes.

Added a new Kconfig option to limit the maximum size of a message queue
dynamically allocated on the heap.

Added a check to ensure the heap is at least large enough to hold a
maximum size dynamically allocated queue.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-06 10:20:17 -05:00
Carlos Stuart
07a1a60df2 lib: cmsis_rtos_v2: Additional Kconfig dependency
Added Kconfig dependency that NUM_PREEMPT_PRIORITIES must be at least
osPriorityISR (56). This was enforced by a build assert message but not
decribed in the Kconfig.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-06 10:20:17 -05:00
Carlos Stuart
b484884c1e tests: cmsis_rtos_v2: Uncrustify source files
Ran uncrustify on all test source files to ensure a compliant base to
work from.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-06 10:20:17 -05:00
Carlos Stuart
ccf51e2f50 lib: cmsis_rtos_v2: Uncrustify source files
Ran uncrustify on all library source files to ensure a compliant base to
work from.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-06 10:20:17 -05:00
Rajavardhan Gundi
a23161e7fe gen_isr_tables: Fix _sw_isr_table generation for multi-level IRQs
The commit 77cb942a97 broke the generation of sw_isr_table for
multi-level IRQs. This patch fixes it.

Fixes #13082.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2019-02-06 10:13:25 -05:00
Anas Nashif
177df596d3 tests: irq_offload: remove irq_offload test
This is now part of kernel/common.
Forgot to remove it in d0bcf27eab

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-06 10:10:42 -05:00
Nathaniel Graff
7eb6bd6dfe boards/hifive1: Enable SPI driver
Enable the SPI driver on the HiFive 1

This makes the following configurations choices for the HiFive 1:

The SPI 0 peripheral driver is not enabled by default because it is in
charge of mapping the SPI flash into memory. This can be configured
using the CONFIG_SIFIVE_SPI_0_ROM KConfig option.

The SPI 1 peripheral driver is enabled by default and the pinmux is
configured for all of its outputs

The SPI 2 peripheral driver is enabled by default because it is present
in the DTS for the FE310, but because the QFN48 package used on the
HiFive 1 doesn't route those pins from the silicon die, the pinmux can't
enable the SPI 2 pins.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2019-02-06 09:00:00 -06:00
Nathaniel Graff
596e44d244 soc/riscv32-fe310: Enable DTS gen for SPI
Add the SPI bus DTS generation to the FE310 and the SiFive Freedom SoC.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2019-02-06 09:00:00 -06:00
Nathaniel Graff
9e2ef8db6d drivers/spi: SPI driver for SiFive Freedom
A driver for the sifive,spi0 SPI device on SiFive Freedom platforms

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2019-02-06 09:00:00 -06:00
Nathaniel Graff
5dbb147993 drivers/spi: Generate clock-frequency for SPI bus
Use DTS to generate the clock frequency driving the SPI peripheral.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2019-02-06 09:00:00 -06:00
Kumar Gala
128d2e2bd1 soc: riscv32: openisa_rv32m1: Support Zephyr toolchain
The 0.10 version of the Zephyr toolchain supports building on the
openisa_rv32m1 SoC.  So if the ZEPHYR_TOOLCHAIN_VARIANT is 'zephyr'
than select RISCV_GENERIC_TOOLCHAIN.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-06 14:25:47 +01:00
Kumar Gala
40e0a2e9da cmake: kconfig: Expose ZEPHYR_TOOLCHAIN_VARIANT to Kconfig
Expose ZEPHYR_TOOLCHAIN_VARIANT so that Kconfig can make choices based
on how its set.  For example we RISCV_GENERIC_TOOLCHAIN if the variant
is 'zephyr'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-06 14:25:47 +01:00
Takumi Ando
782a88f2c1 driver: usb: nordic: Fix compile warning with newlib
This commit fixes compile warning with CONFIG_NRFX_USB
and CONFIG_NEWLIB_LIBC.

Signed-off-by: Takumi Ando <takumi.ando@atmark-techno.com>
2019-02-06 14:25:09 +01:00
Takumi Ando
095d567a86 ext: hal: nordic: usb: Fix compile error with newlib
This commit fixes compile error with CONFIG_NRFX_USB
and CONFIG_NEWLIB_LIBC.

Signed-off-by: Takumi Ando <takumi.ando@atmark-techno.com>
2019-02-06 14:25:09 +01:00
Piotr Zięcik
461c81dc38 samples: nrf52: power_mgr: Show effect of power state locking
This commit enhances the power_mgr sample by adding code
presenting power state locking API as well as its effect
on the decisions made by the Power Management Policy.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-06 14:24:01 +01:00
Piotr Zięcik
b6bf56c3fc power: pm_ctrl: Allow fine-grained power state locking
This commit enables fine-grained power state locking.
Now, each power state could be independently enabled or disabled.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-06 14:24:01 +01:00
Wayne Ren
bfc66346b8 arch: arc: add the handling of APP_SHARED_MEM
add the handling of APP_SHARED_MEM.
privileged threads can access all the mem
explictly defined in user mode, i.e., APP_MEM & APP_SHARED_MEM

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-02-06 08:23:11 -05:00
Andrzej Głąbek
df901f4d9c boards: nrf: Indicate pwm as supported on Nordic DK boards
Indicate that PWM is supported on several Nordic DK boards so that
the pwm_nrf5_sw and pwm_nrfx drivers are covered by CI builds.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-06 07:19:07 -05:00
Andrzej Głąbek
e2b38e02bf drivers: pwm: nrf: Use HW PWM by default when available
Enable HW PWM driver instead of the SW one on nRF SoCs where the PWM
peripheral is present.
Default PWM instances are also enabled on Nordic DK boards so that it
is possible to build the basic fade_led sample for them without extra
adjustments.

After the above changes are applied, some configuration alterations
in basic samples blink_led and fade_led become no longer needed.
These are removed. And the blink_led sample is corrected so that it
works with the nRF HW PWM driver as well.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-06 07:19:07 -05:00
Andy Gross
2e8cdc1e7f kernel: Enforce k_mem_slab block size alignment
This patch puts checks in place to ensure that callers to the k_mem_slab
APIs provide word aligned block sizes.  If this is not done, this can
result in unaligned accesses and subsequent crashes.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2019-02-06 07:18:45 -05:00
Daniel Leung
5b13310177 Revert "gpio: enable callback to specify pin in addition to pin_mask"
This reverts commit eb6ea28649.

Reverting this to avoid confusion in using the gpio callbacks.

Fixes #11565

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-02-06 07:18:15 -05:00
Daniel Leung
f7a42a70f8 gpio: intel_apl: rework driver for pin_mask callback
To avoid confusion, callbacks using ordinal pin numbers
is going to be reverted. So the driver has to be re-worked
to expose multiple devices so each device has 32 pins.

Also fixes #12765

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-02-06 07:18:15 -05:00
Daniel Leung
7695a72e3c drivers/interrupt_controller: shared_irq: configure by device tree
This allows the shared_irq driver to be configured by device tree.
With previous implementation, only the board configuration can
override the IRQ trigger, as the trigger config is a "choice" rather
than "config". With this patch, the driver can be fully configued at
the SoC level.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-02-06 07:18:15 -05:00
Andy Gross
1e968a1976 shell: Allocate proper amount of history slab memory
This patch increases the amount of slab memory per item for the shell
history to match the maximum command input buffer size plus the
accounting information for the dnode list item.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2019-02-06 07:16:08 -05:00
Andrew Boie
2d9bbdf5f3 x86: remove support for non-PAE page tables
PAE tables introduce the NX bit which is very desirable
from a security perspetive, back in 1995.

PAE tables are larger, but we are not targeting x86 memory
protection for RAM constrained devices.

Remove the old style 32-bit tables to make the x86 port
easier to maintain.

Renamed some verbosely named data structures, and fixed
incorrect number of entries for the page directory
pointer table.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-05 20:51:21 -08:00
Anas Nashif
a463625b76 tests: benchmarks: remove footprint tests
Those are outdated and unrunnable tests that require lots of
customization to keep them building and the information they provide
can't be retrieved in other means.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 20:40:07 -05:00
Anas Nashif
d0bcf27eab tests: common: move irq_offload test to common
This is a small test that can be easily integrated into the common set
of tests we have already.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 20:40:07 -05:00
Anas Nashif
d35f1150f3 tests: common: move boot_delay test to common
This is a small test that can be easily integrated into the common set
of tests we have already.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 20:40:07 -05:00
Anas Nashif
3f27247617 tests: common: move errno test to common
This is a small test that can be easily integrated into the common set
of tests we have already.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 20:40:07 -05:00
Alexander Wachter
a2ddfe9863 dts: Fix varying baudrate settings for CAN
This commit fixes the varying baudrate settings for the STM32L4
and STM32F072.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-02-05 18:47:47 -06:00
Bobby Noelte
666cf22c60 arch: allow system clock driver selection for cortex m
The selection of the Cortex M systick driver to be used
as a system clock driver is controlled by
CONFIG_CORTEX_M_SYSTICK.

To replace it by another driver CONFIG_CORTEX_M_SYSTICK
must be set to 'n'. Unfortunately this also controls
the interrupt vector for the systick interrupt. It is
now routed to __reserved. More bad the interrupt vector
can not be set by IRQ_CONNECT as it is one of the hard
coded interrupts in the interrupt table.

Route the hard coded systick interrupt to z_clock_isr
and make z_clock_isr a weak symbol that can be overwritten
by an alternative systick system clock driver.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2019-02-05 18:43:03 -06:00
David B. Kinder
7744101887 doc: add icons to the home page blocks
Use (free license) fontawesome icon characters to pretty up the Zephyr
home page navigation blocks added earlier.  (The fontawesome font famliy
is already included by the read-the-doc theme so we can take advantage
of that.)

Also amend the section descriptions.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-02-05 18:36:16 -05:00
David B. Kinder
d34c116505 doc: add clean target to Makefile
Top-level Makefile is for documentation build convenience, so make it a
bit more convenient by adding a make clean target (sometimes needed when
to do a clean doc build when changes are made).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-02-05 16:58:14 -05:00
Andrzej Głąbek
3ea29d081f dts: nordic: Enable wdt nodes by default for all nRF SoCs
Actually, add the "status" property that enables the nodes explicitly.
They were apparently enabled by default without this property.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-05 15:23:24 -06:00
Andrzej Głąbek
44a08ab557 boards: nrf: Indicate watchdog as supported on Nordic DK boards
Indicate that watchdog is supported on several Nordic DK boards
so that the wdt_nrfx driver is covered by CI builds.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-05 15:23:24 -06:00
Aurelien Jarno
847a33d161 soc: same70: always enable data cache
Now that the SAM Ethernet driver can work when the cached is enabled, it
is possible to unconditionally enable the data cache on the SAM E70 SoC.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-02-05 15:03:35 -06:00
Timon Baetz
4cc355d423 boards: hifive1: Added flash runner
HiFive1 flash runner using OpenOCD and GDB

Signed-off-by: Timon Baetz <timon.baetz@gmail.com>
2019-02-05 14:29:16 -06:00
Keguang Zhang
dfd40d2636 setting: avoid the registration of the same handler
Avoid the registration with the same handler by checking handler name.

Signed-off-by: Keguang Zhang <keguang.zhang@unisoc.com>
2019-02-05 20:45:27 +01:00
Andy Gross
a468c15eca ARM: Fix push/pop alignment on ARM platforms
This patch adjusts the way we are doing push/pop operations before
making function calls inside of assembly routines.  ARM requires 8
byte aligned stack operations across public interfaces.  This means
that we need to be sure to push multiples of 2 registers.

Fixes #2108

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2019-02-05 13:13:39 -06:00
Andy Gross
4d2459e515 ARM: Add r3 to clobber list when configuring stack guard
If you enable HW_STACK_PROTECTION, DEBUG_OPTIMIZATIONS, and
CPU_STATS, you can get a crash when switching to the main thread
due to the r3 getting munged during a inline ASM call.  This patch
fixes that by adding r3 to the clobber list.

Fixes #12821

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2019-02-05 13:13:39 -06:00
Anas Nashif
c96c90acf7 sanitycheck: return build.log when we think we crashed
In some cases sanitycheck handles a build error that started with 'make
run' as a handler crash when it actually failed during building. Right
now we try to attach the handler.log to the XML output even if it did
not exist. Check for the file and if it was not found, go back to the
build.log

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 13:40:49 -05:00
Peter A. Bigot
d75495709d drivers: gpio: fix mis-use of slist API in callback processing
The iterator over registered callbacks failed to account for the
possibility that the callback would remove itself from the list.  If
this occurred any remaining callbacks would no longer be reachable from
the node.  Switch to the slist iterator that is safe for self-removal.

Note that the slist API remains unsafe for removal of subsequent nodes.
Even with the corrected code removal of the next callback registration
(cached in tmp) will result in it being called anyway, with the
remaining unremoved registrations not being called.  If the next
callback were removed and re-registered on a different device, the
callbacks would be invoked for the wrong device.

Resolve this by a documentation change describing the conditions under
which a change to callback registration from within a callback are
permitted.  Add a similar note regarding the effect of adding a
callback.  The current event invocation behavior for callbacks added
within an event is explicitly left unspecified, though in the current
slist implementation newly added callbacks will not be invoked until the
next event.

Closes #10186

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-02-05 12:33:25 -06:00
Peter A. Bigot
b48478fef3 driver: gpio: remove documentation related to pin-based callback config
This reverts the documentation component of commit
eb6ea28649.

The original change broke the API contract: drivers that use GPIOs need
to be able to configure callbacks without being aware of whether a
particular implementation expects to use a mask or a pin ordinal.

Revert the API documentation to its original format, and mark that the
added field should be removed when issue #11565 is resolved.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-02-05 12:33:25 -06:00
Ioannis Glaropoulos
aa826960d8 arch: arm: mpu: align NXP MPU implementation with ARM MPU
This commit re-works the NXP MPU driver implementation so that
it aligns with the implementation for ARMv7-M and ARMv8-M MPU
architectures.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-02-05 09:28:59 -08:00
Ioannis Glaropoulos
8d381a8b88 arch: arm: mpu: remove unnecessary MPU region type definitions
This commit removes the unnecessary MPU region type definitions
from arm_core_mpu_dev.h, as they are not used any more in any of
the architecture-specific MPU implementations (ARMv7-M, NXP, and
ARMv8-M MPU).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-02-05 09:28:59 -08:00
Ioannis Glaropoulos
a96643eb20 arch: arm: clean up depreciated implementation and API definition
This commit removes obsolete ARM CORE MPU API definitions
and related implementation from arm_mpu.c, in the wake of
the transition to the new ARM MPU design.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-02-05 09:28:59 -08:00
Ioannis Glaropoulos
2f6904f9cb arch: arm: mpu: group together USERSPACE-related implementation
This commit moves all internal implementation, relevant for
User mode, in a single place in the arm_mpu_v7_internal.h,
arm_mpu_v8_internal, and in arm_mpu.c. Additionally, the
commit cleans up internal function _get_region_attr() that
is not used any more.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-02-05 09:28:59 -08:00
Ioannis Glaropoulos
ab18719e83 arch: arm: mpu: implement API for memory domains in ARM (core) MPU
This commit updates the ARM Core MPU API for memory domains,
to align with the principle of de-coupling the partitioning
and the access attribution with the architecture-specific
MPU driver implementation.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-02-05 09:28:59 -08:00
Ioannis Glaropoulos
b5d4527036 arch: arm: mpu: implement arm_core_mpu_get_max_available_dyn_regions
This commit adds the implementation of internal ARM MPU
function, arm_core_mpu_get_max_available_dyn_regions(),
required by _arch_mem_domain_max_partitions_get(),
according to the new architecture. The function returns
the number of the available partitions for memory domains
based on the total amount of HW regions and the
actual number of statically configured MPU regions.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-02-05 09:28:59 -08:00