Commit graph

42249 commits

Author SHA1 Message Date
Peter Mitsis
fc8b2a2064 arm float: Save and load FP registers
Saves and loads the non-volatile FP registers (s16-s31) when switching
between threads.

Change-Id: Ib3190452d9a70d722032ac83176eb4fbb92aca3d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-06-29 20:34:20 +00:00
Peter Mitsis
017dff9d7d arm float: Add FPU structures and fields to the SCS
Change-Id: I053267549ee73f17a73c8eeb6df3b716ab136e03
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-06-29 20:33:32 +00:00
Peter Mitsis
65f1c0c10a arm float: Add preemptive FP regs
Adds the preemptive floating point registers to the ARM's thread
control structure.

Change-Id: I65fbee6303091ce0658bbc442c4707d306b68e92
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-06-29 19:49:34 +00:00
Peter Mitsis
d5709b6c92 arm float: Update exception stack frame structure
Updates the exception stack frame structure to include floating point
registers.

Change-Id: I0fef784cf4d91dda245180abd75bfd9221825fba
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-06-29 19:47:59 +00:00
Szymon Janc
9c68fd4e5b Bluetooth: Add priority buffer for handling critical HCI events
Command Status, Command Complete and Number of Complete Packets are
used for driving TX fibers (HCI and connection). Missing any of
those event will lead to HCI traffic stall.

Priority pool will be used when critical HCI event is received
or normal pool runs out of buffers. The difference with priority
pool is that buffer from it must not be passed to RX fiber and
must be freed from bt_recv.

If driver knows HCI event opcode before requesting buffer for event
it may hint HCI core about preferred pool selection.

Change-Id: Iad14724945bb59721c5ffb6b62d5a8a3e3f70be7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-06-29 14:51:51 +00:00
Javier B Perez
930669b840 samples: drivers: current_sensing: update tags testcase.ini
Updated tags to sensors in testcase.ini inside current_sensing sample.

Change-Id: Id2d5bfcbb1299ed6b1e386f774de46714669bf14
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-29 05:43:30 +00:00
Vinicius Costa Gomes
28b79191d4 build: Fix not allowing the host tools to be crosscompiled
There are situations that the host gcc is not able to generate x86
binaries, in those cases, the user should point HOSTCC to a binary able
to generate the correct type of binaries.

This also allows './scripts/sanitycheck' to be run in systems where the
build tools are prefixed by default.

Change-Id: Id1fc247f8a820e19bb3d4e8119634f8300e7ebac
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-06-29 05:37:58 +00:00
Dmitriy Korovkin
2e8e3088e8 atmel_sam3: Do not switch off CPU clock if debugging is planned
at91sam3 supposed to go to Sleep mode and stop the CPU clock
(HCLK). It leads to JTAG problems. In order to be able to use
JTAG, we need to keep CPU clock on. This is achieved by
switching to Wait mode and keeping external main clock.
Since Wait mode switches off automatically Fast RC Oscillator,
but keeps external clock untouched.

Change-Id: Ife37a7691c3cbdf434e560725a71d419adafe054
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-06-29 05:36:48 +00:00
Sergio Rodriguez
23430bfa83 pwm: Create API to use time units.
This will allow the capable drivers to add arbitrary duration
to the PWM cycles

Jira: ZEP-69
Change-Id: I688b3aa5c1f93e4ed81eab994c13696608ab609a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-06-29 05:33:48 +00:00
Andrew Boie
31196d78aa nios2: add config option to include reset vector
Change-Id: I0e6257f30eb2ca778c094c0faa3721dc62e18d86
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 05:23:56 +00:00
Andrew Boie
6539fbd453 toolchain/common.h: remove comment
4 is the correct value for this arch, the CPU will freak out
if functions aren't 4-byte aligned.

Change-Id: I3d6742516cb323680ab1f9fe7b1a88de1fbf1fae
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 05:23:55 +00:00
Andrew Boie
7511a4f606 nios2: exceptions: remove remaining muldiv references
We are not going to handle unimplemented math instruction
exceptions at runtime. Remove remaining comments and exports
related to this. We don't need to leave a gap in the exception
stack frame for it either.

Change-Id: I4f1f3980a0e43bbf6f2f7488a9182f7acb06be05
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 05:23:55 +00:00
Andrew Boie
e7041e98f8 nios2: exceptions: use computed offsets
Before we were hard-coding them in the assembly file. Makes it
easier to alter the layout of the struct.

Change-Id: I619dc67c68ff87fe60de429a69b2f604292d270c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 05:23:55 +00:00
Andrew Boie
c2ca9e609c nios2: fix debugging output
The faulting instruction was off by 4 bytes and we weren't printing
the exception cause code properly.

Change-Id: I86f4320c7be43dca96940186def56aa5e47bc49f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 05:23:55 +00:00
Andrew Boie
2de74a93ea nios2: properly set NANO_ESF pointer for _Fault()
We want to pass along the stack pointer, not dereference it.

Change-Id: I554eff316bffe50654942746e7960b561abb413b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 05:23:54 +00:00
Andrew Boie
a0464b802b nios2: implement thread monitor
Pulled from the ARC implementation. Tested via
test_obj_tracing.

Change-Id: I858e89cc9187f99539b362ade8098b3606d31464
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 05:23:54 +00:00
Tomasz Bursztyka
83c82e6cd6 tests: Allow tc_util to use printf when requested
printk() is too simplistic and does not handle byte precision on formats
like %02x etc... printf does, so letting the possibility to use it when
relevant. This might be useful when dumping out some network packets,
byte by byte where a precision of 1 byte (thus 2 0's) is necessary.

It's better to have this output:
	41 d8 ...
instead of:
	00000041 000000d8 ...

Change-Id: Idc15bbae67830f41388373e2ca1947bb274fb550
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-06-29 05:19:26 +00:00
Ramesh Thomas
288305739a fs: [WIP] Pull in open source FAT FS implementation
This implements the top layer of the FAT FS. It exports an user API
that would be abstacted by Zephyr FS API. It has another set of API
to interface with a bottom layer that would provide platform specific
file systems. A flash file system will be implemented for the bottom
layer.

Jira: ZEP-285
Origin: ELM Chan
URL: http://elm-chan.org/fsw/ff/00index_e.html
Change-Id: Id7c99dbdac9612b1a597bd8099b8a528824afae9
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-06-29 05:17:57 +00:00
Rohit Grover
8191ba6c07 doc: fix API name in sample code
Change-Id: Idcf36fcdf8f34d31aad43ec7bd880af1623d1749
Signed-off-by: Rohit Grover <rohit.grover@arm.com>
2016-06-29 05:09:49 +00:00
Mariusz Ryndzionek
c8a589e06e sensor: add driver for TMP112 temperature sensor
Add device driver for the TMP112 I2C temperature sensor

Datasheet:
	http://www.ti.com/lit/ds/slos887d/slos887d.pdf

Change-Id: I08208204cd8f377dc65378aaf2b92c7cdefe8d2b
Origin: Original
Signed-off-by: Mariusz Ryndzionek <mariusz.ryndzionek@firmwave.com>
2016-06-29 05:09:11 +00:00
Bogdan Davidoaia
4f80a44b1b sensor: add driver for HMC5883L magnetometer
Add driver for the I2C-based Honeywell HMC5883L magnetometer.

Datasheet:
	https://cdn-shop.adafruit.com/datasheets/HMC5883L_3-Axis_Digital_Compass_IC.pdf

Change-Id: I9ad56a7533d8d67402aa2ae2862ba339b04d3525
Origin: Original
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-06-29 04:58:44 +00:00
Evan Couzens
9a2d8b7e29 doc: Moved Quark D2000 CRB info to wiki.
Moved the Quark D2000 CRB information from
quark_d2000_crb.rst to the Zephyr wiki.

Change-Id: I62b6970633570c6af2d8d946d5621b032ff10467
Signed-off-by: Evan Couzens <evanx.couzens@intel.com>
2016-06-29 04:56:01 +00:00
Kuo-Lang Tseng
e505c89109 driver: uart: shim driver changes to reflect qmsi changes
QMSI uart driver has removed qm_uart_get_config API. Updated
the shim driver to use alternatives.

Change-Id: I3ccfd0dfec3711d250de7d1004275d9b02d7477a
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-06-29 04:55:06 +00:00
Andrew Boie
8616dad7eb nios2: fix QEMU arguments
The extra and redundant -serial was casuing issues, remove.
Pass -nographic to work around issues with the experimental QEMU
builds.

Change-Id: I3102fe026a56781d5c4fb20acaa519af368f8a41
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:22 +00:00
Andrew Boie
e697621371 qemu: pass -serial stdio instead of -serial mon:stdio
You can now exit out of QEMU using Ctrl-C, and this resolves
some issues where the terminal could get messed up if QEMU
terminates abnormally.

Change-Id: I94ca66333bf9035e3627f28bbd2c152cf981a13f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:20 +00:00
Andrew Boie
f27bb0ae35 qemu_nios2: enable XIP by default
Increases our testing coverage.

Change-Id: If93f0190ddd94f120c567707c472d6a8eda06b62
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:18 +00:00
Andrew Boie
96a9ae3a41 nios2: thread.c: don't include timeout_q.h
Unnecessary and generates build errors for microkernel.

Change-Id: I678f44aa2b68c8f8954c78e7828e534f0c1f4215
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:17 +00:00
Andrew Boie
543aa77392 nios2-qemu: fix CONFIG_XIP
It's all RAM, but we pretend the range 0x410000 - 0x420000
is the "ROM" region, and stuff gets copied into RAM starting
at 0x400000.

Change-Id: Idf6bd603e2552593f588cf6130ee4da946bcf5a3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:15 +00:00
Andrew Boie
a7b54980bd nios2: set appropriate compiler flags for math support
Nios II CPUs vary in configuration on whether they support
'mul', 'mulx', and 'div' family of instructions. The compiler
can be told to use GCC integer library routines instead if
needed.

Ideally we would just pull the configuration out of system.h,
but pulling include file #defines into the Make environment
will involve some build system work that is best left to a
later improvement.

We've decided to take this build-time approach rather than
handle unimplemented instruction exceptions, so remove the
hook in exception.S

Change-Id: I05be0d5ed4c1a49b23dca1550ee66fd5891044d2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:14 +00:00
Andrew Boie
ab5f6de4af test_context: build/run on ARC and Nios II
Change-Id: If3e03fef8ed9448bdba82b442ac976bfd6a7ddce
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:13 +00:00
Andrew Boie
fda3bc1c8c nios2: _Swap(): optimize irq unlock
If the CPU lacks certain features the only writable bit in the
status register is the PIE bit, so just write the saved value back.

Change-Id: I91537ff640aa9977d19587c4b0ae414028752341
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:11 +00:00
Andrew Boie
69abfbdc9b nios2: remove stub build workaround
No longer necessary as all the stubs which didn't use their
parameters have now been implemented.

Change-Id: I0ab3f024431426fbdac6d17de21e9c7338879f6e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:09 +00:00
Andrew Boie
30db3401e8 nanokernel: tests: increase stack size from 256 bytes
A recent change modified the fiber stack size of these tests
to 256 bytes, which causes a stack overflow on Nios II. (This
arch has lots of registers)

Increase to 384 bytes, which still compiles well on RAM-constrained
targets like Quark SE SS, Nucleo, etc.

Change-Id: I2152ea9fc1fac693638b8f7a00a6b6628e0c42d3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:08 +00:00
Andrew Boie
8a8a2928e5 nios2: implement fiberRtnValueSet()
The return value of _Swap() is often treated as a "don't care" value and thus
often ignored. However, there are cases when it is desirable to have a
meaningful return value. This meaningful value can be assigned via
fiberRtnValueSet(). To that end, a new field has been added to the coop
register struct to store this value for when _Swap() needs to return that
meaningful value.

Change-Id: Ic4967fa7d602850c09ebde18e8bfd4c97cda9ec8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:07 +00:00
Andrew Boie
885e9084a8 nios2: _IntLibInit(): fix comment
Change-Id: I9cfee87ed3ba5fadba60c197a44b38a0dc75720f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:06 +00:00
Andrew Boie
148924827d sanitycheck: build for qemu_nios2 target
Change-Id: Ibb1c831a49440b0273316fad2f15b7dbe2002d50
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:05 +00:00
Andrew Boie
2ecb9d45d5 test_irq_offload: unit test for running functions in IRQ context
This is used in many other test cases. However when implementing this
function it's helpful to have a testcase dedicated for it, without
dependencies on other kernel objects.

Change-Id: I66a7cdd0b13712665384d5ad4e79050c82d32e3a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-28 15:56:05 -07:00
Andrew Boie
d4a209d484 nios2: implement irq_offload()
For this implementation, the presence of a value in global
_offload_routine signifies to the exception code that we should
enter the IRQ handling code even if there are no bits enabled
in ipending. The 'trap' instruction gets us into the exception
handling code.

Change-Id: Iac96adba0eaf24b54ac28678a31c26517867a4d2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-28 15:56:05 -07:00
Andrew Boie
99b2866ed2 nios2: implement _IS_IN_ISR()
We check to see if the stack pointer is somwhere on the
interrupt stack.

Change-Id: Ic9d21e9f03476b9c8955c44cbfa2e61dd1daed22
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-28 15:56:05 -07:00
Andrew Boie
be13e26586 build: add 'qemugdb' target
This new target works much like 'make qemu' but fires up a local GDB
server on port 1234 and pauses execution

Change-Id: I87fd174c66dcc9f2f43b5b1204cc5c34f741622d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-28 15:56:05 -07:00
Andrew Boie
54b58827b0 test_intmath: new Nios II test case for integer math
Not all CPUs implemement the mul, div, or mulx instructions. Ensure
that any runtime handling of these works correctly.

Change-Id: I50426bd5704cd913f290c9677d1760d53c9e4b56
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-28 22:48:28 +00:00
Andrew Boie
0b98056350 _nios2_read_sp: fix register read
We were reading et and not sp.

Change-Id: I064e8bebf2107f1900d31c213e7752e1aaead2ca
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-28 22:46:02 +00:00
Luiz Augusto von Dentz
e9083dfcd7 Bluetooth: GATT: Add flags to attribute write callback
This adds flags parameter to write callback which can be used to indicate
that data only need to be prepared with use of BT_GATT_WRITE_FLAG_PREPARE
fixing qualification tests that needs to check authorization or other
errors that cannot be verified with just the permissions.

Change-Id: I3d662b2027718ffb52a280e3bbc9750be14f89ae
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-06-28 17:36:08 +03:00
Luiz Augusto von Dentz
ad8066404f Bluetooth: GATT: Use enum to declare permissions
This makes it easier to document and more aligned to other parts of the
API that do make use of bitfields.

Change-Id: If1ff89d653537d854a4f788bf845d2ab6fe5bc23
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-06-28 17:11:29 +03:00
Mariusz Skamra
22f3baac91 drivers/nble: Fix included services
This fixes the regression of included services in nble.
Because user_data of BT_GATT_INCLUDE_SERVICE points to the first
attribute of service to include, and the bt_gatt_attr_read uses
memcpy, the pointer to pointer is needed to copy the address contained
in user_data to the buffer.
With this patch, included services work on nble as well as Zephyr.

Change-Id: If360014675c399fafc365185d5c1e41c913c8109
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-28 11:01:44 +02:00
Mariusz Skamra
c474a03c58 Bluetooth: tester: Fix copying attribute to the server_buf
BT_GATT_INCLUDE_SERVICE user_data shall point to the service declaration
of service to be included. So user_data_len shall be set to 0 to avoid
copying the contents of bt_gatt_attr to the server_buf, and just use
pointer to the actual attribute.

Change-Id: Id770daeb6d64644c51f2bc5d3962dd80363ec8c3
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-28 10:57:44 +02:00
Andrei Emeltchenko
437c0e18e3 Bluetooth/shell: Add HRS simulation to btshell
Add HRS simulation to shell allowing to switch on / off HRS simulation
helping testing GATT notifications.

Change-Id: Idf99b74ac73d45d2f0d3279d50431be4027fef8a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-06-27 18:43:44 +00:00
Jaakko Hannikainen
51e517c08b net: contiki: Fix compiling with ipv4
ip_buf_sent_status is only available for TCP, but uip_send_udp is only
called for UDP. Remove the else block.

Change-Id: I9695b33f975042ec15fde718d91ab901617437f2
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
2016-06-27 11:46:50 +00:00
Jaakko Hannikainen
0616c2679b net: initialize ip_buf_len when receiving packet
When udp_packet_receive is called, ip_buf_len is set 4 bytes too big.
This ends up with the client program receiving 4 bytes more than the
board actually received. Initialize it correctly alongside other values.

Change-Id: I0012aa7e8c6a440a618dfa03c4fdc2b898d592fc
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
2016-06-27 11:46:50 +00:00
Luiz Augusto von Dentz
70afc2c7ae Bluetooth: GATT: Use BIT macro to declare permissions
This way it is easier to understand what bits are being set.

Change-Id: I17cbcc8adcbacb32d20142b557060759e5b7cd81
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-06-27 11:29:54 +00:00