Commit Graph

72617 Commits

Author SHA1 Message Date
Ederson de Souza 9c55195235 drivers/mm: Only remap unused RAM on Kconfig on Intel ADSP MTL
Remapping by default can confuse things that dynamically manage RAM,
such as newlib heap - since unused memory will be powered off by
default. So this patch shields this behaviour behind a non-default
Kconfig.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-11-29 18:03:09 -05:00
Katarzyna Giądła 14358aee1c twister: get information about memory footprint from build.log
This commit calculate memory footprint from build.log and
proposes an alternative approach to #2465.

Signed-off-by: Katarzyna Giądła <katarzyna.giadla@nordicsemi.no>
2022-11-29 16:17:32 -05:00
Anas Nashif ba7d730e9b tests/samples: use integration_plaforms in more tests/samples
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-29 16:03:23 +01:00
Gerson Fernando Budke 5c773ae45e samples: drivers: counter: alarm: Add support to TFM
Add cmake rules to allow build boards with TFM enabled.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-11-29 13:40:27 +00:00
Gerson Fernando Budke 1d4ef686ec boards: stm32l562e_dk_ns: Enable rtc
Enable RTC for non-secure image.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-11-29 13:40:27 +00:00
Gerson Fernando Budke e68f568f86 drivers: counter: Enable support to stm32l5 mcu
Add driver entries to enable stm32l5 rtc driver.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-11-29 13:40:27 +00:00
Gerson Fernando Budke 8921ba1d46 dts: l5: stm32l5: Add rtc node
Add non-secure rtc devicetree node.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-11-29 13:40:27 +00:00
Emil Gydesen e80c70fd05 Bluetooth: Audio: Fix MCC disconnect issue
When MCC disconnected, it would memset the entire instance.
This causes issues, because the subscription parameters
would also be memset, causing the `notify` callback to
be set to NULL. If this was done as part of a disconnect,
the GATT layer would attempt to call the notify callback
as part of cleaning up the ACL, but if the callback was
set to NULL (from the memset) this caused a fatal error.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-29 13:26:57 +01:00
Georgij Cernysiov 7f06af6b82 tests: drivers: clock_control: stm32: test H7 PLL2_P SPI1
Tests PLL2_P clock source for the SPI1 (SPI123SEL).

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-11-29 11:54:52 +01:00
Georgij Cernysiov 779155135a dts: arm: stm32: add PLL2 to stm32h7
Adds disabled PLL2 clock..

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-11-29 11:54:52 +01:00
Georgij Cernysiov a8ac1424d8 include: dt-bindings: clock: stm32h7 add PLL2 defines
Uncomments PPL2 defines as it is supported.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-11-29 11:54:52 +01:00
Georgij Cernysiov 2b0727d550 drivers: clock_control: stm32h7: add PLL2 support
Adds PLL2 support.

The driver configures and enables PPL2 when
it is enabled in the DTS.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-11-29 11:54:52 +01:00
Georgij Cernysiov e30d78c764 dts: bindings: clock: fix stm32h7 div-m description
Divider value shall start from 1.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-11-29 11:54:52 +01:00
Gerard Marull-Paretas a78bdbce89 dt-bindings: regulator: pca9420: reorganize headers/macros
pca9420_i2c.h has neem remamed to pca9420.h (device only has I2C, so
it's kind of redundant to have i2c in the header name).

pmic_i2c.h was again not generic but designed specifically for PCA9420.
All its macros have been renamed, s/PMIC/PCA9420, and moved to the
pca9420.h header.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas 709f7c88f7 drivers: regulator: pca9420: store common config in parent device
Store all common configuration settings in the parent device. This
change should save ROM, since it avoids duplication.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas 9219d3d2b5 drivers: regulator: pca9420: fix VIN current limit setting
The driver had a conceptual issue regarding current limitation. PCA9420
is able to limit the current flowing through VIN, ie input current. This
is a global setting, not individual to each regulator. This patch
creates a new DT property: nxp,vin-ilim-microamp to specify such limit.
It is applied when the device is initialized.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas dcd63d288f drivers: regulator: pca9420: refactor voltage range handling
Voltage ranges were hardcoded in Devicetree, however, things can be
significantly simplified by using the recently introduce linear ranges
API. All values are now computed using information stored in the driver,
so there is no need to store any lookup table in ROM. Code should now
both be faster in average and consume less ROM.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas 048e415eee dts: bindings: regulator: nxp,pca9420: add maximum current
Maximum current was not specified. Even though not used, yet, it is a
valuable information. Values taken from PCA9420 datasheet, Figure 1
"Simplified block diagram".

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas 1caedf12dd drivers: regulator: pca9420: do not expose registers in DT
Regulator registers were set for each BUCK/LDO in DT, likely because of
the way the devices were instantiated. When using a generic iterator,
ie, DT_INST_FOREACH_CHILD, there's no way to differentiate the child
being _parsed_. Since instantiation happens now based on child node
names, we are able to know which registers each devices gets assigned at
the driver level. This greatly simplifies Devicetree, and it actually
removes information that is not strictly hardware description from it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas 9235ab90cc drivers: regulator: pca9420: remove unused modesel offset
The property was not used, and not defined in the bindings either.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas 85becbb5b3 drivers: regulator: pca9420: remove unused registers
The PCA9420 dt-bindings include file defines all device registers, but
many of them are not used (e.g. battery charger). It is also not the way
to use register definitions. Devicetree is about hardware description
after all. File will be cleaned up in subsequent commits.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas f4713fb7fb drivers: regulator: pca9420: fixed child instantiation
Right now the PCA9420 driver instantiates by iterating over all
children. This is somewhat problematic, for a few reasons:

- Since instantiation is generic code, we're forced to put internal
  details on Devicetree, e.g. reg-masks. After this change, this will no
  longer be necessary.
- We take all children, regardless of what is defined in DT.

While we have no means to validate Devicetree node names as in Linux
dtschema, this approach allows us to have per-child specific
initialization code. This is somewhat similar to the Linux approach.

Note: nodelabels have been removed, since they were not used.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas 9f1d25a2d1 drivers: regulator: pca9420: do not use DT_PROP_OR for booleans
DT_PROP() will evaluate to 0 when a boolean property is missing, so
there is no need to use DT_PROP_OR(..., false). Using _OR also has
side-effects, such as no errors when property is not defined in the
bindings.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas f999ab6a09 dts: bindings: regulator: nxp,pca9420 use standard mode properties
regulator-allowed-modes/regulator-initial-mode are standard properties
defined in regulator.yaml, so use them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas f89405ca8d drivers: regulator: pca9420: use standard regulator-min|max-microvolt
regulator.yaml provides now standard properties for minimum/maximum
voltage.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas a175e68fa9 dts: bindings: regulator: import Linux properties
Import all Linux properties, so that we can maximize compatiblity with
upstream bindings.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas eac400a530 dts: bindings: regulator: regulator-name is common
Following Linux regulator.yaml, regulator-name is a common property for
all regulators.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas d4566ce2b6 drivers: regulator: pca9420: sort includes
Sort includes: stdc, Zephyr.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas ac7c8c810a drivers: regulator: pca9420: fix voltage|current_range types
- voltage/current needs to be stored using int32_t
- reg_val is a 8-bit unsigned register value
- Also removed __packet, it is not required here

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas 7569de6af9 drivers: regulator: pca9420: rename some internal structs/funcs
Rename some internal structures/functions to clearly indicate they
belong to the PCA9420 driver.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Gerard Marull-Paretas af590c4500 drivers: regulator: pca9420: improve instantiation code
- Constify configuration and curr. limits/voltage range/modes arrays
- Use common argument names: node_id, inst to make code more readable
- Improve macro names to make things clear

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 11:54:31 +01:00
Krzysztof Chruscinski 063984d0b8 tests: logging: log_link_order: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski 1cfe927629 tests: logging: log_links: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski 85052a1383 tests: openthread: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski 8112da31c2 tests: net: shell: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski 34010e3bd0 tests: logging: log_switch_format: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski fe4a4ce2ad tests: logging: log_syst: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski ea3d03439c tests: logging: log_core_additional: Align test to LOG_PRINTK changes
Align test to accomodate for a change that LOG_PRITNK is by default
enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Jamie McCrae b635b55ef0 logging: Increase dummy shell buffer size to 400 bytes for LOG_PRINTK
If LOG_PRINTK is used then the buffer size needs to be larger to
account for the additional header/footer output from the shell.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski 3a6e769070 doc: logging: Add section about LOG_PRINTK option
Add section which describes coexistence of printk and logging
and the behavior of LOG_PRINTK with information that it is by
default enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Jamie McCrae c5a40e3a9d logging: Enable LOG_PRINTK if PRINTK is enabled
This change will enable the logging system to handle printk() calls by
default if printk support is enabled, which improves output resiliency
when logging, mcumgr and printk calls are used. Will disable keep
LOG_PRINTK disabled for tests which are not using the new API as
moving to LOG_PRINTK causes test data to be output to a different UART
in the old test system.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski b53a8e5fea samples: tfm_integration: psa_firmware: Improve logging handling
Remove redundant initialization and add logs flushing before
the reboot.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Francois Ramu b839a0f9db samples: drivers: jesd216 jedec ID and SFDP from octo-flash
This adds the support jedec configuration to run
the jedec  sample application. So target boards can display
the content of the octo-NOR flash
of the stm32u585 and stm32l562 or stm32h735 disco boards.
The sfdp-bfp table is provided as example (overlay file),
to run this sample on the stm32l562e_dk platform.
It has to be defined in the deviceTree "in cases were runtime
retrieval of SFDP data is not desired."

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-29 09:32:22 +00:00
Francois Ramu ec3dd57320 boards: arm: stm32l4s5 disco kit with octospi on board
Activates the NOR octoflash MX25r6435f present on the disco kit
b_l4s5i_iot02a from STMicroelectronics.
The connection is made through the OSPIM peripheral for the
octospi1 pins.
QUAD spi mode is selected but SPI or DUAL are also supported.
SPI Max freq is given by the datasheet
and is compatible with Voltage Range 2.
DMAMUX is used for ospi transfer on request 40.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-29 09:32:22 +00:00
Francois Ramu 0c744cb22d dts: arm: stm32l4plus serie has octospi peripheral instead of quadspi
Define the octospi node for the stm32l4plus MCUs from
STMicroelectronics.
It is controlled by a OSPIMgr in front of each peripheral.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-29 09:32:22 +00:00
Francois Ramu acd582e456 drivers: flash: stm32 ospi flash driver for stm32l4plus mcus
Adaptation of the ospi nor flash driver for stm32l4 plus
where the peripheral is slighty different.
Configure the OSPIM peripheral for mcu embeddingthis peripheral
in front their octospi instances.
Add LOG for read access command like for write access.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-29 09:32:22 +00:00
Ettore Chimenti 21a6bb3d2d dts: arm: st: add STM32F302xC device tree
Add ST Micro STM32F302xC family of microcontrollers.

Signed-off-by: Ettore Chimenti <ek5.chimenti@gmail.com>
2022-11-29 09:15:12 +00:00
Gerard Marull-Paretas 737d799660 kernel: sched: fix ticks logging
- Logging supports printing 64-bit values now. Cast to unsigned long and
  use %lu all times.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-29 09:52:04 +01:00
Patryk Duda b9f495282e drivers: flash: Do not unlock CR at the end of initialization
Unlocking CR at the end of initialization was added in commit
a9183cd518. It was probably copied
from previous flash driver implementation.

Unlocking and locking CR in write and erase functions was added in
commit 6e4cdb0c99. Since we always unlock
the register before writing or erasing, and lock it after the operation
is finished, there is no need to unlock it after initialization.

Signed-off-by: Patryk Duda <pdk@semihalf.com>
2022-11-29 09:50:28 +01:00
Emil Gydesen f3b0a8f478 Bluetooth: Audio: Fix broadcast assistant recv state pointer value
When reporting a receive state to the upper layers, the broadcast
assistant should report NULL if there is not a receive state
active. The "activeness" of a receive state is determined by
the length of the characteristic - If it is 0 then there
is no receive state active.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-29 09:50:22 +01:00