Commit graph

19237 commits

Author SHA1 Message Date
Inaky Perez-Gonzalez
eb5ff2606f doc/linux: pip installs in user area vs system wide
When installing packages with PIP, recommend --user so that it is
installed in the user's directory vs system wide, potentially
overriding system-wide files that are under package manager control
and introducing possible security issues.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-07-25 18:05:10 -04:00
Inaky Perez-Gonzalez
cb290aa708 doc/linux: recommend install pip3 from distro packaging
Avoid overriding files in the system that shall be under package
manager control with who knows what is downloaded that day, as it can
introduce security issues.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-07-25 18:05:10 -04:00
Michael Scott
c58be92208 samples: net: irc_bot: fix stack declarations
kernel APIs have changed to using K_THREAD_STACK_DEFINE to declare stack
memory as well as K_THREAD_STACK_SIZEOF to calculate it's size.

Adjust irc_bot sample to reflect those changes.

This fixes stack related page faults when running irc_bot with
CONFIG_X86_STACK_PROTECTION enabled (which it is by default for qemu).

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-07-25 18:01:32 -04:00
Kumar Gala
ebc948d818 tests: net: limit tests to boards with enough memory to build them
A number of the network tests have minimal memory requirements that not
all boards are able to meet.  Add in those memory requirements so we
don't attempt to build these tests for those platforms.  Utilized the
frdm_kl25z (with 16K of memory) and cc2650_sensortag (with 20K) to test
the limits.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-25 15:51:18 -05:00
Yannis Damigos
1bd908088b dts: arm: Update I2C defines in fixup files
Update the I2C defines in fixup files after the introduction
of cell prefix to interrupts-names generated defines

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-07-25 13:25:42 -05:00
Andrew Boie
3aecba10f7 scripts: add version check for pyelftools
Versions before 0.24 have string handling issues in Python 3.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 13:41:16 -04:00
Kumar Gala
0e7067c6be arm: dts: cleanup uart related Kconfig options
Now that we generate BLUETOOTH_UART_ON_DEV_NAME, UART_PIPE_ON_DEV_NAME,
and BLUETOOTH_MONITOR_ON_DEV_NAME Kconfig defines for dts enabled
platforms add those into the appropriate dts files and remove from the
various board/Kconfig.defconfig files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-25 12:23:20 -05:00
Kumar Gala
a45dac0bd1 dts: fix Kconfig enablment of BLUETOOTH_MONITOR_ON_DEV_NAME
Since we generate BLUETOOTH_MONITOR_ON_DEV_NAME based on dts we need a
!HAS_DTS check around it.  Otherwise we can get into odd build errors.
Its also possibly that we don't specify "zephyr,bt-mon-uart" and in that
case we default to CONFIG_UART_CONSOLE_ON_DEV_NAME (ie 'zephyr,console'
on DTS platforms).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-25 12:23:20 -05:00
Erwan Gouriou
9f374d9d9c script: extract_dts_includes: Add cell prefix to interrupt-names
Cell prefix was missing to interrupts-names generated defines

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-25 11:18:05 -05:00
Andrew Boie
416eca5b13 tests: fatal: enable x86 MMU stack protection
Show that this mechanism can detect stack overflows with the
guard page. We only do it once since are are in an alternate
IA HW task after it happens.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
19fdf4d6f8 qemu_x86: enable MMU stack protection by default
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
054d47b29c x86: set stack guard page non-writable
This will trigger a page fault if the guard area
is written to. Since the exception itself will try
to write to the memory, a double fault will be triggered
and we will do an IA task switch to the df_tss and panic.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
0fab8a6dc5 x86: page-aligned stacks with guard page
Subsequent patches will set this guard page as unmapped,
triggering a page fault on access. If this is due to
stack overflow, a double fault will be triggered,
which we are now capable of handling with a switch to
a know good stack.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
befb0695ba kernel.h: add note about K_THREAD_STACK_SIZEOF()
Each member of the array may need to have a padding size added
such that the base address of each array element corresponds to
the desired stack alignment.

This would mean that sizeof(some array element) would return
a larger size than what was originally provided.

This won't cause problems at runtime since the space is really
there, but for users who are only enabling this padding for
debug features, they may be surprised when their stacks are
effectively smaller than when this was enabled.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
861b269128 sys_kernel: fix stack declaration
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
c3fce81d13 tests: fatal: fix stack size to k_thread_create
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
6101aa6220 x86: add API for modifying page tables
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
bc666ae7f7 x86: implement improved double-fault handler
We now create a special IA hardware task for handling
double faults. This has a known good stack so that if
the kernel tries to push stack data onto an unmapped page,
we don't triple-fault and reset the system.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
08c291306e x86: generate RAM-based GDT dynamically
We will need this for stack memory protection scenarios
where a writable GDT with Task State Segment descriptors
will be used. The addresses of the TSS segments cannot be
put in the GDT via preprocessor magic due to architecture
requirments that the address be split up into different
fields in the segment descriptor.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
8a102e44ed x86: allow IDT vectors to be task gates
This has one use-case: configuring the double-fault #DF
exception handler to do an IA task switch to a special
IA task with a known good stack, such that we can dump
diagnostic information and then panic.

Will be used for stack overflow detection in kernel mode,
as otherwise the CPU will triple-fault and reset.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
ddf9f4be31 x86: convert gen_idt to Python
This is one less host tool we have to compile for every build,
and makes the build tools more portable across host OSes.
The code is also much simpler to maintain.

Issue: ZEP-2063
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
dff21de082 x86: add CONFIG_X86_STACK_PROTECTION
This enables the MMU-based stack protection feature,
which will cause a fatal error if a thread overflows
its stack in kernel mode, at a nontrivial cost in memory
(4K per thread).

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Erwan Gouriou
84fce262f9 dts: arm: st: Factorize STM32L4 series soc dtsi files
In order to simplify maintenance of dts files for
stm32f4 series, introduce a stm32l4.dtsi file which
represent the smallest common denominator of IPs in
the family.
This allows to fix usart4 availability on stm32l432
which was not correct.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-25 10:10:32 -05:00
Erwan Gouriou
9f88663079 dts: arm: st: Factorize STM32F3 series soc dtsi files
In order to simplify maintenance of dts files for
stm32f1 series, introduce a stm32f3.dtsi file which
represent the smallest common denominator of IPs in
the family.
Besides, stm32f334 includes stm32f303, as it is a
extension of this SoC.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-25 10:10:32 -05:00
Erwan Gouriou
851efe0cc6 dts: arm: st: Factorize STM32F1 series soc dtsi files
In order to simplify maintenance of dts files for
stm32f1 series, introduce a stm32f1.dtsi file which
represent the smallest common denominator of IPs in
the family.
Besides, stm32f103Xe includes stm32f103xb, as it is a
extension of this SoC.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-25 10:10:32 -05:00
Marti Bolivar
3dd63b60a7 build: export generated DTS configuration
This can be just as important as the contents of auto.conf.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-25 09:57:07 -05:00
Marti Bolivar
497f8fd40a build: export flashing and debugging info, when present
Zephyr supports the flash and debug targets via per-board information
in Makefile.board files.

It is sometimes convenient to know this information when inspecting
the build artifacts or doing exotic builds, so include it in the file
generated by outputexports. The information in Makefile.board provides
what is needed.

Therefore, ensure that Makefile.board, when present, is included by
the generated Makefile.export. This gives users of Makefile.export
access to variables like FLASH_SCRIPT, PYOCD_TARGET, etc. (These users
need to cope with these variables being undefined if not given in
Makefile.board, or if Makefile.board does not exist for a target.)

While we're here, don't export INSTALLKERNEL. That's Linux-specific
and otherwise unused; the Zephyr equivalent is FLASH_SCRIPT and its
associated variables.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-25 09:57:07 -05:00
Jukka Rissanen
45eac217a2 net: tests: Enable net tests for all suitable platforms
Instead of only running net tests in qemu_x86, enable those
tests in all suitable platforms. The tests are disabled for
bbc_microbit as that platform does not have enough memory.

The tests/net/arp and tests/net/ieee802154/l2 are disabled
for qemu_xtensa as the qemu crashed when running the tests.
For tests/net/all there was a weird build error for qemu_xtensa
so that test is also disabled for that platform.

Increased the trickle timeout to 3 secs in tests/net/trickle as
occacionally there was timeout error in qemu_cortex_m3 when the
test was run.

Jira: ZEP-2398

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-25 10:46:44 -04:00
Erwan Gouriou
f8240018d0 dts: arm: Add clocks u(s)art on stm32 family
Add "clocks" property on u(s)arts nodes on stm32 socs
Add a dt clocks binding file and rework clock_control
header file include new device tree binding file.
include/dt-bindings folder is introduced as dt-bindings
placeholder

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-25 09:30:26 -05:00
Erwan Gouriou
c8852fb379 dts: stm32: Add rcc node on stm32 socs
This commit provides rcc nodes to all stm32 based socs.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-25 09:30:26 -05:00
Erwan Gouriou
b9c39b9b7e dts: arm: stm32: Add rcc node yaml descritpion
Provide rcc node yaml description for stm32 socs

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-25 09:30:26 -05:00
Erwan Gouriou
69b59fdeb3 dts: common: yaml: Update uart yaml with new properties
Update  uart yaml files to provide new properties:
-"interrupts-name"
-"pinctrl"

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-25 09:30:26 -05:00
Kumar Gala
6ec63522cc board: arduino_101: remove unused !HAS_DTS bits
Since HAS_DTS is always defined for arduino_101 the board specific
Kconfig bits associated with !HAS_DTS are never used, so lets remove
them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-25 09:09:11 -05:00
Savinay Dharmappa
dca22fa983 dts: tinytile: Add device tree support for tinytile board
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-07-25 08:58:14 -05:00
Nam Do
f04e0cde46 boards: arm: doc: Fix problems in nrf52_vbluno52 document
This patch fix problems in nrf52_vbluno52 document:
+ Delete `Segger RTT` from supported features
+ Add `5.0` version to Bluetooth Low Energy feature

Signed-off-by: Nam Do <robotden@gmail.com>
2017-07-25 06:08:05 -04:00
Jukka Rissanen
68ced8035d net: Add missing __cplusplus checks to includes
Some of the public networking include files did not had
__cplusplus checks.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-24 14:54:34 -04:00
Leandro Pereira
f5a8d498ea scripts: Convert gen_offset_header to Python
By having this as a Python script rather than a host executable, this
should simplify the build process on non-Unix platforms.

With this change, pyelftools is now required to build Zephyr.  Please
consult the getting started documentation for your host platform for
installation instructions.

Jira: ZEP-2062

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-07-24 11:20:04 -07:00
Johann Fischer
bc2454fa9e samples: usb: add usb.rst and README.rst for CDC ACM sample
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-07-23 07:41:57 -04:00
Johann Fischer
1ff51986e5 samples: cdc_acm: use Arduino 101 as default board
Be consistent with other usb samples and use Arduino 101
as default board.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-07-23 07:41:57 -04:00
Yannis Damigos
c78c452315 doc: system_log: Fix global Kconfig options path
This patch fixes global Kconfig options path for system logging.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-07-23 07:01:18 -04:00
Anas Nashif
35a70b41dd doc: add python pip requirements.txt
List all required modules in one file and just call pip with this
file to install all needed modules instead of listing them
individually.

Added gitlint and pyocd and other required packages to the list.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-22 14:04:20 -04:00
Andrew Boie
a717050140 qemu_x86: terminate emulator on fatal system error
This will cause sanitycheck runs to finish more quickly
instead of sitting there waiting on a timeout. We already
do this with the Xtensa simulator.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-22 09:46:26 -04:00
Anas Nashif
f2841b1a99 CODEOWNERS: more tweaks
Do not apply source code wide wildcard to idenitify the missing portions
of the code that need entries. the * entry will be added at a later
stage when we have more coverage.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-22 05:58:08 -04:00
Anas Nashif
7c8ff7524e CODEOWNERS: more github handles
Now we have all emails converted to github handles.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-22 05:49:06 -04:00
Vinayak Kariappa Chettimada
255e5cc344 Bluetooth: controller: Implement Read/Write Auth Payload timeout
Added implementation to support HCI Read Authenticated
Payload Timeout Command and HCI Write Authenticated Payload
Timeout Command.

This fixes:
TP/SEC/SLA/BV-08-C [No response to LL_PING_REQ]
TP/SEC/SLA/BV-09-C [Modified Authentication Payload Timeout]
TP/SEC/MAS/BV-08-C [No response to LL_PING_REQ]
TP/SEC/MAS/BV-09-C [Modified Authentication Payload Timeout]
conformance tests in LL.TS.5.0.0.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-07-22 11:55:35 +03:00
Paul Sokolovsky
4732452a42 samples: bluetooth: ipsp: Bump max number of contexts
This sample includes builtin UDP and TCP echo servers, max
MAX_CONTEXTS=3 as set previously, they just didn't work.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-22 10:33:29 +03:00
Anas Nashif
ddfb2b790a CODEOWNERS: use github handles
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-21 20:36:00 -04:00
Yannis Damigos
c6a381f5e1 dts: intel_quark_d2000: Add device_type and reg in cpu node
Add device_type and reg properties in cpu node

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-07-21 12:20:49 -05:00
Yannis Damigos
1a652e3ef1 dts: Remove memory node from skeleton dtsi file
Remove memory node from skeleton dtsi and add device_type
property in every memory node in soc dtsi files

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-07-21 12:20:49 -05:00
Yannis Damigos
399a6bec0f dts: arm: Add unit-address component to memory and flash nodes
This patch add the unit-address component to memory and flash
nodes. According to the DT specification, the unit-address of
a node must match the first address specified in the reg
property of the node.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-07-21 12:20:49 -05:00