Commit graph

41120 commits

Author SHA1 Message Date
Andrew Boie
e1f2292895 x86: intel64: set page tables for every CPU
The page tables to use are now stored in the cpuboot struct.
For the first CPU, we set to the flat page tables, and then
update later in z_x86_prep_c() once the runtime tables have
been generated.

For other CPUs, by the time we get to z_arch_start_cpu()
the runtime tables are ready do go, and so we just install
them directly.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-24 12:48:45 -07:00
Andrew Boie
f6e82ea1bd x86: generate runtime 64-bit page tables
- Bring in CONFIG_X86_MMU and some related defines to
  common X86 Kconfig
- Don't set ARCH_HAS_USERSPACE for intel64 yet when
  X86_MMU is enabled
- Uplevel x86_mmu.c to common code
- Add logic for handling PML4 table and generating PDPTs
- move z_x86_paging_init() to common kernel_arch_func.h
- Uplevel inclusion of mmustructs.h to common x86 arch.h,
  both need it for memory domain defines

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-24 12:48:45 -07:00
Andrew Boie
33930352f3 x86: intel64: enable MMU region list
Same snippet as in our 32-bit linker file. Creates
an iterable section with all the MMU_BOOT_REGION() info.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-24 12:48:45 -07:00
Andrew Boie
4c0d044863 x86: mmustructs: use Z_STRUCT_SECTION_ITERABLE()
This does the right thing for arches with 8-byte words.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-24 12:48:45 -07:00
Andrew Boie
8ec765b0bf x86: intel64: set up memory sections
Some linker symbols indicating the bounds of various memory
areas needed for setting up boot MMU regions are now in
place.

MMU_BOOT_REGION macros added to align the bounds of these
sections if we're using runtime page tables.

_image_rodata_start moved to the proper place, it was not
accounting for the rodata sections specified in
linker/common_rom.ld.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-24 12:48:45 -07:00
Andrew Boie
46540f4bb1 intel64: don't set global flag in ptables
May cause issues when runtime page tables are installed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-24 12:48:45 -07:00
Andrew Boie
cdd721db3b locore: organize data by type
Program text, rodata, and data need different MMU
permissions. Split out rodata and data from the program
text, updating the linker script appropriately.

Region size symbols added to the linker script, so these
can later be used with MMU_BOOT_REGION().

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-24 12:48:45 -07:00
Alexander Wachter
30ebf52a27 include: drivers: can: Fix zframe to frame conversion
can_copy_zframe_to_frame did not distinguish between the standard and
extended frames. As a result, uninitialized bits were copied to the
destination frame. This commit changes the function to use the correct
bitfields.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-24 21:51:40 +03:00
Carles Cufi
8c2b849ae7 Bluetooth: hci: Fix Create Connection Cancel assert
Since the LE (Enhanced) Connection Complete that comes as part of
cancelling a connection does not come through the priority rx thread in
hci_driver.c, the event class was not being calculated and cached.
Hence, calculate and cache the class whenever an event is received as
part of invoking a command.

Fixes #20110.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-10-24 20:33:59 +02:00
Ulf Magnusson
84da087379 intel_s1000_crb: kconfig: Remove unused I2C_0_DEFAULT_CFG symbol
Unused since commit 7e96ca5d80 ("i2c: Remove non DTS Kconfig params").

intel_s1000_crb probably isn't getting tested in CI, because Kconfiglib
generated a warning for the symbol no longer being given a type, which
would be turned into an error.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-24 12:55:02 -05:00
Henrik Brix Andersen
aefd30cd45 shell: adc: add support for ADC instance 2
Add support for configuring and reading ADC instance number 2.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-10-24 12:49:13 -05:00
Erwan Gouriou
e3b07f3466 west.yml: Update hal_stm32 version
Make of use "make stm32cube a zephyr_library()"


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-10-24 12:47:56 -05:00
Henrik Brix Andersen
e92b108c70 dts: nxp: kinetis-ke1xf-sim: make clkout properties optional
Make the clkout properties of the NXP Kinetis SIM module device tree
bindings optional since not all boards rely on this clock signal for
clocking external peripherals.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-10-24 12:43:48 -05:00
Ulf Magnusson
2b61031c8f kconfig: Remove symbol types from Kconfig.defconfig files
Same deal as in commit 7fdb525754 ("kconfig: Use 'default' instead of
'def_bool' in Kconfig.defconfig files"), but I hacked Kconfiglib to also
find cases where the type is given separately as e.g.

    config FOO
            int
            default 3

Motivation (from a note in
https://docs.zephyrproject.org/latest/guides/kconfig/index.html):

    For a symbol defined in multiple locations (e.g., in a
    Kconfig.defconfig file in Zephyr), it is best to only give the
    symbol type for the "base" definition of the symbol, and to use
    'default' (instead of 'def_<type>' value) for the remaining
    definitions. That way, if the base definition of the symbol is
    removed, the symbol ends up without a type, which generates a
    warning that points to the other definitions. That makes the extra
    definitions easier to discover and remove.

It's also nice if 'def_bool' and the like turn into a semi-reliable flag
that the symbol is only defined in Kconfig.defconfig files. That might
be a sign that things could be cleaned up.

Will do a separate pass later to remove some symbols only defined in
Kconfig.defconfig files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-24 12:40:22 -05:00
Ioannis Glaropoulos
4424356c3b tests: arch: arm: add a test for fatal errors in interrupts
This commit adds a new test suite in tests/arch/arm that
intends to testing system faults inside interrupts.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-24 10:12:08 -07:00
Ioannis Glaropoulos
bb41d56ced arch: arm: do not add CODE_UNREACHABLE in Z_ARCH_EXCEPT
For ARM, Z_ARCH_EXCEPT triggers an SVC to induce a system error.
This code block may be inlined, so, if we want to return from
this error DIRECTLY to thread mode, e.g. if the system error
occurred in ISR context and we are not aborting the current
thread, we must instruct the compiler that the execution
may continue after the inlined SVC. Therefore, we must remove
the CODE_UNREACHABLE statements.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-24 10:12:08 -07:00
Ioannis Glaropoulos
df02923944 kernel: fatal: use nested exception info in z_fatal_error
In z_fatal_error() we invoke the arch-specific API that
evaluates whether we are in a nested exception. We then
use the result to log a message that the error occurred
in ISR. In non-test mode, we unconditionally panic, if
an exception has occurred in an ISR and the fatal error
handler has not returned (apart from the case of an
error in stack sentinel check).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-24 10:12:08 -07:00
Ioannis Glaropoulos
17630f637e arch: arm: internal API to check return execution mode
We add an ARM internal API which allows the kernel to
infer the execution mode we are going to return after
the current exception.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-24 10:12:08 -07:00
Ioannis Glaropoulos
f030608701 arch: add Kconfig to signify ability to detect nested IRQ
We introduce a Kconfig option to signify whether
an Architecture has the capability of detecting
whether execution is, currently, in a nested
exception.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-24 10:12:08 -07:00
Ioannis Glaropoulos
4f11b6f8cf arch: arm: re-implement z_arch_is_in_isr
We re-implement the z_arch_is_in_isr function
so it aligns with the implementation for other
ARCHEs, i.e. returning false whenever any IRQ
or system exception is active.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-24 10:12:08 -07:00
Ioannis Glaropoulos
4aa3f71337 arch: arm: major cleanup and refactoring for fault function
This commit refactors and cleans up __fault, so the function
- reduces to supplying MSP, PSP, and EXC_RETURN to the C
  function for fault handling
- simplifies itself, removing conditional
  implementation, i.e. based on ARM Secure firmware,

The reason for that is simple: it is much better to write the
fault handling in C instead of assembly, so we really do only
what is strictly required, in assembly.

Therefore, the commit refactors the z_arm_fault() function
as well, organizing better the different functional blocks,
that is:
- unlocking interrupts
- retriving ESF
- asserting for HW errors
- printing additional error logs

The refactoring unifies the way the ESF is retrieved for the
different Cortex-M variants and security execution states.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-24 10:12:08 -07:00
Ioannis Glaropoulos
26e4d43916 arch: arm: fatal: add documentation for z_do_kernel_oops()
Add some documentation for ARM-specific function
z_do_kernel_oops, stating clearly that it is only
invoked inside SVC context. We also comment on
the validity of the supplied ESF.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-24 10:12:08 -07:00
Ioannis Glaropoulos
da6c3d14ce arch: arm: swap: add useful inline comment for SVC return
We add a useful inline comment in the SVC handler (written in
assembly), which identifies one of the function return points
a bit more clearly.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-24 10:12:08 -07:00
Anas Nashif
c1ea45280b sanitycheck: enable valgrind checking using an option
Enable valgrind using --enable-valgrind option and fix reporting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-10-24 12:24:48 -04:00
Sebastian Bøe
7358bd342a doc: dtc: Don't incorrectly document that DT uses Kconfig
Remove the documentation that incorrectly says that DT uses
Kconfig. DT no longer has access to Kconfig symbols.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-10-24 11:01:08 -05:00
Sebastian Bøe
e79768c2df dtc: Remove support for common.dts
Remove the common.dts file which has been used for a year.

common.dts at one point allowed us to conditionally add an MCUBoot
overlay based on Kconfig.

but since DT lost access to Kconfig options it has been unused.

The overridable variable DTS_COMMON_OVERLAYS, which by default points
to common.dts, is also unused in-tree, and any out-of-tree usage can
be ported over to use DTC_OVERLAY_FILE instead, so we remove the
variable as well.

This simplifies the configuration system.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-10-24 11:01:08 -05:00
Joakim Andersson
32ee9370bb Bluetooth: UUID: Fix documentation for BT_UUID_128_ENCODE
Documentation for BT_UUID_128_ENCODE does not match the actual names.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-10-24 18:48:50 +03:00
Mohamed ElShahawi
55471982f6 esp32: drivers: Add Entropy Device tree support
- Add TRNG module to esp32.dtsi
- Updated the note about TRNG register address

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2019-10-24 09:09:41 -05:00
Kumar Gala
22e7449b73 kconfig: Introduce typed dt kconfig functions
Replace:
  dt_chosen_reg_addr
  dt_chosen_reg_size
  dt_node_reg_addr
  dt_node_reg_size

with:
  dt_chosen_reg_addr_int
  dt_chosen_reg_size_int
  dt_chosen_reg_addr_hex
  dt_chosen_reg_size_hex
  dt_node_reg_addr_int
  dt_node_reg_size_int
  dt_node_reg_addr_hex
  dt_node_reg_size_hex

So that we get the proper formatted string for the type of symbol.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-24 08:51:06 -05:00
Kumar Gala
2d7303e13f Revert "kconfig: Fix wrong partition size by changing type of FLASH_LOAD_SIZE"
This reverts commit f065eb4271.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-24 08:51:06 -05:00
Sebastian Bøe
8435be81f8 rand32: cmake: Fix invalid build scripts
The build scripts for the tests/crypto/rand32 test has been invoking
'zephyr_include_directories' in an invalid way. They have presumably
been trying to modify the 'app' library, but have in effect being
modifying the global environment, in an invalid way nonetheless.

This patch fixes the build script to modify the 'app' library only.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-10-24 08:28:15 -05:00
Alexey Brodkin
19d4caaaab arch: arc: Implement z_arch_system_halt()
"brk" is a break-point instruction which among other things
halts ARC core. As compared to pure halt (which is "flag 1" for ARC)
it is much more convenient as it might be executed from either
secure mode or normal mode (with SecureShield enabled), while "flag"
instruction will raise privilege violation exception if SecureShield
is enabled and we're in "normal" mode.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2019-10-24 13:26:41 +02:00
Maksim Masalski
11d6385ebe tests: remove duplicate names for the net tests
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-10-24 06:31:48 -04:00
Maksim Masalski
432bb69bab tests: remove duplicate names for the boards tests
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-10-24 06:31:06 -04:00
Maksim Masalski
e9d7565d66 tests: remove duplicate names for the bluetooth tests
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-10-24 06:29:17 -04:00
Maksim Masalski
b2bf7e76d0 tests: remove duplicate names for the libraries tests
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-10-24 06:27:30 -04:00
Maksim Masalski
6882d97531 tests: new updated names for the kernel tests
After run Sanitycheck script I found out that some test cases
have the same test case name in the test result .xml file.
To get rid of it, I decided to change test cases names
for the kernel tests.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-10-24 06:25:53 -04:00
Maksim Masalski
2c5be79e25 tests: remove duplicate names for the shell tests
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-10-24 06:24:49 -04:00
Alexander Wachter
1b88658f9f samples: driver: Extend CAN sample
This commit adds sample code for bus state checking.
Printing the counter state is moved to own thread because the
ISR was blocking too long (messages were lost)

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-24 12:28:01 +03:00
Alexander Wachter
c0da8a7901 drivers: can: Extend CAN API for bus-state management.
This commit extends the CAN API with the following functions:
- can_get_state
- can_recover
- can_register_state_change_isr

This functions can be used to get the error-counters and the state
of the CAN controller. The recover function can be used to recover
from bus-off state when automatic recovery is disabled.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-24 12:28:01 +03:00
Ulf Magnusson
1f046d86a0 native_posix: kconfig: Fix misplaced USB_NATIVE_POSIX default
Should be within the 'if BOARD_NATIVE_POSIX`, or USB_NATIVE_POSIX will
get enabled whenever USB is (unless a user value overrides it).

Probably didn't cause any problems, since
boards/posix/native_posix/Kconfig.defconfig is only included for this
board.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-24 09:51:00 +02:00
Ioannis Glaropoulos
f00429cc2f boards: arm: nucleo_g071rb: include MPU in HW features
Include ARM MPU in the list of supported features
in nucleo_g071rb platform.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-24 09:19:46 +02:00
Maksim Masalski
813ef68554 tests: updated names for the tests
Some test cases have the same test case name.
To get rid of it, I decided to change test cases names
contained same names.
Please check my logic, how I give them names.
Usually trying to give name same as a directory folder.
There are still more test cases which necessary to change,
but I will make changes by small steps.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-10-23 23:15:41 -04:00
Maksim Masalski
d85b45b072 tests: updated names for the arch interrupt tests
Test case arch.interrupt have same test case name
for different architectures. To get rid of it,
I decided to change test cases names.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-10-23 23:13:13 -04:00
Scott Worley
c8b1eb79a1 drivers : spi : mec1501 : XEC SPI driver
SPI driver for MEC1501 QMSPI supporting synchronous only.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-10-23 19:18:32 -07:00
peng1 chen
f20084ff1c Code Coverage: Fix the issue of function code coverage in thread.c
The k_thread_state_str is a new function added into
kernel/thread.c recently which was used to return
the human friendly thread state, so it hasn't been
called by other existing code.
In order to improve the function code coverage, we
just replace the "th->base.thread_state & _THREAD_PENDING"
code by using k_thread_state_str function in
tests/kernel/sched/preempt/src/main.c, because
k_thread_state_str function is realized by judging
the thread_state member to return the thread state.

Signed-off-by: peng1 chen <peng1.chen@intel.com>
2019-10-23 19:16:24 -07:00
Marti Bolivar
52c7df6014 doc: west fixes and updates to manifest.rst
Some of this information is stale and needs to be fixed.

Try to make a few other things clearer while we're here.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-10-23 21:02:02 -04:00
Andrzej Puzdrowski
61481b6981 doc: include flash page layout API
Flash page layout API was omitted by documentation as it
is optional.
Added tag which turn it on to doxygen setup which allows
to include missing API documentation.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-10-23 20:59:26 -04:00
Johann Fischer
f00b272711 boards: reel_board: revise SPI routing
Revise SPI routing. Use slower SPI_1 for EPD and
SPI_3 for expansion connector.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-10-23 20:58:19 -04:00
Johann Fischer
39708536ba samples: mesh_badge: allow to build for any version of the reel board
Allow to build sample for any version of the reel board.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-10-23 20:58:19 -04:00