Commit graph

70 commits

Author SHA1 Message Date
Michael Hope be8cba4bad watchdog: add a watchdog driver for the SAM0 family.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Adam Podogrocki 6d4da19602 iwdg: make independent watchdog driver compliant with STM32Cube LL API
Appropriate inclusion done for F1/F3/F4/L4 families in SoC tree.

JIRA: ZEP-2347

Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-10-23 09:51:16 +02:00
Leandro Pereira 5f22dab17a esp32: Prefix ROM routines with esp32_rom_
Also provide their prototypes in `soc.h`.  This should help
readability, since some ROM functions, with their names as provided by
Espressif, have sometimes the same prefix as Zephyr APIs.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
David B. Kinder f00f58517b doc: replace UTF-8 chars
Some our Zephyr tools don't like seeing UTF-8 characters, as reported in
issue #4131) so a quick scan and replace for UTF-8 characters in .rst,
.h, and Kconfig files using "file --mime-encoding" (excluding the /ext
folders) finds these files to tweak.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-03 20:03:57 -04:00
Leandro Pereira 8dc88069be drivers: watchdog: esp32: Acknowledge watchdog interrupt
If the interrupt isn't acknowledged, the callback will continue to be
called.

Jira: ZEP-2556
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-25 15:31:46 -04:00
Leandro Pereira 1861022148 drivers: watchdog: esp32: Reduce number of seals/unseals
Jira: ZEP-2556
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-25 15:31:46 -04:00
Leandro Pereira 9bacdbac30 drivers: watchdog: esp32: Always use Timer Group 1 for WDT
The FreeRTOS port by Espressif uses the same timer group.  Do the same
here.

Jira: ZEP-2556
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-25 15:31:46 -04:00
Leandro Pereira d52de29fba esp32: Fix redefinition of BIT() macro
Esp-idf defines the BIT macro that is also defined in Zephyr's
misc/util.h.  Fix the issue by including the esp-idf headers first, so
that a check in util.h won't redefine the macro if it's already
defined.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-19 07:50:18 -04:00
Leandro Pereira d691045592 drivers: watchdog: Implement ESP32 watchdog driver
Zephyr's watchdog API is badly designed in the sense that it's a 1:1
abstraction on top of whatever Quark D2000 expects for its watchdog,
instead of expecting a generic timeout value.

This implementation tries as much as possible to calculate the watchdog
timeout in a way that's compatible with a Quark D2000 running at 32MHz;
a comment in adjust_timeout() explains this in more detail.

Jira: ZEP-2296
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-09 12:26:14 -07:00
Leandro Pereira 732424f065 drivers, net: Clean up semaphore initialization
Change the common "init with 0" + "give" idiom to "init with 1".  This
won't change the behavior or performance, but should decrease the size
ever so slightly.

This change has been performed mechanically with the following
Coccinelle script:

    @@
    expression SEM;
    expression LIMIT;
    expression TIMEOUT;
    @@

    - k_sem_init(SEM, 0, LIMIT);
    - k_sem_give(SEM);
    + k_sem_init(SEM, 1, LIMIT);

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-07-27 15:23:07 -04:00
Piotr Mienkowski b185f8617f watchdog: atmel_sam: enable build for all SAM family
atmel_sam watchdog driver was temporarily limited to SAME70
series only. Now that all SAM series are using ASF the
change can be reverted.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-05-28 09:18:54 -05:00
Kumar Gala c40239dcfa watchdog: atmel_sam: only build for SAME70
With recent changes we now have both SAME70 and SAM3X under
SOC_FAMILY_SAM so we need to limit the watchdog driver only to SAME70 as
it only builds there right now.

Change-Id: I4a7c90247ad22532b2384ca536cfb0cbd65186f9
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-28 21:49:45 +00:00
Kumar Gala ccad5bf3e3 drivers: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08f51e2bfd475f6245771c1bd2df7ffc744c48c4
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 10:06:48 -05:00
Kumar Gala 789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
Souvik K Chakravarty 8fa2f82524 watchdog: Add WDT driver for Atmel SAM SoCs
Basic Watchdog driver for Atmel SAM family MCUs. Currently only
disabling the watchdog is supported.

Tested on Atmel SAMV71 Xplained Ultra Evaluation Kit.

Origin: Original

Jira: ZEP-1684

Change-Id: I8f717c7f53aa290c944b7935e0570c2a6f53956e
Signed-off-by: Souvik K Chakravarty <souvik.k.chakravarty@intel.com>
2017-03-09 13:43:17 +00:00
Juan Solano ee623d21de drivers: Remove unnecessary CONFIG_SYS_POWER_DEEP_SLEEP
This commit removes unnecessary CONFIG_SYS_POWER_DEEP_SLEEP protection
in shim drivers as QMSI 1.4 has introduced empty context save/restore
functions that can be called in Quark D2000, therefore keeping common
code at the shim driver level for Quark SE and D2000.

Change-Id: Ia2a466327f999668c6511c0193014e9151bff6ae
Signed-off-by: Juan Solano <juanx.solano.menacho@intel.com>
2017-02-10 16:27:32 +00:00
Kuo-Lang Tseng 23b0074012 ext qmsi: Update to QMSI 1.4 RC2
Update the builtin QMSI code to 1.4 (RC2).
The below shim drivers were updated for API or interface changes:
- aio
- counter
- i2c_ss
- rtc
- wdt.

Also, arch soc specific power management code were updated.

Jira: ZEP-1572

Change-Id: Ibc8fae032a39ffb2c2c997f697835bc0208fd308
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-08 11:59:12 +00:00
Kuo-Lang Tseng dad4127761 drivers: QMSI WDT: simplify driver reentrancy code using IS_ENABLED macro
This is one of the series of patches that simplifies the driver
code by using the IS_ENABLED macro. This removes the need of the
const variable and the three wrapper functions on semaphore APIs.

Jira: ZEP-1251

Change-Id: I2ea0b2d04252d6b28e7d5ca528480234545e6eed
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-01-19 16:48:42 -08:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Vincenzo Frascino 8e44a5aa0e watchdog: Add driver for CMSDK APB WDOG
Add driver for CMSDK (Cortex-M System Design Kit) APB WDOG. This device
uses NMI as interrupt hence it requires Runtime NMI (CONFIG_RUNTIME_NMI)
to be configured in the platform.

Tested with drivers/watchdog sample application.

Jira: ZEP-1300
Change-Id: Ib318047109af81e32060e80d456ef3873fd380ea
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-12-06 10:31:45 -06:00
Vincenzo Frascino b41c0159a8 watchdog: Refactor main Kconfig file
This patch refactors the main Kconfig file in order to align it with the
Zephyr code style and to make sure that each Kconfig configuration
portion is easily identifiable.

Change-Id: Ib226aaa9a98e9b08a47d9d1c329f18f4f6936620
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-30 17:25:15 +00:00
Baohong Liu 3c01b5db57 drivers: wdt: update to unified kernel
Use new semaphore APIs from unified kernel.

Change-Id: I1e051271212290a90a5659190bf031e9961e1917
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-10 05:12:19 +00:00
Andrew Boie 0b474eef9c kernel: deprecate old init levels
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.

New init levels introduced: PRE_KERNEL_1, PRE_KERNEL_2, POST_KERNEL
to replace them.

Most existing code has instances of PRIMARY replaced with PRE_KERNEL_1,
SECONDARY with POST_KERNEL as SECONDARY has had a longstanding bug
where the documentation specified SECONDARY ran before the kernel started
up, but actually ran afterwards.

Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:59:44 +00:00
JuanX Solano Menacho f8130521e2 wdt_qmsi: Use qm_wdt_*_context API
Remove the Zephyr implementation and
update the wdt_qmsi driver to use new QMSI PM APIs.

Jira: ZEP-1001
Change-Id: I4d0a2e3b8cf402b457ee0454650080d406eb6d0a
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
2016-11-03 23:52:07 +00:00
Iván Briano 5b2160b598 watchdog qmsi: Enable the driver to work on ARC
Jira: ZEP-1030
Change-Id: Iab5bb301dae9a18dc2050606f230606ef76bebb5
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-11-02 22:24:48 +00:00
Jesus Sanchez-Palencia fd4dc0f11f wdt: Remove unneeded include from wdt_qmsi.c
qm_interrupt.h is not needed.

Change-Id: Ia9e62db9fc39ee7a8a36e087eb447cbc4a419817
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-10-31 20:58:33 +00:00
Iván Briano 0094ab228d ext qmsi: Update to QMSI 1.3 release
Update the QMSI drop we maintain in Zephyr, and fix the build where
needed:

- QM_SCSS_INT is renamed to QM_INTERRUPT_ROUTER;
- every member of QM_INTERRUPT_ROUTER was renamed as well;
- QM_IRQ_* renamed too, mostly added _INT at the end;
- some isr functions were renamed to keep their names consistent;
- build for x86 needs to define QM_LAKEMONT, as QM_SENSOR was for ARC.

Change-Id: I459029ca0d373f6c831e2bb8ebd52402a55994d1
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-10-31 13:26:06 +00:00
Marcus Shawcroft 807a103653 watchdog/iwdg_stm32: Limit name space, add static.
Change-Id: I497e2afe0a0e700c1fb95ef50338d44e601248df
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:09 +00:00
Marcus Shawcroft a2017aafa1 watchdog/iwdg_stm32: Fix missing include compilation error.
Change-Id: I0dae37eae451452e6071639b5258634c44c7ccbf
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:08 +00:00
Marcus Shawcroft bcc7f633fc drivers/watchdog: Make WDT_0_IRQ_PRI dependent on WDT_QMSI
The config variable WDT_0_IRQ_PRI is intended to be generic across a
range of watchdog drivers, however it has no default value which means
that if CONFIG_WATCHDOG is enabled, but no driver is provided for a
specific board the the configuration will fail.  For now, make
WDT_0_IRQ_PRI depend on the only driver that uses it.

Change-Id: I54708d66ac8fbc2ef657a1ef4510eb5e7a2cff28
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:07 +00:00
Marcus Shawcroft eb2f6e0325 wdt_qmsi: Make driver_api const.
Change-Id: I35055a6c5d41b3a9474fef45b9e7f8662f286c65
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:00 +00:00
Jesus Sanchez-Palencia 7c0fc99c79 ext qmsi: Update to QMSI 1.2 release
Update the QMSI drop we maintain in Zephyr, and fix the build where
needed:

- QM_USB_BASE is renamed to QM_USB_0_BASE;
- parameter int_en from qm_uart cfg struct was removed;
- driver's folder now has a new structure, fix makefiles accordingly;
- QM_WDT_MODE and related renamed to QM_WDT_CR_RMOD;
- QM_SCSS_AON renamed to QM_AONC.

Change-Id: Iffe9c66b7a3f2fe64418326e20ff0894149b3044
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-10-18 23:26:01 +00:00
Iván Briano aba245daad drivers qmsi: Fix power management with reentrancy disabled
The new device control API added a 'device_power_state' variable to the
driver's data structure to keep track of the current power state set
for a device. This member variable is conditionally built into the
runtime data structure of each driver, but in some cases the whole data
structure is conditional on its respective API_REENTRANCY config
variable.

In those cases where the runtime data was previously used only for
reentrancy protection, the runtime data pointer used for device
initialization is NULL, and when power management is enabled, this
invalid pointer ends up dereferenced to get the device_power_state
member.

Make the declaration of the runtime data dependent on any of its
conditional members, and NULL only when all of those settings are
disabled.

Change-Id: I4f41e00ad8551a096db639e31d33f43752b6672f
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-10-05 09:51:09 +00:00
amirkapl c490219d1e power_mgmt: Update sample and drivers according to new pm device API
Update the power sample and drivers with the new device driver power
management API using the existing logic

Jira: ZEP-954
Change-Id: Idd94232e458767635973e94e9fc673c01612c1e2
Signed-off-by: Amir Kaplan <amir.kaplan@intel.com>
2016-09-22 00:23:43 +00:00
Julien Delayen 0392d79845 wdt_qmsi: Implement suspend and resume functions
In order to restore watchdog context after entering
SYS_PM_DEEP_SLEEP, suspend and resume functions
are called.

The following parameters are restored:
 - All registers for the WDT device.
 - Watchdog interrupt mask.

The suspend/resume functionality is implemented in
the QMSI shim layer as a fast and temporary solution,
it will be removed and migrated to QMSI later.

Change-Id: I6e4e30a797b0ca38ce727d50fa51d1b2f8330405
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
2016-09-12 00:29:25 +00:00
Jithu Joseph 3dd008e0c2 qmsi: wdt: improved reentrancy of the wdt driver
Uses locking in an API and removes a global variable
for improved safety/correctness in the face of concurrent
threads and fibers.

The locking mechanism is by default disabled in the
build. To enable it, the following flag needs to be defined:

CONFIG_WDT_QMSI_API_REENTRANCY

Jira: ZEP-440
Change-Id: Ibcd1501a4af628017b20d7e7ce20b988c8e4e4e2
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-07-27 22:17:09 +00:00
Anas Nashif f35d6e04e3 qmsi: update qmsi to 1.1 alpha
Change-Id: Ib35ebcb32954f764ef8e33f6a1c11ad9f63931bc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:30:04 +00:00
Anas Nashif 72bf29eb03 watchdog: unify kconfig variables
Use consistent naming for watchdog drivers.

Change-Id: Idcec987253ce1b6230ccdf29cd8149d0bd705052
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:24 +00:00
Daniel Leung 75c4a181ab watchdog/qmsi: use new DEVICE_AND_API_INIT()
Change-Id: I118df1333524f774a80602f6a1f2ce95a6e4f1c1
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-28 01:03:39 +00:00
Anas Nashif 98c09140f1 qmsi: watchdog: use built-in qmsi driver
Change-Id: I0cff75181bb2a51c91e6589f9624f0891db0b6e9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:29 -04:00
Anas Nashif 9bf2da7ef4 stm32: rename CONFIG_SOC_STM32 -> CONFIG_SOC_FAMILY_STM32
Use CONFIG_SOC_FAMILY for the top level SoC family. A family
will have different SoCs or different SoC series with multiple
SoCs.
Adding the Family string to the config variable to avoid confusion
between actual SoCs and families and to prevent name collisions.

Change-Id: Ic99a2c1df7850dee3a45641027af82464dd6fadb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:58 +00:00
Daniel Leung 46052f2ad8 watchdog/iwdg_stm32: convert to use DEVICE_AND_API_INIT()
Change-Id: Ie72eedbe17d4534751a8b459bd35939f57534011
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:15 +00:00
Daniel Leung aa0635aa30 watchdog/dw: convert to use DEVICE_AND_API_INIT()
Change-Id: Id345c74ca4b466838f0382ef686d70ff5aedb10e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:12 +00:00
Daniel Leung f1ead35cc6 watchdog/wdt_dw: remove kconfigs that are SoC specific
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.

Change-Id: Ic73783189db57059d2b7f3727e4802e1b2e27931
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-31 23:17:24 +00:00
Andre Guedes 3172fca3a0 drivers: qmsi: Fix gpio, i2c and wdt for D2000
This patch fixes the gpio, i2c and watchdog shim drivers so they set the
CLK_PERIPH_CLK bit during driver initialization. Differently from Quark
SE, the peripheral clock gate bit (CLK_PERIPH_CLK) is not enabled by
default in Quark D2000. We have to explicitly set this bit in order to
properly initialize the device.

This issue has been masked so far because the CLK_PERIPH_CLK bit is set
when UART NS16550 driver is enabled. The UART NS16550 driver is enabled
by default for Quark D2000 so gpio, i2c and watchdog sample apps were
working just fine. But if we disable the NS16550 driver, these samples
applications stop working.

The remaining shim drivers already set the CLK_PERIPH_CLK bit during
initialization so there is no need to fix them.

Change-Id: I3f658da564f87e9d52092ce7aac423c7b3e0c890
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-18 23:31:45 +00:00
Maciek Borzecki 624c9e339a watchdog/iwdg_stm32: add driver for STM32 Independent Watchdog (IWDG)
Add a driver for Independent Watchdog (IWDG) commonly found in STM32
MCUs. The driver has been tested on STM32F1 family MCU.

Change-Id: Idc6ac35990e46901a206b4af0ce3767eb4875de9
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:57:26 +00:00
Andre Guedes 7c956d2ece drivers: Replace DEV_FAIL by -EIO
This patch replaces all occurences of the macro DEV_FAIL by -EIO
at the driver level. So this patch touch the files under drivers/,
include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I0594ab5dbe667e074c250129e7c13ce512ac940f
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes 024cfe754e drivers: Replace DEV_OK by 0
This patch replaces all occurences of the macro DEV_OK by the actual
value 0 at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I69980ecb9755f2fb026de5668ae9c21a4ae62d1e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00