Commit graph

41120 commits

Author SHA1 Message Date
Vinicius Costa Gomes
3f24658f29 pinmux: Move the Quark D2000 board to the pinmux model
Change-Id: If82e7323ffa8547bb6b090872948b5e69715b19b
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-03-25 06:17:33 -04:00
Vinicius Costa Gomes
a12a25ad00 pinmux: Move the Freescale FRDM K64F board to the pinmux model
Change-Id: I50cf5fcf00481a3ebac07ced3aa6f7783765934f
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-03-25 06:17:33 -04:00
Vinicius Costa Gomes
41529e20e6 pinmux: Move the Galileo board to the pinmux model
Change-Id: Ib58b1ea56d6c82c2e055bf4cb0df4b07b0dd936e
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-03-25 06:17:33 -04:00
Vinicius Costa Gomes
649253c8a8 k64f: Fix mixing GPIO and pinmux concepts
Setting the direction of a GPIO pin is not the responsibility of the
pinmux "board" initialisation. This should be left for the GPIO
utilising application.

Some macros that were only used when setting the pin direction are
removed.

Change-Id: I5b63d52446a27fe539c89f0639a8dcadf5ea9f80
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-03-25 10:17:01 +00:00
Vinicius Costa Gomes
f25c5ca061 pinmux: Move the Arduino Due board to the pinmux model
Change-Id: I53fb54c0d11bcdbc42191dd4a26787d9beebbf58
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-03-25 10:17:01 +00:00
Vinicius Costa Gomes
ed6fc400e9 pinmux: Move the Arduino 101 board to the pinmux model
This driver doesn't provide any API, it only initializes the pinmux
controller to appropriate values depending on the board.

The first board to use this new infrastructure is the Arduino 101 board,
because it is alphabetically the first.

To better organize code for the different SoCs and boards, a "family"
level is created in the 'drivers/pinmux' directory. The Arduino 101
board is part of the Quark MCU "family".

The PINMUX_DEV configuration (and functionality) is removed for now, it
will be added back when the pinmux_dev drivers are (re)introduced, with
clearer semantics.

Change-Id: Idf5cc3caf6be620aa50828ae8fdc535df6caf458
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-03-25 10:17:00 +00:00
Szymon Janc
ca662c14f1 Bluetooth: Add initial support for BR/EDR discovery
This allows to start (general or limited) BR/EDR discovery. Inquiry
is active until explicitly disabled by application. This is to keep
BR/EDR discovery API similar to LE scan API.

< HCI Command: Inquiry (0x01|0x0001) plen 5
        Access code: 0x9e8b33 (General Inquiry)
        Length: 61.44s (0x30)
        Num responses: 0
> HCI Event: Command Status (0x0f) plen 4
      Inquiry (0x01|0x0001) ncmd 1
        Status: Success (0x00)
> HCI Event: Inquiry Complete (0x01) plen 1
        Status: Success (0x00)

Change-Id: I946fbd881e6d0460be28a9975acd564ae32896e8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-24 20:25:02 +00:00
Szymon Janc
a4836f4da4 Bluetooth: shell: Make cmd_gatt_mread static
This function is not used outside of main.c.

Change-Id: Ia8cc6c2b2193906dd77d031b73d289c6acd128b2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-24 18:39:04 +00:00
Andrei Emeltchenko
f4696286b4 Bluetooth: Fix using uninitialized value
Assign value before using.

Change-Id: I67f0e7195c979bf7547c0f718eeaef5e366b447d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-24 15:10:31 +02:00
Andrei Emeltchenko
425ab2a1e9 Bluetooth: Dereference NULL pointer after check
Dereference buf->len after buf check for NULL.

Change-Id: I2a5de24c8c2367edfd2c35ae925c5cc5b10b03be
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-24 15:02:55 +02:00
Simon Desfarges
9abc29e3ae arc_timer: assert that counter always lower than limit
ASSERT are put each time the timer0 limit register or the timer0 count register
is modified.

Change-Id: I38684d57803de285f4e26c68b449c71396e4c750
Signed-off-by: Simon Desfarges <simon.desfarges@intel.com>
2016-03-24 12:05:37 +00:00
Arkadiusz Lichwa
5cecd07ba2 Bluetooth: BR/EDR: Refactor link key notify handler
Makes proper link key handling based on its type.

Change-Id: I052cc4629e531ea9ae7da95a7268778e633bdba5
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-24 08:32:28 +00:00
Murtaza Alexandru
b1ea13413e sensor: add driver for LSM9DS0 gyroscope
Add device driver for the gyroscope part of LSM9DS0 gyroscope.

Datasheet:
  https://www.adafruit.com/datasheets/LSM9DS0.pdf

Change-Id: I25e0c8470c9b68c594bc4a0d2a9a13f8f41ee309
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-03-24 08:03:31 +00:00
Jukka Rissanen
d233332263 sys_log: User can prevent extra newline to be printed
If the sys log prints already have newline character, then the
syslog macros add another one. User can prevent this by defining
SYS_LOG_NO_NEWLINE before including the sys_log.h

Change-Id: I8aecd856dca8009035dd44f300846492763e57b3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-24 08:02:10 +00:00
Tomasz Bursztyka
69ffd8e64c include: misc: Add a utility macro to generate a bit mask
Such helper is useful to generate a complete bit mask from a given
number. For instance BIT_MASK(2) will output 0x03, or BIT_MASK(8) will
output 0xFF

Change-Id: I406de767d839b7b2d37024b7b41679edddabe551
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-03-24 08:01:52 +00:00
Tomasz Bursztyka
67196bc0c3 drivers: gpio: Align the style all over the drivers
Fixing:
- indentation
- 80 chars limit
- { } mandatory on relevant statements
- using BIT() macro relevantly

Change-Id: Ib84eb29530b175c8a533c1b361aea2632f0d7917
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-03-24 08:01:52 +00:00
Simon Desfarges
a51f88638e arc_timer: fix tickless idle
When exiting from tickless idle uppon an external IRQ, the TICK timer
is set to fire at next TICK boundary. The current algorithm can lead
to a point that timer0_count register is higher than the timer0_limit
register.

In this situation the next TICK will fire after the counter has
wrapped and performed another cycle (~133 seconds).

This condition appears when the counter reaches the limit after the
Interrupt Pending flag is checked. At this point the counter is
automatically wrapped to 0, but is set just next to the limit to fire
at next TICK boundary by SW. At exit of the _timer_idle_exit function,
the timer handler is called, and sets the limit to 1 TICK. At this
point the situation is:
- limit register == 1 TICK
- count register is just below the old limit register and higher than
  1 TICK

To fix this issue, at _timer_idle_exit, the limit register is always
set to 1 TICK and the count register set such as the next TICK fires
on time.

Change-Id: Ifa002809d426aa04109592e53d2b02a224f51101
Signed-off-by: Simon Desfarges <simon.desfarges@intel.com>
2016-03-23 17:21:25 +00:00
Simon Desfarges
e6ded3f581 arc_timer: fix wrong programmed limit when entering idle
The timer counts from 0 to programmed_limit included.

Change-Id: Ifc8585210c319f5452fafc911d4f6d72c4b91eaa
Signed-off-by: Simon Desfarges <simon.desfarges@intel.com>
2016-03-23 17:21:24 +00:00
Anas Nashif
9916452085 samples: w25q80bl: configure sample with correct board
Also enable GPIO and add expected output to the README

Change-Id: I2117d53dc6f90394394c6a8dd9f308a01a110634
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-23 15:56:47 +00:00
Andre Guedes
300bbdc2f4 gpio: Fix returning code from stm32 driver
This patch fixes gpio_stm32 driver since it was merged with a few
occurrences of DEV_* error code.

Change-Id: I025e4f83d8ca07bc0fed7d3dcb9cce3b9d11c3fc
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-23 15:55:11 +00:00
Andre Guedes
4048a59be3 counter: Fix returning code
Counter API and drivers were merged without fixing the new returning
error convention (errno.h codes). This patch fixes all occurrences of
DEV_* codes so -E* codes are used instead.

Change-Id: I85007e8565686b52121410badea547ed904460a0
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-23 15:55:11 +00:00
Andre Guedes
54337aa736 test: Convert returning code to errno.h
Change-Id: Ib4e3fb2e3c1cecf7e1646c7dc03b16e9ce4b6da2
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-23 15:49:40 +00:00
Andre Guedes
db2e46319f arch: Convert returning codes to errno.h
This patch replaces all occurrences of DEV_* codes by errno.h codes at
the arch layer.

Change-Id: I1a1ab6d0481f3660ad032e2690d2577245fe1f34
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-23 15:49:40 +00:00
Andre Guedes
0cf74d1755 device: Deprecate DEV_* error codes
This patch adds a comment to DEV_* codes definition to inform that these
codes are deprecated and we should use codes from errno.h instead.

Change-Id: Ia01b83035db5526b2da56ad4a06b2ebab85b0d55
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-23 15:49:40 +00:00
Maciek Borzecki
25799f045c benchmark/latency: reduce RAM requirements
Reduce RAM requirements of latency benchmarks by reducing the amount of
memory statically allocated for stacks (both fiber and task). This helps
reduce the memory usage required by microkernel test to below 20kB,
enabling the benchmark to be run on Nucleo-F103RB board. The change was
verified for nucleo_f103rb and qemu_x86 boards.

Change-Id: If5990d107f0fcfabd12ade82f97e7a1a13f8421c
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Maciek Borzecki
b7ca3fac3d benchmark/latency: support for Cortex-M targets
Remove x86 specific includes. Add Cortex-M specific instruction pipeline
flush helper.  Microkernel benchmark has been verified to work on STM32
MINI A15 (STM32F103VET) board. Due to memory constraints, Nucleo-F103RB
can only run a nanokernel version of the benchmark.

Change-Id: I2e49c240d6985ceb5643551397d6e0a8cc65b3c6
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Maciek Borzecki
c97906cba6 boards/stm32_mini_a15: default to 115200 for USART1 speed
Change-Id: Ie4ff6bd5559ee2861201e2137986430d6221e564
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Maciek Borzecki
a4808956fc boards/nucleo_f103rb: default to 115200 for USART2 speed
Change-Id: I72618afc33665cc17f7a230f9dada5666a4ded8e
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Maciek Borzecki
fa31a240c8 boards/nucleo_f103rb: enable 72MHz system clock by default
Enable 72MHz SYSCLK by default. The board does not have an on-board
quartz, however the STLink frontend produces a 8MHz clock signal that we
can use. Since the clock signal is not coming from an oscillator, HSE
bypass must be enabled. Make sure not to exceed 36MHz clock on APB1 bus.

Change-Id: I6b0b499a1cc4b0deccbfa374fc9ca3e3e8cc38c5
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Maciek Borzecki
7823380710 boards/stm32_mimi_a15: enable 72MHz system clock by default
Enable 72MHz SYSCLK by default. We use the fact that there is an
on-board 8MHz quartz oscillator available as HSE clock signal. Make sure
not to exceed 36MHz clock limit on APB1.

Change-Id: I9ebc2144910253e68cd8a9b078884852f01c2cab
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Daniel Leung
5b8c5fcc48 arm/fsl_frdm_k64f: remove kconfig default "n" for PWM
CONFIG_PWM is set to "no" by default, so there is no need
to do it in the SoC kconfig file. Also, setting CONFIG_PWM
there causes kconfig to think that CONFIG_PWM depends on
CONFIG_SOC_FSL_FRDM_K64F and gives warnings about
unmet dependencies if the certain combinations of CONFIG
are set.

Change-Id: I0028accfc4b585dcfa87e0d5733b789691a598e3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-23 15:43:22 +00:00
Yannis Damigos
f4d6dbb211 drivers: pinmux: Restructure kconfig options
Moves config options for K64 into its own config file under its
own submenu.

Change-Id: I94ccac54709ab5ec8222daa8634818d9ebc3561d
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-23 15:36:43 +00:00
Yannis Damigos
f978d37466 drivers: spi: Make K64 spi submenu available only for K64 soc
Makes K64 spi driver submenu available only if K64 soc is
selected.

Change-Id: I0ada8863a592f056dbe48e78d9374f2348dcac14
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-23 15:36:43 +00:00
Yannis Damigos
489477b6b9 drivers: pwm: Make K64 pwm submenu available only for K64 soc
Makes K64 pwm driver submenu available only if K64 soc is
selected.

Change-Id: I9959b4785c6deab01977f86bbbebe3d671a4eec7
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-23 15:36:42 +00:00
Andrew Boie
e57a1e5622 sanitycheck: don't require arch.ini blocks for every platform
If the arch ini file doesn't have a specific block for the platform,
just assume all defaults.

Change-Id: Id6ab1ede8936bdd6006a5c4fd2f9a4f6aaf42478
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-23 15:35:38 +00:00
Andrew Boie
821d832f6d sanitycheck: allow N platforms per arch to be run
It is an unfortunate fact of life that our CI machines are often
severly underpowered virtual machines that take quite some time
to run sanitycheck --all. The only other option was to just use
the default test case filtering semantics which chose one platform
per arch to test.

Now it is possible to specify N platforms per arch with the new
--platform-limit option, allowing greater flexibility on how many
tests will be run.

The counter-intuitive use of '--platform all' or '--platform default'
is no longer supported as these use-cases are covered by other
command line options.

Change-Id: I45b0050df52e1a22e75534a3876d89e3c77698c9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-23 15:35:38 +00:00
Szymon Janc
6f9ce0b417 Bluetooth: Provide more config options to init sample
This allows to excersize different kconfig configurations in
single app. Thanks to this other samples don't have to get
extra extra options enabled just to improve test build coverage.

Change-Id: Ie5d261f3d38c60e227cf963d938b6fac6d0fb3b9
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-23 12:50:30 +00:00
Arkadiusz Lichwa
dc6085667e Bluetooth: BR/EDR: Fix storing legacy link key
Stores in keys database legacy (Pre-SSP) link key.

Change-Id: I848e0e29e22edacb24c1a26ffed7a68dff08fed8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-23 11:54:29 +00:00
Szymon Janc
b1e6bb5ef7 Bluetooth: Compile only required parts of keys support
Depending on BR/EDR and SMP support only subset of keys functionality
is needed. This fix compilation if SMP is disabled and BR/EDR is
enabled.

Change-Id: Icf4b5ad1a214e514e03c4c9a359d151e69cab2ab
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-23 10:36:28 +01:00
Szymon Janc
824ec04ea4 Bluetooth: Build keys support if BR/EDR is enabled
BR/EDR requires keys support.

Change-Id: I890b4e56e4e4808cab5579ed280529e11de2cb66
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-23 10:36:28 +01:00
Johan Hedberg
cb5f5d2423 drivers/nble: Fix validation of advertising parameters
According to the Core Sepcification, Advertising Interval Min/Max
shall not be set to less than 0x00a0 if ADV_SCAN_IND or ADV_NONCONN_IND
type is used.

Change-Id: I6c4ef4f73b82841c3a96694dda670cdd12a40a54
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-23 06:14:30 +00:00
Luiz Augusto von Dentz
7a585ee137 Bluetooth: CTS: Add service sample
This adds a CTS service sample which can be shared with application
samples.

Change-Id: I38889f71f6ce8fc7b784d0d04af6c97408e2d662
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-22 17:26:49 +00:00
Luiz Augusto von Dentz
6d461204bf Bluetooth: BAS: Add service sample
This adds a BAS service sample which can be shared with application
samples.

Change-Id: I1f484dadf63b41632992454a40edd91077bb78fa
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-22 17:26:29 +00:00
Luiz Augusto von Dentz
265fc8703a Bluetooth: DIS: Add service sample
This adds a DIS service sample which can be shared with application
samples.

Change-Id: I66f7a725139c8fa381275c3bda5e7c79fa3f09c8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-22 17:26:15 +00:00
Luiz Augusto von Dentz
97e1938db9 Bluetooth: HRS: Add service sample
This adds a HRS service sample which can be shared with application
samples.

Change-Id: I1d2022ee7a6dfa46e2cae2d7c9d7924140d4fe37
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-22 16:43:10 +00:00
Luiz Augusto von Dentz
47bb494610 Bluetooth: Make application samples to use GAP Service sample
This reduces the amount of duplicated code across sample applications.

Change-Id: I20cf2e9f948f1420f234a58beb7f72ad74696cf8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-22 16:43:02 +00:00
Vinicius Costa Gomes
7f68afe382 k64f: Move pinmux specific code to pinmux.c
This makes this board more consistent with the rest of the code base.

Change-Id: I5641c6358e638a3585d2154e67d3536b11436e01
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-03-22 15:17:13 +00:00
Mariusz Skamra
3d35533c95 Bluetooth: Fix validation of advertising parameters
According to the Core Sepcification, Advertising Interval Min/Max
shall not be set to less than 0x00a0 if ADV_SCAN_IND or ADV_NONCONN_IND
type is used.

Change-Id: Ib10f7ec8cdf92dd67e602a9b57d20a35ebacde4e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-22 15:16:12 +00:00
Yannis Damigos
d7a21260b6 drivers: gpio: Make K64 gpio submenu available only for K64 soc
Makes K64 gpio driver submenu available only if K64 soc is
selected.

Change-Id: I4097006a4dca718ed2da730fa85cd2ad9970f419
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-21 19:41:06 +02:00
Yannis Damigos
3a977ae654 drivers: gpio: Move STM32 gpio driver under its own submenu
Moves STM32 gpio driver under its own submenu, like atmel SAM3
and K64 gpio drivers.

Change-Id: Iebc474af9818a73275f99183d3f4788eea1e6ded
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-21 16:51:43 +00:00