Commit Graph

6312 Commits

Author SHA1 Message Date
wangjianyu3
d43f0272e5 Thermal: Add dummy driver
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
b30f866f80 Thermal: Add procfs file nodes
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
520e4042ce Thermal: Register pm suspend notifier
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
2f285a04f9 Thermal: Support cpufreq cooling device
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
338b5d7415 Thermal: Support step_wise governor
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
d1b87bd021 Add thermal framework
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
likun17
09ab135d2f sensor: Fixed the problem of user information lag in cross-core communication "stublist".
When its remote core publishes a message, all subscribed cores will receive the message,
but the local core "stublist" does not update the user's "generation" and "bufferpos" parameters.

Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-21 23:09:48 +08:00
likun17
bdac8c116a sensor_rpmsg.c: Fix that "stub" will be created when local core only has subscribers.
After the ap core subscribes to the 25hz batch 120ms data of the sensor core, it switches
to the cp core and subscribes to the 50hz batch 120ms sensor core data. At this time,
the data subscribed by the AP will be abnormally lost (12.5hz). Mainly because ap
subscribes to sensor core data earlier than cp. The subscription of cp will be broadcast
to the ap core at the same time, and the corresponding "path" already exists
under "/dev/uorb" of ap. Thus the ap will create a "stub".

There are some restrictions on the creation of "stub" to avoid this situation.

Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-20 22:05:58 +08:00
Shoukui Zhang
985e539e02 i2c: Optimize access to private data
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-20 13:28:03 +02:00
wangjianyu3
bdddc76997 nuttx/uorb: Fix incompatible type error
Related: b17c074a18

Log:
  Error: sensors/ms56xx_uorb.c:145:20: error: initialization of 'int (*)(struct sensor_lowerhalf_s *, struct file *, uint32_t *)' {aka 'int (*)(struct sensor_lowerhalf_s *, struct file *, unsigned int *)'} from incompatible pointer type 'int (*)(struct sensor_lowerhalf_s *, struct file *, long unsigned int *)' [-Werror=incompatible-pointer-types]
    145 |   .set_interval  = ms56xx_set_interval,
        |                    ^~~~~~~~~~~~~~~~~~~
  sensors/ms56xx_uorb.c:145:20: note: (near initialization for 'g_sensor_ops.set_interval')
  cc1: all warnings being treated as errors

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 19:54:38 +08:00
wangjianyu3
3ab62370cb nuttx/uorb: Fix initialization error of variable of type struct sensor_ops_s
Related change:
  .flush    : 403469336f
  .get_info : 703bb7e7b3

Error Log:
  1153  Building NuttX...
  1154Error: sensors/bme680_uorb.c:428:3: error: initialization of 'int (*)(struct sensor_lowerhalf_s *, struct file *, long unsigned int)' from incompatible pointer type 'int (*)(struct sensor_lowerhalf_s *, struct file *, int,  long unsigned int)' [-Werror=incompatible-pointer-types]
  1155  428 |   bme680_control    /* control */
  1156      |   ^~~~~~~~~~~~~~

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 19:54:38 +08:00
wanggang26
f6c1d88931 mmcsd: fix a build error
Error: mmcsd/mmcsd_sdio.c:1419:12: error: 'mmcsd_setblockcount' defined
but not used [-Werror=unused-function]
1172 1419 | static int mmcsd_setblockcount(FAR struct mmcsd_state_s
*priv,

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-19 15:44:59 +08:00
wanggang26
1a6e8b9c99 mmcsd: fix a logic error
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-19 07:29:33 +02:00
wangjianyu3
d2b58a520e sensor.c: Rename container_of to list_container_of
https://github.com/apache/nuttx/pull/11805

Log:
    /github/workspace/sources/nuttx/drivers/sensors/usensor.c: In function 'usensor_get_info':
    Warning: /github/workspace/sources/nuttx/drivers/sensors/usensor.c:228:44: warning: implicit declaration of function 'container_of'; did you mean 'list_container_of'? [-Wimplicit-function-declaration]
      228 |   FAR struct usensor_lowerhalf_s *ulower = container_of(lower,
          |                                            ^~~~~~~~~~~~
          |                                            list_container_of
    Error: /github/workspace/sources/nuttx/drivers/sensors/usensor.c:229:44: error: expected expression before 'struct'
      229 |                                            struct usensor_lowerhalf_s,
          |                                            ^~~~~~
    /github/workspace/sources/nuttx/drivers/sensors/usensor.c: In function 'usensor_control':
    Error: /github/workspace/sources/nuttx/drivers/sensors/usensor.c:241:44: error: expected expression before 'struct'
      241 |                                            struct usensor_lowerhalf_s,
          |                                            ^~~~~~

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 11:45:11 +08:00
Petro Karashchenko
549ad08013 can/sja1000: drop driver dependency on __builtin functions
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-09-19 09:39:04 +08:00
Shoukui Zhang
5d3d123272 BCH: Add readonly configuration for BCH devices
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-19 03:53:20 +08:00
wangjianyu3
607b8effe9 driver/sensors: Let gnss geofence follow the existing naming rules
ORB_ID(sensor_gnss_geofence_event)

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
ffac2a314b driver/sensors: Support GNSS Geofence
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
bf83b3fafc driver/sensors: Support GNSS Measurement & Clock
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
e830db0316 driver/sensors: Add constellation for GNSS
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
c652f41c87 nuttx/uorb: Rename GPS to GNSS
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
dongjiuzhu1
b17c074a18 nuttx/uorb: change unsigned long to uint32 to fix size issue
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 03:44:49 +08:00
dongjiuzhu1
abbd9c7da9 drivers/sensors: Limit notification events to user
1. notify POLLIN to reader.
2. notify POLLPRI to writer,
in addition, notify POLLPRI to the user who completed the flush .

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 03:44:49 +08:00
dongjiuzhu1
403469336f driver/sensors: support sensor flush operation
Supports the flush operation of the sensor.

The application can initiate a flush action through ioctl SNIOC_FLUSH
to trigger flush, and the call will be returned immediately.
Using SNIOC_GET_EVENTS to clear flush event,

However, the flush implementation is asynchronous, when all the flush
data is push to upper circbuffer, the POLLPRI event(FLUSH_COMPLETED)
will be reported.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 03:44:49 +08:00
likun17
703bb7e7b3 sensor.c: Added new interface for obtaining and setting sensor device information.
When there is an actual physical sensor, the driver must implement the get info interface. The upper layer can obtain the actual physical sensor information through SNIOC_GET_INFO.
SNIOC_SET_INFO can only set the information of the local virtual sensor, which means it is bound to the local advertisement. Remote subscribers cannot set the information.

Usage:
  struct sensor_device_info dev_info;
  orb_ioctl(fd, SNIOC_GET_INFO, (unsigned long)(uintptr_t)&dev_info);

  or:
  ret = orb_set_info(fd, &dev_info);
  ret = orb_get_info(fd, &dev_info);

Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-19 03:44:49 +08:00
dongjiuzhu1
c0674b34d6 sensors/gps: using config to adjust gps recv size
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 03:44:49 +08:00
wanggang26
ff0194fb74 mmcsd: make a compatibility change for cmd12 and cmd23
For some sd cards don't support cmd23 or support cmd23 indicated by
bit33 in scr

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-19 03:17:48 +08:00
p-szafonimateusz
545774eb88 serial/pci_16550: make sure that interrupts are disabled during init
Make sure that interrups are disabled during initialization.
This is a proper fix for an unexpected MSI interrupt for PCI serial driver.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-18 23:54:12 +08:00
simbit18
583f025422 Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
Replace help => ---help---
2024-09-17 22:16:41 +08:00
dongjiuzhu1
d4bbbe0d0b drivers/pty: support pty write to send signal, like serial driver
The interaction between the shell service in adb and adbd occurs through a pseudo-terminal (pty).
so, when a command is launched through adb shell from a PC, users now have the ability to pause
or kill the launched,application by inputting specific commands CONFIG_TTY_SIGTSTP_CHAR or
CONFIG_TTY_SIGTINT_CHAR, akin to the capabilities provided by nsh.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-17 20:11:10 +08:00
Shoukui Zhang
43223124ec vfs/file: add reference counting to prevent accidental close during reading writing...
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-17 12:01:53 +08:00
dongjiuzhu1
1d5f43664d driver/pinctl: add pinctrl framework
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-17 02:25:47 +08:00
wanggang26
f6d378e528 enable O_CLOEXEC explicitly to avoid fd leak
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-17 02:07:34 +08:00
liaoao
4d35c60ba6 rpmsg_port_spi: set mreq to high to trigger next transmission
rpmsg_port_spi_connect can not be used here because peer may have not finished
the last transmission which will keep the sreq gpio in high level, and it will
read an error data frame.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
88e0aeaad4 rpmsg_port_spi/slave: reorder rpmsg_port_initialize and rpmsg_port_spi_init hardware
Because the data transmision may has been started before
rpmsg_port_initialize(), this should be not allowed.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
1f6ba6c7a7 rpmsg_port_spi: add pending logic for rpmsg port spi
To handle the situation that there is a req from peer side when
current transfer is not finished.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
896f02bd67 rpmsg_port_spi: add nbits to spicfg
Support more spi config paramters for Rpmsg Port SPI/SPI Slave

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
d724ddce0b rpmsg_port_spi: discard messages when disconnected
Disconnected logic optimization

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
yintao
968da8b781 drivers/rpmsg: Add edge_create and edge_destroy for router
use cmd to notify the other cpu to destroy router edge device,
and dont destroy the other cpu's "router:ept"

Signed-off-by: yintao <yintao@xiaomi.com>
2024-09-17 01:55:51 +08:00
Bowen Wang
76572f9892 rpmsg/rpmsg_port_uart: add rpmsg uart port driver
Rpmsg Port Uart is a new rpmsg transport layer.
Just like the rpmsg port spi, the difference is that the physical
communication method changed from SPI to UART.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
4827063958 rpmsg_port_spi: add spi slave support
The rpmsg port spi slave version support

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
89ce5d5e02 rpmsg_port_spi: add get_local_cpuname api
add get_local_cpuname ops for rpmsg_port_spi

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
6a6fc8d883 rpmsg_port_spi:init cs gpio to be low
Transfer will be failure when the cs gpio status is low before
the first transfer.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
yintao
6e55812e59 drivers/rpmsg: Add get_local_cpuname in router
get_local_cpuname ops support for rpmsg router

Signed-off-by: yintao <yintao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
4a356f6f6d rpmsg_port_spi: do not decrease when rx avail is already 0
Bug fix about the rpmsg port spi

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
yintao
3fb39c6fc9 drivers/rpmsg: Use optimal rx size and tx size
Use the minimal tx and rx size form two edge cpu to maintain
the transmit buffer size not exceed the edge cpus' buffer size.

[edg0] tx <---> rx0 [hub] rx1 <---> tx [edge1]
       rx <---> tx0       tx1 <---> rx

edge0_tx = min(rx0, tx1);
edge0_rx = min(tx0, rx1);

edge1_tx = min(rx1, tx0);
edge1_rx = min(tx1, rx0);

Signed-off-by: yintao <yintao@xiaomi.com>
2024-09-17 01:55:51 +08:00
Bowen Wang
ab47465dd5 drivers/rpmsg: add get_local_cpuname to rpmsg ops
Add get_local_cpuname to the rpmsg framework ops to support communicate
with the same remote core with multi rpmsg transport.

Some rpmsg services will send local cpu name to remote core and then let
remote core to connect local core by using this cpu name, when there are
multi rpmsg channels with same remote core, the remote core may connect
to incorrect core, so use the error rpmsg channel.

For example, there are two rpmsg channels between ap and audio:

ap core                     audio core
 [ap1] <-- rpmsg virtio1 --> [audio1]
 [ap2] <-- rpmsg virtio2 --> [audio2]

When we want to use the rpmsg virtio1 to communicate, ap core may send
local cpuname "ap2" to audio, so the audio core use remote cpu "ap2" to
connect with ap, and resulting in the use of incorrect rpmsg channel.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-17 01:55:51 +08:00
yintao
7bc7369102 drivers/rpmsg: Use tx buffer size as payload length
Directly use tx length received from hub as the tx payload length.

Signed-off-by: yintao <yintao@xiaomi.com>
2024-09-17 01:55:51 +08:00
yintao
7c933874e8 drivers/rpmsg: add rpmsg router support
Rpmsg Router is new rpmsg transport layer, it can router the rpmsg
messages to a cpu that not directly connected with local cpu by Rpmsg,
For the rpmsg services, it is as if there is a real Rpmsg Channel between
the local cpu and the remote cpu.

For examples, there are three cpus: ap, cp and audio.
ap and cp, ap and audio has share memory and be connected by Rpmsg VirtIO,
so ap and cp, ap and audio can communicate with each other by Rpmsg, but
cp can not communicate with audio direclty.

[cp] <-- rpmsg virtio --> [ap] <-- rpmsg virtio --> [audio]

With rpmsg router, the cp can communicate with audip by Rpmsg dereclty because
the router in ap will forward the rpmsg message from cp/audio to audio/cp, like
this:

 +<----- rpmsg router --> hub  <-- rpmsg router ------>+
 |                         |                           |
[cp] <-- rpmsg virtio --> [ap] <-- rpmsg virtio --> [audio]

Signed-off-by: yintao <yintao@xiaomi.com>
2024-09-17 01:55:51 +08:00
Bowen Wang
a662c7aab3 rpmsg/rpmsg_port: judge notify_rx_free and notify_tx_ready before calling
Some lower layers do not need implement these two operations, so judge
them before calling.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-17 01:55:51 +08:00
Bowen Wang
d27a9c516f rpmsg/Kconfig: move RPMSG_PORT outside RPMSG and select RPMSG direclty
All the RPMSG transport should direcly select the RPMSG like RPMSG_VIRTIO
does.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
f7939a8081 rpmsg_port_spi: add spi transport layer
Add Rpmsg-Port-SPI transport layer.
Rpmsg Port SPI is a new rpmsg transport layer based on the Rpmsg Port,
it provides the capability for two SPI-connected (and two extra GPIO)
chips to communicate with each other using Rpmsg.

All already implemented Rpmsg Services can be used with this new transport
layer without any modifications.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
dd66a6b203 rpmsg_port:reduce len and avail of rpmsg_port_header_s to uint16_t
uint16_t is enough and more suitable

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
3d6abb1d86 rpmsg_port:add rpmsg_port_queue_nused api
Add nused api for lower layer to get the used buffer number

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
6d604ec487 rpmsg: add physical transport layer support
Rpmsg Physical Transport Layer is a new rpmsg transport, it's a
common part for the physical communication based rpmsg transport
layers such as Rpmsg-SPI and Rpmsg-Uart.

It implements three common parts:
1. Implement the NuttX and OpenAMP rpmsg frameworks' ops and the
rpmsg name service;
2. The buffer management and provide some APIs to lower layer to use;

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
p-szafonimateusz
1e212981b9 drivers/net: add support for Intel I225 network card
add support for Intel I225 network card

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-17 01:42:38 +08:00
p-szafonimateusz
bc0c7b0db3 drivers/net: add Intel e1000 network card support
add Intel e1000 network card support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-17 01:42:38 +08:00
p-szafonimateusz
8723aa7125 drivers: fix gcc14 errors for virtio
fix gcc14 errors for virtio

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-16 11:25:40 -03:00
dongjiuzhu1
a9bc198bc3 composite.c warning
usbdev/composite.c:649:36: warning: implicit declaration of function 'board_usbdev_pid' [-Wimplicit-function-declaration]
649 | uint16_t pid = board_usbdev_pid(); usbdev/composite.c:650:36: warning: implicit declaration of function 'board_usbdev_vid'
[-Wimplicit-function-declaration] 650 | uint16_t vid = board_usbdev_vid();

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-16 10:33:01 +08:00
dongjiuzhu1
e0d82fdf3a drivers/usedev: remove unnecessary mdelay because remain req info had beed push to serial buffer
this mdelay causes cpu busy wait, affects other process running.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-16 10:33:01 +08:00
dongjiuzhu1
1a69d3c6ee cdcacm: Add cdcacm bulkout request buffer config
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-16 10:33:01 +08:00
wanggang26
702068e62c ftl: should pre-allocate eblock for car case
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-16 10:25:36 +08:00
dongjiuzhu1
97d684847b drivers/reset: support rpmsg reset
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-15 20:21:41 +08:00
Masayuki Ishikawa
df298c186f Revert "build depend:Revert Make.dep intermediate ddc file"
This reverts commit ddc3119c4e.
2024-09-15 19:29:47 +08:00
liwenxiang1
868b17bc5a misc/goldfish: Compatible with x86_64 goldfish pipe
x86_64 uses 4-5G virtual addresses, we need to convert them into physical addresses and pass them to qemu, otherwise qemu will fail to map

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-09-15 19:28:55 +08:00
Xiang Xiao
908cd1b10a misc/goldfish_pipe: Refine the implementation
1.Merge goldfish_pipe_qemu.h into goldfish_pipe.c
2.Change all enum to macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-09-15 19:28:55 +08:00
yangguangcai
12ecfe365f driver/goldfish_pipe:remove pipe interrupt task delay.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-09-15 19:28:55 +08:00
zhanghu5
9642d8dae6 fix goldfish_pipe poll error
when multiple processes call poll and a event occured,
all the processes are waked up. it should wake up one
process based on pipe->id

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-09-15 19:28:55 +08:00
Shanmin Zhang
e793a741cc goldfish_pipe: Fix pointer-to-int-cast warning
Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2024-09-15 19:28:55 +08:00
rongyichang
69af7eef54 drivers/goldfish_pipe: notify poll event in interrupt task
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2024-09-15 19:28:55 +08:00
zhanghu5
3fd404a4c5 fds pointer not initialized cause dereference error
Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-09-15 19:28:55 +08:00
rongyichang
ce6382cc0c drivers/misc: enable irq for goldfish pipe
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2024-09-15 19:28:55 +08:00
zhanghu5
2ce2844480 drivers/misc: support nuttx goldfish_pipe
Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-09-15 19:28:55 +08:00
dongjiuzhu1
1bad603fe7 drivers/gpio: save memory if dont support signal
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-15 11:29:55 +08:00
dongjiuzhu1
28815fb7c5 drivers/gpio: add poll function for gpio device
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-15 11:29:55 +08:00
xuxin19
ec99359812 cmake:add mtd driver dhara cmake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-15 10:29:21 +08:00
xuxin19
a3e7fee595 cmake:add missing libc regex CMake support
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-15 10:29:21 +08:00
wangjianyu3
1af4cdf500 driver/ftl: Read the consecutive eraseblocks
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:21:45 +08:00
wangjianyu3
a6080e4502 Revert "driver/ftl: Read the current eraseblock only"
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:21:45 +08:00
wangjianyu3
c40f9b8d9f driver/ftl: Read the current eraseblock only
case: The next eraseblock is bad

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:21:45 +08:00
wangjianyu3
b2221806cb rpmsgdev_server: Support oneway polling
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:18:08 +08:00
wangjianyu3
f2ca3753dd rpmsgdev_server: Support exporting devices
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:18:08 +08:00
xuxin19
ddc3119c4e build depend:Revert Make.dep intermediate ddc file
Revert "Parallelize depend file generation"
This reverts commit d5b6ec450f.

parallel depend ddc does not significantly speed up compilation,
intermediately generated .ddc files can cause problems if compilation is interrupted unexpectedly

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-15 10:01:58 +08:00
wangjianyu3
6013591cb1 dev_mem: Fix config judgment
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 09:58:55 +08:00
wangjianyu3
3c0befbdbd dev_mem: Add config for segment regions
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 09:58:55 +08:00
wangjianyu3
9553506b1f dev_mem: Fix range and pos of region
Test:
  fastboot oem filedump /dev/mem 0 748544
  fastboot get_staged mem1.txt
  fastboot oem memdump 0x44000000 0xb6c00
  fastboot get_staged mem2.txt
  diff mem1.txt mem2.txt

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 09:58:55 +08:00
p-szafonimateusz
51909ed59f drivers: fix gcc14 errors for PCI
fix gcc14 errors for PCI

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz
8ab0785d71 drivers: add UART 16550 compatible PCI device support
add support for UART 16550 compatible PCI device.
For now we support qemu serial PCI devices and AX99100 based cards.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz
ceb2921d79 drivers: prepare 16550 UART driver to support PCI
prepare 16550 UART driver to support PCI:

- [breaking change] change argument of uart_ioctl() from `struct file *filep` to `FAR struct u16550_s *priv`
  Also fix moxart_16550.c build related to this change

- [breaking change] change argument of uart_getreg() and uart_putreg from `uart_addrwidth_t base` to `FAR struct u16550_s *priv`
  Also fix arch/x86/src/qemu/qemu_serial.c and arch/x86_64/src/intel64/intel64_serial.c related to this change

- [breaking change] change argument of uart_dmachan() from `uart_addrwidth_t base` to `FAR struct u16550_s *priv`

- move `struct u16550_s` to public header

- generalize UART_XXX_OFFSET so we can use it with any register increment

- make u16550_bind(), u16550_interrupt(), u16550_interrupt() public

- remove arch/or1k/src/common/or1k_uart.c and use common 16550 MIMO interfacve

- change irq type in `struct u16550_s` from uint8_t to int to match MSI API

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz
c7e8fd43a4 drivers/uart_16550: configure MCR_OUT2 bit from Kconfig
move MCR_OUT2 configuration from qemu-intel64/src/qemu_boot.c to common code
also leave this option disabled for qemu-intel64 as it's not required

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz
a0e00b993a intel64: register PCI controller early but postpone PCI drivers init
Some of PCI drivers require OS interfaces that can't be executed in the INIT context.
In that case we have to postpone PCI drivers probing and call it for example
in board initialization logic.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz
393ed71d81 pci_drivers.c: initialize ret to avoid compiler warnings
initialize ret to avoid compiler warnings in pci_drivers.c

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
Xiang Xiao
1d586c3bee pci: Add driver_data to pci_device_id_s
so driver writer could save the private data here
and get it back in the probe function.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-09-15 03:37:58 +08:00
wangyongrong
639843ade3 virtio-pci: fix set virtio device features error
Should assgin back the feature to the vdev->features

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-15 02:22:16 +08:00
wangyongrong
b0d70b76cb virtio-pci.c: polling mode support
1. Some platforms do not support interrupt mode (PCI_MSI/MSIX),
so add polling mode support, so these platforms can also use virtio-pci;
2. In some cases, we do not want to use the interrupt for virtio driver
to avoid time jitter, so add the polling mode support;
3. If CONFIG_DRIVERS_VIRTIO_PCI_POLLING_PERIOD <= 0, interrupt mode.
   if CONFIG_DRIVERS_VIRTIO_PCI_POLLING_PERIOD > 0, polling mode.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-15 02:22:16 +08:00
wangyongrong
ee6bc2e7df virtio-pci: extract common part of virtio pci modern and leagcy
Extrace common part of virtio pci modern and legacy to virtio-pci to
reduce the duplicated code.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-15 02:22:16 +08:00
wangyongrong
d54d07b62c virtio-pci: add virtio pci legacy support
Follow the virtio spec, support the virtio pci Legacy

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
Signed-off-by: andi <andi6@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-15 02:22:16 +08:00
wangyongrong
decfc9ad65 virtio-pci-modern: replace pci_read/write_mmio_xxx with pci_read/write_io_xxx
Use IO api to access the io region

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-15 02:22:16 +08:00
wangyongrong
877e462990 vitrio-pci.c: add virtio-pci transport support for Nuttx
1. only support pci modern device;
2. need the pci controller support MSI/MSI-X;
It has been verified based on virtio-rng and virtio-net.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-15 02:22:16 +08:00
yintao
38af7001b6 drivers/rpmsg: fix the race condtion about rpmsg_device_created
xxx_rpmsg_device_created may be called repeatedly.

rptun thread				app thread

rptun_dev_start				xxx_rpmsg_init

...					rpmsg_register_callback
priv->...= rpmsg_ns_unbind;
priv->..= rptun_notify_wait;
					if (ns_unbind_cb)
(switch app thread)				device_created()
						xxx_rpmsg_device_created

					metal_list_add_tail(g_cb);
...
rpmsg_device_created();
	cb->device_created
	xxx_rpmsg_device_created;

Signed-off-by: yintao <yintao@xiaomi.com>
2024-09-14 17:34:52 +08:00