Commit graph

41120 commits

Author SHA1 Message Date
Andrew Boie
0509bf155b qemu_x86_iamcu: new board for QEMU with IAMCU ABI
Many bugs that have taken months to tease out could have been
instantly exposed had we run all our sanity checks on this
ABI.

Origin: Original code or copied from boards/qemu_x86
Change-Id: I6a5038bf99379470c3f736857d104024d3fc7978
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-12 02:24:36 +00:00
Andre Guedes
7633279d4a uart: qmsi: Add support for IRQ APIs
This patch extends the UART QMSI driver so it supports the IRQ APIs from
include/uart.h. The IRQ APIs are enabled by the 'CONFIG_UART_INTERRUPT_
DRIVEN' option.

Differently from others APIs such as I2C and SPI, the UART API is very
low level. For that reason, the IRQ facilities (e.g. irq based transfers)
from the QMSI driver are not useful to the shim driver at the moment. In
order to implement the IRQ APIs we rely on UART registers defined by QMSI.
QMSI UART header is missing some macro definitions from IRR register so
we define them in the shim driver.

Since the IRQ trigger condition is not configurable in the QMSI shim
driver, this patch also changes drivers/serial/Kconfig so the "UART
IRQ Trigger Condition" choice doesn't appear on the menu if the QMSI
driver is selected.

Change-Id: Idf9a0f6a47af2a550a31f474d721068dca989713
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-11 23:55:13 +00:00
Andre Guedes
1de58be866 uart: qmsi: Support for line control and driver command
This patch extends the UART QMSI driver so it supports line control and
driver command APIs.

The line control function supports the baud rate option only (LINE_CTRL_
BAUD_RATE) and, at the moment, the QMSI driver doesn't have any custom
command.

Change-Id: Icc10cb39b4077ed4ccfefb1f0feecec75b79d67c
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-11 23:55:08 +00:00
Andre Guedes
27b548251e uart: qmsi: Add baud rate configuration support
This patch extends the UART QMSI driver so it supports different baud
rate configurations. The baud rate is set per UART controller via
menuconfig. The default baud rate is 115200.

Change-Id: Iad736d72bd309b8a33ab5d538251fce374e89fd2
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-11 23:55:04 +00:00
Andre Guedes
d95d6c63a1 uart: Introduce QMSI shim driver
This patch introduces the QMSI UART driver which is simply a shim driver
based on UART driver provided by QMSI BSP.

This initial version implements only the mandatory APIs 'poll_in',
'poll_out' and 'err_check' which are required by trivial sample apps and
by output functionality from the console driver. The remaining APIs will
be implemented by up coming patches. The driver supports only 115200 baud
rate at the moment.

In order to enable this driver, the following options should be set:
CONFIG_QMSI_DRIVERS=y
CONFIG_QMSI_INSTALL_PATH="/path/to/libqmsi/directory"
CONFIG_SERIAL=y
CONFIG_UART_QMSI=y

This driver has been tested with Quark SE Devboard so this patch also
adds its platform-specific default configuration options to 'arch/x86/
soc/quark_se/Kconfig'.

Change-Id: Ibde1825d4b0349a376a8e7d91cc9de306946b62f
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-11 23:54:59 +00:00
Juan Manuel Cruz
6d040a89ff debug: add task tracing to sanity test
Change-Id: I2d9691d094a764b9e884ef5f7a2700bedcf71745
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:13:43 +00:00
Juan Manuel Cruz
568df1b17d debug: add debug tracing support for task initialization
Change-Id: I3d6ec2364f97b415bc27c0ce36df289e8eae9397
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:13:30 +00:00
Juan Manuel Cruz
787b41c8a3 debug: adds object tracing capability to microkernel timers
Microkernel timers are defined at compile time as a static list
but they are allocated dynamically in kernel execution.

The object tracing list will only list those timers that are
currently allocated at debug time. For this reason, timers
can be removed from the tracing list at any time.

A very simple double linked list was implemented to reduce the
complexity of the action to remove an item from the list from O(n)
to O(1) and simplify the remove implementation.

Change-Id: Ib7ea718b52e7c719a32b3fa4ff1d7e6b00482c28
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:13:15 +00:00
Juan Manuel Cruz
08ed2fc106 debug: adds object tracing capability to microkernel events
Change-Id: I227fd996fa4046efe48b7383a60d3ac01ec9f946
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:13:04 +00:00
Juan Manuel Cruz
0588da0b4a debug: adds object tracing capability to ring buffers
Change-Id: If3a603e327267b148f6dc042c4afd7d5c978529d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:12:51 +00:00
Juan Manuel Cruz
f240bf18f7 debug: adds object tracing capability to nano stack
Change-Id: I0a13741a0b250fa587293936110291a4e6eec809
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:12:26 +00:00
Juan Manuel Cruz
d151776e59 debug: thread monitor allow to access more thread information
The thread monitor allows to iterate over the thread context
structures for each existing thread (fiber/task) in the system.

Thread context structures do not expose thread entry information
directly. Although all the information can be scavenged from memory
stacks. Besides, accessing the information depends on the stack
implementation for each architecture.

By extending the tcs we allow a direct access to the thread
entry point and its parameters, only when thread monitor is
enabled.

It also allows a task to access its kernel task structure
through the first parameter of the thread.

This allows a debugger application to access the information directly
from the thread context structures list.

Change-Id: I0a435942b80eddffdf405016ac4056eb7aa1239c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:11:39 +00:00
Juan Manuel Cruz
5f566034e5 debug: object tracing sanity test includes thread monitor.
Change-Id: Ic57ed69374b2075bcdf5cd5d72b83b03b59fbac5
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:10:23 +00:00
Anas Nashif
63ec21c451 Revert "tests: Add test for microkernel early sleep functionality"
This reverts commit b1a0041de6.

This breaks sanitychecks in CI. The early_sleep kernel test case is failing
randomly.

Change-Id: I129b649f7010da90f52616f6fd63eec8b63f8247
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-11 22:09:42 +00:00
Anas Nashif
3d9759c9c5 Revert "sanitychecks: skip early_sleep test"
This reverts commit f9d1d56153.

This breaks sanitychecks in CI. The early_sleep kernel test case is failing
randomly.

Change-Id: I4b21f926198af9f0703f042fc170226ed6ab4331
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-11 22:09:31 +00:00
Anas Nashif
4f9239984f Revert "microkernel: Add support for *_sleep() during initialization"
This reverts commit 0d50329105.

This breaks sanitychecks in CI. The early_sleep kernel test case is failing
randomly.

Change-Id: I015f20699c052b4089076699fc0180945c4d3d16
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-11 22:08:44 +00:00
Juan Manuel Cruz
c15259aca1 debug: expose thread monitor in object tracing header
Exposes the CONFIG_THREAD_MONITOR functionality as part of the
object tracing header.

Change-Id: I2022a580df2cf33e543b980dc9c33b9adca3d3bf
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:07:16 +00:00
Juan Manuel Cruz
83cbf63431 debug: sanity test for kernel object tracing
Adds the sanity test to integrate the kernel object tracing
API. The test implements the philosophers demo and adds
an additional test thread that uses the kernel object tracing
API and test for the correct output.

Change-Id: I2f01f7b3386afd4783ae58b5311eb7d6ee5a3cea
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
Origin: Original
2016-03-11 22:07:15 +00:00
Anas Nashif
f9d1d56153 sanitychecks: skip early_sleep test
Test fails in CI, disabling until we have a resolution.

Change-Id: Ie8e1ca00b08238c2c2a4feefbe08140c762e6d2f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-11 11:40:49 -05:00
Juan Manuel Cruz
caa17577ef debug: kernel's object tracing api
Restructure the kernel's object tracing implementation
to provide a public API that allows debug tools to use
the debug hooks easier and allows kernel developers
to extend the kernel's object tracing scope and include
new kernel objects easier.

The API provides the trace list abstraction to keep track
of different types of kernel objects. The API contains
a simple single-linked list implementation that allows
to save space and simplifies the access to the data for
debug tools such as gdb.

Change-Id: Ic4d393d584576f67f2c5b706e61bae08869debba
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 12:00:07 +00:00
Luiz Augusto von Dentz
f206d86c10 Bluetooth: GAP: Add service sample
This adds a GAP service sample and make use of it in shell test which had
a copy of this code.

Change-Id: I5f03fb7db5349236e41bc30eb884c134136439e3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-11 11:32:13 +02:00
Luiz Augusto von Dentz
ae04454d01 Bluetooth: IPSS: Only register extra services if necessary
If CONFIG_BLUETOOTH_GATT_DYNAMIC_DB is defined it shall be possible for
the application to register any extra service it needs.

Change-Id: I7186f3faf45e9295e0c8b32dce030099a142c500
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-11 11:31:53 +02:00
Luiz Augusto von Dentz
1d523c3faf Bluetooth: IPSS: Move sample service to gatt
This moves IPSS sample code to samples/bluetooth/gatt which shall become
the default place for GATT related samples that can be reused.

Change-Id: I04089f6e43bfcc30ee1c7cc766620f19e3dad08e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-11 11:29:13 +02:00
Vlad Lungu
20a4720b93 net: 802.15.4: Make MAC driver configurable, select nullmac as default
csma MAC driver queues outgoing frames, returning an OK status code immediately.
This defeats logic in sicslowpan fragmentation driver that drops remaining fragments
on send failure. The result is packets reported as sent successfully when they were
not, fragments sent that cannot be reassembled by receiver, packets dropped before
the first fragment even reached the radio driver.

nullmac MAC driver sends frames synchronously, resulting in sicslowpan driver working
as intended.

The MAC driver used by 802.15.4 is selectable now, nullmac is default but csma can be
used instead.

Change-Id: I261d551421a8f55634acb1c528f8f82bea49332d
Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
2016-03-11 07:32:13 +00:00
Jukka Rissanen
efe0d36c7d net: apps: Change echo-client to use common testing header file
Move network testing setup from echo-client to common net_testing.h
file which makes the application much simpler.

Change-Id: Ib1a90b9d87014b7f9adc5f6865ce0fc9faa13422
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-11 07:26:12 +00:00
Jukka Rissanen
ed4f794ac8 net: apps: Change echo-server to use common testing header file
Move network testing setup from echo-server to common net_testing.h
file which makes the application much simpler.

Change-Id: I6f68826916c870ad7db597d30f20245bada70091
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-11 07:26:12 +00:00
Jukka Rissanen
b3c8b5fa19 net: apps: Common routines used in qemu testing
Collect common routines used in every network sample application
into same file. These routines are used when testing with
qemu and slip.

Change-Id: I02f20b3a9bfa1e886846801b22f43a1d06c59930
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-11 07:26:11 +00:00
Jukka Rissanen
ee0734c1a9 cc2520: Generate a mac address in the driver
The driver should read the mac address from the chip but in
case of cc2520, the chip does not have it. So generate a
random mac address for this invocation of the device.

Change-Id: I2d0cf2ee70525e7f5e65da9fb8ceaa1a2dccecdd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-11 07:26:11 +00:00
Johan Hedberg
092289ffb5 flash: Use off_t for offset parameters
Now that the internal libc has the off_t type it's the natural choice
for the offset parameters in the flash API.

Change-Id: I69999999625b46634f6d3008fe1b3f82c17d357c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-11 01:09:56 +00:00
Johan Hedberg
41f8a33555 libc: Add off_t definition
Add definition for the POSIX standard off_t type.

Change-Id: I1142428a3d226d641a8628cbba71cb3ea341ef92
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-11 01:09:56 +00:00
Johan Hedberg
6692e98298 libc: Move ssize_t definition to sys/types.h
There's no need to have a separate file for this, and we'll be adding
other types like off_t here soon as well.

Change-Id: I40629a5a0fba7af44828eaeead294e4e55844bb0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-11 01:09:56 +00:00
Andre Guedes
8337953197 Remove unused macro UART_IOAPIC_FLAGS
This patch removes the macro UART_IOAPIC_FLAGS from Quark SE and D2000
soc.h since it is not used anywhere in the code.

Change-Id: I0fd42fac2f02e8617bd92c73c1a0354ef2d7a71a
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-11 00:15:49 +00:00
Johan Hedberg
a82ed2d905 flash: Reorder data & len parameters
This makes the ordering consistent e.g. with SPI, Bluetooth and
Networking APIs. This also follows the order of parameters in the
POSIX read/write APIs.

Change-Id: I4f11c8c90ccadf176d79f6a7bbd98aac61c26cf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-10 23:29:22 +00:00
Johan Hedberg
d625e920f8 flash: Use size_t & void * for the read/write parameters
size_t is the natural type for any integer that describes a number of
bytes. For the actual data use void pointers to avoid callers having
to do explicit typecasts if the data doesn't originate in a uint8_t
array. Also use a const pointer for writing to avoid typecasts for
data that originates in a const location.

Change-Id: Idbfc14b2d61ca6189411b211c3727f857dbd4059
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-10 23:29:12 +00:00
Andrew Boie
97594df321 iamcu: fix -fstack-protector
One of the tricks that GCC's stack protector does is to stick a
sentinel value on the stack at the beginning of the function, and
check if it is still there when the function is about to return.
However, since this function switches stacks that fails and we get
a stack protector exception before main() even starts.

Change-Id: I2acba8b8c822d7447d8e371bb72603f36e87f54b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-10 23:28:28 +00:00
Iván Briano
4370b5da6c libc-hooks: Provide the 'open()' syscall
Some parts of Newlib, notably the locale handling stuff, will try to
call open(), and if it's not provided, any application that for some
reason is bringing in that code will fail to link.
Having a non-working implementation keeps that code working.

Change-Id: I28345dabb93431d6b80c839b23a46b7f99dc8734
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-03-10 23:28:15 +00:00
Maciek Borzecki
2ca921867d pwm: fix K64 PWM config options dependencies
Fix dependencies of K64 PWM config options so that they do not appear at
incorrect places in the menuconfig tree hierarchy.

Change-Id: Iea8077400a1bdf3ef1c38b3bf45b7a72373bd096
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2016-03-10 23:22:49 +00:00
Jithu Joseph
6182fca156 memory_pool: Refactor code into a helper function
Moves some code from pool_alloc into a helper function,
to avoid code duplication when implementing a pool based heap.

Change-Id: I29b9bc1b8ba166a2187df5ea037aad4d4a522f69
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-03-10 23:19:59 +00:00
Jithu Joseph
9e45411a59 memory_pool_heap: malloc/free access over a heap memory pool
Specifying  HEAP_SIZE keyword in an app's MDEF file, results in
creating a new memory pool, which can be accessed using the
task_malloc() and task_free() APIs, which have the usual malloc/free
like semantics.

Expected format in MDEF file
HEAP_SIZE    <value>

Change-Id: I0569cffeecf8a2c23c20c7b359256123ece91982
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-03-10 23:19:59 +00:00
Benjamin Walsh
7708710229 Revert "arch: arm: set the architecture via Kconfig"
This reverts commit 3f6884902b.

This commit does not work as intended: the part in arch/arm/Makefile
gets ignored and -mcpu=cortex-m3/4 does not get passed to gcc. It seems
that the zephyr toolchain does not care, but the vxworks assembler
chokes if it is missing, and thinks the CPU does not support thumb ISA

Change-Id: I14d11d3e22dac4952bdab3eb9e2d1c36b1a686c2
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-03-10 16:31:26 -05:00
Dmitriy Korovkin
b1a0041de6 tests: Add test for microkernel early sleep functionality
Test verifies that a task_sleep() function can be used during the system
initialization, then it tests that when the k_server() starts, task_sleep()
call makes another task run.

For fibers, test that fiber_sleep() called during the system
initialization puts a fiber to sleep for the provided amount of ticks,
then check that fiber_sleep() called from a fiber running on the
fully functioning microkernel puts that fiber to sleep for the proiveded
amount of ticks.

Change-Id: Ibe20ca1ca966575aaaad0b6ffd66ca43512801f0
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-03-10 18:39:33 +00:00
Dmitriy Korovkin
0d50329105 microkernel: Add support for *_sleep() during initialization
Add support for task_sleep() and fiber_sleep() during the
system initialization. When CONFIG_NANO_TIMEOUTS defined,
before the k_server() starts, kernel uses nanokernel
system clock announce and task sleep functionality.

To give device drivers early sleep functionality, the system
clock has to start on SECONDARY initialization level, same
as most of the drivers.

Change-Id: I5b3cf3da4c8d8398a966e901ab211f2fcee18dd6
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-03-10 18:39:33 +00:00
Andrei Emeltchenko
90697c3e35 drivers/nble: Implement GATT write without response
Implement GATT write without response, no signing yet.

Change-Id: Id676202ab270cf3f0b06ede26dee2f84a9965e09
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-10 16:55:56 +00:00
Andrei Emeltchenko
a8612d5aa8 drivers/nble: Implement GATT write request
Implement GATT write and handle response.

Change-Id: I5f1dd48e12149534d1c7bb0096a5bddc68fd8a0d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-10 16:55:16 +00:00
Shaul Triebitz
d95b3d9118 net: contiki: Fix application layer data offset
The link layer header length isn't always taken into account when
determining the application layer data offset. To avoid potential data
corruption, add the link layer header length where appropriate.

Change-Id: Id718dec8cd5991b561cb13e1304ffdb3dda09da5
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
2016-03-10 16:04:52 +00:00
Andrei Emeltchenko
7e84a00068 Bluetooth/sample: Fix exit after first indication sent
Change-Id: Ia958fa1c1013660e7281dc91e77ea742c753e104
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-10 15:41:00 +00:00
Andrei Emeltchenko
489b0ff793 Bluetooth/shell: Clear subscription on gatt_unsubscribe()
Clear subscription allowing to test subscribe / unsubscribe in
sequence.

Change-Id: Ife8b994410107f05c23687e3fb23b4a81cad8ce7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-10 15:40:36 +00:00
Andrei Emeltchenko
1ec4ec237b Bluetooth/shell: Print handle in hex instead of decimal
Change-Id: Id8654b5c58c3d4f3f157725e550091dd112de4a0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-10 15:40:21 +00:00
Maciek Borzecki
5b1b008661 drivers/adc: fix QMSI ADC config options dependency
Config options 'Clock Radio and 'Serial Delay' appeared out of ADC menu
due to a missing dependency on ADC_QMSI.

Change-Id: Ia1ca0d5a4ea676205a5928689c2adee9e26c2691
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-10 13:28:42 +00:00
Szymon Janc
ab8e7053e2 Bluetooth: Kconfig: Fix max HCI event length if BR/EDR is enabled
Extended Inquiry Result Event is 255 bytes.

Change-Id: Iabd754a85f21998059dfc36935e754ab8a857f54
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-10 12:12:13 +01:00