Commit graph

19237 commits

Author SHA1 Message Date
Benjamin Walsh
cdf8123589 sys_clock: remove global variables duplication
Some global variables were duplicated, being defined in either
k_ticker.o or nano_sys_clock.o depending on the type of kernel.
nano_sys_clock.o is always generated, so move the definitions found in
that file from inside the NANOKERNEL guard and remove them from
k_ticker.c to avoid useless duplication.

Change-Id: Iea67f89cad44b29671df7fa4d573105c0bbe3102
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:53 -05:00
Benjamin Walsh
ba31ab92a3 x86: refactor assembly flags in Makefiles
Add comment regarding the use of GAS when using clang, and remove
duplication of setting -Wa,--divide, which is needed for all toolchains.

Change-Id: Iab7257b038d1f4142c37a6c6c5979ef28f78a655
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:53 -05:00
Benjamin Walsh
4c57acb883 x86: split ABI related files
Move the files that *know* about the calling convention in use by the
compiler. The routines exposed by the files moved to the i386_sysV_abi
directory follow the C calling convention specified by the
i386_sysV_abi which is the default for GCC. The upstream GCC has been
enhanced to support the iamcu_ABI that is optimized for processors
that implement the IA MCU instruction set. This new ABI provides code,
data and stack size improvements on IA MCU based systems.

This change is the first step in adding support for the IA MCU
optimized toolchains to Zephyr OS

Change-Id: I13bffee8007fb3f82aa31389b2c241065e8e315d
Original-work-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis
8c658e11b1 nanokernel: Add task_sleep()
This routine allows the background task to sleep for a specified
number of ticks.

Change-Id: I2533005e3d9a564c2ca0de8333e224743cefb658
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis
e63ceae6b4 nanokernel: Move fiber_sleep() to nano_sleep.c
Change-Id: I5faaa44cf40a3d2d31a37e3b84cbef3c8dacff32
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis
28dc08435c doc: Fix fiber_sleep() description
Change-Id: I3582c9267efa28ac8626d42fdf3b709f362a3c9b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis
42bb6227dc doc: Change "None" return value to "N/A"
Improves documentation consistency by using "N/A" instead of "None"
when the routine does not return a value.

Change-Id: I429a159b3037742cbc431db0cb4828ab9d6d35c3
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis
699b4ee03d nanokernel: Add generic stack routines
Adds the following generic stack routines:
	nano_stack_push()
	nano_stack_stack_pop()
	nano_stack_pop_wait()

Those routines are convenience wrappers for invoking the task, fiber and
ISR (if applicable) specific implementations.

Change-Id: I6e7bb2ca69bb2e3d5ed955654390746e76e4ab92
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis
836eaee18a nanokernel: Add generic semaphore routines
Adds the following generic semaphore routines:
	nano_sem_take()
	nano_sem_take_wait()

Those routines are convenience wrappers for invoking the task, fiber and
ISR (if applicable) specific implementations.

Change-Id: I09d715d07263eb0ee526231120ba65d1e3feebce
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis
16c7452f6b nanokernel: Add generic lifo routines
Adds the following generic lifo routines:
	nano_lifo_put()
	nano_lifo_get()
	nano_lifo_get_wait()
	nano_lifo_get_wait_timeout()

Those routines are convenience wrappers for invoking the task, fiber and
ISR (if applicable) specific implementations.

Change-Id: I5252e4643fe4772f1309b26c1b3e4319f5035956
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis
829967786c nanokernel: Add generic fifo routine
Adds the following generic fifo routine:
	nano_fifo_get_wait_timeout()

That routine is a convenience wrapper for invoking the task or fiber
specific implementation.

Change-Id: I9bd709ea416db834e2a0c5de81257c363e7db066
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis
3d2afc63c0 nanokernel: Add generic timer routines
Adds the following timer routines:
	nano_isr_timer_start()
	nano_isr_timer_stop()
	nano_isr_timer_test()
	nano_timer_start()
	nano_timer_stop()
	nano_timer_test()
	nano_timer_wait()

Change-Id: Ib93f2ef2ffaa12dea3ddb52e9f3ae758b2987300
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Anas Nashif
81057e7596 build: show supported boards when running 'make help'
This lists all supported board by looking at configs/ and other
locations with defconfig files.

Change-Id: I48ed260543adfeacbc089f403f948010ea6f978e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:53 -05:00
Anas Nashif
c47769bd56 kconfig: move all defconfig fragments to configs/
When building for a certain platform, we have no idea
what architecture we are building for.

We used to specify the architecture alongside the board or platform
name and this was used to find the defconfig in arch/<arch>/configs.

By putting all board configurations we support in one place we do
not have to specify the architecture, just the configuration name.

Change-Id: Ib7e9f63b9a8051714dc207f583fd26ef620497d8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:53 -05:00
Anas Nashif
df73d32147 build: use architecture definition from kconfig
Do not depend on host architecture and use architecture definition
from the defconfig file of the board.

Change-Id: Idb3dd42524f26bd167a34d6eb024d4d9816e9730
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
77ba3c3b8b kconfig: define architecture as a kconfig variable
Do not depend on environment variables and use a kconfig variable
for defining the architecture.

In addition, remove the X86_32 variable, it just duplicates X86 for
not good reason, at least until start supporting MCUs with 64bit.

Change-Id: Ia001db81ed007e6a43f34506fed9be1345b88a4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
b2bbf5a7b7 arc: only build configured platform
Use CONFIG_PLATFORM to only build the selected platform. This
makes the makefile with drop-in platforms, does not need to be
changed for any new platforms.

Change-Id: I21f4bd88b04a7e53bc80b9710b1e7668def4e407
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
4ca036074d arc: use kconfig wildcards
Use CONFIG_PLATFORM to only build the selected platform. This
makes the makefile with drop-in platforms, does not need to be
changed for any new platforms.

Change-Id: I8720ba1501b6e1929bfec294f5bb1c7466d65049
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
b533cdc302 arm: remove repeating cflags in Makefiles
Do not repeat the same flags for every added platform. Define
the common flags on the architecture level instead.

Change-Id: I0e501d6a909892dd682b106fb2a5072434a39563
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
3816104619 arm: only build configured platform
Use CONFIG_PLATFORM to only build the selected platform. This
will enable support for drop-in platforms. Makefile will not need
to be changed for every new platforms.

Change-Id: I22778e8242422e487e941143df3e521b33f2b0a8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
c3a7fd2844 arm: use wildcards for kconfig
Move platform related data and definition to the platform
directory and include it using:

arch/<arch>/platforms/*/Kconfig.platform

This way we will able to add a platform as a directory of
content without the need to change and Kconfig files.
Platforms can then be included by reference (using repo or
git submodoules)

Change-Id: I6bff4e48490e33cbaf879fe3c424bf2f6a4887ac
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
cd158f3750 x86: only build configured platform
Do not reference every platform, instead use the platform
name to tell make what to build.

Change-Id: I7498da7cdcdada754466222902f59fe4c6487d89
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
24da31f7fa kbuild: support makefile wildcards
Change-Id: I7482899718da02975949c362045b4f09e117c27b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
a4266c3baf kconfig: use wildcards for platforms
Move platform related data and definition to the platform
directory and include it using:

arch/<arch>/platforms/*/Kconfig.platform

This way we will able to add a platform as a directory of
content without the need to change and Kconfig files.
Platforms can then be included by reference (using repo or
git submodules and does not need to be part of the zephyr
project)

Change-Id: I5e71f5394c22edb346f7d61d9448b8e1c68e1f9b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
90f07a9dd0 doc: support globbing when creating kconfig docs
When generating documentation for kconfig options, support
wildcards to be able to parse all relevant files.

Change-Id: Ifa565e3809996fcd13b0f15d61a4ffb108c1aa0a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
6e23ff44ef kconfig: support wildcards
This allows using wildcards with kconfig files so there is no need
to include individual files within a well define tree structure.

For example, you add

source "drivers/*/Kconfig"

and all Kconfig files under drivers/ will be sourced and the order in
menuconfig will be based on the wildcard processing, not in any particular
order.

The main advantage here is that drivers and platforms become drop-ins, a platform
or a driver can be added by just placing it in the right place without having to
change system Kconfig files or Makefiles (Makefiles will be supported in other change).

Change-Id: Id223ba10e6f48b4c48435e9ea37885162ce55e7c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Yonattan Louise
2ccaed8720 Adapt fixdep to support Windows.
Text files on windows are be created with a different format
for line endings. This commit improves the host tool 'fixdep' to
support files with the windows-style line endings.

Change-Id: I1d120790c5cbb1f1e7df6761821bc7e01c99b988
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:52 -05:00
Yonattan Louise
b8a0d15784 gen_idt: Change the custom host identifier macro.
In order to keep the code compatibility with Linux and Windows, the flag
O_BINARY is defined as zero when we are compiling in a Linux host. But
when compiling in a Windows host, we have to use the definition of the
flag provided by the host's includes. Currently, there is a custom macro
to identify if the host is a Windows host. This commit change that custom
macro for the macros that compilers provide to avoid defining a new one.

Change-Id: Ifeeab17c68d07039bd5b4a80c8263d338e6448ce
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:52 -05:00
Tomasz Bursztyka
39621510e2 Kconfig: quark_se-x86: Set proper default config settings
Provide the proper irq for i2c, gpio and spi. And make relevant drivers
getting enabled easily once their domain is selected.

Change-Id: Ib8a428e11b6163a1b370b23baa34ea2fab733565
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:52 -05:00
Tomasz Bursztyka
7c0155acd3 i2c: dw: Fix support for i2c port 1
- Provide the irq flags to IRQ_CONNECT_STATIC
- Provide the actual IRQ for that controller

Change-Id: If660baca7e92065cfdb588a2ae86ff13da0918eb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:52 -05:00
Tomasz Bursztyka
49ea925727 quark_se-x86: Provide the i2c IRQ flags
Without that, it won't built when enabling support for dw i2c in
quark_se-x86.

Change-Id: Icce26488d870c273516dc9f34555176122bcb9c8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:52 -05:00
Tomasz Bursztyka
14267b85c9 spi: dw: Fix various building and support issues
- Build the actual driver when relevant
- Provide the IOAPIC stub
- Provide the IRQ flags for IRQ_CONNECT_STATIC
- Set the default IRQ priorities

Change-Id: Iea20ef67c92cf7f48791fba5a8021448b7059950
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:52 -05:00
Tomasz Bursztyka
d47f91893d gpio: dw: Fix build error when configuring dw driver with direct IRQ
SYS_GET_DEVICE() needs the name set in DECLARE_DEVICE_INIT_CONFIG() not
the one in IRQ_CONNECT_STATIC().

Change-Id: Id1ed66953c863531411b34594ffed669ad524ef5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:52 -05:00
Tomasz Bursztyka
8ae3b9d2d4 gpio: dw: Provide IRQ flags for GPIO 1
That fixes a build error. Platfom's board.h have to provide such flags
if they enable dw gpio 1 controller.
Take the opportunity to provide the right isr to IRQ_CONNECT_STATIC.

Change-Id: I16900ea04f7f7c5d3c99b93a92b00c1f651494de
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:52 -05:00
Szymon Janc
c0baad2262 Rename simple UART driver to pipe UART
Original name was too generic and confusing. This patch renames
driver to pipe UART and moves it to console drivers folder. Kconfig
destription is also improved.

Change-Id: I716fdbf7d636bbdc03b0fce27a59fd866f473246
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:52 -05:00
Szymon Janc
341f81bd81 Bluetooth: SMP: Refactor keys handling
This refactor the way stored keys are handled to avoid overwriting
existing keys with new keys in case of pairing failed. Main goal is
to delay update of keys (including type and encryption size) until
link is succesfully encrypted with new key (legacy STK or LE SC LTK).

To fix this properly, TK is used to store STK or LE SC LTK and updates
of keys properties are done only on successfull encryption. This makes
code less error prone since update is done only in one place in code.
Also quering SMP code for current key makes sure that correct keys is
used in case of re-pairing.

Change-Id: I6b9e3d8229de522143e0d1fbfe0bd8223dad2a56
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:52 -05:00
Szymon Janc
aa1226f0a9 Bluetooth: SMP: Fix not caching keys on security request
There is no need to always look-up for keys on security request.
Instead use cached keys if present, if not update cache.

Change-Id: I375842beb4c461418aea6a40350f797ca7b6264c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:52 -05:00
Szymon Janc
809c03b835 Bluetooth: SMP: Fix lookup for CSRK keys
Looking up for CSRK to sign local PDU or verify remote signature
shouldn't add those keys in case those are not present (which is
done by get function).

Change-Id: Iec271a9dddd2cd319f153cec6e19fc2408ee0896
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:52 -05:00
Jukka Rissanen
65a240cd2d net: 802.15.4: Start to send beacons if configured so
If the beacon support is activated, then we join the network
and start to send beacons.

Change-Id: Iffd0f05008e6a2463debb53ca73eb142ff60488a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:52 -05:00
Jukka Rissanen
569fc7cf8e net: 802.15.4: Add debugging support for beacon handling
Change-Id: Ia6f189f723815b72b46c7954a691759910c42979
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:52 -05:00
Jukka Rissanen
faa218f53f net: 802.15.4: Add beacon statistics support to Kconfig
User can enable 802.15.4 beacon statistics support.
The 802.15.4 stats are printed periodically together with other
statistics.

Change-Id: I844a27224017a9d28cdbc166471523aa366da315
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:52 -05:00
Jukka Rissanen
20886743f6 net: 802.15.4: Add beacon support selection to Kconfig
User can select whether the beacon support is activated or not.

Change-Id: I8fd22af73cfca0dd4f2182bf98bc4b3571ac1f8f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:51 -05:00
Szymon Janc
073d8fe9e7 Bluetooth: SMP: Refactor LE SC LTK and DHKey Check code
This refactor code that is used to generate LTK and DHKey check value.
Duplicated code is factored to helpers reducing code size. Resulting
code is simpler and much easier to understand.

Change-Id: I1bb5a72959b9196bc472f069e9be5857d38dbcad
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:51 -05:00
Mariusz Skamra
105f052992 Bluetooth: tester: Handle Exchange MTU command
This patch adds Exchange MTU command handler to the tester.
It allows to test if GATT Client can initiate MTU Exchange Procedure.

Change-Id: I2e50cec27fb7b944f57a4a6487138adbf126bad4
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:51 -05:00
Grzegorz Kolodziejczyk
49eab1402c Bluetooth: Extend BTP Specification to cover SM routines
This adds protocol specification for SM.

Change-Id: I9c6ef377d0e4ad261e466dfed3a35713cf79de12
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:24:51 -05:00
Arkadiusz Lichwa
baf2f4d28e Bluetooth: Cleanup LE ACL Tx semaphore
Makes consistent and compact ACL Tx semaphore namespace

Change-Id: Ief357e02ff7c3e1c6b7667dc27f057a3499cf1c4
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:24:51 -05:00
Arkadiusz Lichwa
c4a503b6b4 Bluetooth: BR/EDR: Use correct ACL Tx MTU and semaphore
Selects right ACL Tx MTU and semaphor based on connection link type
and indirectly controller buffers capabilities.

Change-Id: I1df1ba81e6b09d9d5bdcd34a93d9a3d255133143
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:24:51 -05:00
Arkadiusz Lichwa
746ae052ca Bluetooth: Refactor ACL Tx packet users
Make and use helper functions to get ACL Tx packets max length (MTU)
and get semaphore syncing out Tx packet to controller.

Change-Id: I52f60a71c6b179ff300b4fd21da27174e9d825d9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:24:51 -05:00
Luiz Augusto von Dentz
7d2d2838fb Bluetooth: L2CAP: Implement segmentation for incoming packets
If the SDU length is bigger than the amount data received in the first
packet it means it will be segmented in 2 or more packet until the SDU
is completed.

Since the MTU required by the upper layer could be much bigger than the
ACL buffer the code now request a buffer to reassemble the SDU.

Change-Id: I286d16e185f59a8128c4357dddebdc13145dfe31
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:51 -05:00
Luiz Augusto von Dentz
81af3feb01 Bluetooth: L2CAP: Use semaphore to control credits
This use struct nano_sem to control the credits so when sending if the
credits hit zero it now waits more credits to continue instead of
failing.

Change-Id: I2da4692eaa16828f74a1df4346583258bb4cf8f0
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:51 -05:00