Commit Graph

54264 Commits

Author SHA1 Message Date
Luchian Mihai
eadc2f5690 feat: add basic driver for amg88xx sensor
Basic amg88xx sensor handling (open, close, read, ioctl).
No interrupts supported. I intend to add support for this feature when I
gain more know-how on nuttx/posix.
2024-09-07 12:03:38 +08:00
p-szafonimateusz
882c0d0a47 arch/x86_64: convert all asm() to __asm__()
asm() is not supported by -std=c99, __asm__() is more portable

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-07 01:01:24 +02:00
YAMAMOTO Takashi
8b81689f2c Appease a GCC warning
```
common/xtensa_swint.c:442:24: error: passing argument 1 of 'up_dump_register' discards 'volatile' qualifier from pointer target type [-Werror=discarded-qualifiers]
  442 |       up_dump_register(CURRENT_REGS);
      |                        ^~~~~~~~~~~~
```
2024-09-06 21:17:57 +02:00
Jorge Guzman
ae596418ae arm/linum-stm32h753bi: Add support to RFID MFRC522
Signed-off-by: Jorge Guzman jorge.gzm@gmail.com
2024-09-06 14:10:08 -03:00
ouyangxiangzhen
dc7d3470e6 arch/x86_64: Fix wrong RDTSCP implementation
RDTSCP instruction reads the current value of the processor’s
time-stamp counter (a 64-bit MSR) into the EDX:EAX registers, and it
also reads the value of the IA32_TSC_AUX MSR (address C0000103H) into
the ECX register. However, the current RDTSCP implementation does not
provide a hint for the compiler that ECX has been changed, resulting in
register corrupted and subtle errors.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-06 17:27:20 +02:00
p-szafonimateusz
e58efb17cc qemu-intel64: simplify linker script
simplify linker script for qemu-intel64 - remove not needed AT instructions

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-06 21:01:28 +08:00
ouyangxiangzhen
f6e4ab25bd arch/x86_64: Support QEMU PVH ELF loader
Enabling CONFIG_ARCH_CHIP_INTEL64_PVH_BOOT will allow nuttx.elf loaded by QEMU -kernel parameter.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-06 20:56:46 +08:00
p-szafonimateusz
dc92dee353 include/nuttx/net/netfilter/ip6_tables.h: fix gcc 14 errors
fix gcc 14 errors for ip6_tables.h

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-06 14:37:01 +02:00
gaohedong
5172da6b16 socketlin : add lin.h and lin bus-type
Add lin.h adn lin bus-type

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2024-09-06 17:49:29 +08:00
hujun5
427e5f18e8 irq: irq with the same priority share the same wqueue
reason:
1 We place interrupt handling functions of the same priority into the work queue corresponding
to that priority, allowing high-priority interrupts to preempt low-priority ones,
thus ensuring the real-time performance of high-priority interrupts.

2 The sole purpose of the interrupt handler is to wake
up the work queue of the corresponding priority and execute the interrupt handling function.

3 Compared to the functionality of isr threads, this
approach saves more memory, particularly when the number of interrupts is large.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 17:43:11 +08:00
Petro Karashchenko
c6a7816bed libs/libm/libm: increase number of 'log' iterations before epsilon relaxation
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-09-06 17:40:57 +08:00
Petro Karashchenko
02b1e895e2 libs/libm/libm: apply epsilon relax factor only if epsilon is small
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-09-06 17:40:57 +08:00
Petro Karashchenko
9cfb10069c Revert "libs/libm: fix epsilon relaxation in log and logf"
This reverts commit a2ed0ddd72.
2024-09-06 17:40:57 +08:00
hujun5
c45e4ac440 boardcrtl: change BOARDCTL_TESTSET to BOARDIOC_SPINLOCK
reason:
BOARDIOC_SPINLOCK can support the combined semantics
of disabling interrupts (irq), trylock, and spinlock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 16:10:09 +08:00
Xiang Xiao
659448a9d8 fs/hostfs: Replace strcpy with memcpy
The strcpy function is dangerous because it does not check the length of the

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-09-06 12:27:55 +08:00
chenrun1
44351959ee mmcsd_sdio:Limit the use of sleep in mmcsd.
reference:https://github.com/apache/nuttx/pull/12971

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-06 12:25:55 +08:00
chenrun1
0e13ea9ed1 mmcsd_sdio:Fix performing read and write in irq
In some usage scenarios, read and write tasks will be performed during interruptions. If sleep is used at this time, it will cause a timeout crash. Therefore, a macro is added to determine whether it is currently interrupted to select sleep/delay.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-06 12:25:55 +08:00
hujun5
40ae660d30 init: add OSINIT_TASK_READY
reason:
simplifying some code writing

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 11:25:34 +08:00
lipengfei28
aeb98d9c05 fix Compile error
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
5c119b4a03 refresh the pci test config
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
b70922cb24 pci: add ioctl for userspace
which is same as OpenBSD:
https://github.com/openbsd/src/blob/master/sys/sys/pciio.h

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
dba7700813 pci: add rom addr and rom size to resource
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
3250625a15 pci: add find device from bus
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
9dc9500aaf pci add register drivers
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
c25f839b06 pci: add pci bus find capability interface
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
45f1597562 pci: add pci read/write config/io space interface
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
d9c8838319 pci: use g_pci_ctrl_list replace g_root_bus_list
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
75f8c72dbb drivers/pci/pci_qemu_edu: update qemu edu driver code
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
9c07b369e9 drivers/pci/pci_qemu_test: update qemu pci test code
Change the qmeu pci test code for new pci driver framework

Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
7cbb7d36d8 Changed the x86 64 pci driver
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
125884ae95 Changed the pci bus for arm architecture
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yinshengkai
cec3b5c0fb boards: Add TLS_NELEM dependency to libcxxabi
Refresh all defconfig

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:52:33 +08:00
yinshengkai
a055734912 libcxx: adds tls&libcxxabi dependency
If libcxxabi is not enabled, the toolchain default implementation will be used. However, arm-gcc does not enable thread
support by default, which will cause errors in a multi-threaded environment.

libcxx depends on pthread_key_create

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:52:33 +08:00
yinshengkai
6d39b248a4 libcxxabi: fix compilation warnings
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:52:33 +08:00
yinshengkai
ad76a4f7a9 libcxxabi: libcxxabi enables exceptions by default
In the following code, even though the application does not use exceptions, an exception is still thrown in libcxx

If libcxxabi is not enabled, the toolchain default implementation will be used. However, arm-gcc does not enable thread
support by default, which will cause errors in a multi-threaded environment.

Therefore, we need to use libcxxabi to ensure normal functions in a multi-threaded environment.

using namespace std;

void foo(bool recur);
int bar(bool recur)
{
  if (recur) {
      foo(false);
  }
  return 0xFAFAFA;
}

void foo(bool recur)
{
  static int i = bar(recur);
  cout << "Static is:" << i << "\n";
}

int main(int argc, char *argv[])
{
  foo(true);
  return 0;
}

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:52:33 +08:00
yinshengkai
b721f2c84e libcxx: Disable dynamic type checking when enabling libcxxabi
It results in a recursive call, cxxabiv1::__dynamic_case -> is_equal -> __ubsan::checkDynamic -> cxxabiv1::__dynamic_case

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:52:33 +08:00
Filipe Cavalcanti
2af7037fa1 xtensa/esp32s2: add WiFi support on ESP32S2 2024-09-06 09:46:59 +08:00
Filipe Cavalcanti
4915338857 xtensa/esp32s2: fix for timers and watchdog init on startup 2024-09-06 09:46:59 +08:00
Filipe Cavalcanti
2e884cbd11 xtensa/esp32s2: add support for shutdown handlers 2024-09-06 09:46:59 +08:00
yinshengkai
6ac1299218 nrf91: fix cmake compiler error
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:42:53 +08:00
yinshengkai
d7f02a8cb6 sched: change pthread_mutex implementation from sem to mutex
Since pthread_mutex is implemented by sem, it is impossible to see in ps who holds the lock and causes the wait.
Replace sem with mutex implementation to solve the above problems

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:42:53 +08:00
yinshengkai
2fd3981a8e pthread: remove pshared parameter from pthread_mutex_init
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:42:53 +08:00
yinshengkai
4feb418e36 pthread: remove the code which save and restore mutex state in pthread_condwait
type and flags are only initialized in mutex_init and should not change in the middle

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:42:53 +08:00
hujun5
608b59e401 smp: enable smp_call in all smp arch
reason:
In subsequent implementations, we will replace up_cpu_pause with smp_call.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 07:11:38 +09:00
hujun5
ea181e2621 arm: armv7-a/r and armv8-r up_cpu_index inline
reason:
inline small code to improve performance

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 03:44:49 +08:00
yinshengkai
da6ddea8d4 arch/arm: support kernel heap in BUILD_FLAT mode
Make umm & kmm heap alloc more clear, and possible support FLAT build to
enable kernel heap.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-05 11:19:47 -03:00
hujun5
874c0b002c spinlock: spin_initialize should add memory barrier
reason:
spin_initialize is often used to release a lock,
and if we don't include a memory barrier,
it may lead to the lock being released prematurely.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 21:28:52 +08:00
hujun5
855060f353 sched: Make sure that affinity mask is valid
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 21:26:58 +08:00
shizhenghui
af19a22b11 ci-docker: add subversion to linux dockerfile
Add subversion to install list ensure linux docker
can use svn command to download source code.

Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-09-05 21:25:46 +08:00
hujun5
e1b9144e71 can: Before we use pstate, we should check if it is NULL.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 21:25:22 +08:00