Commit graph

23353 commits

Author SHA1 Message Date
Kumar Gala
8d96e8741b drivers: pinmux: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert driver(s) to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-19 19:59:41 -05:00
Kumar Gala
14d5c2fa8f drivers: serial: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert driver(s) to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-19 19:59:21 -05:00
Kumar Gala
f062fbe856 drivers: serial: uart_lpc11u6x: Convert drivers to new DT device macros
Convert uart_lpc11u6x drivers from:

    DEVICE_AND_API_INIT -> DEVICE_DT_DEFINE
    DEVICE_GET -> DEVICE_DT_GET

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-19 19:58:33 -05:00
Kumar Gala
92d62cd839 drivers: flash: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert soc nios2 qspi to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-19 19:57:52 -05:00
Kumar Gala
37e30726c8 drivers: dma: nios2_msgdma: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert driver(s) to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-19 12:19:35 -05:00
Kumar Gala
437e168ed4 drivers: neural_net: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert intel gna driver to DEVICE_DEFINE instead of
DEVICE_AND_API_INIT so we can deprecate DEVICE_AND_API_INIT in the
future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-19 12:19:12 -05:00
Kumar Gala
d59b4a2aaf drivers: ipm: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert NRFx IPC to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-19 12:18:49 -05:00
Kumar Gala
f3cb1c9c3d drivers: clock_control: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert driver(s) to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-19 04:53:45 -06:00
Kumar Gala
e1c47a9bb7 drivers: led: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert LED PWM driver to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-19 04:53:13 -06:00
Kumar Gala
03a1d04c84 drivers: display: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert driver(s) to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 13:25:46 -06:00
Kumar Gala
5ab2e4acdd drivers: can: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert driver(s) to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 13:25:34 -06:00
Kumar Gala
a6800aa9f5 drivers: console: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert driver(s) to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 13:25:22 -06:00
Daniel Leung
0d4dbfc4ad drivers: i2s_cavs: convert to use device tree
This converts the i2s_cavs driver to use device tree
instead of kconfig for device configuration.

Fixes #30750

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-12-18 09:29:20 -05:00
Kumar Gala
463d028a53 drivers: i2c: eeprom: Convert drivers to new DT device macros
Convert i2c slave eeprom driver from:

    DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 08:01:59 -06:00
Kumar Gala
727932fd51 drivers: ipm: cavs_idc: Convert drivers to new DT device macros
Convert ipm cavs_idc driver from:

    DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE
    DEVICE_GET -> DEVICE_DT_INST_GET
    DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 08:01:59 -06:00
Kumar Gala
d31e4b3d27 drivers: gpio: ite_it8xxx2: Convert drivers to new DT device macros
Convert gpio ite_it8xxx2 driver from:

    DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE
    DEVICE_GET -> DEVICE_DT_INST_GET
    DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 08:01:59 -06:00
Kumar Gala
6efb17a821 drivers: ieee802154: Convert drivers to new DT device macros
Convert ieee802154 drivers from:

    DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE
    NET_DEVICE_INIT -> NET_DEVICE_DT_INST_DEFINE

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 07:59:07 -06:00
Kumar Gala
0519a6a0e7 drivers: can: Convert drivers to new DT device macros
Convert CAN drivers from:

    DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE
    DEVICE_GET -> DEVICE_DT_INST_GET

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 07:58:23 -06:00
Kumar Gala
7c699348a8 drivers: dma: mcux_edma: Convert drivers to new DT device macros
Convert dma mcux_edma driver from:

    DEVICE_AND_API_INIT -> DEVICE_DT_DEFINE
    DEVICE_GET -> DEVICE_DT_INST_GET

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 07:54:48 -06:00
Kumar Gala
1b40faef7a drivers: memc: Convert drivers to new DT device macros
Convert memc drivers from:

    DEVICE_DEFINE -> DEVICE_DT_INST_DEFINE

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 07:53:15 -06:00
Kumar Gala
80b4ec0ee1 drivers: pinmux: pinmux_mcux: Remove Kconfig options
We now get the specific port and name from devicetree so remove the
Kconfig options.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 07:52:52 -06:00
Kumar Gala
c9aa36ff39 drivers: pinmux: pinmux_mcux: Convert to devicetree
Use a similar model to the pinmux_rv32m1 driver for kinetis pinmux
driver.  We handle one subtle difference between clock on the KE1xF v
other SoCs.

As the Kconfig and devicetree label names are the same we maintain the
Kconfig options in the driver until all board users are converted over
to use devicetree instead of Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 07:52:52 -06:00
Dan Kalowsky
553a6e34a8 drivers: i2c_dw: add 4 additional ports
Add an additional 4 ports for upcoming Arm based server that will have a
total of 12 I2C ports.

Similar to the original 8 ports, these additional 4 ports will not be
enabled unless specified at configuration time.

Signed-off-by: Dan Kalowsky <dkalowsky@amperecomputing.com>
2020-12-17 21:52:41 -06:00
Kumar Gala
ae9e086802 drivers: ethernet: Convert drivers to new DT device macros
Convert ethernet drivers from:

    DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE
    DEVICE_GET -> DEVICE_DT_INST_GET
    DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE
    ETH_NET_DEVICE_INIT -> ETH_NET_DEVICE_DT_INST_DEFINE
    NET_DEVICE_INIT -> NET_DEVICE_DT_INST_DEFINE

etc...

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-17 11:02:11 -06:00
Martin Jäger
d6648b6124 drivers: pwm: stm32: add support for L0 series
The STM32L0 series MCUs have quite basic timer features only, so we
remove some unavailable configuration options. They were properly
initilized by the LL StructInit functions for other MCUs anyway.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-12-17 10:25:34 -05:00
Henrik Brix Andersen
a3629990ea drivers: sensor: add NXP MCUX ACMP driver
Add driver for the NXP MCUX Analog Comparator (ACMP) IP.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-12-17 08:54:33 -06:00
Kumar Gala
8e55cfab96 drivers: i2s: Convert drivers to new DT device macros
Convert i2s drivers from:

    DEVICE_AND_API_INIT -> DEVICE_DT{_INST}_DEFINE
    DEVICE_GET -> DEVICE_DT_INST_GET
    DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE

etc..

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-17 09:21:02 -05:00
Kumar Gala
c6f1fc6171 drivers: audio: Convert drivers to new DT device macros
Convert audio drivers from:

    DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-17 09:21:02 -05:00
Peng Fan
4deba2616c drivers: interrupt_controller: make GICv3 work for NS-EL1
Configure SPIs/SGI1 as NS interrupt
Enable ARE_NS, G1NS

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-12-17 08:08:00 -05:00
Volodymyr Babchuk
35efb15637 arch: arm: timer: mask interrupt in ISR
As timer interrupt is level triggered, we need to mask it before leaving
ISR or it will be delivered again.

Also, Xen automatically masks timer interrupt when it injects IRQ to
a guest, so we need to unmask it again, when setting new timeout.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-12-17 08:08:00 -05:00
Rajavardhan Gundi
af2ba71e18 drivers: i2c_mchp_xec: fix incorrect timeout value
Use WAIT_COUNT instead of TIME_OUT.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2020-12-17 08:06:39 -05:00
Marcin Niestroj
b2b8554da8 drivers: wifi: esp: deduplicate RX data processing
Deduplicate final part of RX data processing for two supported cases:
passive (+CIPRECVDATA) and non-passive (+IPD). Move implementation to
esp_socket module, as this is strictly related to socket.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-12-17 14:38:02 +02:00
Marcin Niestroj
1886d8c835 drivers: wifi: esp: rework +IPD handling
Split +IPD message handling into smaller logical functions, so it is
much easier to follow code and further improve it. Make sure to do as
much parsing work as possible, before accessing esp_socket object. This
will allow to introduce thread-safety locking just in the critical parts
in subsequent commits.

Prefer early return from function over goto to return instruction,
whenever cleanup code is not needed.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-12-17 14:38:02 +02:00
Marcin Niestroj
d60bd57cb3 drivers: wifi: esp: rework +CIPRECVDATA handling
Current on_cmd_ciprecvdata handler is a bit overwhelming to follow.

Add a cmd_ciprecvdata_parse() helper, which is responsible only for
parsing received metadata (message offset and length), leaving socket
instance untouched.

Consume received payload later on, just after verifying that socket is
in valid state.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-12-17 14:38:02 +02:00
Alexander Wachter
f6ef508f6f tests: drivers: can: timing
Added tests for the timing algorithm.
The tests calculate timings for some bitrates with sample-points
and verify the results.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-12-17 11:07:53 +01:00
Alexander Wachter
b6ec3cb59e drivers: can: Compile time check of can timing not set
Check if the timing is not set from device tree and exclude
sample-point algorithm if it is not used from device-tree.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-12-17 11:07:53 +01:00
Alexander Wachter
05275ecf6e drivers: can: rework zcan_frame and zcan_filter
Reordering of the struct elements to match the Linux format.
The __packed() is not necessary anymore.
std_id and ext_id is merged to id in the frame and filter.
Additionally, the frames are ready for CAN-FD.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-12-17 11:07:53 +01:00
Alexander Wachter
8b6c1bd4b7 drivers: can: Rework can_configure API
The previous API can't change the sampling-point and only allowed
bitrates that fit the time segments.
The new API allows for shifting the sampling-point and adjusts the
number of time quantum in a bit to all more possible bitrates.
The functions to calculate the timings are moved to the can_common file.
They can be used for all drivers.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-12-17 11:07:53 +01:00
Marcin Niestroj
caa35d1a3a drivers: wifi: esp: don't queue send after socket connect
After a synchronous (timeout > 0) connection attempt was made, it was
being checked if there is some packet to be sent. If positive, then a
send work was queued.

This behavior makes little sense, as TCP connection is not even
considered established at this point (from net_context perspective) if
function has not returned yet. Additionally it differs from
asynchronous (timeout == 0) connection attempt. In case of UDP (and
calling esp_connect() from esp_sendto()) sock->tx_pkt is assured to be
NULL. Drop this piece of code as it doesn't seem to be justified.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-12-17 11:42:51 +02:00
Marcin Niestroj
1814e2c8f1 drivers: wifi: esp: unify log level
2 (out of 3) components used CONFIG_WIFI_LOG_LEVEL, while the last one
didn't specify explicit log level. Always use CONFIG_WIFI_LOG_LEVEL in
all components.

While at it switch to LOG_MODULE_REGISTER(<module>, <log_level>), which
is a more compact way to define log level.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-12-17 11:42:32 +02:00
Marcin Niestroj
add649adcd drivers: wifi: esp: calculate size of each command buffer
Calculate size based on the real message, instead of assuming some
arbitrary size. This consumes slightly less stack space, but more
importantly gives an idea what has been taken into account when
calculating the size.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-12-17 11:42:16 +02:00
Marcin Niestroj
dd8aade16d drivers: wifi: esp: drop unused esp_socket members
No reason to occupy RAM if there is no use of stored information.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-12-17 11:41:56 +02:00
Marcin Niestroj
bef25cd97d drivers: wifi: esp: support 32-bit length in +IPD
+IPD,<sock>,<bytes_avail> command in passive mode notifies about ESP
internal buffer usage level. Hence value of <bytes_avail> can exceed
4 digit value, which currently results in failure.

+IPD message is used in driver only for scheduling AT+CIPRECVDATA
command and actual value of <bytes_avail> doesn't really
matter. Increase maximum supported value that can be received from
9999 (maximum 4 digits) to 4294967295, which is maximum value of 32-bit
unsigned integer.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-12-17 11:41:26 +02:00
Kumar Gala
8893ad55db drivers: ipm: Convert drivers to new DT device macros
Convert ipm drivers from:

    DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE
    DEVICE_GET -> DEVICE_DT_INST_GET
    DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-16 18:48:33 -05:00
Tomasz Bursztyka
4ee5101021 drivers/virtualization: Make ivshmem driver userspace ready
Exposing its public API to userspace.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-12-16 18:47:35 -05:00
Tomasz Bursztyka
899fb1af16 drivers/virtualization: Add a shell module for the ivshmem driver
This easily permits to test ivshmem and basic functionality of a custom
protocol passing through.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-12-16 18:47:35 -05:00
Tomasz Bursztyka
d48d5d6147 drivers/virtualization: Add doorbell support for ivshmem driver
This basically adds support for an interrupt based ivshmem variant
called "ivshmem-doorbell".

This allows, via MSI-X, to get multiple vectors for notifications, get
assigned and ID and being able to send a message to another ID (another
VM).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-12-16 18:47:35 -05:00
Tomasz Bursztyka
d11f2f184d drivers/virtualization: Adding ivshmem driver
This is placed into drivers/virtualization as it does not belong to any
existing subsystem.

This is only the ivshmem-plain variant.

This device is provided by qemu or ACRN, and can be used to share memory
either between the host and the VM or between VMs. Here if zephyr is
used as a VM, it will be able to take advantage of such feature.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-12-16 18:47:35 -05:00
Peter Bigot
96fa707e0c Revert "drivers: move eeprom_slave driver to tests directory"
This reverts commit cabbd916cf.

This is considered to be useful enough that it should be restored
as a stable Zephyr API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-12-16 16:39:49 -05:00
Kumar Gala
20689c17d4 drivers: clock_control: stm32: Convert drivers to new DT device macros
Convert clock_control drivers from:

    DEVICE_AND_API_INIT -> DEVICE_DT_DEFINE

As part of this we also changed STM32_CLOCK_CONTROL_NAME to be based on
devicetree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-16 15:23:39 -06:00