fix various coding style issues for drivers/sensors:
- remove redundant `#define CONFIG_XXX` that should be provided from Kconfig
- correct section banners
- remove empty section banners
- fix some function banners
Signed-off-by: raiden00pl <raiden00@railab.me>
Fix frame reception when CANFD is not enabled and there are many message in
the RX buffer.
The previous implementation assumed that the size of the data in the RX buffer
is constant, which is not true. Fortunately, the amount of
data in the buffer can be easily read from frame->fmt.rwcnt.
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Add support for BME688 sensor based on BME680 implementation.
The BME688 is nearly identical to the BME680, and this implementation
reuses much of the existing BME680 code. However, there are some differences
related to gas measurements that make it impractical to use the same driver
without significantly complicating it. BME688 also supports parallel mode
which isn't yet supported.
Signed-off-by: raiden00pl <raiden00@railab.me>
This revises the post-IRQ interruption control logic so that to balance
the disable/enable operations for both chardev and socketcan cases.
Checked with chardev/socketcan on qemu-intel64.
Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
fix an unaligned pointer error for arm32 build:
ctucanfd_pci.c:1361:7: warning: converting a packed 'struct ctucanfd_frame_s'
pointer (alignment 1) to a 'uint32_t' {aka 'long unsigned int'} pointer (alignment 4)
may result in an unaligned pointer value [-Waddress-of-packed-member]
1361 | ptr = (FAR uint32_t *)&rxframe;
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Move can_bytes2dlc() and can_dlc2bytes() to a common CAN file
that can be shared between socketCAN implementation and CAN
character driver.
This is the first step to simplifying the logic repeated in
many CAN drivers.
Signed-off-by: raiden00pl <raiden00@railab.me>
So far the NuttX implementation of OP-TEE has been using
registered memory references to pass non-registered memory
to OP-TEE OS, passing the physical address of the memory
in what is normally used as a 'cookie'. This was compatible
with the Openvela framework, but no other OP-TEE OS.
Fix this by passing temporary memory instead with the standard
non-contiguous (OPTEE_MSG_ATTR_NONCONTIG) flag.
Signed-off-by: George Poulios <gpoulios@census-labs.com>
This is mostly to handle the case that the user calls
close() before calling close() on the shm. In that case
optee_close() frees the shm and then optee_shm_close()
operates on an invalid reference. Fix that.
Signed-off-by: George Poulios <gpoulios@census-labs.com>
This is no longer (exactly) the linked list entry that it
used to be, but rather an associated pointer in an idr tree
entry. Plain 'optee_shm' is more concise, and more appropriate.
Changes also reg_pair_to_uintptr() to reg_pair_to_ptr() for
better readability in invocations.
Signed-off-by: George Poulios <gpoulios@census-labs.com>
Previous implementation was not compatible with GlobalPlatform
API in the following ways:
- Registered mem IDs would begin from negatives when it should
have been greater than or equal to 0
- Register IOCTL would return 0 on success, when it should have
been returning a file descriptor.
- Register IOCTL would expect the user-space client to specify
TEE_SHM_* flags dictating its behaviour when in fact, libteec
never specifies flags.
This commit fixes all those issues. It uses nuttx/idr.h instead
of a linked list, and it uses `file_allocate` to provide file
descriptors for registered shared memory. Upon close(fd), the
memory is de-registered and freed accordingly. It also updates
the documentation accordingly.
Signed-off-by: George Poulios <gpoulios@census-labs.com>
Some calls to `optee_is_valid_range()` would return
-EINVAL and some would return -EACCESS. Change all to
-EFAULT (Bad Address) which is more appropriate.
Signed-off-by: George Poulios <gpoulios@census-labs.com>
Option COMPOSITE_VENDORSTR should be described as composite vendor
string, not vendor id. This is consistent with other USB devices.
Also fixes a typo in USBDEV_EPBUFFER_ALIGNMENT.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Call SDIO_DMARECVSETUP instead of SDIO_RECVSETUP if CONFIG_SDIO_DMA
is defined, aligning with other callings of in mmcsd_sdio.c.
Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
So far NuttX has supported OP-TEE interfacing over
local and RPMsg sockets. This commit introduces support
for direct invocation of OP-TEE through arm SMCs. The
SMC transport is enabled through CONFIG_DEV_OPTEE_SMC.
This SMC implementation has been tested only with arm64,
OP-TEE rev 4.4.
Note that it does not support reverse direction RPCs,
i.e. from the Secure World to the Normal World to
something like optee supplicant. A basic RPC handling
skeleton is provided with implementation for some
basic functions (alloc/free mem, and foreign interrupts)
but no supplicant command handling.
(+one minor change s/parm/param in arch/arm64/include/syscall
to satisfy the spellchecker during PR)
Signed-off-by: George Poulios <gpoulios@census-labs.com>
Adds support for SHM_REGISTER IOCTL. Registration can
be requested both against the driver (for automatic cleanup)
and against the secure OS (for sharing).
Introduces also `optee_{msg,free}_alloc()` to allocate
aligned memory for message arguments depending on the
`alignment` specified in the driver's private data. For
alignment greater than word size, memory is allocated on the
heap, otherwise it's allocated on the stack (similar to the
previous implementation but using `alloca()` instead).
Signed-off-by: George Poulios <gpoulios@census-labs.com>
Besides a few checks for NULL IOCTL argument values, this
commits introduces also a check to ensure that user specified
memory (mainly IOCTL arguments) indeed belongs to the user.
This is applicable only with `CONFIG_ARCH_ADDRENV`.
Signed-off-by: George Poulios <gpoulios@census-labs.com>
Prepares the ground for introducing new transports to
the OP-TEE driver. "transports" as in alternatives to
RPMsg and local network.
Signed-off-by: George Poulios <gpoulios@census-labs.com>
Adds Kconfig-selected splashscreen options used when the driver is first registered
* Includes a new Python script in ./tools to create RLE bitmap files
* Includes default NS logo btimaps in 320x320, 160x160 and 80x80 resolutions along with their PNG files
Signed-off-by: Tim Hardisty timh@jti.uk.com>
The MCP47X6 series consists of the following single channel DAC chips:
- MCP4706 (8 bit)
- MCP4716 (10 bit)
- MCP4726 (12 bit)
The driver supports the following configurations:
- gain
- power down
- voltage reference
Persistent configuration storage in the internal EEPROM is not
implemented.
ax99100 export each serial port as a separate PCI device function
so we have to handle this properly.
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This adds filters field to icjx_config_s structure that is passed
as an argument in icjx_initialize function. This field allows to
configure I/O filters (control world 1 and 3) with three possible
filters or disable them at all.
The filter configuration is currently only configurable during the
initialization, not at run time (the same as current source)
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit resolves issue #16009, where a sync word of less than 64
bytes was printed as 0-padded hex. 0-padding is invalid for the RN2xx3
modules, so now it has been removed.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This call to syslog was missing the '%' in its format string, and also
was using the wrong format string (lu instead of d) to print the `cmd`
argument. It is corrected and the compiler warning resolved.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Use the dedicated nuttx internal interface for debugging semaphore value,
instead of accessing it directly.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Driver now validates ACL provided buffer length agaist the size of
the data buffer which is defined by CONFIG_BLUETOOTH_UART_RXBUFSIZE.
Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
This implements similar functionality than CONFIG_FAT_FORCE_INDIRECT
because in some use cases (e.g. when CONFIG_BUILD_KERNEL) it is not possible to
write directly from user buffer.
Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
This patch adds support for the NAU7802 24 bit ADC from Nuvoton.
Please read the documentation for more details.
Signed-off-by: Daniel Byshkin <online@bskdany.com>
Add an option to completely disable syslog() and replace it with an empty functions.
This option can be useful for small systems when we don't have any logging support,
but compiler is not able to remove useless code.
This way the final image also won't contain the strings that are present in
syslog() calls when compiler optimization is enabled (for example from /boards
where syslog is often used instead of debug macros).
Signed-off-by: raiden00pl <raiden00@railab.me>
The UART driver (cdcacm...) might have buffered data received, Just continue
processing the RX queue if this happens. If not, then check the file or dev
flags.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>