Commit Graph

5889 Commits

Author SHA1 Message Date
chenrun1
d19486e1f8 driver/filemtd:support isbad & markbad
In this change, we can mount a filesystem on filemtd that works like Yaffs and works on the Nand driver

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-07 18:50:00 +08:00
chenrun1
4fc111965d filemtd:fix Fixed the issue of incorrect content returned when using nandflash earse
Nand_erase return result should be the number of blocks that were successfully erased in NuttX

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-07 18:50:00 +08:00
Michal Lenc
17e1d43f6d ioexpander/icjx: add support for change of input interrupts on NINT
iC-JX expander has NINT (not interrupt) pin that goes to logical zero
if interrupt occurs. This commit adds support for iC-JX options settings
that allows to enable the interrupt for defined input pins.

The interrupt is handled in HP worker thread to avoid waiting for SPI
transfers in interrupt context. Board has to configure interrupt event
for GPIO pin connected to NINT.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-04-05 15:23:10 -03:00
chenwen@espressif.com
252e0f8a97 drivers/net/lan9250: Fix crash issue of sending packets by lan9250 driver under SMP and multi-thread
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-04-03 10:06:43 -03:00
Yanfeng Liu
1eb96c3446 virtio/gpu: minor revision on virtio_gpu_send_cmd()
This revises comments and completes reclaiming buf param.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-01 00:27:16 +08:00
Yanfeng Liu
715f8de1bb virtio/cmake: sync with makefile system
This adds drivers like virtio-gpu etc to cmake system to be in line
with the makefile system.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-31 08:04:47 -03:00
SPRESENSE
d5c654914e drivers/video/isx019: Fix default_value of 3A status
Fix default_value of ioctl(VIDIOC_QUERYCTRL)(id=V4L2_CID_3A_STATUS)
to AE operating and AWB operating, because both AE and AWB are
automatical adjustment mode by default.
2024-03-29 16:05:37 +08:00
SPRESENSE
33485cfe7c drivers/video/isx019: Fix the default_value of some parameters
Because the exposure time and ISO sensitivity are adjusted automatically
by default, the default value can not be defined.
So, return the value out of range as the default_value of
ioctl(VIDIOC_QUERYCTRL).
2024-03-26 20:52:28 +08:00
Xiang Xiao
79f834dcbb video: Make v4l2_ops_s to support the mutilple context
which is useful in the m2m usage scenario, by replacing the first
argument of callback from "struct v4l2_ops_s *" to "struct file *"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-26 15:21:05 +08:00
Xiang Xiao
c6821c741d video_framebuff: Replace critical section with spinlock
to avoid th global big lock and improve the performance.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-26 15:21:05 +08:00
Xiang Xiao
0db82210fd video_framebuff: Hold mutex in video_framebuff_realloc_container
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-26 15:21:05 +08:00
Xiang Xiao
efee5f86e8 video_framebuff: Remove the unnecessary vbuf_curr field
since vbuf_curr is always equal to vbuf_next

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-26 15:21:05 +08:00
yaojingwei
25e7d9e43e video: add video buffer overflow warning info.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2024-03-26 15:21:05 +08:00
shizhenghui
fa1b55d297 v4l2-cap: Add FAR to pointer
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-03-26 15:21:05 +08:00
yaojingwei
f03a1a14f3 video: move user define mem_ops into imgdata_ops.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2024-03-26 15:21:05 +08:00
yaojingwei
64aecbcc5c video: add user define memory ops for v4l2 frame buffers.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2024-03-26 15:21:05 +08:00
SPRESENSE
1d2fcc81f4 drivers/video/isx012: Make the I2C access more efficient
Store the i2c configuration in power on
because they are not changed permanently.
2024-03-26 07:41:21 +01:00
SPRESENSE
d9f9c0143c drivers/video/isx019: Make the I2C access more efficient
Store the length of address and the frequency in power on
because they are not changed permanently.
2024-03-26 07:41:21 +01:00
ligd
a1836de09a fdt: move fdx_xx extend APIs from boards to drivers
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-22 18:51:33 +08:00
zhanghongyu
a65cdce281 cdcecm: remove duplicate assignment statements
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-03-21 20:06:13 +08:00
shizhenghui
3afd26bcd1 Add ioctl interface used in v4l2m2m
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-03-21 19:23:53 +08:00
chao an
feb6ede434 sched/cpu: replace up_cpu_index() to this_cpu()
In SMP mode, up_cpu_index()/this_cpu() are the same, both return the index of the physical core.
In AMP mode, up_cpu_index() will return the index of the physical core, and this_cpu() will always return 0

| #ifdef CONFIG_SMP
| #  define this_cpu()             up_cpu_index()
| #elif defined(CONFIG_AMP)
| #  define this_cpu()             (0)
| #else
| #  define this_cpu()             (0)
| #endif

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-21 18:52:35 +08:00
chao an
4e62d0005a sched: replace some global variables to macro
replace to macro will help to extend the scheduling implementation

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-21 18:51:25 +08:00
Michal Lenc
7c7e163e23 icjx: add support for multiple pin read/write
This commit implements functions icjx_multireadpin and icjx_multiwritepin.
These functions can be used for multiple pin access (read/write) if
CONFIG_IOEXPANDER_MULTIPIN is selected. This access is generally
faster than one by one pin and may simplify user application.

Changes to general functions icjx_read and icjx_write were also required
to provide support for multiple data send/receive.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-03-20 20:06:33 +08:00
Radek Pesina
8f9c337c66 drivers/can/sja1000: Add SJA1000 CAN driver support
This driver is based on ESP32 TWAI CAN drivers currently available
in Nuttx, and captures the differences currently present across the
TWAI drivers for easy future adaption to remaining ESP32 platforms
with no loss of support/function. Also provides a generic SJA1000 CAN
driver solution that is CPU-architecture independent.

Changes:
- Low-level driver re-written to allow usage independent of CPU
architecture, and support both SJA1000 and TWAI CAN controllers.
- Platform-specific settings abstracted away to be provided by board
layer.
- Support for multiple instances of SJA1000 driver.
2024-03-19 15:45:53 -03:00
raiden00pl
8bf6b17cc0 sensors/bmi270: fix accel and gyro data position
accel registers are DATA_8 to DATA_13
gyro registers are DATA_14 to DATA_19
2024-03-14 21:16:46 -03:00
dongjiuzhu1
e0c18c05e8 fs/driver: using nx_unlink to call unlink ops to release some resource
if driver complete unlink ops, we need to call it to release some resource,
otherwise, it will only remove inode.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-03-14 11:53:30 +08:00
xucheng5
3b79363041 mtd_config_fs : optimize nvs
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2024-03-14 00:11:41 +08:00
xucheng5
cd80900646 mtd_config_fs : support algin size
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2024-03-14 00:11:41 +08:00
zhanghongyu
e93bdfe089 tun: in tun_write, try to release iob before iob_prepare
io_pktlen will incorrect when two packets are received in a row and the packet length decreases.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-03-13 22:23:52 +08:00
shizhenghui
255090d594 Refactor nuttx v4l2
Adjust the v4l2 framework to support both capture and v4l2m2m,
and can easily add other v4l2 features.

Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-03-13 09:51:08 +08:00
yaojingwei
c3a3f79741 video: extend imgsensor_s interface for getting sensor device params.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2024-03-13 09:51:08 +08:00
SPRESENSE
bac0228825 drivers/video/isx012: Fix buffer overrun of isx012_putreg()
The maximum size of ISX012 register is 4 bytes.
So, extend temporary buffer size.

Detected by CodeSonar 141893
2024-03-11 15:44:39 +01:00
SPRESENSE
3419f018a4 drivers/video/isx019: Delete unnecessary code
Because of misunderstanding spec, unnecessary codes exist.
Delete them.
2024-03-11 15:44:39 +01:00
SPRESENSE
baa2dc5cad drivers/video/isx019: Store initial gamma value
Set initial gamma value to enable application to get
the correct initial gamma value.
2024-03-11 15:44:39 +01:00
SPRESENSE
2b04210b16 drivers/video/isx019: Fix default ISO sensitivity
ISX019's ISO sensitivity is in auto adjustment mode by default.
Then, default ISO sensitivity value should be auto adjusted value.
2024-03-11 15:44:39 +01:00
SPRESENSE
ae970a8ed3 drivers/video: Fix bug that can not use scene mode
Because the mode is set in scene parameter table,
All scene modes was recognized as disabled.
2024-03-11 15:44:39 +01:00
SPRESENSE
8f0ed67339 drivers/video/isx019: Fix mismatch bug of HUE value
Because the ratio between API value and ISX019 register value
is 128 : 90 about HUE, some different API values become the
same register value.
So, store the value specified by application in setting,
and return the stored value in getting so that the gotten value
is the same as the setting value by application.
2024-03-11 15:44:39 +01:00
SPRESENSE
de3bee313e drivers/video/isx019: Fix control type about some parameters
About IMGSENSOR_ID_EXPOSURE_AUTO, IMGSENSOR_ID_ISO_SENSITIVITY_AUTO,
and IMGSENSOR_ID_EXPOSURE_METERING, enumerations are defined.
So, control type should be not integer but integer menu.
2024-03-11 15:44:39 +01:00
SPRESENSE
865c88e34b drivers/video: Add elems setting
Add elems setting to ioctl(VIDIOC_QUERY_EXT_CTRL)
for V4L2 compatibility.
2024-03-11 15:44:39 +01:00
SPRESENSE
fd5c2d4922 drivers/video/isx019: Fix bug that read value is not correct
About parameter whose register size is less than 4 bytes,
when transfer read value to API parameter, cast appropriately
to avoid the following problems.
- Read value includes garbage value
- Negative value becomes huge positive value
2024-03-11 15:44:39 +01:00
SPRESENSE
33f7923d72 drivers/video/isx019: Fix bug that initial exposure time is not correct
Because exposure time calculation needs the cxd56xx clock value,
get the cxd56xx clock value before saving initial value.
2024-03-11 15:44:39 +01:00
SPRESENSE
76e91a69f7 drivers/video/isx019: Fix maximum value of exposure time
Modify maximum value of exposure time from 102000 to 2740
according to hardware specification.
2024-03-11 15:44:39 +01:00
SPRESENSE
dc82022769 drivers/video/isx019: Fix control type of some parameters
Fix control type of some parameters according to specification.
2024-03-11 15:44:39 +01:00
SPRESENSE
fdf9f00952 drivers/video/isx012: Fix control type of some parameters
Fix control type of some parameters according to specification.
2024-03-11 15:44:39 +01:00
SPRESENSE
f1bc6aada3 drivers/video/isx019: Fix supported ISO sensitivity
Support not continuous values but discrete values.
2024-03-11 15:44:39 +01:00
SPRESENSE
75a0a08a4d drivers/video: Modify control id definition
Modify control id definition to avoid duplication even if
the control ids belong to the same control class.
Also, not refer to control class in driver.
2024-03-11 15:44:39 +01:00
raiden00pl
79e8aa5e21 sensors: add uorb support for lsm9ds1 2024-03-09 11:53:57 +08:00
Xiang Xiao
1ba065db87 drivers/pipe: Change to the block mode by file_ioctl(FIONBIO)
it's simpler and safer than file_fcntl(F_SETFL)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-07 10:09:35 -03:00
Jorge Guzman
4b5ad956c3 stm32h7/linum-stm32h753bi: Add support to eeprom using the i2c3
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-03-07 01:55:56 +08:00
chao an
0902231deb drivers/sensors: fix comments typo
Signed-off-by: chao an <anchao@lixiang.com>
2024-03-05 22:25:28 +08:00
Saurav Pal
1bec133385 drivers/mtd/mtd_nandram: Adds virtual NAND Flash device simulator.
Adds virtual NAND Flash device simulator, NAND flash log wrapper, and documentation for it.

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-03-04 10:38:08 -03:00
ligd
661d382322 syslog_rpmsg: handle syslog_rpmsg_transfer() return value
in case of only update head

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-03 02:14:28 +08:00
Michał Łyszczek
768e533123 drivers/analog/hx711.c: fix tare calculation
Taring was done with user defined sign, which later resulted in tare
being "resigned" twice. Because of that taring was workign correctly
for one sign, and not the other.

Fix it to disable user sign when tarring, and tare always without
changing sign.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2024-03-03 01:56:40 +08:00
Michał Łyszczek
459b4434b1 drivers/analog/hx711.c: fix averaging on negative values
ptype of ((int32_t)0 * (uint32_t)0) is (unsigned). "i" counter was
declared unsigned to not make comparision with "unsigned char" in for loop.
This resulted in calculation in average to be implicitly casted to unsigned,
and when negative number was added to it, it turned into huge value.

Change type of "i" to signed, and just cast (unsigned char) to (int)
to fix this.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2024-03-03 01:56:40 +08:00
chao an
6d50274ebe nuttx/list: rename container_of to list_container_of from public header
Use private naming to avoid conflicts with user applications

In file included from libuv/src/unix/internal.h:25,
                 from libuv/src/unix/udp.c:23:
libuv/src/uv-common.h:57: warning: "container_of" redefined
   57 | #define container_of(ptr, type, member) \
      |
In file included from nuttx/include/nuttx/list.h:47,
                 from nuttx/include/nuttx/tls.h:40,
                 from nuttx/include/nuttx/sched.h:48,
                 from nuttx/include/nuttx/arch.h:87,
                 from nuttx/include/nuttx/userspace.h:35,
                 from nuttx/include/nuttx/mm/mm.h:30,
                 from nuttx/include/nuttx/kmalloc.h:34,
                 from nuttx/include/nuttx/lib/lib.h:31,
                 from nuttx/include/stdio.h:35,
                 from apps/system/libuv/libuv/include/uv.h:59,
                 from libuv/src/unix/udp.c:22:
nuttx/include/nuttx/nuttx.h:48: note: this is the location of the previous definition
   48 | #define container_of(ptr, type, member) \
      |

Signed-off-by: chao an <anchao@lixiang.com>
2024-02-29 19:44:54 +08:00
raiden00pl
547342ca50 sensors/bmi160: fix compilation errors
fix compilation errors about undefined reference to `bmi160_configspi'
2024-02-27 13:01:32 +01:00
SPRESENSE
9d4da42aa8 driver/alt1250: Modify return value
Use macro for retrurn value.
2024-02-27 13:16:52 +08:00
SPRESENSE
6915fab2f7 driver/alt1250: Notice instance information
Notice instance information of LwM2M server operation to application.
2024-02-27 13:16:52 +08:00
Michał Łyszczek
84a2cab886 drivers/analog/hx711.c: Add driver for hx711 adc
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2024-02-26 19:16:51 -03:00
wangyongrong
be4875ed30 rptun ioctl: remove rptun_panic and rptun_dump_all
In the previous patch, we moved rptun_panic and rptun_dump_all in rptun to rpmsg.
In order to ensure CI pass, this two API in rptun is not removed. So we remove rptun_panic and rptun_dump_all in this patch.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-02-21 21:38:05 -08:00
simonatoaca
bb6f32d610 esp32-sparrow-kit: Add I2S support for the board's microphone
The board's microphone uses 24-bit i2s and this commit also fixes
the segmentation fault caused by the audio buffer overflow.

arch/xtensa/src/esp32/esp32_i2s.c: Fix bug regarding 24-bit audio and add AUDIOIOC_STOP to ioctl
drivers/audio/audio_i2s.c: Report number of channels on AUDIOIOC_GETCAPS
in boards/xtensa/esp32/esp32-sparrow-kit:
	/configs/nsh/defconfig: Add I2S configs
	/src/esp32-sparrow-kit.h: Add the signature of esp32_i2sdev_initialize()
	/src/esp32_bringup.c: Add call to esp32_i2sdev_initialize()

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>
2024-02-20 06:46:06 -08:00
Xiang Xiao
2e91c07ca7 Remove the back slash from long literal string
since the back slash is only needed for the long macro definition

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-02-19 16:43:15 +01:00
Bowen Wang
8bf8e21614 rptun: should initialize the vring da when da == 0 || da == -1
Be compatible with Linux, Linux remoteproc will init the vring.da
when da == FW_RSC_U32_ADDR_ANY

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-02-19 05:01:46 -08:00
wangyongrong
10a8c2be92 rptun ioctl: Strip rpmsg ioctl and rptun ioctl.
rptun ioctl only handle RPTUNIOC_START, RPTUNIOC_STOP, RPTUNIOC_RESET,
rpmsg ioctl handles the public ioctl commands part.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-02-19 02:15:45 -08:00
wangyongrong
6d27c12c57 rptun dump: move rptun_dump.c to rptun.c, remove redundant code.
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-02-18 20:35:40 -08:00
Bowen Wang
ca22e95577 virtio: move metal_init to the virtio_register_drivers()
Only call metal_init() once for virtio framework

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-02-18 04:09:44 -08:00
Bowen Wang
fcfd5e8ebf rpmsg/Kconfig: add rpmsg_local_name to replace rptun_local_name
Because rpmsg service depends on RPMSG, make rpmsg socket use the
RPMSG_LOCAL_NAME

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-02-18 04:09:34 -08:00
Bowen Wang
169f47beec rpmsg: make all the rpmsg services deponds on RPMSG
After decoupled the rpmsg and rptun, all the rpmsg service should
depends on the RPMSG.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-02-18 04:09:34 -08:00
raiden00pl
1d94b2159c mrf24j40: add support for IEEE802154_ATTR_PHY_REGDUMP 2024-02-17 05:00:27 -08:00
Xiang Xiao
42dad89211 rpmsg/ping: Replace UINT_MAX with CLOCK_MAX
since clock_t may map to either 32-bit or 64-bit integer type,
UINT_MAX may not be the maximum value of clock_t.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-02-16 22:16:31 +02:00
Yanfeng Liu
87ad1196e1 rptun/rptun_initialize: add explicit initialization for variable
This explicitly initializes variable `onceinit` before use.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-02-14 10:50:48 -05:00
Yanfeng Liu
b258680949 rpmsg/rpmsg_ping: tenative fix for build issue
rpmsg_ping.c is blocking CI checks for RPTUN related patches like #11673.
this patch simply fix the compilation issue of rpmsg_ping.c:

- line 191: overflow conversion from "long unsigned int" to "unsigned int"
- line 226: "sendlen" used uninitialized

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-02-08 12:38:21 -03:00
SPRESENSE
eaba1bef1e drivers/modem/alt1250: Add LTE_CMDID_RESTARTAPI command
ALT1250 driver sends an event named LTE_CMDID_RESTARTAPI
to ALT1250 daemon when state is PM_NOARMAL in the function
of prepare registered by pm_register.
2024-02-07 22:19:03 -08:00
chao an
5424ace1cf compiler/tasking: fix compiler warning on tasking
ctc W549: ["serial/serial.c" 877/37] condition is always true
ctc W549: ["inode/fs_inodesearch.c" 72/8] condition is always true
ctc W545: ["obstack/lib_obstack_malloc.c" 69/1] missing 'return'
ctc W545: ["obstack/lib_obstack_malloc.c" 82/1] missing 'return'

Signed-off-by: chao an <anchao@lixiang.com>
2024-01-31 05:02:56 -08:00
SPRESENSE
ea5210bd40 drivers/sensor: delete warning about argument type in bmi160
Remove warning due to variable type difference in format.
2024-01-31 05:00:23 -08:00
chao an
8ff97f6210 compiler/tasking: fix unreachable code on tasking toolchain
ctc W544: ["serial/serial.c" 284/3] unreachable code
ctc W544: ["vfs/fs_lseek.c" 96/13] unreachable code
ctc W544: ["wqueue/kwork_thread.c" 210/32] unreachable code
ctc W544: ["stdio/lib_fopen.c" 327/19] unreachable code
ctc W544: ["stdio/lib_fopen.c" 404/13] unreachable code
ctc W544: ["string/lib_strcasestr.c" 120/3] unreachable code
ctc W544: ["unistd/lib_getopt_common.c" 156/21] unreachable code
ctc W544: ["unistd/lib_getopt_common.c" 216/21] unreachable code
ctc W544: ["wctype/lib_iswctype.c" 155/3] unreachable code

Signed-off-by: chao an <anchao@lixiang.com>
2024-01-30 20:53:00 -08:00
wangyongrong
ce832c6377 rptun_ping: Strip rptun_ping out of rptun and rename to rpmsg_ping
It should be possible to use ping without rptun being enabled, so striped rptun_ping out of rptun and rename to rpmsg_ping.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-30 04:08:59 -08:00
raiden00pl
60807efc85 mrf24j40: always use SPI MODE(0,0)
Other SPI modes are not supported. From doc:

  "The MRF24J40 supports SPI (mode 0,0) which requires
  that SCK idles in a low state."
2024-01-28 09:46:16 -08:00
raiden00pl
32df0dbbaa mrf24j40/Kconfig: add missing IEEE802154_MRF24J40_FREQUENCY option 2024-01-28 09:46:16 -08:00
wangyongrong
5651612f45 rptun: extract rptun char to rpmsg/rpmsg.c
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-26 00:42:28 -08:00
raiden00pl
a12fdd8876 cosmetic changes after pci code rebase 2024-01-25 09:09:30 -08:00
raiden00pl
2e758f33ee fix various compilation errors after pci code rebase 2024-01-25 09:09:30 -08:00
Brennan Ashton
69ed5bb67d Various fixes for PCI work
Squashed commits:

1. Porting prior PCI work in place of jailhouse code

At this point the PCI enumeration works for x86_64 including over
pci-pci bridges.

Running QEMU with this configuration we see the bridge and the
device on the bridge.  It also detected the qemu test device

qemu-system-x86_64 \
  -cpu host,+pcid,+x2apic,+tsc-deadline,+xsave,+rdrand \
  --enable-kvm -smp 1 -m 2G -cdrom boot.iso --nographic -no-reboot \
  -device pci-testdev \
  -device pci-bridge,id=bridge0,chassis_nr=2 \
  -device e1000,bus=bridge0,addr=0x3

qemu_pci_init: Initializing PCI Bus
pci_probe_device: [00:00.0] Found 8086:1237, class/revision 06000002
pci_probe_device: [00:01.1] Found 8086:7010, class/revision 01018000
pci_probe_device: [00:01.2] Found ffff:ffff, class/revision ffffffff
pci_probe_device: [00:01.3] Found 8086:7113, class/revision 06800003
pci_probe_device: [00:01.4] Found ffff:ffff, class/revision ffffffff
pci_probe_device: [00:01.5] Found ffff:ffff, class/revision ffffffff
pci_probe_device: [00:01.6] Found ffff:ffff, class/revision ffffffff
pci_probe_device: [00:01.7] Found ffff:ffff, class/revision ffffffff
pci_probe_device: [00:02.0] Found 1234:1111, class/revision 03000002
pci_probe_device: [00:03.0] Found 8086:100e, class/revision 02000003
pci_probe_device: [00:04.0] Found 1b36:0005, class/revision 00ff0000
pci_probe_device: [00:04.0] Probing
pci_check_pci_bridge: [00:05.0] Found Bridge
pci_probe_device: [01:03.0] Found 8086:100e, class/revision 02000003
pci_probe_device: [00:05.0] Found 1b36:0001, class/revision 06040000

2. Remove unused CONFIG_PCI_MAX_BDF option

3. Add a workaround for Jailhouse pci scanning

4. Extend BAR parsing and handle PIO and MMIO for pci-testdev

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

5. PCI: Add initial support for QEMU 'edu' test device

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

6. Bring up PCI later in boot process

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

7. Add ISR and DMA support to QEMU edu test pci device

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

8. Fix bad function prototype definition in qemu_edu

9. intel64:  Add a pci test configuration and instructions

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>

10. PCI: Fix issue in identification of 64bit bar

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2024-01-25 09:09:30 -08:00
Yang Chung-Fan
18f97bf2f8 pcie: add framework
Squashed commits:

1. x86_64: qemu: implement pci-e functions and enumerate pci-e devices on boot

2. virt: add qemu pci-testdev driver

3. pcie: types array should be null terminated

4. pcie: enable don't take flags, hardcoded enabling flags

5. pcie: checking bar > 4 for 64bit bars are sufficient

6. pcie: qemu: remove not used header

7. pcie: qemu: return -EINVAL if buffer argument is NULL

8. pcie: make pcie enumerate routine as common instead of architecture dependent

9. pcie: cosmetic changes to fit check tools

10. pcie: create MSI/MSIX related marcos and simplify the msi/msix routines
2024-01-25 09:09:30 -08:00
wangyongrong
5018964155 rpmsgfs: decoupling rpmsgfs server and rpmsg virtio.
create a new general api to make rpmsgfs work with virtio/spi/uart transport.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-24 06:52:13 -08:00
xuchaojie
cefb170ea7 bcmf_driver:wlan interface status reset by unsolicited wpa packet
Avoid incorrect NIC flag Settings

Signed-off-by: xuchaojie <xuchaojie@xiaomi.com>
2024-01-24 20:18:40 +08:00
Michal Lenc
22110b3b83 ioexpander: add support for iC-JX expander
This commit adds basic support for iC-JX expander in SPI mode. The
expander is functional and supports both input and output pins. Further
expander functionalities (filtering, adc, interrupt support) are not
yet implemented.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-01-23 17:15:25 -03:00
YAMAMOTO Takashi
81996900db fix build with CONFIG_SCHED_INSTRUMENTATION_FUNCTION 2024-01-22 19:30:40 +08:00
Yanfeng Liu
c3aab93e5f usb: document revision and typo fixing
This slightly revised the USB host documentation and fixed typos
encountered in the document and some source files.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-18 21:09:20 -08:00
Lwazi Dube
1c0299b687 drivers/usbhost: Update USB bluetooth driver
Miscellaneous changes addressing feedback from xiaoxiang781216.
2024-01-17 17:49:02 -08:00
Lwazi Dube
1349dcfc1f drivers/usbhost: Add a USB bluetooth driver.
This change adds support for the USB Transport Layer as described
in the bluetooth spec. Isochronous endpoints are not yet supported.
Because of limitations in the NuttX bluetooth stack, only one USB
device can be used. This driver will only allow one USB dongle to
use bluetooth.

A Laird USB BT4.2 dongle (from Mouser) was used for testing:
M/N BT851 1.0 1829, FCC ID:SQGBT850
lsusb: 04b4:f901 Cypress Semiconductor Corp. CYW20704A2

The following commands were used to test from the nsh prompt:
bt bnep0 scan start
bt bnep0 scan stop
bt bnep0 scan get
bt bnep0 info

The Linux gatttool was used to connect over wireless.

With the BDAddr found by "bt bnep0 info", start gatttool using:
gatttool -b BDAddr -I

Connect to the device using:
connect

Read the device name using the GAP device name UUID:
char-read-uuid 2a00

Part of the response is:
value: 41 70 61 63 68 65 20 4e 75 74 74 58
which is the string "Apache NuttX"
2024-01-16 16:02:15 +01:00
wangyongrong
7508a10e20 rptun: Strip rpmsg and rptun
nuttx/driver/rpmsg: new folder, extract common rpmsg api in rptun.c to rpmsg.c.
rpmsg provide rpmsg_ops to each backend for specific implementation.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-16 15:58:32 +01:00
wangyongrong
df147406db rptun_ping: decoupling rptun ping and rptun.
ping is not only rptun support, so move it to public part.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-14 23:06:51 -08:00
wangyongrong
11cefd087a rptun ping: decoupling rptun ping and rptun virtio device
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-14 23:06: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
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
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