Commit graph

18591 commits

Author SHA1 Message Date
Jean-Paul Etienne
bc81926b9a tests: kernel: test_mpool_concept: increase STACK_SIZE to 1024 for riscv32
In RISCV, stack always grows by a multiple of 16 bytes, even if we are saving
data of size < 16 bytes onto the stack.

Hence, for riscv32 architecture a bigger stack size is required for
test_mpool_concept, otherwise we experience stack overflow.

Change-Id: I938aa511efcae66f0131fa1bc23bd68600421885
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-24 23:03:29 +00:00
Anas Nashif
3b8925099e Bluetooth: Move Bluetooth docs to rst
Change-Id: I36009f5acd4016ec47edb6dac29e81e58b1ba24f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-24 17:58:59 +00:00
Anas Nashif
1cd715c5c9 doc: nios2 altera max 10 board documentation
Change-Id: I43c890433fb1a70e5bba77daa620e792030fa632
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-24 17:58:59 +00:00
Anas Nashif
9fede72910 docs: add Arduino 101 board documentation
Change-Id: I5f0cab8ece3544d14cf328de918f8d076328b859
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-24 17:58:58 +00:00
Kumar Gala
3ac51cd82b tests: newlib: disable bluetooth for now
When trying to build with newlib we get:

hci_driver.c: In function 'hci_driver_open':
hci_driver.c:389:10:
error: format '%d' expects argument of type 'int', but argument 2 has
type 'uint32_t {aka long unsigned int}' [-Werror=format=]
   BT_ERR("Required RAM size: %d, supplied: %u.", err,
          ^

This is because we have different types for {u}int32_t between newlib
and mini-libc.  We have to decide how we are going to handle this going
forward.  Various options include use of PRIu32, making mini-libc match
newlib's types, disabling the -Werror=format, etc.

Change-Id: I5df8fa05dd7658e1f6b2eeb8fa84e3270f3dd208
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-24 14:33:43 +00:00
Baohong Liu
77b7cb90d3 drivers: spi: enable gpio driver automatically when needed
Enable gpio driver automatically when an app or upper
level driver needs it as chip select for spi.

Change-Id: I2bed134939426e2c84f313393d638a878c84fbfc
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2017-01-24 13:47:22 +00:00
Bogdan Davidoaia
9f7a643310 sensor: fxos8700: expand trigger requirement to include pulse config
The pulse config option requires triggers enabled, so expand the
trigger requirement to also include all the pulse configs.

Change-Id: Ib94f4071cac757b24bfe940ca64fd11b07fed1c1
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-24 13:45:16 +00:00
Inaky Perez-Gonzalez
e45f05bc1e filter-known-issues: add warning support, clean up, add more help
Introduce support to tag some issues as warnings, that can be printed
but not considered errors.

Added the ability to write the errors and warnings to split files, for
later reporting.

Added a more consistent help.

Change-Id: Ia75430c3337385afca59595437168ab643c92911
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-01-24 13:44:48 +00:00
Sharron LIU
110d58c055 tests: kernel: mbox_api: fix uninit variable and unchecked value
"struct k_mbox_msg mmsg" should be initialized before using.
"int" value returned by k_mem_pool_alloc() should be checked.

Coverity-CID: 160083
Coverity-CID: 160470

Change-Id: I35714bf9d76723c5fdd8c2963bf76b42ae1b1867
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-01-24 13:39:58 +00:00
Sharron LIU
d9a3c92b5b tests: kernel: mpool: fix assert side effect
assert should not contain "i++" which might work differently in a non-debug
build.

Coverity-CID: 160469

Change-Id: Id8fd50127dd93de1676b812ac0888c9ec2e1b5de
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-01-24 13:39:41 +00:00
Sharron LIU
41d805a235 tests: kernel: mpool: fix unchecked return value
"int" value returned by k_mem_pool_alloc() should be checked.

Coverity-CID: 160471

Change-Id: I7ec19147e7a51997fed890075b06eba30bef9126
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-01-24 13:39:09 +00:00
Andre Guedes
6f141a5576 quark_se: PM: Add multicore support
This patch changes Quark SE power drivers to support multicore scenarios
e.g. both LMT and ARC core are enabled and manage power.

Handling LPS states in multicore scenarios are dead simple because LPS
states are core-specific states. It means that putting the LMT core in
LPS doesn't affect the ARC core, and vice-versa. DEEP_SLEEP state, on
the other hand, affects both cores since it turns power off from the SoC
and both cores are shutdown. It means that if LMT puts the system in
DEEP_SLEEP, ARC core is shutdown even if it is busy handling some task.

In order to support the multicore scenario, this patch introduces the
SYS_POWER_STATE_DEEP_SLEEP_2 state to both ARC and x86 power drivers.

On ARC, this state works as following:
1) Save ARC execution context;
2) Raise a flag to inform the x86 core that ARC is ready to enter in
   DEEP_SLEEP;
3) Enter in the lowest core-specific power state, which in this case is
   LPSS.

On x86, DEEP_SLEEP_2 is very similar to DEEP_SLEEP. The difference relies
in the post_ops() which calls _arc_init() in order to start ARC core so
it can restore its context.

This patch also adds the test/power/multicore/ directory which provides
sample application to x86 and ARC cores in order to easily verify the
multicore support. In test/power/multicore/README.rst you can find more
details regarding the applications.

Jira: ZEP-1103

Change-Id: Ie28ba6d193ea0e58fca69d38f8d3c38ca259a9ef
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2017-01-24 13:36:55 +00:00
Sharron LIU
cd35f06de8 tests: kernel: msgq: fix unused value
"ret" returned from k_msgq_put() should be checked.

Coverity-CID: 160084

Change-Id: I192db3a67ab9489e8338f6636d4c2a6935e98d74
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-01-24 13:36:15 +00:00
Benjamin Walsh
ee659ae1a1 build: add _ASMLANGUAGE to all asm files
This avoids asm files from having to explicitly define the _ASMLANGUAGE
symbol themselves.

Change-Id: I71f5a169f75d7443a58a0365a41c55b20dae3029
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-01-24 13:34:51 +00:00
Benjamin Walsh
ed240f2796 kernel/arch: streamline thread user options
The K_<thread option> flags/options avaialble to users were hidden in
the kernel private header files: move them to include/kernel.h to
publicize them.

Also, to avoid any future confusion, rename the k_thread.execution_flags
field to user_options.

Change-Id: I65a6fd5e9e78d4ccf783f3304b607a1e6956aeac
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-01-24 13:34:50 +00:00
Benjamin Walsh
4b65502448 kernel/x86: move INT_ACTIVE/EXC_ACTIVE to thread_state
They are internal states, not user-facing.

Also prepend an underscore since they are kernel internal symbols.

Change-Id: I53740e0d04a796ba1ccc409b5809438cdb189332
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-01-24 13:34:50 +00:00
Benjamin Walsh
867f8ee371 kernel: move K_ESSENTIAL from thread_state to execution_flags
The execution_flags will store the user-facing states of a thread.

This also fixes a bug where K_ESSENTIAL was already assigned to
execution_flags via the options field of
k_thread_spawn()/K_THREAD_DEFINE().

Change-Id: I91ad7a62b5d180e09eead8985ff519809959ecf2
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-01-24 13:34:49 +00:00
Benjamin Walsh
a8978aba8f kernel: rename thread states symbols
They are not part of the API, so rename from K_<state> to
_THREAD_<state>.

Change-Id: Iaebb7d3083b80b9769bee5616e0f96ed2abc5c56
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-01-24 13:34:49 +00:00
Benjamin Walsh
3f3f4d94d5 kernel: remove K_STATIC
Unused.

Reuse bit for K_FP_REGS to keep the used bits the lowest possible.

Change-Id: I5998801ef34156271d4f66d1948a05e0b2ce58f7
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-01-24 13:34:48 +00:00
Benjamin Walsh
dfa7ce5c94 kernel: include kernel.h in kernel_structs.h in asm files
This will be needed for some thread user options that will move to
kernel.h since they are part of the user API.

Change-Id: I46e302b6cafcdddbad3458134b98feb5b8d45d9b
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-01-24 13:34:48 +00:00
Benjamin Walsh
a5d8461d74 kernel: move volatile from k_thread.prio to k_thread.sched_locked
When prio and sched_locked were moved into a struct together to create a
union with the combined preempt field, the volatile qualifier moved from
sched_locked to prio by mistake.

Change-Id: I5a8e01324f14e77e3d7162c12515471826023633
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-01-24 13:34:47 +00:00
Anas Nashif
12215b4185 Merge "Merge arm branch into master" 2017-01-24 03:01:03 +00:00
Ramesh Thomas
02f327df5d samples: power_mgmt: Convert README to RST format
Changed README to RST and updated the formatting.

Jira: ZEP-1537
Change-Id: I012854daff6883cf462a3cc0246c73a8767dcd66
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-01-23 15:32:41 -08:00
Kumar Gala
4611f37e5a Merge arm branch into master
The following changes since commit 38ca5843cd:

  doc: update MAINTAINERS for .rst files (2017-01-23 18:36:28 +0000)

are available in the git repository at:

  https://github.com/zephyrproject-rtos/zephyr arm

for you to fetch changes up to 098f28983f:

Main changes:

- Added support for STM32F3X SoC
- Added support for ARM AN383 SoC
- Added board support for STM3210C-EVAL, NUCLEO-F334R8, STM32373C-EVAL,
  MPS2 w/AN383
- Start work on replace scs/scb layers with CMSIS
- Converted Kinetis SPI & UART drivers to use MCUX HAL
- Added drivers for ARM CMSDK Dual Timer & Timer

----------------------------------------------------------------
Adam Podogrocki (11):
      soc/stm32: add initial support for STM32F3X series
      clock/stm32: add STM32F3X reset and clock control
      exti/stm32: add support for F334 & F373 MCUs
      flash/stm32: flash driver for STM32F3x series microcontrollers
      gpio/stm32: provide GPIO driver implementation for STM32F3X family
      pinmux/stm32: extend pinmux driver functionality to support STM32F3X series MCUs
      boards: add initial support for Nucleo-64 with Soc STM32F334
      boards: add initial support for STM32373C-EVAL with SoC STM32F373VC
      pinmux/stm32: default pin assignment for STM3210C-EVAL board
      pinmux/stm32: default pin assignment for NUCLEO-F334R8 board
      pinmux/stm32: default pin assignment for STM32373C-EVAL board

Carles Cufi (1):
      arm: cmsis: Convert enable_floating_point to use CMSIS

David Brown (1):
      arm: cortex-m: Implement CONFIG_TEXT_SECTION_OFFSET

Erwan Gouriou (3):
      board: add nucleo_401re board documentation
      license: Replace Apache boilerplate with SPDX tag
      boards:arm: Provide debug option on some boards

Gil Pitney (1):
      cc3200: Added board documentation in RST format.

Jon Medhurst (2):
      arm: soc: Add SoC series for ARM's Cortex-M Prototyping System (MPS2)
      boards: arm: Add board for MPS2 with AN383

Kumar Gala (12):
      arm: kinetis: Remove duplicate & unused defines
      arm: nvic: kill _NvicSwInterruptTrigger
      uart/stm32: add STM32F3X support for uart
      arm: cmsis: Remove unused code from scb/scs layers
      arm: cmsis: Introduce CMSIS layer
      arm: cmsis: Convert DO_REBOOT to use CMSIS
      arm: cmsis: Convert systick to CMSIS
      arm: cmsis: Convert relocate_vector_table to use CMSIS
      timer: nrf_rtc: Use CMSIS NVIC APIs directly
      clock_control: nrf5_power: Use CMSIS NVIC APIs directly
      Bluetooth: Controller: Use CMSIS NVIC APIs directly
      tests: arm_irq_vector_table: Use CMSIS NVIC APIs directly

Maureen Helm (12):
      serial: Introduce new mcux shim driver
      frdm_k64f: hexiwear_k64: Add defaults for the mcux serial driver
      k64: Change the default serial driver to the mcux one
      frdm_k64f: hexiwear_k64: Remove defaults for the uart_k20 driver
      serial: k64: Remove the uart_k20 driver
      gpio: serial: Fix NXP copyright
      spi: Add shared default configs
      spi: Introduce new mcux shim driver
      k64: Change the default spi driver to the mcux shim
      tests: Update spi driver test for mcux
      samples: net: Increase spi log level
      spi: k64: Remove the k64 spi driver

Michael Scott (1):
      drivers: gpio: stm32: fix CONFIG_SOC_SERIES_STM32F4X build break

Ricardo Salveti (4):
      arm: set default vector table address in prep_c when XIP
      arm/nordic_nrf5: enable SOC_FLASH_NRF5 by default if FLASH is enabled
      boards: 96b_nitrogen: Add button and LED definitions
      boards: 96b_carbon: Add LED definitions

Vincenzo Frascino (7):
      counter: cmsdk: Add common interface
      soc: arm: beetle: Add Timers IRQ map
      counter: cmsdk: Add clock control to TMR Counters.
      counter: cmsdk: Add Timer 0 and 1 as Timers
      counter: cmsdk: Add DualTimer as Counter
      counter: cmsdk: Add Dualtimer as a Timer
      board: v2m_beetle: Update defconfig

 MAINTAINERS                                        |    7 +
 arch/arm/core/Kconfig                              |    1 +
 arch/arm/core/cortex_m/Makefile                    |    1 +
 arch/arm/core/cortex_m/prep_c.c                    |   24 +-
 arch/arm/core/cortex_m/scb.c                       |   69 +-
 arch/arm/soc/arm/beetle/soc_irq.h                  |    7 +
 arch/arm/soc/arm/mps2/Kconfig.defconfig.mps2_an385 |   16 +
 arch/arm/soc/arm/mps2/Kconfig.defconfig.series     |   34 +
 arch/arm/soc/arm/mps2/Kconfig.series               |   14 +
 arch/arm/soc/arm/mps2/Kconfig.soc                  |   15 +
 arch/arm/soc/arm/mps2/Makefile                     |    7 +
 arch/arm/soc/arm/mps2/linker.ld                    |    9 +
 arch/arm/soc/arm/mps2/soc.c                        |   31 +
 arch/arm/soc/arm/mps2/soc.h                        |   12 +
 arch/arm/soc/arm/mps2/soc_devices.h                |   31 +
 arch/arm/soc/arm/mps2/soc_irq.h                    |   38 +
 arch/arm/soc/arm/mps2/soc_memory_map.h             |   16 +
 arch/arm/soc/atmel_sam3/soc.c                      |    5 -
 arch/arm/soc/nordic_nrf5/Kconfig.defconfig         |    7 +
 arch/arm/soc/nordic_nrf5/nrf52/soc.c               |    5 -
 .../soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12  |    9 +-
 arch/arm/soc/nxp_kinetis/k6x/Makefile              |    1 -
 arch/arm/soc/nxp_kinetis/k6x/soc.c                 |    3 +-
 arch/arm/soc/nxp_kinetis/k6x/soc.h                 |   57 +-
 arch/arm/soc/nxp_kinetis/k6x/soc_config.c          |   73 --
 arch/arm/soc/st_stm32/stm32f1/soc.c                |    5 -
 arch/arm/soc/st_stm32/stm32f1/soc.h                |    7 +-
 .../soc/st_stm32/stm32f3/Kconfig.defconfig.series  |   32 +
 .../st_stm32/stm32f3/Kconfig.defconfig.stm32f303xc |   28 +
 .../st_stm32/stm32f3/Kconfig.defconfig.stm32f334x8 |   28 +
 .../st_stm32/stm32f3/Kconfig.defconfig.stm32f373xc |   28 +
 arch/arm/soc/st_stm32/stm32f3/Kconfig.series       |   18 +
 arch/arm/soc/st_stm32/stm32f3/Kconfig.soc          |   21 +
 arch/arm/soc/st_stm32/stm32f3/Makefile             |   11 +
 arch/arm/soc/st_stm32/stm32f3/flash_registers.h    |   60 ++
 arch/arm/soc/st_stm32/stm32f3/gpio_registers.h     |  102 ++
 arch/arm/soc/st_stm32/stm32f3/linker.ld            |    9 +
 arch/arm/soc/st_stm32/stm32f3/rcc_registers.h      |   89 ++
 arch/arm/soc/st_stm32/stm32f3/soc.c                |   54 +
 arch/arm/soc/st_stm32/stm32f3/soc.h                |   57 +
 arch/arm/soc/st_stm32/stm32f3/soc_config.c         |   53 +
 arch/arm/soc/st_stm32/stm32f3/soc_gpio.c           |  209 ++++
 arch/arm/soc/st_stm32/stm32f3/soc_irq.h            |  118 ++
 arch/arm/soc/st_stm32/stm32f3/soc_registers.h      |   15 +
 arch/arm/soc/st_stm32/stm32f4/soc.c                |    5 -
 arch/arm/soc/st_stm32/stm32l4/soc.c                |    5 -
 boards/arm/96b_carbon/board.h                      |   20 +
 boards/arm/96b_nitrogen/board.h                    |   21 +
 boards/arm/cc3200_launchxl/doc/cc3200_launchxl.rst |  244 +++++
 boards/arm/frdm_k64f/Kconfig.defconfig             |   51 +-
 boards/arm/frdm_k64f/frdm_k64f_defconfig           |    1 -
 boards/arm/frdm_k64f/pinmux.c                      |    4 +-
 boards/arm/hexiwear_k64/Kconfig.defconfig          |   55 +-
 boards/arm/hexiwear_k64/hexiwear_k64_defconfig     |    1 -
 boards/arm/hexiwear_k64/pinmux.c                   |    4 +-
 boards/arm/mps2_an385/Kconfig.board                |    9 +
 boards/arm/mps2_an385/Kconfig.defconfig            |   39 +
 boards/arm/mps2_an385/Makefile                     |    9 +
 boards/arm/mps2_an385/board.h                      |   12 +
 boards/arm/mps2_an385/doc/img/mps2.png             |  Bin 0 -> 771962 bytes
 boards/arm/mps2_an385/doc/mps2_an385.rst           |  188 ++++
 boards/arm/mps2_an385/mps2_an385_defconfig         |   19 +
 boards/arm/nucleo_f334r8/Kconfig.board             |   10 +
 boards/arm/nucleo_f334r8/Kconfig.defconfig         |   13 +
 boards/arm/nucleo_f334r8/Makefile                  |    2 +
 boards/arm/nucleo_f334r8/Makefile.board            |    7 +
 boards/arm/nucleo_f334r8/board.h                   |   26 +
 boards/arm/nucleo_f334r8/nucleo_f334r8_defconfig   |   53 +
 boards/arm/nucleo_f334r8/support/openocd.cfg       |   12 +
 boards/arm/nucleo_f401re/Makefile.board            |    1 +
 .../doc/img/nucleo64_perf_logo_1024.png            |  Bin 0 -> 780528 bytes
 .../doc/img/nucleo_f401re_arduino.png              |  Bin 0 -> 575018 bytes
 .../nucleo_f401re/doc/img/nucleo_f401re_morpho.png |  Bin 0 -> 481267 bytes
 boards/arm/nucleo_f401re/doc/nucleof401re.rst      |  190 ++++
 boards/arm/stm3210c_eval/Makefile.board            |    1 +
 boards/arm/stm32373c_eval/Kconfig.board            |   10 +
 boards/arm/stm32373c_eval/Kconfig.defconfig        |   13 +
 boards/arm/stm32373c_eval/Makefile                 |    2 +
 boards/arm/stm32373c_eval/Makefile.board           |    7 +
 boards/arm/stm32373c_eval/board.h                  |   32 +
 boards/arm/stm32373c_eval/stm32373c_eval_defconfig |   62 ++
 boards/arm/stm32373c_eval/support/openocd.cfg      |   12 +
 boards/arm/v2m_beetle/Kconfig.defconfig            |   29 +-
 drivers/clock_control/Kconfig                      |    2 +
 drivers/clock_control/Kconfig.stm32f3x             |  115 ++
 drivers/clock_control/Makefile                     |    1 +
 drivers/clock_control/nrf5_power_clock.c           |    9 +-
 drivers/clock_control/stm32f3x_clock.c             |  398 +++++++
 drivers/counter/Kconfig                            |    2 +
 drivers/counter/Kconfig.dtmr_cmsdk_apb             |   75 ++
 drivers/counter/Kconfig.tmr_cmsdk_apb              |   62 +-
 drivers/counter/Makefile                           |    3 +
 drivers/counter/counter_dtmr_cmsdk_apb.c           |  120 +++
 drivers/counter/counter_tmr_cmsdk_apb.c            |   55 +-
 drivers/counter/dualtimer_cmsdk_apb.h              |   68 ++
 drivers/counter/timer_cmsdk_apb.h                  |   40 +
 drivers/counter/timer_dtmr_cmsdk_apb.c             |  206 ++++
 drivers/counter/timer_tmr_cmsdk_apb.c              |  241 +++++
 drivers/flash/Kconfig                              |   16 +-
 drivers/flash/Kconfig.stm32f3x                     |   25 +
 drivers/flash/Makefile                             |    5 +
 drivers/flash/flash_stm32f3x.c                     |  149 +++
 drivers/flash/flash_stm32f3x.h                     |   66 ++
 drivers/flash/flash_stm32f3x_priv.c                |  206 ++++
 drivers/gpio/Kconfig.mcux                          |    2 +-
 drivers/gpio/gpio_mcux.c                           |    2 +-
 drivers/gpio/gpio_stm32.c                          |   45 +-
 drivers/gpio/gpio_stm32.h                          |    7 +-
 drivers/interrupt_controller/exti_stm32.c          |   45 +-
 drivers/pinmux/Makefile                            |    3 +
 drivers/pinmux/stm32/pinmux_board_nucleo_f334r8.c  |   45 +
 drivers/pinmux/stm32/pinmux_board_stm3210c_eval.c  |   34 +
 drivers/pinmux/stm32/pinmux_board_stm32373c_eval.c |   34 +
 drivers/pinmux/stm32/pinmux_stm32.c                |   12 +-
 drivers/pinmux/stm32/pinmux_stm32.h                |   40 +-
 drivers/pinmux/stm32/pinmux_stm32f1.h              |    3 +
 drivers/pinmux/stm32/pinmux_stm32f3.h              |   39 +
 drivers/serial/Kconfig                             |    2 +-
 drivers/serial/Kconfig.k20                         |  178 ---
 drivers/serial/Kconfig.mcux                        |  150 +++
 drivers/serial/Makefile                            |    2 +-
 drivers/serial/uart_k20.c                          |  584 ----------
 drivers/serial/uart_k20.h                          |   16 -
 drivers/serial/uart_k20_priv.h                     |  252 -----
 drivers/serial/uart_mcux.c                         |  508 +++++++++
 drivers/serial/uart_stm32.c                        |   16 +-
 drivers/serial/uart_stm32.h                        |    4 +-
 drivers/spi/Kconfig                                |   40 +-
 drivers/spi/Kconfig.mcux                           |   36 +
 drivers/spi/Makefile                               |    2 +-
 drivers/spi/spi_k64.c                              | 1138 --------------------
 drivers/spi/spi_k64_priv.h                         |  166 ---
 drivers/spi/spi_mcux.c                             |  321 ++++++
 drivers/timer/cortex_m_systick.c                   |   50 +-
 drivers/timer/nrf_rtc_timer.c                      |    3 +-
 ext/hal/nxp/mcux/drivers/Makefile                  |    3 +-
 ext/hal/st/stm32cube/Kbuild                        |    2 +
 include/arch/arm/cortex_m/cmsis.h                  |   96 ++
 include/arch/arm/cortex_m/nvic.h                   |   26 -
 include/arch/arm/cortex_m/scb.h                    |  561 ----------
 include/arch/arm/cortex_m/scripts/linker.ld        |    1 +
 include/arch/arm/cortex_m/scs.h                    |  142 ---
 .../drivers/clock_control/stm32_clock_control.h    |    3 +
 .../drivers/clock_control/stm32f3_clock_control.h  |  114 ++
 include/drivers/k20_sim.h                          |   10 -
 include/drivers/spi/spi_k64.h                      |   68 --
 include/gpio.h                                     |   14 +
 samples/net/echo_client/prj_frdm_k64f_cc2520.conf  |    2 +
 samples/net/echo_server/prj_frdm_k64f_cc2520.conf  |    2 +
 scripts/sanity_chk/arches/arm.ini                  |    2 +-
 subsys/bluetooth/controller/hal/nrf5/ecb.c         |    3 +-
 subsys/bluetooth/controller/hal/nrf5/radio.c       |    7 +-
 subsys/bluetooth/controller/hci/hci_driver.c       |    6 +-
 tests/drivers/spi_test/src/spi.c                   |    7 +-
 tests/drivers/spi_test/testcase.ini                |    4 +-
 tests/kernel/arm_irq_vector_table/src/main.c       |    8 +-
 .../kernel/test_arm_irq_vector_table/src/main.c    |    8 +-
 157 files changed, 5744 insertions(+), 3593 deletions(-)
 create mode 100644 arch/arm/soc/arm/mps2/Kconfig.defconfig.mps2_an385
 create mode 100644 arch/arm/soc/arm/mps2/Kconfig.defconfig.series
 create mode 100644 arch/arm/soc/arm/mps2/Kconfig.series
 create mode 100644 arch/arm/soc/arm/mps2/Kconfig.soc
 create mode 100644 arch/arm/soc/arm/mps2/Makefile
 create mode 100644 arch/arm/soc/arm/mps2/linker.ld
 create mode 100644 arch/arm/soc/arm/mps2/soc.c
 create mode 100644 arch/arm/soc/arm/mps2/soc.h
 create mode 100644 arch/arm/soc/arm/mps2/soc_devices.h
 create mode 100644 arch/arm/soc/arm/mps2/soc_irq.h
 create mode 100644 arch/arm/soc/arm/mps2/soc_memory_map.h
 delete mode 100644 arch/arm/soc/nxp_kinetis/k6x/soc_config.c
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.series
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f303xc
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f334x8
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f373xc
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/Kconfig.series
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/Kconfig.soc
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/Makefile
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/flash_registers.h
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/gpio_registers.h
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/linker.ld
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/rcc_registers.h
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/soc.c
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/soc.h
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/soc_config.c
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/soc_gpio.c
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/soc_irq.h
 create mode 100644 arch/arm/soc/st_stm32/stm32f3/soc_registers.h
 create mode 100644 boards/arm/cc3200_launchxl/doc/cc3200_launchxl.rst
 create mode 100644 boards/arm/mps2_an385/Kconfig.board
 create mode 100644 boards/arm/mps2_an385/Kconfig.defconfig
 create mode 100644 boards/arm/mps2_an385/Makefile
 create mode 100644 boards/arm/mps2_an385/board.h
 create mode 100644 boards/arm/mps2_an385/doc/img/mps2.png
 create mode 100644 boards/arm/mps2_an385/doc/mps2_an385.rst
 create mode 100644 boards/arm/mps2_an385/mps2_an385_defconfig
 create mode 100644 boards/arm/nucleo_f334r8/Kconfig.board
 create mode 100644 boards/arm/nucleo_f334r8/Kconfig.defconfig
 create mode 100644 boards/arm/nucleo_f334r8/Makefile
 create mode 100644 boards/arm/nucleo_f334r8/Makefile.board
 create mode 100644 boards/arm/nucleo_f334r8/board.h
 create mode 100644 boards/arm/nucleo_f334r8/nucleo_f334r8_defconfig
 create mode 100644 boards/arm/nucleo_f334r8/support/openocd.cfg
 create mode 100644 boards/arm/nucleo_f401re/doc/img/nucleo64_perf_logo_1024.png
 create mode 100644 boards/arm/nucleo_f401re/doc/img/nucleo_f401re_arduino.png
 create mode 100644 boards/arm/nucleo_f401re/doc/img/nucleo_f401re_morpho.png
 create mode 100644 boards/arm/nucleo_f401re/doc/nucleof401re.rst
 create mode 100644 boards/arm/stm32373c_eval/Kconfig.board
 create mode 100644 boards/arm/stm32373c_eval/Kconfig.defconfig
 create mode 100644 boards/arm/stm32373c_eval/Makefile
 create mode 100644 boards/arm/stm32373c_eval/Makefile.board
 create mode 100644 boards/arm/stm32373c_eval/board.h
 create mode 100644 boards/arm/stm32373c_eval/stm32373c_eval_defconfig
 create mode 100644 boards/arm/stm32373c_eval/support/openocd.cfg
 create mode 100644 drivers/clock_control/Kconfig.stm32f3x
 create mode 100644 drivers/clock_control/stm32f3x_clock.c
 create mode 100644 drivers/counter/Kconfig.dtmr_cmsdk_apb
 create mode 100644 drivers/counter/counter_dtmr_cmsdk_apb.c
 create mode 100644 drivers/counter/dualtimer_cmsdk_apb.h
 create mode 100644 drivers/counter/timer_cmsdk_apb.h
 create mode 100644 drivers/counter/timer_dtmr_cmsdk_apb.c
 create mode 100644 drivers/counter/timer_tmr_cmsdk_apb.c
 create mode 100644 drivers/flash/Kconfig.stm32f3x
 create mode 100644 drivers/flash/flash_stm32f3x.c
 create mode 100644 drivers/flash/flash_stm32f3x.h
 create mode 100644 drivers/flash/flash_stm32f3x_priv.c
 create mode 100644 drivers/pinmux/stm32/pinmux_board_nucleo_f334r8.c
 create mode 100644 drivers/pinmux/stm32/pinmux_board_stm3210c_eval.c
 create mode 100644 drivers/pinmux/stm32/pinmux_board_stm32373c_eval.c
 create mode 100644 drivers/pinmux/stm32/pinmux_stm32f3.h
 delete mode 100644 drivers/serial/Kconfig.k20
 create mode 100644 drivers/serial/Kconfig.mcux
 delete mode 100644 drivers/serial/uart_k20.c
 delete mode 100644 drivers/serial/uart_k20.h
 delete mode 100644 drivers/serial/uart_k20_priv.h
 create mode 100644 drivers/serial/uart_mcux.c
 create mode 100644 drivers/spi/Kconfig.mcux
 delete mode 100644 drivers/spi/spi_k64.c
 delete mode 100644 drivers/spi/spi_k64_priv.h
 create mode 100644 drivers/spi/spi_mcux.c
 create mode 100644 include/arch/arm/cortex_m/cmsis.h
 create mode 100644 include/drivers/clock_control/stm32f3_clock_control.h
 delete mode 100644 include/drivers/spi/spi_k64.h
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>

Change-Id: I5890c34d63b0d0f0bc8bf443f6ccacae68a53e93
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:45:28 -06:00
Kumar Gala
098f28983f tests: arm_irq_vector_table: Use CMSIS NVIC APIs directly
Convert testcases to use the CMSIS NVIC APIs or direct NVIC register
access rather than the internal ones so we can remove them in the future.

Change-Id: I2a5a3eae713e66944cf105e7fffa603b88522681
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:55 -06:00
Kumar Gala
8d4c1787bf Bluetooth: Controller: Use CMSIS NVIC APIs directly
Convert driver to use the CMSIS NVIC APIs rather than the internal
ones so we can remove them in the future.

Change-Id: Ib9fe696e8d5e55f60865d3fd958a035135ce517a
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:55 -06:00
Kumar Gala
043b006c0f clock_control: nrf5_power: Use CMSIS NVIC APIs directly
Convert driver to use the CMSIS NVIC APIs rather than the internal ones
so we can remove them in the future.

Change-Id: I7bf3024ea4baf61f1e42bbbd5e4b0abfc6c04e6b
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:55 -06:00
Kumar Gala
8c75d79a15 timer: nrf_rtc: Use CMSIS NVIC APIs directly
Convert driver to use the CMSIS NVIC APIs rather than the internal ones
so we can remove them in the future.

Change-Id: I31c2f37bc0aa35668a441f4ef2821b768dd7b817
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:55 -06:00
Kumar Gala
6782c3ea23 arm: cmsis: Convert relocate_vector_table to use CMSIS
Replace _scs_relocate_vector_table with direct CMSIS register access and
use of __ISB/__DSB routinues.  We also cleanup the code a little bit to
just have one implentation of relocate_vector_table() on ARMv7-M.

Jira: ZEP-1568

Change-Id: I088c30e680a7ba198c1527a5822114b70f10c510
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:55 -06:00
Kumar Gala
7f5dc1ab30 arm: cmsis: Convert systick to CMSIS
Remove use of __scs structures and defines in place of CMSIS defined
ones.  Also, use __ISB() instead of inline asm.

Jira: ZEP-1568

Change-Id: I8798206a12680f6c50105c7c28112632ac9dde50
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:55 -06:00
Kumar Gala
82027c68f9 arm: cmsis: Convert DO_REBOOT to use CMSIS
CMSIS provides a complete implentation for reboot, we can utilize it
directly and reduce zephyr specific code.

Jira: ZEP-1568

Change-Id: Ia9d1abd5c1e02e724423b94867ea452bc806ef79
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:55 -06:00
Carles Cufi
88bbd6ccb1 arm: cmsis: Convert enable_floating_point to use CMSIS
As a first step towards removing the custom ARM Cortex-M Core code
present in Zephyr in benefit of using CMSIS, this change replaces
the use of the custom core code with CMSIS macros in
enable_floating_point().

Jira: ZEP-1568

Change-id: I544a712bf169358c826a3b2acd032c6b30b2801b
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:54 -06:00
Kumar Gala
457a5988c4 arm: cmsis: Introduce CMSIS layer
Support using CMSIS defines and functions, we either pull the expect
defines/enum from the SoC HAL layers via <soc.h> for the SoC or we
provide a default set based on __NVIC_PRIO_BITS is defined.

We provide defaults in the case for:
	IRQn_Type enum
	*_REV define (set to 0)
	__MPU_PRESENT define (set to 0 - no MPU)
	__NVIC_PRIO_BITS define (set to CONFIG_NUM_IRQ_PRIO_BITS)
	__Vendor_SysTickConfig (set to 0 - standard SysTick)

Jira: ZEP-1568

Change-Id: Ibc203de79f4697b14849b69c0e8c5c43677b5c6e
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:54 -06:00
Kumar Gala
375a0ef393 arm: cmsis: Remove unused code from scb/scs layers
In preperation for removing the scb/scs layers and using CMSIS directly
lets remove all the _Scb* and _Scs* functions that are not currently
used.

Jira: ZEP-1568

Change-Id: If4641fb9a6de616b4b8793d4678aaaed48e794bc
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:54 -06:00
Jon Medhurst
ac4bfe49d1 boards: arm: Add board for MPS2 with AN383
ARM's Cortex-M Prototyping System (MPS2) is a board with an FPGA that
can be programmed with different 'SoCs'. To use these in Zephyr we need
a set of board files for each variant.

This adds a board for a variant which implements a Cortex-M3 CPU; the
naming of this matches that used for the Zephyr SoC (which is itself
based on ARM's documentation nomenclature).

Change-Id: Ie02a67a03016b8aeee31e3694f0edbcc37f9ee64
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-23 15:15:54 -06:00
Jon Medhurst
cd8fd42de9 arm: soc: Add SoC series for ARM's Cortex-M Prototyping System (MPS2)
ARM's Cortex-M Prototyping System (or MPS2) [1] is a board containing
devices such as RAM, ethernet and display, and at its heart there is an
FPGA which can be programmed with various 'SoCs' which implement the
CPU, SRAM, UARTs, SPI, DMA, etc. There are also software simulations of
systems based on this hardware which are part of ARM's Fixed Virtual
Platforms (FVPs).

All of the above could be regarded SoCs in the same series so we will
treat them as such in Zephyr.

In this initial patch we add SoC support for the public FPGA image
which implements a Cortex-M3 CPU, and includes definitions to support
use of the UARTs on this.

ARM's documentation for MPS2 images are titled 'Application Note ANnnn'
where the number nnn is different for each 'SoC'. E.g. Application Note
AN385 is for "ARM Cortex-M3 SMM on V2M-MPS2" [2]. The files ARM supply
for programming the board firmware also make extensive use of the ANnnn
nomenclature, so we will use this for the SoC name in Zephyr. E.g. the
Cortex-M3 SoC will be called 'mps2_an385'. Note, it is not possible to
use the CPU type (e.g. M3) for the name as there are multiple FPGA
images for some CPU types (e.g. there are three Cortex M7 images
with differing FPU and MPU support).

[1] https://www.arm.com/products/tools/development-boards/versatile-express/cortex-m-prototyping-system.php
[2] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0385c/index.html

Change-Id: Ice54f2d2cde7669582337f256c878526139daedd
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-23 15:15:54 -06:00
Maureen Helm
8769cd585e spi: k64: Remove the k64 spi driver
Now that we have a more generic mcux spi driver that can be used across
multiple Kinetis SoCs, remove the specific k64 spi driver.

Jira: ZEP-1374
Change-Id: Ifc324374f305837f5e3d2cfd7ad30d3608865b5b
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:54 -06:00
Maureen Helm
4279bf1c03 samples: net: Increase spi log level
Change-Id: Ic067a93c1e24c12c7e531b1df590be252cd2531b
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:54 -06:00
Maureen Helm
06bd605da3 tests: Update spi driver test for mcux
Jira: ZEP-1374
Change-Id: Ibd66df42919d085666cfd7e98bea5c808d8d54e0
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:54 -06:00
Maureen Helm
e1c9dfcee5 k64: Change the default spi driver to the mcux shim
Jira: ZEP-1374
Change-Id: I8ae160e32b0f46120138025e373724ad97cb0cd6
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:54 -06:00
Maureen Helm
d138a4fad1 spi: Introduce new mcux shim driver
Adds a shim layer around the mcux dspi driver to adapt it to the Zephyr
spi interface. Unlike the existing k64 spi driver, this driver can be
used for other Kinetis SoCs that contain the dspi module.

Jira: ZEP-1374
Change-Id: I9417c1513565dfcc47ccda098492f60e840f4f84
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:54 -06:00
Maureen Helm
bd562921e8 spi: Add shared default configs
Adds default configurations for baud rate, transfer word size, clock
polarity and phase. These default configurations can be shared across
multiple spi drivers.

Change-Id: I221b402c075003014991b38f6342a89e55c3bec9
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:54 -06:00
Ricardo Salveti
18d4c13bda boards: 96b_carbon: Add LED definitions
Add the GPIO pin and port definitions for the LEDs available on the
board.

Change-Id: I586a0ebfbbe8fa6e50dd1f91c1437665dd8ec677
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-23 15:15:54 -06:00
Ricardo Salveti
6c3446dfcd boards: 96b_nitrogen: Add button and LED definitions
Add the GPIO pin and port definitions for the button and LEDs available
on the board.

Change-Id: If74cf9d780227346c7c8816e6eadca00b16953b2
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-23 15:15:54 -06:00
Vincenzo Frascino
59d1025e62 board: v2m_beetle: Update defconfig
This patch updates the default defconfig in order to support the new
Timers implementation.

Jira: ZEP-1300
Change-Id: I749042bcf41c6b4cb11614315c3c2ce09cdb2aa8
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-23 15:15:54 -06:00
Vincenzo Frascino
a93b88789b counter: cmsdk: Add Dualtimer as a Timer
This patch adds Dualtimer support to be used as a Timer.

Jira: ZEP-1300
Change-Id: If13143c8a8bdb07210daca66deca44710a18406f
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-23 15:15:54 -06:00
Vincenzo Frascino
b1e02a594a counter: cmsdk: Add DualTimer as Counter
This patch adds Dualtimer to be used as a counter.

Jira: ZEP-1300
Change-Id: Ic4a2d89ec7fc0c0c2a0bc7f6d32d97637049faaf
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-23 15:15:54 -06:00
Vincenzo Frascino
b11242d11f counter: cmsdk: Add Timer 0 and 1 as Timers
This patch adds Timer 0 and 1 to be used as timers.

Jira: ZEP-1300
Change-Id: I57112a8ed6f5daa22345e8807e9ebe87bb09e782
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-23 15:15:54 -06:00
Vincenzo Frascino
d36543828b counter: cmsdk: Add clock control to TMR Counters.
This patch adds clock control to the counters based on Timer 0 and 1.

Jira: ZEP-1300
Change-Id: I14499a833fe9720496ab7905bc1466e9b03bb316
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-23 15:15:54 -06:00
Vincenzo Frascino
8971da0375 soc: arm: beetle: Add Timers IRQ map
This patch adds the timers IRQ map to the ARM Beetle SoC platform.

Jira: ZEP-1300
Change-Id: If38a197210f71ae90c7ee6274395f064116faf72
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-23 15:15:53 -06:00