Commit graph

37 commits

Author SHA1 Message Date
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
Krzysztof Chruscinski 00156ad80a drivers: clock_control: nrf: Switch to single clock device
Low frequency and high frequency clocks had separate devices
while they are actually handled by single peripheral with single
interrupt. The split was done probably because opaque subsys
argument in the API was used for other purposes and there was
no way to pass the information which clock should be controlled.
Implementation changes some time ago and subsys parameter was
no longer used. It now can be used to indicate which clock should
be controlled.

Change become necessary when nrf5340 is taken into account where
there are more clocks and current approach would lead to create
multiple devices - mess.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-17 14:38:19 +01:00
Emil Obalski 6c82c80a3c drivers: Add support for nRF52833 in several drivers
By adding new SoC to Zephyr drivers has to be updated.
Commit affects:
 - USB driver
	- support for nRF52833 added.
	- support for USB_DEVICE_REMOTE_WAKEUP in hid-mouse added.
 - SPI
 - IEEE 802.15.4
 - CLOCK CONTROL

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-11-13 10:33:38 -06:00
Krzysztof Chruscinski 6700f2f194 drivers: clock_control: nrf: reimplementation including API updates
Reimplementation of clock control driver for nrf platform. It includes
latest API changes: asynchronous starting and getting clock status.

Additionally, it implements calibration algorithm which optionally
skips calibration based on no temperature change. Internal temperature
sensor is used for that.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-04 17:15:39 +02:00
Andrzej Głąbek 57c6cfc9cd nordic: Use hal/ in all inclusions of nrfx HAL header files
Header files of nrfx HALs are not supposed to be included directly
but only with their names prepended with the hal/ directory (so that
an inclusion of an nrfx HAL header clearly differs from an inclusion
of an nrfx driver header).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Anas Nashif 578ae40761 boards: remove quarl_se_c1000
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Krzysztof Chruscinski c661cc6c78 drivers: clock_control: nrf: Add option to use external LF source
Extended clock configuration to allow usage of external clock
source for nrf52 series.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-02 12:58:06 +02:00
Anas Nashif 17ddd1714c cleanup: include/: move clock_control.h to drivers/clock_control.h
move clock_control.h to drivers/clock_control.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
Krzysztof Chruscinski d2291c4b12 drivers: clock_control: nrf: add SYNTH LFCLK clock source
Added option to have LFCLK synthesized from HFCLK. It is not low
power but ensures constant relation between HFCLK and LFCLK and
might be useful in certain scenarios (e.g. testing).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-04-18 17:50:53 -04:00
Krzysztof Chruscinski 431c450a42 drivers: clock_control: nrf: Fix lfclk source settings for nrf9160
Aligned lfclk source values for nrf9160.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-04-17 10:31:06 -05:00
Ioannis Glaropoulos 2e687653fa drivers: clock control: rename nrf5_power_clock source and header
This commit renames the nrf5_clock_control.h and
nrf5_clock_control.c files to nrf_clock_control.h and
nrf_clock_control.c, respectively, as they are used
in nRF9160 builds, as well.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-15 18:03:24 +01:00
Ioannis Glaropoulos 302a746bd6 drivers: clock control: nrf: rename CLOCK_CONTROL_NRF5 Kconfig symbol
This commit renames the CLOCK_CONTROL_NRF5 Kconfig symbol to
CLOCK_CONTROL_NRF. The change is required to aleviates confusion
when selecting the symbol in nRF9160 SOC definition.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-15 18:03:24 +01:00
Paweł Zadrożniak 68cb7b3e38 drivers: usb: Add nRF52840 USBD driver
* Add usbd_dc_nrfx shim

The shim is based on the previous one usbd_dc_nrf5.
For handling the USBD hardware, tested nrfx_usbd driver from nRF SDK
was used.

Briefly tested examples:
* usb/cdc_acm
* usb/dfu (USB communication only due to flash handling issues)
* usb/hid-mouse
* bluetooth/hci_usb

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2018-10-12 13:14:12 +02:00
Flavio Ceolin 67ca176754 headers: Fix headers across the project
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-17 15:49:26 -04:00
Sundar Subramaniyan 49ed4fb276 clock_control: nrf5: Add USBD power event support for USB enumeration
nRF52840 USBD requires power events to start USB enumeration.

Add APIs to enable/disable the power events, read the USB VBUS detect
and output power ready statuses which can then be used by the USB driver
in the enumeration sequence.

Signed-off-by: Sundar Subramaniyan <sundar.subramaniyan@gmail.com>
2018-03-15 12:39:53 +01:00
Maciej Debski d0678201c3 drivers: clock_control: provide support for stm32f0.
Fixes #3923

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-10-23 12:31:47 +02:00
Erwan Gouriou f8240018d0 dts: arm: Add clocks u(s)art on stm32 family
Add "clocks" property on u(s)arts nodes on stm32 socs
Add a dt clocks binding file and rework clock_control
header file include new device tree binding file.
include/dt-bindings folder is introduced as dt-bindings
placeholder

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-25 09:30:26 -05:00
Erwan Gouriou f2e8a21d7f stm32f1xx: remove references to native driver
Following introduction of stm32cube LL based clock control driver,
remove references to former native driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-06-02 14:11:13 -04:00
Erwan Gouriou 242ed389a3 stm32f4: Clean references to stm32f4 specific clock control
Following activation of stm32 common clock driver for stm32f4 series
remove references to stm32f4 specific driver.

Change-Id: I372a0ea046007bcb34944d6b2b8880077583b1d3
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-04-28 15:26:11 -05:00
Kumar Gala cc334c7273 Convert remaining code to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.  This handles the remaining includes and kernel, plus
touching up various points that we skipped because of include
dependancies.  We also convert the PRI printf formatters in the arch
code over to normal formatters.

Jira: ZEP-2051

Change-Id: Iecbb12601a3ee4ea936fd7ddea37788a645b08b0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 11:38:23 -05:00
Florian Vaussard 85b4ecabe8 clock: stm32f4: Add some missing clocks
Add several missing clocks that are used by other members of the STM32F4
family. This is needed to add support for various hardware, like UART9
and UART10 on STM32F413.

Change-Id: I6f1a04ddece90a04e31a1710065545179b0e530d
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Florian Vaussard 2304e0facf clock: stm32f4: Fix wrong BKPSRAM and CCMDATARAM clocks
It appears that enable bits for BKPSRAM and CCMDATARAM are incorrectly
defined as bit 14 and 16 on AHB1 respectively (when these IPs are present),
where we should use bit 18 and 20 according to the various reference
manuals (STM32F415 for instance).

Change-Id: I44ce59a29c57e306f6a945e46043efbcfce7a92f
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Erwan Gouriou 0aea704462 gpio: enable ports F G (and H) for stm32f1xx (stm32f4xx)
Some GPIO ports activation where missing since not used
on available soc/boards.
Since stm32 family increases, activation of these ports
should be made available.

Jira: ZEP-1551

Change-Id: I612d135b28ef255bc771599e33796671ff81d0ac
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-22 18:09:11 -06:00
Erwan Gouriou 3c389b54f0 clock control: clean up after stm32cube LL driver
After introduction and activation of STM32Cube LL based driver on
F3 and L4 series, this commit removes the no more needed code for
native driver for these soc.

Change-Id: I266d1a3fc4b464cee34b1cc1a1a333c5bf923e41
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-10 14:47:41 -06:00
Erwan Gouriou 58c8d15147 clock control:stm32: provide STM32Cube LL based driver
This new clock control driver aims at providing a lightweight
generic driver to the whole stm32 family.
Driver is based on LL Cube API and hence is for now available
only for STM32 supporting this API: stm32f3xx and stm32l4xx.
Other families should be supported soon.
Once globally supported, this unique driver will also help
reducing the impact of stm32 clock control heterogeneity in
other drivers.

Change-Id: Id15a8d0d44f03809b2907ef10d6877700459e674
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-10 14:47:41 -06:00
Erwan Gouriou 8890b73b6e license: Replace Apache boilerplate with SPDX tag
Apply JIRA: ZEP-1457 to STM32F3X family porting patchset.

Change-Id: I352267a47847143e557a4016de12bb9a14a20067
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:53 -06:00
Adam Podogrocki c514f671c7 clock/stm32: add STM32F3X reset and clock control
Change-Id: Ie5f3ffec0b3aaf15f9d9f8063d2bab6be5aebb6e
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:52 -06:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Adam Podogrocki 72782f542c clock/stm32: add STM32F107 reset and clock control
Change-Id: If2280187c866c130212ea22c3d406501f37133b2
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-12 09:46:27 -06:00
Vincenzo Frascino 6be2a81ae4 clock_control: Add Beetle clock_control
This patch adds the clock_control implementation for the ARM LTD
Beetle platform.

The main features enabled are:
* Clock on and off in ACTIVE, SLEEP and DEEPSLEEP mode.
* PLL support (freq: 12, 36, 48 Mhz).

The integration with the existing drivers will be done in future
patches.

Jira: ZEP-1300
Change-Id: I07cb2325275bd86a036e8e24aeb7bbf2c6176a93
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-12-06 10:31:45 -06:00
Neil Armstrong 3842c60ce3 stm32l4: add clock control driver
Add the clock driver for the STM32L4 series.

Change-Id: Icdf79061f163d8d00187b382d1564422fb875c5b
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-12-06 10:31:41 -06:00
Vinayak Chettimada 13534dbf2c drivers: clock_control: Add nRF5x 32KHz source and accuracy support
Change-id: I0b0909f06c784e340eeed472124e8bcbdffd4337
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-11-07 12:04:02 +00:00
Ricardo Salveti 3580a6bcec clock_control: stm32f4x: introduce driver for STM32F4x RCC
Based on the STM32F10x driver. Removing old code as we need to use the
bus number when dealing with 4 possible peripherals.

Change-Id: Id0263aa008e9b039ff9a00339e5622e289ffdf99
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-28 18:58:03 +00:00
Anas Nashif 4b411b34a1 stm32: rename SOC_STM32F1X -> SOC_SERIES_STM32F1X
Use SOC_SERIES_* for naming SoCs with similar features and architectures
with the goal of code reuse. The Series in the config variable should avoid
name collisions and clearly denote the relationships within an SoC family.

Change-Id: I7a98542f96b5d5dc3acc23782c4d45f98cceb599
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:58 +00:00
Daniel Leung cf97ca685e doc: clock_control/stm32f1: Fix @file tag
The @file tag should follow by a file (or nothing for current file),
instead of file description. Fix it by separating the description.

Change-Id: Iabe3550568cdfdda6ad71be6fab3e8b5dfbeb940
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:42 +00:00
Maciek Borzecki 3f5af00529 clock_control/stm32f10x: introduce driver for STM32F10x RCC
The patch adds a driver for STM32F10x series RCC (Reset and Clock
Control) subsystem.

The module is primarily responsible for setting up of MCU's clock
tree. In particular the driver sets up SYSCLK, PLL (with source
configuration), AHB prescaler, and APB1/APB2 prescalers. As part of this
functionality, the subsystem can enable/disable clock signal for
particular peripherals, thus reducing the power consumption of the MCU.

The driver implements clock control driver API. However, subsystem IDs
being HW specific are exposed in driver public header that must be
included by callers. The driver registers a single device using a common
name STM32_CLOCK_CONTROL_NAME. The device is initialized at
the PRIMARY level with priority 1. This allows the initialization to
take place right after SoC initialization routine.

The driver depends on selection of SOC_STM32F1X config option and is MCU
specific.

Change-Id: I8bea5db20726a24bce7b7ffe0b95de543240429a
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-16 18:11:18 +00:00
Tomasz Bursztyka 714dd9786b clock: add Quark SE clock control
Quark SE provides various clock controllers through its SCSS block.
Peripheral, external, sensor, and others.

This current drivers provides only the clock gating capability, for
peripheral, external and sensor. But it could support divider and more
other features once defined in the generic API.

Note: such clock has _nothing_ to do with a Real Time Clock (RTC).
An RTC provide clock timing like a watch would do. Here the clock
controller is about circuit clocking.

Change-Id: I1a365ae730dfc6be7686271f7fbb693e64a6ff6f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:48 -05:00