Commit Graph

50816 Commits

Author SHA1 Message Date
wangjianyu3
c749e4bfbd binfmt: ELF support load to LMA
Load all sections to LMA not VMA, so the startup code(e.g. start.S) need
relocate .data section to the final address(VMA) and zero .bss section by self.

For example, SiFli and Actions: Background: Device with small sram,
Bootloader run in sram and psram, need boot to Application, with memory overlap
and without XIP. VMA of .data is in "psram" and LMA in "rom", if not enable
`ELF_LOADTO_LMA`, ELF loader will load the section to VMA (will fill bootloader
itself).

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2023-09-04 12:23:26 +08:00
simbit18
d7359bf076 Documentation/quickstart/configuring.rst: Add credentials for NSH session
Add credentials on code blocks  Build & run
2023-09-03 19:03:54 -03:00
Xiang Xiao
7f3a76c290 Replace strlen with sizeof for kconfig string
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-02 16:26:23 +03:00
TimJTi
3b4ea52a79 Remove spinlock, change to i2c_readwrite where appropriate , and consolidate i2c read and write calls. 2023-09-02 16:26:10 +03:00
Alan Carvalho de Assis
c27c33e9a9 Run refresh.sh to update all board configs 2023-09-02 14:45:44 +08:00
Alan Carvalho de Assis
569a4d48b9 Enable ERR/WARN/INFO when selecting DEBUG_FEATURES
When the user selects the debug features it will enable
the Debug Errors, Warning and Info by default avoiding
the issue: https://github.com/apache/nuttx/issues/10452

User still need to enable individual debug for each
subsystem, so this patch didn't increase binary size.
2023-09-02 14:45:44 +08:00
rongyichang
c898461ca5 video/fb: add xres and yres for fb overlay
xres and yres of video overlay buffer may not same as primay framebuffer.
so add it to check the framebuffer count of overlay

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-09-01 23:19:13 +08:00
zhangyuan21
06d9356d12 usbdev: Use BOARD_USBDEV_SERIALSTR config directly
A usbdev has only one serial string, so use a unique macro to control it.

For boards that enable board serial string using COMPOSITE_BOARD_SERIALSTR,
PL2303_BOARD_SERIALSTR, CDCACM_BOARD_SERIALSTR, USBADB_BOARD_SERIALSTR,
USBMSC_BOARD_SERIALSTR, and RNDIS_BOARD_SERIALSTR, they need to be replaced
with BOARD_USBDEV_SERIALSTR.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-01 19:29:12 +08:00
Eero Nurkkala
f5cdfa73dc risc-v/mpfs: clear L2 before use
SiFive document: "ECC Error Handling Guide" states:

"Any SRAM block or cache memory containing ECC functionality needs to be
initialized prior to use. ECC will correct defective bits based on memory
contents, so if memory is not first initialized to a known state, then ECC
will not operate as expected. It is recommended to use a DMA, if available,
to write the entire SRAM or cache to zeros prior to enabling ECC reporting.
If no DMA is present, use store instructions issued from the processor."

Clean the cache at this early stage so no ECC errors will be flooding later.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-09-01 19:28:54 +08:00
zhanghongyu
b30a389459 usrsock_server: fix coverity for recvfrom handle
req->usockid may not be in a valid range when ret less than zero and not -EAGAIN.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-01 12:30:54 +03:00
zhanghongyu
3f927b63b7 tcp_input: update tx_unack before reorder_ofosegs
After the sack is enabled and the ofosegs has gap, tcp cannot update the
tx_unacked, so the peer received packets are retransmitted after the
timer timeout.
So update tx_unacked first.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-01 12:30:06 +03:00
makejian
e7f160bbe9 compile mbedtls alternative implementation
Signed-off-by: makejian <makejian@xiaomi.com>
2023-09-01 01:29:21 +08:00
simbit18
a642b7a54f Fix Kconfig style
Remove extra TABs
Add comments
2023-08-31 18:08:22 +03:00
Michal Lenc
dc83526368 samv7: include mpu.h in sam_boot_image.c to avoid compilation warnings
Header file mpu.h was not included although mpu_control() function
was used.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-31 18:07:40 +03:00
Philippe Leduc
98e998b934 Add i2c support for the i.MX8MP
Enable INA219 on the Verdin board
2023-08-31 10:35:46 -03:00
Ville Juven
779741d1d9 riscv/riscv_pmp.c: Improve NAPOT area validity checks
Check that the base address and region size are properly aligned with
relation to each other.

With NAPOT encoding the area base and size are not arbitrary, as when
the size increases the amount of bits available for encoding the base
address decreases.
2023-08-30 19:04:22 +03:00
chao an
7d1763a57c net/assert: remove all unnecessary check for psock/conn
Since inet/socket layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 20:36:49 +08:00
Xiang Xiao
4c3232a229 libc/machine: Fix ARMV[7|8]M_STRING_FUNCTION typo error in Kconfig
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-30 12:28:41 +03:00
Jukka Laitinen
697472dc07 arch/risc-v/src/mpfs/mpfs_ddr.c: Re-write write calibration
Clean up the code and remove un-used global variables & structs

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
f10dab5531 arch/risc-v/src/mpfs: Sync some of the libero config macros with HSS reference code
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Co-authored-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
c80b8fdf24 arch/risc-v/src/mpfs/mpfs_ddr.c: Add a simple prng for memory training code
Implement the previously empty mpfs_ddr_rand with adapted "seiran128" code
from https://github.com/andanteyk/prng-seiran

This implements a non-secure prng, which is minimal in size. The DDR training
doesn't need cryptographically secure prng, and linking in the NuttX crypto
would increase the code size significantly for bootloaders.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
f9b5918462 arch/risc-v/src/mpfs/mpfs_ddr.c: Make sure that DDRC is in reset when starting the training
Also move the DDRC clock enablement and reset to mpfs_init_ddr. This doesn't
change the functionality, but is the cleaner place for it.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
6baeb7217e arch/risc-v/src/mpfs/mpfs_ddr.c: Correct memory test timeouts
Especially the write calibration must bail out if the memory test timeouts,
otherwise the device will get stuck in running the memory test in sequence,
and it will always timeout.

Negative error value was also not properly returned from mpfs_mtc_test.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
d38eebc0e9 arch/risc-v/src/mpfs/mpfs_ddr.c: Don't auto-determine the write latency
It doesn't make sense to try to auto-determine write latency, it may pass with too low value.

Keep the existing implementation if the write latency has been set to minimum
value, otherwise just set it.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
8fb2e41994 arch/risc-v/src/mpfs/mpfs_ddr.c: Correct the DDR training dq/dqs status check
It was checking a wrong register for dq/dqs window size.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
chao an
3cbf13dd1d net/can: correct the return value if unsupported socket type
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 12:27:41 +03:00
chao an
664927c86e mm/alloc: remove all unnecessary cast for alloc
Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 14:34:20 +08:00
Eero Nurkkala
db13d5e24c drivers/mmcsd: fix regression causing emmcsd not working
Commit 50a8ec6 broke many mmc devices.  Only if the flag
priv->caps & SDIO_CAPS_4BIT_ONLY was set, it migth work.
Without the flag, the mmc clock is never set (mmcsd_widebus()
call is terminated early stopping the clock).  This flag
is probably not very generic because most mmc hw support
1, 4 and 8 bit modes.

JEDEC specifies a bus width selection procedure, but it's
not implemented in this mmcsd_sdio.c driver.  Thus, it's
not known whether the hw supports 1, 4 anf 8 bit modes or
a combination of them.

However, with priv->caps & SDIO_CAPS_4BIT_ONLY the driver
suddenly assigns priv->buswidth = MMCSD_SCR_BUSWIDTH_4BIT
making it the only way to have the driver working.

Fix this by relaxing the above mentioned restrictions.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-08-30 14:33:32 +08:00
dongjiuzhu1
c983aee38a driver/serial: fix race condition about calling rxflowcontrol in mutli thread
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-08-30 14:33:00 +08:00
dongjiuzhu1
ec4f6ecce2 driver/serial: fix error echo about VT100 escape sequence
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-08-30 14:26:11 +08:00
yangdongdong
1956385a7d libs/libc: Breakdown LIBC_BUILD_STRING into specific string operations macro.
Provide a way to only customize specific string operations,
such as for memcpy with the DMA capability by ROM.

Signed-off-by: yangdongdong <yangdongdong@xiaomi.com>
2023-08-29 22:55:18 +08:00
cuiziwei
4ec7af779d nuttx/boards:init_array.* needs to be executed in order
When I try to set priorities in certain programs, such as init_priority(HIGH_PRIORITY), I've noticed that during linking, there's no guarantee that the programs will be compiled in the sequence I've specified based on priority. This has led to some runtime errors in my program.

I realized that in the ld file, when initializing dynamic arrays, there's no assurance of initializing init_array.* before init_array. This has resulted in runtime errors in the program. Consequently, I've rearranged the init_array.* in the ld file of NuttX to be placed before init_array and added a SORT operation to init_array.* to ensure accurate initialization based on priorities during linking.
2023-08-29 22:54:37 +08:00
cuiziwei
e44f69921d nuttx/boards:Replace /r/n with /n 2023-08-29 22:54:37 +08:00
Petro Karashchenko
03614d60ee tools/ci: ensure removing python and openssl related commands
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-29 22:19:59 +08:00
Michal Lenc
f9d4a47889 pcf8575: fix compilation warnings
Just few compile warning fixes in case CONFIG_IOEXPANDER_MULTIPIN is
selected.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-29 20:34:12 +08:00
chao an
6340154f97 net/socket/bind: make sure that an address was provided
1. make sure that an address was provided on bind() call
2. correct the return value if bad socket handler

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 19:42:36 +08:00
Michal Lenc
b005f844f5 ioexpander: add support for ISO1I813T expander
This commit adds basic support for electrically isolated 8 bit expander.
The expander communicates with the MCU via SPI interface. Both single
and multiple pin read are supported.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-29 17:35:59 +08:00
dulibo1
ea7f6c5b07 battery:add FAR for battery_gauge_operations_s
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-29 17:35:29 +08:00
Philippe Leduc
5dbffd01b2 Export build variables to a CMake file so that it can be imported in a generic CMake toolchain file
Add a toolchain file for CMake that can be used in the exported NuttX archive.
2023-08-29 17:35:13 +08:00
chao an
b60f01a55b inode/i_private: remove all unnecessary cast for i_private
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 08:58:07 +02:00
SPRESENSE
f556cb106a drivers/video: Fix an issue isx019 may freeze
isx019 driver freezes by I2C access in the interrupt context.
This I2C access is intended to stop data output from FPGA.
Delete this I2C access for the following reasons.
- Data output from FPGA does not affect power consumption
- There are no problems in capture restart without data output stop
  since restart is done by image data block first.
2023-08-29 13:37:01 +08:00
chenxiaoyi
cc690f1d21 move task tls destruct to before _exit
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2023-08-29 12:05:57 +08:00
anjiahao
48c153db25 vfs:add nxsched_foreach to sched_lock avoid crash
If scheduling occurs in file_fsync,
fl_lock may be released, and an error may
occur when calling nxmutex_unlock

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-08-29 10:36:21 +08:00
Michal Lenc
fa63ef69c9 ioexpander: add support for ISO1H812G expander
This commit adds support for galvanic isolated ISO1H812G SPI expander.
Both single pin and multiple pin writes are supported.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-29 10:31:40 +08:00
xuxin19
94e6cfb662 cmake:fix invalid configs when export defconfig and .config
when func `nuttx_export_kconfig` is called for the second time,
the expired configuration will be retained causing compilation failure

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-29 09:51:20 +08:00
yinshengkai
221ae1f1d1 drivers/note: Add support for atrace mark/counter type
Use sched_note_mark to view event markers/counter in perfetto

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-29 09:48:15 +08:00
chao an
7aa45305b7 fs/inode: remove all unnecessary check for filep/inode
Since VFS layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 09:47:11 +08:00
chao an
baabf4bbf3 net/local: fix visual studio Compiler Error C2057
expected constant expression
The context requires a constant expression, an expression whose value is known at compile time.
The compiler must know the size of a type at compile time in order to allocate space for an instance of that type.

Reference:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2057?view=msvc-170
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 09:45:44 +08:00
wangyingdong
0a567c3c29 change the default NETDB_DNSCLIENT_MAXRESPONSE to the standard length
the size of the dns response buffer
https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-respsize-12

Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-08-29 09:44:37 +08:00
fangxinyong
946ede865d signal: add siginterrupt implementation
https://pubs.opengroup.org/onlinepubs/9699919799/functions/siginterrupt.html

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-29 09:43:42 +08:00