Commit graph

245 commits

Author SHA1 Message Date
Tomasz Bursztyka d99c59ead1 tests: Align all drivers using user_data for callback
s/callback_arg/user_data

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-07-30 09:48:00 +02:00
Tomasz Bursztyka fe71673167 tests: Apply DMA callback change to relevant tests
Now the dma device instance is passed as parameter to the callback.

Fixes #26923

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-07-30 09:48:00 +02:00
Anas Nashif 7c85f4b2f5 samples: remove board_shell
This sample is not working on all boards anymore. Adding every single
shell we have to the prj.conf does not work on every board, due to
missing features.

Instead, we now change how shell modules are enabled and make it
possible to enable shell command and modules for any application when
CONFIG_SHELL is enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-24 21:37:12 -04:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Marc Herbert debade9121 tests: make find_package(Zephyr...) REQUIRED
... because it is (required).

This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.

In this particular case, REQUIRED turns this harmless looking log
statement:

-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
  Cannot specify sources for target "app" which is not built by
  this project.

... into this louder, clearer, faster and (last but not least) final
error:

CMake Error at CMakeLists.txt:5 (find_package):
  Could not find a package configuration file provided by "Zephyr" with
  any of the following names:

    ZephyrConfig.cmake
    zephyr-config.cmake

  Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
  "Zephyr_DIR" to a directory containing one of the above files.  If
  "Zephyr" provides a separate development package or SDK, be sure it
  has been installed.

-- Configuring incomplete, errors occurred!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Kumar Gala ff579a3af3 flash: Convert DT_FLASH_AREA to FLASH_AREA macros
Convert with a combo of scripts and by hand fixups:

git grep -l DT_FLASH_AREA_.*_ID | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_ID/FLASH_AREA_ID(\L\1)/'

git grep -l DT_FLASH_AREA_.*_OFFSET | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_OFFSET/FLASH_AREA_OFFSET(\L\1)/'

git grep -l DT_FLASH_AREA_.*_SIZE | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_SIZE/FLASH_AREA_SIZE(\L\1)/'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-13 21:22:53 +02:00
Kumar Gala 1f0b5c659d tests: boards: altera_max10: Remove unneeded setting of Kconfig symbol
The NIOS2 I2C driver does not utilize Kconfig symbols for per instance
I2C anymore so we don't need to set them in the conf files for this
test.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-05 11:44:34 -05:00
Henrik Brix Andersen 7ede80be46 tests: boards: board_shell: enable DAC commands
Enable DAC commands in the board_shell test application.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-01 12:35:50 -05:00
Peter Bigot 45f126f871 coccinelle: re-run timeout conversion semantic patch
This fixes a variety of K_THREAD_DEFINE issues that were missed.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-15 08:28:57 -05:00
Kumar Gala a5375ead0c tests: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-31 19:31:20 -05:00
Andy Ross 32bb2395c2 timeout: Fix up API usage
Kernel timeouts have always been a 32 bit integer despite the
existence of generation macros, and existing code has been
inconsistent about using them.  Upcoming commits are going to make the
timeout arguments opaque, so fix things up to be rigorously correct.
Changes include:

+ Adding a K_TIMEOUT_EQ() macro for code that needs to compare timeout
  values for equality (e.g. with K_FOREVER or K_NO_WAIT).

+ Adding a k_msleep() synonym for k_sleep() which can continue to take
  integral arguments as k_sleep() moves away to timeout arguments.

+ Pervasively using the K_MSEC(), K_SECONDS(), et. al. macros to
  generate timeout arguments.

+ Removing the usage of K_NO_WAIT as the final argument to
  K_THREAD_DEFINE().  This is just a count of milliseconds and we need
  to use a zero.

This patch include no logic changes and should not affect generated
code at all.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-03-31 19:40:47 -04:00
Torsten Rasmussen 21080447a8 board: updating test cases for intel s1000 crb board
Changing ZEPHYR_BASE throughout Zephyr tests and samples revealed that
intel s1000 crb cache test case could not be run on CI.

This has now been fixed by moving the tests file located in
tests/board/intel_s1000_crb folder into tests/board/intel_s1000_crb/main
instead so there is now main and cache folders with test projects.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Andrzej Głąbek 4253eae005 boards: nrf52840_pca10056: Rename board to nrf52840dk_nrf52840
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_nrf52840.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-27 09:14:08 +01:00
Kumar Gala bdcf87956b driver: gpio: dw: convert to DT_INST defines
Convert driver to use DT_INST_ defines.  The preferred defines for
drivers are DT_INST_.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Daniel Leung 2dde1db391 tests: intel_s1000_crb: update to new GPIO API
Update the intel_s1000_crb test app:
() Update configuration calls to use new flags.
() Separate pin configuration into setting it to input, and
   setting the pin for interrupt.
() Use gpio_pin_get/set() instead of gpio_pin_read/write().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Henrik Brix Andersen 6f680cffc6 tests: board_shell: enable sensor shell
Enable the sensor shell in the board_shell test application.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-13 09:23:35 -06:00
Laczen JMS 0cf0eef7a6 drivers/flash: nios2_qspi add unaligned read test
Add unaligned test

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-12-19 12:53:22 -05:00
Anas Nashif 70758c4374 tests: fix test identifiers
The seasonal overhaul of test identifiers aligning the terms being used
and creating a structure. This is hopefully the last time we do this,
plan is to document the identifiers and enforce syntax.

The end-goal is to be able to generate a testsuite description from the
existing tests and sync it frequently with the testsuite in Testrail.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-09 15:53:44 -05:00
Henrik Brix Andersen 793e1e1a83 tests: board_shell: re-enable flash, ADC, and CAN shells
Re-enable flash, ADC, and CAN related shell commands in the
board_shell test application.

This fixes commit 965aac39b6.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-08 09:32:37 -05:00
Henrik Brix Andersen e72e4aa813 tests: board_shell: enabled EEPROM shell
Enable EEPROM shell commands in the board_shell test application.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Stephanos Ioannidis 2d7460482d headers: Refactor kernel and arch headers.
This commit refactors kernel and arch headers to establish a boundary
between private and public interface headers.

The refactoring strategy used in this commit is detailed in the issue

This commit introduces the following major changes:

1. Establish a clear boundary between private and public headers by
  removing "kernel/include" and "arch/*/include" from the global
  include paths. Ideally, only kernel/ and arch/*/ source files should
  reference the headers in these directories. If these headers must be
  used by a component, these include paths shall be manually added to
  the CMakeLists.txt file of the component. This is intended to
  discourage applications from including private kernel and arch
  headers either knowingly and unknowingly.

  - kernel/include/ (PRIVATE)
    This directory contains the private headers that provide private
   kernel definitions which should not be visible outside the kernel
   and arch source code. All public kernel definitions must be added
   to an appropriate header located under include/.

  - arch/*/include/ (PRIVATE)
    This directory contains the private headers that provide private
   architecture-specific definitions which should not be visible
   outside the arch and kernel source code. All public architecture-
   specific definitions must be added to an appropriate header located
   under include/arch/*/.

  - include/ AND include/sys/ (PUBLIC)
    This directory contains the public headers that provide public
   kernel definitions which can be referenced by both kernel and
   application code.

  - include/arch/*/ (PUBLIC)
    This directory contains the public headers that provide public
   architecture-specific definitions which can be referenced by both
   kernel and application code.

2. Split arch_interface.h into "kernel-to-arch interface" and "public
  arch interface" divisions.

  - kernel/include/kernel_arch_interface.h
    * provides private "kernel-to-arch interface" definition.
    * includes arch/*/include/kernel_arch_func.h to ensure that the
     interface function implementations are always available.
    * includes sys/arch_interface.h so that public arch interface
     definitions are automatically included when including this file.

  - arch/*/include/kernel_arch_func.h
    * provides architecture-specific "kernel-to-arch interface"
     implementation.
    * only the functions that will be used in kernel and arch source
     files are defined here.

  - include/sys/arch_interface.h
    * provides "public arch interface" definition.
    * includes include/arch/arch_inlines.h to ensure that the
     architecture-specific public inline interface function
     implementations are always available.

  - include/arch/arch_inlines.h
    * includes architecture-specific arch_inlines.h in
     include/arch/*/arch_inline.h.

  - include/arch/*/arch_inline.h
    * provides architecture-specific "public arch interface" inline
     function implementation.
    * supersedes include/sys/arch_inline.h.

3. Refactor kernel and the existing architecture implementations.

  - Remove circular dependency of kernel and arch headers. The
   following general rules should be observed:

    * Never include any private headers from public headers
    * Never include kernel_internal.h in kernel_arch_data.h
    * Always include kernel_arch_data.h from kernel_arch_func.h
    * Never include kernel.h from kernel_struct.h either directly or
     indirectly. Only add the kernel structures that must be referenced
     from public arch headers in this file.

  - Relocate syscall_handler.h to include/ so it can be used in the
   public code. This is necessary because many user-mode public codes
   reference the functions defined in this header.

  - Relocate kernel_arch_thread.h to include/arch/*/thread.h. This is
   necessary to provide architecture-specific thread definition for
   'struct k_thread' in kernel.h.

  - Remove any private header dependencies from public headers using
   the following methods:

    * If dependency is not required, simply omit
    * If dependency is required,
      - Relocate a portion of the required dependencies from the
       private header to an appropriate public header OR
      - Relocate the required private header to make it public.

This commit supersedes #20047, addresses #19666, and fixes #3056.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-11-06 16:07:32 -08:00
Henrik Brix Andersen d0a382b44a tests: board_shell: enable PWM shell
Enable the PWM shell commands in the board_shell test application.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-05 15:10:21 -06: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
Kumar Gala 9599c2d510 tests: boards: altera_max10: Use DT define for I2C device name
Move to using DT define instead of a Kconfig param, also remove unused
I2C Kconfig params for this test.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 11:31:32 -05:00
Peter Bigot 6e5db350b2 coccinelle: standardize k_sleep calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Anas Nashif cb5e6b234d tests: rtc: rename test.yaml to testcase.yaml
testcase file wrongly named test.yaml.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 17:20:22 -04:00
Anas Nashif 965aac39b6 tests: board_shell: rename test.yaml to testcase.yaml
testcase file wrongly named test.yaml.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 17:20:22 -04:00
Anas Nashif 2d4837061a tests: fix identifiers
Fix identifier and rename plain 'test' to something more appropriate.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 17:20:22 -04:00
Alexander Wachter 7dbbd8ad02 tests: boards: board_shell: Activate CAN shell
Activate the CAN shell for build testing.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-07-29 10:27:54 +03:00
Nicolas Pitre 6609c12516 tests: enable native_posix_64 testing
Whenever conditions are applied to native_posix, they should apply to
native_posix_64 too.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-16 10:41:11 -07:00
Henrik Brix Andersen 4a50e1f8b3 tests: board_shell: enable ADC shell
Enable the ADC shell in the board_shell test.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-07-14 05:06:38 -07:00
Anas Nashif 9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif f2e35134b0 cleanup: include/: move i2s.h to drivers/i2s.h
move i2s.h to drivers/i2s.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 8f692c7d38 cleanup: include/: move i2c.h to drivers/i2c.h
move i2c.h to drivers/i2c.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 6aa9c3a68f cleanup: include/: move gpio.h to drivers/gpio.h
move gpio.h to drivers/gpio.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif fe051a9055 cleanup: include/: move flash.h to drivers/flash.h
move flash.h to drivers/flash.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 46a5d1e5cb cleanup: include/: move dma.h to drivers/dma.h
move dma.h to drivers/dma.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 83508a5677 cleanup: include/: move flash_map.h to storage/flash_map.h
move flash_map.h to storage/flash_map.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Anas Nashif 2fb19fcbdd style: samples/tests: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:20:21 +02:00
Andrei Emeltchenko 1b3227fd99 samples: usb: Correct USB HID device name
Use "HID_0" as a device name since we have only device count now.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Anas Nashif 5c6efa011a flash_map: add shell interface
Add shell for flash_map currently supporting listing the configurated
flash_map for a device.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-19 13:41:02 -05:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Patrik Flykt 7c0a245d32 arch: Rename reserved function names
Rename reserved function names in arch/ subdirectory. The Python
script gen_priv_stacks.py was updated to follow the 'z_' prefix
naming.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-04-03 17:31:00 -04:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Daniel Leung 33f57c5971 tests/boards/intel_s1000_crb: fix potential uninit variables
The led_val[] may not be initialized depending on the switch-case.
So set them via default case.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-02-26 01:44:42 +01:00
Sathish Kuttan 2072fbdaf8 tests: intel_s1000: cache flush/invalidate tests
Added tests for data cache invalidation and flush

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-20 07:33:11 -05:00
Sathish Kuttan 45fdffe620 tests: intel_s1000: use I2C device name directly
Since this is a test dedicated to Intel S1000 CRB,
use the I2C0 device name directly instead of a Device Tree or
Kconfig defined device name.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-10 15:06:39 -05:00
Sathish Kuttan e28c1e7f81 tests: intel_s1000: I2S test update
Update I2S tests according to i2s_cavs implementation
- Removed ping-pong tests
- Added bidirectional transfer tests

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-10 15:06:39 -05:00
Sathish Kuttan 0cd56fe195 tests: intel_s1000: DMA test update
Update DMA tests according to dma_cavs implementation of
single block transfers. Multiple block transfers are achieved
by reloading DMA upon every DMA completion.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-10 15:06:39 -05:00
Andrei Emeltchenko 78f81fb3be tests: hid: Use HID Device interface
Use new HID Device interface for tests/boards/intel_s1000_crb

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Kumar Gala 4d38160013 tests: boards: intel_s1000_crb: Use DT_FLASH_AREA_<FOO>_ID define
Rather than using hard coded 3, use DT_FLASH_AREA_IMAGE_SCRATCH_ID
that is now generated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 10:31:27 -06:00
Anas Nashif 8b8461dc35 tests: board_shell: add flash support
Enable Flash shell in the generic board_shell test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-04 17:55:40 -05:00
Anas Nashif 63260bf6cf drivers: gpio: enable gpio_shell in board_shell
Enable the GPIO shell in board_shell rathe the shell sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-04 17:55:40 -05:00
Alexander Wachter 7b1e9e9b34 drivers: hwinfo: Add shell command for device id
This commit adds support for device id shell command.
Example:
uart:~$ hwinfo devid
Length: 12
ID: 0x1b0320d51485330313420

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-02-04 14:53:50 -05:00
Anas Nashif aecf90844c tests: intel_s1000: fixed test to use new DT defines
The label of this driver has changed recently.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-04 08:00:30 -05:00
Rajavardhan Gundi 18b64833d5 tests: intel_s1000: flash_map: Enable tests for flash_map
This patchset introduces some tests for the flash_map and
flash_page_layout features.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2019-01-16 21:22:56 -05:00
Rajavardhan Gundi f885fd15bf DTS: flash: spi_nor: use DT_ for freq and other parameters
Use DT_ instead of CONFIG_ for spi freq, spi bus name, flash device
name and flash base address.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2019-01-16 21:22:56 -05:00
Anas Nashif 5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Patrik Flykt 440b535602 tests: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Rajavardhan Gundi 2ed29b5545 tests: intel_s1000: i2c: Support green and white LED blinking
S1000 i2c test was blinking only blue and red lights. However, if
we have to distinguish between 2 test images for whatever reasons,
it is handy to have one test image blinking blue-red while the
other blinks green-white.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-04 16:08:34 -05:00
Rajavardhan Gundi 73562dc863 tests: intel_s1000: Fix the spi flash tests for R/W
The tests are modified to reflect the changed return values
the spi flash read and write APIs return.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-11-24 07:58:05 -05:00
Rajavardhan Gundi e50ce17578 tests: intel_s1000: Change flash offset from 0x10000 to 0x3F0000
Use the last sector of 4MB flash to run the flash API tests.

Fixes #11462.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-11-23 14:52:00 -05:00
Rajavardhan Gundi 31351734e2 kconfig: intel_s1000: Clean up App level prj.conf
USB is desired to be configured by default and hence the Kconfigs
are addressed in _defconfig for intel_s1000_crb. Cleaned it up
from the app level prj.conf which was anyway redundant.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-11-15 07:44:04 -05:00
Savinay Dharmappa f805343941 tests: boards: intel_s1000_crb: Add a test app to read/write from flash
patch test SPI flash on intel_s1000_crb board.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-11-13 18:49:03 -05:00
Ulf Magnusson fc210ab505 Kconfig: Remove unused symbols defined only in Kconfig.defconfig files
Turning 'def_bool' in Kconfig.defconfig files into 'default' revealed
three unused symbols (confirmed with 'git grep'). Remove them.

Search for "Kconfig.defconfig" in
https://docs.zephyrproject.org/latest/application/kconfig-tips.html for
an explanation of how def_bool->default can reveal undefined symbols.

Removed unused symbols:

 - SPI_DW_CLOCK_GATE

 - PINMUX_MPS2

 - BOARD_XTENSA

Also remove an assignment to the promptless symbol ALTERA_AVALON_SYSID,
in tests/boards/altera_max10/sysid/prj.conf. Assignments to promptless
symbols have no effect.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-13 16:04:01 -05:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Anas Nashif c79dea567a intel_s1000: do not enable options in _defconfig
Application should be responsible for enabling various drivers and
features, we should not enable everything by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-12 13:50:21 -05:00
Anas Nashif aed52d7058 tests: add board_shell test app
Group various shell modules for kernel, peripherals and other
subsystems. This will be used to test board functionality interactively
using commands implemented in the individual shell modules.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 09:32:38 -05:00
Reto Schneider 7eabab2f5d samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2018-10-27 21:31:25 -04:00
Jun Li 2acbaf499e tests: dma: use generic callback arg for all dma_callbacks
Replace the first argument in dma_callback with
generic 'void * arg'.

Signed-off-by: Jun Li <jun.r.li@intel.com>
2018-10-16 16:58:19 -04:00
Rajavardhan Gundi 6bcb9c6a98 xtensa: intel_s1000: Move some functions to SoC level SYS_INIT
Mux configuration for I2C and GPIO are now done in SYS_INIT
which were earlier done in the respective tests.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-10-12 07:52:17 -04:00
Anas Nashif b5a51f8b01 tests: s1000: rename board
Instead of Intel_S1000, use correct name "Intel S1000 CRB"

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-11 10:49:56 -04:00
Anas Nashif 6cb52b97fe tests: boards: intel_s1000_crb: move to new logger
Move to new logger and use new logger macros/Kconfig variables.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 18:32:13 -04:00
Yannis Damigos d1a655a624 subsys/usb: Move to new logger subsystem
Move to new logger subsystem.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-10-08 12:54:57 -04:00
Yannis Damigos 1674d061b6 drivers: usb: device: Migrate to new logger
Move to new logger subsystem.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-10-08 12:54:57 -04:00
Flavio Ceolin da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
Alberto Escolar Piedras 71523eceb9 tests: native_tasks: Add missing header
Added missing header in tests/boards/native_posix/native_tasks/

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-08-02 19:14:19 +02:00
Alberto Escolar Piedras 550225b668 native: Generalize native tasks
Some drivers or tests need to execute some code before Zephyr is
booted, dynamically register command line arguments, etc.

For this purpose, we generalize the NATIVE_EXIT_TASK to also
provide hooks to run a function at a given point during the startup
of native_posix.

Also, test/boards/native_posix/exit_tasks is generalized to cover
this new functionality.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-07-30 22:13:46 -04:00
Alberto Escolar Piedras 8ba0ddf4ba test: Add test for native_posix RTC and real time control
Added a simple test to validate the real time control and
RTC functionality

Note that this test depends too much on not having a high host
load to pass.
Therefore it is better to not run in it automated regression

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-07-24 22:59:07 -04:00
Alberto Escolar Piedras d35d8e9310 tests: Add test for NATIVE_EXIT_TASK
Added a simple testcase for the NATIVE_EXIT_TASK hook

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-07-18 15:43:12 -04:00
Savinay Dharmappa 70944e8375 tests: boards: intel_s1000_crb: Fix build error.
A HID application can no longer write to the default
 interrupt IN endpoint because the addresses are assigned
 dynamically. Add hid_int_ep_write() function  and leave
 it to the hid-core to call the usb_write() with the correct
 endpoint address.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-07-12 23:09:36 -04:00
Anas Nashif c57326e1b6 tests: fix doxygen comments
Fix many warnings resulting from doxygen comments in tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif 93109f2d8e tests: enhance test meta-data/improve test naming
Enhance the test meta-data and test names. This will is needed for
better and consistent reporting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Ramakrishna Pallala ee1e9886a9 tests: boards: altera_max10: Add test for Nios-II MSGDMA soft IP
Add test for Altera Nios-II MSGDMA soft IP core. This IP on
Altera MAX10 support Memory to Memory DMA transfers.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-05-03 10:38:09 -04:00
Savinay Dharmappa e57df9a3ed tests: boards: intel_s1000_crb: select application based on config
Add support to enable test application selectively based
on defconfig

Change-Id: I8111750ff099edd95ffa22c6e312999c801678ea
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 16:46:41 -04:00
Savinay Dharmappa a2afa6cf8c test: board: intel_S1000: Add test application for HID
patch add a hid test application which sends continues
reports to the host

Change-Id: I3a638caded629b502b4cfc6c7bdcba0b67428350
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 16:46:41 -04:00
Rajavardhan Gundi 46d6ba4674 boards: intel_s1000: enable I2S
Enable the CAVS I2S on intel_s1000. Also, introduce a test to
validate I2S in ping-pong and normal modes.

Change-Id: Iea78e22cedc7724c1c2e821c68d7030cc0a65047
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 16:46:41 -04:00
Rajavardhan Gundi cea1c75e2b boards: intel_s1000_crb: enable DMA
Enable the CAVS DMA on intel_s1000. Also, introduce a test to
validate the DMA.

Change-Id: I2ff233c45cfd8aea55e254d905350a666aa649a0
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 16:46:41 -04:00
Rajavardhan Gundi 567482ff35 intel_s1000: tests: introduce tests to check features enabled
This patchset carries out basic tests on the features supported
on intel_s1000. Currently, Interrupt mechanism, GPIO handling, I2C
communication and UART prints are illustrated.

Change-Id: I7ea03b5085b7fa8d29635c294038536465a70660
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 16:46:41 -04:00
Ramakrishna Pallala 55662a7f89 tests: boards: altera_max10: Add test for Nios-II i2c core
Add test application for Nios-II i2c core on Altera MAX10 board.

This test uses ADV7513 HDMI I2C slave module on Altera MAX10
board to perform i2c read and write operations. For more details
on ADV7513 HDMI module, please refer to the following link.

https://ez.analog.com/docs/DOC-1986

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-02-07 19:37:35 -05:00
Ramakrishna Pallala 727653333e tests: boards: Add QSPI flash test app for altera_max10
Add test application to demonstrate the usage of Nios-II
QSPI Flash soft IP.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-02-05 06:30:50 -08:00
Ramakrishna Pallala eace9ede03 tests: boards: add SysID test app for altera_max10 board
Add test application to demonstrate the usage of Nios-II
System ID soft IP.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-12-15 18:12:00 -05:00