Commit graph

34 commits

Author SHA1 Message Date
Maureen Helm 8a8b90d6d1 boards: arm: Clean up zephyr-app-commands usage in frdm_k82f board doc
Cleans up the frdm_k82f board document to make its usage of
zephyr-app-commands consistent with other frdm boards.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:58:50 -05:00
Maureen Helm 877997e71f boards: arm: Remove OPENSDA_FW cmake variables from nxp boards
The OPENSDA_FW and LPCLINK_FW cmake variables are remnants of pre-west
days where we used an environment variable to set the desired debug host
tool, such as jlink or pyocd, based on which debug probe firmware was
loaded on the board. We now have two possible ways to do this, neither
of which requires the nxp-specific OPENSDA_FW or LPCLINK_FW variables:

1. Set standardized cmake runner variables when generating the build
   system:
   $ west build -- -DBOARD_FLASH_RUNNER=jlink -DBOARD_DEBUG_RUNNER=jlink

2. Use the west "--runner" argument with the debug and flash commands:
   $ west debug -r jlink

Remove the now unnecessary OPENSDA_FW ond LPCLINK_FW variables and
update board documentation accordingly.

A few boards (frdm_kw41z, hexiwear_k64, mimxrt10{20,50,60,64}_evk)
reordered pyocd.board.cmake and jlink.board.cmake includes to preserve
the default runner when OPENSDA_FW was not explicitly set.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:58:50 -05:00
Maureen Helm 54f606eec0 boards: arm: Conditionalize adc pinmuxes on nxp boards
Conditionalizes adc pinmuxes on CONFIG_ADC for all nxp boards (kinetis,
lpc, and imx families) to avoid possible conflicts between peripherals.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-22 14:56:00 +02:00
Maureen Helm 5c2d8f3e2a boards: arm: Conditionalize i2c pinmuxes on nxp boards
Conditionalizes i2c pinmuxes on CONFIG_I2C for all nxp boards (kinetis,
lpc, and imx families) to avoid possible conflicts between peripherals.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-22 14:56:00 +02:00
Maureen Helm 49debeb636 boards: arm: Conditionalize spi pinmuxes on nxp boards
Conditionalizes spi pinmuxes on CONFIG_SPI for all nxp boards (kinetis,
lpc, and imx families) to avoid possible conflicts between peripherals.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-22 14:56:00 +02:00
Maureen Helm ab2d73379a boards: arm: Conditionalize serial pinmuxes on nxp boards
Conditionalizes serial pinmuxes on CONFIG_SERIAL for all nxp boards
(kinetis, lpc, and imx families) to avoid possible conflicts between
peripherals.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-22 14:56:00 +02:00
Maureen Helm 7197e7c8fc boards: frdm_k82f: Enable adc instance and pinmux
Enables the adc instance and pinmux associated with arduino header pin
A2 on the frdm_k82 board. Adds adc to the board yaml to ensure we build
adc samples/tests for this board in CI.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-21 11:01:18 +02:00
Kumar Gala 3393600017 boards: Make GPIO pin config default for LEDs instead of PWM
Add an additional check for CONFIG_PWM to decide if pins associated with
LED are configured for GPIO or PWM.

Fixes #25337

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-20 10:32:11 +02:00
Martí Bolívar 6e8775ff84 devicetree: remove DT_HAS_NODE_STATUS_OKAY
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:

- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
  for macros which are equivalent to
  DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name

Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.

This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 18:24:42 +02:00
Kumar Gala c2135f8721 devicetree: DT_NODE_HAS_COMPAT_STATUS_OKAY -> DT_NODE_HAS_COMPAT_STATUS
Swap this out and make the status a parameter.
Leave a couple of cases of DT_NODE_HAS_COMPAT().

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-08 19:37:18 -05:00
Martí Bolívar 17b8667197 dts: clean up some redundant DT checks
These are redundantly checking a node's status twice.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-08 19:37:18 -05:00
Martí Bolívar 7e0eed9235 devicetree: allow access to all nodes
Usually, we want to operate only on "available" device
nodes ("available" means "status is okay and a matching binding is
found"), but that's not true in all cases.

Sometimes we want to operate on special nodes without matching
bindings, such as those describing memory.

To handle the distinction, change various additional devicetree APIs
making it clear that they operate only on available device nodes,
adjusting gen_defines and devicetree.h implementation details
accordingly:

- emit macros for all existing nodes in gen_defines.py, regardless
  of status or matching binding
- rename DT_NUM_INST to DT_NUM_INST_STATUS_OKAY
- rename DT_NODE_HAS_COMPAT to DT_NODE_HAS_COMPAT_STATUS_OKAY
- rename DT_INST_FOREACH to DT_INST_FOREACH_STATUS_OKAY
- rename DT_ANY_INST_ON_BUS to DT_ANY_INST_ON_BUS_STATUS_OKAY
- rewrite DT_HAS_NODE_STATUS_OKAY in terms of a new DT_NODE_HAS_STATUS
- resurrect DT_HAS_NODE in the form of DT_NODE_EXISTS
- remove DT_COMPAT_ON_BUS as a public API
- use the new default_prop_types edtlib parameter

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-08 19:37:18 -05:00
Kumar Gala a5b45d9567 boards: Remove Kconfig I2C_[0-9] usage
The Kconfig I2C_[0-9] sybmols don't have any meaning for the majority of
SoCs.  The drivers doesn't utilize them and no sample or test code does
either so we can remove setting them in board Kconfig.defconfig files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 10:55:38 -05:00
Kumar Gala fdd85d5ad7 dts: Rename DT_HAS_NODE macro to DT_HAS_NODE_STATUS_OKAY
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear.  As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 05:25:41 -05:00
Kumar Gala f9702c34ae boards: arm: nxp_kinetis: Remove Kconfig PWM_[0-3] usage
The Kconfig PWM_[0-3] sybmols don't have any meaning for kinetis family
SoCs.  The driver doesn't utilize them and no sample or test code does
either so we can remove setting them in board Kconfig.defconfig files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-05 08:54:23 -05:00
Henrik Brix Andersen 9ceb29ac56 dts: introduce shared binding for the NXP FlexTimer
Do not assume in the SoC level device trees that NXP Kinetis FlexTimer
nodes will always be configured as PWM. Instead, configure FlexTimer
nodes for PWM at the board level for NXP Kinetis boards.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-04-30 08:28:48 -05:00
Kumar Gala 22e65cb9ba gpio: mcux: Convert convert to DT_INST defines
Convert driver to use DT_INST_ defines.  As part of this conversion we
remove the Kconfig options for per GPIO controller enables and instead
get that information from device tree.  This means we now disable each
GPIO controller by default in the DTS and have each board dts enable the
GPIO controller ports it needs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 17:07:41 -05:00
Kumar Gala 9a65318a5b drivers: uart: mcux_lpuart: Convert to DT_INST
Convert driver to use new DT_INST macros throughout.  Removed per
instance Kconfig symbols and replaced with DT_NODELABEL references
where needed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-20 15:50:45 -05:00
Kumar Gala 806c540f71 boards: arm: nxp: kinetis: Convert from Kconfig to DT_NODELABEL
As prep for drivers being converted to utilize DT_INST and removal of
per instance Kconfig symbols, move board pinmux.c code to utilize
DT_NODELABEL instead.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-17 09:49:03 -05:00
Kumar Gala 2eb28c1364 dts: arm: nxp: k8x: rename nodelabels to match SoC docs
Have nodelabels match the SoC docs so when a nodelabel reference is
made in the code its easier to relate to the SoC.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-17 09:49:03 -05:00
Alexander Wachter 57bd09186b boards: Remove "supported: -hwinfo" from all boards
Remove all "supported: -hwinfo" definitions from the boards
yaml files and documentation. hwinfo can generally be tested
on every board because it returns -ENOTSUP if not supported.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Ulf Magnusson a42a42cd5a kconfig: Replace defconfig singe-symbol 'if's with 'depends on'
Same deal as in commit eddd98f ("kconfig: Replace some single-symbol
'if's with 'depends on'"), for all symbols defined within defconfig
files. See that commit for an explanation.

Maybe 'if's were used originally to mirror the 'if's in the main Kconfig
files, and then it got copied around by people assuming 'if' must work
differently from 'depends on'. It doesn't match in every spot at least.
Better to keep it simple and just consistently use 'depends on' when
it's a single symbol/choice I think. Helps reinforce that 'if' isn't
magic too.

Verified by printing all Kconfig menu nodes (symbols, choices, menus,
etc.) before and after the change and diffing (should show no
difference).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-12 10:32:13 -06:00
Ulf Magnusson c5839f834b kconfig: Remove assignments to CONFIG_<arch> syms and hide them
All board defconfig files currently set the architecture in addition to
the board and the SoC, by setting e.g. CONFIG_ARM=y. This spams up
defconfig files.

CONFIG_<arch> symbols currently being set in configuration files also
means that they are configurable (can be changed in menuconfig and in
configuration files), even though changing the architecture won't work,
since other things get set from -DBOARD=<board>. Many boards also allow
changing the architecture symbols independently from the SoC symbols,
which doesn't make sense.

Get rid of all assignments to CONFIG_<arch> symbols and clean up the
relationships between symbols and the configuration interface, like
this:

1. Remove the choice with the CONFIG_<arch> symbols in arch/Kconfig and
   turn the CONFIG_<arch> symbols into invisible
   (promptless/nonconfigurable) symbols instead.

   Getting rid of the choice allows the symbols to be 'select'ed (choice
   symbols don't support 'select').

2. Select the right CONFIG_<arch> symbol from the SOC_SERIES_* symbols.
   This makes sense since you know the architecture if you know the SoC.

   Put the select on the SOC_* symbol instead for boards that don't have
   a SOC_SERIES_*.

3. Remove all assignments to CONFIG_<arch> symbols. The assignments
   would generate errors now, since the symbols are promptless.

The change was done by grepping for assignments to CONFIG_<arch>
symbols, finding the SOC_SERIES_* (or SOC_*) symbol being set in the
same defconfig file, and putting a 'select' on it instead.

See
https://github.com/ulfalizer/zephyr/commits/hide-arch-syms-unsquashed
for a split-up version of this commit, which will make it easier to see
how stuff was done. This needs to go in as one commit though.

This change is safer than it might seem re. outstanding PRs, because any
assignment to CONFIG_<arch> symbols generates an error now, making
outdated stuff easy to catch.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 00:50:08 -06:00
Kumar Gala 1dc4b1dd2f boards: shrink image sizes
Reduce images sizes of boards.  Get a roughly 3x reduction in size.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-07 13:52:45 -05:00
Maureen Helm 3a5148d464 boards: arm: Remove redundant CONFIG_BOARD_* from all frdm defconfigs
The Kconfig board choice only has only one option which is implicitly
enabled, therefore it is not necessary to set the symbol explicitly in
board defconfigs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-07 05:43:46 -06:00
Peter Bigot fba3375327 boards: frdm_k82f: replace legacy devicetree active flags
Replace the legacy flags that assumed active level was relevant
only to input signals with the generic active level flags used
in Linux.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Maureen Helm cadbc96d66 drivers: sensor: Convert fxos8700 to new gpio api
Converts the fxos8700 sensor driver to the new gpio api. Updates device
trees for all boards with this sensor to active low gpio interrupts by
default.

Tested on frdm_k64f and rv32m1_vega_ri5cy boards. The latter verifies
that the reset output works correctly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 4549d379da treewide: use full path to pinmux.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Henrik Brix Andersen 89d23e891a Revert "boards: nxp: pinmux: enable ftm pwm outputs based on DT_INST_* defines"
The DT_INST_* defines for the PWM controllers enabled in the device
tree are always defined causing the LED pins to always be set as PWM
outputs in the pinmux. Revert to using CONFIG_PWM_* for pinmux
configuration for now.

This reverts commit eb42a24dc6.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-13 09:14:12 -06:00
Henrik Brix Andersen 85e1117e94 dts: nxp: kinetis-ftm: add PWM flags cell
Add support for specifying PWM flags for the NXP Kinetis FlexTimer
(FTM) PWM driver through the device tree.

All in-tree clients of this PWM controller are active-low LEDs.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Henrik Brix Andersen eb42a24dc6 boards: nxp: pinmux: enable ftm pwm outputs based on DT_INST_* defines
Enable the NXP FTM PWM outputs in the board pinmux files based on the
DT_INST_* defines instead of CONFIG_PWM_* to match the pwm_mcux_ftm
driver.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-06 10:03:20 -06:00
Maureen Helm 851e397d19 boards: arm: Add arduino header to all frdm boards
Adds a device tree nexus node to define which gpio pins are mapped from
the soc to the arduino header.

The frdm_kw41z board excludes the arduino A0 pin because it cannot be
muxed as a gpio on the soc.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-12-10 08:49:31 -06:00
Ulf Magnusson bd6e04411e kconfig: Clean up header comments and make them consistent
Use this short header style in all Kconfig files:

    # <description>

    # <copyright>
    # <license>

    ...

Also change all <description>s from

    # Kconfig[.extension] - Foo-related options

to just

    # Foo-related options

It's clear enough that it's about Kconfig.

The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)

    git ls-files '*Kconfig*' | \
        xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Filip Brozovic 3fe53db5cb boards: arm: frdm_k82f: add support for the NXP FRDM-K82F board
Add support for the NXP FRDM-K82F development board. This board
features an NXP MK82FN256VLL15 CPU, a user RGB LED and two buttons,
two 32 Mb QSPI flashes, Arduino R3 compatible headers, and a FlexIO
header.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-09-11 09:23:28 -05:00