Commit Graph

46325 Commits

Author SHA1 Message Date
wangbowen6
25c2f3e042 driver: move find_mtddriver() to fs.h and add close_mtddriver.c
Rpmsg mtd need a way to find the mtd device according to the
mtd device path.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-09 19:27:57 +08:00
Victor Benso
2892f18f15 Fix some register's values, enable TWAI extended registers and add a missing prototype.
Also, replaced critical_sections with spinlocks.
2022-09-09 15:30:35 +08:00
GD32-MCU
85c8144afa add chip GD32F450 of GD32MCU
Modify the file according to the checks

update the board config files, and modify the gd32f4xx_progmem.c

Add chip GD32F450 of GD32MCU

delete the micro FAR, modify code style

Add chip GD32F450 of GD32MCU
2022-09-09 15:29:35 +08:00
curuvar
e8f4d74ad0 RP2040 Code Cleanup 2022-09-09 12:43:40 +08:00
Nathan Hartman
9b56bb86da Kconfig: EXPERIMENTAL: Add help text and change prompt label 2022-09-08 23:37:48 +08:00
Eero Nurkkala
5cedf1ef2a risc-v/mpfs: usb: fix usb restart
Issuing the following commands doesn't succeed:
  - conn
  - disconn
  - conn
This USB driver doesn't even disconnect without this patch.

If the USB driver has been started from another hart, closing it
will not disable the PLIC interrupt. This means it's possible many
harts get the USB interrupt and thus make the USB look very unstable.

Fix these problems by disconnecting the USB via the USB_POWER
register at shutdown and disabling the interrupt at shutdown. Also
clear the software internals via the mpfs_sw_setup() for the conn /
disconect loop to succeed.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-08 22:08:17 +08:00
curuvar
0322a61510 Add watchdog driver support to RP2040 2022-09-08 21:41:13 +08:00
ligd
4bd88acf1b wqueue: fix work_qcancel() judge error caused by the union in struct work_s
in struct work_s:
union
{
  struct
  {
    struct dq_entry_s dq; /* Implements a double linked list */
    clock_t qtime;        /* Time work queued */
  } s;
  struct wdog_s timer;    /* Delay expiry timer */
}

while we use WDOG_ISACTIVE(&work->timer) to decide use dq or timer,
that is error, wd_cancel() maybe modify this area, dq_rem() also can
modify this area.
So we can't use the WDOG_ISACTIVE(&work->timer) to take as the judgement,
when there is a union.

Fix:
swap the order in struct wdog_s, move the arg to the second 32bit

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00
ligd
4a87578bdb wqueue: change single queue to double queue to improve speed
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00
ligd
2cc3ec57ef queue: add dq_rmafter support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00
Neale Ferguson
213b954a90 * Squash round() commits
- Add check in roundx() functions for infinite or NaN cases
  - Add block to avoid style warnings
  - Define long double constants and macros for infinity and nan
  - Correct return syntax to match NuttX style
  - Make c89 compliant
  - Fix definitions of INFINITY_L/NAN_L

* include/nuttx/lib/math.h - match standard naming conventions
  - Rename isinf_l to isinfl
  - Rename isinf_f to isinff
  - Add finite()
  - Add finitel()
  - Add finitef()
  - Define isnanl and isnanf
  - Define isfinite() so that it uses the appropriate macro

* libs/libc/math/lib_asinf.c
  libs/libc/math/lib_asinl.c
  libs/libc/math/lib_roundf.c
  libs/libc/math/lib_roundl.c
  libs/libc/math/lib_sqrtf.c
  libs/libc/math/lib_sqrtl.c
  - Use renamed macros
  - Use correct NAN_x or INFINIT_x macro on returns
2022-09-08 20:57:27 +08:00
Amir Melzer
5e22dcb73b modify clock config 2022-09-08 20:55:53 +08:00
chao an
7c6e4a7204 drivers/ipcc: enter/leave critical section should in pairs
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-08 19:37:18 +08:00
chao an
b6e76966b9 net/procfs: interface index should begin from 1
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-08 18:09:43 +09:00
chao an
66d9397320 netdev/ioctl: netlock/unlock() should in pairs
fix regression by:

commit fd53db56b6
Author: chao an <anchao@xiaomi.com>
Date:   Wed Sep 7 10:56:09 2022 +0800

    net/netdev: simplify handling of netdev ifr ioctl()

    1. call netdev_ifr_dev() only once
    2. unify the error code of ENODEV

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-08 15:50:45 +08:00
chao an
fd53db56b6 net/netdev: simplify handling of netdev ifr ioctl()
1. call netdev_ifr_dev() only once
2. unify the error code of ENODEV

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-08 11:05:13 +08:00
wangbowen6
4e1097280a telink: add custom setjmp implementation for tlsr82.
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-08 09:15:25 +08:00
chao an
4068b2eccc net/procfs: add entry mapping table
add entry mapping table to simplify new component registration

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-08 09:03:34 +08:00
chao an
3913ef2f2f net/inet: invalid addrlen length should return EINVAL
https://www.freebsd.org/cgi/man.cgi?connect

[EINVAL] The namelen argument is not a valid length for the address family.

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-08 09:02:30 +08:00
chao an
fc626543fd audio/audio: remove invalid assign of errno
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-08 09:02:15 +08:00
Nathan Hartman
de8d54781c fs: Fix symbol name in comments 2022-09-08 09:01:55 +08:00
Nathan Hartman
09a186727c fs/vfs/fs_open.c: Improve documentation blocks of functions 2022-09-08 09:01:36 +08:00
curuvar
05b19e02d9 Eliminate un-needed wait in rp2040 SMART filesystem 2022-09-08 09:00:52 +08:00
curuvar
d3b226aea1 Fix race condition in RaspberryPi Pico W WiFi 2022-09-08 09:00:33 +08:00
Xiang Xiao
e17b678a16 compiler.h: Rename inline_function to always_inline_function
reserve inline_function macro for inline keyword

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-07 10:24:04 +02:00
Nathan Hartman
b04ae46ea6 boards/arm/tiva: Add tm4c129e-launchpad
* boards/arm/tiva/tm4c129e-launchpad: New subdirectory providing
  board support for the Texas Instruments TM4C Crypto Connected
  LaunchPad, or more correctly the EK-TM4C129EXL.

* Documentation/introduction/detailed_support.rst,
  Documentation/introduction/supported_platforms.rst,
  boards/README.txt: Document the additional board support.

* boards/Kconfig:
  (ARCH_BOARD_TM4C129E_LAUNCHPAD): New config.
  (ARCH_BOARD): Add tm4c129e-launchpad.
  (Board-Specific Options): Source the board-specific Kconfig
   boards/arm/tiva/tm4c129e-launchpad/Kconfig when selected.
2022-09-07 14:15:48 +08:00
Masayuki Ishikawa
22a5cc0973 drivers: wireless: Add SIOCGIFFLAGS support to gs2200m.c
Summary:
- I noticed that the latest ifconfig command shows nothing
- Finally, I found that gs2200m.c needs to handle SIOCGIFFLAGS
- This commit fixes this issue

Impact:
- gs2200m only

Testing:
- Tested with spresense:wifi
- NOTE: gs2200m_main.c will be updated later

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-09-07 11:21:20 +08:00
ligd
3b04450808 sched: fix corner case wd_cancel assert crash
There one ways can caused this:
mq_timedreceive
   TIMER IRQ do wd_timer -> wd_func1 mq_send
                         -> wd_func2 nxmq_rcvtimeout -> crash

Resolve:
Stop the watchdog when mq_send

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-07 10:50:28 +08:00
zhanghongyu
9bff29d7e7 udp: add IPVx_PKTINFO related support
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-09-07 10:49:47 +08:00
ligd
94cf99f310 sim: fix signal crash in SMP mode
reproduce:
sim:smp
ostest

reason:
shouldn't do sim_sigdeliver() in irq handler

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-07 09:33:36 +09:00
Sebastien Lorquet
179d64d999 stm32h7: SPI is no more experimental 2022-09-06 19:34:40 -04:00
Sebastien Lorquet
3e16b6c9f1 update conditionals to select stm32h7 spi peripherals 2022-09-06 19:34:40 -04:00
chao an
54dba40f87 net/netdev/ioctl: correct the argument length of ioctl MII/PHY
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-07 03:33:41 +08:00
Xiang Xiao
9726be616a fs: Run the default action of FIONBIO/FIOCLEX/FIONCLEX in success path
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-06 23:16:15 +08:00
Eero Nurkkala
4df8b16060 risc-v/mpfs: usb: provide more endpoints
The underlying hardware supports 9 endpoints:
  - EP0
  - 4x IN EPs
  - 4x OUT EPs

Currently the driver assumes every EP number is unique. This limits
the amount of EPs to 1 + 4 = 5. Utilize the EPs in such a manner
that all may be used.

Also fix a few error handling related bugs. Update the composite
driver to match the current situation as well.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-06 23:10:30 +08:00
Xiang Xiao
e0bb281e7a net: Align the prototype of sock_intf_s::si_ioctl with file_operations::ioctl
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-06 22:46:37 +08:00
chao an
0978dcf88d net/mld/route: fix build warning
In file included from route/net_del_ramroute.c:30:
route/net_del_ramroute.c: In function ‘net_match_ipv4’:
route/net_del_ramroute.c:93:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
   93 |   ninfo("  target=%08lx netmask=%08lx\n",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
route/net_del_ramroute.c:93:23: note: format string is defined here
   93 |   ninfo("  target=%08lx netmask=%08lx\n",
      |                   ~~~~^
      |                       |
      |                       long unsigned int
      |                   %08x

mld/mld_timer.c: In function ‘mld_gendog_work’:
mld/mld_timer.c:118:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  118 |   ifindex = (int)arg;
      |             ^
mld/mld_timer.c: In function ‘mld_v1dog_work’:
mld/mld_timer.c:237:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  237 |   ifindex = (int)arg;
      |             ^

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-06 18:24:20 +08:00
baggio63446333
e5e03b67c2 documentation: Fix links to pull requests in release notes
In the ReleaseNotes, fix link errors to each pull request.
2022-09-06 08:49:18 +02:00
curuvar
89d3ba44ca Fixes to RP2040 SMART flash and documentation 2022-09-06 13:13:00 +08:00
Alin Jerpelea
ac4af3ff49 documentation: Add release notes for 11.0.0 release
This is a local copy taken from the confluence notes
 https://cwiki.apache.org/confluence/display/NUTTX/NuttX+11.0.0

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-09-05 22:53:01 +08:00
anjiahao
1a5351edac libc:add timingsafe_bcmp to libc
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-09-05 22:27:05 +08:00
anjiahao
21934122d5 include:endian.h add openbsd style
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-09-05 10:39:36 -03:00
curuvar
9ad75fd95d Added SMART flash filesystem to RP2040 2022-09-05 10:38:56 -03:00
Juha Niskanen
fb852440af pthread: fix typo with CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_INHERIT
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2022-09-05 15:36:23 +02:00
xiangdong6
460d94729a mm: Check the function result with suitable macro.
The return value of function mm_takesemaphore will never below
than zero, DEBUGVERIFY make no effect to check it, use DEBUGASSERT
instead.

Signed-off-by: xiangdong6 <xiangdong6@xiaomi.com>
2022-09-05 21:11:01 +08:00
Junbo Zheng
74ab851ac4 nuttx/libs/libc/time: fix runtime error by UBSan
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-09-05 14:55:25 +08:00
Michal Lenc
23b27419e2 imxrt/encoder: add support for index position capture
This commit enhances imxrt encoder driver with index capture support.
The index is captured when the index interrupt occurs and can be passed
to application layer with QEIOC_GETINDEX ioctl call.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2022-09-04 11:08:45 +08:00
Michal Lenc
8e2b4576bf sensors/qencoder: add QEIOC_GETINDEX ioctl
This IOCTL (QEIOC_GETINDEX) allows the application to get the actual
encoder position, the index last position and the index count with
one IOCTL call if supported by architecture specific level.

The position, index and count is passed to application level through
qe_index_s structure.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2022-09-04 11:08:45 +08:00
zhangyuan21
1a9252aec9 nuttx/queue: change some queue function to macro 2022-09-04 11:08:02 +08:00
chao an
1b9c013dad sched/wqueue: fix visual studio Compiler Error C2059
Designated initializers are a C99 (or newer) feature, and Visual Studio doesn't (part) support C99 (or newer).

D:\code\incubator-nuttx\sched\wqueue\kwork_thread.c(94,50): error C2059: syntax error : ','

Reference:
https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-160#c-standard-library-features-1
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2059?view=msvc-170

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-03 23:31:04 +08:00