Commit graph

42249 commits

Author SHA1 Message Date
Tomasz Bursztyka
930bb9d3ca cc2520: Make the driver more in line with Zephyr
CC2520 drivers as a singleton:
Current driver can only handle a single instance. This is due to the
gpio callback which cannot provide the concerned device (not the gpio
device, the cc2520 one). Setting a singleton instance for now, as the
network stack cannot handle more net devices anyway. This will be fixed
in the future.
In the mean time: improving a bit the usage of spi and gpio by accessing
the cc2520 instance directly.

Also: simplifying SPI usage, useless internal locking removed, better
debugging routines, better busy wait macro and use Zephyr's BIT() macro
instead of internal one.

Change-Id: I92b849135a92f77ee6a4374c9f662dcad8347814
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:23 -05:00
Jukka Rissanen
cf7c826874 cc2520: Add Quark SE devboard support
Support for running cc2520 radio found on Quark SE devboard.

Change-Id: Ib0781489e3ebae8569a13c35d3fe6a6d87ac9a3b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:23 -05:00
Jukka Rissanen
f1563253cf cc2520: Initial checkin for TI CC2520 802.15.4 driver
Integrating it into network stack. Centralizing all in drivers/802.15.4

Change-Id: Ia2916ff652afe5fe736f6560c2ed4a911a5f0679
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:23 -05:00
Tomasz Bursztyka
fa79a5df21 contiki: clock: Tiny cleanup
Use existing macros from Zephyr and apply proper code style.

Change-Id: Ia3d572054aa702ce33ceae04eff931cfb900c45c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:23 -05:00
Tomasz Bursztyka
eb96f0a73a spi: dw: Fix Tx and Rx threshold after each push/pull
Reading: As when setting up the transfer, Rx has to adapt to current
left Tx lenght.
Writing: If nothing will be transmitted anymore, downsizing the level to
0. This fixes a hanging issue while making the controller being busy for
nothing. Another hack found to fix the same issue was to test the SR
Busy flag bit in the ISR handler. As the threshold level makes more
sense, kepping this one.

Change-Id: I87ba393d507c9418295f188d866d9979f423536c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:23 -05:00
Anas Nashif
e3401c9496 toolchain: remove yocto variant, now using zephyr variant
Change-Id: I976f1e47a4fa80030878da1568dc71289bbd8e0f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:23 -05:00
Dan Kalowsky
2ad4940f6a docs: Platform documentation of Arduino 101
Adds documentation for the Arduino 101 on how to
connect up the debugger, flash, and build for the platform.

Change-Id: I0c7f119eb892ad5857de73dca94bc284bd0b4279
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:25:23 -05:00
Juan Manuel Cruz
06e2d0fe76 adc: updates sample width kconfig help message
The numeric code to configure sample width in ADC needs correction.

Change-Id: I6d73db674852650f70178322d949f9b2b49f97af
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:23 -05:00
Dmitriy Korovkin
09acfc27f7 c++: Add sample projects
Change-Id: I2d74f6225ed9736d671f34a33c99da34e81863cc
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:25:23 -05:00
Peter Mitsis
8e35cc8eb4 build: Add C++ support
Adds C++ support to the build system.

Change-Id: Ice1e57a13598e7a48b0bf3298fc318f4ce012ee6
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:23 -05:00
Constanza Heath
eaed145cb6 Integration of TinyCrypt v2: ECC, CMAC, AES-CCM with test cases for CMAC and CCM.
Change-Id: I26a5c3027af0d00f55021c1ac063100606084314
Signed-off-by: Constanza Heath <constanza.m.heath@intel.com>
2016-02-05 20:25:23 -05:00
Anas Nashif
23be7fd1cd build: rebuild binary if dependencies have changed
We had an issue of final binary not being built when sources
are changed. This adds the required dependencies.

Change-Id: I1676fc63e6857ef604576905a5ae1ee02b0b648a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:23 -05:00
Anas Nashif
bd615ff4d4 samples: fix description of sample and fix Makefile
We were pointing to a different source tree.

Change-Id: Ibeb91037f8672f6cc6618e3c408f740548c7e141
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:23 -05:00
Anas Nashif
2fe1a05b74 task monitor: remove ifdef, we check in Makefile already
Change-Id: I507c3e803a0d781e6cb84f03684d1ed0043678b8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:23 -05:00
Fabien Chereau
e2e78baf68 ns16550: implement the irq_tx_empty function
Change-Id: I5b043354aefe8d54c2f8e06e06204e3de8e715b5
Signed-off-by: Fabien Chereau <fabien.chereau@intel.com>
2016-02-05 20:25:23 -05:00
Fabien Chereau
fdc08ce417 uart: allow to check whether Tx fifo is empty
Adds a new uart_irq_tx_empty function in the UART base API.

Change-Id: Iab76251d4d40b92a553628956c49f1dd707292b5
Signed-off-by: Fabien Chereau <fabien.chereau@intel.com>
2016-02-05 20:25:23 -05:00
Fabien Chereau
b7d9842875 ns16550: implement the err_check function
Change-Id: If38bb1082f11a3be5b5d94a7122db233e6a822df
Signed-off-by: Fabien Chereau <fabien.chereau@intel.com>
2016-02-05 20:25:23 -05:00
Fabien Chereau
43ad5532df ns16550: Interruption Identification Register definitions clean up
Change-Id: I7346cec74061bce774c8fee80186d09aaf690f76
Signed-off-by: Fabien Chereau <fabien.chereau@intel.com>
2016-02-05 20:25:23 -05:00
Fabien Chereau
01d42186b2 uart: allow to check for errors
Adds a new uart_err_check function in the UART base API.

Change-Id: Ia94386d75fcb66a582a2ad919c1a7afb05dd7776
Signed-off-by: Fabien Chereau <fabien.chereau@intel.com>
2016-02-05 20:25:22 -05:00
Peter Mitsis
a74d5d63f1 test c++: Recognize init_array as a valid section
Updates the sanitycheck script to identify the "init_array" section
as a valid section in the image.

Change-Id: I55c20909d3734e68e8ec319e1abde94da93665a1
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Peter Mitsis
df3c6b13ab c++: Update minimal libc headers
Updates the minimal libc headers for differences between the C and C++
languages.  This includes ...
   1. Conditionally defining "bool", "true" and "false" as they are
      already keywords in C++.
   2. Making the definition of NULL language dependent.
   3. Using the _Restrict macro instead of the restrict keyword as
      restrict exists in C, but not in C++.
   4. Changing the definition of size_t so that it is compatible with
      what the compiler expects when building the new operator stubs
      (as it varies by architecture).

Change-Id: I37ff058a60b90a05f96e9dd6f61d454d143041ce
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Peter Mitsis
497d0e53c4 libc: Consolidate size_t definitions
Consolidates the definitions of size_t in the minimal libc library.
This prevents code duplication.

Change-Id: I996990ad9093ebec1f9ba0045d14319e1a243e70
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Peter Mitsis
b111d6c932 libc: Consolidate NULL definitions
Consolidates definitions of NULL in the minimal libc library.
This prevents code duplication.

Change-Id: Ia4a2bde1329d66e7c83afeab806a39b22704ab48
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Peter Mitsis
36a2ae3184 c++: Add TASK_ENTRY_CPP to C++ task entry points
The TASK_ENTRY_CPP macro is to be used to tag task entry points when
they are defined in a C++ file.

Change-Id: I213965cf55648f54972e1e95bf5b4269f03fd44d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Peter Mitsis
babea6d2dd c++: Add EXTERN_C macro
The EXTERN_C macro is to be used to ensure compatibility between C and C++;
It prevents name mangling in C++ environments.

Change-Id: I33be727150687901f7770306c8a07c16a7e46ffa
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Peter Mitsis
a0e4568760 c++: Add extern "C" { } block to header files
Adds extern "C" { } blocks to header files so that they can be
safely used by C++ source files.

Change-Id: Ia4db0c36a5dac5d3de351184a297d2af0df64532
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Jesus Sanchez-Palencia
6504b7e72a gpio: Add QMSI-based implementation
Introduce the GPIO QMSI-based implementation. This is basically a
shim layer that implement's Zephyr's GPIO APIs on top of QMSI drivers.

This is an alternative driver that conflicts with the previous
GPIO_DW implementation. In order to enable it you must set:
- CONFIG_GPIO=n
- CONFIG_GPIO_QMSI=y
- CONFIG_GPIO_0=y
- CONFIG_QMSI_DRIVERS=y
- CONFIG_QMSI_INTALL_PATH="PATH_TO_QMSI"

Note that this driver currently only supports one controller instance,
GPIO_0. It is implemented this way due to a limitation from the current
version of QMSI. QMSI versions later than 1.0 doesn't have this
limitation.

Missing:
- support multiple controller instances (gpio_0, gpio_1, etc);
- enable level triggered interrupts in sync with system clock,
through setting INT_CLOCK_SYNC properly.

Change-Id: Ib61b153dae9741806a9a31d7dc1f82b96d000fbe
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-02-05 20:25:22 -05:00
Juan Manuel Cruz
41771e5b1c adc: Repetitive buffer management
This commit changes the behavior of the driver when it reports
buffer results back through the callback.

Originally, the driver reported a callback after each sequence
table round signaled by an interrupt. If in repetitive mode,
each reported result was put in the next buffer element,
which was considered circular, and reported back with callback.

Now the behavior changes. If in repetitive mode, each sequence table
round reported by an interruption puts the data  in next element of
the reception buffer. The callback reports back once the buffer is
fulled and stops the sampling process.

Change-Id: I3707574cfaf5dfc874473f38c5dfa88dd392133d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:22 -05:00
Juan Manuel Cruz
51a5b96367 adc: remove of single/differential modes
On Curie SoC the ADC must always be configured in single ended mode.

Change-Id: Ie59b4180358153865c961b66f98321db60d4269f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:22 -05:00
Juan Manuel Cruz
fed390316f adc: improvements to the adc sample code.
- Sample application now pulls data continuously.
- Adds information on the arduino analog input pins and ADC channels.
- CHANNEL is defined as a macro.
- BUFFER_SIZE is defined as a macro.
- Sets the sample to run on repetitive mode on ARC architectures
  (applies to Arduino 101 ADC).

Change-Id: I6201fea3a98b5394c05eb3ac570793629431ac02
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:22 -05:00
Juan Manuel Cruz
87aa20ebad adc: adds dummy conversion
After exiting a deep power down mode a dummy conversion is required.

Change-Id: I98dad19e168984efe7af6ad360d0cc46e6603736
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:22 -05:00
Juan Manuel Cruz
1e3467602a adc: fix a bug polling the power states.
Curie specs states that the ADC_PWR_MODE_STS bit in the
IO_CREG_SLV0_OBSR register must be polled to check if
the requested power mode equals the current power mode.
The bit is set to 1 when requested and current modes match
and the bit is located as the bit 0.

Change-Id: I030d7693d36fb96f09a9cbdd404118674fcb089a
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:22 -05:00
Juan Manuel Cruz
edfe960e02 adc: adds calibration capability for dw driver.
ADC DW IP requires a calibration process each time the
IP recovers from a deep power down mode.

Change-Id: I2e02d1987af9addd9cb08a4e4e8d3848ad5b623c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:22 -05:00
Juan Manuel Cruz
65cb6dbe23 adc: removing MST_CLT and SLV_OBSR offsets
Change-Id: I1d287332036dde399875249580635c2a06fd2b5c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:22 -05:00
L.S. Cook
7e7be98a98 doc: fix overlength in heading underline for consistency.
Change-Id: Ia5d0dae2fe7249090c7986f2bb29fdec9fd9bbc1
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:25:22 -05:00
Andre Guedes
eda4d59404 kbuild: Remove check from non-existing options
This patch removes the checks related to CONFIG_CC_STACKPROTECTOR_
REGULAR and CONFIG_CC_STACKPROTECTOR_STRONG options since these
options don't exist in Zephyr. According to 186ab6552, they were
copied from Linux but further clean up was missing.

Change-Id: I1d8b4f47319a54b68b6f0b5aec1feb0a247e72e9
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-02-05 20:25:22 -05:00
Andrew Boie
123c33a836 x86/iamcu: improve _execute_handler() readability, small optimization
It wasn't immediately clear in _execute_handler() that
enable_interrupts() didn't actually do anything if
CONFIG_NESTED_INTERRUPTS wasn't enabled.

If we are not using nested interrupts, perform small optimization
1) The call to disable interrupts isn't necessary as interrupts
are already disasbled
2) The check for !_nanokernel.nested in a couple places always
evaluates to true if nested interrupts aren't used

Change-Id: I7e66cee0466d03bc1172a572e19389accf6e0e62
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka
d08ac2f241 clock: Make sure the clock is initialized prior to devices
On NANOKERNEL level only of course. Some devices, initialized at this
level, may require to get the clock running already.

Change-Id: Id2dd830d915474aac6c080068c2cf356cf841e0c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka
bcb2e2e45c spi: dw: Rework the logic on testing/setting controller's readyness
Controller should not be enabled while configuring or setting up a
transfer call. It's enabled once the transfer call is ready to proceed,
and disabled once the last interrupt has be raised.

Change-Id: Ib9125a3600971b57e642730682f2b3bfb91b1e02
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka
6021c64844 spi: dw: Add an initialization priority Kconfig option
On Quark SE, SPI might require GPIO to be ready before hand, to emulate
CS, thus providing an option to tweak the intialization priority for SPI
DW driver.

Change-Id: Ifa373948ac8227bf6e4ed1113bcb4dc9139b6663
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka
3ef1517c1a spi: dw: Add Kconfig option to emulate CS through a GPIO pin
It might be necessary to emulate CS through a GPIO pin depending on
these 2 conditions:
- the controller's CS pin is not wired, and thus a GPIO pin is the only
  option
- The controller is unstable at a certain frequency and cannot set/unset
  CS reliably. This is actually a possible issue on DesignWare's SPI
  controller in Quark SE or Quarks D2000 where it has been found
  unstable at 1Mhz and above.

Change-Id: Ib6a06577906c005ddd347070d476a367a9c3da8a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka
655fb9fb2e spi: dw: Fix how internal FIFO is handled
- Refine how DFS is calulated now that it is strictely used to
  manipulate buffer lengths.
- Fix threshold limit
- Tune RX threshold relevantly (reduce it if rx_len is lower than actual)
- Don't push more than available left space in FIFO
- Tune the private structure to lower memory space occupation

Change-Id: I65b1b48b996b2104cebcb24cc366fb4dcbf7d53b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka
bfb8b375a3 spi: Rework constants for better identification
IMR and ISR bits are same, but it stil better to differentiate them
properly. Also fixing naming where all ISR ends with an 'S'.

Change-Id: I2fc1e1d8d2743c3d98f5da40a5f4720a85c4f9a7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka
a4d8e14008 spi: dw: Add support for auxiliariy registers based access
On ARC, the SPI IP block might be accessible only via user extended
auxiliary registers, which requires different instructions to read from
and write to.

Change-Id: I3aa5f223938a9aed7795de4aedc64bd529d62942
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka
4320dffe0f spi: dw: Differentiate ARC to other arch support
Registers offsets are hopefully all the same, but size differs.
On x86, thus 32bits support, CTRL0 or DR for instance are 32 bits r/w.
And DFS on 32 bits support is placed differently as well.

Change-Id: I5115d5c3c9bba71ece4a6f4a1d3d2fdc203c8da1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Ramesh Thomas
3d5351b624 spi: dw:support all frame sizes
Only 8 bit frames were supported. Added support for bigger data frames
which can go up to 32 bits (on 32bits version of the controller, 16 bits
otherwise). Store the frame size in bytes during configure, and use it
during pull/push to read/write correct frame size.

Change-Id: Iae8c55442e0a205403aa3febd1811b36aaf4c5b6
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka
de00223c04 spi: Make sure option are generated according to their dependencies
If SPI_INTEL is not requested, no need to instanciate specific value.

Change-Id: I5f41d919e258e420f2bd099db88ed2259f9cd27e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:21 -05:00
Tomasz Bursztyka
13c2b1ac7b spi: Rename files according to rules
Renaming files as:
<domain>_<model or manufacturer>.<c/h>

Change-Id: I018f6fdb4ba8aac8bb96e848f0f3633bd032b44e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:25:21 -05:00
Tomasz Bursztyka
295078d52a spi: Fix the spi configuration mode documentation
Reported by Ramesh Thomas, the loop mode is included in the mode
configuration and not as a standalone bit. Also rewording word_size
parameter documentation.

Change-Id: I1e3337087316f56d58e843278b9c65e9f4f5476f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:21 -05:00
Tomasz Bursztyka
aad67cbfbc samples: gpio: Add quark_se_ss in the white list
Quark SE SS provides 2 valid GPIO controllers, thus enabling the built
test case for it.

Change-Id: I46c6ceb3d4fe78a87c095e24851d289720524a9c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:21 -05:00