Commit graph

41120 commits

Author SHA1 Message Date
Andrei Emeltchenko
a314368aac drivers/nble: Increase debug for NBLE
Change-Id: I92fca3a8d28aa29f31d0c448b6b9bc9931ce2118
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-06 17:05:40 +03:00
Andrei Emeltchenko
a52d7d7fe0 drivers/nble: Update RPC to Nordic BLE to 0509
Update RPC following major RPC update in firmware.

Change-Id: I4094b94319359a59164ac69394937ac1472b8cbe
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-06 11:28:34 +00:00
Chuck Jordan
68c4555b59 test: fix a comment
Some comments were edited.

Change-Id: I76c2763a98d1141c03ce684dd31683701b74f2d8
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-06 11:19:05 +00:00
Chuck Jordan
02c7eaa173 arc: improve code-density by using ld_s and st_s with r0-r3
Code size can be reduced by replacing ld and st
with ld_s and st_s (if target registers are r0-r3).

Change-Id: Ia70f0aff07fe41a0cfeff2d59dcdadf7c88e1ae8
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-06 11:18:27 +00:00
Chuck Jordan
3545672e57 arc: can use small-variant instructions to load/store %r13
code-size optimization to use small-variant loads/stores with %r13w

Change-Id: Ic9b2b7744f7d465bccb1e59f64e621985ae7d04d
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-06 11:18:27 +00:00
Benjamin Walsh
f1e90a295c benchmark: fix sema give/take test
This test has been broken since we've moved from object IDs being
small integers to pointers. The problem was two-fold:

 - The semaphores are not put in a an array anymore, and are thus not
   necessarily referenced. The linker drops them in that case.
 - The semaphores are not necessarily allocated in memory in the order
   they are defined in the mdef file. On x86 actually, they are
   allocated in the reverse order.

There was no need anyway of having all those semaphores: the microkernel
semaphore is a counting semaphore. It can thus simply be given a number
of times anre taken the same number of times to operate on it a
reasonable amount of time to take a measurement.

Change-Id: I67c82cb7eb03d28906f8c63717db8f951818be5e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-05-05 22:54:49 +00:00
Chuck Jordan
77286b3143 arc: Set __start entry point to be same as __reset
There is a BUG here in that the alias for __start was
aliased to the start of the vector table. Yet, on ARC CPUs,
the vector table CANNOT be the entry point, because there
is no code in a vector table. Only addresses appear in each vector.
Thus, the reset vector, at offset 0 in this table, is a raw address.
The top Makefile in zephyr sets the lable __start to be the entry point
like this: -e __start. Debuggers, for example, use this entry point
to know where the first line of code is.

Also, in KConfig, there were duplicate NSIM blocks. One has been
removed.

Change-Id: I480be7d338a8b45b8ea6ef3f55ac2e6c43829452
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-05 22:12:56 +00:00
Vlad Dogaru
77850daf11 sensor: sx9500: fix compile error
Looks like this snuck in with the GPIO API migration.

Change-Id: Ib58142e134a779431bacf9ca75a66541bf63d5b0
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-05 19:06:16 +00:00
Mariusz Skamra
22fa025157 Bluetooth: Minor fix missing format specifier
Sample output:
Include 3f54 found: handle 00000021, start 00000040, end 00000045
Include 477a found: handle 00000041, start 000000a0, end 000000a2

Change-Id: I44ef1c5c956d0ff81c08b9f447df676cac8185b8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-05 17:23:49 +00:00
Anas Nashif
aaa508a2f8 tests: build using newlib also on ARC
A recent issue due to a change to ARC was not caught because we
do not build on ARC. Now that we have libc with ARC toolchain,
built for all arches.

Change-Id: I8c9b7d37802cb582dcb50e6c61d040078d8ecd26
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-05 14:08:50 +00:00
Bogdan Davidoaia
c2216c7088 libc: newlib: fix RAM config names for ARC
The RAM config symbols need to be updated as they were named by the
commit:
	1a1f7fd arc: make SRAM/DCCM values configurable

Change-Id: Ieeb06de2f77b4c9e10a0bc32d8318834ce150f5e
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-05-05 14:08:50 +00:00
Szymon Janc
c3d71b5414 Bluetooth: Don't update responder for master role connection
Both initiator and responder addresses are already set during
connection creation so there is no need to set responder address
again.

Change-Id: Id477a9e6dd2244c57126d1f985aa41cd1b04650b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-05 14:30:15 +02:00
Szymon Janc
e3013e8ced Bluetooth: Add new conn on LE Connection Complete only for slave
New connection needs to be added only for slave role. For master
connection object is created when LE Create Connection is send.

Change-Id: I24dbfc4b3a647ea230b199fbec09940f486b983f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-05 14:30:15 +02:00
Szymon Janc
a14c932d91 drivers/nble: Fix setting SCAN_RSP data twice
set_ad() already checks for length==0 so there is no need for
checking if sd is valid.

Change-Id: Idc0ce9135eca56a1e8057f3a2129adb0b5e5ddd7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-05 12:19:36 +00:00
Vlad Dogaru
149decdcf5 sensor: bmg160: fix compile error when not using trigger
Change-Id: If681ace87439daf6e6aa0ad70ac79a19827a2e73
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-05 12:00:20 +00:00
Chuck Jordan
4f07126496 samples: shell now emits a banner
It is useful to have the shell emit the zephyr version number.
Output looks like this:
  Zephyr version 1.3.0
  shell>

Change-Id: I2608272564a5d2fe39f263c420a897d845457a98
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-05 11:24:30 +00:00
Vlad Dogaru
1cbfbe8426 checkpatch: Remove Change-Id warning
There seems to be no way to configure it, so I've just removed the code.

Change-Id: I35341e8afc0bdfa8b953b833cfb0eecf05b81c16
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-05 11:24:06 +00:00
Chuck Jordan
48e1749721 kernel: _MOVE_INSTR needs to be defined for CONFIG_ARC
In order to build test/kernel/test_stackprot/microkernel for the ARC,
the _MOVE_INSTR needs to define what the move instruction is for this
target.

Change-Id: I087cc5baa4c41297ce52323556e94aab424aa891
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-05 00:06:03 -07:00
Andrew Boie
8b4e0a957e doc: update installation to add PLY library to Python3
Change-Id: I324cb5c369da84139ffb49b150d75ade09325554
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 22:57:40 +00:00
Andrew Boie
0c4590d252 test_tickless: improve testcase.ini filter
The filter specification now matches the code. We can run on any x86,
or those ARM boards where the test's timestamp.c has _Timestamp*
implementations.

Change-Id: Ib81e5379f892beb3783dd3c345cd536c883a74de
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 22:57:39 +00:00
Andrew Boie
3ea7892410 sanitycheck: allow for more expressive filtering in testcase.ini
The old 'config_whitelist' directive in testcase.ini has been removed.
We use the new expr_parser module to parse a 'filter' directive which
is a boolean expression. This gives a great deal more flexibility
in how tests can be filtered.

To keep the tree bisectable, use of config_whitelist in testcase.ini
converted to the new expression language.

Change-Id: I0617319818c5559c0f0569d2fa73d09b681cac51
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 22:57:39 +00:00
Andrew Boie
b4efd548f9 expr_parser.py: simple expression language
Sanitycheck will use this to allow for much more expressive
conditions when filtering test cases based on defconfig values.

Origin: Original code
Change-Id: Icb650a2aa383699e4f2e18f66e853279c02b50e5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 22:57:39 +00:00
Arkadiusz Lichwa
b670ddaeec scripts/sysgen: Fix indentation inconsistency
scripts/kconfig/conf --silentoldconfig Kconfig
  Using /home/<user>/zephyr.git as source for kernel
  GEN     ./Makefile
  CHK     include/generated/version.h
  UPD     include/generated/version.h
  HOSTCC  scripts/gen_idt/gen_idt.o
  HOSTLD  scripts/gen_idt/gen_idt
  CHK     misc/generated/configs.c
  UPD     misc/generated/configs.c
  CHK     include/generated/offsets.h
  UPD     include/generated/offsets.h
  CHK     misc/generated/sysgen/prj.mdef
  UPD     misc/generated/sysgen/prj.mdef
  File "/home/<user>/zephyr.git/scripts/sysgen", line 461
    kernel_main_c_out("extern int %s(int event);\n"% (event[1]))
                                                               ^
TabError: inconsistent use of tabs and spaces in indentation
/home/<user>/zephyr.git/./Kbuild:51: recipe for target 'misc/generated/sysgen/kernel_main.c' failed
make[3]: *** [misc/generated/sysgen/kernel_main.c] Error 1
/home/<user>/zephyr.git/Makefile:904: recipe for target 'prepare' failed
make[2]: *** [prepare] Error 2
make[2]: Leaving directory '/home/<user>/zephyr.git/tests/bluetooth/shell/outdir'
Makefile:169: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/home/<user>/zephyr.git'
/home/<user>/zephyr.git/Makefile.inc:63: recipe for target 'all' failed
make: *** [all] Error 2
make: Leaving directory '/home/<user>/zephyr.git/tests/bluetooth/shell'

Change-Id: Id6dbf7ef1c0b95a68cf4265465a0124c16e6f971
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-05-04 22:51:56 +00:00
Peter Mitsis
46e6c6f8cb microkernel: lock interrupts in _k_state_bit_[re]set()
Locks interrupts in the microkernel routines _k_state_bit_reset() and
_k_state_bit_set(). This is a necessary pre-requisite for allowing
microkernel objects to pend on nanokernel objects since that feature
will require the manipulation of the microkernel queues in the context
of an ISR as well as the kernel server fiber.

Change-Id: I2d263707e0d3aed75bba971df878daa3d7ae1d11
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:35 +00:00
Peter Mitsis
59c21a5f62 microkernel: Fibers and ISRs may invoke microkernel no-op
Adds support that allows fibers and ISRs to invoke the microkernel
no-op kernel service request. This is useful for cases when the
nanokernel needs to invoke the microkernel task scheduler.

Change-Id: I1f4b2a39ac6b5e44bb1b6c6b3cd6034262bbada8
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:35 +00:00
Peter Mitsis
e53c1851e9 nanokernel: Fix nanokernel object timeout recalculation
Fixes the timeout recalculation in the following routines:
	nano_task_fifo_get()
	nano_task_lifo_get()
	nano_task_sem_take()
	_nano_task_sleep()
Without this fix, a task that called one of the previously listed
routines could in theory sleep/wait up to almost twice the requested
timeout.

Change-Id: I53196be84e65874e94a62d5b0be1b7aaaaeda91f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:35 +00:00
Peter Mitsis
542c37fe9c device: simplify synchronization
Takes advantage of the fact that microkernel tasks can now wait on
nanokernel objects to simplify the device synchronization code.

Change-Id: I5b8d21eaccde9db8b63dd906ef982494a6170271
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:34 +00:00
Peter Mitsis
2cac7eea6a tests: Pend microkernel tasks on nanokernel objects
Adds a test for pending microkernel tasks on nanokernel objects.
This explicitly covers the nanokernel FIFOs, LIFOs and timers
while implicitly covering nanokernel sempahores.

Change-Id: Ic044b731da13dea337e199499c23ea425056fae4
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:34 +00:00
Peter Mitsis
1cbc9089ee nanokernel: [un]block tasks on nanokernel objects infrastructure
Adds the nanokernel infrastructure to permit microkernel tasks
to block/unblock on nanokernel objects. Multiple tasks may wait
on a nanokernel object's dedicated task wait queue.

It is important to note that when data is posted to the object
all the tasks on that object's dedicated task wait queue may be
woken up but the data is not immediately given to any of the tasks.
This is done to maintain consistent behavior with the nanokernel
as in a nanokernel system, fibers are given preference in both
waiting on and getting data from a nanokernel object.

Change-Id: Ia5c7f21ae59a367d9fec23dafc3a918d9e767db5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:33 +00:00
Peter Mitsis
4ce3c0004b microkernel: [un]block tasks on nanokernel objects infrastructure
Adds the microkernel infrastructure to permit a microkernel task
to [un]block on a nanokernel object. Unlike tasks that [un]block
on microkernel objects, the work for [un]blocking tasks on nanokernel
objects will not always be done in the kernel service fiber. One of
the repercussions of this is that in many cases the microkernel task
scheduler must be explicitly invoked (by issuing a no-op kernel
service call).

Origin: Original
Change-Id: I2b145668cef142a7a4034e191116fcb344a9b8b3
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:33 +00:00
Peter Mitsis
b58878bb89 kernel: Init back pointer to microkernel task
Fibers initialize this back pointer to NULL as they are (by definition)
not microkernel tasks.  Microkernel tasks initialize it to their
corresponding 'ktask_t'.

However for nanokernel systems, the back pointer is always NULL. This
is because there is only one task in a nanokernel system (the background
task) and it can not pend on a nanokernel object--it must poll.

Change-Id: I9840fecc44224bef63d09d587d703720cf33ad57
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:33 +00:00
Peter Mitsis
8a33d98811 nanokernel: Add back pointer to microkernel task
Adds a back pointer to the microkernel task to the TCS when
configured for a microkernel. This is a necessary prerequisite
to support microkernel tasks pending on nanokernel objects.

Change-Id: Ia62f9cf482ca20b008772dad80cbfd6acb6f5b7a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:32 +00:00
Peter Mitsis
f0948a4cbc microkernel: Add TF_NANO wait flag reason
Adds the TF_NANO wait flag reason to indicate that a task is pending
on a nanokernel object.

Change-Id: Ic20ef79398da7d9118bdf775e22b8f8a31501f7f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:32 +00:00
Johan Hedberg
251f1cbc28 Bluetooth: monitor: Add 32-bit timestamp support
Add support for the 32-bit timestamp (1/10th ms units) extended
header.

Change-Id: I67f481a35be6878605b8c2256f6e4bfb6afe55c8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-04 21:19:49 +03:00
Andrew Boie
68b3b6135e errno: implement _get_errno() in common code
We really should have more faith in the compiler, it generates
code to implement this exactly like the arch-specific assembly
versions, and on ARM is actually 4 bytes shorter.

FUNC_NO_FP used to disable the usual C preamble to update the
frame/stack pointers, which is how the sizes are still the same
or less. It's debatable how useful the occasional use of
FUNC_NO_FP is in practice since it hinders debugging and in a
production build frame pointers should be globally disabled, but
we can address that later.

Change-Id: I6c4b64ab3e3a9b6f91d52fa8c92e6e79a986fc77
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 17:04:14 +00:00
Szymon Janc
2450a56ae5 Bluetooth: Use le_set_rpa in check_pending_conn
This makes code simpler and easier to understand as generating RPA and
setting random address are done in same place.

Change-Id: I1f9ebdf3ee322921258c92f3f1a40d6b7764b2fc
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-04 16:40:06 +00:00
Szymon Janc
ac52cffa32 Bluetooth: Refactor check_pending_conn error handling
If anything went wrong just report connection failed. This makes
code easier to read and less error prone. Also makes sure that
scanning is reenabled with correct parameters on failure.

Change-Id: I7387571f6dbf308511694a635aa47d5371a81616
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-04 16:34:55 +00:00
Szymon Janc
4031d6d160 Bluetooth: Fix connection leak if failed to generate RPA
If bt_smp_create_rpa failed connection object needs to be unreferenced.

Change-Id: Ie1f2905cafbf15db2970c0f07748d016cbe55c2b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-04 16:33:54 +00:00
Mariusz Skamra
20c7f47fc0 drivers/nble: Pass read_params as nble user_data
Getting params from user_data seems to work now.

Change-Id: I81bccea9aa6994d3c09a3ff03a49fa6767e7305e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-04 15:24:00 +00:00
Mariusz Skamra
ec8a92b93a drivers/nble: Fix NULL pointer dereference
In on_nble_gattc_discover_rsp conn->gatt_private is set to NULL prior
to calling this parser functions. This fixes this issue by passing
discover params pointer to these functions.

Change-Id: I6669cb0d16dc65d532e17f96ceb9cd94dbe6ce08
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-04 15:23:39 +00:00
Daniel Leung
aed8ef4d4c microkernel: events: fix undefined function error
The handler of the microkernel events are not declared properly.
This causes the public event objects to complain about
undefined functions. Fix this by declaring the function
before using it.

JIRA: ZEP-85
Change-Id: I68afe777bad66e010c92e637806a48911b2f52f4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-05-04 15:16:55 +00:00
Chuck Jordan
6fd732f780 arch/arc/include: start_task_arch.h needed so ARC can build microkernel apps
Change-Id: Ibf23fb3545f98a4d5ade7640abde4819b95d0b8e
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-04 14:55:33 +00:00
cjordan
42f7741712 drivers/interrupt_controller: initialize only NUM_IRQS interrupts
Change-Id: I33b4d09bc9255ab75bd25ef8938fc37e74e81038
Signed-off-by: cjordan <cjordan@synopsys.com>
2016-05-04 14:55:10 +00:00
Chuck Jordan
822b19ef74 arch/arc: add ICCM_BASE_ADDRESS and ICCM_SIZE
I am working on porting Zephyr to ARC EM Starterkit. This board has ARC 
CPUs with ICCM memories. On quark_se_ss ICCM is missing and ignored.

Change-Id: Ic49fc8ef3e6ad879ffc673b8baf34dd467f76c04
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-04 14:54:54 +00:00
cjordan
9afe58de3e include/arch/arc: fix memory permissions
Change-Id: Ibb77088a7c9095f4725b6a65bc30a1db4220f254
Signed-off-by: cjordan <cjordan@synopsys.com>
2016-05-04 14:54:46 +00:00
Genaro Saucedo Tejada
736bda177b doc: Fixed broken link to development documentation
The fixed link was broken when development documentation started being
hosted at /doc instead of /doc/dev

Change-Id: I3621bf83beb030e7d80f60e1d148cd7311d25cdf
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-05-04 14:54:24 +00:00
Andrei Emeltchenko
6e60fc8d7c drivers/nble: Update RPC function names
Updating function names prepares for firmware RPC update, to this
moment only names changed.

Change-Id: I8d19e83c5c88a4b41ed803e276652eb15e0d87b1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 14:23:17 +00:00
Andre Guedes
ea6eac35bb pinmux_dev: Remove PINMUX_SELECT_REGISTER from quark_mcu driver
This patch removes the PINMUX_SELECT_REGISTER macro definition from
pinmux_dev_quark_mcu.c since it is already defined in pinmux_quark_mcu.h
(which is included by the .c file).

Change-Id: I468cf6a54fc30d681f42a59eb2c8401d2b180849
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-05-04 13:53:00 +00:00
Baohong Liu
e4c1d07477 drivers: pinmux: Implement pinmux pin get API for QMSI shim driver
Add implementation for pinmux pin get API in the shim driver.
It is based on the function from pinmux_dev_quark_mcu.c

Jira: ZEP-189
Change-Id: Ib6673f90cfe8e367fcbd12ed546b1fa3af7e1dbf
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-05-04 13:48:26 +00:00
Tomasz Bursztyka
7cd63abccb ieee802154: cc2520: SPI workaround when QMSI drivers are in use
Current QMSI SPI API does not handle asymmetric tx/rx buffers, and thus
it's up to cc2520 driver to manage the tx dummy bytes.

Change-Id: I97900946bcd8d96e9f039646bccd765c574c363e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-05-04 13:47:17 +00:00