Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If shell is enabled then enable all sub-shells if their dependencies are
satisfied. This was done for some modules and subsystems but was not
consistent.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add the missing prefix z_ required to make the ESP32 version override
the weak implementation.
General practice in ESP32 seems to be to use the MAC address, so
extract that in its canonical byte order.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Following the practice for i.MX decoding assume the 32-bit identifier
values need to be converted to big-endian representation for
device-independent interpretation.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Resources indicate that CFG2 holds the upper 32 bits, and CFG1 the
lower 32 bits, of a 64-bit unique identifier. Store it in big-endian
format so it reads correctly when accessed as a byte sequence.
https://community.nxp.com/docs/DOC-94459
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The unique identifier for this platform is a 96-bit value, where the
upper 56 bits provide an ASCII encoding of the lot number, and the
lower 40 bits provide the wafer number and X, Y position on the wafer.
Extract the value into big-endian form for device-independent
interpretation.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
HWINFO drivers should be responsible for ensuring that
the data structure is a sequence of bytes. That is not
what the current sam0 and nordic drivers do. The drivers
read the data as u32_t and then memcpy the data to a
buffer. This ensures the data has the endianness of the
underlying MCU, which in this case is Cortex M0 which
is little endian.
This commit fixes the endianness so the data can be
interpreted as a "left to right sequence of bytes".
This commit updates the API doc to provide clarification
of the data structure.
Add to 2.3 release notes.
Fixes#23444, #24103
Signed-off-by: Steven Slupsky <sslupsky@gmail.com>
Replace DT_FLASH_DEV_BASE_ADDRESS with new DT_REG_ADDR/DT_INST macro as
we phase out DT_FLASH define usage.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert older DT_INST_ macro use in litex drivers to the new
include/devicetree.h DT_INST macro APIs.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert older DT_INST_ macro use in atmel sam0 drivers to the new
include/devicetree.h DT_INST macro APIs.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
CLOE (Code Loop Optimization) does not exist on SAM3x.
Make the EEFC_FMR_CLOE disable depending on CONFIG_SOC_SERIES_SAM3X.
Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
Include stm32XXxx_ll_utils.h in soc.h for every stm32 SoC,
if CONFIG_HWINFO_STM32 is selected.
Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
Make the NRF hwinfo driver depending on !TRUSTED_EXECUTION_NONSECURE
because the FICR registers are not accessible from the non-secure
world.
Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
Introduce the HWINFO_HAS_DRIVER Kconfig symbol to get
the information if hwinfo is supported on the current platform.
Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
Use this short header style in all Kconfig files:
# <description>
# <copyright>
# <license>
...
Also change all <description>s from
# Kconfig[.extension] - Foo-related options
to just
# Foo-related options
It's clear enough that it's about Kconfig.
The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)
git ls-files '*Kconfig*' | \
xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit adds driver supporting reading DNA ID value for LiteX SoC
builder.
Signed-off-by: Jakub Wegnerowski <jwegnerowski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
The semi-automated API changes weren't checkpatch aware. Fix up
whitespace warnings that snuck into the previous patches. Really this
should be squashed, but that's somewhat difficult given the structure
of the series.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
These calls are not accessible in CI test, nor do they get built on
common platforms (in at least one case I found a typo which proved the
code was truly unused). These changes are blind, so live in a
separate commit. But the nature of the port is mechanical, all other
syscalls in the system work fine, and any errors should be easily
corrected.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move hwinfo.h to drivers/hwinfo.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
ESP32 can sport up to 4 network interfaces: two 802.11 (station and
ap), ethernet, and bluetooth. All of them derive from the same RDATA
register in efuse block 0. However, in most cases, the last (sixth)
octet will change like so:
- 802.11 station: mac[5] += 0
- 802.11 ap: mac[5] += 1
- bluetooth: mac[5] += 2
- ethernet: mac[5] += 3
Read "Number of universally admnistered MAC address" section in esp-idf
documentation[1] for more information.
[1] https://docs.espressif.com/projects/esp-idf/en/latest/
Signed-off-by: Leandro Pereira <leandro@hardinfo.org>
Add driver support for Atmel SAM0 device ID, which is 16-bytes long.
The device ID can simply be read from memory at a known location, but
the location is only described in the data sheet, not in ASF.
For SAMD2x it's 0x0080A00C, 0x0080A040, 0x0080A044 & 0x0080A048.
For SAMD5x it's 0x008061FC, 0x00806010, 0x00806014 & 0x00806018.
This adds a new property to the device tree to define the device ID
registers for this SoC family.
Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add driver support for Atmel SAM device ID, which is 16-bytes long. On
this SoC family, the device ID is part of the flash controller and
complex to read. Therefore the driver reads it once at boot time and
then just returned the copy saved in RAM.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Update reserved function names starting with one underscore, replacing
them as follows:
'_k_' with 'z_'
'_K_' with 'Z_'
'_handler_' with 'z_handl_'
'_Cstart' with 'z_cstart'
'_Swap' with 'z_swap'
This renaming is done on both global and those static function names
in kernel/include and include/. Other static function names in kernel/
are renamed by removing the leading underscore. Other function names
not starting with any prefix listed above are renamed starting with
a 'z_' or 'Z_' prefix.
Function names starting with two or three leading underscores are not
automatcally renamed since these names will collide with the variants
with two or three leading underscores.
Various generator scripts have also been updated as well as perf,
linker and usb files. These are
drivers/serial/uart_handlers.c
include/linker/kobject-text.ld
kernel/include/syscall_handler.h
scripts/gen_kobject_list.py
scripts/gen_syscall_header.py
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Use LL drivers instead of HAL driver because LL driver is available
for all soc while HAL driver is not.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
It is planned to deprecate SHELL_CREATE_STATIC_SUBCMD_SET macro
which is replaced by SHELL_STATIC_SUBCMD_SET_CREATE.
Additionally, removed irrelevant comments about alphabetical
ordering which is no longer needed.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The hwinfo shell uses shell functions and thus doesn't build when
CONFIG_SHELL=n. Fix that by adding a dependency on SHELL.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Add driver support for kinetis ID device.
The length depends on the SoC.
`SIM_GetUniqueId` was not used because the struct would reorder
the ID and makes the driver more complicated because the length
of the struct depends on the SoC.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit adds support for device id shell command.
Example:
uart:~$ hwinfo devid
Length: 12
ID: 0x1b0320d51485330313420
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit adds a new hardware info API.
With this API it is possible to read out the device ID.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>