Commit graph

41120 commits

Author SHA1 Message Date
Mariusz Skamra
6f11245d92 Bluetooth: Fix missing endian conversion
16 bit handles have to be converted to host order.

Change-Id: Iae5d9d79bacd90cd5b42a98d02165ec75bf1272e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-07-07 06:04:33 +00:00
Baohong Liu
c5404e7c4f sensor: adc: Fix a bug in ADC QMSI shim driver
Correct ADC resolution definition and default value in Kconfig.
QMSI uses different definition for sensor. But, Kconfig did not
reflect the difference.

Change-Id: I8e57aa5670bff0e5b29bf0772159834e4b902d88
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-07-06 22:06:17 +00:00
Mariusz Ryndzionek
57afc5f851 sensor: tmp112: use arithmetic_shift_right helper function
Use the function provided in misc/util.h to do the sample
conversion.

Change-Id: I21179982b6001bf79448e4eb289e9cffaf97f3fb
Signed-off-by: Mariusz Ryndzionek <mariusz.ryndzionek@firmwave.com>
2016-07-06 22:04:25 +00:00
Evan Couzens
8061457f3a doc: Arduino 101 BLE: Moved board content to wiki.
Moved the arduino_101_ble.rst content to Zephyr wiki:
https://wiki.zephyrproject.org/view/Arduino_101#Blue
tooth_firmware_for_the_Arduino_101

Change-Id: I361f124967da277aba835f39294a36718cf990a8
Signed-off-by: Evan Couzens <evanx.couzens@intel.com>
2016-07-06 22:03:45 +00:00
Sergio Rodriguez
9852ee5573 pwm: Implement set period and duty cycle API
This allow the PWM QMSI shim driver to implement the set duty cycle
API, and correct the behavior of Set Value

Jira: ZEP-69 ZEP-156 ZEP-158

Change-Id: I47744958fed889116fbb5024343ea00f76ed7706
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-07-06 22:01:51 +00:00
Inaky Perez-Gonzalez
c70f361e6b doc: clean removes autogenerated .rst files in refence/kconfig
Change-Id: I480ac3356782d121e9d245d94fe26efb19b0b2b6
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-06 21:56:50 +00:00
Inaky Perez-Gonzalez
f6d29b297f doc: do not generate unused doxygen HTML and Latex output by default
The doc build needs not the HTML or Latex documentation generated by
doxygen, as sphinx takes only the XML. Disable them to use less space
and speed up the build.

Change-Id: I51974449262fc5b45c6c2b41aad54365cceac341
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-06 21:56:39 +00:00
Andrew Boie
ef29812d51 nios2: support more global pointer scenarios
We now allow use of -mgpopt=global and -mgpopt=data. The 'global'
option is now the default instead of compiler-default local, expanding
global pointer usage to all small data in the system.

For systems where all RAM is less than 64K, the 'data' option may be
appropriate.

Some fixes had to be made to the system in order to get around some
issues:

* prep_c.c no longer uses fake linker variables to figure out the size
of data or BSS, as these gave the linker fits as it tried to compute
relative addresses to them.

* _k_task_ptr_idle is create by sysgen and placed in a special section.
Any small data in a special section needs to be declared extern
with __attribute__((section)) else the compiler will assume it's in
.sdata.

* same situation with extern references to k_pipe_t (fixed pipe_priv
test)

For legacy applications being ported to Nios II which do things that
freak out global pointer calculation, it can be disabled entirely.

Change-Id: I5eb86ee8aefb8e2fac49c5cdd104ee19cea23f6f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-06 18:14:31 +00:00
Baohong Liu
5846bb6d65 drivers: i2c: qmsi shim driver bug fix
Fix a bug in i2c_qmsi_transfer function in the shim driver.
The function did not wait for the completion of a msg transfer
before starting another msg transfer. Similar issue exists in
the i2c sensor shim driver. It is also fixed.

Change-Id: I1f8ad2281fa185d85db25a4682ed596c02ea322e
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-07-06 17:43:49 +00:00
Andrei Emeltchenko
a09a696ff0 Revert "uart: qmsi: Add driver API reentrancy support to UART shim driver"
Revert patch fixing Bluetooth application with Debug enabled crashing.

This reverts commit 029d3beb57.

Change-Id: I0004dae656ca5a0b44da9f12542088d47c38b837
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-07-06 16:58:59 +00:00
Andrew Boie
fca3591bce nios2: enable use of global pointer indirect addressing
needs to be 0x8000 after .sdata and .sbss sections since
register offsets are 16-bit signed values.

Change-Id: Ia7486d32af81e54a6ebac6be7ec308dfdeafe79e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-06 16:33:32 +00:00
Luiz Augusto von Dentz
96b9425a64 Bluetooth: L2CAP: Only call disconnected callback for connected channels
If channel has conn set to NULL disconnected shall not be called as
may cause invalid actions as with bt_gatt_disconnected being called
with a NULL conn.

Change-Id: I11bc41a34c2a2a3bc5f8514ec4a948235473cfba
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-06 12:08:53 +00:00
Mariusz Skamra
2dda2a9835 Bluetooth: Use LE Rand workaround for MyNewt on Quark SE Devboard
LE Rand command crashing the MyNewt HCI firmware issue has been also
observed on Quark SE Devboard. Applying this workaround solves the problem.

Change-Id: I57a533309ced0b2d31517a65ac1899ed55112973
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-07-06 12:08:42 +00:00
Szymon Janc
ad281d4dbe Bluetooth: L2CAP: Avoid double endianess convertion
We already have host order length in len variable.

Change-Id: I5b4ea652c5709eadd64b66584024501c40fd3abc
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-07-06 12:08:31 +00:00
Arkadiusz Lichwa
fdfc92c80d Bluetooth: ATT: Fix ATT_CHAN() macro
ATT_CHAN() macro as a wrapper to CONTAINER_OF is been used by ATT
internals API wherein the main parameter is pointer to bt_l2cap_chan
object. The macro returns pointer to bt_att context object but
CONTAINER_OF's third parameter determines what member is taken into
account in getting right address. Luckily here this third parameter
"chan" of type bt_l2cap_le_chan got of its own sub-member the "chan" of
type bt_l2cap_chan on first position in structure order. If such order
would change somehow there could be taken wrong address.

Change-Id: I955c2af11e001dac90a1eacc281ff167ceb34fb9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-05 16:52:05 +02:00
Johan Hedberg
f1a82f8ebe Bluetooth: Fix incorrect public key size
The ECC public key is 64 bytes in length.

Change-Id: I0fec312cdd94ff181abf8ec7e4eab46e1dc11eb6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-03 17:07:48 +03:00
Inaky Perez-Gonzalez
da5446281d doc: revert unnamed union/struct workaround in favour of known-issues
A workaround used to silence a warning in the doc generation process
which involved tagging a structure with a #define can now be solved
with a cleaner approach which is non-code-invasive.

Backup said change and update documentation on what to do when the
issue is found.

Change-Id: I1ef5224cd1b2df2e57c2ace438dba90ba3fc8528
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-01 21:53:45 +00:00
Inaky Perez-Gonzalez
0fb7abfea5 build: script to filter known issues
This is is a proposal to have a system to filter the output of the
build (compilation, documentation, sanity check and runtime tests)
that eliminates known issues so that whoever sees the output of the
tree can note new issues being added without having to dive on
existing, known ones.

Most common user of this will be the continuous integration system, to
decide what is shown to gerrit as feedback to the user who submitted a
change.

The rationale behind having it in the tree is that if somebody submits
code that introduces a false positive (due to tool limitations) or as
an accepted (normally minor) issue to be fixed later, it can also
submit a "filter" for it without breaking CI.

For example, consider the documentation workaround in include/uart.h
(that will be reverted when this is done):

  diff --git a/include/uart.h b/include/uart.h
  index a30b211..178bd5e 100644
  --- a/include/uart.h
  +++ b/include/uart.h
  @@ -97,7 +97,7 @@ typedef void (*uart_irq_config_func_t)(struct device *port);
    * @param sys_clk_freq System clock frequency in Hz
    */
   struct uart_device_config {
  -       union __unnamed_workaround__ {
  +       union {
                  uint32_t port;
                  uint8_t *base;
                  uint32_t regs;

This introduces a harmless warning in the documentation compilation
process due to a limitation in the tools that will be fixed in future
releases. In the meantime, as they accumulate, it makes more difficult
for people to know if *they* introduced any other warnings (or
errors). The configuration in .known-issues/doc/uart.conf matches that
warning and filters it out (and only that), with enough regex glue to work
around subtle context changes (like line numbers).

The implementation is a Python script that can take the build output
and remove what is being told to ignore by a list of configuration
files, each of which contains a list of single/multiline Python
regular expressions.

Addition of said exceptions is caught by CI: it will trigger a
maintainer being included as a reviewer because the as directed by the
entry for the .known-issues in the MAINTAINERS file.

Change-Id: I7939e0726f2c505481592c3a7f5f40fa3e9c62fd
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-01 21:53:44 +00:00
Jesus Sanchez-Palencia
abd7496225 ext qmsi: Update to QMSI 1.1-Beta
QMSI 1.1 Beta is available on Github:
https://github.com/01org/qmsi/releases/tag/v1.1.0-beta

Update the QMSI drop we maintain in Zephyr and
keep the modification to qm_soc_regs.h introduced on commit
6b88a6b945 "ext qmsi: Add USB base and interrupt defines" since
that patch hasn't made into the QMSI 1.1-Beta release in time.

Also, fix the build where needed:
- add hard dependency from qm_i2c to qm_dma
- fix spi_qmsi_ss.c due to new parameter naming
- fix adc_qmsi.c and adc_qmsi_ss.c due to a new parameter

Change-Id: I01388c787f5ee6ee97fece2e42b24a717522207f
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-07-01 13:43:02 -07:00
Andrew Boie
19fa82ab91 REVERTME: test_pool disable due to memory corruption bug
See ZEP-514

Change-Id: I7e9c2c5f81c01e73f1f7ce892fe835ebe3a7a36b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-01 19:44:30 +00:00
Peter Mitsis
b4eee20e4b test_fp_sharing: Enable for Cortex-M4
Update the FP sharing test project for use with the Cortex-M4.

Change-Id: If04a191b26291058bd7002ce8a0939eda8a5eb48
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-07-01 19:44:16 +00:00
Peter Mitsis
3490627a97 test_fp_sharing: clean up test code
Clean up test code in preparation for adding Cortex-M4 support.

Change-Id: I64a32e8aa2808b4e0348601e2fc0f7f39cdb413c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-07-01 19:44:15 +00:00
Peter Mitsis
005925e2dd arm float: Add Kconfig options
Adds Kconfig options CPU_HAS_FPU, FLOAT and FP_SHARING for the arm
architecture.

NOTE: All SOCs in the MK64F12 family have an FPU so that makes it a
convenient location to enable the hidden CPU_HAS_FPU option.

Change-Id: I71771d24f20f52079314bb8db9bf8a0aa827ab41
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-07-01 19:44:15 +00:00
Peter Mitsis
1f47a0dbce arm float: Update compiler options
Apply the correct compiler options when building for a Cortex-M4
processor that has floating point enabled. Using 'softfp' allows
floating point to be used with existing libraries supplied by the
Zephyr SDK. The 'hard' option would require new libraries to be
shipped with the SDK.

Change-Id: I141c20f54c2241134510888688637930c7b560a2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-07-01 19:44:15 +00:00
Andrew Boie
571ccee400 test_pool: increase task stack sizes
We were getting a stack overflow on Nios II.

Change-Id: Id2c9be27552f31f5cdbf72dc31e77a106082746b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-01 19:01:58 +00:00
Inaky Perez-Gonzalez
b34e376e51 doc: update troubleshooting for Kconfig help
Fix the omission of having bullets for the enumeration of options, as
it makes the formatting look properly vs just different lines.

Change-Id: I701f705bc03ccc2082439c3ea3c1b5053b2aac0a
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-01 17:44:25 +00:00
Luiz Augusto von Dentz
b008f74b0b Bluetooth: L2CAP: Fix not cleanup properly if ACL is disconnected
If ACL is disconnected with channels still active the code should call
l2cap_chan_del to clean it up properly.

Change-Id: Iffa9345a9697ac80c1f2295578c7161ffeb44420
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-01 14:17:06 +00:00
Mariusz Skamra
997765def2 Bluetooth: tester: Increase prepare write buffers pool for qemu and nble
Buffers pool has to be increased for all configurations.

Change-Id: Id24caced5043c1672ca5f753d1e86d9a72c728ea
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-07-01 14:57:02 +02:00
Mariusz Skamra
940ee5e6e5 Bluetooth: tester: Increase prepare write buffers pool
TP/GAW/SR/BV-10-C test case requires two long values to perform
nested prepare write operation. Using one ATT Execute Write command
this two values are going to be written simultaneously.

Change-Id: I2950409ed8f1d121dcc706b432cdf071b9af00c0
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-07-01 12:34:06 +02:00
Johan Hedberg
179f08f049 Bluetooth: Create proper abstraction for ECC access
This makes the SMP usage of ECC functionality properly encapsulated
and offers the chance of other protocols to utilize the functionality
in the future.

Change-Id: Iae14beafd5f8f7dbe2c6ffd33700471b8a62b8da
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-01 11:21:04 +03:00
Flavio Santes
b2383406cc samples/static_lib: Linking with a static library
This sample shows how to integrate a static libray into a Zephyr
application. A hello_world application and a small library are
included.

Origin: Original

Jira: ZEP-366
Change-Id: Idab38402b47042c3f9369b3a8e433d07d5fa4535
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-07-01 00:39:20 +00:00
Genaro Saucedo Tejada
c8d9b6b5e3 tags: basic kernel objects test for actual hardware
Tagged some tests/kernel testcases with 'bat_commit'. Only test that
work on actual hardware are tagged, while tests with known issues
were left not tagged, test meant for emulator or build only were
also not tagged.

Change-Id: Icede6bc76788aba60d8f1fdcf624e95a7d3116a2
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-07-01 00:38:31 +00:00
Andrew Boie
231e617593 nios2: enable instruction/data caches
The caches get initialized on boot and flushed after XIP copy
takes place.

Change-Id: I642a14232835a0cf41e007860f5cdb8a2ade1f50
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-01 00:34:47 +00:00
David B. Kinder
47eb6096b1 doc: fix ref in include/sensor.h
Added missing (placeholder) comment on struct sensor_trigger_config

Removed @ref references to undefined terms

Fixed a misspelling while I was there too.

Jira: ZEP-487
Change-Id: I314f243cbd58cab48da33abd2f181b9aeb17b0e9
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2016-06-30 21:22:25 +00:00
Andrew Boie
c613715322 nios2-qemu: use all available RAM
Use all available ram, cut in half for simulated RAM/ROM
regions. Some larger test cases did not fit in 64K for
non-XIP case.

Change-Id: I12296286ca7efa5bcc1ceef30486c3fe8976811c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 20:56:16 +00:00
Andrew Boie
0a8a101e6e nios2: enable microkernel sanity checks
All tests are building now.

Change-Id: I96a94733a96a92df445c46add0de94319fbca3a5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 20:56:16 +00:00
Andrew Boie
ac6ac00337 sample/kernel_event_logger: fix nano config
There was no need for arch-specific configs for this test
case. We now use the x86 config with CONFIG_TICKLESS_IDLE
removed.

The test case has been re-enabled on Nios II.

Change-Id: Idd206cb3ca55f2336685a416df18f5848dee09c3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 12:10:43 -07:00
Andrew Boie
8e35554743 sample/kernel_event_logger: fix microkernel config
There is no reason to enable tickless idle or system power management
to test the kernel event logger, and it breaks systems which do not
implement tickless idle (like Nios II which lacks a powersave
instruction).

Sleep events are logged on all arches in nano_cpu_idle() or
nano_cpu_atomic_idle() so we get sleep events even without these
configs turned on.

Change-Id: I6db811478686d8b2cd9e12a65b118349e825b22f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 12:10:43 -07:00
Andrew Boie
f33b8d32a1 nios2: implement kernel_event_logger
Interrupts and context switches are logged. Since this CPU does not
have a power-saving instruction, it never enters a sleep state so
we do not call _sys_k_event_logger_enter_sleep() from anywhere.

Change-Id: Idcef388e93ffea373446997a0f87e93a4db44331
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 12:10:43 -07:00
Andrew Boie
71e22620a8 nios2: define vaddr_t and paddr_t
Change-Id: I09b91159b4c30876026fe7ae32109afb9164332d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 12:10:43 -07:00
Andrew Boie
59169052c6 misc/kernel_event_logger.h: prototype irq entry point
Missing from the header, likely due to other arches always calling
this from ASM-land.

Change-Id: Id90e0269a4f9e17b78c48eb7df3b6cde08c53d2a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 18:52:23 +00:00
Andrew Boie
eab9123589 nios2: fix nano_cpu_idle()
Interrupts must always be unlocked when coming out of this function
or execution will never leave _power_save() once entered.

Change-Id: Idda9d9be7cfc576a1072afec38000f63ae262a10
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 18:52:10 +00:00
Andrew Boie
e3ffa67bde test_stackprot: disable for Nios II
No compiler support for -fstack-protector on this arch with the
current toolchain.

Change-Id: Ifa793599b6760c318f16748f9e71c31e0d4edbe7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 18:51:51 +00:00
Andrew Boie
5da328b07b tests: test_tickless: exclude on Nios II
Tickless idle will not be enabled on Nios II due to the
lack of a powersaving instruction.

Change-Id: Ib3c23d803d6335aeb791983e31ad7da2d0deb118
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 18:51:51 +00:00
Andrew Boie
fe40d1071e REVERTME test: bluetooth: init: exclude Nios II JTAG UART
This driver does not yet support interrupt-driven console.
Revert when ZEP-280 is implemented.

Change-Id: Ib430c39138194ab441c95a1b1856c3661102a625
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 18:51:50 +00:00
Chuck Jordan
c1c60415c1 test: merge x86 changes over to prj_arc.conf
I see that the x86 version of the prj.conf file changed.
Merging those changes into the ARC one.

Change-Id: Ifd59d3b7ed71a4e6613bb3d164b901eb1ad7ad55
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-06-30 17:54:04 +00:00
Adrian Bradianu
ab2c18b0ad usb: Move LOW_BYTE and HIGH_BYTE to samples code
Move LOW_BYTE and HIGH_BYTE macros from usb_common.h to
samples code.

Change-Id: I26296bde8c5b3991b3bfab71272c861b5360ce97
Signed-off-by: Adrian Bradianu <adrian.bradianu@windriver.com>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-06-30 17:51:58 +00:00
Adrian Bradianu
88656ec981 usb: dfu: Add support for alternate settings
Add support for alternate settings in order to access additional flash areas.
The DFU example uses the alternate settings as an offset into flash.

Change-Id: I636042c7f71a5d2a2778ec7dd5301a622720107d
Signed-off-by: Adrian Bradianu <adrian.bradianu@windriver.com>
2016-06-30 17:51:57 +00:00
Adrian Bradianu
d8ee2b087f usb: Add ReST documentation file
Change-Id: I955bad3c560d8e0026d671dadf6004edb94559e4
Signed-off-by: Adrian Bradianu <adrian.bradianu@windriver.com>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-06-30 17:51:57 +00:00
Adrian Bradianu
3d8b28b358 usb: Add CDC ACM and DFU class examples
CDC ACM sample class driver implements a virtual UART port.
SET_LINE_CODING, GET_LINE_CODING and SET_CONTROL_LINE_STATE
class requests are supported.

DFU class example does not perform an actual firmware upgrade,
instead it allows the user to upload a file at a predetermined flash
address or to download the content from that flash address.

Change-Id: I702e6727db15ef360d110a70a979c1e4bd4ee1bb
Signed-off-by: Adrian Bradianu <adrian.bradianu@windriver.com>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-06-30 17:51:57 +00:00