Commit Graph

52134 Commits

Author SHA1 Message Date
Lwazi Dube 2dac5e1b6a bluetooth: Prevent btsak from repeatedly showing the same error. 2024-01-14 02:16:48 -08:00
Takeyoshi Kikuchi f01e395b1c fs: partition: fs_mbr: fix for MBR block count calculation.
When the MBR partition size exceeds 2 GiB, a 32-bit wrap-around occurs,
causing an error in the block count calculation.

* wrong
 brw-rw-rw- 5150605312 mmcblk0
 brw-rw-rw-  629145600 mmcblk0p1
 brw-rw-rw-  225443840 mmcblk0p2 <--

* fixed
 brw-rw-rw- 5150605312 mmcblk0
 brw-rw-rw-  629145600 mmcblk0p1
 brw-rw-rw- 4520411136 mmcblk0p2 <--

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2024-01-14 01:29:24 -08:00
Yanfeng Liu 78e8c0dea5 risc-v/nuttsbi: add device specific initialization hook
Some devices have special preparations before entering S-mode, thus
a hook is needed from NUTTSBI to give them the chance.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-14 01:28:10 -08:00
Tiago Medicci Serrano 8fb05d44bc esp32s3/wifi: Fix Wi-Fi connection to WPA3-SAE APs.
This commit fix the connection issues while trying to connect to
WPA3-SAE-secured Access Points (APs).
2024-01-12 16:57:49 +01:00
Yanfeng Liu f221878204 risc-v/nuttsbi: use ARCH_RV_MMIO_BITS for mtimer access selection
Chips like K230 has ARCH_RV64 but only supports 32-bit MMIO. So using
ARCH_RV_MMIO_BITS is more proper here.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-11 21:48:44 -08:00
chenwen@espressif.com b739b2b18a xtensa/esp32s3: Support WPA3 on softap mode
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-01-12 13:41:58 +08:00
Lwazi Dube d13065468e boards/sama5d3-xplained: Add USB mouse initialization. 2024-01-11 18:29:30 -08:00
dependabot[bot] 86638b6a0e build(deps): bump jinja2 from 3.1.2 to 3.1.3 in /Documentation
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.2...3.1.3)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-11 21:38:34 -03:00
Ville Juven 983387e6dd mpfs_mpucfg.c: Add mpfs_mpu_lock()
Add method to lock an MPUCFG entry. Locking means the value of the register
cannot be changed until the SoC is reset.
2024-01-11 06:57:16 -08:00
Ville Juven a0901ec142 mpfs_usb.c: Remove PMPCFG configuration from the driver
This is not the right place to modify DMA memory protection values.

Why not? These are designed to protect other AMP mode instances. Opening
the entire SoC's memory for the USB DMA kind of defeats this purpose.

Also, the driver cannot know how to configure these registers correctly,
only opening up the whole SoC "works".
2024-01-11 06:50:51 -08:00
chao an c04f1e7789 drivers/serial/pl011: add FAR specifier
Signed-off-by: chao an <anchao@lixiang.com>
2024-01-11 13:39:06 +01:00
chao an 1dd9f64287 drivers/serial/pl011: add support of uart0/2/3 port
Signed-off-by: chao an <anchao@lixiang.com>
2024-01-11 13:39:06 +01:00
chao an 5f51aba1be serial/pl011: rename serial_pl011 to uart_pl011
The lower half driver should be prefixed with "uart_"

Signed-off-by: chao an <anchao@lixiang.com>
2024-01-11 13:39:06 +01:00
chao an 181a31801d arm/armv8r: remove unused serial_pl011.h
Signed-off-by: chao an <anchao@lixiang.com>
2024-01-11 13:39:06 +01:00
chao an b7bd2e33b1 arm/armv8-r: wfi secondary cores if SMP is disabled
Check cpu affinity in single core mode to avoid secondary cores bootup

Signed-off-by: chao an <anchao@lixiang.com>
2024-01-11 12:29:59 +01:00
chao an 6e940b74f5 arm/fvp-v8r: fix arm_earlyserialinit() is not called correctly
USE_EARLYSERIALINIT will depends on the definition in arm_internal.h

Signed-off-by: chao an <anchao@lixiang.com>
2024-01-11 00:52:17 -08:00
wangyongrong 976aa5552f rptun: remove rptun work queue related unused code
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-11 00:51:57 -08:00
chao an 5eef09b4a1 arm/armv8-r: fix compile warning
armv8-r/arm_gicv3.c: In function 'gic_validate_dist_version':
armv8-r/arm_gicv3.c:730:9: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
  730 |   sinfo("GICD_TYPER = 0x%x\n", typer);
      |         ^~~~~~~~~~~~~~~~~~~~~  ~~~~~
      |                                |
      |                                uint32_t {aka long unsigned int}
armv8-r/arm_gicv3.c:730:26: note: format string is defined here
  730 |   sinfo("GICD_TYPER = 0x%x\n", typer);
      |                         ~^
      |                          |
      |                          unsigned int
      |                         %lx

Signed-off-by: chao an <anchao@lixiang.com>
2024-01-11 00:51:28 -08:00
Yanfeng Liu a9372627d8 risc-v/rv-virt: use fully linked apps for kernel build
Fully linked apps take less storage and are efficient to load. This
is to enable them for rv-vrit configurations in KERNEL build.

Changes:

- arch/risc-v/Kconfig       select BINFMT_ELF_EXECUTABLE for QEMU-RV
- boards/risc-v/qemu-rv/rv-virt/configs
  - knsh32/defconfig        enable ELF_EXECUTABLE, LIBM, OSTEST
  - knsh64/defconfig        enable ELF_EXECUTABLE, LIBM, OSTEST
  - ksmp64/defconfig        enable ELF_EXECUTABLE, LIBM, OSTEST
  - knetnsh64/defconfig     enable ELF_EXECUTABLE, LIBM, OSTEST
  - knetnsh64_smp/defconfig enable ELF_EXECUTABLE, LIBM, OSTEST

Additions:
- boards/risc-v/qemu-rv/rv-virt/scripts/
  - gnu-elf.ld              apps linker script

The ARCH_TEXT_VBASE of knsh32 is set to same as that of 64bit to reuse
the apps linker script.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-11 00:51:07 -08:00
wangyongrong 5a39935d4f rpmsgmtd: use fixed length struct to transfer between two cpus
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-11 08:33:15 +01:00
Yanfeng Liu da365c1cb0 risc-v/canmv230: enable fully linked apps for kernel build
Previously apps in kernel build are partially linked, thus are
big and inefficient. This enables full link for kernel mode apps
to reduce size and speed up loading.

Changes:

- arch/risc-v/Kconfig          select HAVE_ELF_EXECUTABLE for K230
- boards/../scripts/Make.defs  adjust LDELFLAGS
- boards/../knsh/defconfig     enable BINFMT_ELF_EXECUTABLE

Additions:
- boards/../scripts/gnu-elf.ld apps linker script

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-10 23:27:46 -03:00
chenwen@espressif.com a774587088 esp32s3/rt_timer: Adjust spinlock position to avoid deadlock 2024-01-11 09:22:52 +09:00
Tiago Medicci Serrano f4485a58e3 esp32s3_devkit/sta_softap: Reenable SMP on `defconfig`.
This reverts commit e25fcb3bd5.
The issue - related to a deadlock in the RT-Timer - was properly
solved.
2024-01-11 09:22:52 +09:00
Tiago Medicci Serrano 823a183c17 esp32s3/rt_timer: Fix deadlock on RT-Timer thread.
The RT-Timer thread may call the `start_rt_timer` function. This
function gets the spinlock with interrupts disabled to ensure
exclusive access. However, this was already being performed in the
RT-Timer thread, causing a deadlock.
2024-01-11 09:22:52 +09:00
Roy Feng 4761af7069 esp32[s2|s3] Following up update interrupt type constants.
Following up the 'Espressif HAL fullly integration for ESP32s2/s3'
changes in https://github.com/apache/nuttx/pull/11428
There are few missing interrupt type constants need update. So
update them to avoid the build error.
2024-01-10 09:54:55 -08:00
zhanghongyu b3dcebce07 linux/Dockerfile: Add the python3 coloredlogs package for the matter build
Depend on this package when we compile using the build_examples.py script that comes with matter.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-01-10 09:47:54 -08:00
fangxinyong f2bcb0d2d8 tools/ci: revert tmp change
for apache/nuttx#11498 to pass ci, need revert after all commits are merged

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-01-10 01:58:53 -08:00
fangxinyong c479ccb8aa sched: move etc romfs mount from nsh to sched/init
Usually the startup script is placed under /etc. The contents of the etc directory
are compiled and linked with Nuttx binary in the form of romfs. After startup,
it will be  mounted by Nsh.

etc is generated by the different boards, that use genromfs and xxd tools to generate
and compile it into the Nuttx, for example: boards/arm/at32/at32f437-mini/tool/mkromfs.sh
The more common method is etc image generated from the content in the corresponding
board/arch/board/board/src/etc directory, and added by Makefile for example:
boards/sim/sim/sim/src/etc.

But in kernel/protected mode, Nuttx kernel and apps are run in different privileged/
non-privileged mode or the isolated binarys, so as that nsh should use syscall to
access Nuttx kernel by exported API. In this scenario, nsh can not mount the etc image
content, because that is generated in board and as a part of Nuttx kernel.

changes:

- move etc romfs mount from nsh to Nuttx, but keep the script to parse and execute.
- move and rename the related CONFIG, move customized nsh_romfsimg.h to etc_romfs.c
  in boards, and no need declaration for romfs_img/romfs_img_len.

This commit changes and updates all configurations in Nuttx arch/board as much as possible,
but if any missing, please refer to the following simple guide:

- rename CONFIG_NSH_ROMFSETC to CONFIG_ETC_ROMFS, and delete CONFIG_NSH_ARCHROMFS in defconfig
- rename the etc romfs mount configs, for example CONFIG_NSH_FATDEVNO to CONFIG_ETC_FATDEVNO
- move customized nsh_romfsimg.h to etc_romfs.c in board/arch/board/board/src and no need
  declaration for romfs_img/romfs_img_len.
- delete default nsh_romfsimg.h, if ROMFSETC is enabled, should generate and compile etc_romfs.c
  in board/arch/board/board/src.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-01-09 21:29:46 -03:00
wangyongrong 62698051c7 rptun ping: fix data format warning
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-09 06:06:40 -08:00
wangyongrong 661171661f rptun ping: fix code format in rptun ping
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-09 06:06:40 -08:00
wyr8899 df09e40e3a rptun ping: support data checksum and data transfer rate calculation
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-09 06:06:40 -08:00
Zhe Weng 3b74cfecc2 net/route: Support longest prefix match for routing
Support longest prefix match routing described as "Longest Match" in
RFC 1812, Section 5.2.4.3, Page 75.

Introduced `prefixlen` to indicate the prefix length of currently
founded route, and only looks up for longer prefix in all later steps.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-01-09 05:58:10 -08:00
Zhe Weng 54f3452293 net/route: Fix null pointer access when ramroute is full
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-01-09 05:58:10 -08:00
Zhe Weng 688f0e9117 net: Only call arp_send for PF_INET and icmpv6_neighbor for PF_INET6
If we only enable one of `CONFIG_NET_ARP_SEND` and
`CONFIG_NET_ICMPv6_NEIGHBOR`, both IPv4 and IPv6 traffic will send
ARP or NDP, which causes problem.

Example:
`CONFIG_NET_ARP_SEND=n`
`CONFIG_NET_ICMPv6_NEIGHBOR=y`

Wrong:
IPv4 traffic (`PF_INET`) goes into `icmpv6_neighbor`, which
definitely causes problem.

Correct:
IPv4 traffic doesn't call anything, IPv6 traffic calls `icmpv6_neighbor`

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-01-09 05:56:28 -08:00
simbit18 eaf1d07809 tools/ci: add initial support for MSYS2
removed uname from msys2 job
2024-01-09 05:50:09 -08:00
wangyongrong 540e7f475f rpmsgfs: synchronous message transfer format
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-09 05:49:03 -08:00
Philippe Leduc e59c95bc9b Fix mx8mp ecspi interruption management. 2024-01-09 05:48:12 -08:00
Alin Jerpelea c04118309c Documentation: add NuttX-12.4.0 release notes
Add release notes for 12.4.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-01-09 05:47:24 -08:00
simbit18 39e01289b6 .gitignore: Added ignore file .fakelnk
Added ignore file .fakelnk for make distclean in MSYS2
2024-01-08 17:38:27 -08:00
simbit18 8b0bc64903 tools/link.sh: fix an incorrect variable
fix ${desg} ->  ${dest}
2024-01-08 19:46:59 -03:00
Yanfeng Liu dd1365ef85 risc-v/canmv230: add PROTECTED build support
Additions:

- In arch/risc-v/src/k230/
  - k230_userspace.c      add user space initialization
  - k230_userspace.h      headers for user space initialization
- In boards/risc-v/k230/canmv230/kernel/
  - k230_userspace.c      userspace_s const data definition
  - Makefile              pass1 Makefile
- In boards/risc-v/k230/canmv230/scripts/
  - ld-protected.script   linker script for protected build kernel
  - ld-userland.script    linker script for protected build userspace
- In boards/risc-v/k230/canmv230/configs
  - pnsh/defconfig        defconfig for protected build

Changes:

- In arch/risc-v/src/k230/
  - k230_start.c          add protected build handling logic
  - Make.defs             add protected build support
- In boards/risc-v/k230/canmv230/scripts/
  - Make.defs             add protected build support
- In Documentation/platforms/risc-v/k230/boards/canmv230/
  - index.rst             add protected build usage

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-08 19:46:42 -03:00
Bowen Wang 514f020ace nucleo-h745zi/stm32_bringup.c: the cpuname should be the remote cpu name
The share memory name should be same, and the cpuname is the remote
cpu name.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-01-08 19:53:54 +01:00
Rodrigo Sim 21b02f176f stm32f401rc-rs485: Add rs-485 support 2024-01-07 17:15:59 -08:00
Rodrigo Sim 7b9b630073 nucleo-l432kc: Fix board configuration for USART2 2024-01-07 17:12:15 -08:00
Yanfeng Liu b516b29efc risc-v/k230: revise CanMV230 kernel build support
changes:
- under boards/risc-v/k230/canmv230/scripts/:
  - Make.defs           add POSTBUILD actions
  - ld-flat.script      minor reformating
  - ld-kernel.script    minor reformating
- under boards/risc-v/k230/canmv230/src/:
  - Makefile            add clean of generated ROMFS source
  - canmv_init.c        use `ferr` and drop too late runtime warning
  - romfs_stub.c        use const for romfs_img_len

The POSTBULD actions can warn stub ROMFS usage at build time, thus
the too late warning in canmv_init.c can be removed.
The cleaning of `libboard.a` in POSTBUILD can also ensure real ROMFS
is in use, as some times weak_data is still in use.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-07 06:40:10 -08:00
David Sidrane 73bfeccc3f imxrt:ENET Use multi PHY
Allow a board to specify a list of PHYs.
  Then use this list, at run-time, to select and use the
  PHY populated on the board.
2024-01-06 04:26:12 -08:00
David Sidrane 93f37ab1da net:Add support for multi PHY
Support runtime phy selection based on a list
   supplied by board.h
   For Example:

   #define BOARD_ETH0_PHY_LIST                   \
	{                                        \
		"LAN8742A",                      \
		MII_PHYID1_LAN8742A,             \
		MII_PHYID2_LAN8742A,             \
		MII_LAN8740_SCSR,                \
		0,                               \
		0xffff,                          \
		MII_LAN8720_SPSCR_10MBPS,        \
		MII_LAN8720_SPSCR_100MBPS,       \
		MII_LAN8720_SPSCR_DUPLEX,        \
		22,                              \
	},                                       \
	{                                        \
		"TJA1103",                       \
		MII_PHYID1_TJA1103,              \
		MII_PHYID2_TJA1103,              \
		0xffff,                          \
		18,                              \
		0xffff,                          \
		0,                               \
		MII_LAN8720_SPSCR_100MBPS,       \
		MII_LAN8720_SPSCR_DUPLEX,        \
		45,                              \
	},                                       \
2024-01-06 04:26:12 -08:00
Bowen Wang e9a146bbfc virtio-mmio: use byte to byte in read/write config when length != 1,2,4,8
The length of some config elements are not equal to 1,2,4,8, so we can't
assert in virtio_mmio_config_read/write() direclty when length != 1,2,4,8

For example, in virtio_net_config from virtio spec v1.2
struct virtio_net_config {
	u8 mac[6];
	le16 status;
	le16 max_virtqueue_pairs;
	le16 mtu;
	le32 speed;
	u8 duplex;
	u8 rss_max_key_size;
	le16 rss_max_indirection_table_length;
	le32 supported_hash_types;
};

The mac length is 6 and not equal to 1,2,4,8

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-01-06 04:23:05 -08:00
YAMAMOTO Takashi d0335f089f cmake: fix CONFIG_HAVE_CXXINITIALIZE on macOS
Note: This implementation is a bit more relaxed than what we do for
non-cmake builds. Mainly because I'm not familiar enough with cmake
to mirror what the non-cmake version does.
2024-01-06 04:21:52 -08:00
YAMAMOTO Takashi 32ea2914c0 cmake: use -fvisibility=default for "arch"
so that macos build can find "_sim_netdriver_setmacaddr" etc.
2024-01-06 04:21:52 -08:00