Commit graph

159 commits

Author SHA1 Message Date
Andrzej Głąbek b814f8ab4b soc: nordic_nrf: Update validation of base adresses with new entries
Add checks for:
- NRF_RNG
- NRF_IPC
- NRF_WDT0
- NRF_WDT1

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-11-08 14:54:12 +01:00
Andrzej Głąbek cf92c31e02 modules: hal_nordic: Update nrfx to version 2.0.0
Update the hal_nordic module revision to switch to nrfx 2.0.0.
Add Kconfig options that enable to use the newly introduced nrfx
drivers in Zephyr.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-11-08 14:54:12 +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 1f38ea77ba kconfig: Clean up 'config FOO' (two spaces) definitions
Must've been copy-pasted around.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05: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
Ulf Magnusson 975de21858 kconfig: Global whitespace/consistency cleanup
Clean up space errors and use a consistent style throughout the Kconfig
files. This makes reading the Kconfig files more distraction-free, helps
with grepping, and encourages the same style getting copied around
everywhere (meaning another pass hopefully won't be needed).

Go for the most common style:

 - Indent properties with a single tab, including for choices.

   Properties on choices work exactly the same syntactically as
   properties on symbols, so not sure how the no-indentation thing
   happened.

 - Indent help texts with a tab followed by two spaces

 - Put a space between 'config' and the symbol name, not a tab. This
   also helps when grepping for definitions.

 - Do '# A comment' instead of '#A comment'

I tweaked Kconfiglib a bit to find most of the stuff.

Some help texts were reflowed to 79 columns with 'gq' in Vim as well,
though not all, because I was afraid I'd accidentally mess up
formatting.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-01 15:53:23 +01:00
Ulf Magnusson a02c333963 arm/riscv: kconfig: Remove type from NUM_IRQS in defconfig files
Add a common definition for NUM_IRQS in arch/arm/core/Kconfig and
arch/riscv/Kconfig. That way, the type doesn't have to be given for
NUM_IRQS in all the Kconfig.defconfig files.

Trying to get rid of unnecessary "full" symbol definitions in
Kconfig.defconfig files, to make the organization clearer. It can also
help with finding unused symbols.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-28 08:27:28 -05:00
Ulf Magnusson 2b61031c8f kconfig: Remove symbol types from Kconfig.defconfig files
Same deal as in commit 7fdb525754 ("kconfig: Use 'default' instead of
'def_bool' in Kconfig.defconfig files"), but I hacked Kconfiglib to also
find cases where the type is given separately as e.g.

    config FOO
            int
            default 3

Motivation (from a note in
https://docs.zephyrproject.org/latest/guides/kconfig/index.html):

    For a symbol defined in multiple locations (e.g., in a
    Kconfig.defconfig file in Zephyr), it is best to only give the
    symbol type for the "base" definition of the symbol, and to use
    'default' (instead of 'def_<type>' value) for the remaining
    definitions. That way, if the base definition of the symbol is
    removed, the symbol ends up without a type, which generates a
    warning that points to the other definitions. That makes the extra
    definitions easier to discover and remove.

It's also nice if 'def_bool' and the like turn into a semi-reliable flag
that the symbol is only defined in Kconfig.defconfig files. That might
be a sign that things could be cleaned up.

Will do a separate pass later to remove some symbols only defined in
Kconfig.defconfig files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-24 12:40:22 -05:00
Stephanos Ioannidis 5eb71b45b4 soc: arm: Clean up HAS_CMSIS_CORE usage.
For nordic_nrf, this commit relocates HAS_CMSIS_CORE selection from
SoC Kconfig to the HAL module Kconfig, as done for other SoCs.

For nxp_kinetis, remove redundant HAS_CMSIS_CORE selection in SoC
Kconfig, as it is already selected by the HAL Kconfig.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-10-18 14:01:07 -05:00
Stephanos Ioannidis bb14d8c5e5 ext: hal: cmsis: Update references to HAS_CMSIS to HAS_CMSIS_CORE.
This commit updates all references to HAS_CMSIS to use HAS_CMSIS_CORE
instead. With the changes introduced to allow multiple CMSIS variants
to be specified, the latter is semantically equivalent to the former.

For more details, see issue #19717.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-10-18 14:01:07 -05:00
Ulf Magnusson ac9fe11f2f Kconfig: Remove copy-pasted comments on some promptless symbols
Remove the

    # Omit prompt to signify a "hidden" option

comments that appear on some symbols. They seem to have been copy-pasted
at random, as there are lots of promptless symbols that don't have them
(that's confusing in itself, because it might give the idea that the
ones with comments are special in some way).

I suspect those comments wouldn't have helped me much if I didn't know
Kconfig either. There's a lot more Kconfig documentation now too, e.g.
https://docs.zephyrproject.org/latest/guides/kconfig/index.html.

Keep some comments that give more information than the symbol having no
prompt.

Also do some minor drive-by cleanup.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-17 13:05:24 -05:00
Andrew Boie 8c98a97581 arm: arch code naming cleanup
This patch re-namespaces global variables and functions
that are used only within the arch/arm/ code to be
prefixed with z_arm_.

Some instances of CamelCase have been corrected.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-04 10:46:23 +02:00
Andrzej Głąbek f473cd4965 soc: nordic_nrf: Add validation of base addresses defined in dts
Add a set of build time assertions that checks if the peripheral base
addresses defined in dts nodes match the values provided by nrfx/MDK.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-27 11:39:31 -04:00
Andrzej Głąbek 35754375bc soc: nordic: Get rid of nrf_common.h
This file contains redundant definitions of a bunch of nRF IRQ numbers
(not all, however) that only generates confusion, as enumeration values
provided by MDK can be used instead.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Andrzej Głąbek c24c463328 soc: nordic: Include <nrfx.h> instead of <nrf.h> from <soc.h>
This change is done so that there is no need to additionaly include
<nrfx.h> before <soc/nrfx_coredep.h> (what might be a bit surprising)
and so that <nrfx_config.h> doesn't need to be include separately for
nRF SoCs requiring a special mapping of peripheral accessing symbols.

This commit removes also no longer needed inclusions and updates
the hal_nordic module with required minor correction of nrfx_glue.h.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Andrzej Głąbek 57c6cfc9cd nordic: Use hal/ in all inclusions of nrfx HAL header files
Header files of nrfx HALs are not supposed to be included directly
but only with their names prepended with the hal/ directory (so that
an inclusion of an nrfx HAL header clearly differs from an inclusion
of an nrfx driver header).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Ioannis Glaropoulos c799e953ee soc: arm: nordic: introduce Kconfig option for LE Coded PHY
We, now, have multiple nRF52x SoCs with 2.4GHz
Radio with LE Coded PHY Capabilities. Therefore,
we would like to have a Kconfig option and select
it in the corresponding SoCs. This allows us to
simplify several #ifdef blocks in the nRF Bluetooth
Controller that would, otherwise, require listing
all nRF SoCS with LE Coded PHY support.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-23 10:50:01 +02:00
Andrzej Głąbek 916bf0e682 modules: hal: nordic: Update the module revision
Update the module revision so that the following commits become
effective:

* nrfx_config: Use common mappings of Kconfig options to nrfx macros
* nrfx_config: Unify the way of enabling instances in nrfx drivers
* nrfx_config: Add missing mappings of Kconfig option symbols
* CMakeLists: Add missing inclusions of driver implementation files

The above changes require a minor correction in the nrf91/soc.h file,
so it is also modified in this commit.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-10 13:23:44 +02:00
Andrzej Głąbek 92096048f7 soc: nrf9160: Remove unsupported Kconfig option GPIO_AS_PINRESET
In nRF9160 the reset pin is a dedicated one, it cannot be configured
as a regular GPIO pin, so this option should not be presented to users
building for this SoC, to not generate confusion.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-08-09 20:14:24 +02:00
Andrzej Głąbek dd7999d253 soc: nordic: Add HAS_HW_NRF_RADIO_IEEE802154 Kconfig option
Add a hidden Kconfig option indicating that a given SoC is equipped
with the IEEE 802.15.4 capable radio so that the corresponding driver
configuration can depend on it.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-07-31 16:09:30 +03:00
Andy Ross 7c0f44816e soc/arm: Increase nRF timer default to the cycle rate.
The nRF timer runs at only 32 kHz, so there's little reason to try to
divide it to get a synthesized tick rate.  Just use the raw clock as
the tick rate, which provides maximal precision and very
singnificantly simplifies the generated code for the ISR.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-02 22:52:29 -04:00
Ioannis Glaropoulos d202d620c7 soc: nordic: nrf9160: add IPC capabilities
The IPC peripheral is missing from the list of
supported HW for nRF9160, so this commit adds
that.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-07-02 19:09:25 -04:00
Anas Nashif 536dd5a71f cleanup: include/: move misc/slist.h to sys/slist.h
move misc/slist.h to sys/slist.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 190e368275 cleanup: include/: move power.h to power/power.h
move power.h to power/power.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
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Krzysztof Chruscinski ea44b056bc samples: drivers: counter: alarm: Fix compilation for nrf boards
Sample was not compiling for nordic boards because RTC_0
instance was not enabled by default and RTC_0 device is using
different DT define.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-06-14 05:44:39 -04:00
Benjamin Lindqvist f194982fa3 Power: Fix various spurious LOG_ERR calls
These events aren't errors at all, but rather part of normal operation.
They shouldn't trigger error messages, especially given that the console
gets absolutely flooded with them if power management is activated.

Signed-off-by: Benjamin Lindqvist <benjamin.lindqvist@endian.se>
2019-06-04 09:20:37 -04:00
Ioannis Glaropoulos 8d6346ef65 soc: arm: nordic_nrf: force platform-specific initialization
This commit enforces platform-specific initialization
for nRF SoC family. The specific platform initialization
hook is invoked directly after reset and calls the nRFx
SystemInit() function.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-05-27 09:20:50 -04:00
Ioannis Glaropoulos 4b15873c13 soc: arm: add ARM MPU node info and fixup for ARMv8-M SoCs
This commit adds a DTS node for the ARM MPU peripheral in the
device tree of ARMv8-M SoCs (for the secure and the non-secure
DTS descriptions) and updates the fixup files. SoCs:
- nrf9160
- musca_a
- musca_b1

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-05-20 14:06:10 -05:00
Ioannis Glaropoulos fb713aa062 soc: arm: move z_clearfaults() in kernel_arch_init()
In kernel_arch_init() we initialize the ARM core (interrupt
setup, fault init, etc.) so we can also move z_clearfaults()
in the same function and skip invoking it in the SoC init
functions.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-05-17 09:48:11 -07:00
Carles Cufi 5ec96b1766 soc: nrf: Conditionally enable clock control and timer
The CONFIG_CLOCK_CONTROL and CONFIG_NRF_RTC_TIMER were
unconditionally selected when enabling any nRF SoC. But since
timers can be disabled in the kernel, depend instead on
CONFIG_SYS_CLOCK_EXISTS, which is only defined when kernel
timer support is included.

Note that ideally we would enable CONFIG_NRF_RTC_TIMER only, and
that would select CONFIG_CLOCK_CONTROL (on which the RTC timer
depends) but there is a circular Kconfig dependency that prevents
us from doing so.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-15 10:44:59 +02:00
Jakub Rzeszutko 0efddb63b7 arm: nrf: Add support for the nRF52811
This commit adds basic support for nrf52811 in the arch SoC, dts
and nrfx folders.

The nRF52811 is a Bluetooth 5.1 Direction Finding SoC with comprehensive
protocol support.
The nRF52811 SoC is capable of the latest features of Bluetooth 5.1,
the most prominent being Direction Finding.

The radio in the nRF52811 SoC has comprehensive protocol capabilities,
including Bluetooth 5.1 Directing Finding, all Bluetooth 5 features,
802.15.4, Thread, Zigbee, ANT and 2.4 GHz proprietary.
It has 4 dBm TX power and has been optimized to offer the best RX
sensitivity of all SoCs in the nRF52 series.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-05-14 09:52:57 +02:00
Peter A. Bigot da3f7feaf8 soc: arm: nordic_nrf: unrevert provide custom busy_wait implementations
This reverts commit bd24b31139.

While the test case failure described in #14186 is associated with the
cycle-based busy-wait implementation, that test is fragile, and fails
less frequently once the incongruence between ticks-per-second and the
32 KiHz RTC clock are resolved.  It also assumes that the system clock
is more stable than the infrastructure underlying the the busy-wait
implementation, which is not necessarily true.

The gross inaccuracies in the standard busy-wait on Nordic described in
issue #11626 justify restoring the custom solution.

As this applies to all Nordic devices, move the setting to the top-level
Kconfig.defconfig.

See: https://github.com/zephyrproject-rtos/zephyr/issues/11626#issuecomment-487243369

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-05-07 14:32:21 +02:00
Peter A. Bigot c76dd1edb7 soc: arm: nordic_nrf: change default SYS_CLOCKS_PER_SEC
The default system clock on all Nordic devices is based on a 32 KiHz
(2^15 Hz) timer.  Scheduling ticks requires that deadlines be specified
with a timer counter that aligns to a system clock.  With the Zephyr
default 100 clocks-per-sec configuration this results in 100 ticks every
32700 ticks of the cycle timer.  This reveals two problems:

* The uptime clock misrepresents elapsed time because it runs 0.208%
  (68/32768) faster than the best available clock;

* Calculation of timer counter compare values often requires an integer
  division and multiply operation to produce a value that's a multiple
  of clock-ticks-per-second.

Integer division on the Cortex-M1 nRF51 is done in software with a
(value-dependent) algorithm with a non-constant runtime that can be
significant.  This can produce missed Bluetooth deadlines as discussed
in upstream #14577 and others.

By changing the default divisor to one that evenly divides the 2^15
clock rate the time interrupts are disabled to manage timers is
significantly reduced, as is the error between uptime and real time.  Do
this at the top level, moving SYS_CLOCK_HW_CYCLES_PER_SEC there as well
since the two parameters are related.

Note that the central_hr configuration described in upstream #13610 does
not distinguish latency due to timer management from other
irq_block/spinlock regions, and the maximum observed latency will still
exceed the nominal 10 us allowed maximum.  However this does occur
much less frequently than changing the timer deadline which can happen
multiple times per tick.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-05-07 14:32:21 +02:00
Andrew Fernandes 1b9dc5fa53 drivers: spi: nrfx: fix a CMakeLists.txt bug introduced in e96673d
Fix incorrect lowercase logical operators in a CMakeLists file.

Signed-off-by: Andrew Fernandes <andrew@fernandes.org>
2019-05-06 08:47:56 -05:00
Andrew Fernandes e96673dca7 drivers: spi: nrfx: allow enabling DMA with the nRF52832 despite PAN 58
Add a Kconfig option to enable DMA for SPI with SOC_NRF52832 as long as
it being disabled due to Product Anomaly Notice (PAN) 58 is explicitly
overridden. This allows the SPIM driver to be enabled for the nRF52832
SoC for situations where PAN 58 is not a problem.

Signed-off-by: Andrew Fernandes <andrew@fernandes.org>
2019-04-28 13:29:46 -04:00
William Fish cc15b9ced3 soc: nordic_nrf: MPU temperature sensor default
Consistency: nrf51 & 52 SOC set temp sensor as default if SENSOR=y

Signed-off-by: William Fish <william.fish@manulytica.com>
2019-04-18 12:25:51 -04:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Patrik Flykt fd42bf7443 soc: Rename reserved function names
Rename reserved function names in the soc/ subdirectory.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-04-03 17:31:00 -04:00
Piotr Zięcik bd24b31139 Revert "soc: arm: nordic: provide custom busy_wait implementations"
This reverts commit d4b4b99272 as it
introduced unwanted side effect: It moved the k_busy_wait() to other
clock that the one driving system timer and k_cycle_get_32(). As result,
delays created using these interfaces not matched each other.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-03-28 15:09:32 -05:00
Mieszko Mierunski 7700322961 dts: nrf: Add DPPIC to device tree.
Add DPPIC to dts. Add HAS_HW_NRF_DPPIC to nrf91 soc.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-03-28 09:30:57 -04:00
Piotr Mienkowski a3082e49a1 power: modify HAS_STATE_SLEEP_ Kconfig options
Add SYS_POWER_ prefix to HAS_STATE_SLEEP_, HAS_STATE_DEEP_SLEEP_
options to align them with names of power states they control.
Following is a detailed list of string replacements used:
s/HAS_STATE_SLEEP_(\d)/HAS_SYS_POWER_STATE_SLEEP_$1/
s/HAS_STATE_DEEP_SLEEP_(\d)/HAS_SYS_POWER_STATE_DEEP_SLEEP_$1/

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-03-26 13:27:55 -04:00
Piotr Mienkowski 17b08ceca5 power: clean up system power managment function names
This commit cleans up names of system power management functions by
assuring that:
- all functions start with 'sys_pm_' prefix
- API functions which should not be exposed to the user start with '_'
- name of the function hints at its purpose

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-03-26 13:27:55 -04:00
Ulf Magnusson 53376394b7 kconfig: Remove blank lines at the beginning/end of files
Maybe this is some "just in case" thing that got copied around. There's
no need to have a blank line at the beginning or end of Kconfig files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-13 07:29:42 -05:00
Thomas Stenersen a3fc1a1f53 drivers: nrf5: Don't force specific drivers from soc/arm/nordic_nrf
Redefining the config will not let another (out-of-source) driver be
chosen instead of the default. The driver is practically forced by the
soc settings. This commit moves default settings from soc/arm/nordic_nrf
into the drivers themselves.

Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
2019-03-12 19:42:40 +01:00
Patrik Flykt 4344e27c26 all: Update reserved function names
Update reserved function names starting with one underscore, replacing
them as follows:
   '_k_' with 'z_'
   '_K_' with 'Z_'
   '_handler_' with 'z_handl_'
   '_Cstart' with 'z_cstart'
   '_Swap' with 'z_swap'

This renaming is done on both global and those static function names
in kernel/include and include/. Other static function names in kernel/
are renamed by removing the leading underscore. Other function names
not starting with any prefix listed above are renamed starting with
a 'z_' or 'Z_' prefix.

Function names starting with two or three leading underscores are not
automatcally renamed since these names will collide with the variants
with two or three leading underscores.

Various generator scripts have also been updated as well as perf,
linker and usb files. These are
   drivers/serial/uart_handlers.c
   include/linker/kobject-text.ld
   kernel/include/syscall_handler.h
   scripts/gen_kobject_list.py
   scripts/gen_syscall_header.py

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-11 13:48:42 -04:00
Ioannis Glaropoulos 1d50b92890 soc: arm: nrf52810: reduce number of boot-time configured MPU regions
nRF52810 Flash and SRAM sizes do not have power-of-two values.
This commit reduces the amount of MPU regions reserved at boot
time to enforce basic permissions in Flash and SRAM memory. It
does this by selecting the next power-of-two size for the Flash
and SRAM regions, respectively. In this way we can cover the
entire Flash and SRAM space each with a single MPU region, thus,
save two MPU regions to be used by the kernel/application.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-03-01 19:43:17 +01:00
Andrzej Głąbek e2dd85472a soc: nrf52810: Allow the use of SPI0, TWI0, and UART0
In the recent MDK brought by nrfx 1.6.2, these legacy peripherals have
been revealed as available also in nRF52810. This patch allows their
use in Zephyr drivers.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-26 11:53:20 -06:00
Piotr Mienkowski f04a4c9deb power: rename CPU_LPS_n power states
CPU_LPS_n name used to indicate a low power state is cryptic and
incorrect. The low power states act on the whole SoC and not exclusively
on the CPU. This patch renames CPU_LPS_n states to LOW_POWER_n. Also
HAS_ pattern for Kconfig options is used in favor of a non standard
_SUPPORTED. Naming of deep sleep states was adjusted accordingly.

Following is a detailed list of string replacements used:
s/SYS_POWER_STATE_CPU_LPS_(\d)_SUPPORTED/HAS_STATE_LOW_POWER_$1/
s/SYS_POWER_STATE_CPU_LPS_(\d)/SYS_POWER_STATE_LOW_POWER_$1/
s/SYS_POWER_STATE_DEEP_SLEEP_(\d)_SUPPORTED/HAS_STATE_DEEP_SLEEP_$1/

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-02-26 02:30:13 +01:00
Piotr Mienkowski c75187587b power: simplify SYS_POWER_*_SUPPORTED Kconfig options
This commit removes dependency on SYS_POWER_LOW_POWER_STATES_SUPPORTED,
SYS_POWER_DEEP_SLEEP_STATES_SUPPORTED Kconfig options. Power management
SYS_POWER_LOW_POWER_STATES, SYS_POWER_DEEP_SLEEP_STATES options depend
now directly on specific power states supported by the given SoC. This
simplifies maintenance of SoC Kconfig files.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-02-26 02:30:13 +01:00
Piotr Zięcik 63b0df645e power: Clean up power state names
Some of power states used numerical suffix while otthers not.
This commit adds proper suffix to all power state names.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>

f
2019-02-19 13:25:36 -05:00
Piotr Zięcik c45961daae power: Rework OS <-> Application interface
This commit simplifies OS <-> Application interface controlling power
management. In the previous approach application-based PM required
overriding sys_suspend() and sys_resume() functions. As these functions
actually implemented power state change, in such case application
basically had to provide own implementation of all PM-related stuff,
which was not portable and hard to maintain.

This commit changes this scheme: The sys_suspend() and sys_resume()
are now system functions while the application could either use
built-in power management policies or provide its own. All details
of power mode switching are now handled by the OS.

Also, this commit cleans up the Kconfig options related to system-level
power management grouping them under common CONFIG_SYS_PM_ prefix.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-19 13:25:36 -05:00
Takumi Ando b81cfdf81b soc: arm: nrf51: Fix CONFIG_SYS_POWER_MANAGEMENT exclusion
We don't need these defines when we set CONFIG_SYS_POWER_MANAGEMENT=n.

Signed-off-by: Takumi Ando <takumi.ando@atmark-techno.com>
2019-02-13 11:47:16 +01:00
Takumi Ando 3af63b5d1d soc: arm: nrf52: Fix CONFIG_SYS_POWER_MANAGEMENT exclusion
We don't need these defines when we set CONFIG_SYS_POWER_MANAGEMENT=n.

Signed-off-by: Takumi Ando <takumi.ando@atmark-techno.com>
2019-02-13 11:47:16 +01:00
Piotr Zięcik 9cc63e07e4 power: Fix naming of Kconfig options controlling deep sleep states
This commit changes the names of SYS_POWER_DEEP_SLEEP* Kconfig
options in order to match SYS_POWER_LOW_POWER_STATE* naming
scheme.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-12 07:46:32 -05:00
Krzysztof Chruscinski a6c2c3f0a9 soc: arm: nordic_nrf: Remove duplicates from Kconfig.soc
Removing duplicates in selects for config SOC_NRF52832 and
SOC_NRF52840. Duplicates were unexpected merge artifacts.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-07 16:14:00 -05:00
Krzysztof Chruściński 6b4ff1252a drivers: counter: Counter API implementation for nRF Series (TIMER).
Shim for counter API using nrfx_timer driver.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2019-02-07 16:14:00 -05:00
Piotr Zięcik 28576260c3 power: Remove sys_is_valid_power_state() interface
Each platform is now specifying list of supported power states
as a Kconfig options. Some of the specified states could be
disabled in runtime. As result there is no need for the removed
interface.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-04 18:08:47 +01:00
Piotr Zięcik fdb62f7565 power: Make power_state enum global
Currently each SoC has to define own list of power states.
However all these definitions have to be the same, as common power
management code uses them.

This commit replaces per-soc power state list by global definition.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-04 13:36:29 +01:00
Piotr Zięcik 2587ed0090 soc: arm: nrf51: Backport power management code from nRF52
This commit ports power management code from nRF52 to the nRF51 SoC,
enabling usage of Zephyr Power Management policies on this platform.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-01-31 17:39:27 +01:00
Piotr Zięcik 4ce523094f soc: arm: nrf52: Update power management code for nRF52
This commit updates the power management code for nRF52 SoC
series after recent changes in Zephyr power management subsystem.

Changes:
- Removed LPS modes, as they are not supported by HW.
  (previous implemntation used CONSTLAT and LOWPWR settings
  in NRF_POWER to implement low power modes, however these
  knobs should be used only when application needs ultra low
  CPU wake-up time).

- Reworked code in order to allow adding custom power levels
  on the application level and provide better integration
  with power management subsystem.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-01-31 17:39:27 +01:00
Ioannis Glaropoulos 2a3852fc75 soc: nrf: add include of nrfx_config_nrf9160.h in nrf9160 soc.h
In soc.h of nRF9160 SoC we need to explicitly include
nrfx_config_nrf9160.h to have the standard peripheral
base address macro mappings in Zephyr builds for nRF9160
SoC. (We need to do this spefically for nRF9160, as those
macros are not present in the nRF9160 MDK header).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-25 22:16:49 +01:00
Ioannis Glaropoulos 704e4b446b soc: nrf: clean up inclusions and style fixes
Remove redundant inclusion of nrf.h (included by nrfx.h).
Group the logging/log.h inclusion together with the other
inclusions in this file (make inclusions' list look as in
nrf9160/soc.c).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-18 18:27:12 -05:00
Ioannis Glaropoulos bc5b8e24fe soc: nrf: remove unnecessary macros in mpu_regions.c
Remove the locally-defined macros which define the base
addresses for XICR, Peripheral space and PPB. The macros
are not used.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-18 18:27:12 -05:00
Ioannis Glaropoulos 5108990079 soc: nordic: add nRF9160 soc and mpu init configuration
This commit adds the nRF9160 fixup and the source files
for SOC and MPU boot configuration.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-15 17:18:34 -05:00
Ioannis Glaropoulos 1fa958510f soc: nordic: add Kconfig structure for nRF9160 SOC definition
This commit introduces the Kconfig file structure for nrf9160
SoC in the Zephyr tree.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-15 17:18:34 -05:00
Ioannis Glaropoulos 302a746bd6 drivers: clock control: nrf: rename CLOCK_CONTROL_NRF5 Kconfig symbol
This commit renames the CLOCK_CONTROL_NRF5 Kconfig symbol to
CLOCK_CONTROL_NRF. The change is required to aleviates confusion
when selecting the symbol in nRF9160 SOC definition.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-15 18:03:24 +01:00
Ioannis Glaropoulos 1aace66c05 soc: nordic: Fix flash driver defines nomenclature in fixup.h
In the wake of 9cbe468a470fe6a103557d4352d37604a632b2fe we need
to update the nomenclature of DT_FLASH_DEV_NAME macros.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-15 08:17:26 -06:00
Carles Cufi cee87a1ca2 soc: nrf: Add missing nRF52832 variants
The CIAA and QFAB variants of the nRF52832 were missing in Kconfig,
although present in Device Tree. Add the relevant Kconfig entries in
order to be able to select them.

Fixes #12417

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-11 10:32:42 +01:00
Peter A. Bigot 1c5cd92e12 soc: nordic: default GPIO when SPI enabled
SPI devices almost always require chip selects, which are configured
through GPIOs.  Make the GPIO infrastructure available by default when
SPI is enabled.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-02 13:01:41 +01:00
Anas Nashif 74a74bb6b8 power: rename api sys_soc -> sys_
sys_soc is just redundant, just call APIs with sys_*.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-28 16:16:28 -05:00
Anas Nashif 9151fbebf2 power: rename APIs and removing leading _
Remove leading underscore from PM APIs. _ was used for internal APIs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-28 16:16:28 -05:00
Ioannis Glaropoulos c8ff1fd27f soc: nordic: add Kconfig options for several peripherals
In the wake of introducing nRF9160 .dtsi header, we are
adding several HAS_HW_NRF_xxxx Kconfig symbols, for the
peripherals present in nrf9160 SoC.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-12-21 21:03:55 +01:00
Andrzej Głąbek 4b43065cfc drivers: nrf: Enable nRF drivers by default in Kconfig
Make the following nRF peripheral drivers:
- ADC
- GPIO
- I2C
- SPI
- UART
- USB_DEVICE
enabled by default so that users do not need to explicitly enable them
in their applications after choosing an nRF SoC as the build target.

Kconfig options enabling these drivers depend on both a given hardware
feature (e.g. I2C) and an nRF family SoC selected, so effectively they
will be automatically enabled only when it is adequate (and in most
cases these drivers are the only option for a given hardware feature
on nRF SoCs).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-12-21 21:01:37 +01:00
Andrzej Głąbek 7c13ba9965 drivers: serial: nrf: Remove false dependency on the gpio driver
Implementations of both flavors of serial drivers for Nordic SoCs
are no longer dependent on the gpio driver. Remove the dependency
from Kconfig.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-12-21 21:01:37 +01:00
Mieszko Mierunski 4a4e51ffa7 drivers: nrf: Fix UARTE fixup defines.
Due to alias changes, after UARTE is enabled current dts_fixup
is not working.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-12-20 18:32:40 +01:00
Håkon Øye Amundsen d270f08956 soc: nordic: Add BPROT and MPU to list of supported HW.
Add configuration values for HAS_HW_NRF_BPROT and HAS_HW_NRF_MPU.
Select these configurations where applicable.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2018-12-03 13:39:27 +01:00
Aurelien Jarno 1e9ed85de9 arm: nRF5x: select ENTROPY_NRF5_RNG if ENTROPY_GENERATOR is enabled
This is done on other SoCs and is important for some of the net samples.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-02 09:39:32 -05:00
Peter A. Bigot d4b4b99272 soc: arm: nordic: provide custom busy_wait implementations
Implementation taken from Nordic nrfx version 1.3.1 soc/nrfx_coredep.h,
modified to remove material from other series and to conform to Zephyr
coding standards.

Note that unlike standard k_busy_wait this is susceptible to
longer-than-intended delays due to the impact of interrupt handling.

Fixes #11626

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2018-11-26 19:13:18 +01:00
Ioannis Glaropoulos 8204ecbead arch: arm: mpu: declare and define arm_mpu_config as const
Declare and define arm_mpu_config and arm_mpu_regions
structs as const, as they are not modified in run-time.

Fixes #10320

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-21 09:44:21 -05:00
Mieszko Mierunski c9906dd3cf dts: nrf: Remove qdec dts.fixup defines and use aliases instead.
Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Mieszko Mierunski 066fe7294e dts: nrf: Remove cryptocell dts.fixup defines and use aliases insted.
Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Mieszko Mierunski ac4f588e1f dts: nrf: Remove USBD dts.fixup defines and use aliases instead.
Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Mieszko Mierunski 94dc637c65 dts: nrf: Remove WDT dts.fixup defines and use aliases instead.
Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Mieszko Mierunski 80421d3f5f dts: nrf: Remove GPIOTE dts.fixup defines and use aliases instead.
Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Mieszko Mierunski b370b2ba05 dts: nrf: Remove ADC dts.fixup defines and use aliases instead.
Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Mieszko Mierunski 34cb33daa8 dts: nrf: Remove UART dts.fixup defines and use aliases instead.
Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Mieszko Mierunski c1f7e0c955 dts: nrf: Remove SPI dts.fixup defines and use aliases instead.
Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Mieszko Mierunski 5a10087a25 dts: nrf: Remove TWI dts.fixup defines and use aliases instead.
Changed driver to use alias defines instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Michael Scott 7f6fcf2198 dts-binding: modem: wnc-14a2a: remove base_label to fix build errors
When the WNC-14A2A modem binding was originally introduced, I thought
the base_label would shorten the define keeping the result short and
easily portable.  Turns out with the latest changes, it has a side
effect of removing the "DT_*" prefix which is breaking the build.

Let's remove "base_label" from the modem binding and adjust all of
the dts_fixups referring to the WNC14A2A defines.

NOTE: This commit moves the left-over WNC14A2A dts_fixup defines from
the nRF52 soc into samples/net/lwm2m_client as the new values.
They will stay there until the modem can be re-configured as a shield.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-17 00:50:15 -05:00
Kumar Gala 1634cf2248 drivers/spi: Always selecet HAS_DTS_SPI once SPI is enabled
All drivers require DTS for their primary SPI settings.

Removing SPI_[0-9]_NAME config option added some more samples changes.
Usage of these options there was anyway not relevant.

Fixes #11064

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 14:02:00 -05:00
Kumar Gala fd6e9c6f58 dts: i2c: cleanup CONFIG_I2C_x_IRQ_PRI
The majority of cases of CONFIG_I2C_x_IRQ_PRI should be
DT_I2C_x_IRQ_PRI.  So go ahead and fix them up.  Only the i2c_nios
driver still uses Kconfig for getting priority.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 13:57:02 -05:00
Ulf Magnusson 4638652214 Kconfig: Use 'default' instead of 'def_bool' in Kconfig.defconfig files
This can help find unused symbols. Those end up without a type if
'default' is used instead of 'def_bool', which generates a warning.

Search for "Kconfig.defconfig" in
https://docs.zephyrproject.org/latest/application/kconfig-tips.html for
a longer explanation.

Keep the 'def_bool' for the following symbols, which seem to be
deliberately defined only in Kconfig.defconfig files:

 - ALTERA_AVALON_I2C
 - ALTERA_AVALON_MSGDMA
 - ALTERA_AVALON_PIO
 - ALTERA_AVALON_QSPI
 - ALTERA_AVALON_SYSID
 - CLOCK_CONTROL_IMX_CCM
 - CPU_EM4_DMIPS
 - CPU_EM4_FPUDA
 - CPU_EM4_FPUS
 - FP_FPU_DA
 - I2C_GECKO

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-13 16:04:01 -05:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Andrzej Głąbek f39ba7230d dts_fixups: Update labels generated from DTS with DT_ prefix
All labels containing "_<8-hex-digits>_" or "16550_<3or6-hex-digits>_"
in their names, assumed to be generated by the extracting script,
are updated with the DT_ prefix, to reflect the recent changes made
to the script.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Sebastian Bøe 3215dd862f cmake: nrf51: Don't #define NRF51822
The define NRF51822 has no in-tree users and is believed to have been
added by accident. The define NRF51 should be referenced in it's
place.

To avoid users accidentally referencing NRF51822 instead of NRF51, and
to avoid confusing users into believing that NRF51822 has semantics we
remove it.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-04 22:03:01 +01:00
Sebastian Bøe c4266a8cd2 cmake: Move MDK-defines from 'soc' to the MDK build script
The build script ext/hal/nordic/CMakeLists.txt manages the MDK
dependency. The MDK is not aware of Zephyr and uses it's own defines
to indicate what HW we are building for.

This commit moves these MDK-specific defines out of the 'soc' build
scripts and into the MDK build script where they belong.

This is expected to be a pure refactoring without side-effects.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-04 22:03:01 +01:00
Jamie McCrae 183e7445c6 soc: nordic: Add Nordic GPREGRET setting support
Adds support for setting GPREGRET register when rebooting.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdtech.com>
2018-10-29 21:43:23 +00:00
Pawel Dunaj ecae736e0b dts: Add support for Nordic QDEC
Add QDEC binding and entry in Nordic SoC DTSI files.

This closes issue #9364

Jira:DESK-259

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2018-10-17 13:45:51 -05:00