Commit graph

234 commits

Author SHA1 Message Date
Yannis Damigos 87d624419d drivers/stm32f0x_ll_clock: Enable SYSCFG in clock_control
Enable System Configuration Controller clock in clock_control
instead of gpio controller when we set a gpio as interrupt.
We use System Configuration Controller to manage external
interrupts and enable PIN pair PA11/12, used in USB device,
mapped instead of PA9/10.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-05-14 09:45:40 -05:00
Yannis Damigos f6a9697923 drivers/stm32l0x_ll_clock: Enable SYSCFG in clock_control
Enable System Configuration Controller clock in clock_control
instead of gpio controller when we set a gpio as interrupt.
We use System Configuration Controller to manage external
interrupts and internal voltage reference for 48 MHz HSI
used in USB device.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-05-14 09:33:29 -05:00
Erwan Gouriou d8ba007a8b drivers: clock_control: Add MSI as possible clock source for stm32
Add MSI as potential SYSCLK direct source for L0 and L4.
It could be needed in some cases when an accurate clock
is required and no external clock is available.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-24 08:55:02 -05:00
Leandro Pereira 42a96c5667 drivers: clock_control: quark_se: Fix "make menuconfig"
Commit 29f8b23b broke "make menuconfig" due to a missing newline in
this Kconfig.quark_se file.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-04-04 20:31:02 -04:00
Tomasz Bursztyka 29f8b23bfd drivers/clock_control: Enable ARC core support on quark_se driver
Clock control can also be done through the ARC core.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Carles Cufi f49150cab6 arch: arm: nrf: Rename nrf5 SoC Family to nrf
Upcoming Nordic ICs that share many of the peripherals and architecture
with the currently supported nRF5x ones are no longer part of the nRF5
family. In order to accomodate that, rename the SoC family from nrf5 to
nrf, so that it can contain all of the members of the wider Nordic
family.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 11:57:14 +01: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
Endre Karlson e99a79a9b1 drivers: clock_control: Provide support for stm32l0x
Add Clock Control support for the stm32l0x based on reference manuals

Signed-off-by: Endre Karlson <endre.karlson@gmail.com>
2018-03-10 11:42:25 -06:00
Vinayak Kariappa Chettimada 81332c1fc8 clock_control: nrf5: Return -EBUSY on turning off if still in use
Fix return value to -EBUSY instead of 0 when releasing a
reference but not physically turning off the clock.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-02-08 14:51:31 +01:00
Neil Armstrong c406b95c40 drivers: clock_control: simplify CLOCK_STM32_PLL_PREDIV1 config
Remove SoCs part dependency of CLOCK_STM32_PLL_PREDIV1 config since
it will only be used on parts having an HSE oscillator, ignored
otherwise.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2018-01-25 15:13:53 -06:00
Erwin Rol 6342938bba drivers: clock control: stm32: use Kconfig to select HAL/LL sources
Use "select USE_STM32_LL_UTILS" to select the needed STM32 LL files,
instead of editing ext/hal/st/stm32cube/CMakeLists.txt

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2018-01-23 08:46:16 -06:00
Daniel Wagenknecht 39bb93d402 drivers: stm32 clock control: fix HSI PLLSOURCE with PREDIV1 support
The combination of
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL and
CONFIG_CLOCK_STM32_PLL_SRC_HSI
on SOCs with PREDIV1 support made use of the LL define
LL_RCC_PLLSOURCE_HSI_DIV_2, which is not defined for SOCs with
PREDIV1 support.

This exchanges LL_RCC_PLLSOURCE_HSI_DIV_2 with LL_RCC_PLLSOURCE_HSI
which is the appropiate source according to stm32f0xx_ll_rcc.h
line 473 and stm32f3xx_ll_rcc.h line 795.

Tested by compiling hello world for nucleo_f091rc board with HSI as
PLLSOURCE.

Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2018-01-11 19:00:19 -05:00
Maureen Helm 0f3b490905 clock_control: Introduce mcux ccm driver
Adds a new clock control driver for i.MX SoCs that have the clock
control module (CCM).

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-11-15 09:09:58 -06:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05: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
Maureen Helm 7a60782f67 clock_control: Introduce mcux sim driver
Adds a new clock control driver for Kinetis SoCs that have the system
integration (SIM) module. This will allow mcux shim drivers, such as
uart and i2c, to abstract the call to CLOCK_GetFreq() behind the
clock_control interface and thus be reused for SoCs with different clock
architectures.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-10-20 12:28:11 -05:00
Thiago Silveira 1d8c8ac3af clock_control: nrf5_power: Let the LF clock be configured at least once
If the LF clock was already started, but wasn't initialized with
_k32src_start yet, allow it to run once. This is needed because if a
soft reset is triggered while watchdog is active, the LF clock will
already be running, but won't be configured yet (watchdog forces LF
clock to be running).

If the LF clock isn't configured with _k32src_start, the nRF5 RTC
won't count and the whole system will malfunction, as the kernel
depends on the clock source being working properly.

Signed-off-by: Thiago Silveira <thiago@exati.com.br>
2017-10-08 23:05:34 -04:00
Anas Nashif 09bcd8ee74 Kconfig: make all syslog variables depend on SYS_LOG
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-04 14:34:54 -05:00
Vinayak Kariappa Chettimada e81fb85cad clock_control: nRF5x: Select 251-500ppm as default for 32kHz RCOSC
Frequency tolerance for LFRC after calibration for nRF5x
Series ICs is between 251 and 500 ppm as per Product
Specification. For more details refer to:
http://infocenter.nordicsemi.com/

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-07-11 10:29:46 -05:00
Kumar Gala 49ebc09a52 clock: stm32: Cleanup use of C99 types
We introduced some see C99 types, so convert them over to the Zephyr
types.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-22 13:47:28 -04: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 e1a90583d4 drivers: clock_control: provide LL based driver to stm32f1xx series
Align stm32f1xx series clock driver to other parts of stm32 family.
Driver support both Connectivity and Density lines of stm32f1 series,
that are based on different Reset and Clock Control architectures.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-06-02 14:11:13 -04:00
Erwan Gouriou 9208d9f8db drivers: clock_control: fix AHB2 bus clock activation on stm32f4
During introduction of LL clock_control driver on stm32f4 series,
AHB2 clock activation/deactivation case was let under stm32l4 condition
preventing activation of this clock with F4 series.
This patch fixes the issue.

Change-Id: I5e488e990d33252f491f8960fc7a798ca3416be2
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-05-15 08:27:27 -05:00
Marti Bolivar 15780bd542 clock_control: stm32: fix a PLL init corner case
Commit 58c8d15 ("clock control:stm32: provide STM32Cube LL based
driver") added PLL initialization which disables the PLL before
configuring it.

This works if the system clock source is not the PLL (which is the
usual case for Zephyr booting out of chip reset). However, if the
SYSCLK source *is* the PLL, this halts execution.

To support this use case, switch the SYSCLK source to the
always-present HSI before disabling the PLL.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-05-10 08:31:13 -04:00
Marti Bolivar cf05109c91 clock_control: stm32: factor out HSI switch code
Factor out a subroutine used to switch SYSCLK to HSI. This code will
be used again in a subsequent patch.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-05-10 08:31:13 -04:00
David B. Kinder f930480e16 doc: misspellings in Kconfig files
fix misspelling in Kconfig files that would show up in configuration
documentation and screens.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-05-05 19:38:53 -04:00
Erwan Gouriou 288a9c145d driver: clock control stm32: align f4 factor names on l4
This commits align CONFIG_ factor names between stm32f4 and stm32l4
series to enable code factorization such as use of Q_DIVISOR.
Though, it does not concatenate kconfig sections as we might use
a bit of time to see what is needed in this regard

Change-Id: Ia603406d53949abf5675b801a5448397d5ab8462
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-04-28 15:26:37 -05: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
Erwan Gouriou fda01e52c2 drivers: clock control: Provide LL based clock control for stm32f4 series
This commit enables STM32Cube LL based driver for stm32f4 series.
This generic driver provides a unified API to clock driver for all
stm32 series.
LL API allows driver to be lightweight and to keep genericity across
stm32 family to ease further devlopment and maintenance.

Change-Id: Ie31ae8f433313787f9c9eda77de41925721d54dd
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-04-28 15:06:41 -05:00
David B. Kinder 93e4d7258d spell: fix Kconfig help typos: /boards /drivers
Fix misspellings in Kconfig help text

Change-Id: I3ae28a5d23d8e266612114bc0eb8a6e158129dc7
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-21 21:31:30 +00:00
Kumar Gala ccad5bf3e3 drivers: convert 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.

Jira: ZEP-2051

Change-Id: I08f51e2bfd475f6245771c1bd2df7ffc744c48c4
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 10:06:48 -05:00
Florian Vaussard 33579adef9 clock: stm32f4: Fix range of CLOCK_STM32F4X_PLLN_MULTIPLIER config
The PLLN multiplier can range between 50 and 432 on all STM32F4, except
on the STM32F401 where the lower bound is restricted to 192.

Fix the range property and the help text to reflect this reality.

Change-Id: I7b93e84b321f7869aaf611287344cd3e25c893c8
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Erwan Gouriou de684bbdaa clock_control: fix to get PLL2 source for PREDV1 working
Some fixes where needed to get PLL2 source of PREVI1 functional.
Compiled ok with following configuration:
CONFIG_CLOCK_STM32F10X_CONN_LINE_PREDIV1_SRC_PLL2CLK=y
CONFIG_CLOCK_STM32F10X_CONN_LINE_PREDIV2=0
CONFIG_CLOCK_STM32F10X_CONN_LINE_PLL2_MULTIPLIER=8

Jira: ZEP-1758

Change-Id: I5ddfaef1b44c4c4e5e6adedc158a1c9092bc8df5
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-22 18:09:22 -06:00
Erwan Gouriou 8ab42c92ce clock_control: stm32: code optimization
This commit brings code size optimization as suggested by Christer
Weinigel review during review of initial commit for this driver.
It also cleans up useless definition in header file.

Change-Id: Ibeaa2e51570dff21825c60c30ba83d939b31d938
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-10 14:47:41 -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
Kumar Gala 043b006c0f clock_control: nrf5_power: Use CMSIS NVIC APIs directly
Convert driver to use the CMSIS NVIC APIs rather than the internal ones
so we can remove them in the future.

Change-Id: I7bf3024ea4baf61f1e42bbbd5e4b0abfc6c04e6b
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:55 -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
Anas Nashif a9e879e273 logging: move sys_log to subsys/logging
Move logging out of misc/ to its own subsystem. Anything related to
logging and any new logging features or backends could be added here
instead of the generic location in misc/ which is overcrowded with
options that are not related to eachother.

Jira: ZEP-1467
Change-Id: If6a3ea625c3a3562a7a61a0ba5fd7e6ca75518ba
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19 19:58:39 +00: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
Flavio Santes b04cdcd6e6 drivers: Remove legacy nanokernel.h include
This commit replaces the nanokernel.h include by kernel.h.

Change-Id: Ib42fbf2d9f77a73c0831f569b3dbbfb342ea2e1d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-04 14:59:37 -06:00
Tomasz Bursztyka dc7193373b clock_control: NRF5 Kconfig option should be available only on NRF5
Change-Id: If6ba2f5a03967ca2ddca8d4bc211bc0c55ae0312
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-11-22 17:00:46 +00:00
Vincenzo Frascino 86add71a86 clock_control: Cleanup stm32f10x driver
This patch addresses the following issues:
* Aligns the Kconfig code style with Zephyr projects requirements.
* Removes redundant "depends on" from Kconfig.
* Adds static to the containing file scope declarations.

Change-Id: Idaaa0d705a31bc69cdf7e576e303f581d3d0bd5f
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-19 01:58:55 +00:00
Vincenzo Frascino b6b35f6113 clock_control: Cleanup stm32f4x driver
This patch addresses the following issues:
* Aligns the Kconfig code style with Zephyr projects requirements.
* Removes redundant "depends on" from Kconfig.
* Adds static to the containing file scope declarations.

Change-Id: I14651826724c014cc71d62ab6cab03c668c578c0
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-19 01:58:54 +00:00
Vincenzo Frascino 9c1bb2b2b9 clock_control: Cleanup quark_se driver
This patch addresses the following issues:
* Aligns the Kconfig code style with Zephyr projects requirements.
* Removes redundant "depends on" from Kconfig.
* Adds static to the containing file scope declarations.

Change-Id: I6d48d2eaf6ffd5fa28b37e1d3ca2d467705110f3
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-19 01:58:54 +00:00
Vincenzo Frascino dc1ddf9c1a clock_control: Cleanup nrf5 clock_control driver
This patch removes redundant "depends on" from Kconfig.

Change-Id: I13d7556faa4751d2da149d458340bcdf29afa2ca
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-19 01:58:53 +00:00
Vincenzo Frascino d6964951df clock_control: Cleanup main Kconfig
This patch addresses the following issues:
* Aligns the Kconfig code style with Zephyr projects requirements.
* Removes redundant "depends on" from Kconfig.

Change-Id: Ic9e2fd935417fa40127bddeba4660109332087ff
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-19 01:58:53 +00:00
Andrew Boie 0b474eef9c kernel: deprecate old init levels
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.

New init levels introduced: PRE_KERNEL_1, PRE_KERNEL_2, POST_KERNEL
to replace them.

Most existing code has instances of PRIMARY replaced with PRE_KERNEL_1,
SECONDARY with POST_KERNEL as SECONDARY has had a longstanding bug
where the documentation specified SECONDARY ran before the kernel started
up, but actually ran afterwards.

Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:59:44 +00: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
Erwan Gouriou eed678612b clock_control: have FLASH_BASE compatible with ST CMSIS files
In ST CMSIS files, FLASH_BASE does not mean base address of FLASH register
Instead FLASH_R_BASE is used.
stm32f1 clock control driver is updated to be compatible with this naming.

Change-Id: Ic4fb49c60c392e15fd12c69266baf4c686bd343b
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2016-11-03 20:29:07 +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
Marcus Shawcroft d8de6cb08d drivers/quark_se_clock_control: Make driver_api const.
Change-Id: I09c2c4aedf6f1e31513f857843f0718b51401f9f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:50:57 +00:00
Marcus Shawcroft 960565269a drivers/stm32f10x_clock: Make driver_api structure const.
Change-Id: I7d8fb922b9ea0d11c48f61004138a166b9eb4d98
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:22 +00:00
Marcus Shawcroft fece918846 drivers/nrf5_power_clock: Make driver_api structure const.
Change-Id: Ibac214beb850b74746b5315695beb543a7c0bd76
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:22 +00:00
Ricardo Salveti 69b9451af1 arm/nordic: use a common header for the nrf51/nrf52 SoC families
Integrating the IRQ definitions for both nRF51 and nRF52, and defining
the set of IRQ values that are common to both.

Also switch the controller, uart and clock drivers to use the common
header definitions.

Change-Id: Id6816d7a97720896cfe4df83656fb8b1f8fb01fa
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-10-22 01:25:54 +00:00
Vinayak Chettimada 5843e8df89 drivers: clock_control: Add nRF5x Series SoC clock driver
In the Nordic Semiconductor's nRF5x series SoC clock control
system can source the system clocks from a range of internal or
external high and low frequency oscillators and distribute them
to modules based upon a module’s individual requirements.
In this commit the implementation adds support for 16MHz
peripheral clock, 32.768 kHz RC oscillator, and 32.768 kHz
crystal oscillator clock sources.

16MHz peripheral clock is required to use the 2.4GHz Radio
peripheral. 32.768 kHz RC or crystal oscillator clock source
is required to use the real time counter peripheral.

Jira: ZEP-896

Change-id: I1a1e22322a5a26b587f3e27bb979e6296987ac1c
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-10-18 13:03:41 +00:00
Marcus Shawcroft 02dcceef29 clock/quark: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: I0337cb574d8bac0877643b2116920d4a0c08c8f3
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-08 11:40:15 +00:00
Anas Nashif 5363d14a9e boards: rename Quark SE Devboard to Quark SE C1000
This board now has an official name and will be available soon:

http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/se-soc/overview.html

Jira: ZEP-758
Change-Id: Ia16d33722308cf81471321c3063bdc75055a4d50
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:31 +00:00
Genaro Saucedo Tejada 1c7e992e5d sys_log: replace old debug macros at clock control driver
Clock control drivers are now using new system log macros. also update
the Kconfig variable to be a level rather than a bool.
JIRA: ZEP-311

Change-Id: Ia64e79e4e083df580861f64c661f8dbaa8a3985d
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-07-08 19:41:26 +00:00
Kumar Gala 9ec2f3be80 Cleanup whitespace in Kconfig files
Convert leading whitespace into tabs in Kconfig files.  Also replaced
double spaces between config and <prompt>.

Change-Id: I341c718ecf4143529b477c239bbde88e18f37062
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-05-25 13:28:07 -05: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 00dce01c89 clock_control/stm32f10x: convert to use DEVICE_AND_API_INIT()
Change-Id: Ifba0123c6843396341d213601889fa6839bfedd6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:14 +00:00
Daniel Leung 0ac7c72e7b clock_control/quark_se: convert to use DEVICE_AND_API_INIT()
Change-Id: Ib3aa021b8e8c32079d5800b3f2ffc9f9fabdb4b6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:09 +00:00
Daniel Leung 546b8ade37 refactor common driver initialization priorities
Most of the SoC and board Kconfig use the same values for
driver initialization priorities. So refactor them, and
discard duplicate ones.

The shared IRQ init priority was changed so that the kernel
default init and device init priorities can be standardized
across all SoC/boards. Same goes for DesignWare SPI driver.

This also changes the UART_CONSOLE_PRIORITY and
IPM_CONSOLE_PRIORITY to UART_CONSOLE_INIT_PRIORITY and
IPM_CONSOLE_INIT_PRIORITY, to standardize across all drivers.

Note that this does not take away the ability to override
those values. This just provides reasonable defaults such
that there is virtually no need to override.

Change-Id: Ibbd95d802c637df06f9a2fd48763ee1e6f4ff627
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-28 15:58:29 -07:00
Maciek Borzecki 61c0363257 clock_control/stm32f1: HSE support and PLL configuration cleanup
Add support for use of HSE (incorrectly named PREDIV1)as input of PLL,
along with HSE bypass for stabilized external clock, and XTPRE
prescaler. Update PLL handling so that we do not unnecessarily enable
PLL clocks, instead enabling only the clocks sources that are required
as per user's configuration.

This change allows higher SYSCLK clock values, up to 72MHz.

Change-Id: Ia7c2be3ce11ac0de2efa664b20e7ab5fddd57a51
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-21 16:36:13 +00:00
Daniel Leung 770c6e7ca5 clock_control/stm32f10x: move kconfigs into its submenu
Moves the kconfig options for STM32F10X clock control driver
into its own submenu.

Change-Id: I9ef658defe85feab3dfdb3e329710cb48bbffd86
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-18 11:27:09 +00:00
Daniel Leung e143d6dd59 clock_control/quark_se: fix default kconfig dependencies
() Moves the Quark SE clock control into its submenu.
() Fixes the dependencies in the SoC default Kconfig
   so the options are not displayed out of place in
   menuconfig.

Change-Id: Ifdf06242be8ceed03c2c657c942875a5a7f2750e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-18 11:27:09 +00:00
Andre Guedes 024cfe754e drivers: Replace DEV_OK by 0
This patch replaces all occurences of the macro DEV_OK by the actual
value 0 at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I69980ecb9755f2fb026de5668ae9c21a4ae62d1e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04: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
Maciek Borzecki 14482f0940 clock_control: extend API with clock rate query operation
Extend the public API of clock_control driver with a function for
querying of clock rate driving given peripheral. This is useful when the
driver must calculate or configurae values that depend on the rate of
clock driving this subsystem.

A baud rate setting of UART port is an example of such operation. To
configure a particular baud rate the driver may need to set the internal
counters of UART port, where the actual value will depend on the clock
rate for this peripheral.

The implementation returns DEV_NO_SUPPORT for clock_control drivers that
do not implement such functionality.

Change-Id: I4e7ec96cd3678a4bb1ff289b0247488289310f2d
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-16 18:09:32 +00:00
Maciek Borzecki 5cff3cc561 clock_control/Kconfig: move quark_se entries to separate file
Move quark_se clock control entries to separate file. This will help to
keep things organized once we add more clock control drivers.

Change-Id: Id8f4a94189ab5bbba9b6552777549cf426d79273
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-16 18:08:11 +00:00
Maciek Borzecki 9d61f61453 clock_control/Kconfig: fix quark_se dependencies
Fix dependencies for external and sensor clock device names in
clock_control Kconfig.

Change-Id: I708f025cf3ce97bcd003754fb5b395712d203107
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-08 16:47:48 +00:00
Benjamin Walsh d340d4cb3f device: use DEVICE_INIT everwhere
This is the last step before obsoleting DEVICE_DEFINE() and
DEVICE_INIT_CONFIG_DEFINE().

Change-Id: Ica4257662969048083ab9839872b4b437b8b351b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh 0303d8cab9 device: rename SYS_DEFINE_DEVICE()
Rename it to DEVICE_DEFINE() so that it fits in the 'device' namespace.

Change-Id: I3af3a39cf9154359b31d22729d0db9f710cd202b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh bfc27206b2 device: rename DECLARE_DEVICE_INIT_CONFIG()
Rename it to DEVICE_INIT_CONFIG_DEFINE(), because (a) it was not fitting
in any namespace and (b) it is not used to declare, but rather define a
object.

Change-Id: I1da5822f06b85a9fb024b5b184afd0ccc01012ec
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Anas Nashif 10bb38c186 Use SoC instead of platform.
Change terminology and use SoC instead of platform. An SoC provides
features and default configurations available with an SoC. A board
implements the SoC and adds more features and IP block specific to the
board to extend the SoC functionality such as sensors and debugging
features.

Change-Id: I15e8d78a6d4ecd5cfb3bc25ced9ba77e5ea1122f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Anas Nashif 5115fb57ad quark_se: rename platform and remove x86 suffix
Change-Id: I19ac3a4c6081720736c6fbf16b649ccf6ae60e2f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05:00
Dmitriy Korovkin 57f2741e4f init: Implement fine-grained initialization policy
Put initialization priorities as device driver Kconfig
parameter.

Initialization priority value for each platform is defined
in the platform Kconfig file.

Drivers and platform code use SYS_DEFINE_DEVICE to add
and initialization function.

Change-Id: I2f4f3c7370dac02408a1b50a0a1bade8b427a282
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05: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