Commit graph

41120 commits

Author SHA1 Message Date
Ulf Magnusson
638e89bb7c scripts/dts: Simplify tabstop logic in write_header()
A string can be repeated n times with n*'foo'.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
0e922bff75 scripts/dts: Simplify write_header()
That the 'aliases' key isn't a regular property makes things a bit
confusing. Write the aliases separately, which should be a bit clearer.
That also makes it clear that the order doesn't matter.

The 'aliases' key always exists in defs[node], so use [] instead of
.get(). Also write "'aliases'" instead of "prop" when the value is
known.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
98df8b99d6 scripts/dts: Remove unused os.listdir import
Unused.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
72f0125b92 scripts/dts: Rename conf/header-writing functions to write_conf/header
Probably easier to understand.

Also rename 'fd' to 'f'. "File descriptor" might make it sound like an
integer.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
00c43d4d08 scripts/dts: Simplify output_keyvalue_lines()
That the 'aliases' key isn't a regular property makes things a bit
confusing. Write the aliases separately, which should be a bit clearer.
That also makes it clear that the order doesn't matter.

Also write "'aliases'" instead of "prop" when the value is known.

The .get() seems to be needed to work around a bug, and sometimes you
get DT_...=None in the output. Might look into that later.

extract_string_prop() could generate 'defs' entries without 'aliases'
keys. Make it add an empty 'aliases' dict instead, to remove existence
checks elsewhere.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
7b0ac7d303 scripts/dts: Simplify get_parent_address()
Returns the empty string for '/foo' and '/', but the old version did
that too, so maybe it's intended.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
a776927250 scripts/dts: Simplify find_parent_prop()
Also replace a .get() where the key is known to exist.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
87193b0e1b scripts/dts: Remove generate_node_definitions() return value
Unused.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
4217de046b scripts/dts: Inline simple single-caller functions into main()
Inline load_and_parse_dts() and generate_{keyvalue,include}_file().

Also specify UTF-8 for writing files, and fix some mis-indentation.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
2528b538a4 scripts/dts: Remove redundant nargs=1 argparse args
Flags take a single argument by default, and removing nargs=1 avoids
getting it as a single-element list.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
6f5d5c56f2 scripts/dts: Simplify code around extract_bus_name() call
Get rid of the parent_label variable.

Also avoid using "label" in two different senses (DT label and name of
define macro) within the same comment.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
7827c765aa scripts/dts: Rename extract_single() to extract_bus_name()
This matches the only way in which it's used.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
6127f0a07f scripts/dts: Simplify extract_single()
Get rid of the 'prop' variable.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
c631edddb8 scripts/dts: Inline 'prop' and 'key' params into extract_single()
These are always 'parent-label' (used as a flag) and 'bus-name',
respectively.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
636b6be62d scripts/dts: Remove the prop_def variable in extract_single()
Shorter and still clear without it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
Ulf Magnusson
f5ee8f65a7 scripts/dts: Remove dead type-checking code in extract_single()
'prop' is always a string.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-07 21:42:36 -06:00
David B. Kinder
c1dce2f799 doc: fix misspellings in docs
Fix misspellings missed in regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-02-07 22:06:14 -05:00
Peter A. Bigot
aa684363f0 drivers: sht3xd: update to new I2C API
Use the new i2c_write_read() wrapper to simplify the code.

Also add several overlays used to test the sensor on a variety of
boards, and conf file support for trigger testing.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-02-07 22:04:28 -05:00
Peter A. Bigot
46072632bd drivers: i2c: document problematic API and deprecated unused functions
The scatter/gather API for I2C assumes that all SoC implementations are
capable of supporting such operations, in particular performing a single
write (read) transaction that transfers from (to) multiple addresses in
memory.  This is not the case: for some driver implementations a write
of a device register address followed by a write of data to be stored in
that register will produce two bus transactions and be mis-interpreted
by the receiving device.

Extend the documentation of the I2C message flags to provide more
information about the breadth of implementation variation in their
interpretation.

i2c_burst_write cannot be deprecated because we have no replacement.
Clarify in the description that the behavior is not portable.

i2c_burst_read is not being deprecated because it is in use throughout
Zephyr.  The description is updated to reflect that it can be replaced
by i2c_write_read().

Deprecate unused convenience wrappers that depended on the burst APIs
but were never used in the tree.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-02-07 22:04:28 -05:00
Peter A. Bigot
4d7c06702c drivers: eth_sam_gmac: replace deprecated API
Replace the sole use of i2c_burst_read_addr with a more generic API
function to allow the former to be deprecated along with its unreliable
sibling write and update functions.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-02-07 22:04:28 -05:00
Peter A. Bigot
7f42423c7c drivers: i2c: add convenience wrapper for common I2C transaction pair
It is commonly necessary to execute a pair of I2C transactions where the
first is a write transaction that identifies information held on the
device and a second is a read transaction that retrieves the identified
information.

Add API that performs this operation generically, without restricting
the type or size of the identification or content messages.  Follow the
argument order of the existing i2c_write and i2c_read methods.

This reduces the need to explicitly construct buffers for i2c_transfer,
or to use more restrictive API functions that perform a gather write
that is not reliable on all I2C bus driver implementations.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-02-07 22:04:28 -05:00
Anas Nashif
b61a8e6441 boards: quark_se_c1000_ss_devboard: fix build warning
error: a label can only be part of a statement and a declaration is not
a statement u32_t limit = _arc_v2_aux_reg_read(_ARC_V2_TMR0_LIMIT);

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-07 22:02:33 -05:00
Aurelien Jarno
0a7b45d55f ext: hal: atmel: sam: fix GMAC priority queues related registers
The latest update of the SAM E70 HAL (commit 6ad7e13608) shifted the
GMAC priority queues related registers by 4 bytes. It is not cleared
yet, if it is change is a mistake or a change from 0 based indexing
to 1 based indexing. Indeed the main queue is the number 0, and the
first priority queue is therefore the number 1.

In the meantime revert that change, and use the old registers addresses
matching the datasheet.

Fixes #12945

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-02-07 17:10:24 -05:00
Klaus Petersen
c66cb76fed Build: Added support for out-of-tree Arch
Introduces the ARCH_ROOT argument, similar to BOARD_ROOT and SOC_ROOT.
This enables support for out-of-tree architectures.

The ARCH_ROOT out-of-tree layout is expected to be the following:
 * ${ARCH_ROOT}/arch/${ARCH}/
 * ${ARCH_ROOT}/include/arch/${ARCH}/ (Optional)

Signed-off-by: Klaus Petersen <kape@oticon.com>
2019-02-07 17:00:43 -05:00
Carles Cufi
9f1acfe2fd boards: arm: nrf: Make Bluetooth optional
Instead of enabling Bluetooth by default on nRF5x boards, only enable
the controller if Bluetooth has been enabled by the applicaiton.

Fixes #5454
Fixes #12215

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-02-07 16:17:27 -05:00
Anas Nashif
f164b056b0 samples: fix alarm sample doc and inclusion
Fix reference for alarm sample and how it is included in the
documentation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
193c7c066e boards: Update yaml for boards supporting rtc/counter (3/3)
Few boards supporting RTC were missing rtc as supported rtc feature
in yaml files. Fix this.
Add counter to all boards supporting rtc as RTC IP now support
both rtc and counter API.
Change split in 3 parts in order to lower CI load and get shippable
happy.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
e7cc297f5a boards: Update yaml for boards supporting rtc/counter (2/3)
Few boards supporting RTC were missing rtc as supported rtc feature
in yaml files. Fix this.
Add counter to all boards supporting rtc as RTC IP now support
both rtc and counter API.
Change split in 3 parts in order to lower CI load and get shippable
happy.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
f65f63c454 boards: Update yaml for boards supporting rtc/counter (1/3)
Few boards supporting RTC were missing rtc as supported rtc feature
in yaml files. Fix this.
Add counter to all boards supporting rtc as RTC IP now support
both rtc and counter API.
Change split in 3 parts in order to lower CI load and get shippable
happy.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
d2e305491f soc: stm32: Convert CONFIG_RTC leftover to DT_
Convert CONFIG_RTC_0_IRQ_PRI to DT_ namespace.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
2cefc60973 tests: counter: Update to support STM32 RTC counter
Update counter_basic_api test to support STM32 RTC counter.
Add device to list and skipp not supported test cases.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
50da5bb214 tests/drivers: counter: bump cmake minimum version
counter_basic_api test is cmake outdated.
Set it to newest version.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
27cbd21793 boards: nucleo_f746zg: Configure and document counter RTC
Configure RTC on nucleo_f746zg.
It is supported through counter RTC API.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
3074e393db drivers/counter: stm32 rtc: Use dts to get RTC clock information
RTC clock information should be provided by dts files

Fixes #10451

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
da744314ca samples/drivers: Provides basic sample for counter alarm
Provide basic sample to exercise counter alarm API.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
458226e1f7 drivers/counter: stm32: Provide STM32 RTC driver using counter API
Provides a STM32 RTC driver using new counter API.
Driver does not support wrap related functions (set, get, ..)

Fixes #11373

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Kumar Gala
7809970c8a drivers: counter: cmsdk: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert cmsdk driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 16:14:00 -05:00
Kumar Gala
c2a04890d9 tests: counter_basic_api: Enable tests for ARM CMSDK drivers
Enable testing of counter (COUNTER_{D}TMR_CMSDK) on mps2_an385 and
enable timers on v2m_beetle (TIMER_{D}TMR_CMSDK).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 16:14:00 -05:00
Kumar Gala
36427f8bbb drivers: timer: Move Dual Timer API to unified interface
The CMSDK Dual Timer can be used as a timer or as a counter.
The unified interface proposed in #8340 unifies counter.h and rtc.h to
provide a common interface.

This patch modifies the timer implementation of the dual timer to
make it compliant with the new proposed interface.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 16:14:00 -05:00
Kumar Gala
6fca18de60 drivers: timer: Move Timer API to unified interface
The CMSDK Timer can be used as a timer or as a counter.
The unified interface proposed in #8340 unifies counter.h and rtc.h to
provide a common interface.

This patch modifies the timer implementation of the single timer to
make it compliant with the new proposed interface.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 16:14:00 -05:00
Kumar Gala
3edafc2517 dts: arm_cmsdk_(d)timer: Add label property to (d)timer
Add a label property so we can use that in drivers rather than getting
from Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 16:14:00 -05:00
Krzysztof Chruscinski
6c419c3617 counter: Clarify behavior of counter_set_channel_alarm
Explicitly state that alarm is single shot.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-07 16:14:00 -05:00
Maureen Helm
210a71f108 tests: counter: Enable debug logging
Enables debug logging in the counter_basic_api test. Fixes a build error
in the nrf counter drivers when logging is enabled.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-07 16:14:00 -05:00
Maureen Helm
8226862991 tests: counter: Adapt test for the mcux rtc driver
The mcux rtc hardware supports a single alarm only and a fixed top
value, so restructure the counter_basic_api test to skip unsupported
features.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-07 16:14:00 -05:00
Maureen Helm
d57f18f9ac boards: frdm_kw41z: Document counter driver is supported
Documents that the counter driver is supported in the frdm_kw41z board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-07 16:14:00 -05:00
Maureen Helm
fd4adce5b5 soc: nxp_kinetis: Enable the mcux rtc driver on kw41
Enables the mcux rtc shim driver on the kw41 SoC when the counter driver
interface is enabled.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-07 16:14:00 -05:00
Maureen Helm
eb338915bb drivers: counter: Introduce mcux rtc shim
Adds a shim layer around the mcux rtc driver to adapt it to the zephyr
counter interface. Portions of this driver are reused from the existing
rtc driver in drivers/rtc/rtc_mcux.c.

The hardware supports a single alarm only and a fixed wrap value.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-07 16:14:00 -05:00
Krzysztof Chruscinski
7de898d337 drivers: counter: Fix default top value callback in counter_nrfx_rtc.c
In case of default top value, driver was calling top value
callback only on the first period. This was not expected behavior.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-07 16:14:00 -05:00
Krzysztof Chruscinski
a016954490 rtc: Fix call to counter API in adaptation layer
Update rtc.h after renaming counter_set_wrap to counter_set_top_value.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-07 16:14:00 -05:00
Stanislav Poboril
9b72f66070 tests: drivers: counter: Enabled counter tests on UDOO Neo board
Tests i.MX EPIT timer peripheral driver. Since it supports zero number
of channel alarms, some tests had to be adjusted to look at the
number of channel alarms supported first.

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2019-02-07 16:14:00 -05:00