Commit graph

41120 commits

Author SHA1 Message Date
Johan Hedberg
1b804f9d74 Bluetooth: samples/hci-uart: Fix up configuration files
Right now the hci-uart samples doesn't really work anywhere else than
nRF5x, so make that the default configuration. Also rename the old
prj.conf to generic.conf to give a generic starting point for creating
configurations for other targets.

Change-Id: I1c940339b457d0e77c8ddad4b2474fc7e5b12a51
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
9dc033cb84 Bluetooth: Add handling for security level 0
So far bt_security_t has completely missed out on security level 0,
i.e. its actual values have been one lower than in the core
specification.

To properly introduce for the new level (which is only applicable for
BR/EDR) add proper tracking for each channel and server, and make the
channels inherit their required level from the respective server.

Change-Id: I9a2384d883017125c2c117880aa6e0ade30520e4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Luiz Augusto von Dentz
237455f77f Bluetooth: GATT: Fix calling read handler twice
If length is already 0 there is no point in calling the handler again
as that already mark the end of the operation.

Change-Id: I212a6d8bdd9aa3d9886099bb7ed3f9d3831bcf1a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-01 21:40:39 +02:00
Luiz Augusto von Dentz
07c8be1791 Bluetooth: ATT: Rework buffer pools to minimize extra data
This uses net_buf_simple_{save/restore} so the same buffer can be reused
if the buffer needs to be resent, also since the responses don't need to
be saved a pool with 1 element is enough while it keeps the code safe
from deadlocking when both request and responses use the same pool.

Change-Id: Ibaa8e7ef39f4b466d5cd4d55874bd609f0a1d67c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-01 21:40:39 +02:00
Carles Cufi
20952b75e3 Bluetooth: uart: Fix UART TX stall condition
In 3 of our UART driver implementations the ISR is exclusively
used and enabled for the RX path. The existing logic was
susceptible to a stall situation where a polled out transmission
would be interrupted by a reception and then the ISR code
would loop forever due to the TX event being signalled (although
the interrupt itself was disabled) causing the ISR to keep
looping for an RX interrupt.

Change-Id: Ic379e58b1c974aca3cee37d2d81f12c3726fb160
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-11-01 21:40:39 +02:00
Johan Hedberg
079030718f Bluetooth: Move hci_driver.h to include/drivers/bluetooth
This header file is not intended for applications, rather than for
drivers, so move it to the appropriate place.

Change-Id: I7ff8158418e7e839b538c6cccbb32f3af43c12c6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
a3a74de6ba Bluetooth: samples/hci-uart: Remove unneeded hci_driver.h include
There's no need for this app to use the HCI driver API directly.

Change-Id: Ie5acfbfb09fc3f86c3f29f22fbf7da7db1ff2127
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Luiz Augusto von Dentz
bbe538fde2 Bluetooth: ATT: Fix not responding when there is a request in parallel
If there is a request ongoing it may block responses to be generated
since they were using the same buffer pool, so this introduces a
dedicated pool for responses making the code able to act as both
server and client at same time.

Change-Id: I5fe3e19f9c5c0c2e0dfadedf77b7684f0960572c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
900fbc20ba boards: x86: Don't default to 'y' with NRF51_PM and WAIT_NOP
These options were only needed for a MyNewt-based nRF51 firmware on
these boards (the MyNewt BLE stack is called Nimble, hence the
prj_nimble.conf sample config files). With a Zephyr-based nRF51
firmware these options are no-longer needed, so it's not appropriate
to have them default to enabled. Instead, if they are needed, require
the app-specific configuration to enable them.

Change-Id: Iefbee4d97590af4e11bcedea05fe61f32a147b83
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 19:37:26 +00:00
Andrew Boie
cc5be1eb96 tests: move benchmark tests to legacy/
These are using old kernel APIs and need to be converted.

Change-Id: I7457270fb5e93e290023756316e82a384712e82b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-01 19:23:48 +00:00
Inaky Perez-Gonzalez
43f788a6eb tests/kernel/test_{fifo,lifo,stack}: filter unified kernel for small memory
As we transition to the unified kernel, we need to check on there
being enough memory in said case (nano kernel always had it based on
higher granularity filtering with 'kernel = nano').

Change-Id: Ic36c352f06be09407cd3aac74a1dfe73bb2fc61d
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-01 11:07:41 -07:00
Anas Nashif
f7bb11a54b tests: stub: we should not be testing this
This code is part of the infrastructure, it does not test any features really.

We are wasting cycles on a stub that does basically nothing.

Change-Id: I130f320d1b365abdac118e5c44b80fd866e5f502
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
0ad8e7c21a samples: convert to unified applications
Change-Id: Ic65886b9144e4c8b738f94ab228541ef4a34dea3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
f431084619 tests: common: add rand32 test
Change-Id: I499586a3be1f9794b68b5cf2e5047a762ea11104
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
5058bb75bc tests: move individual common tests into one test
We have many tests that are being built as stand-alone binaries for no good
reason. Those can be put in one single test to speed up testing and CI
verification.

Currently we do support the following in test_common:

- byteorder
- printk
- intmath
- slist
- atomic
- ring_buf

In addition, the test now uses the ztest framework.

Change-Id: I656ac7f4acf48b7de4ec81c9f5dafc9dea3da911
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
ea607625a3 samples: synchronization no need to set unified_capable tag
We are building for unified kernel by default. This avoids running the test
twice.

Change-Id: I2951464f448b3019c236ce5943df55c052b427d9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
90937df6e9 tests: make generic kernel tests unified
Tests that do not use any of the legacy kernel APIs can be moved to unified
kernel to avoid double testing.

Change-Id: Ic2353feb23ee20d9d93f5459432d3b3739df8e03
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
be4fe7f4e5 tests: move kernel tests to tests/legacy
Move all kernel tests using legacy APIs into tests/legacy to continue testing
old APIs and compatibility. We keep in tests/kernel those tests that do not use
any kernel APIs and generic in nature, those should not be affected by the
unified kernel API change.

In tests/kernel we will start adding tests that are unified kernel only. Later
and when deprecation period is over the legacy tests would be dropped.

Change-Id: Icc7d8c7e5f2af65af350b75da3117f72396925f4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
649ba4f619 benchmark: sys_kernel: do not build on systems with little RAM
Change-Id: Ic566e247441426918fafb63eea8d2f75f9b8a3b1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Benjamin Walsh
1952ac1611 unified/test Adapt sys_kernel test to unified kernel
As unified kernel starts main() application function, remove test
thread.

Remove nanokernel part of the test since their code base is
identical.

Change-Id: I2afb4c0da2d139b159c89186166afdb5d9813d61
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-01 16:52:44 +00:00
Kumar Gala
bfcf575cbb tests: exclude quark_d2000_crb from net/buf test
Currently the net/buf test fails on quark_d2000_crb due to RAM
overflow:
	region `RAM' overflowed by 2256 bytes

Change-Id: I854960a3c22c7318f5f5e9341ca7aaaf8743d30d
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-01 15:03:04 +00:00
Anas Nashif
b4dc970a7c tests: convert loopback test to unified kernel
Make it run on Qemu only, this test is not intended for HW.

Change-Id: I842d7456f9238221ef5b661749136f4418d5ab16
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 10:24:55 -04:00
Andrew Boie
4208976bfc build: consolidate some common parts of linker scripts
There are a number of data sections that are repeated across
all the linker scripts for various architecture. In practice these
don't always get updated and we have had problems with bit-rot.
Consolidate these to make maintenance easier.

x86 linker scripts now follow the same naming convention and we
get rid of a linker-epilog.h that wasn't necessary and whose purpose
has been lost to the mists of time. If applications want to define their
own sections they should be allowed to. Linker scripts for x86 do not
end with .h any more, they are not C header files even though we use
C's preprocessor.

Issue: ZEP-688
Change-Id: I893eb4619969695c1f980efd7c2ec9fa5dad136d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-10-31 18:00:58 -07:00
Chuck Jordan
8b1958a36a arc: Don't need CONFIG_NUM_REGULAR_IRQ_PRIO_LEVELS
We can derive NUM_REGULAR_IRQ_PRIO_LEVELS by subtracting 1
from CONFIG_IRQ_PRIO_LEVELS if FIRQ is present (which is currently
always the case). If FIRQ is not present, the value will be equal
to CONFIG_IRQ_PRIO_LEVELS since all interrupts will be regular.

Change-Id: Ibefc939e3771bf0adf712127db0d36cb49bf732b
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-10-31 23:56:56 +00:00
Allan Stephens
075ee6b9fd unified/doc: Update system threads section of Kernel Primer
Note that a new section will be created to discuss workqueues,
including the system workqueue.

Change-Id: I921511f117acb07768619418539bef5b6a2a0a72
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-31 23:56:30 +00:00
Allan Stephens
24320aca9b unified/doc: Update list of changes from version 1 kernel
Change-Id: I57ad834bdc54e495d53986a74b9b5793a37a7732
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-31 23:56:30 +00:00
Peter Mitsis
3f95bfccf5 unified: Add doxygen function headers to legacy.h
Jira: ZEP-981
Change-Id: I08435da22a3776b60ac3f3c5ca77578bff969f19
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-31 23:56:05 +00:00
Peter Mitsis
348eb4c4fb unified: Update kernel.h doxygen comments
Jira: ZEP-981
Change-Id: I3797f5e8824b4a01153f3c1fe0e070d3b107f596
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-31 23:56:04 +00:00
Johan Hedberg
ee0412a7d1 net: tests: Fix net_buf_unref() tests for fragment chains
The net_buf_unref() API will unref all associated fragments, so it's
wrong to assume that no fragment destroy callbacks would be called
when the head buf is unreffed. Instead the right expectation is that
all fragments get unrefed as well.

Change-Id: I00530e4c1cfa5dddbfcbeab9609347873010ff4d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-31 23:53:40 +00:00
Anas Nashif
fcb54aa96b tests: crypto: convert all tests to unified kernel
Change-Id: Id7c1c6bbb0b04eb190cc44c1fbb557722871fc0f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 21:38:49 +00:00
Anas Nashif
a32579749b ztest: move ztest to unified kernel
ztest was not working with unified kernel and v1 APIs and not many tests are
using ztest right now, so instead of making it work with old APIs, convert it
to unified kernel completely so that new tests written using ztest would be
unified kenrel based.

Change-Id: Ibfcc7783dcb266abbd388662ba61c4b55d32b10c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 21:38:04 +00:00
Flavio Santes
70ff94c42a scripts: Update fixdep from kernel.org
This commit updates fixdep.c from the Linux Kernel, stable v4.8.5.

Origin: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/scripts/basic/fixdep.c?id=refs/tags/v4.8.5

Jira: ZEP-737

Change-Id: If75d0abb22f98bae74a801aea53218039107dd65
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-10-31 20:58:57 +00:00
Jesus Sanchez-Palencia
fd4dc0f11f wdt: Remove unneeded include from wdt_qmsi.c
qm_interrupt.h is not needed.

Change-Id: Ia9e62db9fc39ee7a8a36e087eb447cbc4a419817
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-10-31 20:58:33 +00:00
Anas Nashif
6043c30aa4 tests: samples: exclude quark_d2000_crb from large applications/tests
Change-Id: I108639966d5bb66fb08d745155d692b82c304de1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 16:10:45 -04:00
Allan Stephens
e3e0b29418 unified/doc: Remove semaphore groups documentation from Kernel Primer
Semaphore groups are not supported by the unified kernel (other than
via the legacy APIs).

A select() or poll() type mechanism may be introduced in the future
to provide a more general capability for a thread to wait on multiple
kernel objects simultaneously.

Change-Id: I6cdf773ecb5954bd1b9a5caa9ca5cc29b2932d9a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-31 20:03:51 +00:00
Allan Stephens
a55575497f unified/doc: Add atomic array variable information to Kernel Primer
Change-Id: Ibdcc928c7a114b80abb66696bcc4fe08992399b0
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-31 20:03:50 +00:00
Allan Stephens
fac31c1e2c unified/doc: Update thread lifecycle section of Kernel Primer
Adds thread option information. Corrects and enhances information
about the thread's stack area and the spawning of threads.

Change-Id: I881bc448abf0962599eff9c7d32f3760625b3c37
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-31 20:03:50 +00:00
Allan Stephens
1bafb52d85 unified/doc: Mention that a list of items can be added to a fifo
Fifo section now mentions the existence of this capability, and
notes the associated APIs. (Including an example of using the APIs
is not done, since the amount of code needed to show the creation
of the list of data items is significant, and is likely of little
interest to most users.)

Change-Id: I0485cb7d6a35df48a5eab7f6e7a751ddf403625b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-31 20:03:49 +00:00
Baohong Liu
9824608935 samples: pwm: use new API and add rgb led app
Add a new pwm app (rgb led) using the new API.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

To demonstrate the usage of the new PWM APIs, this app
to drive a rgb led is added. It will use the new API
pwm_pin_set_usec().

This app will be located in a new sub directory.

Jira: ZEP-745 ZEP-1029

Origin: Original

Change-Id: If8e5d8ab22dcf8b7cf3665e38949715c61ca9c03
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:02:23 +00:00
Baohong Liu
22a10c3b6c samples: pwm: use new API and add motor control app
Add a new pwm app (motor control) using the new API.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

To demonstrate the usage of the new PWM APIs, this app
to drive a servo motor is added. It will use the new
API pwm_pin_set_usec().

This app will be located in a new sub directory.

Jira: ZEP-745 ZEP-1029

Origin: Original

Change-Id: I65857848e64d0478c4e12d1317b2089cdd1ecf5c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:02:06 +00:00
Baohong Liu
0273ddff24 samples: pwm: use new API and add fade led app
Add a new pwm app (fade led) using the new API.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

To demonstrate the usage of the new PWM APIs, this app
to fade led is added. It will use the new API pwm_pin_
set_usec().

This app will be located in a new sub directory.

Jira: ZEP-745 ZEP-1029

Change-Id: I8d929a21f7de88307c47b52f98f131e00b2fdbe7
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:01:28 +00:00
Baohong Liu
e1db5f2019 samples: pwm: use new APIs and rename the app
Replace existing APIs which will be deprecated by
the new API in this app and rename the app.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

Since the two existing APIs (pwm_pin_set_period and
pwm_pin_set_values) used by this app will be deprecated,
this change is to replace them with the new API
pwm_pin_set_usec().

To demonstrate the usage of the new PWM APIs, more apps
will be added. All the apps will be located in their own
sub directories. The existing app is actually one to
blink LED. So, it is moved the "blink_led" sub directory.

Jira: ZEP-745 ZEP-1029

Change-Id: Icc3fbf6b6c25db9590c63bc08f40ec62c87c0f16
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:01:05 +00:00
Baohong Liu
8ecfcc8ca4 pwm: qmsi_shim: implement pwm driver required by new APIs
Implement qmsi shim driver based on the new API interfaces.

Recently, a RFC was sent and discussed on the re-design of
PWM interfaces. A API change was already posted.

The API new design will deprecate all existing APIs and three
new APIs will be added. The new APIs are pwm_pin_set_cycles,
pwm_pin_set_usec and pwm_get_cycles_per_sec. Pwm_pin_set_cycles
and pwm_pin_set_usec will rely on two driver functions to set
the period and pulse width. This change is to implement the
driver functions pwm_qmsi_pin_set and pwm_qmsi_get_cycles_per_
sec.

Jira: ZEP-745

Change-Id: I39bb973f8c5b19cb7dbd496d10e7f0b6735efc12
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:01:05 +00:00
Baohong Liu
56e0b53c6e drivers: pwm: re-design pwm API interfaces
Re-design the pwm API interfaces. A RFC was sent and discussed
recently on the re-design of PWM APIs.

APIs like pwm_pin_set_values, pwm_pin_set_period, pwm_pin
_set_duty_cycle will be deprecated and replaced by the new
APIs pwm_pin_set_cycles and pwm_pin_set_usec.

A new API pwm_get_cycles_per_sec will be added to get the
clock rate for pwm pins.

The API pwm_pin_set_phase will be deprecated(it always sets
the phase to zero).

The API pwm_pin_configure will be deprecated since it is not
doing anything for most of the platforms or it can be moved
to device init function for the other platforms.

All the pwm_all_xxx APIs will be deprecated. If necessary,
user or an app can set the pins individually.

Jira: ZEP-745

Change-Id: Ie7095df2a67cff08873b59794812ac64ee00c1c2
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:01:04 +00:00
Anas Nashif
4d090e09d6 usb: move usb subsystem to subsys/usb and cleanup header inclusion
Change-Id: I5bdfd2cf5fee62af2ca772d778477f4f378a6a55
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 19:21:42 +00:00
Peter Mitsis
5f8fa677b5 unified: Fix boot_time nanokernel benchmark
Enables boot time timestamps for unified kernel.

Also Splits the source code into microkernel and nanokernel versions
instead of having common code. Not only does this make the code for
each project easier to read, but it also easily allows the nanokernel
version to link against the correct version of main().

Change-Id: Ie0afa2272c3347ebdacc0e3daeebbfe9583fe596
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-31 17:06:26 +00:00
Ricardo Salveti
8891d969f4 boards: Add support for the RedBear nRF51 BLE Nano board
Board uses nRF51822-QFAA, with 16kB of RAM and 256kB of flash.

Change-Id: I92b543022ae6103683cc9e16b925508fb3cf7db1
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-10-31 15:59:41 +00:00
Anas Nashif
fe5f1a51c6 grove: lcd: convert to a unified kernel application
Some minor cleanup and rename of c file to main.c

Change-Id: I8635c9c044f194c5527cd696e9065656403d10c4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 15:15:57 +00:00
Iván Briano
0094ab228d ext qmsi: Update to QMSI 1.3 release
Update the QMSI drop we maintain in Zephyr, and fix the build where
needed:

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

Change-Id: I459029ca0d373f6c831e2bb8ebd52402a55994d1
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-10-31 13:26:06 +00:00
Inaky Perez-Gonzalez
b74d7aa9bd testcases: catch 'Fatal essential task error" messages
When a serial port spews this, the test case should be mardek failed
inmediately.

Change-Id: Idb45ebce07d1eacc9a75bc6fcafa92939c447f8e
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-10-31 12:57:28 +00:00