Commit graph

41120 commits

Author SHA1 Message Date
Andrew Boie
4ae4d2f4d1 nios2: include .sbss in BSS section
Change-Id: I1165d65ae8505ec79166acc8ebde86611ac50e08
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:21 +00:00
Andrew Boie
738dec483e nios2: add static interrupt handling code
Supports Internal Interrupt Controller only for now; EIC
supoort tracked in ZEP-258.

Change-Id: I2d9c5180e61c06b377fce4bda8a59042b68d58f2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:21 +00:00
Andrew Boie
e2ff2fdd91 nios2: add base exception handling code
Change-Id: I56b0ec1a3576a77ca7bd6f2c0217de8053406927
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:20 +00:00
Andrew Boie
b6d9c5ca80 bluetooth: init: disble for CONFIG_UART_ALTERA_JTAG
Interrupt-driving UART not implemented yet for this driver.

Change-Id: Ida60d7e09e9eca2d7e6452a84f6d95529d0af9b6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:20 +00:00
Andrew Boie
533e88718b altera_max10: use JTAG UART for console
Attached PCs can read these messages with the 'nios2-terminal'
application.

Change-Id: I44942c8feaf3901adb410269460787cf2a8b6a4a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:19 +00:00
Andrew Boie
25052517c1 uart_altera_jtag: add JTAG UART driver for Nios II
This currently only supports outgoing messages without interrupts.

Change-Id: I635562f47106eb6cdc7104a8160e431bebea25dc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:19 +00:00
Andrew Boie
7bd697b0d5 nios2: add _nios2_reg_write/read functions
The technical manuals and example HAL code frequently refer to
register bank numbers from some base address. Add these helper
functions to read and write registers correctly using this
notation.

Change-Id: Ia082f5cc89081fcea2cb6ad8204c1b9b2650d3fd
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:19 +00:00
Andrew Boie
280340162d altera_max10: enable some debug configs
Useful at this stage of the bring-up. Stack memory will be initialized
with 0xaa and we build with -O0.

Change-Id: Icd0e9ac49c0158f7b18e4e286a07ca281d20e7e6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:18 +00:00
Andrew Boie
1487c6d66e nios2: implement _Swap() and _new_thread()
With this code we can successfully boot and context switch into
the main thread. Nanokernel hello_world has the expected
"Hello World!" string in the RAM console.

Change-Id: I56335d992f5a7cbb12d9e4c02d1cc23ea28ae6ef
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:18 +00:00
Mariusz Skamra
cc1559ce56 drivers/nble: Add timeout before Conn Param Update as Peripheral
According to Core 4.2 Vol 3, Part C, 9.3.12.2,
The Peripheral device should not perform a Connection Parameter
Update procedure within T_GAP (conn_pause_peripheral) after
establishing a connection.

T_GAP (conn_pause_peripheral) is 5 seconds.
Fixes TC_LE_REJ_BI_01_C.

1/3   L2CAP   TC_LE_REJ_BI_01_C   PASS
2/3   L2CAP   TC_LE_CPU_BI_02_C   PASS
3/3   L2CAP   TC_LE_CPU_BV_01_C   PASS

1/3   GAP   TC_CONN_CPUP_BV_01_C   PASS
2/3   GAP   TC_CONN_CPUP_BV_02_C   PASS
3/3   GAP   TC_CONN_CPUP_BV_03_C   PASS

Change-Id: I66bf57a2b8323b748c15f61b2daecfaa435dbb69
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-22 16:01:48 +02:00
Tomasz Bursztyka
06717d3196 net: Fix documentation of buf.h
Make sure all is documented, and the comments properly formated.

Change-Id: I7431535b0f3a409e63ac4b12c421be662098eed1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-06-22 13:34:46 +00:00
Andrei Emeltchenko
a0204e22aa drivers/nble: Implement on_nble_gatts_notify_tx_evt()
Print debug statement allowing to track bugs with firmware, this also
removing Not Implemented warnings.

Change-Id: I15b77cd6efb5d9bc75910ef444f746c860ac3c6c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-06-22 13:12:37 +00:00
Luiz Augusto von Dentz
105d342a63 Bluetooth: GATT: Fix attribute .write documentation
Change-Id: I765de61cc98927affd2547de765d61bb3f8e7efb
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-06-22 12:03:23 +00:00
Mariusz Skamra
ad02f94c29 drivers/nble: Fix return type
This function can return negative value.

Change-Id: If466897821a0d1b718ad210df208ce8a004b3da9
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-22 11:25:37 +02:00
Mariusz Skamra
b2ba8fbd0c drivers/nble: Split writing part of on_nble_gatts_write_evt
To be reused by on_nble_gatts_write_exec_evt.

Change-Id: I2cb7f3b8e2c33cbede9af3f211e876c4038bef36
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-22 11:25:32 +02:00
Mariusz Skamra
cad52d1a66 drivers/nble: Fix execute write condition
This fixes the condition that has to be checked while writting attribute
value. According to the GATT API, write() callback returns the "number
of bytes written, or in case of an error BT_GATT_ERR() with a specific
ATT error code".

Change-Id: I4268e1d0585f5ce816ad64ca62232b6d739b780a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-22 10:44:18 +02:00
Fabrice Olivero
b551a447b0 samples/task_profiler: fix crash when starting profiler
When profiler is started from shell, platform information is
transmitted over uart by calling uart_poll_out(uart_dev)
directly in the shell fiber context which is executed when
the command is entered ('prof start')

Problem is that 'uart_dev' global variable is set to the UART
console device when prof_flush() first call is done.

Depending on when this call happens (application dependent,
especially in nano-apps which have to call prof_flush in
their main loop), 'prof start' may happen before 'uart_dev'
variable is actually set, which drives to shell fiber crash.

This patches moves sending platform information from shell
fiber to prof_flush function to avoid using non initialized
'uart_dev' variable.

Change-Id: Ie64f4418a745affa3fbd731db6bf9bb998b7c2f9
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-06-22 05:30:26 +00:00
Kumar Gala
86cbc320f0 build: quote SOURCE_DIR to allow it to be a list
If SOURCE_DIR happens to be multiple directories we need to quote it so
it gets passed correctly as a list.

Change-Id: I7795ddecd016fad2048f957accd1557bb2215632
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-22 05:02:28 +00:00
Kumar Gala
5ccf5298b5 build: make zephyrmake exposed with V=1
Remove extra @ which would always silence output from zephyrmake.  Every
instance of zephyrmake is prefixed with a $(Q) so V=1 will expose them

Change-Id: I8e622cc2175f645897ac78d607486d37c0af1618
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-22 05:02:28 +00:00
Inaky Perez-Gonzalez
b6b39f63d9 doc: add a troubleshooting guide
In preparation for more strict guidelines on documentation, provide a
trouble shooting guide with the most common and obscure issues found.

The CI system will point to this guide to help committers upon doc
failures.

Change-Id: I386baea75dad0c82b58b23926e0bd32de8a0b249
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-22 04:49:28 +00:00
Tomasz Bursztyka
bf40601c2a cc2520: Fix how FREGs and SREGs are accessed
- SREGs should use MEMRG/MEMWR instructions, FREGs use REGRD/REGWR
- REGRD/REGWR get the register address in the first byte along the
  instruction.

Reported-by: Igor Modino <igor@emutex.com>

Change-Id: I0da9de5ecd4cab914c8711bd4276e7a2bc6147a5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-06-22 04:47:43 +00:00
Evan Couzens
17acc7fde4 doc: Moved board content from rst to wiki.
Moved content from arduino_101.rst to Zephyr wiki article

Change-Id: I10d42e28f375bcb5c5c7266e7595b6dd7767ac8b
Signed-off-by: Evan Couzens <evanx.couzens@intel.com>
2016-06-22 03:26:07 +00:00
Sebastien Griffoul
300dee8a26 serial: fix ns16550 set_baud_rate()
In order to change the baudrate the DLAB bit of the LCR register has to
be set to 1 (This bit is used to enable reading and writing of the 
divisor latch register). This bit must be cleared after the baudrate
setup in order to access other registers.

The set_baud_rate function correctly sets the DLAB bit of the LCR reg but
never clears it. Therefore the ns16550 doesn't properly work any more
after updating the initial baud rate.

In order to fix this issue the LCR reg has to be temporary saved
(because it contains other important settings). After switching to a new
baud rate the LCR reg value has to be restored. 

Change-Id: Ied4db683cbf40ba3125e747552968ddf1a66e2be
Signed-off-by: Jeremie GARCIA <jeremie.garcia@intel.com>
Signed-off-by: Sebastien GRIFFOUL <sebastien.griffoul@intel.com>
2016-06-22 01:35:37 +00:00
Jeremie GARCIA
36c19491c0 serial: fix uart_irq_rx_disable()
Fixed uart_irq_rx_disable() to call irq_rx_disable() instead of
irq_tx_disable() callback.

Change-Id: Ib18ab1c147b016ea1a2450380a90d6ac769a75eb
Signed-off-by: Jeremie GARCIA <jeremie.garcia@intel.com>
2016-06-22 01:35:22 +00:00
Andrew Boie
9a7443591a nios2: linker.ld: keep exception code for non-XIP
The KEEP() is only necessary for the exception entry point
as it sits at a magic memory address and isn't referenced by
other code.

Change-Id: I8443e8aa23059b65eaf9c5a1cf3f9b14b04737d5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:13 +00:00
Andrew Boie
3574aec5e1 nios2: don't enable XIP by default
If XIP is turned on, only hardware breakpoints may be used, and
code cannot be loaded onto the device with nios2-download
or GDB 'load' command. RAM-constrained applications are free to
enable this if they need to.

Change-Id: Iee2d41f71f7ca2bc599801cf3cf0fac680273e51
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:13 +00:00
Andrew Boie
5c586ee6b2 nios2: linker.ld: ensure reset code isn't discarded
This isn't directly referenced by other code in the binary,
it just sits at a magic memory address. Make sure gc-sections
doesn't throw it away.

Change-Id: I1c00a163dbf2eb4866ebadc7f1d70bcc6845b8d1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:12 +00:00
Andrew Boie
a3c2812e37 nios2: linker.ld: remove some assertions
These aren't valid in all circumstances; the reset vector in most cases
needs to be in ROM.

Change-Id: I83df8762eecc53c99af92f3b0972dfbafac457fb
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:12 +00:00
Andrew Boie
5846018d0d nios2: crt0: fix GDB debugging
When an image is sent over the wire with the GDB 'load' command,
it tries to start execution from the __start symbol, which needs to
be in RAM. Since the reset vector is in ROM, name it something else.

Change-Id: Id0bbfa76db9a8a81bd7ff20be3f2baec81eae15e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:12 +00:00
Andrew Boie
c266df2d81 MAINTAINERS: Add Andrew for Nios II
Change-Id: Ia7bffdcf5d83a4f7d3642228d828c7158511ab24
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:11 +00:00
Andrew Boie
0d9b755bb1 nios2: ensure stack pointer is properly aligned
Kconfig doesn't enforce any kind of alignment when specifying the
ISR stack size. Perform the assembly equivalent of STACK_ROUND_DOWN.

Change-Id: Ib7fb72ff7db8a3aa20ec6d0c59a03aa8227f6671
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:11 +00:00
Andrew Boie
2933aadce9 altera_max10: use Nios II/f core
Has extra debug capabilities and the board has sufficient space
for it.

Change-Id: I638c665e766f1a41dc5db89fcf8b8c0d44912789
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:10 +00:00
Andrew Boie
b5177d7d2d nios2: Makefile: optionally include SOC Makefile
It may not necessarily exist.

Change-Id: I5c79d7538edef78e38f7e05b004e69e0259dd079
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:10 +00:00
Andrew Boie
464676510b nios2: crt0: init interrupt stack as well
CONFIG_INIT_STACKS should initialize all stack regions
with 0xaa. Make sure the initial interrupt stack gets this
as well. Take care not to exceed the bounds of the array
if it is not 4-byte aligned.

Change-Id: Ib23329ac84a5a8515272be2944f948e8faba65b3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:10 +00:00
Andrew Boie
9ac955a762 qemu_nios2: new board for running tests under QEMU
Change-Id: If59d9291d3750274ef6a8429e2b24cf35f41dbd3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:09 +00:00
Andrew Boie
6524bae242 nios2-qemu: experimental QEMU target for Nios II
Change-Id: I4c2413000166b4a8c221fab81f3d8da98a88806b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:09 +00:00
Andrew Boie
4fabf216fd nios2f-zephyr: add Nios II/f core
This core has extra debugging features useful for this bring-up
exercise.

Change-Id: I619bc8768acb1d9be8699a6e238168f47e605f3d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 01:31:09 +00:00
Inaky Perez-Gonzalez
ecc4c765cc doc: fix WARNING: Invalid definition" due to unamed structs/unions
Fix with a workaround in unnamed unions / structs in bluetooth, i2c,
sensor and uart.

Current documentation parsers (sphinx under Doxygen) don't seem to
understand well unnamed structs / unions. They will not generate any
documentation for any documented members (see left side of
http://imgur.com/mcpBXWc).

A workaround is to make the parser think there is something like a
struct/union/enum name that is actually something with no effect to
the compiler.

Naming it with __unnamed_workaround__ ensures it is clear it is a
workaround while we wait for a final fix. It is #defined to be a NO-OP
to the compiler and rearrange the member documentation as *@param* so
we have some documentation that the non-worked around code fails to
document.

Anonymous structs/union that declare a variable are just given an
internal name.

Workarounds documented in the contribution guidelines.

Change-Id: I4d32cf444f3c5e7d2fb11581e4b41f80e93c9786
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-21 22:06:56 +00:00
Javier B Perez
587e5a5198 doc: fix blank line and unindent error in FAULT_DUMP option
Change-Id: I5fe38a03c0c16f89e5f456a62eb38d058380d00c
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-21 20:04:13 +00:00
David Kinder
333f2c9bc1 doc: add links for version 1.4.0 documents
update index.rst to include 1.4.0 doc folder

Change-Id: I57b7ea470e4a5d2f8e93459f90421a87abf331ce
Signed-off-by: David Kinder <david.b.kinder@intel.com>
2016-06-21 19:52:48 +00:00
Javier B Perez
5eecd88011 checkpatch: kconfig: warn about spaces instead of tabs
checkpatch warns about kconfig lines that contains spaces
instead of tabs.

Change-Id: I60aa74072ce424f21db64a7df0804d7d4cbe315b
Jira: ZEP-427
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-21 19:50:59 +00:00
Luiz Augusto von Dentz
c116fc42e0 Bluetooth: ATT: Merge all permission check in one place
This merges callback checks with permissions checks so there are done in
one place.

Change-Id: Ic51b2be9cda67eac9e5dc1ebcbf6186ad5007bf4
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-06-21 14:56:04 +03:00
Louis Caron
b7702334c4 drivers/nble: Update firmware to 0620 revision
Update NBLE driver to use the latest firmware fixing the
dependency on the bt_gatt_attr structure size.

Change-Id: Ib93d7d29656028bfb06bbb6ca883816e2a7072fc
Signed-off-by: Louis Caron <louis.caron@intel.com>
2016-06-21 09:24:10 +00:00
Arkadiusz Lichwa
8b1c837e28 Bluetooth: L2CAP: Handle incoming BR/EDR connection request
Enables L2CAP protocol definitions for connection request/response and
use it then to start handle incoming PSM connection request to valid
registered local PSM server. SDP PSM got no security restrictions.
The other PSM connections are validated against link encryption and
availability of SSP feature and if not matched are refused with
security error.

Change-Id: I429cf5dbce92300bd52639d5065e0144f8db4d13
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-21 07:41:27 +00:00
Genaro Saucedo Tejada
eeb2b733e4 sys_log: replace old debug macro on ADC driver sample.
ADC driver sample is now using system log.

Change-Id: I44f5189b3beb09a14d87842c5968127460eda710
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
JIRA: ZEP-311
2016-06-20 20:40:31 +00:00
Maureen Helm
280eadffdd ksdk: Add Makefile support for ksdk device and CPU
Translate the SOC name and part number into the ksdk device path and CPU
macro respectively. This will be used by future ksdk shim drivers and by
the ksdk itself.

Change-Id: I40e94441ee032bfbed7df834be8000d95be53250
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-06-20 17:38:47 +00:00
Johan Hedberg
8afe6078e1 Bluetooth: Avoid unnecessary indentation in read_remote_features_complete
Instead of having a dedicated branch for the success case jump to the
cleanup label in the inverse condition.

Change-Id: I271ce088a5b469d1fb96af1256fcafa5b1e6e2f7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-20 13:39:28 +03:00
Arkadiusz Lichwa
16fda5f3d9 Bluetooth: Add support to read LMP remote features
Introduces HCI protocol defines to be able request and read remote LMP
features and if available extended data from peer when connected.

Change-Id: Ic274737d8b6c896eb9e83e2179829bcbadf6f635
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-20 10:13:03 +02:00
Maureen Helm
2bf391797b ksdk: Add Kconfig support for the ksdk
Add hidden configuration HAS_KSDK for SoCs to select if they have
support in the ksdk.

Change-Id: Ia4cd11901bc26d21a3bdfad6236d66656bb292cb
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-06-17 19:15:29 +00:00
Kumar Gala
b757c1ccba nios2: remove empty files from nios2e-zephyr
Use a kbuild trick to force built-in.o to get built even if there isn't
any code so we can link properly.  This is cleaner than keeping around
empty files that don't do anything.

Change-Id: I4214d21104fe5f49613fa5697c8116b0e8c8aa50
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-17 17:28:31 +00:00