Commit graph

76 commits

Author SHA1 Message Date
Peter Bigot 9dc7640ede spi-device: set CS gpio flags for all devices that had none
The generic SPI GPIO chip select support now respects devicetree flags
for signal active level.  Update all cs-gpios properties to specify
active low.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Andrew Boie a9670ab5cf boards: centralize QEMU icount management
Instead of endlessly repeating the same command line args,
centralize this and tune the shift value on a per-board
basis.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-24 20:28:36 -04:00
Maureen Helm cec9735d8a boards: riscv: Conditionalize pinmuxes on rv32m1_vega board
Conditionalizes pinmuxes on associated driver configs (CONFIG_SERIAL,
CONFIG_I2C, etc.) for the rv32m1_vega board to avoid possible conflicts
between peripherals.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-22 14:51:07 +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
Wentong Wu bb80d3528e boards: hifive1: enable icount mode
Enable icount mode for hifive1 platform, The icount shift value is
selectd based on cpu clock frequency of this platform. The virtual
cpu will execute one instruction every 2^shift ns of virtual time.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-14 13:52:07 +02:00
Wentong Wu 49bf0ff1ff boards: qemu_riscv64: enable icount mode
Enable icount mode for qemu_riscv64 platform, The icount shift value
is selectd based on cpu clock frequency of this platform. The virtual
cpu will execute one instruction every 2^shift ns of virtual time.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-14 13:52:07 +02:00
Wentong Wu 589a0c22ff boards: qemu_riscv32: enable icount mode
Enable icount mode for qemu_riscv32 platform, The icount shift value
is selectd based on cpu clock frequency of this platform. The virtual
cpu will execute one instruction every 2^shift ns of virtual time.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-14 13:52:07 +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 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
Peter Bigot 113c814517 boards: riscv: rv32m1_vega: fix parse error in pinmux
If processed this would have produced a syntax error.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-05 13:40:55 -05:00
Kumar Gala 98e5123593 boards: arm: rv32m1_vega: Replace old DT macros with new ones
Replace DT_ALIAS_GPIO_x_LABEL with DT_NODELABEL references to get the
device name for the gpio ports.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 15:50:26 -05:00
Corey Wharton d873573f76 tests: fp_sharing: Enable build-only tests for RISC-V QEMU platform
Enables build-only tests for the qemu_riscv32 platform.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-04-22 16:39:48 -07:00
Jeanina Dragusin 40ee38a945 bluetooth: controller: enable privacy for RV32M1
This patch adds the selection of the necessary CONFIG_*
options for allowing the use of privacy on VEGA platform

Signed-off-by: Jeanina Dragusin <ancajeanina.dragusin@nxp.com>
2020-04-15 13:43:00 -05:00
Jeanina Dragusin 6099e0f928 bluetooth: controller: openisa/RV32M1: add RPA support
The radio on the VEGA platform will now be able to resolve Resolvable
Private Addresses through the use of the CAUv3 hardware. With this
patch the RPA feature is now fully supported on the Controller:
RPA addresses are generated with local IRK and resolved with
previously exchanged peer IRK.

Signed-off-by: Jeanina Dragusin <ancajeanina.dragusin@nxp.com>
2020-04-15 13:43:00 -05:00
Kumar Gala f928e1b144 drivers: gpio: rv32m1: Convert driver to new DT_INST macros
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-10 14:38:04 -05:00
Kumar Gala 019d611031 boards: riscv: rv32m1_vega: remove stale Kconfig PWM setting
Per instance Kconfig symbols aren't used by the rv32m1 lpspi driver
so remove the unnecessary setting of PWM_2.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-10 14:38:04 -05:00
Kumar Gala 8f0018663f drivers: pinmux: rv32m1: Convert driver to new DT_INST macros
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.

Updated the openisa,rv32m1_vega-pinmux binding to require the label
property and updated the rv32m1.dtsi to add label properties for the
pinmux nodes.

Also update gpio_basic_api test to use DT_NODELABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-10 14:38:04 -05:00
Kumar Gala 8c60bc0b07 drivers: spi: rv32m1_spi: Convert driver to new DT_INST macros
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-10 14:38:04 -05:00
Kumar Gala 03d48d894d drivers: serial: rv32m1_lpuart: Convert driver to new DT_INST macros
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-10 14:38:04 -05:00
Kumar Gala 376c5a4e4f drivers: i2c: i2c_rv32m1_lpi2c: Convert driver to new DT_INST macros
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-10 14:38:04 -05:00
Kumar Gala 8c78fa85ad boards: riscv: rv32m1_vega: 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-10 14:38:04 -05:00
Kumar Gala b263a3379c soc: riscv: openisa_rv32m1: Convert from Kconfig to DT_NODELABEL
As prep for drivers being converted to utilize DT_INST and removal of
per instance Kconfig symbols, move soc.c code to utilize DT_NODELABEL
instead.

Also rename various node labels to match the SoC docs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-10 14:38:04 -05:00
Anas Nashif 2215d21104 doc: fix broken links in README and board docs
Point to zephyr/sdk release pages instead of non-existent downloads page
on project website.

Fixes #21706

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-03-12 17:18:49 -04:00
George Stefan 350dc0601d boards: riscv: rv32m1_vega: remove no power-save limitation
Now the VEGABoard BLE supports power-saving,
so the docs need to be updated accordingly.

Signed-off-by: George Stefan <george.stefan@nxp.com>
2020-03-12 17:05:02 +02:00
Alex Porosanu f39df4c5d4 boards: riscv: rv32m1_vega: remove BLE 2Mbps limitation
Now the VEGABoard BLE support includes the support for
the 2 Mbps BLE PHY, so the docs need to be updated
accordingly.

Signed-off-by: Alex Porosanu <alexandru.porosanu@nxp.com>
2020-03-12 13:10:04 +02:00
Kumar Gala 4372efe4ef drivers: uart: miv: convert to DT_INST defines
Convert driver to fully use DT_INST_ defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 16:37:22 -06:00
George Stefan c864615f8e boards: riscv: rv32m1_vega: remove no MESH limitation
Now the VEGABoard BLE supports MESH,
so the docs need to be updated accordingly.

Signed-off-by: George Stefan <george.stefan@nxp.com>
2020-02-18 13:48:12 +02:00
Cristi Caciuloiu 2a2f84256c bluetooth: controller: openisa: encryption and decryption using CAUv3
Created unit tests for the encryption and decryption functions.
Tested with the peripheral and with central_hr samples.
Due to latency of CAUv3 when used as CCM inline accelerator
only one of the PDU can be encrypted/decrypted within an
bilateral exchange M->S + S->M in a connection event.
If the RXed PDU is encrypted, the TXed PDU must be empty
with More Data if there is data in the LLL queue.
The TXed PDU will be encrypted when an empty PDU is RXed.

Signed-off-by: Cristi Caciuloiu <cristian.caciuloiu@nxp.com>
2020-02-18 12:34:27 +02: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
Peter Bigot 099614b30a gpio: replace GPIO_DIR flags
GPIO_DIR_OUT is now GPIO_OUTPUT, similarly for GPIO_DIR_IN.

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
Robert Winkler 94b8832585 boards: litex_vexriscv: Enable LiteX GPIO driver
Enable LiteX GPIO driver in litex_vexriscv board.

Signed-off-by: Robert Winkler <rwinkler@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
2020-02-05 12:00:36 +01:00
Nathaniel Graff be1cbd4aa7 drivers: gpio_sifive: Update for new GPIO API
Update the Sifive GPIO driver for new API

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2020-02-05 12:00:36 +01:00
Maureen Helm 03c3b4bed5 gpio: Update rv32m1 gpio driver to use new gpio api
Updates the rv32m1 gpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Assumes the gpio api layer handles translating logical flags to physical
flags.

Stops quietly reconfiguring pinmuxes to gpio mode. The pinmux must now
be configured explicitly in the board's pinmux.c or in the application.

Tested with:
- samples/basic/blinky
- samples/basic/button
- tests/drivers/gpio/gpio_api_1pin

On boards:
- rv32m1_vega_ri5cy

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-05 12:00:36 +01:00
Henrik Brix Andersen 9c52a3f189 boards: riscv: rv32m1_vega: document PWM support
Document PWM support for the OpenISA RV32M1 VEGAboard.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Henrik Brix Andersen 030ea45ab3 boards: riscv: rv32m1_vega: enable PWM support for the RGB LED
Enable PWM support for the onboard RGB LED present on the OpenISA
RV32M1 VEGAboard.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Ulf Magnusson 7a3f7e02d2 boards: litex_vexriscv: Remove unused /chosen/zephyr,timer property
Added in commit f9efca4b4f ("boards: riscv32: add LiteX VexRiscV
board"), never used.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 13:48:48 +01:00
Robert Winkler 0b6c18bd64 boards: litex_vexriscv: Enable LiteX PWM driver
This commit enables LiteX PWM driver for litex_vexriscv board.

Signed-off-by: Robert Winkler <rwinkler@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-01-08 11:04:36 +01:00
Robert Winkler 34fedd6cc9 boards: litex_vexriscv: Enable LiteX I2C driver
This commit enables LiteX I2C driver for litex_vexriscv board.

Signed-off-by: Robert Winkler <rwinkler@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-01-07 20:55:43 +01:00
Pawel Czarnecki 65b47118c5 boards: litex_vexriscv: Enable LiteX PRBS driver
This enables LiteX PRBS random number generator driver
for litex_vexriscv board.

Signed-off-by: Pawel Czarnecki <pczarnecki@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-01-06 13:33:25 -05:00
Jose Manuel Pacheco Luna 8e5e812252 boards: rv32m1_vega: Documentation and sanity test support
Edited the index.rst file to say spi functionality is included. Also
edited the .yaml file in the boards directory to support spi for sanity
tests.

Signed-off-by: Jose Manuel Pacheco Luna <manuel.pacheco@nxp.com>
2019-12-20 17:06:10 +01:00
Jose Manuel Pacheco Luna 19097e407c riscv: Configured pinmux for Arduino header SPI
Added in enablement for the SPI-0 instance pins, as found in the
board schematic files. These connect to the arduino headers on the
front of the board.

Signed-off-by: Jose Manuel Pacheco Luna <manuel.pacheco@nxp.com>
2019-12-20 17:06:10 +01:00
Jose Manuel Pacheco Luna 51fc06a708 riscv: enabled spi-0 in defconfig and dtsi files
In preparation for enabling the spi-0 instance

Signed-off-by: Jose Manuel Pacheco Luna <manuel.pacheco@nxp.com>
2019-12-20 17:06:10 +01:00
Mateusz Holenko 008241311b boards: litex_vexriscv: Enable networking
This sets missing config options necessary
to enable liteeth driver.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-12-18 10:35:15 +02:00
Ulf Magnusson fa453ea997 riscv: kconfig: Remove assignment to promptless CONFIG_64BIT symbol
64BIT has no prompt. Assignments in configuration files have no effect
on symbols without prompts. A prompt means the symbol is
user-configurable.

64BIT is instead enabled indirectly through being selected by
BOARD_QEMU_RISCV64, which is enabled in the same configuration file.

Detected through some work-in-progress improved error checking.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 19:58:36 -06:00
Peter A. Bigot 73ed1bafd1 boards: hifive1*: fix ticks per second
The HiFive1 boards power up using a 32 KiHz low frequency kernel, so
have a cycle rate of 32768 Hz.  The board definitions have not been
revisited since the Zephyr default for ticks-per-second increased from
100 to 10000.  The timer system on the board does not operate
correctly at 4 cycles per tick, but does at 328 cycles per tick.

To support functional timers while keeping system milliseconds in sync
with clock time set ticks-per-second to 128.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-27 13:32:16 -05:00
Peter A. Bigot b61574d81b boards: hifive1_revb: add ardunio_i2c support
Add node label and missing label property.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-19 13:55:27 -05:00
Peter A. Bigot 0a8dc5b338 boards: hifive1_revb: add arduino gpio nexus map
Provide the mapping from FE310-G002 GPIO pins to the Arduino Uno
headers.  Note where pins have pre-assigned functions that may
interfere with use as GPIOs with the default pinmux assignments.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-19 13:55:27 -05:00