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>
Add ability to use arv8m systick lowerhalf driver
Fix wrong macro for systick current register in initialize
Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
In case the wdog has already completed when calling cancel, the cancel is
supposed to just return OK.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
The watchdog auto-monitor sets up during the register phase,
so we should be prepared before calling register.
Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
There are many close calls in application without checking return value,
and wrong code causes the same fd to be closed multi times, we should detect
this situation and avoud effecting the fd in other threads.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Remove dependency on CONFIG_NET_CAN for socketCAN definitions.
Definitions from this file are also used by arch/sim CAN
implementation, which is based on a host socketCAN interface.
With this change CONFIG_NET and CONFIG_NET_CAN don't need to
be enabled to support CAN character driver on sim.
Signed-off-by: raiden00pl <raiden00@railab.me>
The fast path can be used also for counting semaphores when the priority
inheritance is disabled.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Installation instructions, license exceptions and supported features
of the RP2040 common among all boards have been moved exclusively to the
rp2040/index.rst file. Board documentation links back to the primary
source for installation instructions.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Add a kernel build with OP-TEE/SMC driver enabled to
i.MX93 EVK (target imx93-evk:koptee). Since this is
derived from the 'knsh' target, it is also preconfigured
for use with AHAB boot (see
https://spsdk.readthedocs.io/en/latest/examples/ahab/imx93/imx93_ahab_uboot.html).
Signed-off-by: George Poulios <gpoulios@census-labs.com>
Whitelist all symbols starting with "TEEC_" and a few
entire struct field names from tee_client_api.h.
Signed-off-by: George Poulios <gpoulios@census-labs.com>
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>
This commit added a macro function clock_delay2abstick to calculate the
absolute tick after the delay.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit resolves a timing error caused by the round-up behavior in clock_time2ticks. In rare cases, this could lead to a two-tick increment within a single tick interval. To fix this, we introduced clock_time2ticks_floor, which guarantees the correct semantics for obtaining current system ticks.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit change the type of the constants to unsigned, avoiding signed integer division.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit added CONFIG_TIMER_ADJUST_USEC to support the time compensation for wdog timer. Normally, timer event cannot triggered on exact time due to the existence of interrupt latency. Assuming that the interrupt latency is distributed within [Best-Case Execution Time, Worst-Case Excution Time], we can set the timer adjustment value to the BCET to reduce the latency.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
To improve the absolute timer accuracy, this commit move the tick++ to relative wdog timer.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
The l1entry replace cause huge time when text/data is big,
Need 16KB per task to hold l1table.
Also critical_section no longer required, as table per-task maintained.
For complex goldfish emulator scarios can speed up:
enter_nsh/application_init_done,
from 23.517300/05:07.067500
to 01.501500/00:06.587300
at least 10 times faster.
As we don't have do x_NPAGES swap out etc.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Or will be catch by codespell, when do checkpatch.sh
Also fix the relative comment file changed.
include/nuttx/scsi.h
drivers/syslog/ramlog.c
excluded as we have to modify field name in struct
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Notice: the up_addrenv_pa_to_va is not correct, it will be complex if we
search all address to lookup all virtual address according to physical
address.
Use up_addrenv_x method as common interface across va & pa
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
BUILD CMD: ./tools/configure.sh -l sama5d3x-ek/nx; make -j`nproc`
chip/sam_memories.c:705:17: note: each undeclared identifier is reported only once for each function it appears in
chip/sam_memories.c:706:27: error: 'CONFIG_SAMA5_DDRCS_PGHEAP_SIZE' undeclared (first use in this function); did you mean 'CONFIG_SAMA5_DDRCS_HEAP_SIZE'?
706 | poolend = poolstart + CONFIG_SAMA5_DDRCS_PGHEAP_SIZE;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| CONFIG_SAMA5_DDRCS_HEAP_SIZE
make[1]: *** [Makefile:168: sam_memories.o] Error 1
make[1]: Target 'libarch.a' not remade because of errors.
make: *** [tools/LibTargets.mk:170: arch/arm/src/libarch.a] Error 2
make[1]: Target 'libsched.a' not remade because of errors.
make: *** [tools/LibTargets.mk:71: sched/libsched.a] Error 2
make: Target 'all' not remade because of errors.
~/nuttx/tools/testbuild.sh: line 385: ~/nuttx/../nuttx/nuttx.manifest: No such file or directory
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
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>
Add timestamp for GNSS measurements and clock, for matching.
When recovering the combination of `GnssMeasurement` and `GnssClock` into
[GnssData](https://android.googlesource.com/platform/hardware/libhardware/+/
refs/heads/android14-release/include/hardware/gps.h#1748),
the reason for splitting is that the uORB buffer is not large enough to
accommodate `GnssData`, since different topics cannot guarantee the
same timing when publishing and subscribing data, we need an index to match.
WARNING: A new member "timestamp" of type uint64_t has been added at
the beginning of the struct "sensor_gnss_measurement" and "sensor_gnss_clock".
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit improve the performance of the work_queue by reducing
unnecessary wdog timer setting.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>