Commit graph

19237 commits

Author SHA1 Message Date
Anas Nashif
8eea1d78d8 tinytile: support flashing
Now both flashing over DFU and JTAG are supported, however JTAG needs a
special connection, so DFU is the current out of the box supported
method for flashing.

Jira: ZEP-1785
Change-Id: I47ffce3b332b99ef6c6afdce2214709a4fa5b946
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-27 16:53:08 +00:00
Kumar Gala
a432cc52f8 Merge "Merge arm branch into master" 2017-03-27 15:55:32 +00:00
Andy Gross
c65c6a9029 build: Don't remove dts/ directory on clean
This patch fixes an issue where any make target executing the the clean
from the root source directory would remove the dts directory.  This is
not necessary and can cause build issues on following make commands.

ZEP-1968

Change-Id: I2cc751d8fd24bd77e425860686b66644ade44eeb
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-03-27 10:27:01 -05:00
Kumar Gala
48d6596f57 Merge arm branch into master
- Fix for floating point stack corruption issue
- Update of NXP MCUX HAL to v2.2
- Various cleanups on STM SoCs
- Cleans & prep for supporting NXP MKL25Z SoC
- Board docs for 96b_carbon & 96b_nitrogen

----------------------------------------------------------------
Florian Vaussard (10):
      kernel: arm: Increase idle stack size to fix corruption by FP_SHARING
      gpio: stm32: Use atomic set/reset in stm32_gpio_set()
      arm: stm32f4: Fix comment in Kconfig
      arm: stm32f4: Add FPU support
      clock: stm32f4: Fix range of CLOCK_STM32F4X_PLLN_MULTIPLIER config
      clock: stm32f4: Fix wrong BKPSRAM and CCMDATARAM clocks
      clock: stm32f4: Add some missing clocks
      gpio: stm32: Use macro to simplify registration
      gpio: stm32: Add support for ports I to K
      serial: stm32: Properly put Kconfig options in their own submenu

Gustavo Denardin (2):
      arm: IRQ number correction in the soc configuration
      arm: UART driver modifications for MKL25Z soc support

Kumar Gala (1):
      spi: mcux: Rename spi driver to DSPI to match naming convention

Maureen Helm (2):
      ext: mcux: Update to mcux 2.1 for k64
      ext: mcux: Update to mcux 2.2 for k64

Ricardo Salveti (3):
      boards: add 96b_carbon board documentation
      boards: add 96b_nitrogen board documentation
      nrf_rtc_timer: clear events and counter when disabling sys_clock

Yannis Damigos (2):
      dts: arm: Add base DTS support for Olimexino STM32 board
      olimexino_stm32: Enable DT usage for OLIMEXINO STM32

 .../soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12  |    2 +-
 arch/arm/soc/nxp_kinetis/k6x/soc.c                 |    8 +-
 .../soc/st_stm32/stm32f1/Kconfig.defconfig.series  |    2 +
 .../st_stm32/stm32f1/Kconfig.defconfig.stm32f103xb |    3 +
 .../st_stm32/stm32f4/Kconfig.defconfig.stm32f407xx |    2 +-
 .../st_stm32/stm32f4/Kconfig.defconfig.stm32f429xx |    2 +-
 arch/arm/soc/st_stm32/stm32f4/Kconfig.series       |    3 +-
 arch/arm/soc/st_stm32/stm32f4/soc_gpio.c           |    8 +-
 boards/arm/96b_carbon/doc/96b_carbon.rst           |  279 ++++
 boards/arm/96b_carbon/doc/img/96b-carbon-front.png |  Bin 0 -> 1120451 bytes
 boards/arm/96b_nitrogen/doc/96b_nitrogen.rst       |  350 +++++
 .../96b_nitrogen/doc/img/96b-nitrogen-front.png    |  Bin 0 -> 335901 bytes
 .../arm/olimexino_stm32/olimexino_stm32_defconfig  |    3 +
 drivers/clock_control/Kconfig.stm32f4x             |    8 +-
 drivers/ethernet/eth_mcux.c                        |    4 +-
 drivers/gpio/Kconfig.stm32                         |   12 +
 drivers/gpio/gpio_stm32.c                          |  130 +-
 drivers/serial/Kconfig.stm32                       |    4 +
 drivers/serial/uart_mcux.c                         |   12 +
 drivers/spi/Kconfig                                |    2 +-
 drivers/spi/{Kconfig.mcux => Kconfig.mcux_dspi}    |    6 +-
 drivers/spi/Makefile                               |    2 +-
 drivers/spi/{spi_mcux.c => spi_mcux_dspi.c}        |    0
 drivers/timer/nrf_rtc_timer.c                      |   14 +
 dts/arm/Makefile                                   |    1 +
 dts/arm/olimexino_stm32.dts                        |   37 +
 dts/arm/olimexino_stm32.fixup                      |   24 +
 dts/arm/stm32f103xb.dtsi                           |  101 ++
 ext/hal/nxp/mcux/README                            |    2 +-
 ext/hal/nxp/mcux/devices/MK64F12/MK64F12.h         |  548 ++++---
 .../nxp/mcux/devices/MK64F12/MK64F12_features.h    |  996 +++++-------
 ext/hal/nxp/mcux/devices/MK64F12/clock_config.c    |  369 +++--
 ext/hal/nxp/mcux/devices/MK64F12/clock_config.h    |   73 +-
 ext/hal/nxp/mcux/devices/MK64F12/fsl_clock.c       |  120 +-
 ext/hal/nxp/mcux/devices/MK64F12/fsl_clock.h       |  536 ++++---
 ext/hal/nxp/mcux/devices/MK64F12/system_MK64F12.c  |   26 +-
 ext/hal/nxp/mcux/devices/MK64F12/system_MK64F12.h  |   28 +-
 ext/hal/nxp/mcux/drivers/Makefile                  |    2 +-
 ext/hal/nxp/mcux/drivers/fsl_adc16.c               |   14 +-
 ext/hal/nxp/mcux/drivers/fsl_adc16.h               |   76 +-
 ext/hal/nxp/mcux/drivers/fsl_cmp.c                 |   14 +-
 ext/hal/nxp/mcux/drivers/fsl_cmp.h                 |   69 +-
 ext/hal/nxp/mcux/drivers/fsl_cmt.c                 |   33 +-
 ext/hal/nxp/mcux/drivers/fsl_cmt.h                 |   47 +-
 ext/hal/nxp/mcux/drivers/fsl_common.c              |  142 +-
 ext/hal/nxp/mcux/drivers/fsl_common.h              |  115 +-
 ext/hal/nxp/mcux/drivers/fsl_crc.c                 |   42 +-
 ext/hal/nxp/mcux/drivers/fsl_crc.h                 |   66 +-
 ext/hal/nxp/mcux/drivers/fsl_dac.c                 |   17 +-
 ext/hal/nxp/mcux/drivers/fsl_dac.h                 |   49 +-
 ext/hal/nxp/mcux/drivers/fsl_dmamux.c              |   14 +-
 ext/hal/nxp/mcux/drivers/fsl_dmamux.h              |   68 +-
 ext/hal/nxp/mcux/drivers/fsl_dspi.c                |  216 +--
 ext/hal/nxp/mcux/drivers/fsl_dspi.h                |  352 +++--
 ext/hal/nxp/mcux/drivers/fsl_dspi_edma.c           |  594 ++++---
 ext/hal/nxp/mcux/drivers/fsl_dspi_edma.h           |  112 +-
 ext/hal/nxp/mcux/drivers/fsl_edma.c                |  603 +++++++-
 ext/hal/nxp/mcux/drivers/fsl_edma.h                |  349 +++--
 ext/hal/nxp/mcux/drivers/fsl_enet.c                |  445 ++++--
 ext/hal/nxp/mcux/drivers/fsl_enet.h                |  283 +++-
 ext/hal/nxp/mcux/drivers/fsl_ewm.c                 |   14 +-
 ext/hal/nxp/mcux/drivers/fsl_ewm.h                 |   59 +-
 ext/hal/nxp/mcux/drivers/fsl_flash.c               | 1620 +++++++++++++++-----
 ext/hal/nxp/mcux/drivers/fsl_flash.h               |  965 +++++++-----
 ext/hal/nxp/mcux/drivers/fsl_flexbus.c             |   16 +-
 ext/hal/nxp/mcux/drivers/fsl_flexbus.h             |   17 +-
 ext/hal/nxp/mcux/drivers/fsl_flexcan.c             |  317 ++--
 ext/hal/nxp/mcux/drivers/fsl_flexcan.h             |  129 +-
 ext/hal/nxp/mcux/drivers/fsl_ftm.c                 |   74 +-
 ext/hal/nxp/mcux/drivers/fsl_ftm.h                 |  157 +-
 ext/hal/nxp/mcux/drivers/fsl_gpio.c                |   28 +-
 ext/hal/nxp/mcux/drivers/fsl_gpio.h                |  194 ++-
 ext/hal/nxp/mcux/drivers/fsl_i2c.c                 |  503 ++++--
 ext/hal/nxp/mcux/drivers/fsl_i2c.h                 |  187 +--
 ext/hal/nxp/mcux/drivers/fsl_i2c_edma.c            |  138 +-
 ext/hal/nxp/mcux/drivers/fsl_i2c_edma.h            |   55 +-
 ext/hal/nxp/mcux/drivers/fsl_llwu.c                |    4 +-
 ext/hal/nxp/mcux/drivers/fsl_llwu.h                |   87 +-
 ext/hal/nxp/mcux/drivers/fsl_lptmr.c               |   38 +-
 ext/hal/nxp/mcux/drivers/fsl_lptmr.h               |   89 +-
 ext/hal/nxp/mcux/drivers/fsl_mpu.c                 |  232 ---
 ext/hal/nxp/mcux/drivers/fsl_mpu.h                 |  495 ------
 ext/hal/nxp/mcux/drivers/fsl_pdb.c                 |   16 +-
 ext/hal/nxp/mcux/drivers/fsl_pdb.h                 |  126 +-
 ext/hal/nxp/mcux/drivers/fsl_pit.c                 |   14 +-
 ext/hal/nxp/mcux/drivers/fsl_pit.h                 |   39 +-
 ext/hal/nxp/mcux/drivers/fsl_pmc.c                 |    4 +-
 ext/hal/nxp/mcux/drivers/fsl_pmc.h                 |  124 +-
 ext/hal/nxp/mcux/drivers/fsl_port.h                |  159 +-
 ext/hal/nxp/mcux/drivers/fsl_rcm.c                 |    6 +-
 ext/hal/nxp/mcux/drivers/fsl_rcm.h                 |   35 +-
 ext/hal/nxp/mcux/drivers/fsl_rnga.c                |   10 +-
 ext/hal/nxp/mcux/drivers/fsl_rnga.h                |    7 +-
 ext/hal/nxp/mcux/drivers/fsl_rtc.c                 |   19 +-
 ext/hal/nxp/mcux/drivers/fsl_rtc.h                 |   47 +-
 ext/hal/nxp/mcux/drivers/fsl_sai.c                 |  196 ++-
 ext/hal/nxp/mcux/drivers/fsl_sai.h                 |  146 +-
 ext/hal/nxp/mcux/drivers/fsl_sai_edma.c            |   46 +-
 ext/hal/nxp/mcux/drivers/fsl_sai_edma.h            |    7 +-
 ext/hal/nxp/mcux/drivers/fsl_sdhc.c                |  502 +++---
 ext/hal/nxp/mcux/drivers/fsl_sdhc.h                |  219 +--
 ext/hal/nxp/mcux/drivers/fsl_sim.c                 |   56 +-
 ext/hal/nxp/mcux/drivers/fsl_sim.h                 |   69 +-
 ext/hal/nxp/mcux/drivers/fsl_smc.c                 |   56 +-
 ext/hal/nxp/mcux/drivers/fsl_smc.h                 |  113 +-
 ext/hal/nxp/mcux/drivers/fsl_sysmpu.c              |  249 +++
 ext/hal/nxp/mcux/drivers/fsl_sysmpu.h              |  435 ++++++
 ext/hal/nxp/mcux/drivers/fsl_uart.c                |  378 +++--
 ext/hal/nxp/mcux/drivers/fsl_uart.h                |  138 +-
 ext/hal/nxp/mcux/drivers/fsl_uart_edma.c           |   68 +-
 ext/hal/nxp/mcux/drivers/fsl_uart_edma.h           |   46 +-
 ext/hal/nxp/mcux/drivers/fsl_vref.c                |   70 +-
 ext/hal/nxp/mcux/drivers/fsl_vref.h                |   62 +-
 ext/hal/nxp/mcux/drivers/fsl_wdog.c                |    4 +-
 ext/hal/nxp/mcux/drivers/fsl_wdog.h                |   97 +-
 .../drivers/clock_control/stm32f4_clock_control.h  |   25 +-
 kernel/Kconfig                                     |    2 +-
 117 files changed, 10345 insertions(+), 6102 deletions(-)
 create mode 100644 boards/arm/96b_carbon/doc/96b_carbon.rst
 create mode 100644 boards/arm/96b_carbon/doc/img/96b-carbon-front.png
 create mode 100644 boards/arm/96b_nitrogen/doc/96b_nitrogen.rst
 create mode 100644 boards/arm/96b_nitrogen/doc/img/96b-nitrogen-front.png
 rename drivers/spi/{Kconfig.mcux => Kconfig.mcux_dspi} (92%)
 rename drivers/spi/{spi_mcux.c => spi_mcux_dspi.c} (100%)
 create mode 100644 dts/arm/olimexino_stm32.dts
 create mode 100644 dts/arm/olimexino_stm32.fixup
 create mode 100644 dts/arm/stm32f103xb.dtsi
 delete mode 100644 ext/hal/nxp/mcux/drivers/fsl_mpu.c
 delete mode 100644 ext/hal/nxp/mcux/drivers/fsl_mpu.h
 create mode 100644 ext/hal/nxp/mcux/drivers/fsl_sysmpu.c
 create mode 100644 ext/hal/nxp/mcux/drivers/fsl_sysmpu.h

Change-Id: I7e209c3e655e3ef9615ef2d1ae8075116a1ac53a
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-03-27 09:08:01 -05:00
Maureen Helm
aa9c14667b ext: mcux: Update to mcux 2.2 for k64
Updates the mcux drivers and device header files for the k64 from mcux
2.1 to mcux 2.2. Updates the k6x soc init and ethernet shim driver to
reflect mcux interface changes.

Origin: NXP MCUXpresso SDK 2.2
URL: mcux.nxp.com
Maintained-by: External

Change-Id: Icb578dddbe84c190e990b756193bef621010a898
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-27 09:05:58 -05:00
Maureen Helm
e0b56a7076 ext: mcux: Update to mcux 2.1 for k64
Updates the mcux drivers and device header files for the k64 from mcux
2.0 to mcux 2.1.

Origin: NXP MCUXpresso SDK 2.1
URL: mcux.nxp.com
Maintained-by: External

Change-Id: Ic83acfa91b575550c92ccc124d94ecd8fdac1f57
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-27 09:05:58 -05:00
Florian Vaussard
a57df869b4 serial: stm32: Properly put Kconfig options in their own submenu
Currently the entries for STM32 UART ports are at the same level than
the top menuconfig UART_STM32. As a result they are mixed with other
configs in the "Serial Drivers" menu.

Use if/endif grammar to put these entries under a dedicated STM32
submenu.

Change-Id: If28945204b801578d29f8cce7c2370ca3c2737a1
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Florian Vaussard
87960944d2 gpio: stm32: Add support for ports I to K
Add support for GPIO banks I to K that can be found on some high-density
STM32F4 products.

Change-Id: I2cb65ed4d4a2282f7d17478cb1fcdd65dffe71b0
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Florian Vaussard
52d663d49d gpio: stm32: Use macro to simplify registration
The registration of each GPIO bank differs by only few details. These
differences can be factorized in order to create a generic registration
macro.

This has several advantages:
- Less code
- Easier to add new banks
- Less work to add support for new STM32 families

The diff stat speaks for it-self: 26 insertions(+), 92 deletions(-)

Change-Id: I674752fda5ee3caefb815ccf070a1b636b16cf85
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Florian Vaussard
85b4ecabe8 clock: stm32f4: Add some missing clocks
Add several missing clocks that are used by other members of the STM32F4
family. This is needed to add support for various hardware, like UART9
and UART10 on STM32F413.

Change-Id: I6f1a04ddece90a04e31a1710065545179b0e530d
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Florian Vaussard
2304e0facf clock: stm32f4: Fix wrong BKPSRAM and CCMDATARAM clocks
It appears that enable bits for BKPSRAM and CCMDATARAM are incorrectly
defined as bit 14 and 16 on AHB1 respectively (when these IPs are present),
where we should use bit 18 and 20 according to the various reference
manuals (STM32F415 for instance).

Change-Id: I44ce59a29c57e306f6a945e46043efbcfce7a92f
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Florian Vaussard
33579adef9 clock: stm32f4: Fix range of CLOCK_STM32F4X_PLLN_MULTIPLIER config
The PLLN multiplier can range between 50 and 432 on all STM32F4, except
on the STM32F401 where the lower bound is restricted to 192.

Fix the range property and the help text to reflect this reality.

Change-Id: I7b93e84b321f7869aaf611287344cd3e25c893c8
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Florian Vaussard
9b6140eafc arm: stm32f4: Add FPU support
The Cortex-M4 of the STM32F4 family has an FPU. Enable the FPU support
by selecting CPU_HAS_FPU.

Change-Id: Iddae9c547df6e010562649eb0997dc61563c8fc4
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Florian Vaussard
0601d8ad2b arm: stm32f4: Fix comment in Kconfig
The comment refers to STM32F1 instead of STM32F4.

Change-Id: Ide116b712146f87a6f4d2aaafea8bd181c4d9397
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Florian Vaussard
632a07d987 gpio: stm32: Use atomic set/reset in stm32_gpio_set()
The current implementation of stm32_gpio_set() uses the GPIO output data
register to change the state of individual GPIOs. The generated
assembler needs at least 3 instructions: load / modify / store.

This opens a small race window, for example if a thread and an
interrupt both try to change the state of the same GPIO bank.

Use the GPIO bit set/reset register to perform the atomic change without
locking.

This also has the benefit of a more optimised implementation, which can
be useful for GPIO-intensive work. Compare the new version:

08000c98 <stm32_gpio_set>:
 8000c98:       f001 010f       and.w   r1, r1, #15
 8000c9c:       2301            movs    r3, #1
 8000c9e:       b902            cbnz    r2, 8000ca2 <stm32_gpio_set+0xa>
 8000ca0:       3110            adds    r1, #16
 8000ca2:       408b            lsls    r3, r1
 8000ca4:       6183            str     r3, [r0, #24]
 8000ca6:       2000            movs    r0, #0
 8000ca8:       4770            bx      lr

and the old one:

08000c98 <stm32_gpio_set>:
 8000c98:       2301            movs    r3, #1
 8000c9a:       f001 010f       and.w   r1, r1, #15
 8000c9e:       fa03 f101       lsl.w   r1, r3, r1
 8000ca2:       6943            ldr     r3, [r0, #20]
 8000ca4:       b10a            cbz     r2, 8000caa <stm32_gpio_set+0x12>
 8000ca6:       4319            orrs    r1, r3
 8000ca8:       e001            b.n     8000cae <stm32_gpio_set+0x16>
 8000caa:       ea23 0101       bic.w   r1, r3, r1
 8000cae:       6141            str     r1, [r0, #20]
 8000cb0:       2000            movs    r0, #0
 8000cb2:       4770            bx      lr

Change-Id: Ie5800d1c345016028d1b9a099f5d74cac35f592a
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Florian Vaussard
8fcb780034 kernel: arm: Increase idle stack size to fix corruption by FP_SHARING
When enabling CONFIG_FP_SHARING on ARM, 64 extra bytes are necessary
on the stack of each task in order to save FPU registers S16 to S31.

In the case of the idle stack, the default value of 256 bytes is too
small. As described in ZEP-1470, when the idle task is scheduled out,
floating point registers are saved, which corrupts the stack frame
(especially the saved PC value). When scheduling the idle task, the
restored PC will jump to nowhere, leading to a Usage Fault.

Increase the size of the idle stack by 64 bytes to fix this issue.

JIRA: ZEP-1470

Change-Id: Ib800cd51e5189dda8bf59332db661c21399db3e3
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Gustavo Denardin
ad235dc24b arm: UART driver modifications for MKL25Z soc support
Since all interrupts come in on the status line,
we only connect it for the KL2X.

Change-Id: Ia9e0d483fe68464a0eeab08c95a043260e5793b0
Signed-off-by: Gustavo Denardin <gustavo.denardin@gmail.com>
2017-03-27 09:05:57 -05:00
Ricardo Salveti
51036ca5f4 nrf_rtc_timer: clear events and counter when disabling sys_clock
Clear pending IRQ when starting and restore back the RTC1 state when
disabling sys_clock, to avoid issues when soft rebooting the device or
chainloading another Zephyr image (e.g. mcuboot).

Change-Id: I693d9168196ad2cfb8475ecfa2051eac043b1fbd
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-03-27 09:05:57 -05:00
Ricardo Salveti
67f488b8f1 boards: add 96b_nitrogen board documentation
This patch adds documentation for 96b_nitrogen board.

Change-Id: I3e50d61cb9dd3e3a1afd242e53c74aae969ffdf0
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-03-27 09:05:57 -05:00
Ricardo Salveti
2df2790448 boards: add 96b_carbon board documentation
This patch adds documentation for 96b_carbon board.

Change-Id: I2ffa8dc0dab579306474887023275d85d9a168da
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-03-27 09:05:57 -05:00
Kumar Gala
83d8ffb2a0 spi: mcux: Rename spi driver to DSPI to match naming convention
In prep for supporting the older KL2x SoCs that use a different SPI
block, rename the current SPI driver to DSPI to match what the MCUX HAL
defines it as.

Change-Id: I9097580df5fca649ab6fd9a38212fced0b1ea6ed
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-03-27 09:05:57 -05:00
Yannis Damigos
fedf497b03 olimexino_stm32: Enable DT usage for OLIMEXINO STM32
This patch adds the necessary changes to enable use of DTS for
generating required build information.

Change-Id: I0d7aa15488339a425ffe57b6354992851212f7f3
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-03-27 09:05:57 -05:00
Yannis Damigos
a7b6d769d4 dts: arm: Add base DTS support for Olimexino STM32 board
This patch adds the base DTS files required to support DTS for the
STM32F103xB based Olimexino STM32 board.

Origin: Original

Change-Id: I2a20d3f3ce8b1d3c20fe92b2ffa584c69fbd96a5
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-03-27 09:05:57 -05:00
Gustavo Denardin
5295191b28 arm: IRQ number correction in the soc configuration
The previous file contained erroneous values of the number of IRQs
in these socs.

Change-Id: Ie7d2c19d86e247599f4924b95d9330175140d894
Signed-off-by: Gustavo Denardin <gustavo.denardin@gmail.com>
2017-03-27 09:05:57 -05:00
Anas Nashif
f475d2cde9 samples: grove: remove duplicate config
Duplicate Kconfig variable in prj.conf causes warning

Jira: ZEP-1880
Change-Id: I941b36a17c550d7e64759ea3266da6957ec3e82c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-26 02:10:24 +00:00
Flavio Santes
c3f79e1d46 test/crypto: Update ECC DSA test case
The ECC DSA test case was updated in TinyCrypt 0.2.6.

Fix the length of the random vector.

Change-Id: I7545a51c6855959afdefe00a1e0b53e5c3001a7c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-25 15:42:13 +00:00
Flavio Santes
3692aed6a8 test/crypto: Update ECC DH test case
The ECC DH test case was updated in TinyCrypt 0.2.6.

This patch adds two helper arrays for the Monte Carlo routine.

Change-Id: If28292512b351feffc3fe470942cd97b18851a57
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-25 15:42:13 +00:00
Leandro Pereira
a50c1d0620 test: Add test for JSON library
This adds a test suite for the JSON library, testing both encoding and
decoding of all supported data types, including arrays, nested objects,
and basic types such as booleans, numbers, and strings.

Jira: ZEP-1607
Change-Id: I4f6ad7e2859a142e06d405e0760e91751e01a31f
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:55 +00:00
Leandro Pereira
262365c727 lib: json: Fix parsing of boolean values
Boolean values were being decoded using the descriptor type rather than
the value type.

Jira: ZEP-1607
Change-Id: I0c9324ee705af973ccf738e92785820c3a5fb692
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:55 +00:00
Leandro Pereira
4c7803b59f lib: json: Ignore spaces while scanning for tokens
The function to ignore spaces was not being called, so some tokens had
whitespace in the beginning.  They were correctly lexed, but parsing
could eventually fail.

Jira: ZEP-1607
Change-Id: I796596143895fa0fa652641f56af9a03e7a65b7a
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:54 +00:00
Leandro Pereira
844ef6744e lib: json: Fix number parsing
Comparing *endptr with '\0' will always be true before replacing
*token->end with prev_end.

Jira: ZEP-1607
Change-Id: I224129586e15380d3919bfba3db4fcf38c28cb07
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:53 +00:00
Leandro Pereira
122cdb3956 lib: json: Do not use translation tables to encode characters
It has been suggested in a review to use a simple function with a
switch statement instead of the table trick.

Jira: ZEP-1607
Change-Id: I5290de175021bfa8642334548ece8266d4c137f0
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:52 +00:00
Leandro Pereira
95ec49cb70 lib: json: Simplify lexing of "true", "false", and "null" tokens
Roll the loop in an accept_run() function and use it to match "rue" and
"alse" depending on the first character of the token.  Use that to lex
"ull" after finding "n" as well.  This reduces the code slightly.

Jira: ZEP-1607
Change-Id: Iec8ff6ae2fb79e7fe65d476d1574c5943d23e14f
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:52 +00:00
Leandro Pereira
b9b1c18cd7 lib: json: Add encoding support
Serializing an object in JSON is quite tricky to do by hand, and with
an array of descriptor structs, there's enough information to do that
programatically.

The encoder takes a callback function, so that one can be written to
write bytes to, for instance, a struct net_buf.  This way, there's no
guesswork to determine the buffer size, reducing the possibility of
overflowing the stack.

Jira: ZEP-1607
Change-Id: I5ccf1012e46c1db32fcfdf2ecee4a1ef44c927d5
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:51 +00:00
Leandro Pereira
67ac6f6701 lib: json: Parse nested objects and arrays
Parse arrays and nested objects.

Array parsing is limited to items of the same type, and requires an array
with fixed number of elements.  Elements can be of any type supported by
the parser, including arrays and objects.

The return value of json_obj_parse() won't be that helpful: the nth bit
will only be set if the object has been fully decoded.

Jira: ZEP-1607
Change-Id: I472e402ae3f36a1bd1505decc0313f74cbfa2e07
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:50 +00:00
Anas Nashif
0505c9c881 benchmarks: convert latency_measure to unified kernel
Change-Id: If92833d699b95f5a7e813d0577f5467b06d3a1b6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-25 12:38:50 +00:00
David B. Kinder
c096453f34 doc: fix installation on windows instructions
Add more installation details for building zephyr on Windows
including what to do with the ISSM tar.gz file that's
downloaded, proxy settings if behind a firewall, adding tar
to the dependencies (needed to extract the ISSM tar.gz file),
linking to the downloads page for the ARM toolchain, and
fixing command lines to correctly use `make BOARD=`. Verified
instructions work on a Windows 10 system.

Change-Id: I04e5f8e46df7630868568b90388dc65bb9baa4c9
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-03-25 12:36:14 +00:00
Anas Nashif
25aa9e8e36 tests: enable syslog for sensors
Change-Id: If866083d5707a83b1df0a3411f3a848fdf40dbcb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-25 12:00:30 +00:00
Anas Nashif
a53bc0eef0 sensors: sx9500: varables undeclared when in debug mode
Change-Id: I1625fffbe4c1d24b7976fe5b82dafc29e8ec8350
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-25 12:00:29 +00:00
Anas Nashif
2c04055970 Merge "Merge bluetooth branch into master" 2017-03-25 11:25:43 +00:00
Anas Nashif
8ec959a041 Merge "Merge net branch into master" 2017-03-25 11:25:33 +00:00
Johan Hedberg
93fbca0d16 Merge bluetooth branch into master
- Controller cleanups
 - Refactor controller for a cleaner Link Layer abstraction
 - SDP enhancements
 - Use sys_slist_t API wherever possible
 - Fix race condition in controller
 - Update controller to report Bluetooth 5.0 version

----------------------------------------------------------------
Carles Cufi (6):
      Bluetooth: controller: Remove unused H:4 tag macros
      Bluetooth: controller: Rename downstream API calls
      Bluetooth: controller: Introduce BLUETOOTH_LL_SW
      Bluetooth: controller: Move ll.h to an include folder
      Bluetooth: controller: Remove public address config option
      Bluetooth: controller: Move LL code from driver to ll_sw

Johan Hedberg (11):
      Bluetooth: Make bt_hci_driver instances link-time constants
      Bluetooth: shell: Fix missing initialization of param.own_addr
      Bluetooth: shell: Add command to start continuous passive scanning
      Bluetooth: Move crypto APIs to dedicated header file
      Bluetooth: Controller: Factor out ECB core code from ecb_encrypt()
      Bluetooth: Controller: Introduce big-endian variant for ECB
      Bluetooth: Introduce public big-endian AES API
      Bluetooth: Controller: Increase default TX buffer count
      Bluetooth: Use specific pointer type for conn->channels
      Bluetooth: ATT: Reorder handler struct for compactness
      Bluetooth: ATT: Refactor PDU handling

Kaustav Dey Biswas (5):
      Bluetooth: SDP: Server: Send service search response
      Bluetooth: SDP: Server: Handle ServiceAttributeRequest
      Bluetooth: SDP: Server: Find the attributes in the record
      Bluetooth: SDP: Server: Send ServiceAttributeResponse
      Bluetooth: SDP: Server: Support ServiceSearchAttributeRequest

Luiz Augusto von Dentz (4):
      Bluetooth: ipsp: Fix checking for NULL pointer
      Bluetooth: L2CAP: Use sys_slist_t for connection channels
      Bluetooth: L2CAP: Use sys_slist_t for server channels
      Bluetooth: L2CAP: Use sys_slist_t for fixed channels

Mariusz Skamra (2):
      Bluetooth: L2CAP: Fix TX queueing for LE CoC
      Bluetooth: tester: Fix UART issue on qemu

Matthias Ringwald (1):
      Bluetooth: Controller: Kconfig company id and subversion number

Sathish Narasimman (5):
      Bluetooth: HFP HF: SCO: Handle synchronous_conn_complete
      Bluetooth: SCO: Rename 'conn' to 'acl'
      Bluetooth: HFP HF: SCO: Handle SCO Disconnect
      Bluetooth: HFP HF: SCO Initiate Audio connection
      Bluetooth: AT: Fix reset the state during error

Vinayak Chettimada (16):
      Bluetooth: Controller: Fix RSSI feature conditional compilation
      Bluetooth: Controller: Add advertisement event indication feature
      Bluetooth: Controller: Add Kconfig range check for public address
      Bluetooth: Controller: Version 5.0 and PDU type rename
      Bluetooth: controller: Use explicit paths to internal headers
      Bluetooth: controller: Move bt_rand into separate file
      Bluetooth: Make LE Encrypt helpers public
      Bluetooth: controller: Replace 0 for pointers with NULL keyword
      Bluetooth: Fix checks for changes in connection parameters
      Bluetooth: Support connection parameter update as central
      Bluetooth: shell: Reorder commands in logical order of use
      Bluetooth: shell: Add connection update command
      Bluetooth: controller: Move PDU macros from radio.h to pdu.h
      Bluetooth: controller: Cleanup makefiles
      Bluetooth: controller: Fix mayfly caller id for thread call path
      Bluetooth: controller: Fix race waiting for ticker job to complt

 drivers/bluetooth/hci/h4.c                         |   2 +-
 drivers/bluetooth/hci/h5.c                         |   2 +-
 drivers/bluetooth/hci/spi.c                        |   2 +-
 include/bluetooth/bluetooth.h                      |  15 +-
 include/bluetooth/conn.h                           |  11 +
 include/bluetooth/crypto.h                         |  77 ++
 include/bluetooth/hci.h                            |  24 +
 include/bluetooth/l2cap.h                          |   4 +-
 include/drivers/bluetooth/hci_driver.h             |   2 +-
 samples/bluetooth/ipsp/src/main.c                  |   6 +-
 subsys/bluetooth/Kconfig                           |   2 +-
 subsys/bluetooth/controller/Kconfig                |  39 +-
 subsys/bluetooth/controller/Makefile               |  23 +-
 subsys/bluetooth/controller/hal/Makefile           |   1 +
 subsys/bluetooth/controller/hal/ecb.h              |   3 +
 subsys/bluetooth/controller/hal/nrf5/Makefile      |   3 +
 subsys/bluetooth/controller/hal/nrf5/cntr.c        |   4 +-
 subsys/bluetooth/controller/hal/nrf5/ecb.c         |  64 +-
 subsys/bluetooth/controller/hal/nrf5/radio.c       |  17 +-
 subsys/bluetooth/controller/hal/nrf5/rand.c        |   4 +-
 subsys/bluetooth/controller/hal/radio.h            |   5 -
 subsys/bluetooth/controller/hci/Makefile           |   4 +
 subsys/bluetooth/controller/hci/hci.c              |  76 +-
 subsys/bluetooth/controller/hci/hci_driver.c       | 217 +-----
 subsys/bluetooth/controller/include/ll.h           |  58 ++
 subsys/bluetooth/controller/ll/ll.h                |  29 -
 subsys/bluetooth/controller/ll_sw/Makefile         |   4 +
 subsys/bluetooth/controller/ll_sw/crypto.c         |  54 ++
 subsys/bluetooth/controller/{ll => ll_sw}/ctrl.c   | 660 +++++++++--------
 subsys/bluetooth/controller/{ll => ll_sw}/ctrl.h   |  54 +-
 .../controller/{ll => ll_sw}/ctrl_internal.h       |   6 +-
 subsys/bluetooth/controller/{ll => ll_sw}/ll.c     | 237 ++++++-
 subsys/bluetooth/controller/{ll => ll_sw}/pdu.h    |  64 +-
 subsys/bluetooth/controller/ticker/Makefile        |   3 +
 subsys/bluetooth/controller/ticker/ticker.c        |  12 +-
 subsys/bluetooth/controller/util/Makefile          |   1 +
 subsys/bluetooth/controller/util/memq.c            |   5 +-
 subsys/bluetooth/host/Kconfig                      |  16 +-
 subsys/bluetooth/host/Makefile                     |   2 +
 subsys/bluetooth/host/at.c                         |   7 +-
 subsys/bluetooth/host/att.c                        | 204 ++++--
 subsys/bluetooth/host/conn.c                       | 148 +++-
 subsys/bluetooth/host/conn_internal.h              |  12 +-
 subsys/bluetooth/host/crypto.c                     | 155 ++++
 subsys/bluetooth/host/crypto.h                     |   8 +
 subsys/bluetooth/host/hci_core.c                   | 150 ++--
 subsys/bluetooth/host/hci_core.h                   |   2 +-
 subsys/bluetooth/host/hci_ecc.c                    |   9 +-
 subsys/bluetooth/host/hci_ecc.h                    |   5 +-
 subsys/bluetooth/host/hci_raw.c                    |   8 +-
 subsys/bluetooth/host/hci_raw_internal.h           |   2 +-
 subsys/bluetooth/host/l2cap.c                      | 202 ++----
 subsys/bluetooth/host/l2cap_br.c                   |  97 +--
 subsys/bluetooth/host/l2cap_internal.h             |   5 +-
 subsys/bluetooth/host/sdp.c                        | 781 +++++++++++++++++++++
 subsys/bluetooth/host/sdp_internal.h               |  14 +
 subsys/bluetooth/host/smp.c                        |  36 +-
 tests/bluetooth/init/prj_controller_4_0.conf       |   1 +
 tests/bluetooth/init/prj_controller_dbg.conf       |   1 +
 tests/bluetooth/shell/src/main.c                   | 137 +++-
 tests/bluetooth/test_bluetooth/src/bluetooth.c     |   2 +-
 tests/bluetooth/tester/qemu.conf                   |   1 +
 62 files changed, 2583 insertions(+), 1216 deletions(-)
 create mode 100644 include/bluetooth/crypto.h
 create mode 100644 subsys/bluetooth/controller/hal/Makefile
 create mode 100644 subsys/bluetooth/controller/hal/nrf5/Makefile
 create mode 100644 subsys/bluetooth/controller/hci/Makefile
 create mode 100644 subsys/bluetooth/controller/include/ll.h
 delete mode 100644 subsys/bluetooth/controller/ll/ll.h
 create mode 100644 subsys/bluetooth/controller/ll_sw/Makefile
 create mode 100644 subsys/bluetooth/controller/ll_sw/crypto.c
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl.c (93%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl.h (84%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl_internal.h (98%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ll.c (58%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/pdu.h (77%)
 create mode 100644 subsys/bluetooth/controller/ticker/Makefile
 create mode 100644 subsys/bluetooth/controller/util/Makefile
 create mode 100644 subsys/bluetooth/host/crypto.c
 create mode 100644 subsys/bluetooth/host/crypto.h

Change-Id: Ic8bee0eb4f15c00ce5ca7b3b80133b1bbd0bdbf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-24 23:21:09 -07:00
Anas Nashif
898c8b639b tests: object_footprint: add missing file
Change-Id: I2d26f0770ac81482d70a8101c22745b2baef64ae
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 18:17:32 -04:00
Anas Nashif
e994b0ab19 benchmarks: remove legacy tests already ported to unified
Change-Id: I002a462e06333b8540e96d4e4e166830b231d536
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 18:17:04 -04:00
Anas Nashif
7942eaee39 benchmarks: port object_footprint to unified kernel
Change-Id: Iaa39f60b9ef498059f0320631823a9d7d47a99de
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 21:51:17 +00:00
Anas Nashif
477a928134 benchmarks: move footprint benchmark out of legacy
Those can be used with unified kernel.

Change-Id: I4bd024f7e645b99ac1b8df6dfbbdd94f2fda99c4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 21:51:17 +00:00
Inaky Perez-Gonzalez
6db4a991b2 tests: tag with 'ignore_faults' testcases that provoke faults
This way we can monitor testcases for faults that should not be there;
however, in the case of these, a fault message is expected and shall
be ignored.

Change-Id: I63736723026c381c9fee7f24a751ceafc12f2a40
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-03-24 21:51:16 +00:00
Anas Nashif
aa70533244 tests: remove legacy tests already ported to unified
Legacy APIs are to be deprecated, so getting rid of tests that have been
moved to unified kernel already.

Change-Id: I752e42bc498dfdd0ea29b0b5b7b9da1dac7b1136
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 21:51:15 +00:00
Vinayak Chettimada
611460b913 Bluetooth: controller: Fix race waiting for ticker job to complt
Same volatile status variable as return and being updated
in ISR would modify the variable in two context which
caused the variable to be set to a stale value.

This commit uses two different variables, one for return
value and the other to be updated by ISR.

Jira: ZEP-1941

Change-id: I19e3bdc85e15bda7891395f3f1f64c2ddbeee0c6
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-24 17:06:59 +00:00
Vinayak Chettimada
2d644f2f42 Bluetooth: controller: Fix mayfly caller id for thread call path
role_disable initiated through HCI commands are initiated
in thread context and controller code was using the job
mayfly caller id instead of using the correct app caller
id.

Also the XTAL retain calls being called from two different
call context used the same worker caller id and same mayfly
instead of using the correct caller ids and independent
mayfly for each caller.

This potentially could cause mayfly enqueued list to be
corrupted and enqueued mayfly could be lost.

Change-id: Ia356419462d1fb4e38f4a20c720974143f12fdb6
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-24 17:06:43 +00:00