Commit Graph

43795 Commits

Author SHA1 Message Date
Alexander Lunev
8be9cb9f72 net/tcp/sendfile: notify the device driver of the availability of TX data on TCP retransmission
(as well as on sending normal TCP packets).
2022-01-26 02:01:25 +08:00
Alexander Lunev
7e748e63dd net/tcp/tcp_sendfile: optimized out sendfile_txnotify() function 2022-01-26 02:01:06 +08:00
Huang Qi
4b6ca9432b board/Board.mk: Make romfs_img 4 byte aligned
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-01-25 14:49:12 +01:00
Xiang Xiao
bc2dd37051 drivers/timers: Add weak_function for up_ function
so the user could replace the implementation if need

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-25 13:35:05 +01:00
chao.an
e781787cb9 sched/critmonitor: remove the assertion if counter == 0
Perf timer interface generally uses the hardware cycle counter
provided by the arch chip directly(such as DWT_CYCCNT(cortex-m)),
CYCCNT is a free running counter and counting upwards.
It wraps around to 0 on overflow.

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-25 20:24:58 +08:00
Petro Karashchenko
48211f90d3 ci: select ARMV7A_TOOLCHAIN_GNU_EABIL for ARMv7-A based builds
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-25 20:24:28 +08:00
Ville Juven
fc3cd308d5 Wipe the PMP configuration in MPFS bootloader start routine
This way old PMP configurations are removed upon warm reset.
2022-01-25 20:22:34 +08:00
Ville Juven
81188d9c94 Extend the RISC-V PMP functionality
- Add test for mode support, which is architecture dependent
- Add tests for address alignment and region size
- Add option to query for access rights
 - The function goes through every PMP entry and tests if an address
   range from [base, base+size] has been configured for desired
   access rights.
 - If several PMP entries match the range and access rights, the
   information is combined
 - End result is either no access, a partial match was found, or a full
   match was found. Details about the partial match are not provided.

The intent for testing access rights and not just blindly applying them
is a case where they are already set in e.g. a bootloader. In this
case, nothing should be done, unless the configuration does not match,
in which case the software must not continue further.
2022-01-25 20:22:34 +08:00
Ville Juven
8a4881c4e5 Implement CONFIG_BUILD_PROTECTED with MMU
NOTE: THIS ONLY WORKS WHEN KERNEL RUNS IN M-MODE FOR NOW

This frees the PMP for other use, e.g. HART memory separation.

The page tables are statically allocated, 1 per level.

This feature is now behind CONFIG_MPFS_USE_MMU_AS_MPU, because
only the MPFS target supports this (others are not tested).

If the MMU is used for memory separation within a HART, the PMP must
still be configured to allow user access to the memory mapped for the
HART, because PMP *rekoves* access by default. At this point all of
the user memory as well as the kernel RAM are opened.

A more flexible solution for PMP configuration will follow.
2022-01-25 20:22:34 +08:00
Ville Juven
7eb726d57f Add proper user/kernel space linker scripts for knsh target
The old implementation used the default ld.script for the kernel side
which did not obey the memory.ld limits whatsoever.

Also, provide the user space addresses from the linker script to get rid
of the pre-processor macros that define (incorrect) default values for
the user space composition.
2022-01-25 20:22:34 +08:00
Ville Juven
356ae984ac Add knsh target for icicle
Template for knsh target (e.g. protected build with user space nsh)

Requires MPU and linker script updates to work
2022-01-25 20:22:34 +08:00
Ville Juven
3fa0834e7d Fix PROTECTED_BUILD build errors for mpfs target
Userspace struct definition did not have pthread_startup
The definition for up_pthread_exit was not compiled ever
2022-01-25 20:22:34 +08:00
Alexander Lunev
ad25c43983 net/tcp/sendfile: fast retransmit on duplicate acknowledgments (RFC 5681).
(the same as it was implemented in tcp_send_unbuffered.c)
2022-01-25 16:30:38 +08:00
Xiang Xiao
a24ae559c2 arch: Decouple up_critmon_[gettime|convert] from critmon
and rename to up_perf_[gettime|convert] since it's useful in other case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-25 14:43:34 +08:00
Masayuki Ishikawa
7b1cf2dfac arch: arm: Fix make export for armv7-a SoCs
Summary:
- I noticed that make export does not work with swama5d4-ek:knsh
- This commit fixes this issue.
- NOTE: apps/Makefile also needs to be updated.

Impact:
- CONFIG_BUILD_KERNEL=y only

Testing:
- Build (make and make export) with sama5d4-ek:knsh

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-01-25 11:05:22 +08:00
Jukka Laitinen
49085eebae arch/risc-v/src: Cleanups for opensbi
- remove some unneeded includes
- tab/space fixes
- change DEBUGPANIC to PANIC in noreturn function, otherwise it compiles only in DEBUG builds

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-25 00:10:46 +08:00
Jukka Laitinen
5bb3936212 arch/risc-v/src/opensbi: Update 3rd party opensbi version into Make.defs
This fixes build errors with more strict compiler settings

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-25 00:10:46 +08:00
Jukka Laitinen
8a6d62423d Revert "risc-v/mpfs: switch to NuttX types for opensbi"
This reverts commit d611e2d99b.
2022-01-25 00:10:46 +08:00
chao.an
c50d39060b drivers/sensors: fix Kconfig warning
drivers/sensors/Kconfig:590:warning: defaults for choice values not supported

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-24 23:52:56 +08:00
zhuyanlin
dde241f306 libxx:uclibxx: add patch use overload constructor of filebuf & ostream
overload constructor of filebuf & ostream in uclibxx

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-01-24 23:26:59 +08:00
Eero Nurkkala
eb462a2eb3 risc-v/mpfs: configure harts according to CONFIG_MPFS_HART*_SBI
The following options need to be taken in account while determining
the proper hart_index2id -table:
  CONFIG_MPFS_HART1_SBI
  CONFIG_MPFS_HART1_SBI
  CONFIG_MPFS_HART3_SBI
  CONFIG_MPFS_HART4_SBI

Unused harts should be marked with -1. Hart0 is never used so it
stays at -1.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-01-24 23:25:53 +08:00
Eero Nurkkala
e5a9ba5602 risc-v/mpfs: opensbi defconfig: refresh config
Some of the configuration options have changed, so update this
config file accordingly.

In this example config, the following hart configuration takes
place:
  hart1: 0xafb00000 (Another NuttX)
  hart2: unused
  hart3: 0x80200000 (u-boot and Linux kernel)
  hart4: 0x80200000 (u-boot and Linux kernel)

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-01-24 23:25:53 +08:00
Alan Rosenthal
35905302d3 Cleanup boards/Makefile
Changes:
There was logic in `tools/Config.mk` which was duplicated in `boards/Makefile`.
This PR removes the duplicated logic in boards/Makefile
2022-01-24 11:17:55 +08:00
Alan C. Assis
31b1fd5c89 stm32f4discovery: Add support to MS5611 2022-01-24 10:23:45 +08:00
Alan C. Assis
eb39b3a189 esp32-devkitc: Add support to MS5611 2022-01-24 10:23:45 +08:00
Alan C. Assis
d8163803d1 sensors: Add support to MS5611 Barometer 2022-01-24 10:23:45 +08:00
Alan C. Assis
d664385784 Move MS58xx CRC-4 to include/ it will be used by other sensors 2022-01-24 10:23:45 +08:00
Petro Karashchenko
48c7fa6e92 boards/arm/samv7/common: add HSMCI0 boot mount configuration option
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-24 01:08:20 +01:00
Petro Karashchenko
c0881feca9 boards/arm/samv7/same70-qmtech: fix description in README.txt
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-23 20:08:10 -03:00
Petro Karashchenko
311f351da5 boards/arm/samv7/same70-qmtech: enable slow crystal
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-23 22:00:45 +01:00
Huang Qi
71d3ff1045 arch/risc-v: Remove g_serial_ok
`WFI` is enough to wait the ready signal from master core,
so we can remove it.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-01-23 18:28:37 +08:00
Huang Qi
422e005183 arch/risc-v: Move xxx_cpustart.c to common
It's a common solution for MSIP and IPI based risc-v smp soc,
also works on qemu-rv smp (WIP).

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-01-23 18:28:37 +08:00
Norman Rasmussen
da5659138b Fix regression where used code was marked as unused
Commit 5d1a444812 replaced __attribute__
((unused)) with unused_code but two instances of __attribute__ ((used))
were also incorrectly replaced. Add used_code/used_data and used them
instead.
2022-01-23 14:57:19 +08:00
raiden00pl
4c2dd3924a include/nuttx/can.h: rename CAN_ERR_CTRL to CAN_ERR_CRTL for compatibility with libcanutils 2022-01-23 01:34:34 +08:00
raiden00pl
7d39642561 include/nuttx/can.h: make SocketCAN error definitions always available 2022-01-23 01:34:34 +08:00
Petro Karashchenko
6c27f3c19d toolchain: add libm to EXTRA_LIBS only if it is provided by the compiler
Some toolchains may be built without libm support, but using
such toochain should not generate any errors in case if math
functions are not used in the program

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-22 15:36:29 +08:00
Alexander Lunev
f73abc76d5 sim/netdev: retrieve all the queued RX frames from the network device on every poll.
As a result, the RX throughput is increased significantly w/o harming the TX throughput.
2022-01-22 15:34:58 +08:00
Xu Xingliang
021363f1db driver/mmcsd: add option to limit block count in multiple-block transfer mode.
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2022-01-22 14:59:26 +08:00
Petro Karashchenko
d611e2d99b risc-v/mpfs: switch to NuttX types for opensbi
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-22 14:58:56 +08:00
Petro Karashchenko
ea177faaf6 boards/same70-qmtech: clarify usage of CD signal on SD card connector
By default SAME70_QMTECH board does not have CD signal routed to
SAME70.  The HW rework can be done to enable CD signal.  Clarify
description of SD card connector.
Change configuration of CD pin to get auto unmount work correctly

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-22 14:57:36 +08:00
Huang Qi
b803919b9d arch/risc-v: Merge mcause.h into irq.h
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-01-22 14:57:05 +08:00
Alexander Lunev
eec94132c4 net/tcp/sendfile: removed excessive overwrites of conn->sndseq
(conn->sndseq was updated in multiple places that was unreasonable and complicated).
This optimization is the same as it was done for tcp_send_unbuffered.
2022-01-22 00:43:53 +08:00
Jukka Laitinen
9061c92ec8 arch/risc-v/src/mpfs: Make each hart entry configurable for bootloader
Add two config flags for each hart for a bootloader nuttx:

CONFIG_MPFS_HARTx_SBI :
- select whether the hart boots via opensbi or not.

CONFIG_MPFS_HARTx_ENTRYPOINT :
- the target address to jump to, either directly from startup code or
  from SBI if CONFIG_MPFS_HARTx_SBI is set

This allows building a nuttx based bootloader application, which can load
different applications/OSs for individual harts and jump to those

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-22 00:43:05 +08:00
Jukka Laitinen
36b73fd0a3 arch/risc-v/src/mpfs/mpfs_opensbi.c: Ensure stack alignment of 16 bytes
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-22 00:43:05 +08:00
Alexander Lunev
338b122b2b net/tcp/sendfile: fixed an issue with unackseq calculation.
Wrong unackseq calculation locked conn->tx_unacked at non-zero values
even if all ACKs were received.
This issue is the same as it was with tcp_send_unbuffered.
2022-01-22 00:42:29 +08:00
Alexander Lunev
c9e32dd4a4 tcp: fixed warning: ISO C90 forbids mixed declarations and code 2022-01-22 00:41:42 +08:00
Eero Nurkkala
2a22c0e32d risc-v/mpfs: OpenSBI: utilize an index2id table
Hart index to hart id table is used to track unused and used harts. This
table is useful when configuring only some of the harts for OpenSBI use.
Mpfs will always have the hart0 unused, so mark it with -1.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-01-21 13:40:58 -03:00
Abdelatif Guettouche
8c582c27b8 esp32c3_irq.c: Add a comment explaining the assigment of CURRENT_REGS to
regs.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-01-22 00:38:43 +08:00
Abdelatif Guettouche
e335d44028 esp32c3_irq.c: Skip over ECALL instruction.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-01-22 00:38:43 +08:00
zouboan
a310b0952f bug patch for frexpf function 2022-01-21 13:37:37 -03:00