Commit Graph

54149 Commits

Author SHA1 Message Date
chenzhijia
1086a05e50 libc/sysconf: add _SC_GETPW_R_SIZE_MAX
pass tlpi example: https://man7.org/tlpi/code/online/dist/users_groups/t_getpwnam_r.c.html

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-08-29 09:05:45 +08:00
Tiago Medicci Serrano
a763ed1e07 espressif: Fix build with RTC
This commit ensures that RTC data is properly allocated in the RTC
segment in the linker. This fixes the reported problem about using
the legacy bootloader and RTC.
2024-08-29 09:05:17 +08:00
pangzhen1
c8e56ff63a CMake: fix CMake compile errors during the protected build mode
There are 2 CMake compile errors during the protected build mode. One is forget to add library for nuttx_user, another is the wrong macro used when compile wqueue.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2024-08-29 01:59:29 +08:00
chenzhijia
f526b91165 nuttx/drivers:Modify errcode returned by relay_ioctl
Fixed system function call failure due to return errcode error

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-08-29 01:04:03 +08:00
Felipe Moura
37e1f5db47 Add spi slave dev to esp32 xtensa 2024-08-29 01:01:04 +08:00
Ville Juven
a0a85e5c10 arch/arm64: Move ELF_64BIT selection to arch/Kconfig
Unify the elf file format for the whole arm64 architecture
2024-08-28 07:45:36 -04:00
yinshengkai
263f8955da fs/procfs: Supports any number of thread displays
After the number of threads exceeds the array size, it will not be displayed.
Any number of threads can be displayed using dynamic adaptation

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-28 14:01:25 +08:00
yangguangcai
efbf43cdfa driver/mem:add Mem Driver.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-08-28 13:59:04 +08:00
yangsong8
a2e7265adb cdcacm: align cdcacm_epconfigure function parameters
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-28 13:48:55 +08:00
Lup Yuen Lee
4c35bde3ba risc-v/bl808: Configure MMU to cache User Text, Data and Heap
This PR configures the BL808 MMU to cache the the User Text, Data and Heap. We enable the T-Head MMU Flags for Shareable, Bufferable and Cacheable, as explained in the previous PR: https://github.com/apache/nuttx/pull/13199

This PR fixes the Slow Memory Access for NuttX Apps on Ox64 BL808 SBC: https://github.com/apache/nuttx/issues/12696. With this fix, Ox64 NuttX CoreMark jumps from 19 to 1,104. (Close to Buildroot Linux CoreMark)

Modified Files:

`arch/risc-v/Kconfig`: Enabled `ARCH_MMU_EXT_THEAD` for BL808 SoC.
2024-08-28 13:47:41 +08:00
yangguangcai
45625cbe3b timer driver:support poll.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-08-28 13:46:47 +08:00
pangzhen1
dee4c63adb protected build: userspace threads will unexpectly work in privileged mode after syscall
In protected build mode, the syscall returns without setting correct value for the CONTROL register, which causes the userspace threads working in privileged mode after syscall.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2024-08-28 13:44:37 +08:00
LuchianMihai
d59fbfdbdc tools/nxstyle: fix wrong error reports for if statements
* Fix nxstyle check so it does not report error on comments on the same
line as if statements
* Rework if statement checks
* Report warning instead of error for is statements check fail
2024-08-28 09:08:42 +08:00
Lup Yuen Lee
b14dc8f8ae risc-v/mmu: Configure T-Head MMU to cache User Text, Data and Heap
This PR configures the T-Head MMU to cache the the User Text, Data and Heap. We enable the MMU Flags for Shareable, Bufferable and Cacheable, as explained in this article: https://lupyuen.github.io/articles/plic3#appendix-mmu-caching-for-t-head-c906

This PR fixes the Slow Memory Access for NuttX Apps on BL808 and SG2000 SoCs: https://github.com/apache/nuttx/issues/12696. With this fix, SG2000 NuttX CoreMark jumps from 21 to 2,423. (Close to SG2000 Debian CoreMark)

We introduce a Kconfig Option: `ARCH_MMU_EXT_THEAD` ("System Type > Enable T-Head MMU extension support"). Enabling this Kconfig Option will configure the T-Head MMU to cache the User Text, Data and Heap.

This PR enables the MMU cache for only SG2000 SoC (Milk-V Duo S SBC). The next PR will apply the same settings to BL808 SoC (Pine64 Ox64 SBC).

Modified Files:

`arch/risc-v/Kconfig`: Added Kconfig Option `ARCH_MMU_EXT_THEAD` that will configure the T-Head MMU. Enabled `ARCH_MMU_EXT_THEAD` for SG2000 SoC.

`arch/risc-v/src/common/riscv_mmu.h`: Set the T-Head MMU Flags (Shareable, Bufferable and Cacheable) for User Text, Data and Heap, if `ARCH_MMU_EXT_THEAD` is enabled

`arch/risc-v/src/common/riscv_addrenv.c`: Extended the MMU Flags from 32 bits to 64 bits, to accommodate the T-Head MMU Flags

`arch/risc-v/src/common/riscv_exception.c`: Extended the MMU Flags from 32 bits to 64 bit, to accommodate the T-Head MMU Flags. This code is enabled only for MMU Paging (`CONFIG_PAGING`).
2024-08-27 19:54:58 -04:00
guoshichao
2d7c47ce16 greenhills: fix the build option warning
Warning: Unknown option "-fno-optimize-sibling-calls" ignored.  Did you mean "-mno-long-calls"?

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-28 01:22:03 +08:00
yangsong8
fa1c094e65 usbdev: add usb3.0 ep companion struct and descriptor
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-27 12:53:15 -03:00
yangsong8
1dd38fe974 usbdev: unify the parameter of mkconfdesc function
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-27 12:53:15 -03:00
yangsong8
07aa8a5c57 usbdev: modify usb device support USB3.0 MaxPacketSize
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-27 12:53:15 -03:00
yangsong8
0788e68285 usbdev: usb device descriptor support USB3.0
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-27 12:53:15 -03:00
yangsong8
af017a5c30 usbdev: fix usb cdcecm build error
usbdev/cdcecm.c:295:3: error: invalid type argument of '->' (have 'struct net_driver_s')
  295 |   NETDEV_TXPACKETS(self->dev);
      |   ^~~~~~~~~~~~~~~~
usbdev/cdcecm.c: In function 'cdcecm_txdone':
usbdev/cdcecm.c:495:3: error: invalid type argument of '->' (have 'struct net_driver_s')
  495 |   NETDEV_TXDONE(priv->dev);
      |   ^~~~~~~~~~~~~

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-27 12:53:15 -03:00
jinxiuxu
575c9b12ab drivers/audio: fix samp rate conversion issue
use ac_controls.hw to get the correct sample rate intead of ac_controls.b

Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-27 22:00:39 +08:00
Masayuki Ishikawa
ec4d31515a fs: nfs: Fix nfsmount error
Summary:
- I noticed that nfsmount does not work due to the recent
  changes on sockaddr_storage alignment.
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested with sabre-6quad:netnsh_smp (QEMU)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2024-08-27 21:57:18 +08:00
pengyinjie
6b21bebcd1 [env]:Fixed spacing and typo issues in code comment descriptions
[Desc]: as title

Signed-off-by: pengyinjie <pengyinjie@xiaomi.com>
2024-08-27 21:52:56 +08:00
pengyinjie
cbc9b98075 [FS]:Fixed spacing and typo issues in code comment descriptions
[Desc]:as title

Signed-off-by: pengyinjie <pengyinjie@xiaomi.com>
2024-08-27 21:52:56 +08:00
hujun5
572daf46c2 irq: add isr thread
purpose:
To improve the real-time performance of the system, we prefer to perform
as few operations as possible within the interrupt function.
We have designed an interrupt thread for each interrupt,
where all the operations that are not necessary to be handled
in the interrupt function are delegated to be processed by the interrupt thread.
Up_enable_irq will be invoked after isrthread started.

Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
   -machine virt,virtualization=on,gic-version=3 \
   -net none -chardev stdio,id=con,mux=on -serial chardev:con \
   -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-08-27 21:49:53 +08:00
pangzhen1
8bb62e532c nuttx/syscall: delete getrandom in syscall.csv
delete getrandom in syscall.csv, because it has been moved to libc.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2024-08-27 21:44:33 +08:00
likun17
7913b249ca drivers/regmap: add exit function interface.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-08-27 21:43:58 +08:00
simbit18
1661a66843 [cmake]: added initial support for MSYS2
Currently concerns only arm.

tools/ci/testlist/msys2.dat:
At the moment I only added the board nucleo-l152re:nsh

.github/workflows/build.yml:
Enabled cmake for msys2
2024-08-27 21:36:12 +08:00
yangguangcai
3fa6cfc41e rpmsg_rtc:Update g_basetime from rpmsg.
When ipc is busy, g_basetime may be inconsistent
on different cores.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-08-27 21:35:17 +08:00
Ville Juven
12ba2eeb23 arm64_checkstack.c: Fix traversing of user stack when ARCH_ADDRENV=Y
Need to instantiate the correct address environment when reading from
user stack, otherwise the result is very likely a crash
2024-08-27 21:34:43 +08:00
Mingjie Shen
51c4a5c2d6 gd32f4xx_at24: Fix uninitialized use of local variables i2c and at24
Prior to this commit, i2c and at24 may be used uninitialized on line
113, 117, 129, and 143 when gd32_at24_wr_test() is called the second
time because these two variables are not static. I don't think making
them static is the correct fix because i2c is released at the end of
this function. Fixed by removing the `if (!initialized)` condition
surrounding the initialization of i2c and at24, making them initialized
at every call to this function.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2024-08-27 21:32:28 +08:00
yangguangcai
234c7d58bf rtc alarm:fix doesn't call nxsig_notification
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-08-27 10:18:10 -03:00
makejian
8de247543f crypto: export interfaces abort aes-cmac
Signed-off-by: makejian <makejian@xiaomi.com>
2024-08-27 07:44:06 -04:00
makejian
28974b8a21 crypto: export crc32 from /dev/crypto
Signed-off-by: makejian <makejian@xiaomi.com>
2024-08-27 07:44:06 -04:00
Ville Juven
963c5e8e52 arm64/imx9: Force 64-bit ELF format
The format is always 64-bits
2024-08-27 07:39:26 -04:00
guoshichao
599d41d806 greenhills: fix the pointless comparison build warning
"ioexpander/gpio.c", line 529: warning #186-D: pointless comparison of
          unsigned integer with zero
            if (pintype < GPIO_INPUT_PIN || pintype >= GPIO_NPINTYPES)
                        ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 07:33:09 -04:00
SPRESENSE
2cc9221c09 arch: cxd56xx: Add logic for i2c reset
Add ARCH_HAVE_I2CRESET configration to ARCH_CHIP_CXD56XX
and implement i2c reset function.
2024-08-27 12:29:46 +02:00
SPRESENSE
de8829f8cd arch: cxd56xx: Fix SCU sensor data format
Add offset setting for sensor data to be written to SCU math function.
Fix comments in function descriptions.
2024-08-27 12:28:50 +02:00
Samuel Martinez
a6df724b4f BlackPill buttons example
Description:
Example to interact with KEY button and user external button connected to PA1.
For KEY button pull-up resistor is active, board schematic does not show any pull-up or pull-down resistor.

Results: Example working as expected.

BlackPill PWM example

Description:
PWM example using PB0 - Timer3 - Channel 3
Create default configuration for the example.

Controlling_RGB_LED

Description: Controlling a RGB LED on NuttX for Black Pill board [STM32F411]

Note: Example currently not working as expected.
2024-08-27 09:13:35 +08:00
Samuel Martinez
447f03cfd0 Led and buttons examples
Description:
Test LED examples on freedom-k66f, nucleo-f401re and blackpill-f411ce boards.
Update linker file for bluepill-f103c6.
2024-08-27 09:13:35 +08:00
zhaoxingyu1
517d55a2ce nvs: modify nvs block size and block numbers
mtd_config_fs/Kconfig: update nvs block size and block number to configurable

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2024-08-26 20:55:24 -04:00
yangguangcai
352e3a6873 armv7-a timer:fix timer overflow.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-08-26 17:50:47 -04:00
wanggang26
dfffaee706 mmcsd: add write ext csd reg support
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-08-26 17:45:43 -04:00
Zhe Weng
90c0acce05 net/tun: Support changing carrier state of TUN/TAP
Add TUNSETCARRIER ioctl, then we may change the carrier state of TUN dynamically. Note that we don't need an ioctl for getting carrier, it can be done by SIOCGIFFLAGS already.

Ref: https://github.com/torvalds/linux/blob/v6.10/drivers/net/tun.c#L3374-L3380

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-08-26 17:34:23 -03:00
yanghuatao
33ddf1a297 toolchain/ghs: Fix green hills toolchain build Vela warnings
ccarm: Warning: Option "-fomit-frame-pointer" not supported in this product
ccarm: Warning: Unknown option "-Wno-cpp" ignored.  Did you mean "--nocpp"?
ccarm: Warning: Unknown option "-pipe" passed to linker
ccarm: Warning: Unknown option "-Wno-psabi" ignored.  Did you mean "-Wno-convert64"?
ccarm: Warning: Option "-fomit-frame-pointer" not supported in this product
ccarm: Warning: Unknown option "-Wno-cpp" ignored.  Did you mean "--nocpp"?
ccarm: Warning: Unknown option "-pipe" passed to linker
[asarm] (warning #2073) unknown option: -mimplicit-it=always
Warning: Unknown option "-pipe" passed to linker
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-08-27 01:56:34 +08:00
guoshichao
3bb30231a9 greenhills: fix the file build path error
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 01:56:34 +08:00
guoshichao
e5f40db601 greenhills: fix the "etc/init.d/rc.sysinit" file preprocess error
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 01:56:34 +08:00
guoshichao
c2d26988fd greenhills: fix double-precision float operation running error
since not all Armv7-m platform support double-precision floating
operations, so we add an extra option that help those specific platform
could define the single-precision floating operations.
for example, qemu-mps platform(armv7-m) support double-precision
floating operations, so we do not need to open
CONFIG_ARM_FPU_SINGLE_HARDWARE build options;
but for fc7300 platform(armv7-m) only support single-precision floating
operations, so if we pass "-fhard" build option to "ghs" compiler, then
the following instruction will be generated:
vcvt.f64.s32    d9, s18
which will fail to execute on fc7300 platform.
with "-fsingle" build option, the "ghs" compiler will generate hardware
instruction for single-precision floating operation, and generate
software instruction for double-precision floating operation.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 01:56:34 +08:00
guoshichao
90a6ced9c1 arch/arm/toolchain: add --entry_std LDFLAGS for different toolchain
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 01:56:34 +08:00
pangzhen1
d2ec034ada support inputting multiple ldscript files when linking the nuttx.bin
To support greenhill compilation, LDFLAGS removes the code that adds -T through addprefix to ARCHSCRIPT(greenhill requires a space between -T and ldscript files, but addprefix didn't do it). However,if we modified like this, when ARCHSCRIPT has more than one ldscript, the -T is only added to the first ldscript, but not to the following ldscripts, which results in a warning when linking.
To solve this problem, we can just add a space after $(SCRIPT_OPT) when using addprefix, instead of deleting addprefix.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2024-08-27 01:56:34 +08:00