Commit Graph

49509 Commits

Author SHA1 Message Date
raiden00pl
5f814b1da8 arch/{nrf52|nrf53}/Kconfig: hide SPI_MASTER options if SPI_MASTER not enabled 2023-05-31 22:28:50 +03:00
raiden00pl
81b0ae064c arch/{nrf52|nrf53}/Kconfig: hide I2C_MASTER options if I2C_MASTER not enabled 2023-05-31 22:28:50 +03:00
raiden00pl
a3b91bc183 arch/{nrf52|nrf53}/Kconfig: hide PWM options if PWM not enabled 2023-05-31 22:28:50 +03:00
Ville Juven
7c2930c3df mpfs/mpfs_corespi: Optimize TX / RX FIFO handling
Remove unnecessary reading of the status register when loading / unloading
the FIFOs. Reading from the IP block is slow due to BUS synchronization and
this basically makes the SPI busy loop for no reason at all, destroying the
CPU usage.

The overall benefit of these changes is approx. 25%-points, which is a
MASSIVE improvement.
2023-05-31 15:52:56 -03:00
Ville Juven
fc5e8ff8f8 mpfs/CoreSPI: Fix bug when waiting for last character to arrive
The logic for rx_fifo_empty is wrong, needs a loop for the retry to work
2023-05-31 15:52:56 -03:00
Jukka Laitinen
8d646fc49c arch/risc-v/src/mpfs/mpfs_corespi.c: Fix the usage of MPFS_CORESPI_INSTANCES macro
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-05-31 15:52:56 -03:00
Ville Juven
4b6166548b mpfs/mpfs_corespi: Add Kconfig for instance/irq offsets
Also change the defaults
2023-05-31 15:52:56 -03:00
Ville Juven
223cc6d1f4 mpfs/corespi: Add driver for CoreSPI
Adds a driver for an FPGA fabric / CoreSPI implementation.

Supports multiple instances, assuming they reside in some base address,
offsettable by a constant value.
2023-05-31 15:52:56 -03:00
raiden00pl
2d56197792 arch/{nrf52|nrf53}: validate if EasyDMA transfer is possible
Add an interface that validate if EasyDMA transfer is possible.
EasyDMA cannot access flash memory which can cause hard to detect silent bugs.
This feature is enabled if CONFIG_DEBUG_FEATURES=y and CONFIG_DEBUG_ASSERTIONS=y.
2023-06-01 00:40:17 +08:00
raiden00pl
58ad290b0e boards/nrf5340-dk: add MCUboot configurations for the app core
Added configurations:
- mcuboot_loader_cpuapp - MCUboot loader
- mcuboot_app_cpuapp - MCUboot compatible application.
  Needs to be signed manually:
    imgtool.py sign nuttx.hex nuttx_img.hex --align 8 -v 1.0.0 -H 0x200 -S 0x70000 --pad-header --pad
2023-05-31 23:12:21 +08:00
raiden00pl
d0942f5cb3 nrf53: add MCUboot support 2023-05-31 23:12:21 +08:00
raiden00pl
b98acb9a44 arch/nrf53: add progmem support 2023-05-31 23:12:21 +08:00
raiden00pl
ebfd0b22f9 boards/nrf53: unify linker scripts
Unify linker scripts:
- use the same name for linker scripts
- merge RPTUN linker scripts with standard linker scripts
2023-05-31 23:12:21 +08:00
anjiahao
e6506619ac mempool:Fix seqnumber statistics error in memdump
The judgment of seqmin and seqmax is ignored

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-05-31 23:00:16 +08:00
Ville Juven
d566b7e2c7 mpfs_usb: Add mpfs_vbus_detect
External function to query vbus status. Reading from the block requires
the clock, but if no devices are open -> vbus detect does not work.

This creates a chicken / egg problem, if vbus detect is used to start
the usb device.
2023-05-31 22:59:25 +08:00
Filipe Cavalcanti
3fea2923d7 arch/arm/src/tiva: start FPU before gpio config 2023-05-31 22:47:55 +08:00
yinshengkai
aad2f97587 mm: Dump all memory blocks on allocation failure
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-05-31 15:24:25 +08:00
xucheng5
484d349fe3 driver/mtd : check args for nvs read
mtd_config_fs: check configdata before use

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-05-31 15:24:14 +08:00
raiden00pl
37cdfeed9b boards/nrf52840-dk: add MCUboot configurations
Added configurations:
- mcuboot_loader - MCUboot loader
- mcuboot_app - MCUboot compatible application.
  Needs to be signed manually:
    imgtool.py sign nuttx.hex nuttx_img.hex --align 8 -v 1.0.0 -H 0x200 -S 0x30000 --pad-header --pad
2023-05-31 10:44:08 +08:00
raiden00pl
3c0ce99c01 boards/nrf52832-dk: add MCUboot configurations
Added configurations:
- mcuboot_loader - MCUboot loader
- mcuboot_loader_minimal - MCUboot loader optimised for FLASH usage.
  Further optimization can be achieved by CONFIG_LTO_FULL=y.
- mcuboot_app - MCUboot compatible application.
  Needs to be signed manually:
  imgtool.py sign nuttx.hex nuttx_img.hex --align 8 -v 1.0.0 -H 0x200 -S 0x30000 --pad-header --pad
2023-05-31 10:44:08 +08:00
raiden00pl
1facea635b nrf52: add MCUboot support 2023-05-31 10:44:08 +08:00
raiden00pl
4650c9f756 Documentation: move boards/nrf52 readmes to Documentation 2023-05-30 19:25:30 -07:00
raiden00pl
da4c7703db Documentation: move boards/nrf53 readmes to Documentation 2023-05-30 19:25:30 -07:00
anjiahao
045b9ffd54 mempool:fix bug read out of bounds when realloc
fix kasan report

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-05-30 23:12:07 +08:00
Jukka Laitinen
f24ab22b76 arch/risc-v/src/mpfs: Modify mpfs_i2c.c to support arbitrary number of FPGA I2C blocks
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-05-30 23:02:19 +08:00
chao an
090a52c5fb elf/coredump: alignment stack buffer to 64 to match gdb request
Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-30 23:00:23 +08:00
chao an
589d4a9f8e net/semantic/parser: fix compile warning found by sparse
Reference:
https://linux.die.net/man/1/sparse

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-30 23:00:00 +08:00
chao an
fb9b41221d semantic/parser: fix compile warning found by sparse
Reference:
https://linux.die.net/man/1/sparse

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-30 23:00:00 +08:00
paolovolpi
f875db41d4 drivers/can/mcp2515.c Use SPIDEV_CANBUS(config->devid) instead of SPIDEV_CANBUS(0) 2023-05-30 11:48:13 +03:00
chao an
c470ef7c9c net/socket: fix kconfig warning
warning: (NET_SOLINGER) selects NET_UDP_NOTIFIER which has unmet direct dependencies
  (NET && NET_UDP && !NET_UDP_NO_STACK && SCHED_WORKQUEUE)

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-30 16:06:17 +08:00
ligd
1a927a6cf3 mm: add invalid pid dump when malloc failed
We can dump the memory that has exited but
has not been released

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-05-30 02:19:59 +08:00
anjiahao
70cb62e2a3 Support when malloc failed dump mempool info
Replaced the previous implementation method to
maintain unity with the heap dump

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-05-29 15:29:31 +02:00
Eero Nurkkala
059d02a231 risc-v/mpfs: i2c-fpga: fix complex transactions
bmp388 works poorly as the system fires STOPs even in
a beginning of a transaction. Don't let unrelated STOPs
to distort the data flow.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-05-29 20:45:01 +08:00
Eero Nurkkala
816b971e70 risc-v/mpfs: i2c: add more FPGA i2cs
This adds 2 more FPGA I2Cs. Also rework the indexing
so that it matches the earlier work without major changes.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-05-29 20:45:01 +08:00
Eero Nurkkala
53b58b0881 risc-v/mpfs: i2c: fix an FPGA known issue
This fixes the following issue:
  - After sending the address, the driver writes an extra zero

Without this patch, the extra write causes an extra ACK that would
terminate the sequence prematurely. This is observed as data read
corruption.

With this fix, the condition is detected precisely. That being the
case, the sequence is continued with a repeated start, after which
the read continues normally.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-05-29 20:45:01 +08:00
Eero Nurkkala
a0bde84c9a risc-v/mpfs: integrate fpga i2c driver
This incorporates an fpga i2c driver into the existing i2c driver.
This fpga i2c works almost 100% as the MSS i2c, but the difference
is that the fpga driver terminates all transactions with a stop
sent -interrupt. That needs to be handled.

Fpga clock source is also different, act accordingly.

SEC2TICK(10) is an overkill to any app, use just one second instead.

modifyreg32s are simplified as well, no need to clear and set
as set is enough.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-05-29 20:45:01 +08:00
Jani Paalijarvi
0fefc43458 mpfs: i2c: Fix reset and interrupt issues
I2C status register reset value (0xf8) was not handled properly causing unnecessary bus resets.
Added critical section to mpfs_i2c_reset() and removed unnecessary interrupt disabling elsewhere.
2023-05-29 20:45:01 +08:00
Zhe Weng
7d1b733202 net/tcp: Add flag for tcp_close to avoid double free
Problem:
When tcp_close_work starts to run in LPWORK, if another event comes and
calls tcp_free before tcp_close_work takes net_lock, the tcp_free will
be called twice and cause double free.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-05-29 13:00:06 +02:00
Michal Lenc
f4d409b3e5 boards/samv7/common: add type member to mtd_partition_s structure
Board related code may use different mounts for MTD device (block
character for one, SmartFS for another) if required by the board.
Additional type member was therefore added to mtd_partition_s structure
in order to support this.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-05-29 13:50:34 +03:00
Xiang Xiao
dde8ae468e fs/partition: register partition device if caller doesn't provide handler
to avoid the duplication of common logic

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-27 20:23:17 -03:00
Xiang Xiao
5528c84c03 fs/partition: MBR parser should initialize blocksize field
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-27 20:23:17 -03:00
Roberto Bucher
547e0a051f DIR/Complementary PWM possible on PE08 and PE10 2023-05-27 20:22:01 -03:00
Roy Feng
bcd776b2a7 Fix build issues for ESP32 SoftAP mode 2023-05-27 23:54:55 +09:00
raiden00pl
20af03b31e arch/{nrf52|nrf53}/usbd: fix IN endpoint completion logic
Confirmation of the IN request must be done immediately after all data has been transferred,
otherwise sending data when more than one request has been added to the queue will
not work properly.
2023-05-27 18:52:16 +08:00
Michal Lenc
5f5ffa9380 fix compile warnings caused by incorrect variable format in print
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-05-27 18:52:01 +08:00
wangbowen6
4a8331a019 openamp: virtio.h add version field in device id table struct
Add new patch 0019, this patch is used to support the legacy virtio
mmio trasport.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-05-27 18:51:04 +08:00
hujun5
d70d406161 libc/fdsan: add fdsan protection for all file pointers
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-27 15:05:44 +08:00
Dong Heng
97d2d6376d xtensa/esp32s3: SPI slave driver 2023-05-27 14:11:36 +08:00
TimJTi
27fb0c76c9 SAMA5D2, improve LCD support 2023-05-27 14:03:51 +08:00
Michael Jung
2e27698d6c SLIP: Switch to poll based design
This is a refactored version of the SLIP network driver.  Updates
include:

1. The original design started two kernel threads per SLIP device.
   The refactored version uses file_poll to essentially be driven
   by the UART RX and TX interrupts and pushes work to the low
   priority work queue.

2. The SLIP byte un-/stuffing is more efficient now, using memcpy
   instead of handling each byte individually.

3. The switch of the old SLIP driver to IOBs caused buffer overwrites
   if packets were sent that would not fit into a single IOB.  This is
   fixed now.

Signed-off-by: Michael Jung <michael.jung@secore.ly>
2023-05-26 19:57:57 -03:00