Commit graph

2576 commits

Author SHA1 Message Date
Pieter De Gendt
7ef643385b soc: arm: atmel_sam: sam4s: add support for sam4sa16c
Add soc support for sam4sa16c variant

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-08-16 12:53:50 +02:00
Kumar Gala
9f1f9a4843 peci: remove Kconfig.defconfig* setting of peci drivers
Now that peci drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-16 08:26:11 +00:00
Yves Vandervennet
7a4bb3b27c can: nxp: enabling MCAN on NXP's lpcxpresso55s36
This commit introduces

 - changes on SoC Kconfig and dts files
 - board specific changes (CAN node status, pinctrl and Zephyr alias)

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2022-08-15 13:37:38 -05:00
Kumar Gala
c54086da54 ethernet: remove Kconfig.defconfig* setting of ethernet drivers
Now that ethernet drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-15 14:32:45 +02:00
Aurelien Jarno
72dab5bda9 soc: arm: stm32g0: fix USB-C PD dead battery support
Currently the USB-C PD dead battery support is disabled very early in
the boot process, in order to give access to CC1 and CC2 pins to the
application. However this breaks dead battery support as this instructs
the PD source to stop delivering power.

This commit changes the behavour to keep the internal pull-up in dead
battery pins enable if the UCPD driver is enabled, and the corresponding
UCPD peripheral is also enabled. The code is a bit complex as it aims to
support possible G0 devices with a single UCPD controller (as opposed to
the current one), and also because I haven't found any simple way to
match the UCPD peripheral with the bits in the SYSCFG_CFGR1 register (I
used the same trick with the base address as in the driver).

Given I have not been able to get that working with macros, the check is
done at "runtime", however GCC is smart enough to optimize the code. The
generated code is identical if none of the UCPD peripheral is enabled.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-08-15 08:20:29 +00:00
Immo Birnbaum
86d68e15e9 soc: arm: xilinx_zynq7000: add MMU PTEs for all AXI GPIO IP core instances
add the MMU page table entries for all instances of the Xilinx AXI GPIO
controller IP core. Other than any Zynq-7000 peripheral supported so far,
the existance of 1..n instances of the IP core within the FPGA part of the
SoC is optional. Therefore, other than addressing instances of supported
peripherals using their DT node label as has always been the case so far,
the data for the MMU page table is added using the DT_FOREACH_STATUS_OKAY
macro.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
2022-08-15 08:11:35 +00:00
Navin Sankar Velliangiri
3a15dc8c31 soc: arm: nxp: Add LPC51U68 support.
Add initial support for NXP LPC51U68 SOC series

Signed-off-by: Navin Sankar Velliangiri <navin@linumiz.com>
2022-08-12 16:15:42 -05:00
Declan Snyder
310283dad1 soc: rt: CAAM requires cache write-through mode
The use of the RT11xx CAAM requires
cache write-through mode,
otherwise some tests give a compiler warning.

Add to the soc CMake to do this

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2022-08-12 11:43:37 -05:00
Kumar Gala
2169a09d8a sdhc: remove Kconfig.defconfig* setting of sdhc drivers
Now that sdhc drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-12 17:39:15 +02:00
Gerard Marull-Paretas
ffc90592f8 soc: arm: gigadevice: add initial support for gd32e50x series
Add initial support for GD32E50X series (only GD32507X for now).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-12 14:13:49 +01:00
Mahesh Mahadevan
aa061b42b6 soc: nxp_imx: Workaround for SDK macro name variation
The macro INPUTMUX_PINTSEL_COUNT is name INPUTMUX_PINT_SEL_COUNT
on certain SoC's in the SDK.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-08-12 11:34:03 +02:00
Kumar Gala
6124ccfccf drivers: ethernet: provide Kconfig means to disable ethernet drivers
There are several test cases that create fake ethernet devices and
expect the fake device to be the only ethernet device enabled.  Some
tests handle this be explicitly disabling actual ethernet drivers,
but this doesn't scale well.

Change drivers/ethernet/Kconfig to utilze a menuconfig option that
wraps all the drivers.  This allows us for those test cases that
don't want any actual ethernet drivers to disable them with a
simple CONFIG_ETH_DRIVER=n.

Note, the fake ethernet devices utilize CONFIG_ETH_INIT_PRIORITY so
we have it outside of the 'if ETH_DRIVER' block.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-12 11:33:43 +02:00
Erwan Gouriou
92b100e2df soc: stm32l5: power: Factorize some code pm_state_set
Factorize actions that do not depend on substate_id in pm_state_set.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-08-11 13:22:58 +01:00
Kumar Gala
ff2a1212bf counter: remove Kconfig.defconfig* setting of counter drivers
Now that counter drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-10 10:46:55 -05:00
Attie Grande
df8db2d3f6 soc: atmel_sam0: fix include path for SAMR35
Add the "zephyr/" prefix...

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-08-10 12:00:11 +02:00
Gerard Marull-Paretas
b74a22924e net: lib: config: remove NET_CONFIG_IEEE802154_DEV_NAME
Remove NET_CONFIG_IEEE802154_DEV_NAME in favor of DT based choice using
zephyr,ieee802154.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-10 11:57:34 +02:00
Kumar Gala
236484456f drivers: kscan: Remove unnecessary Kconfig settings
Have the kscan device enabled in devicetree will now get the driver
enabled by default when CONFIG_KSCAN=y is set.  So we can remove
driver enabling Kconfig values in various Kconfig.defconfig files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-09 23:37:46 -05:00
Kumar Gala
f2fa572561 entropy: remove Kconfig.defconfig* setting of entropy drivers
Now that entropy drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-09 23:37:33 -05:00
Henrik Brix Andersen
b6376aed9d soc: arm: st: check if clock device is ready before accessing
Add check for device_is_ready() before accessing clock control devices.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-08-09 17:16:16 +02:00
Kumar Gala
63769bd1c1 drivers: display: Remove unnecessary Kconfig settings
Have the display enabled in devicetree will now get the driver
enabled by default when CONFIG_DISPLAY=y is set.  So we can remove
setting driver enabling Kconfig values in various .conf and
defconfig files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-09 12:27:44 +02:00
Kumar Gala
e31cba26be flash: remove Kconfig.defconfig* setting of flash drivers
Now that flash drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-09 12:27:28 +02:00
Kumar Gala
8429167e1c soc: nordic_nrf: drop IPM support
Only support mailbox as that is the preferred solution on NRF.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-08 10:42:32 +02:00
Gerard Marull-Paretas
61361e870b kconfig: remove redundant IEEE 802.15.4 defaults or selections
All IEEE 802.15.4 drivers are now automatically enabled if they are
'okay' in DT and all of its dependencies are 'y', including
CONFIG_IEEE802154. This means individual driver enablement is not
necessary anymore in Kconfig.defconfig files or samples/tests. Boards
need to still make sure any dependencies are enabled, e.g. SPI bus in
some cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:56:47 +02:00
Erwan Gouriou
e12d103a80 soc: stm32: Remove direct COUNTER_RTC_STM32 to COUNTER dependency
COUNTER_RTC_STM32 used to be enabled directly based on COUNTER status.
This should not be the case anymore as we should first check
DT_HAS_ST_STM32_RTC_ENABLED status (which is already done in
drivers/counter/Kconfig.stm32_rtc).

Remove these 3 lines that are not correct anymore.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-08-05 11:42:33 +01:00
Jay Vasanth
ccb77af3b7 eeprom: Add Microchip eeprom driver skeleton
Prepare for Microchip eeprom driver addition. Update
dtsi, kconfig, cmake and relevant soc files for eeprom
driver addition.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-08-04 18:36:18 +02:00
Yves Vandervennet
cd7dbe92b1 soc: arm: nxp_lpc: lpc55xxx: disabling LPC55S36 IAP support
This is temporary until support has been enabled. lpc55s36's IAP controller
is different and does not match previous implementations.
The Zephyr driver uses a data structure matching the IAP controller to
implement a feature that should normally come out of the ROM.

Since IAP support is not in yet, disabling the option in the SoC's Kconfig
and disabling the node in the device tree is the proper way to go forward.

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2022-08-04 10:47:16 -05:00
Neil Chen
5642d4f805 soc: arm: nxp_lpc: lpc55xxx: LPC55S36: add device support
- Add soc information for LPC55S36

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2022-08-04 10:47:16 -05:00
Daniel DeGrasse
f7f94dd367 drivers: pinctrl: update lpc iocon to support LPC55s3x
LPC55s3x family has an additional analog mode bit available. Update
IOCON binding and IOCON driver to support setting this bit via a pin
control property.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-08-04 10:47:16 -05:00
Kumar Gala
27f28f2822 can: remove Kconfig.defconfig setting of CAN drivers
Now that CAN drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the CAN.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-04 13:47:52 +02:00
Gerard Marull-Paretas
2df965f490 drivers: ieee802154: nrf5: make driver DT-based
Use Devicetree to describe the radio and IEEE 802.15.4. This allows to
remove usage of IEEE802154_NRF5_DRV_NAME in preparation for the
removal of NET_CONFIG_IEEE802154_DEV_NAME.

All SoC files have been updated with the addition of an ieee802154 node
(disabled and only on those SoCs that define ieee802154-supported. The
peripheral has been enabled in the nRF52840DK board (used for testing
ieee802154).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-04 13:25:35 +02:00
Gerard Marull-Paretas
7d5272db62 drivers: ieee802154: kw41z: make driver DT-based
Use Devicetree to describe the radio and IEEE 802.15.4. This allows to
remove usage of IEEE802154_KW41Z_DRV_NAME in preparation for the removal
of NET_CONFIG_IEEE802154_DEV_NAME.

KW41Z files have been updated with the addition of radio and an
ieee802154 nodes The peripheral has been enabled in the frdm_k41z board
(used for testing ieee802154).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-04 13:25:35 +02:00
Gerard Marull-Paretas
fa16891625 drivers: ieee802154: cc13x2_cc26x2: make driver DT-based
Use Devicetree to describe the radio and IEEE 802.15.4. This allows to
remove usage of IEEE802154_CC13XX_CC26XX_DRV_NAME in preparation for the
removal of NET_CONFIG_IEEE802154_DEV_NAME. All boards used in testing
have been updated to enable the peripheral in DT as well.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-04 13:25:35 +02:00
Kumar Gala
6298b27725 watchdog: remove Kconfig.defconfig setting of watchdog drivers
Now that watchdog drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
watchdog and not respect the devicetree state of the watchdog.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-03 18:30:17 -05:00
Kumar Gala
b5b2b627b5 dac: remove Kconfig.defconfig setting of DAC drivers
Now that DAC drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the DAC.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-03 18:45:23 +02:00
Kumar Gala
7e8a312c6b adc: remove Kconfig.defconfig setting of ADC drivers
Now that ADC drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the ADC.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-02 15:51:43 -05:00
Fabio Baltieri
24d09d363c include: fix the remaining legacy #include paths
Add the "zephyr/" prefix to various #include statements that are
preventing the CI form running with LEGACY_INCLUDE_PATH=n.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Kumar Gala
84575930f5 i2c: Remove unncessary HAS_I2C_DW Kconfig symbol
The HAS_I2C_DW was to limit Kconfig visibility to only platforms
that utilize the I2C DW IP.  The Kconfig for I2C_DW depends on
DT_HAS_SNPS_DESIGNWARE_I2C_ENABLED which will cause the same
visbility limitation to only platforms that have I2C DW devicetree
nodes.  Thus we can remove HAS_I2C_DW and its references.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-01 18:01:44 +02:00
Kumar Gala
5c57a36f9d i2c: remove Kconfig.defconfig setting of I2C drivers
Now that I2C drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the I2C.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-01 18:01:44 +02:00
Jay Vasanth
3e0f738cb2 mec15xx: pinctrl for both mec15xx and mec17xx
Changes to compile pinctrl driver for both mec15xx
and mec17xx. Also add mec15xx pinctrl dtsi

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-08-01 10:28:23 +02:00
Kumar Gala
5b9e0b615c clock_control: remove Kconfig.defconfig setting of clk control drivers
Now that clock control drivers are enabled based on devicetree we
need to remove any cases of them getting enabled by Kconfig.defconfig*
files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a sensor and not
respect the devicetree state of the clock control.  Additionally we
can get problems with prj.conf/defconfig getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-29 14:12:12 +02:00
Jun Lin
ec4f700202 driver: PECI: npcx: add driver support for Nuvoton npcx family
This commit add the PECI driver for Nuvoton npcx family to support PECI
APIs.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2022-07-29 14:09:17 +02:00
Kumar Gala
65e1c6fb1e pwm: remove Kconfig.defconfig setting of PWM drivers
Now that PWM drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the PWM.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-27 18:43:54 +02:00
Kumar Gala
960f2f1a37 spi: remove Kconfig.defconfig setting of SPI drivers
Now that SPI drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the SPI.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-27 09:49:00 +02:00
Kumar Gala
9a501e0922 serial: remove Kconfig.defconfig setting of serial drivers
Now that serial drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the serial.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-26 09:29:24 -05:00
Kumar Gala
600d749cf3 gpio: remove Kconfig.defconfig setting of GPIO drivers
Now that gpio drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the GPIO.
Additionally we can get problems with prj.conf/defconfig
getting incorrectly overridden.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-26 08:49:38 +02:00
HaiLong Yang
ef1ad14c78 soc: arm: fix gd32f4xx series config
This add soc check for series config, also fix a miss spelling issue.

Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
2022-07-25 15:14:21 +02:00
Kumar Gala
df0c6d4c43 sensors: remove defconfig setting of sensor drivers
Now that sensor drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Typically the Kconfig.defconfig* will blindly enable a
sensor and not respect the devicetree state of the sensor.
Additionally we can get problems with prj.conf/defconfig
as well getting incorrectly overridden.

Fixes #48198

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-25 09:40:14 +02:00
Mulin Chao
8cf0feb3e2 power: npcx: add leakage-io support for better power consumption
This CL adds a DT node, 'power_leakage_io', which property,
'leak-gpios', contains GPIOs that have leakage current. In oerder to get
better power consumption, npcx power driver will disable the connections
between these io pads and input buffers before entering deep sleep.
Then, restore the connections after ec wakes up.

The users can overwrite this property at board DT file. Here is an
example:

    &power_leakage_io {
        leak-gpios = <&gpio0 0 0
                      &gpiob 1 0>;
    };

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-07-22 10:33:03 +02:00
Mulin Chao
9267655f42 driver: gpio: npcx: Support GPIO_VOLTAGE_1P8 flag
This CL configures low-voltage (1.8V) detection via GPIO driver with
GPIO_VOLTAGE_1P8 flag. It also adds support for this flag in
pin_get_config() function.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-07-22 10:33:03 +02:00
Mulin Chao
a5fee4c6de driver: scfg: npcx: cleanup low-voltage detection configuration
Cleanup npcx low-voltage (1.8V) detection configuration. It removes
unused soc utilities, macros, and DT node. We will configure this
feature by GPIO driver with GPIO_VOLTAGE_1P8 flag later.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-07-22 10:33:03 +02:00
Kumar Gala
2d88414c4e drivers: serial: pl011: Remove unused Kconfig symbols
The driver has be DT_INST based for a while so the Kconfig
symbols CONFIG_UART_PL011_PORT0<n> aren't used.  So lets
remove them.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-21 16:40:28 +00:00
Simon Hein
c29d0a3c4f soc: arm: comply to coding guidelines MISRA C:2012 Rule 14.4
MISRA C:2012 Rule 14.4 (The controlling expression of an if statement
and the controlling expression of an iteration-statement shall have
essentially Boolean type.)

Use `do { ... } while (false)' instead of `do { ... } while (0)'.

This commit is a subset of the original commit:
5d02614e34a86b549c7707d3d9f0984bc3a5f22a

Signed-off-by: Simon Hein <SHein@baumer.com>
2022-07-21 10:31:00 +02:00
Tomislav Milkovic
0fe2c1fe90 everywhere: Fix legacy include paths
Any project with Kconfig option CONFIG_LEGACY_INCLUDE_PATH set to n
couldn't be built because some files were missing zephyr/ prefix in
includes
Re-run the migrate_includes.py script to fix all legacy include paths

Signed-off-by: Tomislav Milkovic <milkovic@byte-lab.com>
2022-07-18 16:16:47 +00:00
Bernard Lee
5658e9e30d soc: arm: nordic_nrf: include linker sections header
Include linker sections header to move z_arm_platform_init to text
section. It is now is placed in the TEXT section.

Signed-off-by: Bernard Lee <bernard.lee@nordicsemi.no>
2022-07-18 16:11:50 +00:00
Attie Grande
7ded40de84 soc: atmel_sam0: The ADC reference is locked while enabled for SAML21
For SAML21-based parts, the REFCTRL register is locked while the ADC is
enabled. Permit some parts to declare that they need the ADC to be
disabled before modifying REFCTRL.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-07-18 10:35:46 +00:00
Attie Grande
a10b8cb1c0 soc: atmel_sam0: Add support for SAMR34 and SAMR35 parts
Implement support for SAMR34 and SAMR35 parts, tested on a SAMR34
Xplained Pro dev board. Confirmed operational peripherals: UART, GPIO,
PWM, ADC.

NOTE: The SAMR34 datasheet lists NVIC line 20 for the ADC's interrupt,
but the SAML21 datasheet gives line 22. It appears that the SAMR34 sheet
is incorrect (the ADC doesn't function with line 20), and as such, I have
also omitted the adjustments for TC4 and AC...

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-07-18 10:35:46 +00:00
Attie Grande
64e4200d94 soc: atmel_sam0: Add support for SAML21 parts
Implement support for SAML21 parts, tested on a SAML21 Xplained Pro dev
board. Confirmed operational peripherals: UART, GPIO, PWM, ADC.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-07-18 10:35:46 +00:00
Mulin Chao
24fb705cdd npcx: scfg: psl: cleanup unused functions and DT files
Clean up unused psl functions in scfg.c, unused DT macros, unused psl DT
nodes and related yaml files. Currently, PSL pad configurations are made
by pinctrl mechanism. Please refer
https://issuetracker.google.com/234861079 for more detail.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-07-15 10:00:15 +02:00
Johann Fischer
3c971307dc arch/kernel/soc/samples: use unsigned int for irq_lock()
irq_lock() returns an unsigned integer key.
Generated by spatch using semantic patch
scripts/coccinelle/irq_lock.cocci

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-07-14 14:37:13 -05:00
Mulin Chao
3468a02f72 npcx: scfg: pinmux: cleanup unused functions and macro
Clean up unused pinmux function 'npcx_pinctrl_mux_configure()' and
related 'NPCX_DT_IO_ALT*' macro functions.

Please refer https://issuetracker.google.com/234861079 for more detail.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-07-13 10:38:49 +02:00
Jay Vasanth
7c88336171 soc: device_power: MEC172x: fix incorrect for loop check
fix incorrect iteration condition in MEC172x device_power.c

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-07-12 09:24:30 -05:00
Jeppe Odgaard
af6f975391 soc: select HAS_MCUX_SRC for MIMXRT1052
Select missing HAS_MCUX_SRC Kconfig symbol for MIMXRT1052,
that allows using NXP i.MX mcux SRC hwinfo driver.

Fixes https://github.com/zephyrproject-rtos/zephyr/issues/47025

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2022-07-12 10:17:38 +02:00
Pieter De Gendt
3cde5a0aaa soc: mimxrt1064: Remove unused low power header include
The included header file wasn't used.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-11 17:51:18 -05:00
Pieter De Gendt
3556bf6fa9 soc: mimxrt1064: Fix low power build issue with video PLL
Fix build error if CONFIG_PM and CONFIG_INIT_VIDEO_PLL are enabled.
Added 2 missing semicolons.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-11 17:51:18 -05:00
Carlo Caione
2f5fef960e sample: s2ram: Introduce S2RAM sample
Introduce a template / sample for S2RAM running on rf5340dk.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 15:26:26 +02:00
Julien Massot
08f5fb5cdb soc: arm: fvp_aemv8r_aarch32: define static mpu regions
Add static MPU regions for this SoC.
These regions will be initialized as static region during system boot.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-07-11 11:17:02 +02:00
Francois Ramu
c1782a096e soc: arm: new stm32f412Rx device
This adds a new stm32f412Rx in the list of stm32F4 devices.
The module stm32cube/stm32f4/soc/stm32f412rx.h exists

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-07-08 10:49:31 +02:00
Mulin Chao
851e357aa4 pinctrl: npcx: add pinctrl support for psl pads
This CL introduces how to configure PSL (Power Switch Logic) pads
properties such as input detection mode/polarity, pin-muxing and so
on via pinctrl mechanism. It includes:

1. Add two pinctrl properties and their enums for PSL input
   detection configuration.
    psl-in-mode:
      - "level"
      - "mode"
    psl-in-pole:
      - "low-falling"
      - "high-rising"

2. Add macro functions to get PSL input detection and pin-muxing
   configurations from 'pinmux', 'psl-offset' abd 'psl-polarity'
   properties.

Here is an example to configure PSL_IN2 as the PSL detection input and
its mode and polarity.

/* A falling edge detection type for PSL_IN2 */
&psl_in2_gp00 {
	psl-in-mode = "edge";
	psl-in-pol = "low-falling";
};

A device will be introduced later which uses this pinctrl node to
configure PSL input detection settings and how to turn off VCC1 power
rail by PSL_OUT.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-07-07 14:12:52 +00:00
Joep Buruma
7e0fff24c7 drivers: pwm: add pwm driver for rpi_pico
Add pwm driver implementation for rpi pico family.
Adds myself as codeowner of drivers/pwm/*rpi_pico*

Signed-off-by: Joep Buruma <burumaj50@gmail.com>
2022-07-07 15:17:26 +02:00
Anas Nashif
782b083686 soc: add mising braces to single line if statements
Following zephyr's style guideline, all if statements, including single
line statements shall have braces.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 11:00:45 -04:00
Alexandre Duchesne
1561b1046f soc: arm: gigadevice: Initial support for gd32f470
add initial support for gd32f470 SoC

Signed-off-by: Alexandre Duchesne <alexandre.duchesne@rtone.fr>
2022-07-06 13:22:25 +02:00
Christian Taedcke
e71c2d1893 boards: efm32pg_stk3402a: Add minimal pwm support
With this additions samples/basic/blinky_pwm works.
LED0 is used as pwm output.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2022-07-04 15:51:11 +02:00
Alex Sergeev
f7f35af277 soc: gd32: Add HAS_SEGGER_RTT
Enable SEGGER RTT for GigaDevice family.

Signed-off-by: Alex Sergeev <asergeev@carbonrobotics.com>
2022-07-04 09:50:35 +02:00
Kumar Gala
287acdbb9d i2c: sam0: Set driver Kconfig default based on devicetree
Change Kconfig default to be based on if the devicetree has the
atmel,i2c-sam0 driver enabled.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-01 15:05:55 -05:00
Kumar Gala
d200321767 video: mcux_csi: Set driver Kconfig default based on devicetree
Change Kconfig default to be based on if the devicetree has the
nxp,imx-csi driver enabled.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-01 14:56:33 -05:00
Bartosz Bilas
33a4c78699 soc: select HAS_MCUX_XBARA for MIMXRT1062
Select HAS_MCUX_XBARA Kconfig symbol for MIMXRT1062,
since the XBARA Inter-Peripheral Crossbar Switch peripheral is present
on this SOC.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2022-07-01 16:23:11 +00:00
Jay Vasanth
e74978cc03 microchip: mec: zephyr spi image generation
Added mchp mec zephyr image generator python script. It takes
zephyr.bin as input and produces zephyr.mchp.bin.
The default behavior is to not pad to SPI flash size.
(Enable through CONFIG_MCHP_MEC_UNSIGNED_HEADER=y and
CONFIG_MCHP_MEC_HEADER_FLASH_SIZE_256K=y)

zephyr.mchp.bin is composed of:
1. First 4KB contains TAG at offset 0 and header at offset 0x100
2. Offset 0x1000 is the start of zephyr.bin which has been padded
to a multiple of 128 bytes.
3. Boot-ROM EC Info Block (128 bytes)
4. Boot-ROM Co-Signature Block (96 bytes)
5. Boot-ROM trailer (160 bytes) contains the SHA-384 digest of 2-4.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-07-01 11:35:13 +02:00
Bartosz Bilas
091a54202a soc: arm: nxp_imx: rt: add new MIMXRT1062CVJ5B part number
Add missing MIMXRT1062CVJ5B SOC.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2022-06-30 19:50:03 +00:00
Bartosz Bilas
dcf2d4d542 soc: arm: nxp_imx: rt: add new MIMXRT1062CVJ5A part number
Add missing MIMXRT1062CVJ5A SOC.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2022-06-30 19:50:03 +00:00
Alexandre Duchesne
7109e7dc20 soc: st_stm32f7: Add stm32f750xx SoC
add initial support for STM32F750xx SoC

Signed-off-by: Alexandre Duchesne <alexandre.duchesne@rtone.fr>
2022-06-30 13:41:06 +00:00
Daniel DeGrasse
69d153cd3d soc: nxp_imx: rt: enable SWO output for iMX RT 10xx series
enable swo output for iMX RT 10xx series. SWO pinmux settings are
currently only present for the RT1060 and RT1064

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-06-28 16:02:09 -05:00
Henrik Brix Andersen
9d51d9145b soc: arm: xilinx: zynq7000: default to 1 CPU core
Default to 1 CPU core on the Xilinx Zynq-7000 SoC series since Zephyr does
not yet suppport SMP on aarch32.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-06-28 20:46:11 +02:00
Henrik Brix Andersen
e8df5bdf5b soc: arm: xilinx: zynq7000: add pinctrl header file
Add Xilinx Zynq-70000 pinctrl header file to define SoC specific
pinctrl_soc_t structure. This is used to store pin configurations for the
pinctrl driver.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-06-28 20:46:11 +02:00
Henrik Brix Andersen
982d379808 soc: arm: xilinx: zynq7000: unlock the slcr at boot
Unlock the Xilinx Zynq-7000 System Level Control Registers (SLCR) at boot
to allow write access using the generic syscon driver.

Since the generic syscon driver uses the DEVICE_MMIO_* APIs for
memory-mapped IO we can remove the dedicated SLCR MMU region.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-06-28 20:46:11 +02:00
Jeremy Bettis
6ede43b078 npcx: Set hex_file automatically w/ npcx hex image
When using CONFIG_NPCX_IMAGE_OUTPUT_HEX, set the hex_file
runners_yaml_props_target property, so that west flash will flash the
correct file.

Change the cmake flash rules to populate the hex_file value in the
runners.yaml file if either CONFIG_BUILD_OUTPUT_HEX is enabled or some
cmake file set the runners_yaml_props_target hex_file property.

Update the npcx9m6f_evb instructions now that the filename is implicit.

Signed-off-by: Jeremy Bettis <jbettis@google.com>
2022-06-28 11:09:35 +02:00
Bartosz Bilas
63e9fb6190 soc: select HAS_MCUX_SRC for MIMXRT1062
Select missing HAS_MCUX_SRC Kconfig symbol for MIMXRT1062,
that allows using NXP i.MX mcux SRC hwinfo driver.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2022-06-24 12:30:11 -05:00
Aurelien Jarno
e54224ddab soc: stm32: h7: Generate MPU regions from DT nodes
Commit b91d21d32c added the possibility to define MPU regions from the
device tree, however commit c276088567 removed that possibility for H7
SoC, as it now uses a SoC specific definition of the MPU regions without
the DT-defined regions (probably because the two PRs got developped in
parallel).

Fix that by adding the macro which adds the DT-defined regions to the
STM32H7 specific file.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-06-20 10:27:52 +02:00
Chay Guo
a4c9e13ea8 boards: arm: Enable flash for storage on mimxrt595_evk
- The MX25UM51345G flash is connected to FLEXSPI PortA for
  mimxrt595_evk.
- Updated flexspi_mx25um51345g driver to support DTR OPI mode.
- Tested with tests/drivers/flash.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Chay Guo
c846537820 boards: arm: Add wdog support on mimxrt595_evk
Add watchdog support to the mimxrt595 platform.
The mimxrt595 platform is excluded from the watchdog
test case because the test case uses variables in the
noinit section that need to be retained through a reset
but the rt595 does not retain this memory through a
reset.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Chay Guo
fdca36e1cc boards: arm: mimxrt595: Add CTimer driver for mimxrt595_evk
Add counter support using CTimer for RT595.
Tested with samples/drivers/counter/alarm.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Chay Guo
77a0bc2135 boards: mimxrt595: Add SPI support
Enable access to the HS_SPI pins(JP26) on the mimxrt595_evk board.
Using DMA mode, tested with spi_loopback testcase.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Chay Guo
705ab550d1 boards: arm: Added DMA support on MIMXRT595-EVK
Added DMA driver support.
Tested with tests/drivers/dma/loop_transfer

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Chay Guo
0d64506130 boards: Add I2C and sensor driver support on MIMXRT595-EVK
Enable I2C access to FXOS7000 sensor on the mixrt595_evk board
Tested using samples/sensor/fxos8700 for mimxrt595_evk_cm33.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Bartosz Bilas
bc853b8960 soc: select HAS_MCUX_ADC_ETC for MIMXRT1062
Select HAS_MCUX_ADC_ETC Kconfig symbol for MIMXRT1062,
since the ADC External Trigger Control eripheral is present
on this SOC.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2022-06-10 09:48:50 +02:00
Chay Guo
191f93c325 boards: Add analog comparator support on MIMXRT1170 EVK
Updated mcux_acmp sample to support discrete mode config.
Add ACMP support on MIMXRT1170 EVK.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-09 11:30:49 +02:00
Dylan Hung
8b7ec919c8 soc: arm: aspeed: enable cache for AST10x0 series SOC
Enable cache for AST10x0 series SOC in platform initialization.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
2022-06-05 14:28:50 +02:00
Dylan Hung
1c3810ded2 soc: arm: select CACHE_ASPEED for Aspeed AST10x0 series SOC
Select CACHE_ASPEED to enable Aspeed cache driver for AST10x0 series
SOC.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
2022-06-05 14:28:50 +02:00
Dylan Hung
7d9f8adbeb soc: arm: select SYSCON for Aspeed AST10x0 series SOC
Aspeed AST10x0 series SOC has a SYSCON hardware block at address
0x7e6e2000.  Enable this option to enable relative driver.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
2022-06-05 14:28:50 +02:00
Jay Vasanth
de5296203a soc: pm: Microchip MEC172x SoC based power management
Add support for SoC power management for Microchip MEC172x.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-06-05 14:28:25 +02:00
Nickolas Lapp
b425627629 RT10xx Power Management: Enable RT1060 Soft Off Mode and Fixup PM API
This PR adds a soft off mode to the RT10xx Power Management API.
Additionally, it corrects the PM API function in rt10xx_power.c to
use the correct function prototype to be properly overridden.

Signed-off-by: Nickolas Lapp <nickolaslapp@gmail.com>
2022-06-05 14:16:43 +02:00
Erwan Gouriou
af4a044e6f soc: stm32wb: Move MB_MEM2 linker section to SRAM1
There was a confusion on MB_MEMx definitions. Both MB_MEM1/2
should be located in SRAM1. Fix this.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-27 17:46:49 -07:00
Fabio Baltieri
e24314f10f include: add more missing zephyr/ prefixes
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-27 15:20:27 -07:00
Gerson Fernando Budke
5b7734c926 drivers: adc: sam0: Fix adc_reference implementation
The current sam0 adc driver not implement correctly the adc_reference
enum values. This try homonize adc input referece by tracking VDDANA
at ADC_REF_VDD_1. The ADC_REF_VDD_1_2 were fixed with correct INTVCCx
channel selection.

Fixes #45443

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-05-25 13:36:10 -07:00
Francois Ramu
39c8ba32ff soc: arm: stm32f7 soc without Dcache
The stm32f7 (like stm32H7) should be able to disable
the Dcache when using the DMA. This is to avoid any
pb of cache coherency on the DMA buffers.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-25 11:38:05 -07:00
Stephanos Ioannidis
b2c8f26e34 soc: npcx: scripts: Initialise Colorama during module load
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Lukasz Majewski
0f9c8c2935 arm: stm32h7: Enable DCache when CONFIG_DCACHE is defined
Up till now the usage of CONFIG_NOCACHE_MEMORY also explicitly disables
data cache on the STM32H7 SoC.

With this change the usage of CONFIG_NOCACHE_MEMORY has been decoupled
from data cache enabling as new Kconfig option - namely
CONFIG_DCACHE is now used to explicitly enable it.

After this change it would be possible to use data cache on STM32H7
with DMA buffers, fragile to cache coherency issues, defined with
'__nocache' attribute.

Such approach would improve the overall STM32H7 performance until the
moment when proper (i.e. in-DMA) buffer cache management is developed.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-05-24 08:47:20 -07:00
Mulin Chao
0f18c4c4ab pinctrl: npcx: config pwm open-drain without enabling STORE_REG
Config pwm open-drain mode without enabling STORE_REG. This CL
collects all active PWM's base address and related index in an
array. Then, pinctrl driver configs its open-drain mode by
finding the corresponding 'channel' index.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-20 12:36:22 +02:00
Jose Alberto Meza
4e443dac34 soc: arm: microchip: mec172x: Enclose macro in brackets
Macro should be in brackets.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-05-20 12:35:37 +02:00
Krzysztof Chruscinski
99fb57652a soc: arm: nordic: Change tick rate for non-tickless kernel
Set SYS_CLOCK_TICKS_PER_SEC to 128 for non-tickless kernel.
Previously it was set to 32768 disregarding kernel mode and that
lead to too frequent interrupts in non-tickless mode (tick every
30 us). Change to smaller value.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-05-19 11:03:50 +02:00
Henrik Brix Andersen
a195f98265 soc: arm: gigadevice: undefine CAN_MODE_NORMAL
The GigaDevice HAL defines CAN_MODE_NORMAL, which conflicts with the
zephyr/drivers/can.h header definition. Undefine it in soc.h.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-16 12:56:50 +02:00
Nazar Palamar
5a99e93d69 soc: arm: cypress: Update PSoC 6 implementation to use mtb-pdl-cat1
Updated PSoC 6 implementation to use hal_infineon/mtb-pdl-cat1

This PR is reflected changes according to Task#1 for RFC#42883.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2022-05-13 21:34:59 +02:00
Thomas Altenbach
cc51031445 drivers/entropy: stm32: fix inter-core race condition
On STM32WB and dual-core STM32H7 MCUs, the RNG peripheral is shared
between the cores and its access is protected by a hardware semaphore.
Locking was not performed in the current entropy driver, leading to a
race condition when multiple cores concurrently used the RNG. This
commit implements the necessary logic for locking the HSEM during entropy
generation on multi-core STM32 MCUs. It also reconfigures the RNG in case
the configuration was changed by the other core, as this can happen e.g
on STM32WB MCUs.

Signed-off-by: Thomas Altenbach <taltenbach@witekio.com>
2022-05-13 10:28:53 -05:00
Daniel DeGrasse
dea2e642b2 soc: mimx8ml8_m7: add pin control support for mimx8ml8_m7
Add pin control support for IOMUXC peripheral present
on mimx8ml8_m7 soc. This reuses the existing pin
control driver for the IOMUXC peripheral, but uses a
new header and compatible binding to handle the
different register layout on this SOC.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse
e1ef51ce39 soc: mimx8mm6_m4: add pin control support.
Add pin control support for mimx8mm6_m4 IOMUXC peripheral.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse
e3b4c0b314 soc: mimx8mq6_m4: add pin control support
Add pin control support for IOMUXC peripheral present
on mimx8mq6_m4 soc. This reuses the existing pin
control driver for the IOMUXC peripheral, but uses a
new header and compatible binding to handle the
different register layout on this SOC.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse
5d374d7b29 soc: mcimx7_m4: add pin control support
Add pin control support for mcimx7_m4 SOC. This reuses the existing pin
control driver for the IOMUXC peripheral, but uses a new header and
compatible binding to handle the different register layout on this SOC.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse
e5fd7d8e67 soc: mcimx6x_m4 add pin control support
Add pin control support for mcimx6x. The IOMUXC peripheral present on
this SOC is identical to the one used on the iMX RT10xx series, so the
dts bindings are reused.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse
bc841e1fb7 drivers: pinctrl: refactor pin control support for imx rt
Refactor iMX RT pin control support to use more generic names, as the
IOMUXC peripheral is present on non RT iMX application cores.
Additionally, make selection of the pin control driver occur at the SOC
level.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Mulin Chao
d53d574bf0 drivers: pinctrl: npcx: add initial pin-controller driver
This CL is the initial version for npcx pinctrl driver and introduces
pinctrl nodes for both IO-pads and peripheral devices for each npcx
series. Users can set pin configuration via these nodes in the board
layout DT file. It also wraps all configurations related to pin-muxing
in pinctrl_soc.h. Regarding the other pin properties, we will implement
them later.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-12 14:24:03 -05:00
Mahesh Mahadevan
14ed412359 soc: rt: Add MIPI support for MXRT1170
Add MIPI support for NXP's MXRT1170

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-05-12 09:26:50 -05:00
Gerard Marull-Paretas
9678bd6970 pinctrl: nrf: prefix custom drive-mode property
The drive-mode property is nRF specific, so prefix it with `nordic,`,
same as the `nordic,invert` property.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-12 09:22:12 +02:00
Jun Lin
51978d9d61 driver: eSPI: npcx: workaround the errata rev1_2, No.3.10
Enabling an eSPI channel (r.g. Peripheral Channel, Virtual Wire Channel,
etc.) during an eSPI transaction might (with low probability) cause the
eSPI_SIF module to transition to a wrong state and therefore response
with FATAL_ERROR on an incoming transaction.
This CL workarounds this issue by clearing the bit 4 of NPCX eSPI
specific register#2.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2022-05-12 09:21:24 +02:00
Henrik Brix Andersen
3f97d11afd drivers: can: convert enum can_mode to a bit field
Convert the can_mode enum to a bit field to prepare for future extensions
(CAN-FD mode, transmitter delay compensation, one-shot mode, 3-samples
mode, ...).

Rename the existing modes:
- CAN_NORMAL_MODE   -> CAN_MODE_NORMAL
- CAN_SILENT_MODE   -> CAN_MODE_LISTENONLY
- CAN_LOOPBACK_MODE -> CAN_MODE_LOOPBACK

These mode names align with the Linux naming for CAN control modes.

The old CAN_SILENT_LOOPBACK_MODE can be set with the bitmask
(CAN_MODE_LISTENONLY | CAN_MODE_LOOPBACK).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-11 10:47:54 +02:00
Georgij Cernysiov
827343a3da soc: stm32: h7: add support for stm32h730xx
Adds support for STM32H730XX SoC.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-11 10:47:43 +02:00
Daniel DeGrasse
fed6d6b754 soc: lpc11u6x: enable pin control
Enable pin control for lpc11u6x soc by selecting CONFIG_PINCTRL=y.
At this time no drivers are ported.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-10 17:27:44 -05:00
Daniel DeGrasse
dc4d168952 soc: lpc11u6x: add pin control header
add pin control header to enable pin control support for lpc11u6x

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-10 17:27:44 -05:00
Daniel DeGrasse
ea9df42b25 soc: lpc11u6x: add pin control definitions to LPC11u6x soc file
add pin control definitions to LPC11u6x soc file, to handle the lack of
a HAL for this SOC.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-10 17:27:44 -05:00
Esteban Valverde
11ba0802b5 soc: arm: Add Cyclone V SoC FPGA Support
soc: arm: privilege: add Cyclone V SoC FPGA suppport
Add support for the Intel Cyclone V SoC FPGA (arm Cortex-A9).

Signed-off-by: Esteban Valverde <esteban.valverde.vega@intel.com>
2022-05-10 13:29:47 -04:00
Andrzej Głąbek
e7b389ddf5 dts: nordic: Add missing qdec0 node labels
This is a follow-up to commit 586e26e8fc.

Add missing `qdec0` node labels in definitions of SoCs that have only
one QDEC instance so that the `HAS_HW_NRF_QDEC0` option is properly set
for them. Use the same pattern as in the WDT case and keep the existing
`qdec` labels for backward compatibility.
Also update validation of base addresses so that both QDEC0/QDEC and
QDEC1 are checked.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-05-10 18:41:14 +02:00
Bernardo Perez Priego
2fc78a9b39 drivers: adc: Add threshold_reg_offset to NPCX adc config structure
ADC threshold control register offset is provided by devicetree, this
change will add this property into `adc_npcx_config` structure and
update macro to access register accordingly. Driver behavior is not
meant to be impacted.

Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
2022-05-10 18:40:24 +02:00
Piotr Dymacz
15b22e066f soc: arm: cc13x2_cc26x2: Kconfig: select CPU_HAS_ARM_MPU
This adds missing 'CPU_HAS_ARM_MPU' for Texas Instruments SimpleLink
CC13x2 and CC26x2 SoC series.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-05-10 18:33:50 +02:00
Flavio Ceolin
99be4358af soc: nxmp: rt10xx: Fix pm callbacks
The pm hooks for this target were not updated to follow the current API.
These weak functions will never be called for the pm subsystem.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-05-10 09:44:17 -05:00
Gerard Marull-Paretas
4b91c2d79f asm: update files with <zephyr/...> include prefix
Assembler files were not migrated with the new <zephyr/...> prefix.
Note that the conversion has been scripted, refer to #45388 for more
details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:45:29 -04:00
Gerard Marull-Paretas
d342e4c4c1 linker: update files with <zephyr/...> include prefix
Linker files were not migrated with the new <zephyr/...> prefix.  Note
that the conversion has been scripted, refer to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:45:29 -04:00
Henrik Brix Andersen
03bece0b70 soc: arm: atmel: samv71: enable the UPLL clock
Enable the UTMI PLL (UPLL) clock and add a static definition of its clock
frequency.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Co-authored-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-05-09 09:27:40 +02:00
Henrik Brix Andersen
f0fc59f0a2 soc: arm: atmel: same70: enable the UPLL clock
Enable the UTMI PLL (UPLL) clock and add a static definition of its clock
frequency.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Co-authored-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-05-09 09:27:40 +02:00
Gerard Marull-Paretas
0e69129fb3 soc: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all soc code to the
new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:57:59 +02:00
Daniel DeGrasse
58a2b15972 drivers: hwinfo: implemented hardware info support for RT11xx SOC
RT11xx SOC uses same system reset controller as RT10xx series. Add
support for SRC on RT11xx

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-06 11:33:26 +02:00
Bradley Bolen
dfc4c3f8a6 soc: arm: xilinx_zynqmp: Enable the VFP
This SoC supports vfpv3-d16 with single and double precision and 16
64-bit registers.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2022-05-05 12:03:27 +09:00
Stephanos Ioannidis
2bd4af44f6 Revert "soc: arm: mps3: Only enable MVE if not QEMU"
This reverts commit 91d4b7766c.

Zephyr SDK 0.14.1 now includes QEMU 6.2, which supports the emulation
of the MVE instructions.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Jan Peters
253cec5c95 drivers: counter: add driver for NXP QTMR counters
The driver is implemented using the MCUXpresso SDK.

Signed-off-by: Jan Peters <peters@kt-elektronik.de>
2022-05-03 20:41:23 -05:00
Jay Vasanth
60a41f6878 drivers: ps2: Microchip XEC PS2 add MEC172x support
Update the Microchip XEC PS2 driver to support MEC172x.
NOTE: MEC15xx has two PS2 controllers and
MEC172x has one.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-05-03 14:13:20 -05:00
Matthias Fend
124d751c28 soc: arm: nxp_imx: select IPM_IMX_REV2 driver for mimx8mm6_m4
This will automatically enable the IMX IPM (Rev. 2) driver if IPM is
enabled on this platform.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
2022-05-02 20:28:57 -05:00
Matthias Fend
30f827341c soc: mimx8mm6_m4: add .resource_table section to linker script
This is required to include the resource table in the build output.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
2022-05-02 20:28:57 -05:00
Daniel DeGrasse
d5b719e084 drivers: pinctrl: add pin control driver for NXP RT600/RT500 SOCs
add pincontrol headers for IOCON peripheral present on NXP iMX RT600
and RT500 SOCs, and update LPC pin control driver for iMX RT family
differences.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-02 13:28:10 -05:00
Daniel DeGrasse
19cc2f6ec2 drivers: pinctrl: update pin control driver for lpc54xxx
update pin control driver with bindings and header for lpc54xxx

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-02 09:41:42 -05:00
Daniel DeGrasse
2fbfed9804 soc: imx_rt: added support for nxp imx_usdhc SDHC driver to RT600/500
added support for NXP iMX RT600/RT500 to use to SDHC driver, with SD
subsystem. Tested with RT685 EVK

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-29 14:21:36 -05:00
Daniel DeGrasse
a18338bf45 soc: rt11xx: Enable USDHC SD host controller on RT1170
Enable SD host controller driver for RT1170, so the EVK can use the new
SD subsystem.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-29 14:21:36 -05:00
Daniel DeGrasse
aef290bb4d boards: Enable USDHC driver for all RT10xx based boards
Enable new USDHC driver for all RT10xx boards, since those will have
the SDHC driver selected by Kconfig

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-29 14:21:36 -05:00
Daniel DeGrasse
32cd207f95 boards: mimxrt1064: Enabled new SDHC driver
Enabled new SDHC driver for mimxrt1064 evk

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-29 14:21:36 -05:00
Erwan Gouriou
42627d3e25 soc/arm: stm32: All stm32h7 based socs have a cache
In c5b59282d6, Kconfig option
CPU_CORTEX_M_HAS_CACHE was added only to a subset of stm32h7 soc
descriptions.
There is no reason not to extend to all socs as they all actually
feature a cache.

Fixes #45073

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-04-26 12:06:48 -04:00
Peter Johanson
4ce42a134f soc: rpi_pico: Fix enabling i2c on rpi_pico
Select HAS_I2C_DW for RP2040 SoC, and include the
i2c dt-bindings header.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2022-04-26 09:00:25 +02:00
Mahesh Mahadevan
785da27257 soc: nxp: Do not select CODE_DATA_RELOCATION_SRAM
We no longer need to relocate the SDK power management
source file to SRAM. Instead specific functions from the
SDK file are relocated to the ramfunc section.

This commit fixes Issue#44670

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-04-22 13:33:29 -05:00
Daniel DeGrasse
d800c6684c soc: k8x: select HAS_MCUX_CACHE
k8x SOCs have cache controller, so HAS_MCUX_CACHE should be selected.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-22 09:44:19 +02:00
Christopher Friedt
5a23cfd7bd soc: arm: cc13xx_cc26xx: pinctrl: minor fix for typedef typo
Drop `_t` from struct name in typedef.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2022-04-21 14:32:00 +02:00
Immo Birnbaum
a9e935e01b soc: xilinx_zynq7000: fix VBAR, SCTLR contents when coming from u-boot
If a Zephyr binary is booted on the Zynq-7000 not via JTAG download,
but via u-boot's ELF boot function instead, Zephyr will have to revert
certain changes made by u-boot in order to boot properly:

- clear the ICache/DCache enable, branch prediction enable and
  strict alignment enforcement enable bits in the SCTLR register.
  By default, u-boot will also set up the MMU prior to Zephyr
  doing so as well, this can be avoided by changing the u-boot
  build configuration. Therefore, the MMU enable bit is not changed
  at this point.

- set the VBAR register to 0. U-boot moves the interrupt vector
  table to a non-standard location using the VBAR register (no
  change is made by u-boot for SCTLR.V, only VBAR is changed
  to a non-zero memory location).

Without these changes, Zephyr will crash upon the first context
switch at latest, when SVC is invoked and u-boot's vector table
is used rather than the vectors copied to address zero by Zephyr.

In order to perform these changes before coming anwhere near the
MMU / device driver / kernel initialization stages or even the
first context switch, the z_arm_platform_init hook is used, which
is now enabled for the Zynq via the Kconfig.defconfig file.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
2022-04-21 13:14:50 +02:00
Daniel DeGrasse
c6b05afc92 soc: lpc: make pin control definition LPC55xx specific
pin control definitions present for LPC55xx are not generic to all LPC
IOCON controllers. Make pin control header file LPC55xx specific.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-19 15:53:50 -05:00
Vaishnav Achath
98f1a98cf5 drivers: pinmux: remove cc13xx_cc26xx pinmux driver
all the consumers of the obsolete pinmux driver is
updated to use pinctrl API, this commit removes
the pinmux driver and assosciated sections.

Signed-off-by: Vaishnav Achath <vaishnav@beagleboard.org>
2022-04-18 18:19:46 -04:00
Vaishnav Achath
e2ed8cf130 drivers: pinctrl: add CC13XX/CC26XX pinctrl driver
Add pinctrl driver for CC13XX/CC26XX family of SoCs
to facilitate transition from pinmux to pinctrl.

`IOCPortConfigureSet()` from TI hal driverlib used to
implement the generic pinctrl driver.

Signed-off-by: Vaishnav Achath <vaishnav@beagleboard.org>
2022-04-18 18:19:46 -04:00
Ryan McClelland
c5b59282d6 arch: arm: aarch32: add Kconfig for arm cortex-m that implements a cache
The Cache is an optional configuration of both the ARM Cortex-M7 and
Cortex-M55. Previously, it was just checking that it was just an M7
rather than knowing that the CPU actually was built with the cache.

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2022-04-14 16:12:03 -05:00
Immo Birnbaum
ab5b451557 soc: arm: xilinx_zynq7000: remove unnecessary "EOF" comments
remove unnecessary EOF comment lines at the end of each file.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
2022-04-14 14:43:52 -05:00
Daniel DeGrasse
65a3f3e468 soc: rt11xx: enable AHB clock during CM7 sleep
Zephyr kernel will always execute WFI in k_cpu_idle(), so access to TCM
will be gated. Keep the AHB clock enabled in sleep unless CONFIG_PM is
selected, to avoid this error.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-14 13:40:52 -05:00
Daniel DeGrasse
b15ac058fa soc: arm: add mpu REGION_FLASH_SIZE definitions for larger flash regions
Add MPU REGION_FLASH_SIZE definitions for 128M-512M flash sizes, to handle
arm SOCs with large flash regions.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-13 13:32:23 -07:00
Jay Vasanth
2e9c18cd0d emi: fix MEC172x emi registers fields size
Rectify reserved fields size in MEC172x emi_regs structure

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-04-13 08:52:57 -05:00
Frank Li
4651a38e5d soc: mxrt10xx: remove forces enable boot header
When we use a third-party or custom bootloader, there is also
need to remove the boot header. Change the select to imply,
so that the boot header can be removed by configuration when
MCUBoot is not used.

Signed-off-by: Frank Li <lgl88911@163.com>
2022-04-12 09:54:01 +02:00
Alexander Vasiliev
a19311f3c7 soc: stm32: Fix DBGMCU register write for SWO configuration
DBGMCU register, which is used for SWO pin configuration,
may not have TRACE_MODE bits in some STM32 MCUs.
Replace register access with LL functions selected based on SoC family.

Fixes #44584

Signed-off-by: Alexander Vasiliev <alex.m.vasil@gmail.com>
2022-04-08 15:53:56 -07:00
Francois Ramu
40f76516d9 soc: arm: stm32 adjust wdt timer due to LSI oscillator characteristics
Due to a wide range of variuation in the LSI RC oscillator
characteristics given by the datasheet of the soc,
It is necessary to add a delay for hardware watchdog.
This is done by the CONFIG_TASK_WDT_HW_FALLBACK_DELAY

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-04-08 10:41:55 -05:00
Joakim Andersson
e74e8b2048 soc: nordic_nrf: Add soc_secure_mem_read implementation in secure
Add soc_secure_mem_read implementation for secure.
This simplifies users code so that ifdefs are not required.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-04-07 11:02:52 -04:00
Joakim Andersson
2dae1823ab hwinfo: Add dependency handling for HWINFO_NRF in nonsecure
The limitation on HWINFO_NRF depending on not nonsecure was removed in
52be3030aa.
This caused problems when TF-M was not enabled.

This happens on the thingy53_nrf5340_cpuapp_ns board since this board
is not supported by TF-M.

Introduce proper dependency handling for the soc secure functions
to make HWINFO_NRF unavailable when no secure services exist in
nonsecure.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-04-07 11:02:52 -04:00
Daniel DeGrasse
9226cf338e soc: add lpc pinctrl definition header
Add pinctrl definition header, to parse pinctrl groups in board level
DTS into pinctrl_soc_pin_t values.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-06 20:57:22 -07:00
Gerard Marull-Paretas
c925b5991a include: remove unnecessary autoconf.h includes
The autoconf.h header is not required because the definitions present in
the file are exposed using the compiler `-imacros` flag.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-05 11:18:20 +02:00
Jay Vasanth
9777c5e90e drivers: peci: Microchip XEC PECI driver add MEC172x support
Update Microchip XEC PECI driver to support MEC172x.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-04-05 11:16:41 +02:00
Carlo Caione
b91d21d32c dt: mpu: Generate MPU regions from DT nodes
Currently the only way for a BOARD/SOC to configure at compile time the
MPU regions is to add, in a soc-specific file, the 'mpu_config' struct
adding static entries for the new regions with the needed attributes
(cacheable, non-cacheable, etc...). This exported struct is then read by
the MPU driver at boot time and used to properly setup the MPU regions.

At the same time it is now possible to introduce new memory regions in
the DT using the newly introduced 'zephyr,memory-region' attribute.

What is missing is the link between these two solutions: that is how to
declare the memory regions in the DT and automatically configure these
regions in the MPU with the correct attributes.

This patch is trying to address exactly this problem.

It is now possible to declare the memory regions in the DT and define
the MPU attributes for the regions using the 'zephyr,memory-region-mpu'
property. When this new property is present together with the
'zephyr,memory-region' property and a the 'zephyr,memory-region'
compatible, the 'mpu_config' struct is automatically extended at
compile-time to host the DT defined regions with the correct MPU
attributes.

So for example in the DT we can now have:

       sram_cache: memory@20200000 {
                compatible = "zephyr,memory-region", "mmio-sram";
                reg = <0x20200000 0x100000>;
                zephyr,memory-region = "SRAM_CACHE";
                zephyr,memory-region-mpu = "RAM";
        };

and a new region will be created called "SRAM_CACHE" and a new MPU
region will be configure at boot time with the attribute
"REGION_RAM_ATTR".

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-05 11:16:31 +02:00
Joakim Andersson
02bd034255 soc: nordic_nrf: Add soc_secure_read_deviceid
Add soc_secure_read_deviceid function for reading the device ID from
FICR when executing in non-secure processing environment.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-04-04 11:15:28 +02:00
Joakim Andersson
6a14a0233b soc: nordic_nrf: Refactor soc_secure handling
Refactor soc_secure handling to not use TF-M directly in the header.
Move from nRF53 to common since nRF91 also supports TF-M.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-04-04 11:15:28 +02:00
Andrzej Głąbek
586e26e8fc soc: nrf: Use data from DTS to populate HAS_HW_NRF_* Kconfig options
Instead of selecting appropriate HAS_HW_NRF_* options for particular
nRF SoCs (and simulated nRF52 target), set their values basing on
information from devicetree.
Correct also semantics of those options so that they are set only when
a corresponding DT node is enabled. This allows using them directly in
Kconfig dependencies of Zephyr drivers for nRF peripherals. Update
appropriately these dependencies.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-04-02 15:14:38 +02:00
Andrzej Głąbek
56a1ac3817 dts: Add missing nodes and bindings for peripherals present in nRF SoCs
Add missing devicetree nodes representing the following peripherals
in nRF SoCs:
- ACL
- BPROT
- CCM
- COMP/LPCOMP
- CTRLAP
- DCNF
- MPU (nRF MPU peripheral in nRF51 Series, not ARM MPU)
- MUTEX
- MWU
- NFCT
- OSCILLATORS
- POWER (in nRF51 and nRF52 Series)
- PPI
- RESET
- SWI
- USBREG
Add also corresponding bindings and validation of base addresses of
these nodes.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-04-02 15:14:38 +02:00
David Leach
314e8484e2 hal: nxp: Centralize handling of SDK custom sections
The NXP SDK defines CodeQuickAccess and DataQuickAccess sections
for locating critical items that need faster access. Centralize
the handling of these sections instead of doing it per SOC.

Fixes #44453

Signed-off-by: David Leach <david.leach@nxp.com>
2022-04-02 13:30:44 +02:00
Jose Alberto Meza
5a3f528387 soc: arm: microchip: mec172x: Fix eSPI flash operations
Correct eSPI flash macro so it not always results in zero,
leading to eSPI flash read operation in all cases:
Read, write, erase.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-03-31 18:11:48 -04:00
Jose Alberto Meza
4430aa22ca soc: arm: microchip: mec172x: Fix PWM dependency
Enable PWM_XEC whenever CONFIG_PWM is selected

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-03-31 15:51:56 -04:00
Johan Öhman
5d51fbc8cb mpu: Support for 8 & 16 MB SRAM regions in Cortex M MPU
Added support for 8 MB MPU regions for SRAM sizes between 4 and 8 MB,
and 16 MB MPU regions for SRAM sizes between 8 and 16 MB.

Signed-off-by: Johan Öhman <johan.ohman@softube.com>
2022-03-31 12:04:00 -05:00
Kamil Piszczek
cb0d8c262f soc: arm: nordic_nrf: enable shared memory reset for nRF53 App Core
Enabled the Shared Memory Reset feature for nRF5340 Application Core
when the RPMsg backend for IPC Service is enabled.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-03-28 12:46:32 +02:00
Erwan Gouriou
48039bc555 drivers/pinctrl: stm32: Allow plain GPIO configuration
Based on introduction of plain GPIO configurations in STM32 pinctrl
bindings, update STM32 pinctrl/gpio drivers to make this functionality
available.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-25 15:52:02 -07:00
Erwan Gouriou
7b9a00a074 soc/arm/st_stm32: pinctrl: Prepare pinmux removal
Some pinctrl related definitions are still defined
in pinmux related files.
Duplicate definitions to prepare pinmux removal.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-25 15:52:02 -07:00
Daniel DeGrasse
8c115a26e0 soc: nxp_imx: rt: remove unnecessary pinmux callbacks
All iMX RT 1xxx boards are now expected to use pin control, so the USDHC
pinmuxing callbacks can be removed.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-25 15:47:54 -05:00
Daniel DeGrasse
8fd1b54a82 soc: nxp_imx: rt: enable ethernet ref clock output
Enable soc ethernet ref clock output at the SOC level instead of board
level, since it is required for all iMX.RT SOCs

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-25 15:47:54 -05:00
Daniel DeGrasse
1cee7be552 drivers: pinctrl: Enable pinctrl for RT11xx series
RT11xx series has similar pin configuration peripheral to RT10xx, with
some differences in register layout. Create new pinctrl definition
header file, and reuse existing driver code for RT10xx.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-25 15:47:54 -05:00
Daniel DeGrasse
3a6919e3aa drivers: pinctrl: update rt pinctrl to support GPR register
iMX.RT parts use a GPR register for some pinmux settings. Update pinctrl
driver to support this GPR register definition.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-25 15:47:54 -05:00
Daniel DeGrasse
da40ffb4a8 soc: enable noncacheable OCRAM region for nxp iMX.RT
OCRAM can be used for DMA, and in this case it should be marked as
noncacheable. Add KConfig symbol and appropriate linker scripts to
enable OCRAM region to be defined as noncacheable, and initialized with
data from flash at boot.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-25 10:40:59 +01:00
Gerson Fernando Budke
0521aa0fbc drivers: pinmux: Drop sam0 pinmux in favor of pinctrl
Drop sam0 pinmux driver and all related entries in favor to use new
pinctrl API.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-03-24 15:45:37 -07:00
Gerson Fernando Budke
c1ad9c39e4 drivers: pinctrl: Drop obsolete atmel sam/sam0 entries
Drop all old and obsolete atmel sam/sam0 pinctrl entries.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-03-24 15:45:37 -07:00
Gerson Fernando Budke
10aa57857d drivers: pinctrl: Update Atmel sam0 driver to new API
This update current Atmel sam0 pinctrl initiative to current Zephyr
pinctrl API. It update current devicetree bindings and add the sam0
pinctrl driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-03-24 15:45:37 -07:00
Gerson Fernando Budke
cb201430cf drivers: pinctrl: Update atmel sam driver to new api
This update current Atmel sam pinctrl initiative to current Zephyr
pinctrl API. It update current devicetree bindings and add the sam
pinctrl driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-03-24 15:45:37 -07:00
Mulin Chao
8a4013b2e1 drivers: adc: Set correct interrupt type and remove spurious interrupts
In npcx adc driver, we select 'Scan' (Multiple Channels Operation Mode)
mode by default. It means that selected channels in ADCCS will be
converted automatically. Then, read the measured data from CHNDAT
registers if EOCCEV (Event is set after all selected channels are
converted.) flag in ADCSTS is set.

But we enable the wrong interrupt type, INTECEN, during adc
initialization. Ec will send the interrupt after each channel in ADCCS
is converted. It has no harm to the current driver since the driver
reads all selected channels and turns off ADC converter only after
EOCCEV is set in ISR. But it does generate spurious interrupts.

This CL enables the correct interrupt type, INTECCEN, during adc
initialization. Ec only sends the interrupt after all of channels in
ADCCS are converted.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-03-24 10:43:54 +01:00
Matthias Fend
a3f7a01ac8 soc: mimx8ml8_m7: add .resource_table section to linker script
This is required to include the resource table in the build output. The
Linux remoteproc framework explicitly looks for this section while loading
the elf and may complain if the resource table is missing.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
2022-03-24 10:41:39 +01:00
Dylan Hung
a24ab24322 soc: arm: Add Aspeed ast10x0 series support
Aspeed ast10x0 series SoCs contain a ARM Cortex-M4F processor.  This
processor operates at 200MHz and executes on SRAM.

This patch adds support for ast1030 as the first SoC of this series
which is targeted but not limited at the bridge IC in a server system.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Change-Id: I668af1ff8a36a05da791c3329ae08f5ae712bdd4
2022-03-23 12:50:28 +01:00
Daniel DeGrasse
8979f87c6e soc: disable pinmux driver for nxp kinetis SOCs
disable pinmux driver for nxp kinetis SOCs, since all boards use pinctrl

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-22 12:36:04 +01:00
Daniel DeGrasse
bde2bbed6f soc: kinetis: do not redefine PORT_PCR_ODE for KW24/22 series
KW24 and KW22 series support open drain pins, while rest of kinetis KW
SOCs do not. Don't redefine PORT_PCR_ODE for these SOCs

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-22 12:36:04 +01:00
Nazar Kazakov
f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Andrzej Głąbek
a5234f3647 soc_nrf_common: Extend and rename the NRF_DT_ENSURE_PINS_ASSIGNED macro
Extend the macro with checks for DT properties related to pin
assignments that are defined but would be ignored, depending on
whether PINCTRL is enabled or not, what presumably indicates
a resulting configuration different from what the user expects.

Add also a possibility to indicate that the pinctrl-1 property
should not be checked because the caller does not support the
sleep state.

Rename the macro so that its name better reflects its function.
Update accordingly all drivers that use it.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-03-18 16:26:21 +01:00
Joakim Andersson
6ac77d6a4e soc: nordic_nrf: Add query items for HW peripheral CTRLAP
Add Kconfig items that can be used to query if the current SoC
support the HW peripheral CTRLAP.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-03-18 10:37:31 +01:00
Jay Vasanth
9a67af9008 soc: arm: microchip_mec: Remove unused soc_espi_v2.h
Remove unused MEC172x header file soc_espi_v2.h

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-18 10:22:52 +01:00
Guy Morand
965d41a195 soc: arm: nxp_imx: Select MCUX_IGPIO driver for mimx8mm6
This automatically enables the gpio_mcux_igpio driver when gpio is
enabled on this platform.

Signed-off-by: Guy Morand <guy.morand@bytesatwork.ch>
2022-03-17 16:32:58 -05:00
Gerard Marull-Paretas
5a71eeb35c pm: policy: move constraints to policy API
The pm_constraint_* APIs were effectively used by the policy manager
only. This patch renames the API to the policy namespace and makes its
naming more explicit:

- pm_constraint_set -> pm_policy_state_lock_get()
- pm_constraint_release -> pm_policy_state_lock_put()
- pm_constraint_get -> pm_policy_state_lock_is_active()

The reason for these changes is that constraints can be of many types:
allow/disallow states, impose latency requirements, etc. The new naming
also makes explicit that the API calls will influence the PM policy
behavior.

All drivers and documentation have been updated accordingly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Andrzej Głąbek
fd7633126e drivers: pinctrl: nrf: Add support for PWM, QDEC, and QSPI peripherals
Add support for configuring pins to be used by the nRF PWM, QDEC, and
QSPI peripherals.
A new custom property "nordic,invert" is added to the pin configuration
group binding to allow configuring PWM channel outputs as inverted.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-03-15 18:38:01 +01:00
Immo Birnbaum
b9f9d4a835 soc: arm: xilinx_zynq7000: add MMU region for PS GPIO controller
Add a 4k indentity mapping in the MMU for the Processor System GPIO
controller if the parent device node is enabled in the device tree.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
2022-03-15 08:44:46 -07:00
Hake Huang
6be3085e73 soc: add pinctrl header file definition for RT series
Pinctrl requires header file with Z_PINCTRL_STATE_PINS_INIT macro
defined. Add header file for mcux RT pinctrl implementation.
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-15 10:12:57 -05:00
Daniel DeGrasse
8b7f23da28 soc: rt10xx: Enable USB2 controller clock
Enable USB2 controller clock on RT10xx SOC init, if nodelabel has
status="okay"

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-11 14:50:11 -08:00
Daniel DeGrasse
8156299bda soc: rt11xx: enable usb pll clock
USB pll clock should be enabled if USB driver is used. Add required
configuration for USB pll clock.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-11 14:50:11 -08:00
Julien Massot
ccddf12b9c soc: arm: add fvp_aemv8r_aarch32
This is mostly the same than the aarch64 one, excepted that we
force the armv8r fvp to run in aarch32 profile. So that we can simulate
the Cortex-R52.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
2022-03-11 10:59:48 +01:00
Yegor Yefremov
b4dfdb5afb soc: arm: nxp_lpc: fix typos
Typos were found with codespell utility.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2022-03-10 17:19:49 -05:00
Erwan Gouriou
ed6cc6dce3 soc/arm/st_stm32: stm32wb: Remove stack reset from shutdown
BLE stack reset should now be done in hci close function.
Remove from shutdown procedure.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-10 13:28:41 -05:00
Navin Sankar Velliangiri
90a11851ec soc: arm: nxp: add LPC55S06 support
Add initial support for the NXP LPC55S06.

Signed-off-by: Navin Sankar Velliangiri <navin@linumiz.com>
2022-03-09 09:46:17 -06:00
Gerard Marull-Paretas
dffaf5375c kconfig: tweak Kconfig prompts
Tweak some Kconfig prompts after the removal of "Enable...".

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 15:35:54 +01:00
Gerard Marull-Paretas
95fb0ded6b kconfig: remove Enable from boolean prompts
According to Kconfig guidelines, boolean prompts must not start with
"Enable...". The following command has been used to automate the changes
in this patch:

sed -i "s/bool \"[Ee]nables\? \(\w\)/bool \"\U\1/g" **/Kconfig*

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 15:35:54 +01:00
Andrzej Głąbek
70fb3124db drivers: serial: nrfx: Ensure that instances have some pins assigned
Add build assertions that will ensure that every peripheral for
which a driver instance is created has some pins assigned to it.
Neither pinctrl-0 nor *-pin properties can be currently marked as
required in devicetree, so these assertions will help users avoid
invalid configurations where it could be hard to figure out why
the UART is not working.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-03-09 12:05:22 +01:00
Jedrzej Ciupis
47ddbc2ed6 soc: arm: nordic: fix GPIO pin forwarder initialization
nRF5340 application core should not attempt to pass control over any
pins to the nRF5340 network core if the latter is disabled.

This commit fixes https://github.com/zephyrproject-rtos/zephyr/issues/43476.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2022-03-08 09:32:33 -08:00
Krzysztof Chruscinski
47ae656cc1 all: Deprecate UTIL_LISTIFY and replace with LISTIFY
UTIL_LISTIFY is deprecated. Replacing it with LISTIFY.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-08 11:03:30 +01:00
Daniel DeGrasse
cbb52e8c50 soc: mimxrt1064: Enable low power clocking for mimxrt1064
Enables low power clocks for mimxrt1064. This allows the soc to
transition into very low power states during idle, as most PLLs can be
disabled. Power states need to be enabled and selected at the board
level.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Daniel DeGrasse
e9ce5cd282 soc: rt10xx: Add power management support
Add power management code for the RT10xx SOC. By default, the code will
simply gate the core clock and transition the SOC to WAIT mode when
sleeping, but if clocking hooks are register to reduce clock frequencies
these will be called as well, and the SOC core voltage will be lowered
for additional power savings.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Daniel DeGrasse
cb685709e5 soc: nxp_imx: Enable inclusion of power management HAL drivers
Add KConfig symbols to select power management HAL drivers required for low
power modes. Set ZTEST_NO_YEILD if PM is enabled, since RT series SOCs
do not connect to a debugger in WAIT mode.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Henrik Brix Andersen
2ffce62f61 soc: arm: nxp: kinetis: fix pinctrl compilation for ke1xf SoC series
The NXP KE1xF SoC series does not support neither slew rate nor open
drain PORT configuration registers.

Fix pinctrl compilation for the KE1xF by defining dummy register macros
for the SRE and ODE registers.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-07 13:52:12 -06:00
Jay Vasanth
63ac835988 i2c: update MEC172x i2c module for pinctrl
Changes to i2c module to support pinctrl

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-07 11:03:06 +01:00
Jay Vasanth
5cccbb13bc gpio: MEC172x: update gpio module for pinctrl
Changes to gpio module to support pinctrl

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-07 11:03:06 +01:00
Jay Vasanth
2cd02bd826 drivers: pinctrl: Microchip MEC172x pinctrl driver
Add core files for Microchip MEC172x pinctrl driver

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-07 11:03:06 +01:00
Guy Morand
6614f917ba soc: arm: nxp_imx: Add HAS_MCUX_IGPIO in SoC support
This enables the mcux_igpio driver for this SoC.

Signed-off-by: Guy Morand <guy.morand@bytesatwork.ch>
2022-03-04 13:23:28 -06:00
Gerard Marull-Paretas
7746abdc39 soc: arm: microchip_mec: mec1501: remove SOC_POWER_MANAGEMENT
Remove a redundant symbol that was used as a proxy to enable CONFIG_PM.
If an application needs to enable PM, it should just enable PM subsystem
Kconfig options. Furthermore, there's no clue "SOC_POWER_MANAGEMENT" is
a Microchip specific option.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-04 09:05:45 -06:00
Gerard Marull-Paretas
ee30559f07 soc: arm: nuvoton_npcx: s/SOC_POWER_MANAGEMENT_TRACE/NPCX_PM_TRACE
Rename CONFIG_SOC_POWER_MANAGEMENT_TRACE to CONFIG_NPCX_PM_TRACE so that
it is clear that it's a NPCX specific option.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-04 09:05:45 -06:00
Gerard Marull-Paretas
57f0316785 soc: arm: nuvoton_npcx: remove SOC_POWER_MANAGEMENT
Remove a redundant symbol that was used as a proxy to enable CONFIG_PM
and CONFIG_PM_DEVICE. If an application needs to enable PM, it should
just enable PM subsystem Kconfig options. Furthermore, there's no clue
"SOC_POWER_MANAGEMENT" is a NPCX specific option.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-04 09:05:45 -06:00
Daniel DeGrasse
bdbb72a95a soc: kinetis: Add common pinctrl include file
Add pinctrl include file to define SOC specific pinctrl_soc_t structure,
used to store pin configuration for pinctrl driver

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-03 13:00:20 -06:00
Bryce Wilkins
c11d1ba621 soc: Conditionally attach SFRO clock to FlexCOMM0
Attaching SFRO clock to FlexCOMM0 should be conditional on the
device tree as an application may not need SFRO attached to FlexCOMM0.

Signed-off-by: Bryce Wilkins <bryce.wilkins@gmail.com>
2022-03-03 10:04:19 -06:00
Kamil Piszczek
cf6a58d3f6 bluetooth: hci: rpmsg: use ipc service library
The Bluetooth HCI driver based on the RPMsg transport now uses the IPC
service module. The compatible Bluetooth sample - HCI RPMsg - has also
been migrated to the new IPC solution.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-03-02 17:03:01 +01:00
Krzysztof Chruscinski
f0825801f6 soc: arm: nordic_nrf: nrf53: Add init priority for sync_rtc
Add configurable init priority for nrf53 synchronized rtc module.
Add build time assert to ensure that initialization is done after
mbox.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-02 09:42:09 -06:00
YuLong Yao
988ae3044e soc: arm: gigadevice: add support for GD32e10x
Add support for the E10x series.

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2022-03-01 18:06:14 +01:00
Mikkel Jakobsen
face3cd0c8 soc: arm: st_stm32: add stm32h725xx support
add support for stm32h725xx family

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
2022-02-28 09:15:33 -06:00
Gerard Marull-Paretas
bb40e38527 soc: arm: ti_simplelink: drop custom constraint implementation
The constraints API offered by TI HAL is meant to be used externally,
for example, when implementing a policy using their policy mechanism
(not used on Zephyr). The API is likely designed for systems where a
thin RTOS is used (e.g., FreeRTOS, TI-RTOS?), places where you basically
get a Kernel and a few services around, but not a system like Zephyr
where you also get, for example, a power management subsystem. This
means that it gets difficult for an RTOS like Zephyr to use such HAL
APIs while using its own constraints API. The first question is why we
allowed such kind of HAL code to be part of upstream Zephyr. It
certainly does useful things, but it is also uses a HAL infrastructure
which is hardly exportable to an RTOS like Zephyr. Part of the
Power_init() code, for example, should likely be in a clock controller
driver, where Zephyr APIs can be used.

The _solution_ that was done to workaround this case was allowing custom
full re-implementations of the constraints API. So we are basically
overwriting a functional API with custom HAL code because of poor HAL
designs. This is in general a bad design principle. If we allow this, we
can hardly offer any guarantees to the API users. For example, is
re-implemented as thread-safe? What is the API behavior then? ...
Platforms like TI that have incomplete support in Zephyr tend to leverage
to HAL code certain functions that should be proper Zephyr
drivers. Such platforms should not influence the design of APIs because
they lack solid foundations.

This patch removes the custom implementation since the HAL has been
patched so that it forwards PM state constraints to Zephyr.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-28 10:18:38 +01:00
Sam Hurst
0a9e8fb9ea pm: Remove extraneous "info" statement left over from PR #42041
Remove extraneous "info" statement left over in file stm32g0/power.c

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2022-02-25 11:23:02 -05:00
Flavio Ceolin
78454e5e93 pm: Rename pm_power_state_exit_post_ops
Aligning with the rest of PM API, replace pm_power_state_exit_post_ops
with pm_state_exit_post_ops.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-02-23 07:33:46 -05:00
Flavio Ceolin
89fee61b43 pm: Rename pm_power_state_set
Aligning with the rest of PM API, replace pm_power_state_set with
pm_state_set.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-02-23 07:33:46 -05:00
Martí Bolívar
dcb0d9fc4a soc: nrf: remove use of NRF_GPIO_PIN_MAP
Commit 7cdd10bf89
("soc: arm: nordic: add NRF_DT_GPIOS_TO_PSEL_BY_IDX") added a use of
NRF_GPIO_PIN_MAP to soc_nrf_common.h without including the relevant
HAL header where it is defined, hal/nrf_gpio.h.

Unfortunately, including that header causes even more problems, since
it causes undefined NRFX_ASSERT() calls to appear elsewhere in the
tree.

It's not really worth bothering to use this macro. Just expand it
inline instead.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-02-22 20:55:53 -05:00
Jedrzej Ciupis
81c48c3e68 soc: arm: nordic: extend nRF5340 initialization
Extend initialization code for nRF5340 application core to iterate over
child nodes of GPIO pin forwarder node and pass control over detected
pins to the network core.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2022-02-22 15:00:35 -08:00
Jedrzej Ciupis
7cdd10bf89 soc: arm: nordic: add NRF_DT_GPIOS_TO_PSEL_BY_IDX
Add a macro that allows to retrieve pin's PSEL from its devicetree
representation taking into account its index into GPIO array.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2022-02-22 15:00:35 -08:00
Chris Trowbridge
52bee41bba drivers: ipm: Add support for NXP i.MX rev2 MU
With a number of the i.MX SoCs (e.g., the i.MX8M Plus), NXP has moved to
supporting the integrated Cortex-M cores with the MCUXpresso SDK (MCUX).
As a result, certain Zephyr drivers (such as the IPM driver) need to be
updated to utlize this new MCUX-based SDK.

This change adds support for the MCUX Messaging Unit driver pulled in by
this PR:
https://github.com/zephyrproject-rtos/hal_nxp/pull/130

Additionally, this change enables the new IPM_IMX_REV2 config for the
mimx8ml8_m7 SoC target which utilizes this new revision of the driver.

Signed-off-by: Chris Trowbridge <chris.trowbridge@lairdconnect.com>
2022-02-22 16:34:06 -06:00
Chris Trowbridge
f401be157f drivers: gpio: Add GPIO support for mimx8ml8_m7 (NXP i.MX8M Plus SoC)
The current MCUX IGPIO driver assumes that the target SoC supports
the DR_SET, DR_CLEAR, and DR_TOGGLE functionality, but some do not
(namely, the M7 core of the i.MX8M Plus SoC). Current releases of
the MCUXpresso SDK IGPIO driver contain utility functions to set,
clear, and toggle pins which include provisions to support SoCs
with and without DR_SET, DR_CLEAR, and DR_TOGGLE, and this change
switches to using these utility functions.

Additionally, this change enables GPIO support on the mimx8ml8_m7
target.

Signed-off-by: Chris Trowbridge <chris.trowbridge@lairdconnect.com>
2022-02-22 10:13:31 -08:00
Tomislav Milkovic
a0bc0672b8 soc: arm: stm32h7: add support for stm32h7b3xx and stm32h7b3xxq
Add SoC Kconfig configurations

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-02-22 10:34:56 -05:00
Carles Cufi
e83a13aabf kconfig: Rename the TEST_EXTRA stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Jun Lin
756babfa75 soc: npcx: add support for npcx9m7f
Add new SoC npcx9m7f support for npcx9 series.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2022-02-21 21:56:24 -05:00
Jun Lin
a6ce9b55c1 soc: npcx: guard psl-in related code by the status of vsby-psl-in-list
Do not include psl-in related code is the status of vsby-psl-in-list is
disabled, which can help reduce a little RAM/flash size.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2022-02-21 21:55:54 -05:00
Carlo Caione
c5894df5ec pm: Change parameters of pm_power_state_{set,exit_post_ops}
Just pass state and substate_id instead of the whole info structure
pointer.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-02-21 20:58:01 -05:00
Carlo Caione
11f1dd2370 pm: Reference pm_state_info only by pointer
It's unnecessary to move the pm_state_info around by value, just use a
pointer.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-02-21 20:58:01 -05:00
Jose Alberto Meza
0549428b55 soc: arm: mchp: Remove magic numbers
Add SoC MEC150x device ID macros.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-02-21 20:55:48 -05:00
Gerard Marull-Paretas
b2aca68622 soc: arm: microchip_mec: remove re-defined Kconfig help
The help for MCHP_ECIA_XEC is defined in
drivers/interrupt_controller/Kconfig.xec. defconfig files must not
re-define prompts or help, just modify the default value.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 19:35:21 -05:00
Gerard Marull-Paretas
f866e796fb soc: arm: nuvoton_npcx: remove Kconfig help re-definitions in defconfig
The SoC Kconfig.defconfig.series files re-defined multiple Kconfig help
entries. The help for such symbols should only be present in places
where symbol is actually defined, not where the defaults are changed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 19:35:21 -05:00
Attie Grande
24478c8a4d drivers: adc: adc_sam0: Change local variables to lower case
Local variables should not be in capitals.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-02-04 10:49:09 +01:00
Attie Grande
e4d4eaca03 soc: atmel_sam0: Implement fixup.h for ADC driver
The ADC driver now supports three different implementations. To maintain
readability, this patch implements an adc_fixup.h that permits more
generic access to relevant registers.

This patch also introduces support for a new third shape ADC - as found
in the SAML21 for example.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-02-04 10:49:09 +01:00
Daniel DeGrasse
5dfd3c3786 soc: rt10xx: Set divisor for sys pll (PLL2) PFD0
Divisor must be set to calculate SD host controller clock frequency in
clock driver.

Fixes #42380

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-02-02 16:59:30 +01:00
Yonatan Schachter
efa170f480 soc: rp2040: Added UF2 output file support
Added support for the UF2 file format for the RP2040 SoC

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2022-02-02 16:23:35 +01:00
Yonatan Schachter
fd59038312 drivers: pinctrl: Added pinctrl driver for RPi Pico
Added a pinctrl driver for the Raspberry Pi Pico series

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2022-02-02 16:23:35 +01:00
Yonatan Schachter
db5b2780bf soc: Added support for Raspberry Pi's RP2040 SoC
Added basic support for the RP2040 SoC. Support
includes booting and starting the kernel, on one
core only.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2022-02-02 16:23:35 +01:00
Joakim Andersson
aef46a8e51 soc: nrf53: Add handling of secure-only code in init with TFM enabled
Add handling of secure-only code with TF-M enabled that can only be done
from secure processing environment.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-02-01 11:31:36 +01:00
Hake Huang
496dd79fdb soc: rt1xxx: fix build errors
remove LOG_ERR in soc init

fixing: #42179

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-01-28 10:06:53 +01:00
Hake Huang
de3518157c soc: nxp_rt: sai clock header include
add sai clock source name define header
update the clock marco for sai

fixing: #42179

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-01-28 10:06:53 +01:00
Alexander Mihajlovic
dafc4383fd soc: stm32l0: Clear LPSDSR when exiting STOP mode
Clear the LPSDSR bit of PWR_CR to restore the voltage regulator
mode when exiting from STOP mode. Leaving LPSDSR set can cause
cause stability issues because the MCU will enter low-power sleep mode
instead of normal sleep mode when the core idles and this is not what
the rest of the implementation expects.

Signed-off-by: Alexander Mihajlovic <a@abxy.se>
2022-01-28 10:06:13 +01:00
Hake Huang
a59e994322 soc: add auido clock init per soc
RT11xx and RT10xx have different audio clock settings
so add them in soc.c

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-01-21 11:26:45 -06:00
Hake Huang
8ae222641d config: soc: add i2s support in rt1170 soc
add HAS_MCUX_I2S in soc config

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-01-21 11:26:45 -06:00
Immo Birnbaum
dffcb1d6f9 soc: arm: xilinx_zynq7000: Re-organize SoC data and init code
Re-organize the SoC family/series/model configuration data so that:
* Board definitions can distinguish between the single-core (XC7ZxxxS)
and dual-core (XC7Zxxx) ARM Cortex-A9 models. Further descriptions
of on-chip resources, in particular relating to the programmable logic
capabilities if support of this functionality is to be implemented,
can be added at a later time.
* Separate SoC initialization code exists for the two series, so that
the init code of the XC7Zxxx series can consider SMP while the init
code of the single-core XC7ZxxxS series doesn't have to.
* Device drivers which don't have to distinguish between the single-
and double-core series of the SoC family can use a common configuration
item whenever the pre-processor is used to enable Zynq-7000-specific
code.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@Weidmueller.com>
2022-01-21 11:34:09 -05:00
Mahesh Mahadevan
6f23f55e4b soc: mxrt10xx: Update the clock init code
1. Setup VDD_SOC with the appropriate setting
   depending on the SoC
2. Do not configure PLL_SYS and PLL_USB. These
   are already configured by the ROM code using
   the DCD
3. Fix setting for USDHC clock

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-01-21 08:36:09 -06:00
Jay Vasanth
4495f43dca soc arm: MEC172x soc.h - Include custom IRQn_Type
Fix for issue #41012 to allow compiler to treat
IRQn_Type to be more than 8-bit. This will ensure NVIC numbers
more than 127 (required for MEC172x device) will work
correctly with irq_enable() API

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-01-20 13:42:16 -05:00
Mahesh Mahadevan
a62ff8906d soc: Add support for MXRT595
Add support for MXRT595

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-01-19 13:35:09 -06:00
Benedikt Schmidt
03297084e5 soc: arm: stm32: activate LPTIM based upon PM
Activate LPTIM by default if PM is selected.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2022-01-19 14:15:29 -05:00
Krzysztof Chruscinski
ff6b5d979f soc: arm: nordic_nrf: nrf53: Add Synchronized RTC
Add a module which is responsible for getting offset between RTCs
used for system clock on NET and APP cores. After getting an offset
between NET and APP clocks, it can be used for logging timestamping
on NET core to ensure that timestamping is in sync on both cores.

Synchronization is done using PPI, IPM task and events and RTC
capture feature.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-19 17:46:28 +01:00
Krzysztof Chruscinski
1f445b65fb soc: arm: nordic_nrf: nrf53: Add nrf53 series guards to Kconfig.soc
All options in Kconfig.soc are only for nrf53 series. Added file
wide guard instead of option specific options.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-19 17:46:28 +01:00
Daniel DeGrasse
19bb8e2ec8 soc: rt11xx: Enable power management for RT11xx series SOCs
Enables basic power management for the RT11xx series SOCs. The following
power saving measures are currently implemented:

- system reduces core voltage during sleep
- core clock can be gated in deep sleep

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-01-18 14:09:45 -05:00
Daniel DeGrasse
f5ebc30087 soc: imx_rt: Enable IMX.RT General Power Controller Driver
GPC driver is used for power management operations on RT series SoCs.
Enable inclusion of the driver into the build.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-01-18 14:09:45 -05:00
Yasushi SHOJI
611230f80e soc/arm/designstart: Make XIP optional
Arm Cortex-M3 DesignStart FPGA-Xilinx edition doesn't have to use XIP.
Our board doesn't need it.  Make it optional by replacing "select" with
"imply".

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2022-01-18 13:21:50 -05:00
Francois Ramu
1b8d2d3dad soc: arm: stm32 mcus should execute stm32_power_init in PRE_KERNEL_1
Change the stm32_power_init to be executed PRE_KERNEL_1
for all the devices with the low power mode (power.c)
When GPIO and UART are not yet up and running.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-01-18 13:17:39 -05:00
Daniel DeGrasse
0fddb3e458 soc: rt11xx: Enabled GPTP module clock
gPTP module clock is enabled for rt11xx. gPTP is not working correctly
on the RT10xx or RT11xx series, but this module clock needs to be
enabled

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-01-18 12:13:24 -05:00
Daniel DeGrasse
b3a148b22f soc: rt11xx: Enable ethernet clocks
Enable clocks for ethernet module.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-01-18 12:13:24 -05:00
Gerson Fernando Budke
58936e7639 soc: arm: atmel_sam: samv71: Fix SPI build dependency
The SAM spi driver depends on GPIO driver to work. It seems that this
dependency chain it is not handled. This select GPIO driver when SPI
driver is enabled. It rework GPIO and SPI Kconfig to select driver by
devicetree and drop entries at Kconfig.defconfig.series file.

Fixes #41525

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-01-18 12:12:52 -05:00
Julien Massot
feb6e2504e drivers: pinctrl: add Renesas RCar PFC driver
Introduce Pin Function Controller for Renesas R-Car family.
This first implementation support to set a given pin as gpio
or peripheral (GPSR), to set a peripheral function to a
pin (IPSR), to set pull-up, pull-down (PUEN, PUD).
In addition this driver allows to set driving capabilies(DRVCTRL).

Pins are identified thanks to the per SoC binding for
pin definition which also contains pin alternate function
parameters.

Some pins can also have driving capabilities, some have bias
capabilities.
In order to find the correct bias and drive registers pfc_r8a77951.c
describes the different registers.
Each SoCs or package will need to define getters
for these registers: pfc_rcar_get_bias_regs() and
pfc_rcar_get_drive_regs().

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
2022-01-17 21:00:58 +01:00
Manojkumar Subramaniam
bd9415e6bf soc: arm: stm32h7: kconfig workaround to handle SoC H7A3XX-Q P/N
Set the correct soc string so that the correct CMSIS file
is being utilised.

Signed-off-by: Manojkumar Subramaniam <manoj@electrolance.com>
2022-01-17 11:45:21 -05:00
Manojkumar Subramaniam
881407be6e soc: arm: stm32h7: add stm32h7a3xxq
The Q variant is the same as non-Q, except the Q has SMPS built-in.
This symbol addition is to have the correct
SOC definition ("STM32H7A3XXQ")

Signed-off-by: Manojkumar Subramaniam <manoj@electrolance.com>
2022-01-17 11:45:21 -05:00
Manojkumar Subramaniam
a268d8b07e soc: arm: stm32h7: add stm32h7a3xx support
Basic kconfig config.

Signed-off-by: Manojkumar Subramaniam <manoj@electrolance.com>
2022-01-17 11:45:21 -05:00
Daniel Leung
aa20e081d2 arm: remove @return doc for void functions
For functions returning nothing, there is no need to document
with @return, as Doxgen complains about "documented empty
return type of ...".

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-12 16:02:16 -05:00
Christoffer Bask
2091c3752d pwm: Added MCUX_PWM support for MIMXRT1021
It has been tested and working on a custom MIMXRT1021-pcb.

Signed-off-by: Christoffer Bask <christoffer@softube.com>
2022-01-12 15:46:01 +01:00
Gerard Marull-Paretas
864888f2ce soc: arm: nuvoton_npcx: add missing include
The reg_def.h was not self-contained: it uses DT API but doesn't
include <devicetree.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-11 10:03:54 -05:00
Gerard Marull-Paretas
e5e73a70e9 soc: remove unnecessary inclusions of devicetree.h
Many ARM SoCs included <devicetree.h> likely due to:

1. nvic.h not being self-contained
2. As a result of copy-paste

Some RISC-V SoCs had the same problem, in this case likely due to
copy-paste from ARM. The <devicetree.h> header has been removed using
the following command:

sed -i ':a;N;$!ba;s/#include <devicetree\.h>\n//g' soc/**/soc.h

soc.h files that make a legitimate usage of the API have not been
changed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-11 11:52:27 +01:00
Gerard Marull-Paretas
a08e87e078 soc: arm: silabs_exx32: make soc_pinmap.h self contained
The soc_pinmap.h uses the DT API, so these headers needs to include
<devicetree.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-11 11:52:27 +01:00
Gerard Marull-Paretas
7a5ee28755 soc: arm: atmel_sam0: common: soc_port: add missing include
The source file uses boolean types internally, however, <stdbool.h> was
not included. It was likely included indirectly before via
<devicetree.h> -> <sys/util.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-11 11:52:27 +01:00
Gerard Marull-Paretas
095a21e2cf soc: arm: nuvoton_npcx: make soc_*.h headers self-contained
Almost none of the soc_*.h headers were self-contained. This patch adds
all necessary includes to improve the situation.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-11 11:52:27 +01:00
Henrik Brix Andersen
25433f1414 soc: arm: nxp: lpc55xxx: add MCAN support
Add support for the NXP LPC MCAN CAN-FD controller.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-01-10 12:00:20 +01:00
Wealian Liao
7add8f7fa0 drivers: adc: npcx: Fix register offset
NPCX7/9 has a different ADC register structure. NPCX7 has 3 threshold
detectors from offset 0x14 & has 10 input channels. NPCX9 has 6
threshold detectors from offset 0x60 & has 12 input channels.

This commit fixes the NPCX ADC register structure.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2022-01-07 11:21:29 -05:00
Aymeric Aillet
7f1f1229e1 soc: arm: renesas: r8a77951: fix defconfig
Fixed an error that could cause problems if
a driver reads "SOC" in the future.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2022-01-06 15:15:10 -05:00
Joakim Andersson
b5ac60e48b soc: nordic: Set TF-M option for nordic HAL library
Set TF-M option for nordic HAL library path to use the included
nordic HAL instead of the version that TF-M downloads.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-01-04 18:59:08 +01:00
Carles Cufi
f0765409a7 soc: nrf: Disable DWT NULL pointer detection by default
Having DWT-based NULL-pointer detection enabled by default trips a lot
of users since it will make any debugging fail when enabled. Disable it
by default and let users enable it if they desire to.

Fixes #39216.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-12-20 19:18:12 +01:00
TOKITA Hiroshi
949d4b91d9 drivers: pinctrl: Support pinctrl with GD32VF103
Change the settings to support pinctrl on the GD32VF103.

- Split soc/arm/gigadevice/common/pinctrl_soc.h
  and put it into include/dt-bindings.
- Leave some definitions that can't handle with device tree compiler
  in pinctrl_soc.h.
- Remove dependency to SOC_FAMILY_GD32 because always enabled it
  if GD32_HAS_AF(IO)_PINMAX was selected.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2021-12-20 17:51:30 +01:00
Jun Lin
db74010cc7 drivers: uart: npcx: use PM constraint for the receiving
In this commit, the driver sets the PM constraint to prevent the system
from entering the suspend state for a CONFIG_UART_CONSOLE_INPUT_EXPIRED
period when data come in. The constraint releases after the
CONFIG_UART_CONSOLE_INPUT_EXPIRED time expires, .

With this change, the PM policy doesn't have to check the timestamp
by calling npcx_power_console_is_in_use() explictly. So the related
npcx_power_console_is_in_use*() functions can be removed.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-12-20 17:43:58 +01:00
Daniel DeGrasse
9a07e5ac0d soc: mimxrt11xx: Fix CAN peripheral for RT11xx
RT11xx can peripheral had incorrect clocking configuration in SOC clock
init code and DTS. Fix peripheral configuration.

Fixes #41251

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-17 11:49:15 -06:00
Kwon Tae-young
5a72181c2c soc: arm: nxp_imx: Add i.MX8MQ SoC support
Add SoC support for the NXP i.MX8MQ series MIMX8MQ6 SoC. This SoC
has a quad Cortex-A53 cluster and a single core Cortex-M4 core. Zephyr
support is added to the Cortex-M4 core for running at 266MHz.

More information about the SoC can be found here: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-8-processors/i-mx-8m-family-armcortex-a53-cortex-m4-audio-voice-video:i.MX8M

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2021-12-17 09:23:38 -06:00
HaiLong Yang
36b1a31c8f soc: arm: gigadevice: support gd32f405xx soc
Add support for GD32F405xx series SOCs.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2021-12-16 10:13:48 +01:00
Chris Trowbridge
ac28f8ddde boards: arm: Add NXP i.MX8M Plus EVK board support
Add board support for NXP i.MX8M Plus EVK. This board has the following
features:

Processor    : i.MX8M Plus Quad applications processor
Memory       : 32-bit LPDDR4 w/6 GB
               eMMC 5.0/5.1 w/32 GB
               SD/MMC connector
               QSPI w/32 MB
Connectivity : MIMO 2x2 Wi-Fi 802.11b/g/n/ac and BT 4.2
               2x Ethernet (1x w/ TSN)
               PCIe M.2
               2x CAN FD DB9 Female connectors
USB          : USB 3.0 Type C for Power
               USB 3.0 Type A
               USB 3.0 Type C
Debug        : JTAG connector
               MicroUSB for debug console

More information about this board can be found in NXP website: https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/evaluation-kit-for-the-i-mx-8m-plus-applications-processor:8MPLUSLPD4-EVK

Signed-off-by: Chris Trowbridge <chris.trowbridge@lairdconnect.com>
2021-12-15 13:15:00 -06:00
Daniel DeGrasse
91a25cc59a soc: mimxrt685_evk: Fix usdhc driver build failure
USDHC driver build failure fix for mimxrt685_evk, dat3 pull function was
not defined at the SOC level.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-13 20:30:06 -05:00
HaiLong Yang
b863420013 soc: arm: gigadevice: add support for GD32F3X0 SoCs
Add support for GigaDevice GD32F3X0 series.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2021-12-13 20:27:30 -05:00
Daniel DeGrasse
b330f18a39 boards: mimxrt1xxx: Added support for GPT hardware timer on RT1xxx
Adds support for using GPT as the hardware timer source (as opposed to
systick) for all RT1xxx platforms. This requires moving the clock
frequency of these devices into a defconfig so it can be overridden by
the GPT clock frequency.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-13 20:13:21 -05:00
Daniel DeGrasse
e99eb6bb70 drivers: mcux_gpt_timer: Enabled GPT timer on MIMXRT1064 EVK
This enables the GPT timer for use as a hardware clock on the
MIMXRT1064. The timer will be disabled when builds use the GPT timer as
a counter, and the build will fall back to using the Cortex M systick as
a timer. This was tested using the kernel tickless test, to verify the
driver functions as expected.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-13 20:13:21 -05:00
Daniel DeGrasse
fa56e9ee2b drivers: mcux_gpt_timer: Added GPT timer for HW clock
Added a driver to enable the GPT timer on RT1xxx parts to be used
instead of systick as a clock source. The timer is set to run in reset
mode, and uses the low frequency 32kHz oscillator for power savings

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-13 20:13:21 -05:00
Daniel DeGrasse
cd4cc7af42 soc: MIMXRT11xx: Enable FlexSPI on MIMXRT11xx
Enable flexspi for RT11xx SOCs. This requires selecting the correct
KConfig symbol for the cortex m4 and m7 SOCs, as well as correcting an
error in the flexspi DTS node and updating the clock init for RT11xx
SOCs.

Note that in addition, the NXP hal must be updated to properly support
including the cache management driver for the Cortex M4.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-09 19:32:45 -05:00
Jordan Yates
f408f42e36 linker: link into derived section names
Link variables into derived section names instead of hardcoded names.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-12-09 16:23:03 +01:00
Mahesh Mahadevan
1d44e281a6 soc: Include PINT include file conditionally
Include fsl_pint.h header file only when the
CONFIG_GPIO_MCUX_LPC is enabled

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-12-09 09:18:10 -06:00
Kumar Gala
91d4b7766c soc: arm: mps3: Only enable MVE if not QEMU
QEMU doesn't currently support MVE until the QEMU 6.2 release is out.
So for now only enable MVE support if we are NOT targetting QEMU.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-12-08 16:50:27 -06:00
Gennady Kovalev
b49766f001 drivers: clock_control: More power supply modes for STM32H7
STM32H7 has different power supply modes but now Zephyr supports just LDO
and direct SMPS. This commit introduses POWER_SUPPLY_CHOICE configuration
parameter and add support for missed power supply modes.

Signed-off-by: Gennady Kovalev <gik@bigur.com>

Fixes #40730.
2021-12-08 09:12:12 -05:00
Jay Vasanth
fd43c725d2 drivers: spi: Add MEC172x QMSPI-LDMA driver
Add driver for MEC172x QMSPI with local DMA(LDMA). The driver
support SPI asynchronous operation.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2021-12-08 08:43:05 -05:00
Daniel DeGrasse
459d9dc43f soc: MIMXRT11xx update clock init code
RT11xx clock init code was not handling difference between RT1160 and
RT1170 Bus_Lpsr clock correctly. Fix this.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-08 08:40:06 -05:00
Daniel DeGrasse
b18aefdfd3 dts: rt685: enabled flexcomm15
the RT685 contains an additional flexcomm peripheral, that supports
only I2C. This commit adds this peripheral to the device tree,
and enables pins and clocks for flexcomm15.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-08 08:27:44 -05:00
Pieter De Gendt
4d161a3b23 drivers: counter: NXP SNVS rtc: Add support for NXP imx SNVS RTC
Adds a driver using the SNVS high power and optionally low power
RTC instances. A device specific function `mcux_snvs_rtc_set` is
provided to update the current counter value.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-12-07 09:45:43 -06:00
Daniel DeGrasse
57f35bbf5a drivers: USDHC: Enable detection using DAT3 pulldown
Enable USDHC host to detect inserted SD card via DAT3 line pulldown.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-06 15:27:25 -05:00
Daniel DeGrasse
9ee2709e0a soc: rt11xx: Enable USDHC for RT11xx devices
RT11xx SOC definitions did not enable USDHC controller. Select Kconfig
symbols required to enable it.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-06 15:27:25 -05:00
Gerard Marull-Paretas
7d1bfb51ae drivers: timer: cortex_m_systick: improve ISR installation
A Cortex-M specific function (sys_clock_isr()) was defined as a weak
function, so in practice it was always available when system clock was
enabled, even if no Cortex-M systick was available. This patch
introduces an auxiliary Kconfig option that, when selected, the ISR
function gets installed. External SysTick drivers can also make use of
this function, thus achieving the same functionality offered today but
in a cleaner way.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 07:34:53 -05:00
Daniel DeGrasse
20b43d7e8d boards: mimxrt1170_evk: Enable PWM on RT1170 EVK
PWM is enabled on RT1170 EVK, for both Cortex M4 and M7 cores. Tested
using led_pwm sample.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-03 16:44:12 -06:00
Hake Huang
57b23c7308 boards: i2s: enable i2s support for mimxrt1060_evk
add i2s(sai) support for mimxrt1060_evk and related
pinmux

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-12-02 10:50:21 +01:00
Wealian Liao
230378aebe driver: uart_npcx: Fix uart to use PM constrain
The device PM callback needs to be used only to suspend/resume devices.
If the system cannot be suspended because UART is in a particular
state, the pm_constraint_set/release API should be used. For NPCX UART,
the chip can't enter low power idle state until UART completes the data
transmission.
This commit changes NPCX UART to use pm_constraint_set/release & fixes
UART lost data from low power idle.

Fix #40621

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2021-12-01 13:49:17 -06:00
Daniel DeGrasse
662a131713 soc: rt6xx: Default flexspi logging to disabled
RT600 uses the mcux flexspi driver, which can produce RWW hazards when
calling code linked into flash (such as the logging subsystem). Disable
logging in flexspi driver by default for RT600 series.

Fixes #40744

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-30 13:54:06 -06:00
Antonio Tessarolo
cc1cd4d65b arm: Nxp imx6sx added PWM support
This commit adds support for IMX6SX PWM.
The PWM module is the same module present on the IMX7D and so dts
bindings has been renamed following the one present on linux.

Signed-off-by: Antonio Tessarolo <anthonytexdev@gmail.com>
2021-11-30 11:54:11 -06:00
Gerard Marull-Paretas
51df9fc8d9 soc: arm: st_stm32: stm32u5: fix pm_power_state_set
Some PM cases were not handled correctly (missing default statement).
The error was caught by CI while doing other PM related work.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-29 11:08:38 +01:00
Gerard Marull-Paretas
a8c93478db soc: arm: nordic_nrf: move soc_nrf_common.h to common folder
Since the addition of pinctrl the common folder is added to the Zephyr
include path. This can be re-used to place the soc_nrf_common.h header
in the common folder and include it directly, without the need of
relative paths.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 14:20:51 +01:00
Gerard Marull-Paretas
22c8c02145 drivers: pinctrl: nrf: initial support
Add initial support for nRF pin controller driver. The implementation in
this patch does not yet support any peripheral. Only states
representation and basic driver functionality is introduced.

Note:
The nrf_pin_configure function has been marked as __unused since it may
not be used in certain scenarios until all peripherals are supported by
the pinctrl driver. For example, if only UART/E is supported but the
board does not enable UART, the function will never get called. However,
that board will likely have other peripherals that will gain support in
the future.

Thanks to Marti Bolivar for bindings documentation.

Co-authored-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 14:20:51 +01:00
Gerard Marull-Paretas
9c10e1e988 drivers: pinctrl: stm32: initial version
Add initial version for STM32 pinctrl driver. Driver has been written
re-using many of the already existing parts in
drivers/pinmux/pinmux_stm32.c.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 11:36:42 +01:00
Daniel DeGrasse
e70907f52d drivers: mcux_flexspi: Default logging to disabled when XIP is used
Program flow will behave incorrectly (memory and instruction fetches
return invalid data) if Flexspi is accessed by the Flexspi driver while
being used as XIP memory by the Cortex M7.

Set logging to disabled by when XIP mode is used in the memc and
flexspi drivers, and warn the user if they attempt to enable it.

Fixes #40133

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-22 22:27:13 -05:00
Gerard Marull-Paretas
037869e28d soc: arm: gigadevice: enable pinctrl by default
Enable pinctrl by default, since it is an essential component on almost
every firmware. Inclusion of series defconfig has also been guarded with
SoC availability (was missing).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
f45c2668e3 soc: arm: gigadevice: gd32f403: select AFIO pinmux
GD32F403 series use AFIO pinmux model.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
f8017dc5ad drivers: pinctrl: gd32: initial support for AFIO based SoCs
Add a pin control driver for GD32 SoCs using the AFIO model.

Thanks to Gerson Fernando Budke for testing and implementation
suggestions.

Co-authored-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
5c44620753 soc: arm: gigadevice: gd32f4xx: select AF pinmux
GD32F4XX series have AF based pinmux.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
543a3843ff drivers: pinctrl: gd32: initial support for AF based SoCs
Add a pin control driver for GD32 SoCs using the AF model.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
95fd99aba3 soc: arm: gigadevice: add support for GD32F4XX SoCs
Add support for the F4XX series.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-18 17:42:57 +01:00
Gerard Marull-Paretas
2dc24bbac8 soc: arm: gigadevice: gd32f403: cleanup soc.h
- Remove unnecessary include guard
- Fix comments

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-18 17:42:57 +01:00
Gerard Marull-Paretas
96966d180b soc: arm: gigadevice: gd32f403: simplify soc selection
There is no need to specify SoC suffixes, so simplify the selection.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-18 17:42:57 +01:00
Gerard Marull-Paretas
fcbb9476f8 soc: arm: gigadevice: use specific series for GD32F403
Despite the "F4" prefix, GD32F403 is an SoC with significant differences
compared to other F4 MCUs:

- It has a completely different HAL
- It has significant hardware differences, for example, the pinctrl
  mechanism uses AFIO (all others use AF)

The grouping principles applied to other similar vendors such as ST
can't be applied for GD32 due to these reasons, so the approach taken
here is to define series based on the used HAL. A different HAL likely
means that there are significant hardware differences between, e.g. F403
and F405. The vendor likely chose a confusing naming scheme, but we need
to deal with it.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-18 17:42:57 +01:00
David Leach
a09ba37334 MXRT600: Fix secure/non-secure definition for FLEXSPI
The Flexspi memory address defines the location of the externally
attached flash to the MXRT600 based board. The flexspi has two
different memory spaces for secure and non-secure access that are
not aligned for the Flexspi register space and the memory map
address space. The normal method of handling this via the two
different dts files for secure/non-secure is not able to handle
this because a base address is applied uniformly across multiple
reg items.

Changes include:

- pull flexspi out of peripherals block to allow it to be explicitly
expressed in the respective secure/non-secure SOC DTS files.
- move the flash size definition to the board level definition and
use the size of the actual flash device found on the board.
:
Signed-off-by: David Leach <david.leach@nxp.com>
2021-11-18 14:29:53 +01:00
Manojkumar Subramaniam
22186c7c51 soc: arm: st_stm32: use SMPS power supply only if enabled
Use SMPS power supply only if enabled.

The default power supply configuration for the
NUCLEO board with -Q subfix is SMPS,
so it's essential to match with hardware configuration
to avoid deadlocks due to mismatch.

if a custom board with LDO configuration is in use,
then no need to enable `CONFIG_POWER_SUPPLY_SMPS`

Signed-off-by: Manojkumar Subramaniam <manoj@electrolance.com>
2021-11-18 13:56:39 +01:00
Manojkumar Subramaniam
7a690a56c5 soc: arm: st_stm32: add kconfig entry for STM32 SMPS
Add support for SMPS

Signed-off-by: Manojkumar Subramaniam <manoj@electrolance.com>
2021-11-18 13:56:39 +01:00
Jay Vasanth
70d4559fdf Microchip: MEC172x: eSPI driver
Updates to MEC172x eSPI driver to support ACPI shared
memory region and EC Host Command Subsystem through
ACPI_EC1 and Embedded Memory Interface (EMI).

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2021-11-16 10:43:42 +01:00
Joakim Andersson
e721921587 soc: nordic_nrf: Add query items for HW peripherals missing
Add Kconfig items that can be used to query if the current SoC
support the HW peripherals for some peripherals that are missing.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-11 07:24:53 -05:00
Erwan Gouriou
b834fbf538 soc: stm32wb: Implement ble shutdown sequence
Implement platform shutdown including BLE stack reset and shutdown.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-09 05:49:23 -05:00
Erwan Gouriou
bd00d4f6f9 soc: stm32wb: Factorize power procedures
Provide some factorization in pm_power_state_set procedure
to prepare shutdown case introduction.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-09 05:49:23 -05:00
Daniel DeGrasse
c0cee4fb5c boards: Add support for NXP RT1160 EVK
Add baseline support for mimxrt1160_evk Cortex M4 and M7 cores
UART shell, synchronization, and hello world have all been verified to
build and run correctly.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-03 16:18:25 -04:00
Wouter Cappelle
8cdc822954 dts: arm: Add devicetree files for STM32L010xB series microcontrollers
This PR adds the devicetree file for supporting the STM32L010xB mcu.

Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2021-11-02 22:21:45 -04:00
Tom Burdick
73f343c51e board: Adds RDDRONE-FMUK66 board support package
Adds required LQ18 part number to the kinetis K66 series

Signed-off-by: Tom Burdick <tom.burdick@electromatic.us>
2021-11-02 13:17:44 -05:00
Jun Lin
5d72417df4 drivers: spi: npcx: add SPI support to access the SPI flash
The FIU/UMA module in the NPCX chip provides an dedicated SPI interface
to access the SPI flash. This commit adds the driver support for it.
With this commit, the application can call the flash APIs
(via spi_nor.c) to access the internal flash of NPCX EC chips.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Change-Id: I32bbf09f6e014b728ff8e4692e48151ae759e188
2021-11-01 21:48:20 -04:00
Mahesh Mahadevan
34ffd5a7d4 boards: lpcxpresso55s69: Add PWM support
Add PWM support

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-11-01 11:14:29 -04:00
Immo Birnbaum
f668474e4d soc: arm: dts: arm: xilinx: Zynq-7000 SoC init code, device tree data
Add SoC-specific code, the basic device tree and Kconfig data as well
as the corresponding linker command file for the Xilinx Zynq-7000
family of SoCs. This SoC - either as a QEMU simulation or on actual
hardware such as the Avnet/Digilent ZedBoard - is suitable as an ini-
tial target for the ARMv7 Cortex-A support.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
2021-10-28 15:26:50 +02:00
Gerard Marull-Paretas
9398d0647b pm: rename HAS_NO_SYS_PM to HAS_NO_PM
Align name with other Kconfig options (CONFIG_PM).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-10-28 13:00:13 +02:00
Gerson Fernando Budke
087be00b58 soc: arm: Introduce gigadevice soc
Add gigadevice soc initial version.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-10-28 11:17:25 +02:00
Jay Vasanth
c214c59548 Microchip: MEC172x: eSPI driver
MEC172x eSPI driver, eSPI pin programming, interrupt updates related
to eSPI and other updates for MEC172x eSPI driver.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2021-10-26 09:27:20 -04:00
Andrei Auchynnikau
baf913b9df soc: add adc driver to the nxp rt series soc
add adc support to the soc dts,
add MCUX_12B1MSPS_SAR to the soc Kconfigs

Signed-off-by: Andrei Auchynnikau <ovchinnikov@strim-tech.com>
2021-10-22 15:43:36 -05:00
Alexandre Bourdiol
2d4b1b6cba soc: arm: stm32h7: implement workaround for AXI SRAM data corruption
Errata ES0392 Rev 8:
2.2.9: Reading from AXI SRAM may lead to data read corruption
Workaround: Set the READ_ISS_OVERRIDE bit in the AXI_TARG7_FN_MOD
register.
This is applicable only to RevY (REV_ID 0x1003)

Fixes #38933

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-10-21 10:32:21 -04:00
Maureen Helm
b0cdef3c25 drivers: adc: Refactor drivers to use shared init priority
Refactors all of the ADC drivers to use a shared driver class
initialization priority configuration, CONFIG_ADC_INIT_PRIORITY, to
allow configuring ADC drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to preserve the
existing default initialization priority for most drivers. The
exceptions are lmp90xxx, mcp320x, and mcux_adc16 drivers which have
dependencies on GPIO, SPI, and/or DMA drivers and must therefore
initialize later than the default device priority.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-20 07:33:44 -04:00
Maureen Helm
ed9cb841c3 drivers: clock_control: Refactor drivers to use shared init priority
Refactors all of the clock control drivers to use a shared driver class
initialization priority configuration,
CONFIG_CLOCK_CONTROL_INIT_PRIORITY, to allow configuring clock control
drivers separately from other devices. This is similar to other driver
classes like I2C and SPI.

Most drivers previously used CONFIG_KERNEL_INIT_PRIORITY_OBJECTS or
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, therefore the default for this new
option is the lower of the two, which means earlier initialization.

The even lower defaults for STM32 and Arm Beetle are preserved by
SoC-family level overrides.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-19 23:05:25 -04:00
Andrzej Głąbek
40329881bf soc: nrf52: Add Kconfig option for enabling REG0 DC/DC converter
Add a Kconfig option, similar to the one that is already available
for nRF5340, that allows enabling the REG0 (VDDH) DC/DC converter
in nRF52840. Make use of this option in Nordic boards: nRF52840 DK
and nRF52840 Dongle.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-10-17 11:49:26 -04:00
Maureen Helm
8302e5e21c soc: arm: Configure serial driver init priority for NXP SoCs
Configures the default serial driver initialization priority for NXP
SoCs to ensure that serial drivers initialize after clock control
drivers.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-17 10:58:09 -04:00
Tom Burdick
f523c336ef pm: Use stats subsys for tracking system states
Uses the stats subsys to provide simple but useful debugging stats for
power management state changes and timing.

Removes the no longer needed PM_DEBUG config option

Replaces the use of PM_DEBUG for a test clock output pin for mec1501 and
adds in its place an SoC Kconfig option to enable it.

Adds a STATS_SET macro for assigning a value to a stat group field

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2021-10-17 10:56:21 -04:00
Diana Zigterman
5a8434585d NPCX: Correct ESPICFG fields
The parameters to FIELD() should be the position and size of each bit
field.  Correct the size of IOMODE and MAXFREQ.  Otherwise, the MAXFREQ
field is overwritten by the IOMODE update during espi_npcx_configure().

Signed-off-by: Diana Zigterman <dzigterman@google.com>
2021-10-14 14:30:58 -04:00
Erwan Gouriou
997e4584ce soc: stm23u5: Provide power implementation
Provide power modes implementation for u5 socs.
For now STOP3 mode is not implemented as this mode is not
compatible with LPTIM activation and hence cannot be used
as a workable suspend to idle state using LPTIM as kernel
tick source.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-10-07 15:38:40 -04:00
Erwan Gouriou
1ec41ce922 drivers/clock_control: stm32u5: Fix VCO setting
When existing stop mode 1&2, VCO is set to range 4
and should be set back to range 1 to allow full speed
operations.
Rather than setting VCO at startup, set it inside clock
setting procedure so that it could done
in clock reset procedure when existing stop modes.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-10-07 15:38:40 -04:00
Francois Ramu
983ff8b040 soc: arm: stm32f4: group stm32f412xx in a Kconfig for the serie
A new stm32f412vx devices is introduced.
The soc devices stm32f412cx, stm32f412vx, stm32f412zx are
removed to have a more generic stm32f412xx Kconfig.
The stm32cube modules stm32f412cx/vx/zx exists.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-10-07 15:38:22 -04:00
Henrik Brix Andersen
d902b49187 soc: arm: nxp: imxrt1024: enable system reset controller
The NXP i.MX RT1024 contains the System Reset Controller (SRC) IP.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-10-01 13:16:26 -05:00
Pieter De Gendt
f68929067b boards: arm: Enable hwinfo driver on mimxrt1064_evk
Enable the status reset controller on mimxrt1064.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-09-29 14:44:21 -04:00
Aurelien Jarno
2e9cce6779 soc: arm: stm32wl: wakeup from stop clock selection based on sysclk
When exiting Stop mode, if system clock is MSI, MSI oscillator is
selected as wakeup from stop clock; otherwise HSI16 oscillator is
selected.

It is otherwise reconfigured as MSI just after, but it slightly
increases the wake-up time and power consumption.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2021-09-28 20:14:03 -04:00
Gregers Gram Rygg
d47bd60933 soc: nordic_nrf: Add Kconfig option for enabling trace port
Add Kconfig option to enable the hardware trace port in the SystemInit()
function.

Signed-off-by: Gregers Gram Rygg <gregers.gram.rygg@nordicsemi.no>
2021-09-28 20:11:40 -04:00
Andrzej Głąbek
bcf20455ee soc: nrf53: Add missing HAS_HW_NRF_* entries
A few HAS_HW_NRF_* Kconfig options for peripherals available in nRF5340
are not selected. Fix it.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-09-28 11:30:09 +02:00
Aurelien Jarno
18c9dfdd8f soc: arm: stm32lx: fix using MSI as wake-up clock source
Following the migration of the clock source configuration in DTS (commit
2691541ad2), HSI is always used as wake-up source on STM32LX. It is
reconfigured as MSI just after, but it slightly increase the wake-up
time and power consumption.

It happens as the file defining STM32_SYSCLK_SRC_MSI is not included.
Fix that.

Fixes #38807

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2021-09-24 14:09:15 -04:00
Erwan Gouriou
7037651c89 soc: stm32l0: Disable clock after write to DBGMCU registers
Similarly to what was done on stm32g0, disable DBGMCU clock
after operation to avoid conflict with openocd.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-23 12:54:03 -04:00
Erwan Gouriou
7f2e792bda soc: stm32g0: Clock is required to write DBGMCU registers
If clock is not enabled write access on that registers are no-op.
Disable clock after operation to avoid conflicts with openocd which
can also access this clock when flashing.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-23 12:54:03 -04:00
Alexandre Bourdiol
dc986291bd soc: stl32l0: Enable DMA clock instead of DBGMCU clock
During review of #38681, switching from HAL to LL,
involuntarily enable DBGMCU clock instead of DMA clock.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-09-21 10:45:57 -04:00
Alexandre Bourdiol
436ba56059 soc: stm32: SEGGER RTT requires some extra configuration
On some STM32 boards, for unclear reason,
RTT feature is working with realtime update only when
  * one of the DMA is clocked
and sometimes also
  * one of the DBGMCU bit STOP/STANDBY/SLEEP is set
Fixes #34324

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-09-21 06:24:09 -04:00
Alexandre Bourdiol
5674eaca2c soc: arm: stm32h7: rework STM32H7 dual core boot
It happens that CM7 wakeups CM4, before CM4 goes to sleep.
Thus when CM4 goes to sleep,
there no more wakeup from CM7. And CM4 hangs.
For a simple synchronisation implementation,
CM4 doesn't go to sleep any more,
instead it waits (active wait) for CM7 to take HSEM
(meaning that clock configuration is finished).

Fixes #38069

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-09-21 06:23:38 -04:00
Alexandre Bourdiol
ac9bb33ab4 soc: stm32l0: enable DMA clock to fix Hardfault linked to DBGMCU bits
On STM32L0, there are some hardfault when DBGMCU bit Sleep, Stop
or Standby are enabled. See #37119
For unclear reason, enabling DMA clock fixes this issue.
(similarly than #38561, DMA clock comes with DBGMCU bits)

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-09-21 06:21:40 -04:00
Gerard Marull-Paretas
994c77a927 soc: arm: st_stm32: do not enable PM_DEVICE by default
CONFIG_PM_DEVICE was a de-facto requirement when enabling CONFIG_PM=y
since some device, i.e. UART, used the PM device hooks to block
suspension process while the device was busy finishing transmission.
This has now been fixed using constraints, so CONFIG_PM=y can be enabled
without further requirements.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-14 08:36:33 -04:00
Flavio Ceolin
f83dc928f6 cc13x2_cc26x2: pm: Conditionally implement PM functions
Do not implement power management functions when CONFIG_PM is not
enabled.

Fixes #38500

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-09-13 17:54:23 -04:00
Flavio Ceolin
351fd170bd pm: cc13x2_cc26x2: Implement their own constraint
TI Hal has its own constraint API that is used by its drivers. These
constraints need to be correlated with Zephyr constraints to be
constraints set in the HAL be visible on Zephyr and vice-versa.

Fixes #38362

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-09-13 05:50:54 -04:00
Erwan Gouriou
31b7483a99 soc: stm32g0: pm_power_ functions should be __weak
In commit "pm: Fix weak linkage symbols" (PR #35274),
PM SoC hooks were converted to __weak to avoid clash with
new definition of these symbols in subsys/pm/power.c.

G0 power implementation was implemented in parallel
with this change and missed the update.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-08 09:29:56 -04:00
Christian Taedcke
5c8f7bf874 boards: efr32mg_sltb004a: Add minimal pwm support
Add minimal pwm support to the efr32mg12p soc and the Thunderboard Sense
2 board.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-09-03 10:11:15 -04:00
Erwan Gouriou
8edcf02881 soc/arm: stm32wb: Default C2 power mode to SHUTDOWN
Low power modes entry on stm32wb depends on requests coming from both
cores, with no consideration of the fact that C2 is booted  or not.

By default, set C2 power mode to shutdown at C1 start up.
If required, it will be updated by C2.
In case C2 is not started, this will allow C1 to enter any power mode
with no dependency on C2.

Fixes #38173

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-03 10:01:07 -04:00
Yong Cong Sin
f7ba9ce226 soc: arm: stm32g0: Add PM support
Low power modes for the STM32G0 series.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-03 09:42:09 -04:00
Mikkel Jakobsen
f8281e728b modules: nxp_imx: Add HAS_MCUX_FLEXSPI to mimxrt1024
the config symbol was missing for some reason even though
the soc does have a flexspi peripheral like most other socs
in the family.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-09-02 22:40:15 -04:00
Erwan Gouriou
92e3fc24a0 soc/arm/stm32u5: Add stm32u585xx soc series
Introduce STM32U585 series

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-01 15:25:20 -05:00
Mahesh Mahadevan
381c7c7dfb boards: lpcxpresso55s69: Add I2S support
Add I2S support for LPCXpresso55S69 board

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-09-01 14:39:03 -04:00
Mahesh Mahadevan
35fca50dce drivers: i2s: Update MCUX Kconfig
Move SoC specific configs to the soc folder

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-09-01 14:39:03 -04:00
Torsten Rasmussen
c2842c388d cmake: linker: arm: adding Zephyr CMake linker files for arm arch
This is the initial version of a Zephyr CMake linker file for the arm
architecture.

This file defines memory regions, groups, linker sections and symbols
for the arm architecture.

It also sources the common common-ram.cmake, common-rom.cmake,
debug-sections,cmake, and thread-local-storage.cmake.

It configure sections for SoC families using zephyr_linker_sources()
functions:
- nxp_imx

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-30 08:54:23 -04:00
Mahesh Mahadevan
e4c6ea9e79 drivers: counter: Add ctimer driver for RT685
Add counter support using CTimer for RT685

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-08-27 13:47:04 -05:00
Martí Bolívar
7ab602a843 soc: stm32: use new DT pinctrl accessors
Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
d40037c56e soc: nuvoton_npcx: use new DT pinctrl accessors
Update to use the new APIs. Fix a typo while I'm here.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
73c7f55a45 soc: cypress: use new DT pinctrl accessors
Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
865ea9c5f7 soc: atmel: use new DT pinctrl accessors
Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
David Leach
d3cd0d2f9a drivers: adc: add LPADC driver support to mimxrt685 platform
Add LPADC support to the mimxrt685 platform.

Signed-off-by: David Leach <david.leach@nxp.com>
2021-08-25 18:02:00 -04:00
Scott Worley
145673d57a Microchip: MEC172x: I2C driver
Microchip MEC172x series I2C driver implementing controller
and target modes. The driver implemenents its own I2C port
pin control functions and does not depended upon pinmux. Future
updates will make use of PINCTRL when that subystem is finalized.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-08-25 13:07:45 -04:00
Toby Firth
893bfc0fc1 drivers: counter: added ctimer driver for lpcexpresso55s69
Added shim driver for the CTIMERs for the lpcexpresso55s69 board.

Fixes: #22705

Signed-off-by: Toby Firth <tobyjfirth@gmail.com>
2021-08-24 17:13:22 -04:00
Andrzej Głąbek
72e3bfe1c0 soc: nordic_nrf: Add Kconfig options for APPROTECT handling
Add Kconfig options that allow users to select the way the APPROTECT
mechanism is handled in the SystemInit() function.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-24 07:27:12 -04:00
Francois Ramu
6b6aa2714f soc: arm: stm32h7 do not use data cache with DMA
This remove the data cache when the dma is nabled
This is done with the NOCACHE_MEMORY flag

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-08-20 06:28:32 -04:00
Mahesh Mahadevan
95ee8f0f64 soc: LPC55S69: Add USB support
1. Update soc.c file to add USB clock setup
2. Add a linker script file to move USB transfer
   buffer and controller buffers to USB RAM
3. Update Kconfig's to add USB support
4. Add zephyr_udc0 nodelabel

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-08-19 17:19:11 -04:00
Mahesh Mahadevan
34a445d943 soc: RT685: Add USB support
1. Update soc.c file to add USB clock setup
2. Add a linker script file to move USB transfer
   buffer and controller buffers to USB RAM
3. Update Kconfig's to add USB support
4. Add zephyr_udc0 nodelabel

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-08-19 17:19:11 -04:00
Mahesh Mahadevan
f18d51073b soc: rt: Update USB config and device tree node names
The USB config name has changed to USB_MCUX and the
device tree node name has changed from nxp_kinetis_usbd
to nxp_mcux_usbd

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-08-19 17:19:11 -04:00
Mahesh Mahadevan
69a95bcafa soc: mxrt: Replace duplicate use of usdhc1
Replace duplicate use of usdhc1 with usdhc2

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-08-17 17:53:31 -04:00
Mahesh Mahadevan
cc170c8158 mxrt685: Add USDHC support for RT685
Add USDHC support for RT685

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-08-17 17:53:31 -04:00
Martí Bolívar
041099f67c Bluetooth: Controller: clean up nRF DFE
The way we currently handle direction finding extension (DFE) support
on Nordic nRF5 controllers relies on required devicetree properties
related to DFE in the "nordic,nrf-radio" node.

That doesn't make sense on radios without DFE support, though.
Any .dtsi for an SoC without DFE support which has such a node would
require extraneous DFE related properties like dfe-antenna-num.

Instead of making the properties required, mark them optional. We
indicate the presence of DFE support via a new 'dfe-supported' boolean
property which the SoC .dtsi files can set (or not) depending on
support.

This gives us the opportunity to do some cleanup in the Kconfig,
removing CONFIG_HAS_HW_NRF_RADIO_BLE_DF since we know from the
devicetree whether DFE support is available.

Handle that change appropriately in radio_df.c. This gives us an
opportunity to improve readability in the devicetree-related macro
magic in that file.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-17 17:52:43 -04:00
Martí Bolívar
50b267f1d6 soc: nordic_nrf: add NRF_DT_GPIOS_TO_PSEL_OR
Helper macro for getting the PSEL value from optional devicetree
properties.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-17 17:52:43 -04:00
Martí Bolívar
b1e0bacb5e soc: nordic_nrf: add NRF_RADIO base address check
Update validate_base_addresses.c for the RADIO peripheral.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-17 17:52:43 -04:00
Stephanos Ioannidis
61ad0d8630 soc: arm: mps2: Enable DSP extension on CPU1
This commit enables the ARM DSP extension on the MPS2 AN521 SoC CPU1
(the CPU1 supports both FPU and DSP).

With this change, the CMSIS-DSP tests running on the
`mps2_an521_remote` board will use the DSP instructions.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-17 16:41:55 -05:00
Bradley Bolen
5a43fd77d8 soc: arm: xilinx_zynqmp: Enable MPU support
QEMU supports the MPU on Cortex-R platforms so enable it for the
qemu_cortex_r5 platform.  This allows running the mem_protect kernel
tests.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2021-08-17 06:06:33 -04:00
David Leach
f567e02926 boards: arm: lpc55s28: Remove Trustzone-M flags
The LPC55S28 does not have the Trustzone-M support.

Fixes #36768
Fixes #37266
Fixes #37267

Signed-off-by: David Leach <david.leach@nxp.com>
2021-08-17 10:26:35 +02:00
Stephanos Ioannidis
70dd3d6b0d soc: arm: mps3: Enable FPU, DSP and MVE extensions
This commit updates the MPS3 AN547 SoC configuration to enable the FPU
as well as the DSP and MVE extensions.

Note that the CPU0 of the SSE-300 (and AN547) supports all of the
extensions mentioned above (as for MVE, it supports both MVE-I and
MVE-F).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-14 20:29:57 -04:00
Crist Xu
d42833c68b drivers: can: Fix isotp test failed on rt1170 EVK
Config the FlexCAN3 with a maximum 80MHz root clock to fix

Signed-off-by: Crist Xu <crist.xu@nxp.com>
2021-08-12 09:00:30 -05:00
Gerson Fernando Budke
a42890fb39 soc: arm: cypress: Fix psoc6 irq priority
PSoC-6 have different priority bit masks for cortex-m0+ and cortex-m4.

M0: 0-3 (2 bits of NVIC prio, no prio reserved by the kernel)
M4: 0-6 (3 bits of NVIC prio, one level reserved by the kernel)

The current macro that gets priority level value from devicetree apply
same value from cortex-m4 on cortex-m0+.  This add missing indirection
to get from intmux node the correct cortex-m0+ priority level value.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-11 19:45:44 -04:00
Scott Worley
19dd46ef68 Microchip: MEC172x: ADC driver
Add ADC driver version 2 for MEC172x using new in-tree headers
and device tree properties. Update the ADC shell for the new driver.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-08-11 19:44:31 -04:00
Scott Worley
ad19104f28 Microchip: MEC172x: Add UART driver
Microchip XEC has been using the standard NS16550 driver.
Using the standard NS16550 driver requires extra HW programming
for XEC UART in board level and did not support XEC GIRQ interrupt
programming. We add an XEC specific driver and remove UART specific
register programming from the board level and implement interrupt
support. Also, by implementing a SoC specific driver we can add
driver PM in the future.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-08-09 16:21:33 -04:00
Carles Cufi
56ec755aeb soc: ti: Use dynamic interrupts in hal_ti
Pull a new revision of the hal_ti module that uses dynamic interrupts
instead of build-time ones.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-08-09 13:04:28 -04:00
HaiLong Yang
9a80196e28 soc: arm: st_stm32: update HSEM ID for stm32 hsem ipm
New hardware semaphore ID for inter-processor mailbox

Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
2021-08-09 16:11:28 +02:00
Mulin Chao
3cfdf3e81e soc: arm: rename soc/arm/nuvoton as soc/arm/nuvoton_numicro
We try to reduce the ambiguity between 'soc/nuvoton/' and
'soc/nuvoton_npcx' folders. Most if soc vendors name their soc folder by
the company name with SOC_FAMILY suffix instead of the company name
directly. It is clearer if the soc company has different product lines
that aim to specific markets.

In this CL, the 'numicro' suffix is used for Nuvoton Microcontroller
production line. It distinguishes the 'npcx' suffix that used for
Nuvoton Embedded Controller (EC) of Notebook PC product line.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-08-07 20:37:24 -04:00
David Leach
569a1a0a5d soc: arm: nxp_imx: rt: Configure settings for TRNG IP
RT platforms that support TRNG IP (rt10xx and rt6xx) need to set
RNG and CSRNG to Xoroshiro and CTR_DRBG respectively instead of
using TRNG as random source.

Fixes: #37307

Signed-off-by: David Leach <david.leach@nxp.com>
2021-08-06 20:29:59 -04:00
Jordan Yates
fdeaa9103e random: deprecate XOROSHIRO_RANDOM_GENERATOR
Deprecate the xoroshiro128+ PRNG algorithm in favour of xoshiro128++.
xoshiro128++ is a drop-in replacement which is invisible from the user
perspective.

xoroshiro128+ is unsuitable because it is explicitly a floating-point
PRNG, not a general-purpose PRNG. This means that the lower 4 bits of
the output are actually linear, not random (from the designers,
https://prng.di.unimi.it/). This means 1/8th of the generated data is
not random.

Additionally, xoroshiro128+ is not a 32bit algorithm, it operates on
64bit numbers. For the vast majority of Zephyr devices, this makes the
PRNG slower than it needs to be. The replacement (xoshiro128++) is
32bit, with no loss in state space (still 128 bit).

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-05 11:24:44 +02:00
Scott Worley
2070c0997f Microchip: MEC172x: Update pinmux driver
Update the Microchip XEC pinmux driver to use system I/O
routine for read/write of registers instead of direct use
of volatile and CMSIS defines. Add GPIO port number to
bindings instead of using hard coded value from chip headers.
Modify SoC DTSI pinmux syntax, requires "pinmux: pinumx {..."
or the DT macros will not work. Since pinmux is used by MEC152x
we update its chip pinmux DT.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-08-03 19:04:56 -04:00
Johann Fischer
6e1e2fba82 soc: replace USB configuration option with USB_DEVICE_DRIVER
Replace USB configuration option with USB_DEVICE_DRIVER
since on the SoC level the specific driver is selected.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Jun Lin
c3cde54303 soc: npcx: scfg: add a new function to select the host interface type
The host interface type (eSPI/SHI) is selected via HIF_TYP_SEL field in
DEVCNT register. This commit adds a function to set it.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2021-08-03 13:59:42 +02:00
Jun Lin
b804956a7d dts: misc: npcx: add new DT node for booter variant
The booter (bootloader) behavior may be different in different NPCX
chip series. One example is that the booter sets host interface type in
NPCX7 series but leave the firmware to set it in NPCX9 series.
This commit adds a new DT node to record variants in its properties.
NPCX drivers can understand if they need to configure the related
setting by checking the node's properties.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2021-08-03 13:59:42 +02:00
David Leach
bdd536a09e watchdog: add watchdog driver support to mimxrt685 platform
Add watchdog support to the mimxrt685 platform.

The mimxrt685 platform is excluded from the watchdog
test case because the test case uses variables in the
noinit section that need to be retained through a reset
but the rt685 does not retain this memory through a
reset.

Signed-off-by: David Leach <david.leach@nxp.com>
2021-08-02 13:21:20 -05:00
Kumar Gala
40fcb1ce9b soc: arm: nxp_imx: rt: refactor flexspi boot config
* Move definition of flexspi_nor_config_t into soc/ dir so it can
  be shared by all i.MX RT based boards.
* Use Kconfig symbol CONFIG_NXP_IMX_RT_BOOT_HEADER instead of
  HAL define (which is set based on the Kconfig symbol)
* Rename board files to flexspi_nor_config.c since they
  are already namespaced by the board dir.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-08-02 12:59:57 -05:00
Gerson Fernando Budke
c9879a58f7 dts: atmel_sam0: Add pinctrl structure
Add Atmel sam0 MCU series pinctrl devicetree bindings and
infrastructure.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-07-30 14:37:20 -05:00
Gerson Fernando Budke
6de5f4d729 soc: atmel_sam0: common: Add soc_port
Introduce soc_port common functions.  The sam0 pinmux driver was
refactored to use soc_port_pinmux_set common function.

This create the common base to implement sam0 pinctrl functions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-07-30 14:37:20 -05:00
Mahesh Mahadevan
18f6718c30 soc: RT600: Add PWM support
Add PWM support for RT600

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-07-30 13:08:03 -05:00
Alexandre Bourdiol
e3e2eb0fbe soc: arm: stm32l0: enable clock before accessing DBGMCU registers
Some STM32 series (l0, g0, f0) needs to enable clock of
DBGMCU peripheral, before accessing registers

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-07-30 07:06:03 -04:00
Erwan Gouriou
96b179663e soc/arm: st_stm32: Add stm32u5 SoC series
Add minimal support for STM32U5 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-07-29 07:28:32 -05:00
Ioannis Glaropoulos
d3e1cb2b01 soc: arm: lpc: move platform init implementation in the main tree
Move the implementation of z_platform_init from the NXP Hal
into the main Zephyr tree. This function is Zephyr-specific,
is part of the Zephyr module glue code, and does not need to
reside in the module repository. We also rename the function
to z_arm_platform_init. The commit does not introduce any
behavioral changes.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 21:08:18 -04:00
Ioannis Glaropoulos
1706b4dfaa arm: rename z_platform_init to z_arm_platform_init
Platform specific initialization during early boot
has been a feature supported only by Cortex-M; the
Kconfig symbol is defined in arch/arm Kconfig space.
We rename the z_platform_init() function to
z_arm_platform_init(), to indicate more clearly that
this is an internal, private ARM-only API.

This commit does not introduce behavioral changes.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 21:08:18 -04:00
Scott Worley
6976800cf0 Microchip: MEC172x GPIO driver version 2
Create version 2 of the MEC GPIO driver to support MEC172x to not
interfere with MEC152x. When the MEC172x ECIA interrupt aggregator
driver is ready, this driver will use ECIA for registering GPIO
interrupt callbacks instead of maintaining its own interrupt table.
Add V2 DT binding.
Add the Kconfig configuration settings for the MEC172x GPIO
V2 driver at the SoC and board level.
Add port id to DT allowing use of DT FOR EACH macro in the driver.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-27 18:01:55 -04:00
Scott Worley
dd1a9559be Microchip: XEC RTOS timer: Add MEC172x support to driver
Update Microchip XEC RTOS timer driver adding MEC172x support and
using more device tree properities in the driver. We must also update
the XEC counter driver to use the new GIRQ DT properties.
Add new properties to RTOS timer and RTC timer YAML. These two timers
are linked due to option using a high speed timer for kernel busy wait.
Add Kconfig logic for XEC RTOS timer to MEC172x SoC.
Enable the Microchip XEC RTOS timer in the MEC172x evaluation board.
Add device tree nodes for most peripeherals.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-27 09:29:34 -04:00
Erwan Gouriou
acba0cd55a soc/arm: power: Leftover from pm hooks conversion to __weak
In commit "pm: Fix weak linkage symbols" (PR #35274),
PM SoC hooks were converted to __weak to avoid clash with
new definition of these symbols in subsys/pm/power.c.

In this process, few SoCs were missed.
Fix this.

#37226

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-07-27 07:18:05 -04:00
Jun Lin
c51a4ecd42 driver: eSPI: unify the bit fields of ACPI/KBC event data
The KBC/ACPI event data is 4-byte in width and composed of
event/data/type fields. However, the field position is defined by each
chip vendor via macro and not unified in the current implementation.
The commit uses the structure bit field to define and unify the field
position. It helps the application access it with a common approach.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2021-07-26 22:50:44 -04:00
Mulin Chao
68bda35b32 driver: pmc: npcx: replace pmc offset macros with inline functions.
This CL replaces offset macros of pmc 'multi-registers' such as
PWDWN_CTLn with internal inline functions for better readability.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-07-26 19:26:52 -04:00
Mulin Chao
66dc1482e7 driver: scfg: npcx: replace scfg offset macros with inline functions.
This CL replaces offset macros of scfg 'multi-registers' such as DEVALTn
and LV_GPIO_CTLn with internal inline functions for better readability.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-07-26 19:26:52 -04:00
Scott Worley
6b3749d2ff Microchip: MEC172x Add aggregated interrupt driver
Add driver implementation and header files for a MEC172x
aggregated interrupt driver. Enable the parent(ECIA) node
to have the driver initialize interrupt hardware for use.
Enable child nodes for those GIRQs used for aggregation.
Refer to chip documention for the list of GIRQs restricted
to aggregation and those which support direct mode.
Add chip level device tree node for MEC172x EC interrupt
aggregator parent and GIRQ children. Each child node contains
a list of sources representing the source bit position in the
GIRQ registers.
Add DT bindings for ECIA and GIRQ nodes.
Add build file(s) and configuration items for the MEC172x ECIA
aggregated interrupt driver. Add and enable the MEC172x interrupt
driver on the MEC172x evaluation board(EVB). Enable parent node to
initialize ECIA hardware. Child nodes are left disabled until a
future driver needs them.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-26 12:24:52 -04:00
Flavio Ceolin
d45a0e1919 pm: Fix weak linkage symbols
Define SoC hooks as weak symbols so this way applications can
overwritten them defining strong symbols.

The problem is that currently SoCs are defining these interfaces as
strong symbol inhibiting the possibility of applications bring their
own implementation.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-07-26 04:31:54 -04:00
Yuval Peress
eadca02251 espi: npcx: Add missing includes to header
Add the missing includes to make the header more portable. It currently
requires other headers to be included before it.

Signed-off-by: Yuval Peress <peress@chromium.org>
2021-07-23 16:26:44 -04:00
Scott Worley
d3f6b54f8e Microchip: MEC172x clock control driver
Implement a clock control driver for Microchip MEC172x handling
configuring the 32 KHz input sources for the PLL and peripheral-32k
clock domains. MEC172x differs from MEC152x. MEC152x had one 32K source
for both PLL and peripherals. MEC172x allows the two domains to use
independent 32 KHz sources. Device tree updated to provide addresses
of hardware used by the driver.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-21 17:46:07 -04:00
David Leach
590a53f662 dts: rt600: Add TRNG support
Add RT6xx TRNG support to enable the entropy driver.

Signed-off-by: David Leach <david.leach@nxp.com>
2021-07-21 17:32:09 -04:00
Flavio Ceolin
65e4add74e soc: cc13x2: Use residency policy
cc13x2_cc26x2 had its own power policy that was implementing the same
logic available in the default residency policy. Also, this policy was
unnecessarily setting up a timeout to wakeup the system. This is not
necessary, the power subsystem takes care of this.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-07-21 17:54:40 +03:00
Alexandre Bourdiol
17d978803b soc: arm: stm32wb power: implement HSEM for power management
Implementation of hardware semaphore algorithm of STM32 AN5289
to enter and exit low power

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-07-21 05:37:48 -04:00
Scott Worley
7872cdec76 Microchip: MEC172x add header set 8
Add MEC172x chip specific headers for Port 80h debug
capture, quad SPI, and VBAT registers. Update due to
merges.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-20 20:05:12 -04:00
Scott Worley
f465cc2cba Microchip: MEC172x Add header set 7
Add MEC172x chip specific header set 7: GPIO and I2C.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-20 20:05:12 -04:00
Scott Worley
a9871a89b2 Microchip: MEC172x add header set 6
Add MEC172x chip specific headers (eSPI).
Update due to previous header PR merges.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-20 23:18:17 +03:00
Crist Xu
04ab2400e6 driver: adc: an adc driver for rt1170
reuse the lpc's lpadc driver for rt1170, modify the dts and add
some macro to shield some code of LPC series. Also add the
board support inside the tests/drivers/adc/adc_api/src/test_adc.c,
and a dts node:zephyr,user inside
samples/drivers/adc/boards/mimxrt1170_evk_cm7.overlay

Signed-off-by: Crist Xu <crist.xu@nxp.com>
2021-07-20 13:15:58 -05:00
Scott Worley
55f4c269c1 Microchip: MEC172x Add header set 5
Add Microchip MEC172x header set 5 chip specific
peripheral headers. Update with recent merged code.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-20 16:54:12 +03:00
Scott Worley
3f3bfe9859 Microchip: MEC172x Add header set 4
Add last common set of headers.
Update for previous merge.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-20 10:05:43 +03:00
Scott Worley
3c39dd0811 Microchip: MEC172x Add header set 3
Add third set of MEC172x common headers.
Update for merged board.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-20 10:05:27 +03:00
Scott Worley
71ba3136ea Microchip: MEC172x add header set 2
Add second group of common headers for MEC172x.
Update with merged MEC172x changes.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-20 10:05:10 +03:00
Scott Worley
d4e382ee05 Microchip: MEC172x Add first set of headers
Consensus was reached to locate Microchip MEC172x header files
in the zephyr MEC172x SoC folders. These are the first set of
headers specific to MEC172x and common to the MEC family. Hardware
register structures will be located in peripheral specific headers.
Update based on latest merge of MEC172x related files.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-20 10:04:53 +03:00
Even Falch-Larsen
b8820da4e6 soc: stm32: stm32l051
Adding support for the stm32l051 devices.

Signed-off-by: Even Falch-Larsen <even.falch.larsen@nomono.co>
Co-authored-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-07-19 15:04:08 -05:00
Scott Worley
5b5396f7b6 Microchip: MEC172x add board and update for minimal build
Added minimal device tree and board files to build Microchip
MEC172x. SOC layer stripped down to allow build for checking
compilation only.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-19 21:07:31 +03:00
Bernhard Krämer
e138b443b1 soc: arm: nxp_imx: rt: add new part number
MIMXRT1062DVJ6A

Signed-off-by: Bernhard Krämer <bdkrae@gmail.com>
2021-07-19 12:15:42 -05:00
Piotr Mienkowski
cdb6bfff1e soc: same70, samv71: free TRACESWO pin when unused
Pin PB5 is part of ARM Cortex-M debug interface and by default
configured to output TDO/TRACESWO signal. Disable TDO/TRACESWO
function on PB5 pin when LOG_BACKEND_SWO is not enabled. This
ultimately frees the pin to be used by standard SoC peripherals.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-07-17 08:09:08 -04:00
Wealian Liao
3964ae1895 soc: npcx: Improve npcx header Kconfig
This commit includes the following:
1. Add symbol for choice option. So we can override the default value
   by an earlier definition.
2. NPCX9 doesn't support 33MHz SPI clock in the header. So disable the
   option for NPCX9.
3. NPCX9 support 512K flash. Change default to 512k for NPCX9.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-07-16 18:59:12 -04:00
Mahesh Mahadevan
db162bb05d counter: Add counter support for rt600
Add counter support using the RTC for RT600

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-07-16 18:56:15 -04:00
Carlo Caione
f4db14f349 dts: Introduce DT_STRING_TOKEN and DT_STRING_UPPER_TOKEN
To be able to get a tokenize DT string without the quotes. Deprecate
also DT_ENUM_TOKEN and DT_ENUM_UPPER_TOKEN.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-07-15 18:12:51 -05:00
Alexandre Bourdiol
cd881e0562 soc: arm: stm32l1: set voltage scaling to range1
Default Voltage scaling range selection (range2)
doesn't allow to configure Max frequency
switch to range1 to match any frequency

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-07-15 10:13:27 +03:00
Alexandre Bourdiol
3103fc8c38 soc: arm: stm32l0: set voltage scaling to range1
Default Voltage scaling range selection (range2)
doesn't allow to configure Max frequency
switch to range1 to match any frequency

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-07-15 10:13:27 +03:00
Henrik Brix Andersen
316cb25db4 soc: arm: nxp: kinetis: ke1xf: add support for power management
Add power management support (runtime-idle and suspend-to-idle)
support for the NXP Kinetis KE1xf SoC series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen
7436432f2e soc: arm: nxp: kinetis: ke1xf: enable lptmr as timer
Enable the NXP Kinetis Low Power Timer (LPTMR) OS timer driver when
power management is enabled as the Arm SysTick timer cannot wake up the
KE1xF from deep sleep.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen
937c2c8dfd soc: arm: nxp: kinetis: ke1xf: keep the sirc running in low-power mode
Keep the Slow Internal Reference Clock (SIRC) running in low-power
mode.

This allows peripherals that needs to remain operative in low-power
mode to use the SIRC as clock source.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen
5fcb13aea3 soc: arm: nxp: kinetis: ke1xf: determine hw clock cycles/sec from dts
Determine the default CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC from devicetree
when using the Arm SysTick hardware timer.

When the NXP KE1xF SoC series is using the Arm SysTick as hardware
timer, the cycles/second will always be equal to the CPU core clock
frequency.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Maureen Helm
ae056a7300 soc: boards: Enable Segger RTT/SystemView on mimxrt1170_evk_cm7
Adds a devicetree chosen node to the mimxrt1170_evk_cm7 board to link
Segger RTT and SystemView sections in DTCM by default. Enables the AHB
clock while the CM7 is sleeping to allow debug access to the TCM.

Note that automatic RTT control block detection may not search the DTCM
address region, therefore you may need to manually set the RTT control
block address or search range in the Segger host tools (SystemView or
RTT Viewer). For example,

$ JLinkRTTViewer -ra 0x20000000

Tested with:
  - samples/subsys/shell/shell_module/
  - samples/subsys/tracing/

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-07-14 13:22:24 -04:00
Gerson Fernando Budke
0ff3616bdf drivers: usb: device: Rename usb_dc_sam to usb_dc_sam_usbhs
The SoC driver name is 'USB High-Speed Interface (USBHS)'. This rename
from usb_dc_sam to usb_dc_sam_usbhs allowing add others SoC drivers
like 'USB Device Port (UDP)' that is found at SAM4S/E variations.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-07-14 07:23:38 -04:00
Thomas Stranger
63478aba48 soc/arm: add support for stm32g0 socs with (hw aes and) rng support
This commit introduces g041, g061, g081, and g0c1 socs in kconfig.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-13 09:37:48 -04:00
Thomas Stranger
e804f5a5c6 soc/arm: add support for additonal stm32wl socs
This commit adds support for stm32wle4xx, stm32wle5xx single core socs,
as well as stm32wl54 dual core soc.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-13 09:37:29 -04:00
Maureen Helm
fbaaca188b soc: boards: Disable i.MX RT6xx boot header in chainloaded applications
The bootloader itself contains the i.MX RT6xx boot header, so we don't
need to duplicate it when building chainloaded applications.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-07-13 09:35:38 -04:00
Maureen Helm
0082a1a6e5 soc: boards: arm: Refactor i.MX RT600 zephyr,flash usage
Refactors the i.MX RT600 SoC series to be more consistent with the i.MX
RT10xx SoC series by choosing a child node (external flash device) of
the FlexSPI bus for zephyr,flash.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-07-13 09:35:38 -04:00
Crist Xu
5b44d5f721 driver: flexcan: flexcan support for the rt1170
add the flexcan3 support for the rt1170

Signed-off-by: Crist Xu <crist.xu@nxp.com>
2021-07-12 16:05:34 -05:00
Jun Lin
1974ea97a4 driver: clock: npcx: add a option to generate LFCLK via XTSOC
This commit adds a new Kconfig option CLOCK_CONTROL_NPCX_EXTERNAL_SRC.
With this option enabled, the internal 32.768 KHz clock (LFCLK) is
generated by the on-chip Crystal Oscillator (XTOSC). Otherwise, the
LFCLK is generated by the Low-Frequency Clock Generator (LFCG).

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2021-07-12 23:34:42 +03:00
Wealian Liao
bbd5b259e5 soc: npcx: Add soc log register
NPCX power.c use LOG_MODULE_DECLARE(soc), but NPCX chip doesn't
register soc log module. This CL register soc log in soc.c to fix NPCX
build error for power management & log system.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-07-12 22:49:18 +03:00
Henrik Brix Andersen
493c909a33 soc: arm: nxp: kinetis: kwx: indicate presence of RCM
Indicate presenence of the Reset Control Module on the NXP KWx SoC
series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-08 09:33:32 -05:00
Henrik Brix Andersen
d16d34b152 soc: arm: nxp: kinetis: kv5x: indicate presence of RCM
Indicate presenence of the Reset Control Module on the NXP KV5x SoC
series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-08 09:33:32 -05:00
Henrik Brix Andersen
6b811443d4 soc: arm: nxp: kinetis: kl2x: indicate presence of RCM
Indicate presenence of the Reset Control Module on the NXP KL2x SoC
series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-08 09:33:32 -05:00
Henrik Brix Andersen
01f62a08f3 soc: arm: nxp: kinetis: k8x: indicate presence of RCM
Indicate presenence of the Reset Control Module on the NXP K8x SoC
series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-08 09:33:32 -05:00
Henrik Brix Andersen
f6a84125b6 soc: arm: nxp: kinetis: k2x: indicate presence of RCM
Indicate presenence of the Reset Control Module on the NXP K2x SoC
series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-08 09:33:32 -05:00
Henrik Brix Andersen
3d20888359 soc: arm: nxp: kinetis: ke1xf: indicate presence of RCM
Indicate presenence of the Reset Control Module on the NXP KE1xF SoC
series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-08 09:33:32 -05:00
Henrik Brix Andersen
e22ce47c4f soc: arm: nxp: kinetis: k6x: indicate presence of RCM
Indicate presenence of the Reset Control Module on the NXP K6x SoC
series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-08 09:33:32 -05:00
Crist Xu
c21bfdca9c driver: gpt: the gpt driver for the rt1170
reuse the gpt driver for the rt10xx, and add the related code

Signed-off-by: Crist Xu <crist.xu@nxp.com>
2021-07-07 20:59:42 -04:00
Maureen Helm
b2b38903a7 soc: arm: nxp_imx: Link Segger RTT/SystemView sections in DTCM if chosen
Configures Segger RTT and SystemView data linker sections to DTCM by
default on i.MX RT SoCs if there is a zephyr,dtcm chosen node in
devicetree. This fixes a build warning in
samples/subsys/shell/shell_module for the mimxrt1170_evk_cm7 and
mimxrt1170_evk_cm4 platforms, which don't currently have a zephyr,dtcm
chosen node.

Note that there are runtime issues with Segger RTT and SystemView on
this board that need further debug, but submitting this patch now to
address nightly CI failures.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-07-07 14:30:14 -04:00
Pavlo Hamov
6a1416d0c2 soc: arm: cc32xx: Override Reboot implementation
Support cold, hot reboots. Cold will reboot all periherals

Signed-off-by: Pavlo Hamov <pasha.gamov@gmail.com>
2021-07-06 15:22:39 -05:00
Fabio Baltieri
2fc87f961b soc: stm32wl: add power management support
This adds power management support for the STM32WL series.

Suspend-to-idle is mapped to the three stop states (wake up from any
EXTI, including LPTIM), and soft-off can trigger either standby or
shutdown (wake up in reset).

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-07-06 09:51:22 -04:00
Gerson Fernando Budke
ac8570f7c8 soc: arm: cypress: psoc6: Enable Cortex-M4
Configure Cortex-M0+ to start Cortex-M4 CPU.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-07-02 22:50:29 -04:00
Jun Lin
ba39c47187 driver: PS/2: npcx: add driver support for Nuvoton npcx family
The PS/2 module in npcx provides a hardware accelerator mechanism
including an 8-bit shift register, a state machine, and control logic
that handle both the incoming and outgoing data. The hardware
accelerator mechanism is shared by 4 PS/2 channels. To support it,
this CL separates the PS/2 driver into channel and controller drivers.
The controller driver is in charge of the PS/2 transaction. The channel
driver is in charge of the connection between the Zehpyr PS/2 API
interface and controller driver.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2021-07-02 15:41:28 -04:00
Krishna Mohan Dani
4e53248ffa asserts: stm32: Adding asserts
This commit adds the asserts symbol in Kconfig to enable/disable
asserts functionality for stm32 series. These would be used in
stm32cube hal & ll drivers.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-07-02 13:33:04 -04:00
Scott Worley
174707b7e7 soc: Microchip: MEC172x initial submission
This is a work in progress initial submission for the
Microchip MEC172x family SoC. This submission does
not contain all header files or power management.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-07-01 13:34:06 -04:00
Benedikt Schmidt
08a39c37dd boards: arm: add STM32H735G discovery kit
Add the STM32H735G discovery kit to the available boards.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2021-07-01 08:49:26 -05:00
Ryan QIAN
431345ae79 soc: arm: nxp_imx: add rt117x support
1. Added RT10xx and RT11xx configs
2. Added a new soc file for rt117x. There are clock differences
   between the RT10xx and RT11xx series, hence the soc files
   have been separated.

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2021-06-29 11:30:00 -04:00
Alexandre Bourdiol
684082b5b2 soc: arm: stm32l5: enable ICACHE
Enable Instruction Cache
Warning: no flash driver yet available for STM32l5
But cache coherency management (cache invalidate)
will be rerquired when implementing flash driver.
ICAHE must be disabled for any flash write opeartion.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-06-28 14:17:40 -04:00
Alexandre Bourdiol
1335228f58 soc: arm: stm32h7: enable ART flash cache accelerator
Enable Instruction cache accelerator for Cortex M4
first 1MB of Flash.
As per Reference Manual: no need for cache coherency management

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-06-28 14:17:40 -04:00
Alexandre Bourdiol
195a1383a4 soc: arm: stm32f7: enable ART flash cache accelerator
Enable Instruction cache accelerator.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-06-28 14:17:40 -04:00
Alexandre Bourdiol
5f72884ce5 soc: arm: stm32f4: enable ART flash cache accelerator
Enable Instruction cache and Data cache.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-06-28 14:17:40 -04:00
Fabio Baltieri
c08f3751bd soc: stm32wl: enable instruction and data cache
Enable instruction and data cache using the corresponding HAL functions.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-06-28 12:35:41 -04:00
Fabio Baltieri
3af832868c drivers: npcx: convert NPCX drivers clock client to DEVICE_DT_GET
Convert the various device_get_binding() calls used to get the device
clock node to use DEVICE_DT_GET. The latter is processed at link time,
so it should be a bit more efficient.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-06-27 23:02:39 -04:00
Fabio Baltieri
13facbefad soc: stm32l0: add power management support
Add power management support to STM32L0 series.

The SoC have a single stop state that can be used with LPTIM as a system
timer, as well as a standby mode where the system resets on exit.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-06-24 21:06:25 -04:00
Øyvind Rønningstad
ff5736d662 soc: nordic_nrf: Add HAS_HW_NRF_KMU config
Indicating whether a SOC has the nRF Key Management Unit peripheral.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-06-23 12:48:12 +02:00
Wealian Liao
b4faf7fe63 driver: uart: npcx: Fix CR_SIN interrupt storm
NPCX WIMU CR_SIN is used to wake up soc from NPCX sleep power state.
The wake-up IRQ enabled when UART init. It causes the wake-up IRQ to
generate many extra interrupt events, which causes the system too busy
to handle other events. This PR moves the UART wake-up IRQ enabling
from UART init to npcx_power_enter_system_sleep() to avoid the
interrupt storm.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-06-22 20:31:09 -04:00
Piotr Mienkowski
471d5ea474 soc: atmel_sam: set SYS_CLOCK_HW_CYCLES_PER_SEC from DT
Set the defalut value of SYS_CLOCK_HW_CYCLES_PER_SEC Kconfig option
from the Device Tree. The `clock-frequency` property of the DT cpu@0
node is a single source of truth defining the CPU frequency. This is
the value used e.g. by all Atmel drivers.

For Atmel SAM family CPU clock is currently the only supported system
clock source. Ensure that kernel understanding of the hardware clock
frequency is the correct one.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-06-22 17:30:15 -04:00
Ioannis Glaropoulos
8deb775736 soc: arm: mps2_an521: have separate configs for the 2 cores of AN521
MPS2 AN521 is a dual (Cortex-M33) core where the two cores
have different capabilities. E.g CPU0 implements TrustZone-M,
while CPU1 implements the FPU. Therefore we introcude separate
Kconfig symbols for the two SoC variants, and use these to
select the different Cortex-M capabilities. We also update
the definitions of __MPU/FPU/SAU/DSP variant in soc.h to make
them get the value from the Kconfig settings, directly.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-22 08:45:41 -04:00
Mulin Chao
fbf5b8e8de dts: pcc: npcx: add properties of pcc node to configure clock settings
This CL introduces six properties, clock-frequency, core-prescaler,
apb1/2/3/4-prescaler in pcc (Power and Clock Controller) node to
configure clock settings. It also removed the original Kconfig options
used for the same purpose.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-06-21 18:47:31 -04:00
Mulin Chao
009388a321 soc: npcx: rename OSC_CLK as OFMCLK
Rename OSC_CLK as OFMCLK to meet npcx datasheet. The Oscillator
Frequency Multiplier Clock (OFMCLK), which is derived from
High-Frequency Clock Generator (HFCG), is the source clock of cortex-m4
core and most of NPCX hardware modules.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-06-21 18:47:31 -04:00
Ioannis Glaropoulos
9fe8a207b5 soc: arm: nrf: ensure z_platform_init does not use stack memory
We should gurantee that we do not use SRAM during Zephyr early
boot, until SystemInit has returned. This commit aims to ensure
that SystemInit will be branched to, without first pushing args
to stack, even when no optimizations are selected. We chose to
define z_platform_init in assembly directly (instead of using
inline assembly) as it appears to be a cleaner design.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-21 17:35:30 +02:00
Ioannis Glaropoulos
faad3223ec soc: nrf: move z_platform_init to a common directory
Use a common implementation for z_platform_init
in nRF SoC family. The implementations are
identical, so no need to maintain separate
identical versions of them. The commit does not
introduce behavioral changes.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-21 17:35:30 +02:00
Kumar Gala
7e52ee7fe1 drivers: pwm: Fix compile issues with Atmel SAM PWM driver
The was a missing comma in the DEVICE_DT_INST_DEFINE macro and the
SAME71 HAL tweaks the name of a struct so we have to work around that.

Fixes #36095

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-18 11:22:27 +02:00
Krishna Mohan Dani
5d8a9206b8 soc: arm: stm32f2: enable ART flash cache accelerator
This commit enables Instruction cache and Data cache.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-06-17 12:40:39 +02:00
Andrzej Głąbek
d6949b75a7 soc: nrf53: Fix configuration of HFXO capacitance
This is a follow-up to commit 60d9988401.

Add a third option for the HFXO capacitance that keeps the default
value of the XOSC32MCAPS register untouched. The message in the above
commit incorrectly claimed that external load capacitors for HFXO
(the reset value of the XOSC32MCAPS register) was the configuration
in effect before. In fact, the register value was modified during
the device trimming in the SystemInit() function to use the internal
capacitors, and that is the configuration required for proper RADIO
operation on nRF5340 DK, for instance.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-06-17 10:29:38 +02:00
Piotr Pryga
dc25a5e455 soc: arm: nrf53: Enable support for Direction Finding HW
Enable support for Direction Finding hardware for nRF5340 SOC.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-06-16 10:40:43 +02:00
Piotr Mienkowski
aaf64e0bdf soc: atmel_sam: Add _INST to ATMEL_SAM_DT_PIN* macros
The macros are used to get the pin(s) of a given driver instance. Add
_INST prefix to match convention used by the devicetree.h. The original
macros can now be used to obtain pin(s) of an arbitrary device instance
identified by the nodelabel.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-06-14 09:50:41 -05:00
Piotr Pryga
97774e0d84 soc: arm: nrf52: Enable support for Direction Finding HW for nRF52820
Enable support for Direction Finding hardware for nRF52820 SOC.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-06-14 15:18:55 +02:00
Maureen Helm
d83bbc2f25 boards: arm: Enable arduino serial port on lpcxpresso55s69
Configures flexcomm2 to operate in USART mode and enables the associated
peripheral clock and pinmuxes. This instance is attached to the Arduino
serial header pins and can be used for Bluetooth serial HCI with a
frdm_kw41z or other BLE controller shield.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-12 08:55:31 -05:00
Maureen Helm
fecef07f74 boards: arm: Enable arduino serial port on mimxrt685_evk
Configures flexcomm4 to operate in USART mode and enables the associated
peripheral clock and pinmuxes. This instance is attached to the Arduino
serial header pins and can be used for Bluetooth serial HCI with a
frdm_kw41z or other BLE controller shield.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-12 08:55:31 -05:00
Johan Stridkvist
b3389d4a5b soc: nrf53: Tune capacitor for LFXO for nRF53 and update accuracy
Switch from using internal 6pf to internal 7pf load capacitor for LFXO.
Use a default clock accuracy of 50PPM as this matches lab results.

50PPM should be sufficient for common operating temperatures of
25degC +- 15.

Signed-off-by: Johan Stridkvist <johan.stridkvist@nordicsemi.no>
2021-06-12 08:52:00 -05:00
Wealian Liao
137bce4574 soc: npcx: Add output npcx image in hex format
To support west OpenOCD path image flashing, this generates an npcx hex
image from the npcx BIN image. Moreover, this also changes the name of
npcx output image by CONFIG_KERNEL_BIN_NAME.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-06-11 09:56:49 -04:00
Fabio Baltieri
6cbf6a50a0 soc: npcx: setup custom MPU regions for npcx7
NPCX7 variants allocate code RAM either at 0x10070000 or 0x10090000.
The MPU requires addresses and region sizes to be aligned, so the
generic cortex_m/arm_mpu_regions.c results in an ineffective setup with
the addresses above.

This adds a custom mpu_regions setup for the npcx7, which covers both
available sizes, resulting in these two possible setups:

- 192kB devices

  Code ram: 0x10090000 to 0x100bffff
MPU region: 0x10080000 to 0x100bffff (256k)

- 320kB devices

    Code ram: 0x10070000 to 0x100bffff
MPU region 0: 0x10040000 to 0x1007ffff (256k)
MPU region 1: 0x10080000 to 0x100bffff (256k)

In both cases MPU data RAM setting is from 0x200c0000 to 0x200cffff,
matching the generic Cortex-m setup.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-06-10 17:14:49 -04:00
Julien Massot
d6fd631130 soc: renesas_rcar: gen3: enable L1 cache and branch prediction
Use CMSIS abstraction to enable L1 cache and branch prediction.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
2021-06-10 17:13:21 -04:00
Andrzej Głąbek
60d9988401 soc: nrf53: Add configuration options for HFXO/LFXO load capacitance
Add Kconfig options that allow configuration of optional internal
load capacitors for the high-frequency (HFXO) and low-frequency
(LFXO) crystal oscillators in nRF5340.
Default settings used for the new options are those that have been
in effect so far, i.e. external load capacitors for HFXO and 6 pF
internal capacitance for LFXO.

This commit also adds missing SOC_ENABLE_LFXO option dependency on
!TRUSTED_EXECUTION_NONSECURE.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-06-09 13:07:12 +02:00
Mulin Chao
d2cd3ed765 soc: npcx: add support for npcx9 series in ecst.py script.
This CL adds the support for npcx9m3f and npcx9m6f chips in ecst.py
script which generates the NPCX firmware header.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-06-08 00:40:14 -04:00
Mulin Chao
a31378dec1 driver: clock: npcx: add apb4 clock support for npcx9 series.
Add apb4 clock support for npcx9 and later series.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-06-07 12:06:33 +02:00
Mulin Chao
85dcdd8e67 driver: intc: npcx: replace miwu offset macros with inline functions.
This CL replaces macros for miwu multi-registers' offset with internal
inline functions. This CL also uses soc series definitions to
distinguish the layout of miwu multi-registers between different npcx
series.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-06-07 12:06:33 +02:00
Mulin Chao
b6f9d212fb soc: npcx: add soc drivers for npcx9 series.
This CL adds the soc drivers for npcx9 series. There are two soc part
numbers, npcx9m3f and npcx9m6f, are introduced. We also move soc family
configurations from /nuvoton_npcx/npcx7/Kconfig.soc to
nuvoton_npcx/Kconfig.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-06-07 12:06:33 +02:00
Mulin Chao
358a61e83c soc: npcx: extend group field of struct npcx_alt to 8-bit
In npcx9, the number of pinmux registers (DEVALTx) is more than 16. We
need to extend the "group" member in the struct npcx_ALT to configure
the pinmux settings in npcx9.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-06-07 12:06:33 +02:00
Mulin Chao
98fcff6508 soc: common: npcx: move power.c and registers.c to common folder.
This CL moves power policy source file for all npcx series to common
folder. It also abstracts the sources for checking register structures
to common/registers.c to avoid the duplicated sources in the later npcx
series.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-06-07 12:06:33 +02:00
Mulin Chao
a8a217f22d dts: npcx: replace series-prefix 'npcx7-' with famliy-prefix 'npcx-'
This CL replaces series-prefix "npcx7-" with family-"npcx-" for npcx dts
nodes such as 'espi-vws-map' and 'miwus-int-map'. Since we plan to
introduce the npcx9 and later series, adding a new node such as
npcx9-espi-vws-map for each series is more complicated and not
necessary.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-06-04 16:14:48 -05:00
Hake Huang
c9a7ce8937 nxp: rt series eth timer clock enable
enable ethernet timer clock when enabling ptp

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-06-03 09:38:45 -05:00
Maureen Helm
5531525f17 soc: arm: Fix condition to set lpc55xxx flash wait states
Commit f5c6afeccb attempted to avoid
accessing lpc55xxx flash registers in nonsecure mode by conditionalizing
part of the SoC clock initialization routine on whether the flash driver
was enabled. This caused secure applications without the flash driver
enabled (e.g., hello_world on lpcxpresso55s69_cpu0) to not boot or show
any console output. Fix this by changing the condition to depend on
whether we are building a nonsecure image.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-01 15:41:31 -05:00
Arvin Farahmand
94e8c2eb81 Kconfig: ROM_START_OFFSET fix for samd5x
Set `ROM_START_OFFSET` for SAMD5X series to match the value
calculated in the linker file after forced alignments in
`vector_table.ld`.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-05-27 15:57:05 -05:00
Scott Worley
a10ce7561f soc: mchp: Deep sleep exit sequence update
Zephyr kernel masks interrupts before calling the SoC PM
sleep entry point. On the Cortex-Mx family this prevents
wake from peripheral interrupts. The SoC PM layer requires
interrupts to wake the SoC and must prevent the CPU from
vectoring to an interrup until PM exit. The SoC does this
by setting ARM NVIC PRIMASK to 1 and BASEPRI to 0. On
return to the kernel SoC sets PRIMASK to 0 allowing ISR's
to fire. In addition the MEC HW only clears its peripheral
sleep enables if the CPU vectors to an ISR. On wake we
clear the MEC PCR sleep control register which clears all
the peripheral sleep enables so peripherals will be active
before exiting the SoC PM layer.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-05-27 12:52:51 -04:00
Henrik Brix Andersen
eb9cf9e0dc soc: arm: nxp: kinetis: k2x: remove MPU support
Remove (disabled) MPU support for the NXP Kinetis K2x. At least the
MK22F51212, which is the only K2x supported by Zephyr so far, does not
contain an MPU.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-05-26 18:14:03 -05:00
Ioannis Glaropoulos
d105a2b76c arm: shrink names for null-pointer exception detection Kconfigs
Reduce the length of the Kconfig defines related to
null-pointed dereference detection in Cortex-M.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-26 12:30:05 -05:00
Lang Xie
7b7ed2baac soc: arm: nordic_nrf: nrf53: Fix flash page erase max time for nrf53
Increase FLASH_PAGE_ERASE_MAX_TIME_US of cpunet to be the same as the
value of cpuapp; FLASH_PAGE_ERASE_MAX_TIME_US is the execution window
duration when doing the flash operation synchronously along the radio
operations (SOC_FLASH_NRF_PARTIAL_ERASE not enabled); the previous
FLASH_PAGE_ERASE_MAX_TIME_US value of cpunet is lower than required.

Signed-off-by: Lang Xie <lang.xie@nordicsemi.no>
2021-05-26 08:30:55 -05:00
Kevin Townsend
f5c6afeccb boards: arm: lpcxpresso55s69: Disable flash access for NS
When using the LPC55S69 with TF-M, the ROM-based flash
controller is restricted to the secure processing environment
to prevent NS access to flash memory. Any access to the
flash controller will cause a secure fault, and the NS
application will halt execution.

This commit disables access to the IAP flash peripheral
when using the lpcxpresso55s69_ns target, enabling TF-M
to restrict IAP access to the secure side.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-05-25 09:05:14 -05:00
Wealian Liao
a336f7e521 soc: npcx: Move ecst to npcx common folder
NPCX series ROM code changes the chip basic setting by firmware binary
header for loading the firmware from flash to RAM. Add the following to
improve the ec firmware header setting:

- Move the ECST which generates the firmware binary header to NPCX
common folder. All the following NPCX series chips can use this.
- Add ecst setting option in Kconfig.

Signed-off-by: Yuval Peress <peress@chromium.org>
Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-05-13 22:06:33 -04:00
Mulin Chao
3bd31aefae pm: npcx: consider host wake-up features only if espi is selected.
This CL limits the compiler to consider the eSPI/LPC host wake-up
functions, such as npcx_host_disable_access_interrupt and
npcx_host_disable_access_interrupt, only if eSPI bus module is selected.
Otherwise, we will encounter compiler errors if the communication
between host and ec is via SPI, not eSPI/LPC bus.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-05-13 12:35:43 -04:00
Andrés Manelli
53d00dc29f logging: Enable SWO pin for STM32 SoCs
Set TRACE_MODE to asynchronous and enable trace output pin.
Add soc_config.c in stm32 soc direcotry.

Fixes #34342

Signed-off-by: Andrés Manelli <am@toroid.io>
2021-05-11 13:02:50 -05:00
Andrzej Głąbek
797aa8b85a soc: nrf9160: Remove incorrect indication of SWO availability
Serial Wire Output functionality is not implemented in nRF9160.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-05-11 13:00:20 -05:00
Wealian Liao
42aeaccb3e driver: clock: npcx: Add valid clock checking
NPCX clock has some limitations about the frequency range &
synchronization between core clock & other clocks. Add build assert to
check whether NPCX clock setting correct. This also fixed soc_clock.h
to consist with datasheet.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-05-07 20:52:55 -04:00
Hake Huang
0062372af1 adc: add soc config for adc
update k8x series to support edma and pit

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-07 08:23:49 -05:00
Martí Bolívar
c8e8d1d109 soc: nrf52811: add missing instance 3 check
spi1 and i2c0 share peripheral ID number 3.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-07 09:27:21 +02:00
Martí Bolívar
824f7224d5 soc: nrf52811: fix enabled instance 0 check
Similar fix to that for the 52805.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-07 09:27:21 +02:00
Martí Bolívar
8765a6b041 soc: nrf52805: fix enabled instance 0 check
UART0, TWI0, and SPI0 have different peripheral IDs (2, 3, and 4
respectively) on this SoC and therefore should not be mutually
exclusive to use.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-07 09:27:21 +02:00
Bradley Bolen
3b6707f140 arch: arm: aarch32: Use mpu headers from common aarch32 location
The mpu headers moved in order to support the Cortex-R mpu in later
commits.  Use the new locations.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2021-05-06 19:39:09 +02:00
Mahesh Mahadevan
ff398d81a4 drivers: timer: rt600: Update SYS_CLOCK_TICKS_PER_SEC
Use the default value as we were failing kernel
timer tests with the increased value

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-05-05 22:28:44 -05:00
Mahesh Mahadevan
2af7f05e57 soc: RT600: Enable code relocation
We need to relocate the power library to SRAM

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-05-05 22:28:44 -05:00
Mahesh Mahadevan
cef3912ecf soc: RT600: Add support for suspend-to-idle power state
Call SoC Deep Sleep mode

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-05-05 22:28:44 -05:00
Gerard Marull-Paretas
f61649b7ba soc: replace power/power.h with pm/pm.h
Replace old header with the new one.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00
Gerson Fernando Budke
d999531f7f drivers: spi: Add cypress PSoC-6 scb spi driver
Add Cypress PSoC-6 SCB[spi] driver.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-05-05 16:01:28 +02:00
Erwan Gouriou
785ecf0991 drivers/clock_control: stm32f1: Deal with stm32f100xx devices
According to RM0041.pdf clock tree for stm32f100xx devices is
different from both STM32F10X density and connectivity lines devices,
but is a combination of both.

Rework symbols definitions so that STM32F100xx is neither of those
and uses:
- CLOCK_STM32_PLL_MULTIPLIER as on SOC_STM32F10X_DENSITY_DEVICE
- CLOCK_STM32_PLL_PREDIV1 as on SOC_STM32F10X_CONNECTIVITY_LINE_...

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-05-04 13:02:26 -05:00
Abram Early
f791211871 soc: atmel_sam0: Add GCLK Reset
Fixes an issue with mcuboot where the SoC will freeze when the dpll is
disabled since `atmel_samd_init` was already run in the bootloader.

Signed-off-by: Abram Early <abram.early@gmail.com>
2021-05-04 14:08:50 +02:00
Mulin Chao
0d50628af9 driver: gpio: npcx: force io type as open-drain if select to 1p8v.
During configuring the low-voltage power supply of IO pads, the npcx
GPIO driver needs to set the related PORTx_OUT_TYPE bit to 1, i.e.
select to 'Open Drain IO type', also. This CL provides a mechanism that
configuring these bits via 'def-lvol-io-list' node automatically in case
the flag of gpios that have been configured to low-voltage power supply
doesn't contain GPIO_OPEN_DRAIN.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-04-30 12:38:59 -05:00
Mahesh Mahadevan
712317c2e3 drivers: i2s: Add support for I2S driver for LPC devices
This uses the API's provided by the SDK I2S driver.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-04-30 12:02:55 -05:00
Jordan Yates
a0909ac00b linker: stm32f0: move ram vector table to snippets
Move the STM32F0 specific ram vector table sections into a dedicated
linker snippet included by the new `SRAM_VECTOR_TABLE` symbol.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-04-30 15:16:02 +02:00
Jordan Yates
318ee971c5 boards: stm32f0: explicit RAM vector table control
Add a new Kconfig symbol that explicitly controls whether the vector
table should be placed in RAM. This eliminates the side effect of
`IS_BOOTLOADER` controlling vector table location. Making the condition
a positive assertion also allows the config to be used in CMakeLists
conditions (`zephyr_linker_sources_ifdef()`, etc).

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-04-30 15:16:02 +02:00
Krzysztof Chruscinski
518193f444 soc: arm: nordic: Do not use PM when no multithreading
Enable by default power managment only when multithreading is
enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-29 14:50:35 +02:00
Keith Short
64c4c74ee8 power: npcx: Fix compile error if !CONFIG_ARM_MPU
The NPCX power management code gets a compile error if CONFIG_PM is
enabled but CONFIG_ARM_MPU is disabled.

Signed-off-by: Keith Short <keithshort@google.com>
2021-04-28 10:16:40 -04:00
Mulin Chao
1cc73074d0 driver: gpio: npcx: fixed leakage current in npcx7 series.
It was found that npcx7 series' GPIOs which support low-voltage power
supply, there is an excessive power consumption if they are selected to
low-voltage mode and their input voltage is 1.8V.

To avoid this excessive power consumption, this CL suspends the
connection between IO pads and hardware instances before ec enters deep
sleep mode. Then restore them after waking up.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-04-28 07:06:41 -04:00
Gerard Marull-Paretas
d9cf132903 soc: arm: st_stm32: remove usage of device_pm_control_nop
If device PM is not implemented just use NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-27 16:28:49 -04:00
Mario Jaun
c276088567 drivers: ethernet: stm32: SRAM3 / MPU configuration
Fixes #29915.

Implements the memory layout and MPU configuration for Ethernet buffers
for STM32H7 controllers as recommended by ST. 16 KB of SRAM3 are
are reserved for this. The first 256 B are for the RX/TX descriptors and
configured as strongly ordered, shareable memory. The rest is for RX/TX
buffers and configured as non cacheable memory. This configuration is
automatically applied for H7 chips if the SRAM3 memory is enabled in the
device tree.

Signed-off-by: Mario Jaun <mario.jaun@gmail.com>
2021-04-27 14:16:35 +02:00
Erwan Gouriou
c4d3306042 soc/arm: st_stm32: Optionally Set SYS_CLOCK_HW_CYCLES_PER_SEC using dt
Optionally configure Kconfig SYS_CLOCK_HW_CYCLES_PER_SEC using
clock-frequency provided by dt if sysclk node is enabled

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-04-27 11:53:37 +02:00
Erwan Gouriou
2691541ad2 drivers/clock_controller: stm32: Prepare for dts based configuration
To allow transition to device tree based clock configuration on
stm32 targets, rework clock_control driver to use intermediate
STM32_ macros initially defined as the equivalent Kconfig macros
for now.
Propagate the change in all code using these macros.

The reason to introduce these new macros instead of configuring
Kconfig flags using dt kconfigfunctions is that we'll need
to be able to inform users that Kconfig flags are deprecated
once the whole family conversion is done, to encourage
out of tree users to adopt this new configuration scheme.

Note: For now STM32H7 series and code is excluded.
This is the same for some series specific code such as
PLL mul/div for L0/L1 and XTRE prescaler on F1 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-04-27 11:53:37 +02:00
Mulin Chao
2368aeae61 dts: pwm: npcx: add override mechanism for pwm input clock assignment.
This CL adds a override mechanism for pwm module's input clock source
assignment. If the 'clock-bus' property exists, the NPCX_DT_PROP_ENUM_OR
macro function will return an enum upper token value. Otherwise, it
expands to default value in 'clocks' property.

For example, if the users want to select LFCLK as pwm0's input clock,
ths node can be overridden by adding 'clock-bus' property with an enum
string, "NPCX_CLOCK_BUS_LFCLK".

&pwm0 {
	status = "okay";
	clock-bus = "NPCX_CLOCK_BUS_LFCLK";
};

Signed-off-by: Keith Short <keithshort@google.com>
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-04-26 21:51:24 -04:00
Guðni Már Gilbert
16c61ca424 dts: arm: st: Add SOC support for STM32G483
This commit adds SOC support for STM32G483 MCUs

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-04-26 17:40:01 +02:00
Guðni Már Gilbert
76a6320213 dts: arm: st: Add SOC support for STM32G473
This commit adds SOC support for STM32G473 MCUs

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-04-26 17:40:01 +02:00
Guðni Már Gilbert
4700d9e9cf dts: arm: st: Add SOC support for STM32G484
This commit adds SOC support for STM32G484 MCU

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-04-26 17:40:01 +02:00
Guðni Már Gilbert
5e4ff3726c dts: arm: st: Add SOC support for STM32G4A1
This commit adds SOC support for STM32G4A1 MCU

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-04-26 17:40:01 +02:00
Guðni Már Gilbert
eb03caf59d dts: arm: st: Add SOC support for STM32G441
This commit adds SOC support for STM32G441 MCU

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-04-26 17:40:01 +02:00
Guðni Már Gilbert
8871d20bad dts: arm: st: Add SOC support for STM32G491
This commit adds SOC support for STM32G491 MCU.

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-04-26 17:40:01 +02:00
Ioannis Glaropoulos
0b464dcb9c soc: nordic_nrf: move NFCT_PINS_AS_GPIOS to common nRF definitions
Kconfig symbol NFCT_PINS_AS_GPIOS may be defined for all
Nordic nRF SoCs that have the NFCT hardware, so we move
the option definition in nRF common Kconfig file. Also,
we correct the help text to reflect that nRF52 series DKs
and nRF5340 DK have different pins for NFC.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-04-26 17:21:37 +02:00
Sebastian Schwabe
98a6cbd80e soc: arm: st_stm32: stm32f0: Add support for STM32F031 and STM32F031X6
This commit adds the soc config for the STM32F031k6 and STM32F031X6.
Add the STM32F031k6 as choice to the Kconfig.soc.

Signed-off-by: Sebastian Schwabe <sebastian-schwabe@gmx.de>
2021-04-26 09:49:52 -05:00
Wealian Liao
abb94b1198 soc: power: npcx: Clear host access IRQ pending bit before enabling
NPCX host access IRQ enables before entering deep sleep. The pending
bit lets chip wake up from sleep immediately. Clear host access IRQ
pending bit before enabling.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-04-22 18:02:36 -04:00
Julien Massot
5fe3f5299d boards: arm: rcar_h3ulcb: add Timer support
Enable CMT timer that can be found on H3ULCB board.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
2021-04-22 10:38:45 +02:00
Julien Massot
dc26d6bb4a soc: arm: add Renesas rcar_gen3 series support
Most of the Renesas RCar Gen3 based SoC contains a Cortex R7
processor.
This processor has access to the same memory mapped devices than
the Cortex-A5x cores.

- CPU operates upto 800MHz
- Can use ram area from 0x40040000 to 0x42000000
- Has 512 interrupts on GIC-400 compliant with Arm GICv2

Add support for r8a77951 as first SoC of this series which is also
known as H3 ES2.0 and is present present on different boards such as
Salvator and R-Car Starter Kit(H3ulcb).

This first SoC definition is just enough to print Hello World in a
ram console.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
2021-04-22 10:38:45 +02:00
Mahesh Mahadevan
9fb4b4a8f2 soc: RT600: Switch the kernel timer to OS timer
Switch the kernel timer from SYSTICK to OS Timer

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-04-21 20:40:24 -04:00
Flavio Ceolin
ad1868369c soc: stm32l4: Register soc log
There are places using log with domain soc without this it being
registered.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-21 09:03:18 -04:00
Flavio Ceolin
b881a9f8dd soc: stm32wb: Register soc log
There are places using log with domain soc without this it being
registered.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-21 09:03:18 -04:00
Flavio Ceolin
150a61f556 soc: stm32l5: Register soc log
There are places using log with domain soc without this it being
registered.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-21 09:03:18 -04:00
Pieter De Gendt
97179c12bc soc: nxp_imx: Disable IVT/DCD when building for mcuboot
The bootloader application itself should contain the IVT/DCD
in the header, but the chainable application doesn't.

The ROM_START_OFFSET defaults to 0x400 otherwise the linker
alignment isn't taken into account.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-04-15 16:26:39 -05:00
Pieter De Gendt
add98e766a drivers: flash: Support i.MX FlexSPI NOR driver with XIP
This change allows writing to the flash while running in XIP mode,
and enables mcuboot or NVS settings to be used on i.MX RT socs.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-04-15 16:26:39 -05:00
Jordan Yates
18d3f4dc36 linker: cc13x2_cc26x2: CCFG to linker snippets
Move the TI_CCFG linker section code into a dedicated snippet in the soc
directory.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-04-15 12:25:55 +02:00
Jordan Yates
a4150c0483 linker: stm32wb: move IPC RAM definition to DT
Move the definition of the two IPC RAM blocks from `#define`'s in family
linker scripts to proper devicetree nodes. Use the devicetree nodes to
generate the memory regions.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-04-15 12:25:55 +02:00
Jennifer Williams
b003c971f6 soc: arm: cypress: fix soc_gpio missing final else in construct
The final else was missing in the if ... else if ... construct.
This commit adds a non-empty else {} to comply with coding
guideline 15.7.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-04-14 09:20:20 -04:00
Mulin Chao
c22df17be3 dts: npcx: Fixed the name of nodes in vw, miwu-wui, and miwu-int files.
Fixed the name of nodes in in espi-vw, miwu-wui, and miwu-int
device-tree node. This CL fixed missing nodes in CL d3a94fa8ab.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-04-13 13:00:19 -04:00
Kumar Gala
365145aa97 drivers: gpio: mmio32: Make GPIO_MMIO32_INIT dt aware
Change the GPIO_MMIO32_INIT to take a devicetree node since we want
to use DEVICE_DT_DEFINE.  This makes it so that code using
GPIO_DT_SPEC_GET works correctly with GPIO controllers that utilize
GPIO MMIO32.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-13 00:25:35 -05:00
Francois Ramu
5a51fe515a soc: arm: stm32g0 with USB-C PD cannot use CC1 and CC2 pins by default
With this patch, the UCPD1 _CC1 and _CC2 pins
are disabling the USB Type-C and Power Delivery Dead Battery.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-04-09 14:53:57 -04:00
Francois Ramu
9e30ab58ea soc: arm: stm32l5 with USB-C PD cannot use CC1 and CC2 pins by default
With this patch, the UCPD1 _CC1 and _CC2 pins
are disabling the USB Type-C and Power Delivery Dead Battery.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-04-09 14:53:57 -04:00
Francois Ramu
931c9dca74 soc: arm: stm32g4 with USB-C PD cannot use CC1 and CC2 pins by default
With this patch, the UCPD1 _CC1 and _CC2 pins
are disabling the USB Type-C and Power Delivery Dead Battery.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-04-09 14:53:57 -04:00
Mulin Chao
105af6f357 pm: power: npcx: add console expired mechanism.
This CL adds support for console expired mechanism. It implements the
notification to power management module that the module for console is
in use. If the interval that module doesn't receive any input message
exceeds CONFIG_SOC_POWER_CONSOLE_EXPIRED_TIMEOUT, the power management
module is allowed to enter deep sleep mode. This mechanism gives a
window in which the users can organize console input.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-04-09 14:50:24 -04:00
Mahesh Mahadevan
82c6e3a0aa soc: Power management support for RT600
Add code for SoC level power management to support
Sleep mode

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-04-08 17:05:39 -05:00
Mulin Chao
d3a94fa8ab dts: npcx: Fixed the name of nodes in device-tree files.
Fixed the name of nodes in device-tree files by following rules:

If object is 'phandles', use underscores for object name.
If not, such as 'node' or 'property', use hyphens for object name.

This CL also applies normal style for all nodes in npcx device-tree
files.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-04-08 16:35:20 +02:00
Sun Amar
ffbf6b14ee gecko pwm: pwm description to efr32fg1 and brd4250b
Add minimal support for efr32fg1p and the brd4250b board
as an exmaple for the driver description support

Signed-off-by: Sun Amar <sun681@gmail.com>
2021-04-02 18:45:33 -04:00
Jun Lin
22c39a21c9 soc: npcx: scfg: add functions to set/get WP pin status
The Write Protect pin of the internal SPI flash can be controlled by
WP_IF bit in DEV_CTL4 register. Add functions to set/get the status of
WP pin.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Change-Id: I8a0ce131f006f919a3b38a65722d0d312314ff0a
2021-04-02 18:43:36 -04:00
Pieter De Gendt
acca3c126c mcux flexspi: move bus driver to drivers/memc
Initially the flexspi device only supported a flash driver for
external NOR flash. As the controller supports HyperBus devices,
which can be either volatile or non-volatile, the driver iss moved
to drivers/memc.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-04-02 10:36:22 -05:00
Kumar Gala
66081100c4 soc: stm32: Remove redudant zephyr_include_directories
soc/arm/st_stm32/CMakeLists.txt already has a
zephyr_include_directories(common) so including in again
soc/arm/st_stm32/common/CMakeLists.txt is redudant.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-01 20:53:58 +03:00
Henrik Brix Andersen
a865b1bb49 soc: arm: nxp: ke1xf: use clock nodes for NXP Kinetis SCG clocks
Use a combination of fixed-clock and fixed-factor-clock devicetree
nodes for describing the clock dividers/multipliers of the NXP Kinetis
System Clock Generator (SCG) present in the KE1xF SoC series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-03-31 11:56:13 -05:00
Carlo Caione
3539c2fbb3 arm/arm64: Make ARM64 a standalone architecture
Split ARM and ARM64 architectures.

Details:

- CONFIG_ARM64 is decoupled from CONFIG_ARM (not a subset anymore)
- Arch and include AArch64 files are in a dedicated directory
  (arch/arm64 and include/arch/arm64)
- AArch64 boards and SoC are moved to soc/arm64 and boards/arm64
- AArch64-specific DTS files are moved to dts/arm64
- The A72 support for the bcm_vk/viper board is moved in the
  boards/bcm_vk/viper directory

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-31 10:34:33 -05:00
Shlomi Vaknin
2b13234e9c soc: stm32h723: fix number of irqs
Increase the number of interrupts from 150 to 163.

Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
2021-03-31 08:00:22 -05:00
Guðni Már Gilbert
849eca3412 soc: arm: added support for STM32L412XX
Add Kconfig for STM32L412XX

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-03-31 08:07:10 -04:00
Wealian Liao
d3469f99e7 soc: npcx: fix warning message for psl function
The compiler shows the array bounds warning message for some boards
which don't set the PSL function.
Change npcx_pinctrl_psl_input_asserted() input parameter from int to
uint32_t to fix it.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-03-29 16:15:41 -05:00
Yestin Sun
c3fdab9ec8 soc: arm: stml32l5: entropy generator support
add entropy generator

Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
2021-03-29 13:43:20 -04:00
Francois Ramu
117796aea9 soc: arm: stm32wb low power substates
The low power states 0∕1∕2 are added to the stm32wb.
The substate-id is mapping the same Zephyr power state.
They correspond to the stm32wb low power stop0/1/2 modes.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-03-26 18:06:16 -04:00
Francois Ramu
43aa93723b soc: arm: stm32wb serie low power modes in debug config
The debug config will let the clocks active in STOP mode
at init.
The substate-id is mapping the same Zephyr power state.
Plus a minor fix in the Kconfig.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-03-26 18:06:16 -04:00
Francois Ramu
d830f2ee3d soc: arm: stm32l5 serie with low power management
The low power modes are available on the stm32l5 soc
with the mcu STOP0/1/2 modes, depending on the CONFIG_PM

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-03-26 18:06:01 -04:00
Francois Ramu
4d3fb9ffb2 soc: arm: stm32l5 is supporting PM with lptim
The low power timer of the soc is enabled when the PM is defined
for the STM32L5xx series.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-03-26 18:06:01 -04:00
Francois Ramu
fa30e879ee soc: arm: stm32l4 low power substates
The low power states 0∕1∕2 are added to the stm32l4.
The substate-id is mapping the same Zephyr power state.
They correspond to the stm32l4 low power stop0/1/2 modes.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-03-26 18:05:38 -04:00
Francois Ramu
acf671336f soc: arm: stm32l4 serie low power modes in debug config
The debug config will let the clocks active in STOP mode
at init.
Plus a minor fix in the Kconfig

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-03-26 18:05:38 -04:00
Christian Taedcke
c5a39188b9 soc: silabs_exx32: Enable creating hex file
Hex firmware file is flashed by default if JLink is used. Since all
of the SiLabs dev boards have an on-board JLink, enable generating hex
file.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-03-26 08:40:28 -04:00
Mulin Chao
53862e72f1 soc: psl: npcx: add PSL driver support.
This CL introduces the implementation of configurating PSL input pads
and setting PSL_OUT to inactive level for ultra-low power consumption.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-03-26 07:11:59 -04:00
Mulin Chao
12a30dce19 dts: psl: npcx: add PSL pads support for ultra-low-power mode.
This CL introduces the Power Switch Logic (PSL) pads which detect the
wake-up events and turn on/off core power supply (VCC1) for ultra-low
-power consumption in npcx device-tree file.

By adding PSL input-pad objects, psl_in1, psl_in2, and so on, into
'psl-in-pads' property and configuring their 'flag' properties, the
related driver will configure them via soc specific functions later.

For example, if PSL input 1 pad that is plan to detect a 'falling edge'
event, this property should be:
	vsby-psl-in-list {
		psl-in-pads = <&psl_in1>;
	};

And the flag property in psl_in1 should change to
	&psl_in1 {
		flag = <NPCX_PSL_FALLING_EDGE>;
	};

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-03-26 07:11:59 -04:00
Erwan Gouriou
dda1d7ba54 soc: stm32l5: Don't disable PWR clock in soc init.
PWR clock is required for various operations.
It is enabled by default in clock control driver,
but disabled at clock init.
It appears soc init is run after clock control driver init
and hence PWR is disabled to to this piece of code at
soc init level.
Don't disable PWR here.
(But keep PWR clock enable in case of ...).

A whole clock clean up will be required later on,
but waiting for that to happen, this is the safest we can do.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-26 10:13:28 +01:00
Flavio Ceolin
9fd4ea91b7 coccinelle: Remove extra semicolon
coccicheck --mode=patch --cocci=semicolon.cocci

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-03-25 11:35:30 -05:00
Francois Ramu
f5df09891f soc: arm: stm32l5 config the DWT for this soc
This config CPU_CORTEX_M_HAS_DWT, is to avoid the
pragma message "Null-Pointer exception detection cannot
be configured on un-mapped flash areas"

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-03-25 14:08:12 +01:00
Kumar Gala
52d15d21bc arm: mps3_an547: Add SoC support for the AN547 on MPS3
The AN547 is a Soft Macro Model implementation of the SSE-300 subsystem
with Ethos-U55 and Cortex-M55 components targeting the MPS3 board.

The SoC support is based on the AN521 MPS2+ support that already exists
in Zephyr.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-23 13:13:32 -05:00
Johann Fischer
e3e25d0a58 drivers: usdhc: fixup i.MX RT related code after driver relocation
Fixup i.MX RT related code after driver relocation.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-23 12:16:01 +01:00
Anas Nashif
771cc9705c clock: z_clock_isr -> sys_clock_isr
Do not use z_ for internal APIs, z_ is for private APIs within one
subsystem only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-19 11:22:17 -04:00
Yonatan Schachter
1d9f0e35a9 soc: silabs_exx32: Add support for EFR32FG13P SoC
This commit adds support for Silicon Labs EFR32FG13P (Flex Gecko) SoC.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2021-03-17 19:33:35 -05:00
Jun Lin
2638f2ecc4 npcx: move scfg driver from pinctrl to soc/arm/nuvoton_npcx/common
In NPCX chips, System Configuration module can configure not only
pinctrl but also misc. functionality such as glue and flash write
protection. This change moves the scfg driver from the pinctrl folder
to soc/arm/nuvoton_npcx/common and renames it to avoid confusion.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2021-03-17 18:47:32 -04:00
Mulin Chao
8c76688b5f soc: power: npcx: solve an interrupt storm caused by host access.
This CL solves an interrupt storm caused by plenty of host access
messages when system is in S0. It only turns on the host access
interrupt before ec enters sleep and turns it off after leaving
sleep.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-03-17 15:32:14 -04:00
Thomas Stranger
c743beec64 soc/arm/st_stm32: Add additional stm32g0 socs
Add soc configuration for g05x and g0bx socs.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-03-17 11:30:20 +01:00
Gerson Fernando Budke
868f722ca1 soc: arm: cypress: Add PSoC-6 pinctrl soc support
Add SoC support to enable Cypress PSoC-6 pinctrl.  This add devicetree
macros to handle pinctrl nodes and SoC GPIO methods to configure pins.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-03-16 13:36:15 -05:00
Erwan Gouriou
90d0eb7947 soc: stm32: Explicitly disable CORTEX_M_SYSTICK if LPTIM enabled
CORTEX_M_SYSTICK should be disabled if LPTIM is selected.
Current implementation is not efficient to do so.
Rework the way the dependency is stated.

Fixes #33342

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-16 10:23:33 -05:00
Krzysztof Chruscinski
cc7a324493 soc: arm: nordic: Indicate SWO presence in nrf52, nrf53 and nrf91
Add HAS_SWO to nordic SoC series.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-15 10:23:10 +01:00
Wojciech Tatarski
35dd66b6c4 drivers: gpio: add EOS S3 GPIO driver
Add GPIO driver for QuickLogic EOS S3 SoC.

Co-authored-by: Jan Kowalewski <jkowalewski@antmicro.com>

Signed-off-by: Wojciech Tatarski <wtatarski@antmicro.com>
Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
2021-03-11 08:58:20 -05:00
Erwan Gouriou
29f4574052 dts/arm: stm32: Don't disable systick
In some stm32 series systick was disabled in order to
allow alternate use of lptim timer as kernel low power ticker.
Doing this, dts based definition of CORTEX_M_SYSTICK Kconfig symbol
is disabled and CORTEX_M_SYSTICK was redefined with 'default y'
in stm32 soc files which makes things more complex to handle to
alternate with LPTIM activation.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-11 07:10:10 -06:00
Mulin Chao
0012ba5a38 driver: espi: npcx: prevent changing data content in host write func.
This CL prevents changing data content in the write function of host
interface by declaring it as constant pointer.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-03-09 10:31:05 -05:00
Kumar Gala
85aec4121b soc: atmel_sam0: Remove unused DMA macro
All users of ATMEL_SAM0_DT_INST_DMA_NAME are now using
ATMEL_SAM0_DT_INST_DMA_CTLR so we can remove the macro.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-08 18:22:27 -06:00
Kumar Gala
5c904c9f5b soc: atmel_sam0: Introduce DMA CTLR macro
Add a macro similar to ATMEL_SAM0_DT_INST_DMA_NAME but instead
provides the devicetree node back via DT_INST_DMAS_CTLR_BY_NAME

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-08 18:22:27 -06:00
Erwan Gouriou
79ea590bef soc: nrf: Enable default DWT null pointer exception detection
Default null pointer exception detection to the DWT solution
instead of MPU based solution.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-08 19:19:14 -05:00
Mikkel Jakobsen
fbfd75e19a soc: nxp: kl2x: move clk divider options to device tree
Use kinetis SIM clock divider options set in device tree
instead of hardcoded values.

The kl25z device tree did not previously define a MCG node.
This has now been added with the general "nxp,kinetis-mcg"
binding.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-03-08 12:18:33 -06:00
Mikkel Jakobsen
2e9500359f soc: nxp: k2x: move clk divider options to device tree
Use kinetis SIM clock divider options set in device tree
instead of kconfig

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-03-08 12:18:33 -06:00
Mikkel Jakobsen
f0c01561fe soc: nxp: k8x: move clk divider options to device tree
Use kinetis SIM clock divider options set in device tree
instead of kconfig

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-03-08 12:18:33 -06:00
Mikkel Jakobsen
f218bec877 soc: nxp: kv5x: move clk divider options to device tree
Use kinetis SIM clock divider options set in device tree
instead of kconfig.

The kv5x device tree originally used the undefined
"nxp,kv58-mcg" binding for the MCG node. This has been
replaced by the general "nxp,kinetis-mcg" binding.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-03-08 12:18:33 -06:00
Mikkel Jakobsen
68e8a4870d soc: nxp: kwx: move clk divider options to device tree
Use kinetis SIM clock divider options set in device tree
instead of kconfig.

Both the kw40z and kw41z device tree originally used an
undefined "nxp,kw41z-mcg" binding for the MCG node.
This has been replaced with the general "nxp,kinetis-mcg"
binding instead.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-03-08 12:18:33 -06:00
Mikkel Jakobsen
f674e82ac4 soc: nxp: k6x: move clk divider options to device tree
Use kinetis SIM clock divider options set in device tree
instead of kconfig

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-03-08 12:18:33 -06:00
Mikkel Jakobsen
1f59da40bd soc: arm: nxp: remove unused clock defines
SYSCLK_DEFAULT_IOSC_HZ and BUSCLK_DEFAULT_IOSC_HZ are
not used anywhere in the tree and can be removed

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-03-08 12:18:33 -06:00
Flavio Ceolin
98dbea0979 power: Get rid of deep sleep and sleep concepts
New power states have more granularity than deep sleep and sleep
states. Just get rid of this and keep the same behavior for now.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-03-07 07:59:53 -05:00
Raveendra Padasalagi
206f341a51 soc: arm: bcm_vk: viper: Increase default NUM_IRQS
Maximum GIC SPI is 228, so maximum INTID is 228 + 32 = 260.
So, _sw_isr_table needs to support 260 entries

Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2021-03-05 07:21:54 -06:00
Raveendra Padasalagi
8c704ea3a8 soc: viper: update registers and interrupt numbers
Update register addresses and NVIC/GIC interrupt numbers
according to the latest viper RTL version.

Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2021-03-05 07:21:54 -06:00
Carlo Caione
9d908c78fa aarch64: Rewrite reset code using C
There is no strict reason to use assembly for the reset routine. Move as
much code as possible to C code using the proper helpers.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-04 06:51:48 -05:00
Carlo Caione
a2226f5200 aarch64: Fix registers naming in cpu.h
The name for registers and bit-field in the cpu.h file is incoherent and
messy. Refactor the whole file using the proper suffixes for bits,
shifts and masks.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-04 06:51:48 -05:00
Mikkel Jakobsen
b5c09de995 soc: nxp: k2x: enable DAC driver
Enable the driver for the Kinetis Digital-to-Analog (DAC) modules
present in the NXP Kinetis K2x SoC series.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-03-02 16:27:47 -06:00
Martí Bolívar
f7aeb2ae4b soc: nrf: add more DT GPIO helper macros
Add some helper macros that will be convenient to use from device
drivers for accessing and error checking pin mux information in the
devicetree:

- NRF_DT_PSEL(): get a PSEL value out of the DT from either a
  'foo-pin' or a 'foo-gpios' style property.

- NRF_DT_PSEL_CHECK_NOT_BOTH(), NRF_DT_PSEL_CHECK_EXACTLY_ONE():
  helpers for checking that a given devicetree is OK according to
  different criteria for setting PSEL properties (NAND or XOR on
  whether the properties exist, respectively).

See comments in the patch for more details.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-01 16:59:56 +01:00
Wealian Liao
b182ec78a1 soc: npcx: add npcx7m6fc & npcx7m7fc
This adds npcx7m6fc & npcx7m7fc Kconfig. Also fix npcx7m6fb typo.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-02-24 11:02:32 -05:00
Jun Lin
c1bc357afd driver: npcx: add debug interface register structure
Add the declaration and check of debug interface register.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Change-Id: Ib8ecd53f1d6139613f39243aee83bdd75a30f5be
2021-02-23 10:32:19 -05:00
Mulin Chao
7c9d3f44f0 driver: sensor: npcx: add tachometer sensor support.
In NPCX7 series, it contains two tachometer (TACH) modules that contains
two Independent timers (counter 1 and 2). They are used to capture a
counter value when an event is detected via the external pads (TA or
TB).

The CL also includes:
— Add npcx tachometer device tree declarations.
— Zephyr sensor api implementation for tachometer.
— Enable "tach1" device in npcx7m6fb.dts for testing.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-02-22 17:56:19 -05:00
Mulin Chao
715efe25cd driver: uart: npcx: Add pm_deivce support for uart driver.
Since the uart device clock will be stopped after ec entered sleep or
deep sleep state and restore its clock automatically, there is no need
to implement code for suspending and resuming devices manually.

The driver still needs to check the current status of uart device when
it wants to change its power state to LOW or SUSPEND power state. It is
crucial to forbid ec enters sleep or deep sleep state when uart device
is busy with transmitting data. Or we will observe broken characters on
the uart console.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-02-19 22:39:53 -05:00
Mulin Chao
1f731c6c02 driver: soc: power: npcx: Add power managerment support.
This CL introduces power management driver that improves the efficiency
of ec operation by adjusting the chip’s power consumption to the level
of activity required by the application in npcx series.

The following list summarizes the main properties of the various chip
power states. Please refer the power.c file for more detail.

Main power states in npcx series include:
- Active: Core, RAM and modules operate at the clocks generated by PLL.
- Idle: Enter this state when the Core executes WFI or WFE instruction.
- Sleep: clock is stopped for most of modules but PLL is enabled.
- Deep Sleep: As Sleep mode but PLL is disabled.
- Standby: All power rails are turned off besides standby and battery
  power rails.

And this CL implements one power state, PM_STATE_SUSPEND_TO_IDLE, with
two sub-states for Zephyr power management system.
Sub-state 0 - "Deep Sleep" mode with “Instant” wake-up if residency
              time is greater or equal to 1 ms
Sub-state 1 - "Deep Sleep" mode with "Standard" wake-up if residency
              time is greater or equal to 201 ms

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-02-19 22:39:53 -05:00
Mulin Chao
e5caae8e0a driver: timer: npcx: add system kernel timer support.
This CL introduces a kernel device driver implemented by the internal
64/32-bit timers in Nuvoton NPCX series. Via these two kinds of timer,
the driver provides an standard "system clock driver" interface.

It includes:
 - A system timer based on an ITIM64 (Internal 64-bit timer) instance,
   clocked by APB2 which freq is CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC.
 - Its prescaler is set to 1 and provide the kernel cycles reading
   without handling overflow mechanism.
 - A event timer based on an ITIM32 (Internal 32-bit timer) instance,
   clocked by LCLK which frequency is 32KHz and still activated when ec
   entered "idle/deep idle" power state for better power consumption.
 - Its prescaler is set to 1 and provide timeout event mechansim.
 - Compensate system timer which clock is gating for better power
   consumption after ec left"idle/deep idle" power state.

This CL passed starve, timer_api, and timer_monotonic test suites.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-02-19 22:39:53 -05:00
Alexandre Bourdiol
0ea63a5a17 soc: arm: st_stm32: add STM32WL support
Add STM32WL soc serie

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-19 22:39:24 -05:00
Francois Ramu
f561c87023 soc: arm: stm32 devices supporting low power modes
stm32wb and stm32l4 are devices which supports the low power
from the Kernel PM, so is the PM_DEVICE defined.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu
398d52de68 soc: arm: stm32l4 give a weak low power mode devices for policy
In case the policy is not available or defined by th application
the pm_policy_low_power_devices is still valid

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu
d7fab9b0e9 soc: arm: stm32l4 low power mode restoring clocks
The clock configuration is restored by the stm32_clock_control_init
function of the clock_stm32_ll_common driver
when exiting the low power mode

Signed-off-by: Francois Ramu <francois.ramu@st.com>


Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu
930df38e23 soc: arm: stm32wb give a weak low power mode devices for policy
In case the policy is not available or defined by th application
the pm_policy_low_power_devices is still valid

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Francois Ramu
6e5eb88367 soc: arm: stm32wb low power mode restoring clocks
The clock configuration is restored by the stm32_clock_control_init
function of the clock_stm32_ll_common driver
when exiting the low power mode.
Keeping the stm32wbxx_ll_utils.h in case the PLL is used for wb.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-02-19 22:38:50 -05:00
Ioannis Glaropoulos
286757e3df soc: arm: nrf5340: remove handling for Erratum 19
Erratum 19 applies to earlier revisions of nRF5340 DK,
which are no longer supported in the tree, so we can
remove the code that handles it.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-19 15:12:28 +03:00
Ioannis Glaropoulos
ce134a7970 soc: arm: nrf5340: add QDEC capability in nRF5340 SoC definition
Add Kconfig options to signify that the nRF5340
HW has support for QDEC instances. Select the
options in the nRF5340 Application core definition.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-17 22:34:20 +03:00
Erwan Gouriou
5ba5dbc333 soc: stm32: Fix backup_sram clock enable
This driver missed #32228 PR that converted STM32 drivers
to use DEVICE_DT_GET for clock activation.
Due to the renaming of STM32_CLOCK_CONTROL_NAME to
STM32_CLOCK_CONTROL_NODE, driver could not compile anymore

Fix this.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-02-17 12:24:14 -06:00
Kumar Gala
464d82618f arm: Remove Musca-A SoC/board support
Remove support for the Musca-A board.  This board is rarely used, few
are available and superceded by Musca-B and Musca-S.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-15 21:04:23 +03:00
Kumar Gala
ba6138d13d drivers: clock_control: npcx: Convert to use DEVICE_DT_INST_DEFINE
The NPCX clock driver was already using devicetree, just need to make a
small tweak to use DEVICE_DT_INST_DEFINE and update NPCX_CLK_CTRL_NAME
to match the label for the "nuvoton,npcx-pcc" clock controller.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-15 08:33:28 -05:00
Scott Worley
2b926db4e1 drivers: espi: Microchip eSPI add SAF support
Add ESPI SAF features to the Microchip eSPI driver as
a separate file. ESPI SAF depends upon the core eSPI
driver adding the ability to attach the system SPI
flash to the EC eSPI endpoint instead of the host
eSPI controller.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-02-15 08:22:01 -05:00
Giancarlo Stasi
dd94c3054b soc: arm: stm32l4: wakeup from stop clock selection based on sysclk
When exiting Stop mode, if system clock is MSI, MSI oscillator is
selected as wakeup from stop clock; otherwise HSI16 oscillator is
selected.

Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
2021-02-15 08:19:27 -05:00
Ryan Holleran
b417bb85d2 dts: nxp_k2x: Correct and enable MCG clock controller binding
nxp_k2x.dtsi: Corrects Multipurpose Clock Generator binding
to utilize nxp,kinetis-mcg. Assign MCG to FlexTimer devices.
Enable FlexTimer clocks via System Integration Module clock
gate control registers.

Kconfig.defconfig.mk22f12: Enable default use of
CLOCK_CONTROL_MCUX_MCG when CLOCK_CONTROL is selected.

Signed-off-by: Ryan Holleran <rhollerar@gmail.com>
2021-02-15 08:14:06 -05:00
Christian Taedcke
9c24fd0a78 soc: silabs_exx32: Always enable SOC_GECKO_CORE
This is required for gecko sdk v3.1.0.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-02-15 08:11:52 -05:00
Mulin Chao
ea00ff32fe driver: intc: npcx: remove 'interrupt disable' in miwu configure func.
In this CL, npcx_miwu_interrupt_configure is no longer responsible for
turning the interrupt off. Although the default state of WK_EN is
disabled, the users still have the chance to configure them when WK_EN
is enabled via npcx_miwu_irq_enable(). Hence, this CL also ensures that
WK_EN is disabled before configuring them.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-02-15 08:11:06 -05:00
Flavio Ceolin
86a624e2a2 power: Remove PM_STATE_LOCK option
Simplify pm subsystem removing PM_STATE_LOCK option. Constraints API is
small and is a key component of power subsystem.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-02-15 08:08:36 -05:00
Bernhard Krämer
3ffb223a7f spi: Add LPSPI support for i.MX RT1062 and RT1064
This activates spi support for this soc. Closes #26428

```tests/drivers/spi/spi_loopback``` succeeded.

Signed-off-by: Bernhard Krämer <bdkrae@gmail.com>
2021-02-15 08:06:48 -05:00
Gerard Marull-Paretas
10532a5310 soc: arm: st_stm32: add support for STM32 backup SRAM
Add support for backup SRAM initialization found in multiple STM32
microcontrollers. Linker script facilities are also provided to make it
easy to define variables in the backup SRAM.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-02-15 08:04:24 -05:00
Manuel Forcén Muñoz
95c7b58330 dts: arm: st: add support for STM32F205xx SOC
STM32F205xx device tree include files added.
Tested properly in a custom board.

Signed-off-by: Manuel Forcén Muñoz <manuforcen@gmail.com>
2021-02-14 22:10:28 -05:00
Martí Bolívar
60ce0e41fd soc: nrf: fix NRF_DT_CHECK_GPIO_CTLR_IS_SOC
This was merged by mistake without being tested and is not working
properly. We need to avoid doing a BUILD_ASSERT() when the relevant
property is missing, because we can't use DT_GPIO_CTLR() on an
undefined property. Handle this with COND_CODE_1().

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-02-14 16:15:16 -05:00
Detlev Zundel
2155e19414 soc: arm: arm: Align Kconfig input prompt for Arm SoCs
According to https://www.arm.com the correct spelling is now "Arm".
Change the Kconfig input prompts to comply.

Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
2021-02-05 09:48:30 -05:00
Detlev Zundel
daf08da2f3 soc: arm: designstart: Fix Kconfig LEADING_SPACE checkpatch problem
This is a trivial patch replacing the spaces at the beginning of the
line with tabs.  Otherwise checkpatch will not be happy with any
changes in here.

Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
2021-02-05 09:48:30 -05:00
Detlev Zundel
979c748e49 soc: arm: st_stm32f2x: Convert Kconfig input prompt to uppercase
The STM32F2x was the only one of the STM32 series with a lowercase
input prompt.  This looks odd in the SoC selection in 'menuconfig'.

Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
2021-02-05 09:48:30 -05:00
Erwan Gouriou
9abff32bdc drivers/watchdog: stm32: Select watchdog using compatible
Rather than Kconfig vendor symbols, select stm32 watchdog using
compatible.
So user only has to enable the requested node and set
CONFIG_WATCHDOG=y.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-02-02 08:15:51 -05:00
Giancarlo Stasi
5b025d0d9b soc: arm: stm32l4: Fix stm32 ll header list
PM stm32 ll header list was not adequate for L4 debug builds.
Add _system.

Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
2021-02-02 07:18:16 -05:00
Mulin Chao
ddd73ca508 driver: espi: add more KBC 8042 support in npcx series.
This CL added more additional details for KBC (Keyboard and Mouse
Controller) bus in espi_event structure. It helps the application to
handle different 8042 events in the callback function.

The format of event data for KBC 8042 protocol is:
[23:16] - 8042 event type: 1: Input buf full, 2: Output buf empty.
[15:8]  - 8042 data: 8-bit 8042 data.
[0:7]   - 8042 protocol type: 0: data type, 1: command type.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-02-01 21:42:44 -05:00
Peter Bigot
e9b5be36db soc: nordic: disable system power management on nRF53 network core
The network core doesn't have access to the regulators necessary to
support system power management.  That has to be done on the
application core.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-01 15:05:03 -05:00
Peter Bigot
5d2acb30eb Revert "soc: nordic: Disable PM for SOC_NRF5340_CPUNET_QKAA"
This reverts commit f38ba314ea.

nrf5340dk_nrf5340_cpunet doesn't support power management, but that
should be handled another way.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-01 15:05:03 -05:00
Vincent Wan
66ed8d53e5 soc: cc13x2_cc26x2: add support for soft off power state
The soft off power state should be supported as it is closest to what
used to be deep sleep state 1, which corresponds to the device off
state supported by hardware.

Fixes #31727.

Signed-off-by: Vincent Wan <vanti.coder@gmail.com>
2021-01-28 08:15:55 -05:00
Scott Worley
af67564573 soc: mchp: Update 32KHz programming sequence
Based upon discussions with HW designers the 32KHz
    programming sequence can be simplified. When FW writes
    a value to the VBAT 32KHz Clock Enable register HW checks
    if the value is the same as the current value. If the same
    the HW does nothing. If different HW begins a sequence to
    switch off the current 32KHz source, revert to ring oscillator,
    and switch to the new source. FW should program the new value
    and then spin until the PCR OSC ID PLL Lock bit goes to 1.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-01-27 21:37:39 -05:00
Volodymyr Babchuk
b07065d3f3 arm: aarch64: add Xen virtual machine support
This commit adds minimal support for running zephyr as Xen guest. It
does not use xen PV console, which is somewhat hard to implement, as it
depends on xenbus infrastructure. Instead SBSA-compatible PL011 uart is
used.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
2021-01-24 13:59:55 -05:00
Andrei Gansari
6d86a6a139 soc: lpc54xxx: add memory controller definitions
Adds device tree and kconfig definitons to use legacy LPC IAP flash
driver.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2021-01-23 08:01:00 -05:00
Maureen Helm
c489cf99e2 soc: arm: Enable FlexSPI flash driver on i.MX RT family
Enables the FlexSPI flash driver on the i.MX RT SoC family and
configures the peripheral clocks accordingly. We are careful to only
configure the peripheral clocks if we are not executing in place from
the FlexSPI flash.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-01-22 11:11:54 -05:00
Maureen Helm
1883c85abd modules: nxp_imx: Add HAS_MCUX_FLEXSPI
Adds a hidden config symbol HAS_MCUX_FLEXSPI selected by NXP SoCs when
the FlexSPI peripheral is present. It will be used as a dependency for a
new FlexSPI flash driver to prevent users from accidentally enabling the
driver on platforms that don't have the necessary hardware.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-01-22 11:11:54 -05:00
Flavio Ceolin
f38ba314ea soc: nordic: Disable PM for SOC_NRF5340_CPUNET_QKAA
This targets was previously enabling PM but the code was doing nothing
because the logic was under an unsatisfied ifdef condition.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Flavio Ceolin
7f48e992e8 soc: efm32wg: Select SOC_GECKO_CORE if pm is enabled
Power management requires core interrupt handling.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Flavio Ceolin
321ce7fb77 power: Use substate-id in pm subsystem
Change subsystem to use struct pm_state with substate-id instead of
using only the power state category.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Flavio Ceolin
d21808b0b1 power: Remove residency and states from Kconfig
Residency time and power states are defined using device tree now.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Flavio Ceolin
d21cfd5f36 power: Remove power management conditionals from code
Remove conditionals (PM_DEEP_SLEEP_STATES and PM_SLEEP_STATES) from
power management code. Now these features are always available when
power management is enabled.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Flavio Ceolin
579f7049c7 power: Move pm subsystem to new power states
Migrate the whole pm subsystem to use new power states information
from power_state.h and get states and residency properties from
device tree.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Lucien Zhao
fe0e01d83f soc: arm: nxp_imx: rt: mimxrt1024: add device support
- Add soc information for RT1024

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2021-01-21 14:50:45 -05:00
Gerson Fernando Budke
f93ee9508b soc: arm: cypress: psoc6: Add Cortex-M0+ int mux support
PSoC-6 SoC needs that user define the nvic interrupt number to bind
with the peripheral interrupt line for the Cortex-M0+ CPU.  It uses
a multiplex before any NVIC interrupt line.  The interrupt vector is
selected using interrupt-parent property with the intmux_chN number
reference.

Note: The PSoC-6 SoC allows that both CPUs receive the same interrupt.
A tipical use is GPIO interrupt handle and user is responsable to
define interrupt line, priority and take care of enable same peripheral
instance on both CPUs only when appropriated.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-01-20 17:54:09 -06:00
Gerson Fernando Budke
2ad591f756 soc: arm: cypress: psoc6: Update soc.h includes
Update <soc.h> include files.  This removes the unnecessary
<kernel_includes.h> file.  In addition, add <sys/util.h> to
expose macros and <devicetree.h> following general standards.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-01-20 17:54:09 -06:00
Henrik Brix Andersen
8167134f05 drivers: pwm: add driver for the NXP Kinetis Pulse Width Timer (PWT)
Add PWM capture driver for the NXP Kinetis Pulse Width Timer (PWT).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-20 08:05:57 -06:00
Antonio Tessarolo
f4acdc2729 NXP: Enable I2C for imx6sx
This commit add support for i2c on imx6sx.
I2C support is based on imx7d and requires NXP HAL.
The Device Tree binding is also changed to better reflect that i2c
driver support both imx6sx and imx7d.

Signed-off-by: Antonio Tessarolo <anthonytexdev@gmail.com>
2021-01-18 17:01:34 -05:00
Mulin Chao
b7ec2cd5de driver: gpio: add 1p8v level detection support in npcx series.
Part of GPIO pads in npcx series support low-voltage (1.8V) level
detection. In order to introduce this feature, this CL adds a new
NPCX-specific controller property, lvol_io_pads, in devicetree file.
For example, here is devicetree fragment which turn on low-voltage
support of i2c1_0 port.

/ {
      def_lvol_io_list {
          compatible = "nuvoton,npcx-lvolctrl-def";
          lvol_io_pads = <&lvol_io90   /* I2C1_SCL0 1.8V support */
                          &lvol_io87>; /* I2C1_SDA0 1,8V support */
     };
  };

Then these pads will turn on 1.8V level detection during initialization.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-01-18 19:09:34 +01:00
Martí Bolívar
dbad2627c8 soc: nrf: add DT GPIO helper macros
Add some helper macros that will be convenient to use from device
drivers for accessing and error checking pin mux information in the
devicetree:

- NRF_DT_GPIOS_TO_PSEL(): converts a devicetree GPIO phandle
  <&gpioX pin flags> to the "PSEL style" registers found in
  nRF SoC family IPs. The conversion is done at
  build time and relies on devicetree properties.

- NRF_DT_CHECK_GPIO_CTLR_IS_SOC(): make sure a GPIO controller
  in a phandle-array property is one of the SoC GPIO controllers
  by checking its compatible is nordic,nrf-gpio.

See comments in the patch for more details.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-01-16 07:59:27 -06:00
Martí Bolívar
c8b89184f8 soc: nrf: clean up soc.h headers
Make a common header for common includes.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-01-16 07:59:27 -06:00