Commit graph

19237 commits

Author SHA1 Message Date
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
Arkadiusz Lichwa
0e782884a0 Bluetooth: ATT: Add helper for LE ATT channel conversion
Change-Id: I4dec2690924764c29445b788a097828cd8c63ca3
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-27 10:52:35 +00:00
Mariusz Skamra
acc28a9631 Bluetooth: Fix invalid pointer to local variable
attr pointer is local here, so it may be overwritten anytime, because
this attribute user_data will be used out of scobe of this function.

Change-Id: I85b390299980dac213d8ce1939078fe8b242c887
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-27 10:49:09 +00:00
Johan Hedberg
502f4a1581 Bluetooth: Add convenience enum value for no advertising options
This makes the code be a bit clearer by letting it specify a more
descriptive value than '0'.

Change-Id: I2e6b46f0924581d0d13f13479aa15170cc9e0e70
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-27 11:09:51 +03:00
Johan Hedberg
fbb2fe8acf Bluetooth: Make random number generation API public
Applications or higher level profiles that are not part of the core
Bluetooth stack may need an easy way to generate random numbers. Since
we already have an internal helper for this export it for others to
use as well.

Change-Id: I29af7cab30ad8f60d481bc847984e781eaecd6bf
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-27 11:09:51 +03:00
Javier B Perez
908926ce36 gen_offset_header: resources leak in pTable
Fixed resources leak in pTable when the lseek command
fails.

Change-Id: I414276399b0d0ca3dee0c18d307ccc2035d66198
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-24 20:46:13 +00:00
David B. Kinder
2a4d461773 doc: add another issue to doxy troubleshooting.rst
Change-Id: I61f72906ddc790a71fccf39c2a7695106c44f13e
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2016-06-24 20:42:22 +00:00
Arkadiusz Lichwa
2178fc5ab3 Bluetooth: L2CAP: Add configuration response handler
Adds L2CAP configuration response protocol definitions to be able handle
response from remote in reaction to issued local request to exchange
MTU. Current optimistic path of configuration initiated from local
assumes to set MTU contract in one iteration.

Change-Id: If86d96b37e9cd888ad10a624a79c864a137e027d
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-24 10:07:24 +02:00
Arkadiusz Lichwa
69882759b8 Bluetooth: L2CAP: Initiate MTU configuration request
Triggers conditionally outgoing configuration request to start exchange
MTU just after incoming PSM connection request was aknowledged by local
host. If local MTU differs from default (672) add MTU option in request,
otherwise send empty configuration meaning default is wanted.

Change-Id: I4eb382cc496345c051967640422e926f595ce854
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-23 19:59:16 +00:00
Arkadiusz Lichwa
5192c44e72 Bluetooth: shell: Suplement BR/EDR L2CAP channel handlers
Adds to BR/EDR L2CAP client channel object required handlers and allocate
room for channel data traffic to make it operational when fully
setup and to be interactive with internal stack.

Change-Id: Id1e90d7ea318ed8a875383995e4d175e124939eb
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-23 19:58:57 +00:00
Mariusz Skamra
db250496b9 drivers/nble: Fix missing return status assignment
Status shall be stored to be returned in the response to the
on_nble_gatts_write_exec_evt.

Change-Id: I03172e4b8833f83bd9b60f10d3cb52a067cc9f34
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-23 11:03:35 +02:00
Mariusz Skamra
ab8ec1592d drivers/nble: Fix missing FIFO initialization
FIFO object has to be initialized before being used.

Change-Id: I3bd774f60e2585d09cfba657cb2aa50c95e0c2f5
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-23 11:03:34 +02:00
Andrew Boie
a1c71b2043 nios2: include required macros for byte addressing
These are no-ops since this is not an arch that isn't byte-
addressable.

Change-Id: I09b0fd8b8d85f67bcca2dcb6ebc35843c19afa45
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-23 05:37:32 +00:00